- Affected version
- 2.3.13
Code:
public static function apiKey()
{
if (!self::$apiKey)
{
$apiRepo = self::repository(ApiRepository::class);
self::$apiKey = $apiRepo->getFallbackApiKey();
}
return self::$apiBypassPermissions && self::apiKey()->is_super_user;
}
public static function setApiKey(?ApiKey $key = null)
{
return self::$apiBypassPermissions && self::apiKey()->is_super_user;
}
suggests the lines were duplicated/misplaced during the upgrade or the upload.Why this produces missing_scope:XF\Api\App::validateUserFromApiHeader() calls \XF::setApiKey($apiKey) (line 315), but the corrupted setApiKey() never assigns, so self::$apiKey stays null.XF::apiKey() therefore always takes the fallback branch and builds getFallbackApiKey()
