Registry / utility / cyphar-filepath-securejoin

cyphar-filepath-securejoin

JSON →
library0.6.1gogounverified

Package securejoin implements a set of helpers to make it easier to write Go code that is safe against symlink-related escape attacks.

go get github.com/cyphar/filepath-securejoin
INSTALL
IMPORT
SIG · CYPHAR-FILEPATH-SE
C
cyphar-filepath-securejoin
utilitygov0.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

securejoin
github.com/cyphar/filepath-securejoin

Safely join a path to a root directory preventing symlink escapes

package main import ( "fmt" "github.com/cyphar/filepath-securejoin" ) func main() { root := "/safe/dir" unsafePath := "../../etc/passwd" safePath, err := securejoin.SecureJoin(root, unsafePath) if err != nil { panic(err) } fmt.Printf("Safe path: %s\n", safePath) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.6.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
cyphar-filepath-securejoin — go get cyphar-filepath-securejoin · libregistry