GHSA-6xv5-86q9-7xr8

Suggest an improvement
Source
https://github.com/advisories/GHSA-6xv5-86q9-7xr8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/09/GHSA-6xv5-86q9-7xr8/GHSA-6xv5-86q9-7xr8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-6xv5-86q9-7xr8
Aliases
Related
Published
2023-09-07T12:58:58Z
Modified
2023-11-08T04:16:32.913050Z
Summary
SecureJoin: on windows, paths outside of the rootfs could be inadvertently produced
Details

Impact

For Windows users of github.com/cyphar/filepath-securejoin, until v0.2.4 it was possible for certain rootfs and path combinations (in particular, where a malicious Unix-style /-separated unsafe path was used with a Windows-style rootfs path) to result in generated paths that were outside of the provided rootfs.

It is unclear to what extent this has a practical impact on real users, but given the possible severity of the issue we have released an emergency patch release that resolves this issue.

Thanks to @pjbgf for discovering, debugging, and fixing this issue (as well as writing some tests for it).

Patches

c121231e1276e11049547bee5ce68d5a2cfe2d9b is the patch fixing this issue. v0.2.4 contains the fix.

Workarounds

Users could use filepath.FromSlash() on all unsafe paths before passing them to filepath-securejoin.

References

See #9.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2023-09-07T12:58:58Z"
}
References

Affected packages

Go / github.com/cyphar/filepath-securejoin

Package

Name
github.com/cyphar/filepath-securejoin
View open source insights on deps.dev
Purl
pkg:golang/github.com/cyphar/filepath-securejoin

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.2.4