CAPEC-31
Accessing/Intercepting/Modifying HTTP Cookies
This attack relies on the use of HTTP Cookies to store credentials, state information and other critical data on client systems. There are several different forms of this attack. The first form of this attack involves accessing HTTP Cookies to mine for potentially sensitive data contained therein. The second form involves intercepting this data as it is transmitted from client to server. This intercepted information is then used by the adversary to impersonate the remote user/session. The third form is when the cookie's content is modified by the adversary before it is sent back to the server. Here the adversary seeks to convince the target server to operate on this falsified information.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-31: Accessing/Intercepting/Modifying HTTP Cookies: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/31.html and https://cve.bz/cve/capec/31?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
How the attack unfolds
Explore
The attacker looks for a way in.
[Obtain copy of cookie] The adversary first needs to obtain a copy of the cookie. The adversary may be a legitimate end user wanting to escalate privilege, or could be somebody sniffing on a network to get a copy of HTTP cookies.
4 techniques
- Sniff cookie using a network sniffer such as Wireshark
- Obtain cookie using a utility such as the Firefox Cookie Manager, Chrome DevTools or AnEC Cookie Editor.
- Steal cookie via a cross-site scripting attack.
- Guess cookie contents if it contains predictable information.
Experiment
They probe what they found.
[Obtain sensitive information from cookie] The adversary may be able to get sensitive information from the cookie. The web application developers may have assumed that cookies are not accessible by end users, and thus, may have put potentially sensitive information in them.
2 techniques
- If cookie shows any signs of being encoded using a standard scheme such as base64, decode it.
- Analyze the cookie's contents to determine whether it contains any sensitive information.
[Modify cookie to subvert security controls.] The adversary may be able to modify or replace cookies to bypass security controls in the application.
4 techniques
- Modify logical parts of cookie and send it back to server to observe the effects.
- Modify numeric parts of cookie arithmetically and send it back to server to observe the effects.
- Modify cookie bitwise and send it back to server to observe the effects.
- Replace cookie with an older legitimate cookie and send it back to server to observe the effects. This technique would be helpful in cases where the cookie contains a "points balance" for a given user where the points have some value. The user may spend their points and then replace their cookie with an older one to restore their balance.
Prerequisites
Target server software must be a HTTP daemon that relies on cookies.
The cookies must contain sensitive information.
The adversary must be able to make HTTP requests to the server, and the cookie must be contained in the reply.
Skills required
- Low skill
To overwrite session cookie data, and submit targeted attacks via HTTP
- High skill
Exploiting a remote buffer overflow generated by attack
Resources required
A utility that allows for the viewing and modification of cookies. Many modern web browsers support this behavior.
Consequences
| Impact | Affects | Note |
|---|---|---|
| Read Data | Confidentiality | |
| Modify Data | Integrity | |
| Gain Privileges | Confidentiality, Access Control, Authorization |
Mitigations
Design: Use input validation for cookies
Design: Generate and validate MAC for cookies
Implementation: Use SSL/TLS to protect cookie in transit
Implementation: Ensure the web server implements all relevant security patches, many exploitable buffer overflows are fixed in patches issued for the software.
Weaknesses it exploits
- CWE-20 Improper Input Validation
- CWE-113 Improper Neutralization of CRLF Sequences in HTTP Headers
- CWE-302 Authentication Bypass by Assumed-Immutable Data
- CWE-311 Missing Encryption of Sensitive Data
- CWE-315 Cleartext Storage of Sensitive Information in a Cookie
- CWE-384 Session Fixation
- CWE-472 External Control of Assumed-Immutable Web Parameter
- CWE-539 Use of Persistent Cookies Containing Sensitive Information
- CWE-565 Reliance on Cookies without Validation and Integrity Checking
- CWE-602 Client-Side Enforcement of Server-Side Security
- CWE-642 External Control of Critical State Data
Recent CVEs with these weaknesses
- 5.5CVE-2026-139984
A weakness has been identified in walinejs Waline up to 1.43.6. The affected element is an unknown function of the component OAuth Login Callback Handler. Executing a manipulation of the argument Type can lead to improper input validation.…
- 3.7CVE-2026-140099
Forge, also called node-forge, is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.4, pki.privateKeyFromPem() and pki.privateKeyFromAsn1() ignore the RSAPrivateKey version and otherPrimeInfos fields and inter…
- 9.1CVE-2026-137019
Enclave OS Mini is a Rust-based runtime for confidential applications inside Intel SGX enclaves. Prior to enclave-os-mini-wasm version 0.53.0 and enclave-cluster version 0.8.0, Enclave OS Mini accepted a caller-chosen user_handle during FI…
- 5.3CVE-2026-138678
The AIL Framework (ail-project/ail-framework) allowed authenticated users to configure arbitrary outbound HTTP/HTTPS destinations for MISP event export and WebHook notifications. The prior validation only verified that the URL used an http…
- –CVE-2026-92089
External control of Assumed-Immutable web parameter vulnerability in Apache OpenMeetings. This issue affects Apache OpenMeetings: from 5.0.1 before 9.2.0. Apache OpenMeetings Docker: from 5.1.0 before 9.2.0. Authenticated attacker wi…
- 6.3CVE-2026-133397
Joomla Extension - solidres.com - Unauthenticated cross-product variant price manipulation in Solidshop extension 1.0.0-1.8.0 - The cart add and update tasks did not verify that a requested variant belongs to the product being added, allow…
- 2.1CVE-2026-138333
A security vulnerability has been detected in dailydotdev daily up to d8fc89d978eb4a454992349adafa283700c52e31. This affects the function render of the file statusline/statusline.mjs of the component Statusline Handler. The manipulation le…
- 1.9CVE-2026-138330
A vulnerability was identified in Anil-matcha open-duet up to 0.8.1. Impacted is the function classify_bash_command of the file backend/app/services/github_classifier.py of the component Git Risk Classifier. Such manipulation leads to impr…
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
Examples
There are two main attack vectors for exploiting poorly protected session variables like cookies. One is the …
There are two main attack vectors for exploiting poorly protected session variables like cookies. One is the local machine itself which can be exploited directly at the physical level or indirectly through XSS and phishing. In addition, the adversary in the middle attack (CAPEC-94) relies on a network sniffer, proxy, or other intermediary to intercept the subject's credentials and use them to impersonate the digital subject on the host. The issue is that once the credentials are intercepted, impersonation is trivial for the adversary to accomplish if no other protection mechanisms are in place. See also: CVE-2010-5148 , CVE-2016-0353
MITRE's words, unchanged: CAPEC-31 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.