Skip to content

v0.45.1

Choose a tag to compare

@musharna musharna released this 28 Jul 04:06
e954564

v0.45.1

Security fix. Upgrade from 0.45.0 if you rely on licence verdicts.

Fixed

  • A hostile licence URL could mint a permissive verdict. host_matches already
    rejected a domain sitting in someone else's path, but the token scanner
    underneath splits a URL at any character it cannot consume — so one URL became
    two tokens and each half was read as a standalone URL:

    http://creativecommons.org@evil.example.com/licenses/by/4.0/
    https://creativecommons.org:8080@evil.example.com/licenses/by/4.0/
    https://evil.example.com#creativecommons.org/licenses/by/4.0/

    Each returned a real CC-BY-4.0 and ALLOW for commercial use. The first two read
    the URL's userinfo as the host; the third matched its fragment. Open Data
    Commons URLs were affected identically.

    This is reachable input rather than a curiosity: licence strings are record
    data, and anyone can upload a record and set that field on Zenodo, HuggingFace
    or OpenML. The compatibility verdict, the access flag and the FAIR score were
    all derivable from attacker-controlled text.

    A token is now rejected when the surrounding URL syntax proves it is not a
    host — followed by "@" (optionally through a port) is userinfo, preceded by
    "@ # ? & =" means it sits inside another URL's userinfo, fragment or query.

  • The same scanner was quadratic on attacker-supplied text. Its host-label group
    nested a star inside a plus, so a 12 KB licence field of "by-by-by-…" cost
    about 1.5 seconds of CPU, and the scan runs three times per licence check — a
    page of such records was minutes of wall clock. Every repetition is now bounded
    by DNS's own limits and the scan is length-capped. 12 KB now costs about 12 ms.

Both symptoms came from one regex, and both are fixed in one change.