zenodo_release.py: send the API token as a Bearer header, and validate the bucket host
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 30/100
Research direction
Start in .github/scripts/zenodo_release.py at deposit() and list every request call that passes params=params. Read test_zenodo_release.py around line 143 to see the current query-parameter assertion and the example.invalid bucket stub, then update both with the code. Done means those requests use an Authorization: Bearer header, the bucket host is checked against the API base and fails closed, and the tests cover both. Linked pull request #139 is already open, so check it before starting.
Written by the indexing model from the issue text.
Description
Summary
.github/scripts/zenodo_release.py sends the Zenodo API token as an access_token query parameter on every request. It should send Authorization: Bearer <token> instead. A second, smaller issue: the bundle upload attaches that token to a URL taken from the API response without checking the host.
Both are low risk while the script runs by hand from a laptop, as documentation/ZENODO.md describes. They matter more once the deposit runs from CI against a repository secret, which is the direction the doc lays out.
1. Token in the query string
deposit() builds params = {"access_token": token} and passes it to all six request calls.
URLs carrying that parameter get written to places that outlive the request:
- web server and reverse proxy access logs
- any intermediary or corporate egress proxy
Refererheaders on downstream navigations- shell history and CI job logs whenever a URL is echoed
Zenodo accepts Authorization: Bearer <token>, which keeps the credential in a header that logging stacks do not record by default.
Fix: replace params=params with headers={"Authorization": f"Bearer {token}"} throughout deposit().
2. Credential attached to an unvalidated host
The bundle upload targets draft["links"]["bucket"], which Zenodo supplies in its response:
requests.put(f"{draft['links']['bucket']}/{bundle.name}", data=handle, params=params, timeout=TIMEOUT)
The API base is hardcoded to zenodo.org or sandbox.zenodo.org, so this rests on trusting Zenodo to return its own bucket rather than on an open redirect. It is still a credential sent to a host the script never checked. A response-shaping bug or a compromised endpoint would leak a token that carries deposit:write and deposit:actions.
Fix: verify the bucket URL's host matches the API base host before the upload, and fail closed if it does not.
Scope
Both changes live in deposit(). test_zenodo_release.py asserts the current query-parameter behavior on line 143 and stubs a bucket on example.invalid, so both need updating alongside.
- Dominant language
- JavaScript
- Stars
- 177
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GenAI-Security-Project/GenAI-LLM-Top10
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
GenAI-Security-Project/GenAI-LLM-Top10#176 · 1 comment · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
GenAI-Security-Project/GenAI-LLM-Top10#131 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
[Release feedback] Make Zenodo source bundles reproducible across checkoutsPossibly taken @drk-ram claimed this 20 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 32/100
All issues in GenAI-Security-Project/GenAI-LLM-Top10
Similar issues
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpOpenenhancement feature: settings good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
grafana/viz-contract#151 ·
Maintainers usually reply within 1 day
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mastra-ai/mastra#32336 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nextcloud-libraries/nextcloud-vue#9280 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jellyfin/jellyfin-web#8910 ·
Maintainers usually reply within 1 day