T05 · Unauthorized Access and Privilege Escalation
- Location
- src/index.mjs:151
- Finding
- Request-Controlled Constraints Can Disable Security Safeguards<![CDATA[ ## Vulnerability Details **File Location**: `src/index.mjs:151-161` **Vulnerability Type**: Authorization policy bypass through untrusted policy configuration **Risk Level**: High ### Vulnerable Code ```js function normalizeConstraints(c = {}) { return { require_ticket: c.require_ticket !== false, require_justification: c.require_justification !== false, require_expiry_for_temporary: c.require_expiry_for_temporary !== false, max_temporary_duration_minutes: Number.isInteger(c.max_temporary_duration_minutes) ? c.max_temporary_duration_minutes : 240, block_wildcard_permissions: c.block_wildcard_permissions !== false, production_requires_human_confirm: c.production_requires_human_confirm !== false, forbid_break_glass_without_incident: c.forbid_break_glass_without_incident !== false }; } ``` The input schema also explicitly permits callers to supply these policy settings: ```json "constraints": { "type": "object", "additionalProperties": false, "properties": { "require_ticket": { "type": "boolean", "default": true }, "require_justification": { "type": "boolean", "default": true }, "require_expiry_for_temporary": { "type": "boolean", "default": true }, "max_temporary_duration_minutes": { "type": "integer", "minimum": 1, "default": 240 }, "block_wildcard_permissions": { "type": "boolean", "default": true }, "production_requires_human_confirm": { "type": "boolean", "default": true }, "forbid_break_glass_without_incident": { "type": "boolean", "default": true } } } ``` ### Technical Analysis The security constraints are taken directly from the same request that is being evaluated. The normalization logic treats an explicit `false` value as authorization to disable the corresponding safeguard. An untrusted requester can therefore disable: - Ticket requirements - Justification requirements - Temporary-access expiration requirements - Wildcard-permission blocking - Production human-confi ...[truncated 1989 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove security-policy controls from the untrusted invocation schema. 2. Load the effective constraints from a trusted deployment configuration, authenticated board configuration, or server-controlled `opts` value. 3. If request-level overrides are necessary, only permit changes that make the policy stricter. For example: - Permit `false` to become `true`, but never `true` to become `false`. - Permit a shorter maximum duration, but never a longer one. 4. Require a separate privileged administrative authorization before accepting weaker policy settings. 5. Record the trusted policy version and policy source in every decision artifact. 6. Add tests proving that request data cannot disable wildcard blocking, ticket enforcement, expiration enforcement, production confirmation, or break-glass incident checks. 7. Fail closed when trusted policy configuration is missing or invalid. ]]>
