commit | 2cf43d31947868496925b5b15df2a4a560a5656c | [log] [tgz] |
---|---|---|
author | Andrew Vuong <[email protected]> | Fri Mar 31 20:57:02 2023 +0000 |
committer | Presubmit Automerger Backend <android-build-presubmit-automerger-backend@system.gserviceaccount.com> | Fri Mar 31 20:57:02 2023 +0000 |
tree | dffefd0374f7ed3358f3a252c2e2aafba60b76be | |
parent | aa8399f7c5dc71d37f7affe865d2c46df539b3ec [diff] | |
parent | 6a30958ac795b8a4a03d052d8b1475ca207215cf [diff] |
[automerged blank] Initial import of owasp-java-encoder from upstream main 2p: 6a30958ac7 Blank merge reason: Change-Id I89d97ac6be9533b10d9add01706d59260b686cdd with SHA-1 3566f56059 is in history Original change: https://googleplex-android-review.googlesource.com/c/platform/external/owasp/java-encoder/+/22389311 Bug: 262898801 Change-Id: Iaf30143811a6860a3d2ba82a7428bf01b7411189 Merged-In: I89d97ac6be9533b10d9add01706d59260b686cdd
Contextual Output Encoding is a computer programming technique necessary to stop Cross-Site Scripting. This project is a Java 1.5+ simple-to-use drop-in high-performance encoder class with little baggage.
For more detailed documentation on the OWASP Javca Encoder please visit https://owasp.org/www-project-java-encoder/.
You can download a JAR from Maven Central.
JSP tags and EL functions are available in the encoder-jsp, also available in Central.
The jars are also available in Maven:
<dependency> <groupId>org.owasp.encoder</groupId> <artifactId>encoder</artifactId> <version>1.2.3</version> </dependency> <dependency> <groupId>org.owasp.encoder</groupId> <artifactId>encoder-jsp</artifactId> <version>1.2.3</version> </dependency>
The OWASP Java Encoder library is intended for quick contextual encoding with very little overhead, either in performance or usage. To get started, simply add the encoder-1.2.3.jar, import org.owasp.encoder.Encode and start using.
Example usage:
PrintWriter out = ....; out.println("<textarea>"+Encode.forHtml(userData)+"</textarea>");
Please look at the javadoc for Encode to see the variety of contexts for which you can encode.
Happy Encoding!
The team is happy to announce that version 1.2.3 has been released!
The team is happy to announce that version 1.2.2 has been released!
The team is happy to announce that version 1.2.1 has been released!
OWASP Java Encoder has been moved to GitHub. Version 1.2 was also released!
Please visit https://www.owasp.org/index.php/OWASP_Java_Encoder_Project#tab=Use_the_Java_Encoder_Project to see detailed documentation and examples on each API use!
We're happy to announce that version 1.1.1 has been released. Along with a important bug fix, we added ESAPI integration to replace the legacy ESAPI encoders with the OWASP Java Encoder.
We're happy to announce that version 1.1 has been released. Along with a few minor encoding enhancements, we improved performance, and added a JSP tag and function library.