Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-4444-JWT-Algorithm-Confusion-via-kid-Injection — 针对 CVE-2026-4444 的 POC,演示通过不受信任的 kid 注入导致的 JWT 算法混淆,包含易受攻击的 Node.js 服务器以及用于令牌伪造和权限提升的 Python 漏洞利用程序。 | Kitploit
工具/GitHubGitHub/george0papasotiriou/cve-2026-4444-jwt-algorithm-confusion-via-kid-injection
身份验证与授权漏洞利用Web应用程序漏洞利用密码学学习与教育API 安全实验室与实践
GitHubgeorge0papasotiriou/cve-2026-4444-jwt-algorithm-confusion-via-kid-injection

CVE-2026-4444-JWT-Algorithm-Confusion-via-kid-Injection

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

针对 CVE-2026-4444 的 POC,演示通过不受信任的 kid 注入导致的 JWT 算法混淆,包含易受攻击的 Node.js 服务器以及用于令牌伪造和权限提升的 Python 漏洞利用程序。

查看仓库
18天前尚未审核

CVE-2026-4444 – 通过 kid 注入导致的 JWT 算法混淆

程序代码(Node.js 服务器 + Python 漏洞利用)

root@kitploit:~
// jwt_server.js - Vulnerable JWT verification server
const express = require('express');
const jwt = require('jsonwebtoken');
const jwksClient = require('jwks-rsa');
const axios = require('axios');

const app = express();
app.use(express.json());

// Normally fetches public key from a JWKS endpoint, but vulnerable kid handling
async function getPublicKey(kid) {
    // Attacker can inject a kid that points to their own URL
    if (kid.startsWith('http://') || kid.startsWith('https://')) {
        // Fetch the key from attacker-controlled URL (INSECURE!)
        const response = await axios.get(kid);
        return response.data.publicKey; // expects PEM
    }
    // Otherwise use local JWKS (simulated)
    return `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCYZM5rPY4
...
-----END PUBLIC KEY-----`;
}

app.post('/api/verify', async (req, res) => {
    const token = req.body.token;
    const decoded = jwt.decode(token, { complete: true });
    const kid = decoded.header.kid;
    try {
        const publicKey = await getPublicKey(kid);
        const payload = jwt.verify(token, publicKey, { algorithms: ['RS256','HS256'] });
        res.json({ status: 'authenticated', user: payload.sub });
    } catch (e) {
        res.status(401).json({ error: e.message });
    }
});

app.listen(3000, () => console.log('JWT server on :3000'));

CVE-2026-4444 – 通过 kid 注入导致的 JWT 算法混淆

Severity: Critical

概述

JWT 验证服务盲目信任 kid 标头来定位公钥,从而允许攻击者提供指向其自身密钥的 URL。这会导致完整的令牌伪造和权限提升。

漏洞详情

  • 类型: JWT 算法混淆 / SSRF
  • 影响: 未授权访问、管理员冒充。
  • 根本原因: 服务器从用户控制的 kid URI 获取公钥,而未验证其是否属于受信任来源。

漏洞利用演示

  1. 启动存在漏洞的服务器:
    root@kitploit:~
    node jwt_server.js
    
  2. 运行漏洞利用脚本(该脚本还会启动一个伪造的密钥服务器):
    root@kitploit:~
    python exploit_jwt_kid.py
    
下载工具