API Reference

Get a CWE

Retrieve a single CWE record: name, abstraction level, structure, status, description, likelihood of exploit, related weaknesses, applicable platforms, modes of introduction, common consequences, detection methods, potential mitigations, observed examples, and related attack patterns.

GET
/v1/cwe/{cwe-id}

Cost: 1 credit per successful call

Path parameters

cwe-idintegerrequired

CWE numeric identifier. Pass the number only: 89, not CWE-89. Accepted range: 1–1500.

Request

curl https://api.precursorintelligence.com/functions/v1/cwe/89 \
  -H "Authorization: Bearer $PRECURSOR_API_KEY"

Response

200 OK
{
  "data": {
    "cwe_id": 89,
    "name": "Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')",
    "abstraction": "Base",
    "structure": "Simple",
    "status": "Stable",
    "description": "The product constructs all or part of an SQL command using externally influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command.",
    "extended_description": "Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.",
    "likelihood_of_exploit": "High",
    "related_weaknesses": ["CWE-74", "CWE-707"],
    "applicable_platforms": [
      { "language": "Any" }
    ],
    "modes_of_introduction": [
      { "phase": "Implementation", "note": "REALIZATION: This weakness is caused during implementation of an architectural security tactic." }
    ],
    "common_consequences": [
      { "scope": ["Confidentiality"], "impact": ["Read Application Data"] },
      { "scope": ["Integrity"], "impact": ["Modify Application Data"] },
      { "scope": ["Access Control"], "impact": ["Bypass Protection Mechanism"] }
    ],
    "detection_methods": [
      { "method": "Automated Static Analysis", "description": "This weakness can often be detected using automated static analysis tools." }
    ],
    "potential_mitigations": [
      { "phase": ["Architecture and Design"], "description": "Use a vetted library or framework that does not allow this weakness to occur, such as parameterized queries or prepared statements." },
      { "phase": ["Implementation"], "description": "Apply input validation to reject unexpected characters." }
    ],
    "observed_examples": [
      { "reference": "CVE-2024-3094", "description": "SQL injection via unsanitized search parameter.", "link": "https://www.cve.org/CVERecord?id=CVE-2024-3094" }
    ],
    "related_attack_patterns": ["CAPEC-66", "CAPEC-470"],
    "generated_at": "2026-05-29T10:15:00.000Z"
  },
  "meta": {
    "request_id": "8b16efb8-9a6c-4ace-b817-11cbee626d08",
    "generated_at": "2026-05-18T10:24:31.118Z",
    "credits": { "charged": 1, "remaining": 9998 }
  }
}

Response fields

data.cwe_idintegeroptional

CWE numeric identifier.

data.namestringoptional

Official CWE weakness name.

data.abstractionstringoptional

Abstraction level. Common values: Pillar, Class, Base, Variant, Compound.

data.structurestringoptional

Weakness structure. Common values: Simple, Composite, Chain.

data.statusstringoptional

CWE entry status. Common values: Stable, Draft, Incomplete, Deprecated.

data.descriptionstringoptional

Short description of the weakness.

data.extended_descriptionstring | nulloptional

Longer explanatory description. null when not provided.

data.likelihood_of_exploitstring | nulloptional

CWE-assigned likelihood of exploit (High, Medium, Low). null when not assigned.

data.related_weaknessesarrayoptional

Related CWE identifiers (strings such as CWE-74).

data.applicable_platformsarrayoptional

Applicable platform objects. Each may contain a language, technology, operating_system, or architecture key.

data.modes_of_introductionarrayoptional

Lifecycle phases where the weakness is typically introduced. Each element contains a phase and an optional note.

data.common_consequencesarrayoptional

Typical consequences. Each element contains a scope array and an impact array.

data.detection_methodsarrayoptional

Detection techniques. Each element contains a method and a description.

data.potential_mitigationsarrayoptional

Recommended mitigations. Each element contains a phase array and a description.

data.observed_examplesarrayoptional

Real-world examples. Each element contains a reference (CVE ID), a description, and a link.

data.related_attack_patternsarrayoptional

Related CAPEC attack-pattern identifiers (strings such as CAPEC-66).

data.generated_atstringoptional

ISO 8601 timestamp indicating when this record was generated.

Errors

StatuserrorWhen
400invalid_cwe_idA parameter failed validation.
401invalid_authorizationMissing or malformed Authorization header.
401unauthorizedInvalid/revoked key, or IP not allowlisted.
402insufficient_creditsOrganisation credit balance is below 1.
404not_foundThe route or entity does not exist.
405method_not_allowedOnly GET and OPTIONS are accepted.
500internalUnexpected server error (credit auto-refunded).

See Errors for the full error reference.