Skip to content

Bypassing promo code limitations with race conditions

High
cbellone published GHSA-67jg-m6f3-473g Sep 6, 2024

Package

docker alfio/alf.io (docker)

Affected versions

<= 2.0-M4-2402

Patched versions

2.0-M5

Description

Summary

The race condition allows the user to bypass the limit on the number of promotion codes and use the discount coupon multiple times.

Details

In "alf.io", admin can apply price discounts by using promo codes to their events.
And admin can limit the number of promo codes that will be used for events, but the time-gap between checking the number of codes and restricting the use of the codes allows attackers to bypass the promo code limit.

PoC

  • The validity of the promo code is checked twice during the entire reservation process, so there are two race conditions are needed.
  1. Create an event.
    image

  2. Create a promo code. (note that the maximum number is one)
    image

  3. Try reservations in different sessions.
    image

  4. The first race condition is used here. There are several methods to perform a race condition in this case, but here I used "Last-byte synchronization" to ensure a stable race condition. (reproducible via burpsuite's Group send feature)
    image
    image

  5. Check that the step has progressed, with the first validation bypassed.
    image

  6. Prepare the race condition again for the second verification.
    image

  7. Check that the two discounted registrations were successful, bypassing the promo code restrictions as expected.
    image
    image

  8. This can be clearly seen on the admin page.
    image
    image
    image

Impact

It can be disruptive and financially damaging.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2024-45300

Weaknesses

Credits