
cve-2022-34169 延伸出的Jdk Xalan的payload自动生成工具,可根据不同的Jdk生成出其所对应的xslt文件
This is an automated payload generation tool for the JDK Xalan overflow vulnerability (CVE-2022-34169). It was created because different JDK versions require different overflow payloads. Running this tool with different JDK versions will generate different XSLT exploit files.
Copy select.bak.xslt to select.xslt and modify the command to be executed.

Then run java -jar AutoGenerateXalanPayload.jar. Some errors may be thrown during the process; ignore them. After execution, the generated select.xslt will be the Xalan overflow command execution payload for that JDK version.

https://mp.weixin.qq.com/s/xxAtjFvk9RxWiY-pwGf8Ow
Due to the large number of JDK minor versions, I used a binary search method to compare versions from JDK 1.6 to JDK 1.8. Using JDK 1.7 as an example: first test the highest minor version of JDK 1.7 to obtain an XSLT, and define its content as type A. Then test the lowest minor version of JDK 1.7 to obtain another XSLT. If the two XSLTs are identical, it means all versions between the lowest and highest JDK 1.7 use the same type A payload. If they differ, I test the middle version of JDK 1.7 and continue the binary search. This is the fastest method I could think of – it avoids installing every single version while still covering all possibilities. For example, from the tested results below: Jdk-8u301 uses type A, Jdk-8u202 uses type A, so is it possible that Jdk-8u221 (the midpoint between them) uses type B? No.
Below are my test results, showing six different payload types between JDK 1.6 and JDK 1.8.
https://blog.noah.360.net/xalan-j-integer-truncation-reproduce-cve-2022-34169/
| JDK version | XSLS type |
|---|
| Jdk-8u301 | A |
| Jdk-8u202 | A |
| Jdk-8u162 | A |
| Jdk8u152 | A |
| Jdk8u151 | B |
| Jdk8u144 | B |
| Jdk8u131 | B |
| Jdk8u121 | C |
| Jdk8u111 | C |
| Jdk8u102 | D |
| Jdk8u101 | D |
| Jdk8u91 | D |
| Jdk8u60 | D |
| Jdk8u20 | D |
| Jdk7u40 | D |
| Jdk7u21 | D |
| Jdk7u10 | D |
| Jdk7u05 | D |
| Jdk7u04 | D |
| Jdk7u03 | E |
| Idk7u02 | E |
| Jdk7u0 | E |
| Jdk6u45 | E |
| Jdk6u20 | E |
| Jdk6u17 | F |
| Jdk6u15 | F |
| Jdk6u10 | F |
| Jdk6u0 | F |