CWE-352 / WEAKNESS
Cross-Site Request Forgery (CSRF)
The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.
- Category
- CWE weaknesses
- Version / scope
- CWE 4.20; release 2026-04-30; publisher status Stable
- Affected / relevant technologies
- Web Based / Web Server / Not Language-Specific
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
No separate exploit prerequisites are asserted here; the publisher's weakness/pattern context must be matched to the implementation.
Potential impact
Confidentiality Integrity Availability Non-Repudiation Access Control Gain Privileges or Assume Identity Bypass Protection Mechanism Read Application Data Modify Application Data DoS: Crash, Exit, or Restart The consequences will vary depending on the nature of the functionality that is vulnerable to CSRF. An attacker could trick a client into making an unintentional request to the web server via a URL, image load, XMLHttpRequest, etc., which would then be treated as an authentic request from the client - effectively performing any operations as the victim, leading to an exposure of data, unintended code execution, etc. If the victim is an administrator or privileged user, the consequences may include obtaining complete control over the web application - deleting or stealing data, uninstalling the product, or using it to launch other attacks against all of the product's users. Because the attacker has the identity of the victim, the scope of CSRF is limited only by the victim's privileges.
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: MITRE. Release: CWE 4.20; release 2026-04-30; publisher status Stable. Source checked: 2026-11-18.
Source object: CWE-352. Object modified: 2025-12-11.
Attribution and source terms (© The MITRE Corporation; reproduced with permission)Detection and investigation
- Manual Analysis This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. Specifically, manual analysis can be useful for finding this weakness, and for minimizing false positives assuming an understanding of business logic. However, it might not achieve desired code coverage within limited time constraints. For black-box analysis, if credentials are not known for privileged accounts, then the most security-critical portions of the application may not receive sufficient attention. Consider using OWASP CSRFTester to identify potential issues and aid in manual analysis. High These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
- Automated Static Analysis CSRF is currently difficult to detect reliably using automated techniques. This is because each application has its own implicit security policy that dictates which requests can be influenced by an outsider and automatically performed on behalf of a user, versus which requests require strong confidence that the user intends to make the request. For example, a keyword search of the public portion of a web site is typically expected to be encoded within a link that can be launched automatically when the user clicks on the link. Limited
- Automated Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Bytecode Weakness Analysis - including disassembler + source code weakness analysis Binary Weakness Analysis - including disassembler + source code weakness analysis SOAR Partial
- Manual Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies SOAR Partial
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- Architecture and Design Libraries or Frameworks Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. For example, use anti-CSRF packages such as the OWASP CSRFGuard. [REF-330] Another example is the ESAPI Session Management control, which includes a component for CSRF. [REF-45]
- Implementation Ensure that the application is free of cross-site scripting issues (CWE-79), because most CSRF defenses can be bypassed using attacker-controlled script.
- Architecture and Design Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330). [REF-332] Note that this can be bypassed using XSS (CWE-79).
- Architecture and Design Identify especially dangerous operations. When the user performs a dangerous operation, send a separate confirmation request to ensure that the user intended to perform that operation. Note that this can be bypassed using XSS (CWE-79).
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
No protocol-specific mapping is asserted for this entry.
Related security reading
Continue directly to another reference. Editorial reading connections do not assert official CWE/CAPEC/ATT&CK/OWASP equivalence or mappings.
Publisher-defined relationships
These directed relationships come from the pinned publisher data. They describe framework context, not guaranteed prevention, detection coverage or equivalence between entities.
Publisher weakness and attack-pattern relationships
These relationships retain the publisher's source attributes and view context; they do not establish that an attack or weakness applies to a particular system.
- CAPEC-111 → Related_Weakness → CWE-352 Open related reference
- CAPEC-462 → Related_Weakness → CWE-352 Open related reference
- CAPEC-467 → Related_Weakness → CWE-352 Open related reference
- CAPEC-62 → Related_Weakness → CWE-352 Open related reference
- CWE-1275 → CanPrecede → CWE-352 Open related reference
- CWE-352 → Related_Attack_Pattern → CAPEC-111 Open related reference
- CWE-352 → Related_Attack_Pattern → CAPEC-462 Open related reference
- CWE-352 → Related_Attack_Pattern → CAPEC-467 Open related reference
- CWE-352 → Related_Attack_Pattern → CAPEC-62 Open related reference
- CWE-352 → ChildOf → CWE-345 Open related reference
- CWE-352 → ChildOf → CWE-345 Open related reference
- CWE-352 → Requires → CWE-346 Open related reference
- CWE-352 → Requires → CWE-441 Open related reference
- CWE-352 → Requires → CWE-613 Open related reference
- CWE-352 → Requires → CWE-642 Open related reference
- CWE-79 → PeerOf → CWE-352 Open related reference
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- Publisher reference: CWE-352 — source accessed 2026-11-18
- cwe — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
