-
Notifications
You must be signed in to change notification settings - Fork 2
Add sensitive information exposure query #126
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
Conversation
javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll
Outdated
Show resolved
Hide resolved
javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll
Outdated
Show resolved
Hide resolved
javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll
Outdated
Show resolved
Hide resolved
javascript/frameworks/cap/src/sensitive-exposure/SensitiveExposure.md
Outdated
Show resolved
Hide resolved
javascript/frameworks/cap/src/sensitive-exposure/SensitiveExposure.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some thoughts on improving the structure of the query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superb!
|
||
class SensitiveExposureSource extends DataFlow::Node { | ||
SensitiveExposureSource() { | ||
exists(PropRead p, SensitiveAnnotatedElement c | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a problem here as you are only comparing on the property name (name
in the test vs Sample.name
)
There can be multiple entities with the same names as well as multiple applications in the same repo...
I think you can use getCdsDeclaration()
* @problem.severity warning | ||
* @security-severity 7.5 | ||
* @precision medium | ||
* @id javascript/sensitive-log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the js
language code: @id js/sensitive-log
https://github.com/github/codeql/blob/main/docs/query-metadata-style-guide.md#query-id-id
currently this query only covers the case of a
PropRead
(ie entity field) being the exact match for the annotated sensitive element. Technically also the entire entity (see entity level labels) can be labelled as@PersonalData
but I am considering to define the first iteration of this with the heuristic that fields in that case are still what also get annotated additionally and exposed.happy to reconsider based on other's thoughts! :)