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 GA Language Rules #197

Closed
37 tasks done
elsapet opened this issue Jan 26, 2024 · 0 comments
Closed
37 tasks done

Java GA Language Rules #197

elsapet opened this issue Jan 26, 2024 · 0 comments
Assignees

Comments

@elsapet
Copy link
Collaborator

elsapet commented Jan 26, 2024

Bringing the Java rules to GA will be a three-step process.

  1. Improve rule coverage

We currently have ~20 Java rules. The initial part of this work will be to expand our Java rule set to cover a wider area, predominantly Java lang rules (and not e.g. 3rd party API rules as this is step 2).

Focus - Java is missing rules for the following CWEs and these should be the initial focus.

CWEs to be supported that are known Java candidates:

Additional CWEs to be supported (some may not be good Java candidates):

  1. Add 3rd party API rules (CWE-201 - "Insertion of Sensitive Information Into Sent Data"). This is the list from other languages supported by bearer-rules, and part of this step will be to investigate which of these APIs are supported by Java:

As we did with Go, PHP and JS (in the case of Google Dataflow), we skip the Google APIs:

  • Google Analytics worth of rule is unclear. API accessed through HTTP calls (which we would catch in other rules) or through a client. Client usage relies on builders making detection very fine grained
  • Google Dataflow

The following third parties are not applicable in terms of Java rules:

And the following are not currently supported they require us to catch on sensitive data being entered into HashMap data structures

  1. Battle test 💪

Spring cases from battle testing

  • Include Spring @RequestParam annotation (see Spring docs) as user input e.g. someMethod(@RequestParam String payload)
  • CWE-352 CSRF in Spring - HttpSecurity instance without csrf enabled

SQLi cases from battle testing

  • Snyk (and Semgrep) counts as SQLi any query string that includes a variable. Some of these were known user input because of Spring @RequestParam annotation, but a lot were simply the function argument included in the query string. Likely a larger question across all languages whether we want to catch such cases, and how (warning-level, for example).
@elsapet elsapet self-assigned this Jan 26, 2024
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

No branches or pull requests

2 participants