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.
/v1/cwe/{cwe-id}Cost: 1 credit per successful call
Path parameters
cwe-idintegerrequiredCWE 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
{
"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_idintegeroptionalCWE numeric identifier.
data.namestringoptionalOfficial CWE weakness name.
data.abstractionstringoptionalAbstraction level. Common values: Pillar, Class, Base, Variant, Compound.
data.structurestringoptionalWeakness structure. Common values: Simple, Composite, Chain.
data.statusstringoptionalCWE entry status. Common values: Stable, Draft, Incomplete, Deprecated.
data.descriptionstringoptionalShort description of the weakness.
data.extended_descriptionstring | nulloptionalLonger explanatory description. null when not provided.
data.likelihood_of_exploitstring | nulloptionalCWE-assigned likelihood of exploit (High, Medium, Low). null when not assigned.
data.related_weaknessesarrayoptionalRelated CWE identifiers (strings such as CWE-74).
data.applicable_platformsarrayoptionalApplicable platform objects. Each may contain a language, technology,
operating_system, or architecture key.
data.modes_of_introductionarrayoptionalLifecycle phases where the weakness is typically introduced. Each element
contains a phase and an optional note.
data.common_consequencesarrayoptionalTypical consequences. Each element contains a scope array and an
impact array.
data.detection_methodsarrayoptionalDetection techniques. Each element contains a method and a description.
data.potential_mitigationsarrayoptionalRecommended mitigations. Each element contains a phase array and a
description.
data.observed_examplesarrayoptionalReal-world examples. Each element contains a reference (CVE ID), a
description, and a link.
data.related_attack_patternsarrayoptionalRelated CAPEC attack-pattern identifiers (strings such as CAPEC-66).
data.generated_atstringoptionalISO 8601 timestamp indicating when this record was generated.
Errors
| Status | error | When |
|---|---|---|
| 400 | invalid_cwe_id | A parameter failed validation. |
| 401 | invalid_authorization | Missing or malformed Authorization header. |
| 401 | unauthorized | Invalid/revoked key, or IP not allowlisted. |
| 402 | insufficient_credits | Organisation credit balance is below 1. |
| 404 | not_found | The route or entity does not exist. |
| 405 | method_not_allowed | Only GET and OPTIONS are accepted. |
| 500 | internal | Unexpected server error (credit auto-refunded). |
See Errors for the full error reference.