Summary
Algernon's URL-prefix authorization checks are case-sensitive, while the filesystem may treat paths as case-insensitive. On affected filesystems, an unauthenticated request using different letter casing may bypass protections for /admin, /repo, or /data and access the corresponding protected content.
Affected context
The issue affects Algernon deployments before version 1.17.10 when the permission system is active and protected paths are served from a case-insensitive filesystem. The authorization gate checks URL prefixes using case-sensitive matching, but the same raw path is later resolved by the filesystem. This mismatch can allow differently cased paths to reach protected content.
Exploit preconditions
- Attack surface: HTTP requests to an Algernon server
- Required access: No authentication is required when the request bypasses the prefix gate
- Trigger point: Authorization checks and subsequent filesystem resolution of a requested path
- Why exploitation is possible: Case-sensitive prefix checks can treat differently cased paths as public, while a case-insensitive filesystem resolves them to protected files
- Environment condition: The affected path must be served from a case-insensitive filesystem, such as Windows NTFS or a default case-insensitive macOS filesystem
Why this happens
The authorization layer and filesystem interpret path casing differently. Case-sensitive prefix matching fails to recognize differently cased forms of protected paths, while filesystem resolution may map those paths to the same protected files. This is an authorization enforcement failure (CWE-863) enabled by improper handling of case sensitivity (CWE-178).
Potential impact
- An attacker may read files under protected prefixes
- Protected Lua files could be executed, depending on server behavior and configuration
- Confidentiality and integrity of data in protected areas could be affected
- Access to protected administrative or repository content could support further compromise
General mitigation guidance
Defensive designs should make authorization and resource resolution use the same canonical representation of a path. Common patterns include normalizing paths before access checks, authorizing the resolved resource rather than a raw URL prefix, and applying deny-by-default rules when path interpretation is ambiguous.
Reduce trust in request-supplied path forms, constrain filesystem access to explicitly permitted roots, and run the server with only the privileges needed to serve its content. Tests should cover case variants and filesystem-specific path behavior.
How teams detect issues like this
Review authorization code for prefix checks that operate on raw paths, especially when filesystem resolution may use different case rules. Static analysis and code review can look for mismatches between path normalization, authorization, and file lookup.
Add tests for case variants of protected prefixes on supported filesystems. At the policy level, require authorization checks to apply to canonical resolved resources and flag routes that fall through to public access without an explicit allow decision.

