{
  "id": "pitfall.ed25519-rfc8032-torsion",
  "version": 1,
  "category": "integration_pitfall",
  "severity": "high",
  "lifecycleStatus": "ACTIVE",
  "lifecycle": {
    "status": "ACTIVE",
    "appliesTo": "Evergreen / Node.js OpenSSL & Crypto",
    "verifiedAt": 1795800000000,
    "reviewDueAt": 1858872000000,
    "replacedBy": "",
    "retireReason": ""
  },
  "contentOrigin": "HUMAN_ORIGINAL",
  "aiModel": "",
  "summaryEn": "Guards Ed25519 verifiers against small-order torsion public keys, malleable S >= L scalars, and X25519 SPKI confusion.",
  "match": {
    "field": "prompt",
    "containsAny": [
      "ed25519_small_order_key",
      "x25519_spki_confusion"
    ]
  },
  "actions": [
    "ALERT_USER",
    "EXPLAIN_TO_USER"
  ],
  "indicators": [],
  "knowledge": {
    "environment": "Node.js crypto / OpenSSL verifying untrusted Ed25519 public keys and signatures",
    "symptom": "Default OpenSSL verification can accept low-order torsion points or mislabeled X25519 SPKI keys if unchecked.",
    "rootCause": "Different crypto libraries disagree on strict RFC 8032 cofactored vs cofactorless verification and canonical S scalar bounds.",
    "verifiedFix": "Verify `asymmetricKeyType === 'ed25519'`, reject the 8 low-order torsion points and y >= p, and enforce canonical scalar S strictly between 0 and L before calling `crypto.verify`.",
    "verificationCheck": "Run negative crypto tests with identity point `0100..00`, `S >= L`, and an X25519 key; all must return false.",
    "commandPattern": "",
    "commandRisk": "READ_ONLY",
    "license": "CC0-1.0",
    "sourceBasis": "SELF_AUTHORED_FIX"
  },
  "playbookSha256": "af629b1482bc6fcb3c5d93d3b7fd87cb2e90e25378f591e4d1d6cb17a1702fbf",
  "snapshotSha256": "116114a19ef52fd932a20216d0c0a4136c3ef2489839d44e6e031683fb594cd2",
  "advisoryOnly": true
}
