All vulnerabilities

RubyGems

CVE-2026-141524

Addressable::Template#match and #extract take variable names from the URI, so a URI can add or reassign variables

Severity
Low 3.7
Published
1 Dec 2026
Last changed
1 Dec 2026
Added to UpHeron
1 Dec 2026
Fixed in
2.10.0
Weakness
Improper input validation (CWE-20)Mass assignment (CWE-915)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
Also known as
GHSA-q5vw-6v74-fg2g
Sources
OSV.dev and GitHub

Description

Addressable::Template#match and #extract take the name of a variable in a ;, ? or & expression from the URI, not from the template, when the variable isn't exploded. The template /search{?q} matches /search?admin=true and gives {"q" => nil, "admin" => "true"}: the mapping has a variable the template doesn't have, and q is missing its value. The URI can also give its value to another of the template's variables, which takes the first value it's given. /files{;version}/{id} matches /files;id=secret/42 and gives id the value "secret", not the 42 in its place in the path.

A URI Template can only expand such a variable to its own name followed by = (Sections 3.2.7 to 3.2.9 of RFC 6570), and matching assigns the parts of a URI "to the named variables" (Section 1.4). So these URIs aren't expansions of the template, and the mappings name variables that the URI's text doesn't give them.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

  • After matching, keep only the template's variables, and accept the URI only if they expand back to it. This rejects every URI above. It also rejects some that differ only in how they're written, such as a query with the names in a different order.
  • Check a processor's restrictions on a variable's value in restore, not only in match.
  • Don't act on values in a processor's restore, such as by recording them. Act on the mapping after it passes the check above.
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
addressableRubyGems · osv:RubyGems:addressable
  • From 2.3.0 before 2.10.0

About addressable

Total downloads (RubyGems)
1,323,514,580RubyGems, 1 Dec 2026

References