Summary
Metacat contains an unauthenticated path traversal vulnerability in the legacy 1.x API that allows a remote requester to read files accessible to the Tomcat process. The issue becomes critical when the legacy read endpoint is reachable without authentication, potentially exposing credentials, private keys, configuration data, and embargoed research data.
Affected context
The vulnerability occurs in Metacat 1.x API deployments in the 1.x through 2.19.1 release lines when the legacy action=read endpoint is exposed. The archiveEntryName parameter is incorporated into a filesystem path without adequate validation, while the surrounding read-permission check is not active. Deployments where these servlets remain reachable by unauthenticated network clients are particularly exposed.
Exploit preconditions
- Attack surface: The legacy Metacat 1.x API and its
action=readendpoint - Required access: Network access to the endpoint; authentication is not required
- Trigger point: Processing of the
archiveEntryNameparameter byArchiveHandler.readArchiveEntry() - Why exploitation is possible: User-controlled path data is concatenated into a filesystem path without traversal validation, and the intended authorization check is unavailable
- Required runtime condition: The target file must be readable by the Tomcat or hosting process
Why this happens
The underlying defect is an unchecked path construction operation that treats attacker-controlled archive entry data as a trusted filesystem location. Without canonicalization, containment checks, or an effective authorization decision, traversal sequences can escape the intended archive directory and reference other readable files. This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with CWE-862: Missing Authorization contributing because access control is not enforced before the file operation.
Potential impact
- Attackers may read application configuration files and stored credentials
- Client certificates and private keys could be exposed
- Federation member-node impersonation may become possible if sensitive keys are obtained
- Embargoed research data may be disclosed
- System details could be gathered to support additional attacks
- The Tomcat process and connected repository environment could face broader compromise
General mitigation guidance
Mitigation generally focuses on removing or isolating legacy file-reading endpoints and enforcing authorization before any filesystem access.
Common defensive patterns include:
- Restricting or disabling legacy API servlets that are not operationally required
- Enforcing authentication and authorization at the application and reverse-proxy layers
- Resolving requested paths canonically and verifying that they remain within an intended base directory
- Allowing only validated archive entry identifiers rather than arbitrary path strings
- Running Tomcat with a dedicated least-privilege account and minimal filesystem permissions
- Preventing private keys, credentials, and unrelated repository files from being readable by the service
- Restarting the servlet container after endpoint or configuration changes so stale servlet mappings are not retained
How teams detect issues like this
Detection can combine endpoint exposure review, application testing, and filesystem access monitoring.
Useful approaches include:
- Inventorying externally reachable legacy 1.x API servlets and identifying unauthenticated read routes
- Reviewing code for string concatenation or path resolution involving request parameters
- Applying static analysis rules for missing canonicalization, base-directory containment checks, and authorization-before-file-access
- Monitoring web logs for unusual requests to legacy read endpoints and repeated path-like parameter values
- Auditing Tomcat file access for reads outside approved repository directories
- Enforcing deployment policies that prohibit public exposure of deprecated or unnecessary API surfaces
- Using automated security review tools to flag path traversal and missing-authorization patterns during code review

