Advisory

GHSA-3px7-jm2p-6h2c

Also known as: CVE-2024-0241

Summary

encoded_id-rails potential DOS vulnerability due to URIs with extremely long encoded IDs

Details

Impact

The length of URIs and the various parts (eg path segments, query parameters) is usually limited by the webserver processing the incoming request. In the case of Puma the defaults are :

  • path segment length: 8192
  • Max URI length: 1024 * 12
  • Max query length: 1024 * 10

See https://github.com/puma/puma/blob/master/docs/compile_options.md

If too long Puma raises:
> Puma caught this error: HTTP element REQUEST_PATH is longer than the (8192) allowed length (was 12503) (Puma::HttpParserError)

However due to the performance of hashids extremely long encoded IDs will consume a large amount of CPU and allocate a huge number of intermediate objects.

For example:

Severity

High Basis: The source's own band: HIGH

Dates

Published
2023-10-24 02:00 UTC
Modified
2026-07-08 06:52 UTC

Affected packages and fixes

encoded_id-rails

RubyGems · All systems

Affected

  • introduced 0, fixed 1.0.0.beta2 (ecosystem)

Fixed versions

1.0.0.beta2

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences