-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Determining if an error message is sensitive? #17094
Comments
Hi @KylerKatz, You're assessment is correct that exists(CatchClause cc, MethodCall mc | mc.getQualifier() = cc.getVariable().getAnAccess() and source.asExpr() = mc) should not occur in the source. This is because it effectively singles out every method call on the variable defined by the catch clause as a source, which is clearly too broad. The usual strategy here would be to use something like a flow state. See here for query that uses one. In you case you would want two states, and initial state that tracks a sensitive variable until you reach a throw, and a second state that you switch to once you observe the throw. You switch by defining an appropriate Unfortunately, the above does not work in your case, because the dataflow library does not support flow from |
Hello @jketema, Thank you for being so helpful. I appreciate it. |
I tried to at least implement the Here is an example code snippet.
Here This is my query for this example
I have confirmed that both the source and sink work as expected by having an example where the source flows directly to the sink by just printing it directly. So, I believe it's an issue with my Thank you for any help. |
Hi @KylerKatz, Not sure if this is still relevant, but your additional step is empty and the following is a possible option to connect the thrown exception object with it uses in a catch clause.
|
This issue is stale because it has been open 14 days with no activity. Comment or remove the |
This issue was closed because it has been inactive for 7 days. |
Hello, I am currently trying to create a query that will allow me to determine whether a servlet message contains sensitive information.
I almost have this working, however, the issue that I am having has to do with false positives.
Say I have this code
In this example, there is sensitive information (dbUrl + dbUser + dbPass) in the e.getMessage() so this would be valid.
However, say we change it to
Now we no longer have sensitive information exposed. However, I am still detecting this. I believe this issue is in this line.
Without it, I don't detect any usages of e.getMessage(), but with it, I detect all of them. When I only want to detect them with sensitive information in them. I believe this should be moved to the isSink check, however, I am not sure how to integrate it.
I appreciate any help, thank you.
The text was updated successfully, but these errors were encountered: