Summary
Allure 2 report generator prior to version 2.38.0 contains a path traversal vulnerability that allows arbitrary file reads on the host while processing test result artifacts.
By crafting malicious result files that reference sensitive files as attachments, an attacker can cause Allure to embed those files into the generated test report under certain conditions.
Affected context
This vulnerability occurs when Allure 2 report generator processes test result artifacts (e.g., *-result.json, *-container.json, or .plist files) that describe attachments.
If these result files can be supplied or influenced by an attacker, and the Allure report generation process runs on a host where sensitive files are present, the generator may resolve attacker-controlled paths and read files outside the intended results directory.
The issue is typically exposed in CI/CD pipelines or build environments where Allure is invoked automatically over collected test results.
Exploit preconditions
- Attack surface: Allure report generation process (CLI or integrated tool) that consumes test result files.
- Required access: Ability to create, modify, or inject test result files (
*-result.json,*-container.json,.plist) consumed by Allure. - Trigger point: Execution of the Allure report generator over a directory containing the crafted result files.
- Why exploitation is possible: The generator trusts attachment source paths from result files and resolves them without enforcing confinement to an expected directory or applying robust path canonicalization and validation, enabling path traversal or out-of-scope file resolution.
Why this happens
The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Allure's report generator treats attachment source paths in result artifacts as trustworthy and resolves them directly on the host filesystem.
Without normalizing paths and enforcing that they remain within an allowed root (such as the test results directory or a dedicated attachments folder), an attacker-supplied path can reference arbitrary locations (e.g., via absolute paths or ../ segments).
This insecure pattern allows untrusted metadata to influence which files are read and subsequently embedded into the generated report.
Potential impact
- Sensitive configuration files (e.g., application configs, CI secrets, keys) may be included in the generated report.
- Credentials, tokens, or API keys stored on the host can be exposed through report artifacts.
- Internal source code or proprietary files can be unintentionally published or leaked.
- Further compromise of connected systems may be possible if exposed secrets are later abused by an attacker.
General mitigation guidance
Effective mitigation focuses on constraining file resolution and reducing trust in result metadata:
- Enforce strict directory confinement for all attachment sources (e.g., only allow paths under a designated attachments root).
- Normalize and canonicalize paths before access, rejecting any that attempt directory traversal or reference absolute filesystem locations.
- Treat all test result artifacts as untrusted inputs, even when produced by automated tools or plugins.
- Run report generation with least-privilege filesystem access, avoiding unnecessary read permissions to sensitive directories.
- Segregate test-result processing environments from locations where highly sensitive files (keys, secrets) are stored.
How teams detect issues like this
Organizations can pursue several approaches to detect or monitor this class of issue:
- Static analysis and code review: Look for file access logic that consumes paths from result files or metadata without canonicalization and strict root checks; pay attention to functions that join user-controlled paths with base directories.
- Configuration and policy checks: Enforce CI/CD policies that restrict which directories the Allure process can read, using sandboxing, containers, or filesystem permissions.
- Runtime monitoring: Log and review file access patterns during report generation, flagging attempts to read files outside the expected results or workspace directories.
- Artifact inspection: Periodically inspect generated reports for unexpected embedded files (e.g., configuration snippets, keys, or system files) to uncover misuse or exploitation attempts.

