Advisory

GO-2024-3293

Also known as: None

Summary

Full access to the host's OS file system using osfs.FS with Router.Static in goyave.dev/goyave/v5

Details

Static file serving using router.Static and osfs.FS allows clients to access any file on the host file system using relative paths because the requested path is not sanitized and . and .. segments are accepted. The files will be returned as a response, provided the system user running the Go application has read access to the requested file.

As a workaround, use fsutil.NewEmbed(embeddedFS) from the goyave.dev/goyave/v5/util/fsutil package to serve static content using Router.Static instead of &osfs.FS. Embedded file systems are rooted to the specified directory, making it impossible to navigate outside of the developers' intended directory.

Severity

Not rated by the source.

Dates

Published
2024-12-13 20:59 UTC
Modified
2024-12-13 20:59 UTC

Affected packages and fixes

goyave.dev/goyave/v5

Go · All systems

Affected

  • introduced 5.0.0, fixed 5.5.0 (semver)

Fixed versions

5.5.0

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Go Vulnerability Database · CC BY 4.0

Sources & licences