Skip to content

Path traversal file write via savein()

High
xyproto published GHSA-2j2c-pv62-mmcp May 5, 2026

Package

No package listed

Affected versions

< 1.17.6

Patched versions

1.17.6

Description

uploadedFileSaveIn() in lua/upload/upload.go uses filepath.Join() with the caller-supplied directory but performs no boundary check after joining. A directory of ../../../tmp resolves cleanly to /tmp, outside the web root.

Impact

If Algernon is ran as root (not recommended) and set up for file upload, and does not have safeguards in place in the Lua source code provided by the user, then files may be uploaded to /tmp or nearly anywhere on the system.

If Algernon is set up with good systemd service file, the problem is limited to writing to files in ie /home/algernon.

Algernon comes with example systemd service files.

Patches

Has been patched in version 1.17.6.

Workarounds

Use a stricter systemd service file. Adding extra checks in connection with file uploads might also help, but upgrading is recommended.

References

#172

Severity

High

CVE ID

CVE-2026-43982

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

Credits