Skip to content

fix(Security): Host header injection auth bypass and forged admin emb… - #1353

Merged
fit2cloud-chenyw merged 1 commit into
mainfrom
pr@main@fix_embedded_auth_bypass
Aug 31, 2026
Merged

fix(Security): Host header injection auth bypass and forged admin emb…#1353
fit2cloud-chenyw merged 1 commit into
mainfrom
pr@main@fix_embedded_auth_bypass

Conversation

@fit2cloud-chenyw

Copy link
Copy Markdown
Contributor

No description provided.

…edded token (CNVD)

- TokenMiddleware/ResponseMiddleware/audit logger use scope['path']
  instead of request.url.path for whitelist checks: a crafted Host
  header (e.g. x/api/v1/mcp) was concatenated into Starlette's URL
  and made protected routes match the /mcp* whitelist entry
- validateEmbedded rejects admin accounts and non-type-4 apps, so a
  self-signed token with account=admin can no longer impersonate the
  administrator
- Add HostValidationMiddleware rejecting malformed Host headers at the
  outermost layer (defense in depth)
- Add regression tests for host validation, whitelist matching and
  source-level guards

Co-Authored-By: Claude <noreply@anthropic.com>
@fit2cloud-chenyw

Copy link
Copy Markdown
Contributor Author

LGTM

@fit2cloud-chenyw
fit2cloud-chenyw merged commit bbfc4cc into main Aug 31, 2026
2 of 3 checks passed
@fit2cloud-chenyw
fit2cloud-chenyw deleted the pr@main@fix_embedded_auth_bypass branch August 31, 2026 03:05
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