Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS02eHY1LTg2cTktN3hyOM4AA1v8
SecureJoin: on windows, paths outside of the rootfs could be inadvertently produced
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.
Permalink: https://github.com/advisories/GHSA-6xv5-86q9-7xr8JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS02eHY1LTg2cTktN3hyOM4AA1v8
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 1 year ago
Updated: over 1 year ago
Identifiers: GHSA-6xv5-86q9-7xr8
References:
- https://github.com/cyphar/filepath-securejoin/security/advisories/GHSA-6xv5-86q9-7xr8
- https://github.com/cyphar/filepath-securejoin/pull/9
- https://github.com/cyphar/filepath-securejoin/commit/c121231e1276e11049547bee5ce68d5a2cfe2d9b
- https://github.com/cyphar/filepath-securejoin/releases/tag/v0.2.4
- https://github.com/advisories/GHSA-6xv5-86q9-7xr8
Blast Radius: 0.0
Affected Packages
go:github.com/cyphar/filepath-securejoin
Dependent packages: 5,997Dependent repositories: 21,974
Downloads:
Affected Version Ranges: < 0.2.4
Fixed in: 0.2.4
All affected versions: 0.1.0, 0.2.0, 0.2.1, 0.2.2, 0.2.3
All unaffected versions: 0.2.4, 0.2.5, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.4.0, 0.4.1