GHSL-2022-018:Apache Commons 文本中的任意代码执行 - CVE-2022-42889

admin 2022年10月29日23:58:37评论46 views字数 962阅读3分12秒阅读模式

协调披露时间表

  • 2022-03-09:向 [email protected] 报告问题

  • 2022-03-25:Apache Commons 安全团队承认收到报告

  • 2022-05-27:GHSL 请求状态更新

  • 2022-05-27:Apache Commons 安全团队通知他们正在努力默认禁用脚本插值

  • 2022-06-29:Apache Commons 安全团队声明“Commons Text”将被更新,以使程序员使用“危险”功能的意图完全明确

  • 2022-08-11:GHSL 请求状态更新

  • 2022-10-12:Apache Commons Text 发布版本 1.10.0,其中默认禁用脚本插值

概括

StringSubstitutor默认插值器可能导致不安全的脚本评估和任意代码执行

产品

Apache Commons 文本

测试版

1.9

细节

问题:不安全的脚本评估 ( GHSL-2022-018)

StringSubstitutor与默认插值器 ( ) 一起使用时,将StringSubstitutor.createInterpolator()执行可能导致任意代码执行的字符串查找。

特别是,如果不受信任的数据流入StringSubstitutor.replace()orStringSubstitutor.replaceIn()方法,攻击者将能够使用ScriptStringLookup触发任意代码执行。

final StringSubstitutor interpolator = StringSubstitutor.createInterpolator();String out = interpolator.replace("${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}");System.out.println(out);

影响

此问题可能会导致远程代码执行 (RCE)

CVE

  • CVE-2022-42889

资源

  • https://lists.apache.org/thread/n2bd4vdsgkqh2tm14l1wyc3jyol7s1om

原文始发于微信公众号(Ots安全):GHSL-2022-018:Apache Commons 文本中的任意代码执行 - CVE-2022-42889

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年10月29日23:58:37
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   GHSL-2022-018:Apache Commons 文本中的任意代码执行 - CVE-2022-42889http://cn-sec.com/archives/1358009.html

发表评论

匿名网友 填写信息