Detalle CWE-352

CWE-352

Cross-Site Request Forgery (CSRF)
Medio
Stable
2006-07-19
00h00 +00:00
2025-12-11
00h00 +00:00
Notificaciones para un CWE
Manténgase informado sobre cualquier cambio en un CWE específico.
Gestionar notificaciones

Nombre: 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.

Informaciones generales

Modos de introducción

Architecture and Design : REALIZATION: This weakness is caused during implementation of an architectural security tactic.

Plataformas aplicables

Lenguaje

Class: Not Language-Specific (Undetermined)

Tecnologías

Class: Web Based (Undetermined)
Name: Web Server (Undetermined)

Consecuencias comunes

Alcance Impacto Probabilidad
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

Note: 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.

Ejemplos observados

Referencias Descripción

CVE-2004-1703

Add user accounts via a URL in an img tag

CVE-2004-1995

Add user accounts via a URL in an img tag

CVE-2004-1967

Arbitrary code execution by specifying the code in a crafted img tag or URL

CVE-2004-1842

Gain administrative privileges via a URL in an img tag

CVE-2005-1947

Delete a victim's information via a URL or an img tag

CVE-2005-2059

Change another user's settings via a URL or an img tag

CVE-2005-1674

Perform actions as administrator via a URL or an img tag

CVE-2009-3520

modify password for the administrator

CVE-2009-3022

CMS allows modification of configuration via CSRF attack against the administrator

CVE-2009-3759

web interface allows password changes or stopping a virtual machine via CSRF

Mitigaciones potenciales

Phases : Architecture and Design
Phases : 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.
Phases : 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]
Phases : 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.
Phases : Architecture and Design
Phases : Architecture and Design
Do not use the GET method for any request that triggers a state change.
Phases : Implementation
Check the HTTP Referer header to see if the request originated from an expected page. This could break legitimate functionality, because users or proxies may have disabled sending the Referer for privacy reasons.

Métodos de detección

Manual Analysis

Efectividad : High

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.
Efectividad : Limited

Automated Static Analysis - Binary or Bytecode

Efectividad : SOAR Partial

Manual Static Analysis - Binary or Bytecode

Efectividad : SOAR Partial

Dynamic Analysis with Automated Results Interpretation

Efectividad : High

Dynamic Analysis with Manual Results Interpretation

Efectividad : High

Manual Static Analysis - Source Code

Efectividad : SOAR Partial

Automated Static Analysis - Source Code

Efectividad : SOAR Partial

Architecture or Design Review

Efectividad : SOAR Partial

Notas de mapeo de vulnerabilidades

Justificación : This is a well-known Composite of multiple weaknesses that must all occur simultaneously, although it is attack-oriented in nature.
Comentario : While attack-oriented composites are supported in CWE, they have not been a focus of research. There is a chance that future research or CWE scope clarifications will change or deprecate them. Perform root-cause analysis to determine if other weaknesses allow CSRF attacks to occur, and map to those weaknesses. For example, predictable CSRF tokens might allow bypass of CSRF protection mechanisms; if this occurs, they might be better characterized as randomness/predictability weaknesses.

Patrones de ataque relacionados

CAPEC-ID Nombre del patrón de ataque
CAPEC-111 JSON Hijacking (aka JavaScript Hijacking)
An attacker targets a system that uses JavaScript Object Notation (JSON) as a transport mechanism between the client and the server (common in Web 2.0 systems using AJAX) to steal possibly confidential information transmitted from the server back to the client inside the JSON object by taking advantage of the loophole in the browser's Same Origin Policy that does not prohibit JavaScript from one website to be included and executed in the context of another website.
CAPEC-462 Cross-Domain Search Timing
An attacker initiates cross domain HTTP / GET requests and times the server responses. The timing of these responses may leak important information on what is happening on the server. Browser's same origin policy prevents the attacker from directly reading the server responses (in the absence of any other weaknesses), but does not prevent the attacker from timing the responses to requests that the attacker issued cross domain.
CAPEC-467 Cross Site Identification
An attacker harvests identifying information about a victim via an active session that the victim's browser has with a social networking site. A victim may have the social networking site open in one tab or perhaps is simply using the "remember me" feature to keep their session with the social networking site active. An attacker induces a payload to execute in the victim's browser that transparently to the victim initiates a request to the social networking site (e.g., via available social network site APIs) to retrieve identifying information about a victim. While some of this information may be public, the attacker is able to harvest this information in context and may use it for further attacks on the user (e.g., spear phishing).
CAPEC-62 Cross Site Request Forgery
An attacker crafts malicious web links and distributes them (via web pages, email, etc.), typically in a targeted manner, hoping to induce users to click on the link and execute the malicious action against some third-party application. If successful, the action embedded in the malicious link will be processed and accepted by the targeted application with the users' privilege level. This type of attack leverages the persistence and implicit trust placed in user session cookies by many web applications today. In such an architecture, once the user authenticates to an application and a session cookie is created on the user's system, all following transactions for that session are authenticated using that cookie including potential actions initiated by an attacker and simply "riding" the existing session cookie.

Notas



Referencias

REF-44

24 Deadly Sins of Software Security
Michael Howard, David LeBlanc, John Viega.

REF-329

Cross-Site Request Forgeries (Re: The Dangers of Allowing Users to Post Images)
Peter W.
https://marc.info/?l=bugtraq&m=99263135911884&w=2

