Repository navigation
fix: validate caller app on Entra inbound Agent ID tokens - #935
Open
Corina (corinagum) wants to merge 2 commits into
Open
Corina (corinagum) wants to merge 2 commits into
Corina (corinagum) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Malformed azp values can incorrectly fall back to an allowed appid.
1 open finding
What changed in this PR
Restricts Entra-authenticated inbound activities to the Agent 365 platform.
Changes:
- Validates
azp, withappidfallback. - Adds caller-validation and Bot Framework regression tests.
| File | Description |
|---|---|
inbound-activity-token-validator.ts |
Adds caller-app authorization. |
inbound-activity-token-validator.spec.ts |
Tests accepted and rejected callers. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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
Inbound activities authenticated with an Entra (Agent ID) token are now accepted only when the token was requested by the Agent 365 platform. The caller app is read from
azp, falling back toappidfor v1 tokens, and compared case-insensitively. Tokens from any other client app are rejected with 401. Bot Framework tokens are unaffected.Changes
InboundActivityTokenValidatorchecks the caller app after Entra token validation succeeds.Behavior change
Entra-authenticated activities sent from any app other than the Agent 365 platform (for example, a custom client or another bot calling the bot's endpoint directly with an Entra token) now receive 401.
Testing
azp, allowedappid, case-insensitive match,azpprecedence, disallowedazp, disallowedappid, missing caller claims, and Bot Framework tokens unaffected.