[2026 errata] zenodo_release.py interpolates raw HTML and javascript: URLs into the public deposit

Aperta
#169 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@drk-ram ci sta già lavorando.

Dal 6/11/2026.

  • #171 di @drk-ram — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
release, security

Direzione di ricerca

Start in .github/scripts/zenodo_release.py: build_metadata() builds the HTML description and related_identifiers, and collect_files() resolves include paths and writes them with ZipFile. Check linked PR #171 first, since it is already open against this issue. Done means the description is HTML-escaped, only https URLs with a host are accepted, and symlinks or paths outside the repo are refused with an explicit error, with regression tests added.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Affected section

Other

Where does the issue appear?

GitHub source

What is incorrect?

.github/scripts/zenodo_release.py build_metadata() copies CITATION.cff abstract and url into the Zenodo HTML description and into related_identifiers with no escaping and no scheme check.

Reproduction against the script on origin/main:

meta = build_metadata({
    "title": "T",
    "authors": [{"family-names": "Doe", "given-names": "Ada"}],
    "abstract": "Safe text </p><script>alert(1)</script><p>",
    "url": "javascript:alert(document.domain)",
    "license": "CC-BY-SA-4.0",
}, {"metadata": {}}, "2026", None)

Observed description:

<p>Safe text </p><script>alert(1)</script><p></p><p>Project site: <a href="javascript:alert(document.domain)">javascript:alert(document.domain)</a></p>

related_identifiers contains that javascript: URL.

The same publisher also selects an include path that resolves outside the repository (REPO_ROOT / absolute_path replaces the root on this platform, and Path.is_file() is true). collect_files() then dies with an uncaught ValueError from Path.relative_to instead of a confinement error. A symlink inside an include directory still passes relative_to (the link path is inside the repo) while ZipFile.write stores the link target's bytes. A release checkout with a symlink, or a config include that escapes the repo, can therefore publish non-repository bytes or abort the release without a clear refusal. This is not the token-transport bug in #138 or the UTF-8 / DSGAI07 fix in #152.

Proposed correction

HTML-escape the description, accept only https URLs that have a host, and refuse symlinks and any path that resolves outside the repository. Fail closed with an explicit error. Add regression tests.

Supporting evidence

Local run of build_metadata() on the origin/main script, quoted above. Zenodo deposit descriptions are HTML: https://developers.zenodo.org/

Acknowledgments
  • I checked the published release and the canonical GitHub source for an existing correction.
  • I agree to follow the OWASP Code of Conduct.
Lingua principale
JavaScript
Stelle
177
Fork
57
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GenAI-Security-Project/GenAI-LLM-Top10

Tutte le issue di GenAI-Security-Project/GenAI-LLM-Top10

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.