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

taint analysis for org.bson.Document.parse(String) #1036

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jgaleotti
Copy link
Collaborator

No description provided.

@jgaleotti jgaleotti requested a review from arcuri82 July 17, 2024 21:14
// Load the Document class
Class<?> documentClass;
try {
documentClass = Class.forName("org.bson.Document");
Copy link
Collaborator

Choose a reason for hiding this comment

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

in instrumentation, a call to Class.forName is extremely tricky. for example, the classloader of Class and of Mongo driver could be different (eg in a SpringBoot application run with external driver).
have a look at all the shenanigans had to go through in ThirdPartyMethodReplacementClass.getOriginalConstructor.
in other words, this might work in E2E tests, but fail to work in the experiments.
likely would need to use UnitsInfoRecorder.getInstance().getClassLoaders

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I pushed a way of handling class loaders for static methods in ThirdPartyMethodReplacementClass. Please have a look at getOriginalStaticMethod(), specially how the callerName is obtained.

@jgaleotti jgaleotti requested a review from arcuri82 July 25, 2024 12:18
@arcuri82
Copy link
Collaborator

@jgaleotti thx. I LL look at it next week

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.

None yet

2 participants