GHSA-2v74-9pcq-cq9m: 
JavaScript Analyse et atténuation de la vulnérabilité

Summary

Stored XSS in generated HTML reports via unescaped Cucumber JSON fields

Details

Impact

multiple-cucumber-html-reporter builds HTML reports from Cucumber JSON result files. Several text fields from that JSON are written into the generated pages without HTML escaping. If an attacker can control the content of a results file, for example through a malicious feature file or pull request in a project whose CI generates and publishes reports, the report can run arbitrary JavaScript in the browser of anyone who opens it. The affected fields are:

  • the feature name and feature tags
  • the scenario name, scenario description and scenario tags
  • the step name The feature description is escaped in the visible page. However, the full results JSON is also embedded inline inside a <script> block in index.html and in each feature page without neutralizing </script>. A value that contains </script> can therefore end that block early and inject markup, so every string field in the JSON is a possible injection point. All released versions are affected; this was confirmed on 0.1.0, 1.0.0, 2.0.0, 3.0.0, 4.0.0 and 4.7.0.

Proof of concept

  1. Save this as json/t.json:
    [{"id":"f","uri":"f.feature","keyword":"Feature","name":"FEAT<img src=x onerror=alert('feat')>","description":"DESC<script>alert('desc')</script>","line":1,"tags":[{"name":"@TAG<b>x</b>","line":1}],"elements":[{"id":"s","keyword":"Scenario","type":"scenario","line":3,"name":"SCEN<img src=x onerror=alert(1)>","description":"SDESC<svg onload=alert(2)>","tags":[{"name":"@T<i>y</i>","line":2}],"steps":[{"keyword":"Given ","line":4,"name":"STEP<img src=x onerror=alert(3)>","result":{"status":"passed","duration":1000}}]}]}]
  1. Generate a report:
    require('multiple-cucumber-html-reporter').generate({ jsonDir: './json', reportPath: './report' });
  1. Open the generated feature page in report/features/. The payloads appear as raw markup and the event handlers run.

Patches

Fixed in version X.Y.Z. All text taken from Cucumber JSON is now HTML-escaped before rendering, and the inline JSON data is serialized safely: <, >, &, U+2028 and U+2029 are escaped, so </script> can't end the block.

Workarounds

Until you can upgrade, only generate reports from trusted Cucumber JSON. Don't publish reports built from untrusted branches or forks, and serve published reports with a restrictive Content-Security-Policy that blocks inline scripts and event handlers.

Credits

Found during an internal security review by the maintainer.

Proof of concept

Proof of concept

  1. Save this as json/t.json:
[{"id":"f","uri":"f.feature","keyword":"Feature","name":"FEAT<img src=x onerror=alert('feat')>","description":"DESC<script>alert('desc')</script>","line":1,"tags":[{"name":"@TAG<b>x</b>","line":1}],"elements":[{"id":"s","keyword":"Scenario","type":"scenario","line":3,"name":"SCEN<img src=x onerror=alert(1)>","description":"SDESC<svg onload=alert(2)>","tags":[{"name":"@T<i>y</i>","line":2}],"steps":[{"keyword":"Given ","line":4,"name":"STEP<img src=x onerror=alert(3)>","result":{"status":"passed","duration":1000}}]}]}]
  1. Generate a report:
require('multiple-cucumber-html-reporter').generate({ jsonDir: './json', reportPath: './report' });
  1. Open the generated feature page in report/features/. The payloads appear as raw markup, for example <h4 …>SCEN<img src=x onerror=alert(1)></h4>, <span>STEP<img src=x onerror=alert(3)></span> and <div …>SDESC<svg onload=alert(2)></div>, and the event handlers run.

Impact

Impact

multiple-cucumber-html-reporter builds HTML reports from Cucumber JSON result files. Several text fields from that JSON are written into the generated pages without HTML escaping. If an attacker can control the content of a results file, for example through a malicious feature file or pull request in a project whose CI generates and publishes reports, the report can run arbitrary JavaScript in the browser of anyone who opens it. The affected fields are:

  • the feature name and feature tags
  • the scenario name, scenario description and scenario tags
  • the step name The feature description is escaped in the visible page. However, the full results JSON is also embedded inline inside a <script> block in index.html and in each feature page without neutralizing </script>. A value that contains </script> can therefore end that block early and inject markup, so every string field in the JSON is a possible injection point. Reports are often published as CI artifacts or on internal sites, and shared with team members who may be signed in to other internal tools. That makes this a stored XSS risk for teams that generate reports from untrusted or partly trusted test sources.

Source: NVD

Connexe JavaScript Vulnérabilités :

CVE ID

Gravité

Partition

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

GHSA-jxvc-9hcf-fw42CRITICAL9.2
  • JavaScript logoJavaScript
  • mysql2
NonOuiDec 05, 2026
GHSA-mxg9-wm8p-75g7HIGH8.3
  • JavaScript logoJavaScript
  • mysql2
NonOuiDec 05, 2026
GHSA-rw72-639f-x4f2HIGH7.1
  • JavaScript logoJavaScript
  • @atpdeveloper/atp-cli
NonOuiDec 05, 2026
GHSA-6j7m-7ww6-rcr4MEDIUM5.5
  • JavaScript logoJavaScript
  • atp-hermes-hook
NonOuiDec 05, 2026
GHSA-2v74-9pcq-cq9mMEDIUMN/A
  • JavaScript logoJavaScript
  • multiple-cucumber-html-reporter
NonOuiDec 05, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.

Évaluation de la demande

Ressources Wiz supplémentaires

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités