Short summary
A client-side search feature consumed a generated search.json and rendered results by injecting HTML strings. If search.json contains malicious content, a visitor using search could execute arbitrary JavaScript in the site origin. This is a high-impact vulnerability and should be fixed and CI‑checked immediately.
Fix applied (summary)
search.json generation: fields serialized with Liquid jsonify to produce valid, safe JSON.
src/js/simpleJekyllSearch.js: switched from string-based templating to DOM construction with textContent to avoid HTML parsing of untrusted values.
src/js/target_blank.js: added rel="noopener noreferrer" for external links to prevent reverse tabnabbing.
Verification (quick commands)
- Manual PoC test: create malicious
search.json and open poc-search-xss.html.
- Run the verification scripts added in
scripts/:
# run these from repo root
node scripts/check_search_json.js
node scripts/check_target_blank_rel.js .
Short summary
A client-side search feature consumed a generated
search.jsonand rendered results by injecting HTML strings. Ifsearch.jsoncontains malicious content, a visitor using search could execute arbitrary JavaScript in the site origin. This is a high-impact vulnerability and should be fixed and CI‑checked immediately.Fix applied (summary)
search.jsongeneration: fields serialized with Liquidjsonifyto produce valid, safe JSON.src/js/simpleJekyllSearch.js: switched from string-based templating to DOM construction withtextContentto avoid HTML parsing of untrusted values.src/js/target_blank.js: addedrel="noopener noreferrer"for external links to prevent reverse tabnabbing.Verification (quick commands)
search.jsonand openpoc-search-xss.html.scripts/: