Skip to content
Fencer Intel
high 7.5

HSEC-2025-0004 json

Broken Path Sanitization in spacecookie Library

published 11mo ago modified 11mo ago

cvss
7.5
version 3.1, OSV
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

# Broken Path Sanitization in spacecookie Library

The spacecookie library exposes the functions `sanitizePath` and `sanitizeIfNotUrl` intended to remove `..` components from paths which can be used to prevent path traversal attacks. Due to erroneous comparison code, this elimination is not actually performed which has been remedied in version 1.0.0.3 by properly comparing using `equalFilePath`.

Any user of those respective functions of any version of spacecookie should upgrade to 1.0.0.3 or later. Note that the spacecookie server executable included in the same package is not affected by the problem since a separate check would reject any malicious path that gets by `sanitizePath`.

Patch / fix

  • hackage spacecookie 1.0.0.3

Is HSEC-2025-0004 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

CVSS scores

assigned by version score vector
OSV 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected packages

ecosystem package affected fixed in
hackage spacecookie
>=0.2.0.0, <1.0.0.3
1.0.0.3

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.