Files
Guillaume Meyer (The Opinionated Man) fa81cbc23a fix: harden writes, HTTP client, CI supply chain, and resource caps
Security hardening from deep assessment:

- Writes: atomic temp+rename via safe_write_bytes/text (no symlink
  following, no partial in-place loss); backup_path for --in-place;
  umask-default modes; symlink destinations refused.
- rewrite_text: refuse redirects (no Authorization/key re-send to
  unvalidated hosts), default-deny loopback allowlist with explicit
  --allow-remote / WATERMARKS_REWRITE_ALLOW_REMOTE opt-in, http(s)-only
  schemes, --api-key argv flag removed (env-only).
- CI: SHA-pin actions (checkout v7.0.1, setup-python v7.0.0, codeql),
  permissions: contents: read, pinned requirements-dev.txt, pip-audit
  step; new CodeQL workflow.
- Scorer deps: bump Pillow 10.4.0 -> 12.3.0 (24 known CVEs); pip pinned
  in Dockerfile and setup_synthid.sh; Docker runs as unprivileged user.
- Resource caps: MAX_INPUT_BYTES 1GiB -> 256MiB, 64MiB stdin cap,
  zip budget 512MiB -> 128MiB, RLIMIT_AS/FSIZE on child processes.
- Tests: 18 new security regression tests (60 total, all passing).
2026-08-12 21:13:53 -07:00

29 lines
715 B
YAML

name: CodeQL
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "23 3 * * 1"
permissions:
contents: read
# Required for CodeQL to upload SARIF results.
security-events: write
jobs:
analyze:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
language: [python]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: github/codeql-action/init@c16c0f3f2812ec4bb3750a5ed64873fe2ce0fbef # codeql-bundle-v2.26.3
with:
languages: ${{ matrix.language }}
- uses: github/codeql-action/analyze@c16c0f3f2812ec4bb3750a5ed64873fe2ce0fbef # codeql-bundle-v2.26.3