Skip to content

Add more org.owasp.esapi.Encoder escape functions tainting support#5624

Merged
jandro996 merged 2 commits into
masterfrom
alejandro.gonzalez/esapi_escape_functions
Aug 16, 2023
Merged

Add more org.owasp.esapi.Encoder escape functions tainting support#5624
jandro996 merged 2 commits into
masterfrom
alejandro.gonzalez/esapi_escape_functions

Conversation

@jandro996

@jandro996 jandro996 commented Jul 24, 2023

Copy link
Copy Markdown
Member

What Does This Do

Add taint tracking support to:

  • org.owasp.esapi.Encoder#canonicalize(String) -> mark for XSS
  • org.owasp.esapi.Encoder#canonicalize(String, boolean) -> mark for XSS
  • org.owasp.esapi.Encoder#canonicalize(String, boolean, boolean) -> mark for XSS
  • org.owasp.esapi.Encoder#encodeForLDAP -> mark for LDAP_INJECTION
  • org.owasp.esapi.Encoder#encodeForOS -> mark for COMMAND_INJECTION
  • org.owasp.esapi.Encoder#encodeForSQL -> mark for SQL_INJECTION

Motivation

Additional Notes

@jandro996 jandro996 added the comp: asm iast Application Security Management (IAST) label Jul 24, 2023
@jandro996 jandro996 changed the title Add more org.owasp.esapi.Encoder escape functions taint tracking Add more org.owasp.esapi.Encoder escape functions tainting support Jul 24, 2023
@pr-commenter

pr-commenter Bot commented Jul 24, 2023

Copy link
Copy Markdown

Benchmarks

Parameters

Baseline Candidate
commit 1.19.0-SNAPSHOT~996e0b0158 1.19.0-SNAPSHOT~ba15c35311
config baseline candidate
See matching parameters
Baseline Candidate
module Agent Agent
parent None None

Summary

Found 1 performance improvements and 0 performance regressions! Performance is the same for 21 cases.

scenario Δ mean execution_time
scenario:Startup-iast-IAST better
[-1247.623µs; -649.371µs] or [-9.108%; -4.741%]

@jandro996
jandro996 marked this pull request as ready for review July 24, 2023 11:42
@jandro996
jandro996 requested a review from a team as a code owner July 24, 2023 11:42
return result;
}

@CallSite.After("java.lang.String org.owasp.esapi.Encoder.canonicalize(java.lang.String)")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I miss some smoke tests to validate that we don't trigger XSS vulnerabilities when the encoder is used

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Probably the best place to test that are smoke test as each piece of code is unitary tested. I will extend this comment to all the escape function instrumentation PRs so maybe the best approach is to create a new PR with this new smoke tests. @smola do you agree with that?

@jandro996
jandro996 merged commit 51cca99 into master Aug 16, 2023
@jandro996
jandro996 deleted the alejandro.gonzalez/esapi_escape_functions branch August 16, 2023 11:18
@github-actions github-actions Bot added this to the 1.20.0 milestone Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm iast Application Security Management (IAST)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants