Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-34169 PoC — Apache Xalan Java XSLT library is vulnerable to an integer truncation issue when processing malicious XSLT stylesheets

Source
Associated Vulnerability
Title:Apache Xalan Java XSLT library is vulnerable to an integer truncation issue when processing malicious XSLT stylesheets (CVE-2022-34169)
Description:The Apache Xalan Java XSLT library is vulnerable to an integer truncation issue when processing malicious XSLT stylesheets. This can be used to corrupt Java class files generated by the internal XSLTC compiler and execute arbitrary Java bytecode. Users are recommended to update to version 2.7.3 or later. Note: Java runtimes (such as OpenJDK) include repackaged copies of Xalan.
Description
https://nvd.nist.gov/vuln/detail/CVE-2022-34169
Readme
# Description

Checks if CVE-2022-34169 is fixed on your machine. As far as I know, an exploit was found by a Google employee and not published. Since the fix is known, a small test routine was written with this to check whether the fix is available at runtime.

# Build yourself (optional)

Optional: This is only available, if you have JDK:

```
# Optional: To see if `javac` is available: `sudo updatedb && sudo locate /bin/javac`
javac Bcel.java
```

The six warnings can be ignored. The code that is flagged is used to include the Bcel library that is available in OpenJDK. If one were to include the Bcel library oneself, it would be a bit more complicated and the version would be predefined - which is not necessarily in the spirit of this exercise.

# Run

```
# `cd` into (built) folder where `Bcel.class` is, then:
java Bcel
```

# Check output


```
echo $?
```

Don't get confused with the error codes. They are the other way round. The Fix https://github.com/openjdk/jdk/commit/41ef2b249073450172e11163a4d05762364b1297?diff=unified#diff-3d2cb29a8f3fca8e2f3421d2898dce63255b850406456533cce91f26dbf8dbe2R217 throws an error with error code 1 and thus catches the security risk. If the fix is not present, the source code runs through without error with error code 0 - but too many elements are created in the object!

* Error code 1 is good! :)
* Error code 0 is bad! :(

# Results

* OpenJDK 1.8.0_72 - Bad :(
* Oracle 1.8.0_131 - Bad :(
* Oracle 1.8.0_202 - Bad :(
* Oracle 1.8.0_212 - Bad :(
* Oracle 1.8.0_341 - Good :)
* OpenJDK 1.8.0_342 - Good :)

File Snapshot

[4.0K] /data/pocs/1b668d115075f1fb7a7b016136a4d3e21263ae0b ├── [1.4K] Bcel.java ├── [4.0K] built_with_openjdk_1.8.0_342 │   └── [1.5K] Bcel.class ├── [4.0K] built_with_oracle_1.8.0_333 │   └── [1.5K] Bcel.class ├── [4.0K] built_with_oracle_1.8.0_341 │   └── [1.5K] Bcel.class └── [1.5K] README.md 3 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →