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

Java: Introduce a common sanitizer type for types which cannot realistically carry taint. #15291

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

egregius313
Copy link
Contributor

Many queries have dataflow/taint-tracking configurations with an isBarrier definition which check if the node's type is a PrimitiveType, BoxedType, NumberType, etc.

This introduces a new library semmle.code.java.security.dataflow.CommonSanitizers which contains a new sanitizer class SimpleScalarSanitizer, which represents nodes which cannot realistically carry taint for most queries (e.g. primitives, their boxed equivalents, and numeric types).

It also converts existing configurations/sanitizer classes to use instanceof SimpleScalarSanitizer instead.

Important

I am still debating the naming of the library and class. If there is something better than "SimpleScalarSanitizer", I am open to changing the name.

The `SimpleScalarSanitizer` class represents common scalar types which
cannot realistically carry taint (e.g. primitives/numbers, and
eventually UUIDs and Dates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant