Vulnerabilities in pkg:maven/io.qameta.allure/allure-generator

PACKAGE
Advisory Identifier: GHSA-gx93-m64w-5m6h
Advisory Summary

CVE-2026-55847 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Allure Report libraries in the Maven ecosystem. The issue involves stored xss via unescaped ansi helper in status message/trace rendering. Remediation is available by upgrading affected packages to version 2.39.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/io.qameta.allure/allure-generator

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/io.qameta.allure/allure-generator. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-gx93-m64w-5m6h CVE-2026-55847 MODERATE Allure Report: Stored XSS via unescaped ANSI helper in status message/trace rendering
GHSA-64hm-gfwq-jppw CVE-2026-33166 HIGH Allure Report has an Arbitrary File Read via Path Traversal in Attachment Processing (Allure 1, Allure 2, and XCTest Readers)

CVE-2026-55847 at a Glance

CVE Identifier CVE-2026-55847
GHSA Identifier GHSA-gx93-m64w-5m6h
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Allure Report
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-55847

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

io.qameta.allure:allure-generator fixed: 2.39.0
<dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-generator</artifactId>
    <version>2.39.0</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=io.qameta.allure

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-55847, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.qameta.allure

Analyze the terminal output to locate any version of Allure Report in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.39.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.qameta.allure command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Allure Report, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `ansi.js` Handlebars helper in allure-generator passes user-controlled `statusMessage` and `statusTrace` values from test result files through the `ansi-to-html` library and wraps the output in Handlebars `SafeString` without HTML escaping. Since `ansi-to-html` does not escape HTML entities by default, an attacker who can influence test result content (e.g., via crafted JUnit XML failure messages) can inject arbitrary JavaScript that executes when anyone views the generated Allure report. ## Details The vulnerability is an incomplete fix — commit `4c64b19` (PR #3271) fixed XSS in `linky.js` and `text-with-links.js` by adding `escapeExpression()`, but the same pattern in `ansi.js` was not addressed. **Vulnerable sink** — `allure-generator/src/main/javascript/helpers/ansi.js:10-11`: ```javascript export default function (input) { return new SafeString(ansiConverter.toHtml(input)); }; ``` The `AnsiToHtml` constructor at line 4 does not set `escapeForHtml: true`: ```javascript const ansiConverter = new AnsiToHtml({ fg: "black", bg: "black", newline: true, }); ``` The `ansi-to-html` library (v0.7.2) defaults `escapeForHtml` to `false`, meaning HTML entities in the input pass through unchanged. Wrapping the result in `SafeString` tells Handlebars to skip its auto-escaping, so the raw HTML reaches the browser. **Template usage** — `allure-generator/src/main/javascript/blocks/status-details/status-details.hbs:7,10`: ```handlebars <pre class="status-details__message"><code>{{ansi statusMessage}}</code></pre> ... <pre class="{{b 'status-details' 'trace'}}"><code>{{ansi statusTrace}}</code></pre> ``` **Source** — `plugins/junit-xml-plugin/src/main/java/io/qameta/allure/junitxml/JunitXmlPlugin.java:307-308`: ```java result.setStatusMessage(element.getAttribute(MESSAGE_ATTRIBUTE_NAME)); result.setStatusTrace(element.getValue()); ``` These values are read directly from XML attributes with no sanitization. The same pattern exists in TRX, xUnit XML, xctest, and Allure1/2 plugins. **Contrast with the fixed helper** — `linky.js` (post-fix) correctly escapes before wrapping in `SafeString`: ```javascript const safeText = escapeExpression(text); return new SafeString(`<a href="${safeText}" ...>${safeText}</a>`); ``` ## PoC 1. Create a malicious JUnit XML test result file: ```xml <?xml version="1.0" encoding="UTF-8"?> <testsuite name="XSSTest" tests="1" failures="1"> <testcase name="xssPayload" classname="com.example.Test"> <failure message="&lt;img src=x onerror=alert(document.cookie)&gt;"> Stack trace: &lt;img src=x onerror=alert('statusTrace_XSS')&gt; </failure> </testcase> </testsuite> ``` 2. Generate an Allure report: ```bash allure generate /path/to/results-with-malicious-xml -o /tmp/allure-report ``` 3. Open the report and navigate to the failed test case: ```bash allure open /tmp/allure-report ``` 4. When viewing the test's status details, the `<img onerror>` payloads execute JavaScript in the viewer's browser. ## Impact - **Arbitrary JavaScript execution** in the browser of anyone viewing the generated Allure report - **Cookie theft, session hijacking** if the report is served from a domain with active sessions (e.g., CI dashboards) - **Data exfiltration** — the injected script can read the full report content and send it to an attacker-controlled server - **Attack vectors**: A malicious dependency that throws crafted exception messages, a CI pipeline processing test results from untrusted pull requests, or a contributor submitting test files containing XSS payloads - Allure reports are commonly hosted on CI/CD platforms (Jenkins, GitLab, GitHub Actions artifacts) where session cookies may be present ## Recommended Fix Configure `AnsiToHtml` with `escapeForHtml: true` to escape HTML entities while preserving ANSI-to-HTML conversion: ```javascript import AnsiToHtml from "ansi-to-html"; import {SafeString} from "handlebars/runtime"; const ansiConverter = new AnsiToHtml({ fg: "black", bg: "black", newline: true, escapeForHtml: true, // Escape HTML entities in non-ANSI input }); export default function (input) { return new SafeString(ansiConverter.toHtml(input)); }; ``` This is the correct approach because it preserves the ANSI escape sequence → HTML conversion (colored output) while ensuring that any non-ANSI HTML in the input is safely escaped. The alternative of using `escapeExpression()` on the input would destroy ANSI sequences before they could be converted.

CVE-2026-55847 Affected Allure Report Versions

1 component(s)
Fixed Versions:
2.39.0
Product / Package Ecosystem Affected Versions Fixed Version
io.qameta.allure:allure-generator
Maven
< 2.39.0
2.39.0

References

Frequently Asked Questions

What is CVE-2026-55847?
CVE-2026-55847 is a security vulnerability in Allure Report involving Stored XSS via unescaped ANSI helper in status message/trace rendering under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Allure Report versions are affected?
Affected versions include releases prior to 2.39.0 across affected packages: io.qameta.allure:allure-generator.
What version fixes CVE-2026-55847?
Upgrading to 2.39.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is allure-generator affected?
Yes, io.qameta.allure:allure-generator is affected in releases prior to 2.39.0. Upgrade your dependency to 2.39.0 or later.
What is the CVSS score of CVE-2026-55847?
CVE-2026-55847 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-55847?
CVE-2026-55847 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Maven dependencies for CVE-2026-55847?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.qameta.allure'. 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-gx93-m64w-5m6h",
  "modified" : "2026-06-19T21:15:53Z",
  "published" : "2026-06-19T21:15:53Z",
  "aliases" : [ "CVE-2026-55847" ],
  "summary" : "Allure Report: Stored XSS via unescaped ANSI helper in status message/trace rendering",
  "details" : "## Summary\n\nThe `ansi.js` Handlebars helper in allure-generator passes user-controlled `statusMessage` and `statusTrace` values from test result files through the `ansi-to-html` library and wraps the output in Handlebars `SafeString` without HTML escaping. Since `ansi-to-html` does not escape HTML entities by default, an attacker who can influence test result content (e.g., via crafted JUnit XML failure messages) can inject arbitrary JavaScript that executes when anyone views the generated Allure report.\n\n## Details\n\nThe vulnerability is an incomplete fix — commit `4c64b19` (PR #3271) fixed XSS in `linky.js` and `text-with-links.js` by adding `escapeExpression()`, but the same pattern in `ansi.js` was not addressed.\n\n**Vulnerable sink** — `allure-generator/src/main/javascript/helpers/ansi.js:10-11`:\n```javascript\nexport default function (input) {\n    return new SafeString(ansiConverter.toHtml(input));\n};\n```\n\nThe `AnsiToHtml` constructor at line 4 does not set `escapeForHtml: true`:\n```javascript\nconst ansiConverter = new AnsiToHtml({\n    fg: \"black\",\n    bg: \"black\",\n    newline: true,\n});\n```\n\nThe `ansi-to-html` library (v0.7.2) defaults `escapeForHtml` to `false`, meaning HTML entities in the input pass through unchanged. Wrapping the result in `SafeString` tells Handlebars to skip its auto-escaping, so the raw HTML reaches the browser.\n\n**Template usage** — `allure-generator/src/main/javascript/blocks/status-details/status-details.hbs:7,10`:\n```handlebars\n<pre class=\"status-details__message\"><code>{{ansi statusMessage}}</code></pre>\n...\n<pre class=\"{{b 'status-details' 'trace'}}\"><code>{{ansi statusTrace}}</code></pre>\n```\n\n**Source** — `plugins/junit-xml-plugin/src/main/java/io/qameta/allure/junitxml/JunitXmlPlugin.java:307-308`:\n```java\nresult.setStatusMessage(element.getAttribute(MESSAGE_ATTRIBUTE_NAME));\nresult.setStatusTrace(element.getValue());\n```\n\nThese values are read directly from XML attributes with no sanitization. The same pattern exists in TRX, xUnit XML, xctest, and Allure1/2 plugins.\n\n**Contrast with the fixed helper** — `linky.js` (post-fix) correctly escapes before wrapping in `SafeString`:\n```javascript\nconst safeText = escapeExpression(text);\nreturn new SafeString(`<a href=\"${safeText}\" ...>${safeText}</a>`);\n```\n\n## PoC\n\n1. Create a malicious JUnit XML test result file:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuite name=\"XSSTest\" tests=\"1\" failures=\"1\">\n  <testcase name=\"xssPayload\" classname=\"com.example.Test\">\n    <failure message=\"&lt;img src=x onerror=alert(document.cookie)&gt;\">\n      Stack trace: &lt;img src=x onerror=alert('statusTrace_XSS')&gt;\n    </failure>\n  </testcase>\n</testsuite>\n```\n\n2. Generate an Allure report:\n\n```bash\nallure generate /path/to/results-with-malicious-xml -o /tmp/allure-report\n```\n\n3. Open the report and navigate to the failed test case:\n\n```bash\nallure open /tmp/allure-report\n```\n\n4. When viewing the test's status details, the `<img onerror>` payloads execute JavaScript in the viewer's browser.\n\n## Impact\n\n- **Arbitrary JavaScript execution** in the browser of anyone viewing the generated Allure report\n- **Cookie theft, session hijacking** if the report is served from a domain with active sessions (e.g., CI dashboards)\n- **Data exfiltration** — the injected script can read the full report content and send it to an attacker-controlled server\n- **Attack vectors**: A malicious dependency that throws crafted exception messages, a CI pipeline processing test results from untrusted pull requests, or a contributor submitting test files containing XSS payloads\n- Allure reports are commonly hosted on CI/CD platforms (Jenkins, GitLab, GitHub Actions artifacts) where session cookies may be present\n\n## Recommended Fix\n\nConfigure `AnsiToHtml` with `escapeForHtml: true` to escape HTML entities while preserving ANSI-to-HTML conversion:\n\n```javascript\nimport AnsiToHtml from \"ansi-to-html\";\nimport {SafeString} from \"handlebars/runtime\";\n\nconst ansiConverter = new AnsiToHtml({\n    fg: \"black\",\n    bg: \"black\",\n    newline: true,\n    escapeForHtml: true,  // Escape HTML entities in non-ANSI input\n});\n\nexport default function (input) {\n    return new SafeString(ansiConverter.toHtml(input));\n};\n```\n\nThis is the correct approach because it preserves the ANSI escape sequence → HTML conversion (colored output) while ensuring that any non-ANSI HTML in the input is safely escaped. The alternative of using `escapeExpression()` on the input would destroy ANSI sequences before they could be converted.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.qameta.allure:allure-generator"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.39.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.38.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/allure-framework/allure2/security/advisories/GHSA-gx93-m64w-5m6h"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/allure-framework/allure2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T21:15:53Z",
    "nvd_published_at" : null
  }
}