Skip to content

fix(security): enforce portal build authorization - #2

Merged
arcwiser merged 3 commits into
mainfrom
fix/portal-file-authorization
Nov 2, 2026
Merged

arcwiser merged 3 commits into
mainfrom
fix/portal-file-authorization

Conversation

@arcwiser

@arcwiser arcwiser commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • close a portal authorization bypass that allowed expired or paused product entitlements to list and download restricted builds
  • enforce release lifecycle controls in portal downloads (is_active, archived/revoked state, and availability windows)
  • correctly authorize builds scoped through app_file_products, instead of treating mapped builds with a null legacy product_id as unrestricted
  • record successful portal downloads in file_download_events
  • update the pinned FastAPI/Starlette, cryptography, multipart, dotenv, and Uvicorn stack to versions with no known advisories in pip-audit
  • fix the PowerShell merge-marker CI gate so a clean git grep result exits successfully

Security impact

Previously, a portal user with any live entitlement could access a portal-visible file tied to a different product if that product entitlement was expired or paused. Multi-product mappings were also ignored, so a mapped file with no legacy product_id was treated as unrestricted. Revoked, archived, inactive, and out-of-window files were not filtered by the portal endpoints either.

The shared portal access predicate now requires a live, unpaused entitlement for at least one allowed active product and applies the same release lifecycle checks to listing and download.

Verification

  • python -m pytest -q tests — 90 passed, 23 subtests passed
  • python -m pytest -q tests/test_admin_security.py -k portal — 2 passed
  • python -m pip_audit -r requirements.txt — no known vulnerabilities found (previous pins reported 40 advisory matches)
  • python -m compileall -q main.py database.py routes utils
  • git diff --check

@arcwiser
arcwiser merged commit a1ab7ee into main Nov 2, 2026
2 checks passed
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