T05 · Unauthorized Access and Privilege Escalation
- Location
handler.py:46- Finding
Tokenless Inbound Authorization Bypass Through Spoofed Entity Type
- Content
View full analysis
Vulnerability Details
File Location:
handler.py, lines 46-55
Vulnerability Type: Authentication bypass caused by trusting caller-controlled identity attributes
Risk Level: HighVulnerable Code
python if direction == "inbound": # 严格核对 Vault 中的 Token if token and token in topology["valid_owner_tokens"]: decision = "PERMIT" scene_trigger = "SCENE_WELCOME_HOME" if topology["policies"]["scene_linkage"] else None elif entity_type == "silicon_agent" and topology["policies"]["allow_silicon_agents"]: decision = "PERMIT" else: decision = "DENY"Technical Analysis
The inbound authorization logic permits access through either a valid vault token or an
entity_typevalue equal tosilicon_agent. Theentity_typefield is supplied directly by the caller throughhandle_tool_calland is not verified against an authenticated identity, signature, trusted service assertion, or dedicated agent credential.Consequently, an unauthenticated caller can identify itself as a silicon agent and bypass token validation. This violates the documented zero-trust behavior stating that a token not present in
S2_BMS_VAULT_TOKENSresults in denial.The returned reason at
handler.py:64compounds the problem by reporting"Token validated securely."for every permitted request, including requests permitted through this tokenless branch. This may cause downstream systems to interpret the result as evidence of successful credential validation when no token was validated.Attack Path
- Obtain the ability to invoke the
evaluate_spatial_transittool. - Supply the known gateway identifier
MAIN_DOOR_ACS_01. - Set
directiontoinbound. - Set the caller-controlled
entity_typefield tosilicon_agent. - Omit
auth_tokenor provide an invalid token. - The valid-token condition fails, but the silicon-agent condition succeed ...[truncated 1205 chars]
- Obtain the ability to invoke the
- Remediation
View remediation
Remediation Suggestions
-
Require successful credential validation for every inbound request, regardless of the claimed entity type.
python if direction == "inbound": if token and token in topology["valid_owner_tokens"]: decision = "PERMIT" scene_trigger = ( "SCENE_WELCOME_HOME" if topology["policies"]["scene_linkage"] else None ) else: decision = "DENY" -
If silicon agents require a separate authorization path, authenticate them using a dedicated, scoped credential or a cryptographically verified identity assertion. Do not use an untrusted request field as proof of identity.
-
Distinguish human-owner tokens from agent credentials and apply explicit authorization scopes, gateway restrictions, expiration, and revocation.
-
Return an authorization-path-specific reason. Only report that a token was validated when token validation actually succeeded; otherwise, report the verified agent-authentication mechanism or the denial reason.
-
Add automated negative tests covering empty tokens, invalid tokens, spoofed
silicon_agentvalues, unknown entity types, and malformed requests. These tests should verify that none can producePERMITwithout authenticated credentials. -
Ensure the downstream BMS does not execute
ACS_OPEN_RELAYsolely from this advisory. It should independently verify the authenticated principal, authorization scope, gateway, direction, freshness, and replay protection before physical actuation.
-
