T05 · Unauthorized Access and Privilege Escalation
- Location
src/analyzers/base_analyzer.py:82- Finding
Substring-Based Author Matching Can Analyze Non-Consenting Identities
- Content
View full analysis
bool: """Check whether a commit's author name/email is in the consent-resolved identity set populated by the orchestrator.""" for author_filter in self.authors: af_lower = author_filter.lower() if af_lower in name.lower() or af_lower in email.lower(): return True return False ``` ### Technical Analysis The consent enforcement mechanism uses unrestricted, case-insensitive substring matching instead of matching complete canonical identities. A consent filter such as `Ann` will match not only an author named `Ann`, but also identities such as: - `Joanne` - `Annette` - `ann-attacker@example.com` - `not-ann@example.org` The same issue affects self-scope mode because the local Git user's name and email are passed into this matching function. Although a complete email generally reduces ambiguity, the local name is also included as an independent filter, and a matching result from either filter is sufficient. This behavior conflicts with the stated guarantee that only the current user or explicitly listed consenting authors are analyzed. Git author metadata is not authenticated and can be freely selected when creating a commit, so it must not be treated as a reliable authorization identifier through fuzzy matching. ### Attack Path 1. A legitimate developer named `Ann` consents to analysis, or the local Git configuration id ...[truncated 1261 chars]- Remediation
View remediation
bool: normalized_name = (name or "").strip().casefold() normalized_email = (email or "").strip().casefold() for identity in self.authorized_identities: if normalized_email and normalized_email == identity.email: return True if ( identity.email is None and normalized_name and normalized_name == identity.name ): return True return False ``` 6. In self-scope mode, require an exact email match when a local Git email is configured. Do not also accept arbitrary names containing the local user's name. 7. Add tests for colliding identities such as `Ann`, `Joanne`, `Annette`, and `ann-attacker@example.com`. 8. Record the exact resolved identities in scope metadata so the report accurately describes whose commits were processed. ]]>
