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

feat: add feature to detect runtime generated classes #64

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

algomaster99
Copy link
Member

Fixes #61

@algomaster99
Copy link
Member Author

Running our tool on sorald-0.8.5 does not produce exit code 1 anymore. See: eb3ea91 (#64)

@@ -33,6 +34,9 @@ public byte[] transform(

private static byte[] isLoadedClassWhitelisted(String className, byte[] classfileBuffer) {
Map<String, List<Provenance>> fingerprints = options.getFingerprints();
if (RuntimeClass.isProxyClass(classfileBuffer) || RuntimeClass.isSynthetic(classfileBuffer)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am really unsure about synthetic classes. We should keep an eye on them and include them in the threat model.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree with you. We could remove this condition also, as I have never encountered a case yet. The test is also very artificial.

@MartinWitt
Copy link
Contributor

LGTM 👍

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

Successfully merging this pull request may close these issues.

Explore the SYNTHETIC flag for runtime classes
2 participants