repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
uuid-insecurities.mdMarkdown76 lines4.7 KiBsource raw download

title: "UUID Insecurities" section: "Web Pentesting" sectionSlug: "pentesting-web" sourcePath: "src/pentesting-web/uuid-insecurities.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/pentesting-web/uuid-insecurities.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

UUID Insecurities#

Basic Information#

Universally Unique Identifiers (UUIDs) are 128-bit numbers used to uniquely identify information in computer systems. UUIDs are essential in applications where unique identifiers are necessary without central coordination. They are commonly used as database keys and can refer to various elements like documents and sessions.[1]

UUIDs are designed primarily for uniqueness, not secrecy or authorization. Some versions are predictable, and even a random UUID must not replace an access-control check. The conventional text form contains 32 hexadecimal digits in five groups.[2]

[!TIP] The version and variant occupy fixed bit positions in RFC UUIDs. For example:
12345678 - abcd - 1a56 - a539 - 103755193864
xxxxxxxx - xxxx - Mxxx - Nxxx - xxxxxxxxxxxx

  • The position of M indicates the UUID version. In the example above, it is UUID v1.
  • The position of N indicates the UUID variant.

Sandwich attack#

The "Sandwich Attack" is a specific type of attack that exploits the predictability of UUID v1 generation in web applications, particularly in features like password resets. UUID v1 is generated based on time, clock sequence, and the node's MAC address, which can make it somewhat predictable if an attacker can obtain some of these UUIDs generated close in time.[1]

Example#

Imagine a web application that uses UUID v1 for generating password reset links. Here’s how an attacker might exploit this to gain unauthorized access:

  1. Initial Setup:
  1. Execution:
  1. Analysis:
  1. Brute Force Attack:
  1. Access Gained:

Tools#

References#