Summary
Malcolm contains an authorization bypass in its Nginx OpenResty Lua access controls because the role check evaluates an unnormalized request URI while Nginx routes the normalized path. An authenticated low-privilege user may exploit this discrepancy to reach a backend resource that their role should not access.
Affected context
The issue can arise in Malcolm deployments that use the affected Nginx OpenResty Lua role-based access-control layer and route requests through normalized Nginx paths. Risk is higher when low-privilege authenticated users can send crafted path variations to endpoints protected by backend-specific authorization rules.
Exploit preconditions
- Attack surface: HTTP request handling through the Malcolm web interface - Required access: An authenticated account with low privileges - Trigger point: Processing a request whose raw URI differs from the
normalized path used for routing
- Why exploitation is possible: The Lua authorization decision may fail to
match a rule for the raw path, while Nginx maps the normalized path to a
restricted backend
Why this happens
The vulnerability results from inconsistent canonicalization between the authorization layer and the web server's routing layer. The Lua role check evaluates raw request data, whereas Nginx uses a normalized path, allowing security decisions and resource routing to be based on different representations. This maps to CWE-863, Incorrect Authorization, because the access-control decision can fail to enforce the intended restriction.
Potential impact
- An authenticated user may access restricted backend endpoints
- Sensitive network-analysis data or administrative functionality could be exposed
- Unauthorized actions may be performed under a low-privilege account
- Access-control boundaries between application components could be weakened
General mitigation guidance
Mitigation generally focuses on making routing and authorization use the same canonical request representation. Security controls should normalize paths before authorization, reject ambiguous or malformed path forms, and apply deny-by-default behavior when no rule matches. Backend authorization should be enforced independently of front-end path checks where practical, with narrowly scoped service privileges and minimized access for low-privilege roles. Input trust should be reduced by treating client-supplied path variations as untrusted and by centralizing canonicalization and policy evaluation.
How teams detect issues like this
Detection can include static analysis and code review for authorization logic that compares raw URI variables while routing or proxy layers canonicalize paths. Reviewers can look for path-based allowlists, fall-open behavior on unmatched rules, and inconsistent normalization across Nginx, OpenResty, and backend services. Runtime monitoring can flag unusual traversal-like path variants, authorization denials followed by successful backend responses, and low-privilege access to restricted routes. Automated security review tools may help identify mismatched canonicalization and authorization patterns.

