Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip file entries are incorrectly parsed as directories instead of class files #75

Open
c01dc0ffee opened this issue Mar 29, 2024 · 2 comments

Comments

@c01dc0ffee
Copy link

Obfuscated class files stored in the jar file which are suffixed with a directory separator character are incorrectly detected as directories. The JVM will still parse these pseudo-directories as class files.

See: https://github.com/sim0n/Caesium/blob/master/src/main/java/dev/sim0n/caesium/manager/ClassManager.java#L95

@ingokegel
Copy link
Owner

Can you attach such a JAR file, so I can try it out?

@c01dc0ffee
Copy link
Author

c01dc0ffee commented Apr 12, 2024

test-1.0-SNAPSHOT-tamper.jar.zip

image

java -jar test-1.0-SNAPSHOT-tamper.jar
Hello world!

Archive manager programs may also interpret this similarly. Here's what 7zip says:
image

Tested with:

openjdk version "1.8.0_345"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (Temurin)(build 25.345-b01, mixed mode)

openjdk version "11.0.16.1" 2022-08-12
OpenJDK Runtime Environment Temurin-11.0.16.1+1 (build 11.0.16.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.16.1+1 (build 11.0.16.1+1, mixed mode)

openjdk version "17.0.4.1" 2022-08-12
OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode, sharing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants