fix(appsec): add auth enforcement and security regression tests to all routers - #41
Draft
izzywdev wants to merge 1 commit into
Draft
fix(appsec): add auth enforcement and security regression tests to all routers#41izzywdev wants to merge 1 commit into
izzywdev wants to merge 1 commit into
Conversation
…l routers Co-Authored-By: Claude claude-sonnet-4-6 <noreply@anthropic.com> Claude-Session-Id: 25bc310d-3986-490d-b009-0079285c519b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rescues and lands uncommitted appsec work from the
fix/appsec-authzbranch. Addresses multiple findings from appsec audit #18.SECRET_KEYdefault. Fails closed (HTTP 503) on JWT ops when key is unset, blank, or a known-insecure placeholder. All jwt.encode/decode route through_require_secret_key().require_identity_scope). A service key may only act for identities listed in<SERVICE>_ALLOWED_IDENTITY_IDSenv. Unset/blank = deny all (fail closed). Resolves cross-tenant BOLA/enumeration on all four credential endpoints.get_current_user(JWT) + ownership-scoped identity lookups. Closes unauthenticated PII exfiltration + account-creation vector. Migrated to async SQLAlchemy.Depends(get_current_user)gates every route (LLM POSTs, destructive DELETE)./signup,/signin,/apikeynow require auth — these drive credential-bearing browser automation.from sqlalchemy.future import select).Test plan
pytest backend/tests/test_security_regressions.py -vSECRET_KEY; confirm token endpoints return 503POST /api/google/signup/{id}without Bearer; confirm 401POST /api/llm-scraper/generatewithout Bearer; confirm 401POST /api/v1/integrations/signupwithout Bearer; confirm 401