Algernon: Host header path traversal in --domain mode reads files and runs Lua from parent dir
Algernon is a small self-contained pure-Go web server. Prior to 1.17.8, when algernon is started with --domain (or --letsencrypt, which silently turns on --domain at engine/flags.go:372), the request handler resolves the served directory by joining the configured --dir with the value of the client-supplied Host header. The join is performed by filepath.Join with no validation, so a Host: .. header walks one level above the document root. Subsequent file resolution then exposes everything in that parent directory — arbitrary file read, full directory listing, and, if any .lua file is present, server-side Lua execution. This vulnerability is fixed in 1.17.8.
Problem Types
| Type | CWE ID | Description |
|---|
| CWE | CWE-22 | CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') |
| CWE | CWE-23 | CWE-23: Relative Path Traversal |
| CWE | CWE-644 | CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax |
Type: CWE
Description: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Type: CWE
Description: CWE-23: Relative Path Traversal
Type: CWE
Description: CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax
Metrics
| Version | Base score | Base severity | Vector |
|---|
| 3.1 | 8.2 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N |
Version: 3.1
Base score: 8.2
Base severity: HIGH
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N