REF-330

Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet
OWASP.
https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html

REF-331

Cross-Site Request Forgeries: Exploitation and Prevention
Edward W. Felten, William Zeller.
https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.147.1445

REF-332

CSRF - The Cross-Site Request Forgery (CSRF/XSRF) FAQ
Robert Auger.
https://www.cgisecurity.com/csrf-faq.html

REF-333

Cross-site request forgery
https://en.wikipedia.org/wiki/Cross-site_request_forgery

REF-334

Top 25 Series - Rank 4 - Cross Site Request Forgery
Jason Lam.
https://www.sans.org/blog/top-25-series-rank-4-cross-site-request-forgery

REF-335

Preventing CSRF and XSRF Attacks
Jeff Atwood.
https://blog.codinghorror.com/preventing-csrf-and-xsrf-attacks/

REF-45

OWASP Enterprise Security API (ESAPI) Project
OWASP.
https://owasp.org/www-project-enterprise-security-api/

REF-956

Samy (computer worm)
Wikipedia.
https://en.wikipedia.org/wiki/Samy_(computer_worm)

REF-1479

State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation
Gregory Larsen, E. Kenneth Hong Fong, David A. Wheeler, Rama S. Moorthy.
https://www.ida.org/-/media/feature/publications/s/st/stateoftheart-resources-soar-for-software-vulnerability-detection-test-and-evaluation/p-5061.ashx

REF-1482

D3FEND: D3-TL Trusted Library
D3FEND.
https://d3fend.mitre.org/technique/d3f:TrustedLibrary/

Envío

Nombre Organización Fecha Fecha de lanzamiento Version
PLOVER 2006-07-19 +00:00 2006-07-19 +00:00 Draft 3

Modificaciones

Nombre Organización Fecha Comentario
Eric Dalci Cigital 2008-07-01 +00:00 updated Time_of_Introduction
CWE Content Team MITRE 2008-09-08 +00:00 updated Alternate_Terms, Description, Relationships, Other_Notes, Relationship_Notes, Taxonomy_Mappings
CWE Content Team MITRE 2009-01-12 +00:00 updated Applicable_Platforms, Description, Likelihood_of_Exploit, Observed_Examples, Other_Notes, Potential_Mitigations, References, Relationship_Notes, Relationships, Research_Gaps, Theoretical_Notes
CWE Content Team MITRE 2009-03-10 +00:00 updated Potential_Mitigations
Tom Stracener 2009-05-20 +00:00 Added demonstrative example for profile.
CWE Content Team MITRE 2009-05-27 +00:00 updated Demonstrative_Examples, Related_Attack_Patterns
CWE Content Team MITRE 2009-12-28 +00:00 updated Common_Consequences, Demonstrative_Examples, Detection_Factors, Likelihood_of_Exploit, Observed_Examples, Potential_Mitigations, Time_of_Introduction
CWE Content Team MITRE 2010-02-16 +00:00 updated Applicable_Platforms, Detection_Factors, References, Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2010-06-21 +00:00 updated Common_Consequences, Detection_Factors, Potential_Mitigations, References, Relationships
CWE Content Team MITRE 2010-09-27 +00:00 updated Potential_Mitigations
CWE Content Team MITRE 2011-03-29 +00:00 updated Description
CWE Content Team MITRE 2011-06-01 +00:00 updated Common_Consequences
CWE Content Team MITRE 2011-06-27 +00:00 updated Relationships
CWE Content Team MITRE 2011-09-13 +00:00 updated Potential_Mitigations, References
CWE Content Team MITRE 2012-05-11 +00:00 updated Related_Attack_Patterns, Relationships
CWE Content Team MITRE 2012-10-30 +00:00 updated Potential_Mitigations
CWE Content Team MITRE 2013-02-21 +00:00 updated Relationships
CWE Content Team MITRE 2013-07-17 +00:00 updated References, Relationships
CWE Content Team MITRE 2014-07-30 +00:00 updated Detection_Factors
CWE Content Team MITRE 2015-12-07 +00:00 updated Relationships
CWE Content Team MITRE 2017-11-08 +00:00 updated Applicable_Platforms, Likelihood_of_Exploit, Modes_of_Introduction, References, Relationships
CWE Content Team MITRE 2018-03-27 +00:00 updated References, Relationship_Notes, Research_Gaps
CWE Content Team MITRE 2019-09-19 +00:00 updated Relationships
CWE Content Team MITRE 2020-02-24 +00:00 updated Relationships
CWE Content Team MITRE 2020-06-25 +00:00 updated Relationships, Theoretical_Notes
CWE Content Team MITRE 2020-08-20 +00:00 updated Relationships
CWE Content Team MITRE 2021-07-20 +00:00 updated Relationships
CWE Content Team MITRE 2021-10-28 +00:00 updated Relationships
CWE Content Team MITRE 2022-06-28 +00:00 updated Relationships
CWE Content Team MITRE 2023-04-27 +00:00 updated References, Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes, Relationships
CWE Content Team MITRE 2024-11-19 +00:00 updated Relationships
CWE Content Team MITRE 2025-04-03 +00:00 updated Alternate_Terms, Common_Consequences, Description, Diagram
CWE Content Team MITRE 2025-09-09 +00:00 updated Detection_Factors, Potential_Mitigations, References
CWE Content Team MITRE 2025-12-11 +00:00 updated Applicable_Platforms, Relationships, Weakness_Ordinalities