
PEACH
Un cadre d’isolation des locataires
Stored XSS in generated HTML reports via unescaped Cucumber JSON fields
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:
<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.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}}]}]}] require('multiple-cucumber-html-reporter').generate({ jsonDir: './json', reportPath: './report' });report/features/. The payloads appear as raw markup and the event handlers run.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.
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.
Found during an internal security review by the maintainer.
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}}]}]}]require('multiple-cucumber-html-reporter').generate({ jsonDir: './json', reportPath: './report' });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.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:
<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
Évaluation gratuite des vulnérabilités
É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.
Obtenez une démo personnalisée
"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."