pax_global_header 0000666 0000000 0000000 00000000064 13752037245 0014522 g ustar 00root root 0000000 0000000 52 comment=1218c16431020dc0d9df2f100f5bf039b2b5d215
owasp-java-encoder-1.2.3/ 0000775 0000000 0000000 00000000000 13752037245 0015212 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/.gitignore 0000664 0000000 0000000 00000000344 13752037245 0017203 0 ustar 00root root 0000000 0000000 */target/**
/target/**
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
# Eclipse project files
.classpath
.project
.settings
maven-eclipse.xml
.externalToolBuilders
# Netbeans configuration
nb-configuration.xml
*/nbproject/*
owasp-java-encoder-1.2.3/.travis.yml 0000664 0000000 0000000 00000000355 13752037245 0017326 0 ustar 00root root 0000000 0000000 language: java
dist: trusty
jdk:
- openjdk8
- oraclejdk8
# to compile using JDK 9+ we must move from source and target 1.5 to 1.6
# - openjdk9
# - openjdk10
# - openjdk11
# - oraclejdk9
# - oraclejdk10
script: mvn test -B -X
owasp-java-encoder-1.2.3/LICENSE 0000664 0000000 0000000 00000002771 13752037245 0016226 0 ustar 00root root 0000000 0000000 Copyright (c) 2015 Jeff Ichnowski
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the OWASP nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE. owasp-java-encoder-1.2.3/META-INF/ 0000775 0000000 0000000 00000000000 13752037245 0016352 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/META-INF/MANIFEST.MF 0000664 0000000 0000000 00000000412 13752037245 0020001 0 ustar 00root root 0000000 0000000 Manifest-Version: 1.0
Bnd-LastModified: 1533328833261
Bundle-ManifestVersion: 2
Bundle-Name: org.owasp.encoder
Bundle-SymbolicName: org.owasp.encoder
Bundle-Version: 1.2.1
Created-By: 1.8.0_181 (Oracle Corporation)
Export-Package: org.owasp.encoder
Tool: Bnd-1.50.0
owasp-java-encoder-1.2.3/README.md 0000664 0000000 0000000 00000006167 13752037245 0016503 0 ustar 00root root 0000000 0000000 OWASP Java Encoder Project
==========================
[](https://travis-ci.org/OWASP/owasp-java-encoder) [](https://opensource.org/licenses/BSD-3-Clause)
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.
Start using the OWASP Java Encoders
-----------------------------------
You can download a JAR from [Maven Central](https://search.maven.org/#search|ga|1|g%3A%22org.owasp.encoder%22%20a%3A%22encoder%22).
JSP tags and EL functions are available in the encoder-jsp, also available in [Central](http://search.maven.org/remotecontent?filepath=org/owasp/encoder/encoder-jsp/1.2/encoder-jsp-1.2.jar).
The jars are also available in Maven:
```xml
org.owasp.encoder
encoder
1.2.2
org.owasp.encoder
encoder-jsp
1.2.2
```
Quick Overview
--------------
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.jar,
import org.owasp.encoder.Encode and start using.
Example usage:
```java
PrintWriter out = ....;
out.println("");
```
Please look at the javadoc for Encode to see the variety of contexts for which you can encode.
Happy Encoding!
News
----
### 2020-11-08 - 1.2.3 Release
The team is happy to announce that version 1.2.3 has been released!
* Update to make the manifest OSGi-compliant (#39).
* Update to support ESAPI 2.2 and later (#37).
### 2018-09-14 - 1.2.2 Release
The team is happy to announce that version 1.2.2 has been released!
* This is a minor release fixing documentation and licensing issues.
### 2017-02-19 - 1.2.1 Release
The team is happy to announce that version 1.2.1 has been released!
* The CDATA Encoder was modified so that it does not emit intermediate characters between adjacent CDATA sections.
* The documentation on [gh-pages](http://owasp.github.io/owasp-java-encoder/) has been improved.
### 2015-04-12 - 1.2 Release on GitHub
OWASP Java Encoder has been moved to GitHub. Version 1.2 was also released!
### 2014-03-31 - Documentation updated
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!
### 2014-01-30 - Version 1.1.1 released
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.
### 2013-02-14 - Version 1.1 released
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.
owasp-java-encoder-1.2.3/core/ 0000775 0000000 0000000 00000000000 13752037245 0016142 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/pom.xml 0000664 0000000 0000000 00000007743 13752037245 0017472 0 ustar 00root root 0000000 0000000
4.0.0
org.owasp.encoder
encoder-parent
1.2.3
encoder
jar
Java Encoder
The OWASP Encoders package is a collection of high-performance low-overhead
contextual encoders, that when utilized correctly, is an effective tool in
preventing Web Application security vulnerabilities such as Cross-Site
Scripting.
org.apache.maven.plugins
maven-surefire-plugin
org/owasp/encoder/BenchmarkTest.java
benchmark
org.apache.maven.plugins
maven-failsafe-plugin
-Xmx1024m -XX:MaxPermSize=256m
org/owasp/encoder/BenchmarkTest.java
integration-test
verify
owasp-java-encoder-1.2.3/core/src/ 0000775 0000000 0000000 00000000000 13752037245 0016731 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/src/main/ 0000775 0000000 0000000 00000000000 13752037245 0017655 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/src/main/java/ 0000775 0000000 0000000 00000000000 13752037245 0020576 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/src/main/java/org/ 0000775 0000000 0000000 00000000000 13752037245 0021365 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/src/main/java/org/owasp/ 0000775 0000000 0000000 00000000000 13752037245 0022516 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/src/main/java/org/owasp/encoder/ 0000775 0000000 0000000 00000000000 13752037245 0024135 5 ustar 00root root 0000000 0000000 owasp-java-encoder-1.2.3/core/src/main/java/org/owasp/encoder/ASCIIBits.java 0000664 0000000 0000000 00000010161 13752037245 0026451 0 ustar 00root root 0000000 0000000 // Copyright (c) 2012 Jeff Ichnowski
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// * Neither the name of the OWASP nor the names of its
// contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
package org.owasp.encoder;
/**
* ASCIIBits - Small helper class for building up 128-bit bit-mask (2 longs)
* to be used testing lower-ASCII characters. It helps make some other code
* easier to read. It is not intended to be public.
*/
class ASCIIBits {
/** Lower 64 bits. */
long _lowerMask;
/** Upper 64 bits. */
long _upperMask;
/**
* Sets a bit to 1 for each character in the argument string. No checking
* is performed to see if characters are in the valid range 0..127.
*
* @param chars the characters to set to 1.
* @return {@code this}
*/
ASCIIBits set(String chars) {
for (int i=0, n=chars.length() ; i