CAPECattack pattern

CAPEC-31 Accessing/Intercepting/Modifying HTTP Cookies

High Official page ↗
Abstraction
Detailed
Status
Draft
Likelihood of attack
High
Typical severity
High
CAPEC version
3.9

Description

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.

Execution flow

1. [Explore] [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. 2. [Experiment] [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. 3. [Experiment] [Modify cookie to subvert security controls.] The adversary may be able to modify or replace cookies to bypass security controls in the application.

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] To overwrite session cookie data, and submit targeted attacks via HTTP • [High] Exploiting a remote buffer overflow generated by attack

Consequences

• Confidentiality: Read Data • Integrity: Modify Data • Confidentiality, Access Control, Authorization: Gain Privileges

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.

Related

Att&ck technique · MITRE ATT&CK (1)

  • T1539 Steal Web Session Cookie technique

Child of · CAPEC (2)

  • CAPEC-157 Sniffing Attacks attack pattern
  • CAPEC-39 Manipulating Opaque Client-based Data Tokens attack pattern

Weakness · CWE (11)

  • CWE-113 Improper Neutralization of CRLF Sequences in HTTP Headers weakness
  • CWE-20 Improper Input Validation weakness
  • CWE-302 Authentication Bypass by Assumed-Immutable Data weakness
  • CWE-311 Missing Encryption of Sensitive Data weakness
  • CWE-315 Cleartext Storage of Sensitive Information in a Cookie weakness
  • CWE-384 Session Fixation weakness
  • CWE-472 External Control of Assumed-Immutable Web Parameter weakness
  • CWE-539 Use of Persistent Cookies Containing Sensitive Information weakness
  • CWE-565 Reliance on Cookies without Validation and Integrity Checking weakness
  • CWE-602 Client-Side Enforcement of Server-Side Security weakness
  • CWE-642 External Control of Critical State Data weakness

Referenced by CWE · attack pattern (11)

  • CWE-113 Improper Neutralization of CRLF Sequences in HTTP Headers weakness
  • CWE-20 Improper Input Validation weakness
  • CWE-302 Authentication Bypass by Assumed-Immutable Data weakness
  • CWE-311 Missing Encryption of Sensitive Data weakness
  • CWE-315 Cleartext Storage of Sensitive Information in a Cookie weakness
  • CWE-384 Session Fixation weakness
  • CWE-472 External Control of Assumed-Immutable Web Parameter weakness
  • CWE-539 Use of Persistent Cookies Containing Sensitive Information weakness
  • CWE-565 Reliance on Cookies without Validation and Integrity Checking weakness
  • CWE-602 Client-Side Enforcement of Server-Side Security weakness
  • CWE-642 External Control of Critical State Data weakness