Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/cyphar/filepath-securejoin
  4. ›
  5. GMS-2023-2229

GMS-2023-2229: SecureJoin: on windows, paths outside of the rootfs could be inadvertently produced

September 7, 2023

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.

References

  • github.com/advisories/GHSA-6xv5-86q9-7xr8
  • github.com/cyphar/filepath-securejoin/commit/c121231e1276e11049547bee5ce68d5a2cfe2d9b
  • github.com/cyphar/filepath-securejoin/pull/9
  • github.com/cyphar/filepath-securejoin/releases/tag/v0.2.4
  • github.com/cyphar/filepath-securejoin/security/advisories/GHSA-6xv5-86q9-7xr8

Code Behaviors & Features

Detect and mitigate GMS-2023-2229 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.2.4

Fixed versions

  • v0.2.4

Solution

Upgrade to version 0.2.4 or above.

Source file

go/github.com/cyphar/filepath-securejoin/GMS-2023-2229.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:14 +0000.