GHSA-6xv5-86q9-7xr8
JSON

medium

SecureJoin: on windows, paths outside of the rootfs could be inadvertently produced

Severity
medium rating by GitHub
Published
Last changed
Also known as
GO-2023-2048

Description

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.

Affected

Product or packageVersionsReported by
github.com/cyphar/filepath-securejoin (Go)before 0.2.4GitHub Advisory Database, Go Vulnerability Database

What each source says

GitHub Advisory Database
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.

Go Vulnerability Database

Certain rootfs and path combinations result in generated paths that are outside of the provided rootfs on Windows.

References

Related

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-6xv5-86q9-7xr8 changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2023-2048 changed 2026-02-04CC-BY-4.0