From 16af35cdc4043a39376c7994a898bcf7961afe23 Mon Sep 17 00:00:00 2001
From: Jim Manico
Date: Fri, 24 Jul 2020 18:30:23 -0400
Subject: [PATCH 01/40] Update README.md
---
README.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/README.md b/README.md
index fa24064..1780b4c 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,6 @@ 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 information on how to use this project, please see the [OWASP wiki](https://www.owasp.org/index.php/OWASP_Java_Encoder_Project#tab=Use_the_Java_Encoder_Project).
-
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).
From 70ce36592b023c40d41f2908c9c6d2986adf272b Mon Sep 17 00:00:00 2001
From: kwwall
Date: Wed, 29 Jul 2020 23:23:28 -0400
Subject: [PATCH 02/40] Bump min ESAPI dependency from 2.0 to 2.2.
---
esapi/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/esapi/pom.xml b/esapi/pom.xml
index 260f0f5..637012a 100644
--- a/esapi/pom.xml
+++ b/esapi/pom.xml
@@ -63,7 +63,7 @@
org.owasp.esapi
esapi
- [2.0,3)
+ [2.2,3)
From 7086f40624f8da97e08544804bd287b10dbde954 Mon Sep 17 00:00:00 2001
From: kwwall
Date: Wed, 29 Jul 2020 23:24:42 -0400
Subject: [PATCH 03/40] Bring ESAPIEncoder in compliance with ESAPI 2.2.0.0 and
later Encoder interface which added new methods.
---
.../java/org/owasp/encoder/esapi/ESAPIEncoder.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
index 0f00de0..2363d44 100644
--- a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
+++ b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
@@ -35,6 +35,7 @@
package org.owasp.encoder.esapi;
import java.io.IOException;
+import java.net.URI;
import org.owasp.encoder.Encode;
import org.owasp.esapi.Encoder;
import org.owasp.esapi.codecs.Codec;
@@ -63,6 +64,7 @@
* {@link org.owasp.esapi.Encoder#canonicalize(String)},
* {@link org.owasp.esapi.Encoder#canonicalize(String, boolean)},
* {@link org.owasp.esapi.Encoder#canonicalize(String, boolean, boolean)}
+ * {@link org.owasp.esapi.Encoder#getCanonicalizedURI(URI)}
*
* Decoding methods:
* {@link org.owasp.esapi.Encoder#decodeForHTML(String)},
@@ -80,6 +82,7 @@
* Rarely-used or alternate compatible encoding:
* {@link org.owasp.esapi.Encoder#encodeForVBScript(String)},
* {@link org.owasp.esapi.Encoder#encodeForLDAP(String)},
+ * {@link org.owasp.esapi.Encoder#encodeForLDAP(String, boolean)},
* {@link org.owasp.esapi.Encoder#encodeForDN(String)}
*
*
@@ -152,6 +155,11 @@ public String canonicalize(String s, boolean restrictMultiple, boolean restrictM
return _referenceEncoder.canonicalize(s, restrictMultiple, restrictMixed);
}
+ /** {@inheritDoc} */
+ public String getCanonicalizedURI(URI dirtyUri) {
+ return _referenceEncoder.getCanonicalizedURI(dirtyUri);
+ }
+
/** {@inheritDoc} */
public String encodeForCSS(String s) {
return Encode.forCssString(s);
@@ -197,6 +205,11 @@ public String encodeForLDAP(String s) {
return _referenceEncoder.encodeForLDAP(s);
}
+ /** {@inheritDoc} */
+ public String encodeForLDAP(String s, boolean b) {
+ return _referenceEncoder.encodeForLDAP(s, b);
+ }
+
/** {@inheritDoc} */
public String encodeForDN(String s) {
return _referenceEncoder.encodeForDN(s);
@@ -236,5 +249,6 @@ public String encodeForBase64(byte[] bytes, boolean wrap) {
public byte[] decodeFromBase64(String s) throws IOException {
return _referenceEncoder.decodeFromBase64(s);
}
+
}
}
From b28c534c99d26e93d4b3ec0caac0ab847ebedb0f Mon Sep 17 00:00:00 2001
From: kwwall
Date: Wed, 29 Jul 2020 23:30:11 -0400
Subject: [PATCH 04/40] Minimal properties to get JUnit tests working for
ESAPIEncoderTest.
---
.../test/resources/.esapi/ESAPI.properties | 39 ++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/esapi/src/test/resources/.esapi/ESAPI.properties b/esapi/src/test/resources/.esapi/ESAPI.properties
index bdffd2a..b92f991 100644
--- a/esapi/src/test/resources/.esapi/ESAPI.properties
+++ b/esapi/src/test/resources/.esapi/ESAPI.properties
@@ -1 +1,38 @@
-ESAPI.Encoder=org.owasp.encoder.esapi.ESAPIEncoder
\ No newline at end of file
+# Properties based on ESAPI 2.2.1.1's configuration/esapi/ESAPI.properties file.
+
+ESAPI.Encoder=org.owasp.encoder.esapi.ESAPIEncoder
+
+# Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html
+# Note that this is now considered deprecated!
+#ESAPI.Logger=org.owasp.esapi.logging.log4j.Log4JLogFactory
+
+# To use JUL, you need to obtain ESAPI's esapi-java-logging.properties and drop
+# it somewhere into your class path. You can get it from the ESAPI configuration
+# jar. (See Release 2.2.1.1 under GitHub for ESAPI/esapi-java-legacy.)
+
+#ESAPI.Logger=org.owasp.esapi.logging.java.JavaLogFactory
+# To use the new SLF4J logger in ESAPI (see GitHub issue #129), set
+ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory
+# and do whatever other normal SLF4J configuration that you normally would do for your application.
+
+# Note: The uncommented out ones are those needed for SLF4J. Others may be
+# needed if you change the ESAPI logger.
+#===========================================================================
+# ESAPI Logging
+# Set the application name if these logs are combined with other applications
+Logger.ApplicationName=ESAPI-Shim-Test
+# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true
+Logger.LogEncodingRequired=false
+# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments.
+Logger.LogApplicationName=true
+# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments.
+Logger.LogServerIP=false
+# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you
+# want to place it in a specific directory.
+#Logger.LogFileName=ESAPI_logging_file
+# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000)
+#Logger.MaxLogFileSize=10000000
+# Determines whether ESAPI should log the user info.
+Logger.UserInfo=false
+# Determines whether ESAPI should log the session id and client IP
+Logger.ClientInfo=false
From d816d12b4f06c091fd998afe43f4b98f90f13b81 Mon Sep 17 00:00:00 2001
From: kwwall
Date: Sun, 2 Aug 2020 13:51:14 -0400
Subject: [PATCH 05/40] Change from using SLF4J to JUL for logging.
---
esapi/src/test/resources/.esapi/ESAPI.properties | 4 ++--
esapi/src/test/resources/esapi-java-logging.properties | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
create mode 100644 esapi/src/test/resources/esapi-java-logging.properties
diff --git a/esapi/src/test/resources/.esapi/ESAPI.properties b/esapi/src/test/resources/.esapi/ESAPI.properties
index b92f991..d1d5f41 100644
--- a/esapi/src/test/resources/.esapi/ESAPI.properties
+++ b/esapi/src/test/resources/.esapi/ESAPI.properties
@@ -9,10 +9,10 @@ ESAPI.Encoder=org.owasp.encoder.esapi.ESAPIEncoder
# To use JUL, you need to obtain ESAPI's esapi-java-logging.properties and drop
# it somewhere into your class path. You can get it from the ESAPI configuration
# jar. (See Release 2.2.1.1 under GitHub for ESAPI/esapi-java-legacy.)
+ESAPI.Logger=org.owasp.esapi.logging.java.JavaLogFactory
-#ESAPI.Logger=org.owasp.esapi.logging.java.JavaLogFactory
# To use the new SLF4J logger in ESAPI (see GitHub issue #129), set
-ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory
+#ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory
# and do whatever other normal SLF4J configuration that you normally would do for your application.
# Note: The uncommented out ones are those needed for SLF4J. Others may be
diff --git a/esapi/src/test/resources/esapi-java-logging.properties b/esapi/src/test/resources/esapi-java-logging.properties
new file mode 100644
index 0000000..71011ac
--- /dev/null
+++ b/esapi/src/test/resources/esapi-java-logging.properties
@@ -0,0 +1,6 @@
+handlers= java.util.logging.ConsoleHandler
+.level= INFO
+java.util.logging.ConsoleHandler.level = INFO
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] [%3$-7s] %5$s %n
+#https://www.logicbig.com/tutorials/core-java-tutorial/logging/customizing-default-format.html
\ No newline at end of file
From ca1fbcd20d0ce4c4fd6a5bfcbb9fbbb5f8325f37 Mon Sep 17 00:00:00 2001
From: Philipp Berger
Date: Tue, 13 Oct 2020 13:27:43 +0200
Subject: [PATCH 06/40] Fixes org.owasp.encoder.esapi.ESAPIEncoder.Impl that
does not override all abstract methods
---
.../java/org/owasp/encoder/esapi/ESAPIEncoder.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
index 0f00de0..1aa72b1 100644
--- a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
+++ b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
@@ -35,6 +35,8 @@
package org.owasp.encoder.esapi;
import java.io.IOException;
+import java.net.URI;
+
import org.owasp.encoder.Encode;
import org.owasp.esapi.Encoder;
import org.owasp.esapi.codecs.Codec;
@@ -236,5 +238,15 @@ public String encodeForBase64(byte[] bytes, boolean wrap) {
public byte[] decodeFromBase64(String s) throws IOException {
return _referenceEncoder.decodeFromBase64(s);
}
+
+ /** {@inheritDoc} */
+ public String encodeForLDAP(String input, boolean encodeWildcards) {
+ return _referenceEncoder.encodeForLDAP(input, encodeWildcards);
+ }
+
+ /** {@inheritDoc} */
+ public String getCanonicalizedURI(URI dirtyUri) {
+ return _referenceEncoder.getCanonicalizedURI(dirtyUri);
+ }
}
}
From 573f67f9f6bdc11a3d606e49ab8a9b1314dce035 Mon Sep 17 00:00:00 2001
From: Philipp Berger
Date: Tue, 13 Oct 2020 13:39:06 +0200
Subject: [PATCH 07/40] Generate OSGi-compliant MANIFEST.MF files
---
core/pom.xml | 2 +-
esapi/pom.xml | 4 +-
.../org/owasp/encoder/esapi/ESAPIEncoder.java | 12 -----
jsp/pom.xml | 2 +-
pom.xml | 46 ++++++++++++++++++-
5 files changed, 49 insertions(+), 17 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index cd0293e..70e07e0 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -42,7 +42,7 @@
org.owasp.encoder
encoder-parent
- 1.2.2
+ 1.2.3-SNAPSHOT
encoder
diff --git a/esapi/pom.xml b/esapi/pom.xml
index 260f0f5..93654f3 100644
--- a/esapi/pom.xml
+++ b/esapi/pom.xml
@@ -42,7 +42,7 @@
org.owasp.encoder
encoder-parent
- 1.2.2
+ 1.2.3-SNAPSHOT
encoder-esapi
@@ -63,7 +63,7 @@
org.owasp.esapi
esapi
- [2.0,3)
+ [2.0,2.1)
diff --git a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
index 1aa72b1..0f00de0 100644
--- a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
+++ b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
@@ -35,8 +35,6 @@
package org.owasp.encoder.esapi;
import java.io.IOException;
-import java.net.URI;
-
import org.owasp.encoder.Encode;
import org.owasp.esapi.Encoder;
import org.owasp.esapi.codecs.Codec;
@@ -238,15 +236,5 @@ public String encodeForBase64(byte[] bytes, boolean wrap) {
public byte[] decodeFromBase64(String s) throws IOException {
return _referenceEncoder.decodeFromBase64(s);
}
-
- /** {@inheritDoc} */
- public String encodeForLDAP(String input, boolean encodeWildcards) {
- return _referenceEncoder.encodeForLDAP(input, encodeWildcards);
- }
-
- /** {@inheritDoc} */
- public String getCanonicalizedURI(URI dirtyUri) {
- return _referenceEncoder.getCanonicalizedURI(dirtyUri);
- }
}
}
diff --git a/jsp/pom.xml b/jsp/pom.xml
index 2407a5c..02722aa 100644
--- a/jsp/pom.xml
+++ b/jsp/pom.xml
@@ -42,7 +42,7 @@
org.owasp.encoder
encoder-parent
- 1.2.2
+ 1.2.3-SNAPSHOT
encoder-jsp
diff --git a/pom.xml b/pom.xml
index d81ad2c..c427304 100755
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,7 @@
org.owasp.encoder
encoder-parent
- 1.2.2
+ 1.2.3-SNAPSHOT
pom
OWASP Java Encoder Project
@@ -238,6 +238,11 @@
maven-pmd-plugin
3.6
+
+ org.apache.felix
+ maven-bundle-plugin
+ 3.3.0
+
org.codehaus.mojo
versions-maven-plugin
@@ -265,6 +270,26 @@
1.5
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ default-bundle
+ process-classes
+
+ manifest
+
+
+ true
+
+ <_noee>true
+ <_nouses>true
+
+
+
+
+
org.codehaus.mojo
cobertura-maven-plugin
@@ -297,6 +322,25 @@
-Xmx1024m -XX:MaxPermSize=256m
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+ default-jar
+ package
+
+ jar
+
+
+ true
+
+ ${project.build.outputDirectory}/META-INF/MANIFEST.MF
+
+
+
+
+
org.apache.maven.plugins
maven-source-plugin
From c0b6c7f0f4c408dcfb5633adb1c84df2c6e57c5d Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sat, 7 Nov 2020 08:04:22 -0500
Subject: [PATCH 08/40] specify dist so both jdk8 are available
---
.travis.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.travis.yml b/.travis.yml
index a26172b..5206c1e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,5 @@
language: java
+dist: trusty
jdk:
- openjdk8
From ad91194bfe981b91b9e36cd8339b7dbb74fdc9ce Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sat, 7 Nov 2020 08:04:36 -0500
Subject: [PATCH 09/40] release version
---
core/pom.xml | 2 +-
esapi/pom.xml | 2 +-
jsp/pom.xml | 2 +-
pom.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index 70e07e0..ad329f1 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -42,7 +42,7 @@
org.owasp.encoder
encoder-parent
- 1.2.3-SNAPSHOT
+ 1.2.3
encoder
diff --git a/esapi/pom.xml b/esapi/pom.xml
index 93654f3..8105a7d 100644
--- a/esapi/pom.xml
+++ b/esapi/pom.xml
@@ -42,7 +42,7 @@
org.owasp.encoder
encoder-parent
- 1.2.3-SNAPSHOT
+ 1.2.3
encoder-esapi
diff --git a/jsp/pom.xml b/jsp/pom.xml
index 02722aa..f720cb6 100644
--- a/jsp/pom.xml
+++ b/jsp/pom.xml
@@ -42,7 +42,7 @@
org.owasp.encoder
encoder-parent
- 1.2.3-SNAPSHOT
+ 1.2.3
encoder-jsp
diff --git a/pom.xml b/pom.xml
index c427304..d3ea074 100755
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,7 @@
org.owasp.encoder
encoder-parent
- 1.2.3-SNAPSHOT
+ 1.2.3
pom
OWASP Java Encoder Project
From 18ab74037f17c6bbf070107ac5359a8584c5373a Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sun, 8 Nov 2020 07:54:07 -0500
Subject: [PATCH 10/40] fix javadoc
---
esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
index 2363d44..02334bd 100644
--- a/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
+++ b/esapi/src/main/java/org/owasp/encoder/esapi/ESAPIEncoder.java
@@ -63,7 +63,7 @@
* Input validation/normalization methods:
* {@link org.owasp.esapi.Encoder#canonicalize(String)},
* {@link org.owasp.esapi.Encoder#canonicalize(String, boolean)},
- * {@link org.owasp.esapi.Encoder#canonicalize(String, boolean, boolean)}
+ * {@link org.owasp.esapi.Encoder#canonicalize(String, boolean, boolean)}
* {@link org.owasp.esapi.Encoder#getCanonicalizedURI(URI)}
*
* Decoding methods:
From 9218ce72a703f4e01086f8ed1dd7e86b142d43b9 Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sun, 8 Nov 2020 07:54:22 -0500
Subject: [PATCH 11/40] fix checkstyle config
---
src/main/config/checkstyle.xml | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/main/config/checkstyle.xml b/src/main/config/checkstyle.xml
index 6811c0f..aefb33c 100644
--- a/src/main/config/checkstyle.xml
+++ b/src/main/config/checkstyle.xml
@@ -25,7 +25,11 @@
-
+
+
+
+
+
@@ -75,12 +79,6 @@
-
-
-
-
-
-
From c19e49d974d1b277b8df89bc49bb4f9965a7fdc3 Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sun, 8 Nov 2020 13:03:16 -0500
Subject: [PATCH 12/40] update checkstyle checks
---
core/src/main/java/org/owasp/encoder/HTMLEncoder.java | 2 ++
src/main/config/checkstyle.xml | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/owasp/encoder/HTMLEncoder.java b/core/src/main/java/org/owasp/encoder/HTMLEncoder.java
index ad36223..068fba0 100644
--- a/core/src/main/java/org/owasp/encoder/HTMLEncoder.java
+++ b/core/src/main/java/org/owasp/encoder/HTMLEncoder.java
@@ -278,6 +278,7 @@ static int encode(int codePoint, char[] out, int j) {
return j;
}
+ //CSOFF: MethodLength
@Override
CoderResult encodeArrays(CharBuffer input, CharBuffer output, boolean endOfInput) {
final char[] in = input.array();
@@ -494,4 +495,5 @@ CoderResult encodeArrays(CharBuffer input, CharBuffer output, boolean endOfInput
return underflow(input, i, output, j);
}
+ //CSON: MethodLength
}
diff --git a/src/main/config/checkstyle.xml b/src/main/config/checkstyle.xml
index aefb33c..3f2c8b6 100644
--- a/src/main/config/checkstyle.xml
+++ b/src/main/config/checkstyle.xml
@@ -31,7 +31,11 @@
-
+
+
+
+
+
@@ -143,7 +147,7 @@
Date: Sun, 8 Nov 2020 13:53:25 -0500
Subject: [PATCH 13/40] v1.2.3
---
README.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/README.md b/README.md
index 1780b4c..fb5a84d 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,11 @@ 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.
From 2e4f429ec1cc0237951de477fffdaf1b2c8829ae Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sun, 8 Nov 2020 14:00:02 -0500
Subject: [PATCH 14/40] updated for 1.2.3
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index fb5a84d..8f6df8a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
OWASP Java Encoder Project
==========================
-[](https://travis-ci.org/OWASP/owasp-java-encoder) [](https://opensource.org/licenses/BSD-3-Clause)
+[](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
@@ -11,7 +11,7 @@ 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).
+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.3/encoder-jsp-1.2.3.jar).
The jars are also available in Maven:
@@ -19,20 +19,20 @@ The jars are also available in Maven:
org.owasp.encoder
encoder
- 1.2.2
+ 1.2.3
org.owasp.encoder
encoder-jsp
- 1.2.2
+ 1.2.3
```
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,
+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:
From fa5c589fb6037e0b7e9bb6b21b537a5411420ac7 Mon Sep 17 00:00:00 2001
From: Jeremy Long
Date: Sun, 8 Nov 2020 14:04:15 -0500
Subject: [PATCH 15/40] updated to 1.2.3
---
core/src/site/markdown/index.md | 2 +-
jsp/src/site/markdown/index.md | 2 +-
src/site/markdown/index.md | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/src/site/markdown/index.md b/core/src/site/markdown/index.md
index bc39882..ec848da 100644
--- a/core/src/site/markdown/index.md
+++ b/core/src/site/markdown/index.md
@@ -19,7 +19,7 @@ The JARs can be found in [Maven Central](https://search.maven.org/#search%7Cga%7
org.owasp.encoder
encoder
- 1.2.2
+ 1.2.3
```
diff --git a/jsp/src/site/markdown/index.md b/jsp/src/site/markdown/index.md
index 3c4a200..e2c305a 100644
--- a/jsp/src/site/markdown/index.md
+++ b/jsp/src/site/markdown/index.md
@@ -17,7 +17,7 @@ includes tags and a set of JSP EL functions:
org.owasp.encoder
encoder-jsp
- 1.2.2
+ 1.2.3
```
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index 0fa1a86..0273e4f 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -18,7 +18,7 @@ The JARs can be found in [Maven Central](https://search.maven.org/#search%7Cga%7
org.owasp.encoder
encoder
- 1.2.2
+ 1.2.3
```
@@ -42,7 +42,7 @@ includes tags and a set of JSP EL functions:
org.owasp.encoder
encoder-jsp
- 1.2.2
+ 1.2.3
```
From b34d8f8f46418e4f60b2c38a740669456ec3e3c2 Mon Sep 17 00:00:00 2001
From: Andreas Hager
Date: Sun, 7 Feb 2021 10:03:17 +0100
Subject: [PATCH 16/40] Add automatic module name
---
META-INF/MANIFEST.MF | 1 +
1 file changed, 1 insertion(+)
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index 2aaee67..992fb32 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -7,3 +7,4 @@ Bundle-Version: 1.2.1
Created-By: 1.8.0_181 (Oracle Corporation)
Export-Package: org.owasp.encoder
Tool: Bnd-1.50.0
+Automatic-Module-Name: org.owasp.encoder
From 1e858125ef482877030ac906e7d0bf6a67f1e18f Mon Sep 17 00:00:00 2001
From: Andreas Hager
Date: Sun, 7 Feb 2021 10:58:16 +0100
Subject: [PATCH 17/40] Revert adding Automatic-Modulue-Name to root
MANIFEST.MF
---
META-INF/MANIFEST.MF | 1 -
1 file changed, 1 deletion(-)
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index 992fb32..2aaee67 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -7,4 +7,3 @@ Bundle-Version: 1.2.1
Created-By: 1.8.0_181 (Oracle Corporation)
Export-Package: org.owasp.encoder
Tool: Bnd-1.50.0
-Automatic-Module-Name: org.owasp.encoder
From f5bb67496a874f04828395016cb6b0b1d95c35e9 Mon Sep 17 00:00:00 2001
From: Andreas Hager
Date: Sun, 7 Feb 2021 10:59:04 +0100
Subject: [PATCH 18/40] Add Automatic-Modulue-Name via apache felix bundle
plugin for each module.
---
core/pom.xml | 4 ++++
esapi/pom.xml | 4 ++++
jsp/pom.xml | 4 ++++
pom.xml | 1 +
4 files changed, 13 insertions(+)
diff --git a/core/pom.xml b/core/pom.xml
index ad329f1..29baed5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -56,6 +56,10 @@
Scripting.
+
+ org.owasp.encoder
+
+
diff --git a/esapi/pom.xml b/esapi/pom.xml
index 263f4e0..fbf5c1f 100644
--- a/esapi/pom.xml
+++ b/esapi/pom.xml
@@ -54,6 +54,10 @@
Projects API into an implementation of ESAPI.
+
+ org.owasp.encoder.esapi
+
+
org.owasp.encoder
diff --git a/jsp/pom.xml b/jsp/pom.xml
index f720cb6..2b25fac 100644
--- a/jsp/pom.xml
+++ b/jsp/pom.xml
@@ -55,6 +55,10 @@
definitions and JSP EL functions.
+
+ org.owasp.encoder.jsp
+
+
org.owasp.encoder
diff --git a/pom.xml b/pom.xml
index d3ea074..5d1a085 100755
--- a/pom.xml
+++ b/pom.xml
@@ -285,6 +285,7 @@
<_noee>true
<_nouses>true
+ ${jigsaw.module.name}
From 93b1f42a2b441722183c048dfda663cf042abe2f Mon Sep 17 00:00:00 2001
From: Jim Manico
Date: Tue, 31 Aug 2021 13:55:07 -0700
Subject: [PATCH 19/40] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 8f6df8a..ac535fd 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,8 @@ 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/].
+
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).
From e45f81d2abd1f531fb8adcf5fc5711be624c068f Mon Sep 17 00:00:00 2001
From: Jim Manico
Date: Tue, 31 Aug 2021 13:55:28 -0700
Subject: [PATCH 20/40] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ac535fd..b153a1d 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ 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/].
+For more detailed documentation on the OWASP Javca Encoder please visit https://owasp.org/www-project-java-encoder/.
Start using the OWASP Java Encoders
-----------------------------------
From cd2dbfe45354beff050034f532efb0d79f40d52c Mon Sep 17 00:00:00 2001
From: kwwall
Date: Mon, 13 Sep 2021 21:50:41 -0400
Subject: [PATCH 21/40] Close issue #51. Correct javadoc for Encode class.
---
.../main/java/org/owasp/encoder/Encode.java | 39 +++++++++++--------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/core/src/main/java/org/owasp/encoder/Encode.java b/core/src/main/java/org/owasp/encoder/Encode.java
index 89d7ed9..165635c 100644
--- a/core/src/main/java/org/owasp/encoder/Encode.java
+++ b/core/src/main/java/org/owasp/encoder/Encode.java
@@ -53,7 +53,12 @@
*
* Please make sure to read and understand the context that the method encodes
* for. Encoding for the incorrect context will likely lead to exposing a
- * cross-site scripting vulnerability.
+ * cross-site scripting vulnerability. Those new to XSS mitigation may find it
+ * useful to read the
+ *
+ * Cross Site Scripting Prevention Cheat Sheet that is part of the OWASP Cheat Sheet series for background
+ * material.
+ *
*
* @author Jeff Ichnowski
*/
@@ -66,7 +71,7 @@ private Encode() {}
* this method encodes for both contexts, it may be slightly less
* efficient to use this method over the methods targeted towards
* the specific contexts ({@link #forHtmlAttribute(String)} and
- * {@link #forHtmlContent(String)}. In general this method should
+ * {@link #forHtmlContent(String)}). In general this method should
* be preferred unless you are really concerned with saving a few
* bytes or are writing a framework that utilizes this
* package.
@@ -155,7 +160,7 @@ public static void forHtml(Writer out, String input) throws IOException {
/**
* This method encodes for HTML text content. It does not escape
* quotation characters and is thus unsafe for use with
- * HTML attributes. Use either forHtml or forHtmlAttribute for those
+ * HTML attributes. Use either {@link #forHtml(String)} or {@link #forHtmlAttribute(String)} for those
* methods.
*
* Example JSP Usage
@@ -232,7 +237,9 @@ public static void forHtmlContent(Writer out, String input)
}
/**
- * This method encodes for HTML text attributes.
+ * This method encodes for HTML text attributes. Do not use for JavaScript event attributes or for attributes
+ * that are interpreted as a URL. Instead use {@link #forJavaScript(String)} and {@link #forUriComponent(String)}
+ * respectively for those.
*
* Example JSP Usage
*
@@ -472,15 +479,13 @@ public static void forHtmlUnquotedAttribute(Writer out, String input)
* Encoding Notes
*