CAPECattack pattern
CAPEC-21 Exploitation of Trusted Identifiers
High
Official page ↗
- Abstraction
- Meta
- Status
- Stable
- Likelihood of attack
- High
- Typical severity
- High
- CAPEC version
- 3.9
Description
An adversary guesses, obtains, or "rides" a trusted identifier (e.g. session ID, resource ID, cookie, etc.) to perform authorized actions under the guise of an authenticated user or service.
Extended description
Attacks leveraging trusted identifiers typically result in the adversary laterally moving within the local network, since users are often allowed to authenticate to systems/applications within the network using the same identifier. This allows the adversary to obtain sensitive data, download/install malware on the system, pose as a legitimate user for social engineering purposes, and more.
Attacks on trusted identifiers take advantage of the fact that some software accepts user input without verifying its authenticity. Many server side processes are vulnerable to these attacks because the server to server communications have not been analyzed from a security perspective or the processes "trust" other systems because they are behind a firewall. Similarly, servers that use easy to guess or spoofable schemes for representing digital identity can also be vulnerable. Such systems frequently use schemes without cryptography and digital signatures (or with broken cryptography). Identifiers may be guessed or obtained due to insufficient randomness, poor protection (passed/stored in the clear), lack of integrity (unsigned), or improper correlation with access control policy enforcement points. Exposed configuration and properties files that contain sensitive data may additionally provide an adversary with the information needed to obtain these identifiers. An adversary may also "ride" an identifier via a malicious link, as is the case in Cross Site Request Forgery (CSRF) attacks.
Regardless of the attack vector, successful spoofing and impersonation of trusted credentials can lead to an adversary breaking authentication, authorization, and audit controls with the target system or application.
Execution flow
1. [Explore] [Survey the application for Indicators of Susceptibility] Using a variety of methods, until one is found that applies to the target, the adversary probes for cookies, session tokens, or entry points that bypass identifiers altogether.
2. [Experiment] [Fetch samples] The adversary fetches many samples of identifiers. This may be through legitimate access (logging in, legitimate connections, etc.) or via systematic probing.
3. [Exploit] [Impersonate] An adversary can use successful experiments or authentications to impersonate an authorized user or system or to laterally move within a system or application
4. [Exploit] [Spoofing] Malicious data can be injected into the target system or into a victim user's system by an adversary. The adversary can also pose as a legitimate user to perform social engineering attacks.
5. [Exploit] [Data Exfiltration] The adversary can obtain sensitive data contained within the system or application.
Prerequisites
• Server software must rely on weak identifier proof and/or verification schemes.
• Identifiers must have long lifetimes and potential for reusability.
• Server software must allow concurrent sessions to exist.
Skills required
• [Low] To achieve a direct connection with the weak or non-existent server session access control, and pose as an authorized user
Consequences
• Confidentiality, Access Control, Authentication: Gain Privileges
• Confidentiality: Read Data
• Integrity: Modify Data
Mitigations
• Design: utilize strong federated identity such as SAML to encrypt and sign identity tokens in transit.
• Implementation: Use industry standards session key generation mechanisms that utilize high amount of entropy to generate the session key. Many standard web and application servers will perform this task on your behalf.
• Implementation: If the identifier is used for authentication, such as in the so-called single sign on use cases, then ensure that it is protected at the same level of assurance as authentication tokens.
• Implementation: If the web or application server supports it, then encrypting and/or signing the identifier (such as cookie) can protect the ID if intercepted.
• Design: Use strong session identifiers that are protected in transit and at rest.
• Implementation: Utilize a session timeout for all sessions, for example 20 minutes. If the user does not explicitly logout, the server terminates their session after this period of inactivity. If the user logs back in then a new session key is generated.
• Implementation: Verify authenticity of all identifiers at runtime.
Related
Att&ck technique · MITRE ATT&CK (3)
Weakness · CWE (9)
- CWE-290 Authentication Bypass by Spoofing weakness
- CWE-302 Authentication Bypass by Assumed-Immutable Data weakness
- CWE-346 Origin Validation Error weakness
- CWE-384 Session Fixation weakness
- CWE-539 Use of Persistent Cookies Containing Sensitive Information weakness
- CWE-6 J2EE Misconfiguration: Insufficient Session-ID Length weakness
- CWE-602 Client-Side Enforcement of Server-Side Security weakness
- CWE-642 External Control of Critical State Data weakness
- CWE-664 Improper Control of a Resource Through its Lifetime weakness
Referenced by CAPEC · child of (4)
Referenced by CAPEC · peer of (1)
- CAPEC-12 Choosing Message Identifier attack pattern
Referenced by CWE · attack pattern (9)
- CWE-290 Authentication Bypass by Spoofing weakness
- CWE-302 Authentication Bypass by Assumed-Immutable Data weakness
- CWE-346 Origin Validation Error weakness
- CWE-384 Session Fixation weakness
- CWE-539 Use of Persistent Cookies Containing Sensitive Information weakness
- CWE-6 J2EE Misconfiguration: Insufficient Session-ID Length weakness
- CWE-602 Client-Side Enforcement of Server-Side Security weakness
- CWE-642 External Control of Critical State Data weakness
- CWE-664 Improper Control of a Resource Through its Lifetime weakness