Skip to content

fix: harden what the security scan flagged (https-only downloads, no strtok, SHA-1 marked not for security) - #1470

Merged
NotRexed merged 1 commit into
mainfrom
sec-hardening
Nov 10, 2026
Merged

NotRexed merged 1 commit into
mainfrom
sec-hardening

Conversation

@NotRexed

Copy link
Copy Markdown
Owner

Follows up the security-scan triage (the real finding, the Dependabot cooldown, landed in #1464). The rest were false positives; where a small change makes the code actually safer, this makes it:

  • Downloads are https-only. builder/linux/linux_update.py sends every urlopen through _https(), which refuses anything else (the release API's asset link included). scripts/release_parts.py's get() does the same, so the CI token is never sent over plain http.
  • No strtok in setup. builder/setup/setup.c splits the setup list with next_line(): strtok's work without its hidden state. Checked on CRLF, blank lines, an empty list, and a list with no last newline.
  • SHA-1 cache keys are marked usedforsecurity=False. The digests are the same, so every build cache stays valid. It also lets the scripts run on FIPS-mode Pythons.
  • The AppRun chmod 0o755 now has a note on why: the launcher has to run.

The "generic API key" hits are 64-bit shader IDs and test constants, so nothing to change there.

Tested: setup.c compiles with llvm-mingw clang (no new warnings), and the Python files parse. test_linux_update/test_make_game_* give the same results as main on Windows; the Linux-only cases run in CI.

🤖 Generated with Claude Code

…k in setup, SHA-1 cache keys marked not for security

- builder/linux/linux_update.py: every urlopen goes through _https(), which refuses anything but an https link
  (the release API's asset link included); the AppRun chmod notes why it is 0o755.
- scripts/release_parts.py: get() refuses non-https links, so the CI token is never sent over plain http.
- builder/setup/setup.c: the setup list is split with next_line(), strtok's work without its hidden state.
- nx2/*.py: hashlib.sha1(..., usedforsecurity=False) for the build-cache and fingerprint keys (same digests, so
  every cache stays valid; also lets the scripts run on FIPS-mode Pythons).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NotRexed
NotRexed merged commit d3cca66 into main Nov 10, 2026
10 checks passed
@NotRexed
NotRexed deleted the sec-hardening branch November 10, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant