This is an automated email from the ASF dual-hosted git repository.
jsedding pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-jsp.git
The following commit(s) were added to refs/heads/master by this push:
new 56fb9dd SLING-13263 - Backport fix for CVE-2016-5018 (#12)
56fb9dd is described below
commit 56fb9dd38acd8afe00b6661069dbe0dd9b6e628f
Author: Julian Sedding <[email protected]>
AuthorDate: Fri Jul 17 12:37:13 2026 +0200
SLING-13263 - Backport fix for CVE-2016-5018 (#12)
---
pom.xml | 2 +-
.../jsp/jasper/compiler/JspRuntimeContext.java | 2 -
.../jsp/jasper/runtime/JspRuntimeLibrary.java | 54 ++--------------------
.../scripting/jsp/jasper/runtime/package-info.java | 2 +-
.../jsp/jasper/security/SecurityClassLoad.java | 3 --
5 files changed, 5 insertions(+), 58 deletions(-)
diff --git a/pom.xml b/pom.xml
index e973bfb..06bfc2a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>org.apache.sling.scripting.jsp</artifactId>
- <version>2.6.3-SNAPSHOT</version>
+ <version>2.7.0-SNAPSHOT</version>
<name>Apache Sling Scripting JSP</name>
<description>Support for JSP scripting</description>
diff --git
a/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/JspRuntimeContext.java
b/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/JspRuntimeContext.java
index c544c53..6fb9e29 100644
---
a/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/JspRuntimeContext.java
+++
b/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/JspRuntimeContext.java
@@ -185,8 +185,6 @@ public final class JspRuntimeContext {
"runtime.JspFactoryImpl$PrivilegedReleasePageContext");
factory.getClass().getClassLoader().loadClass( basePackage +
"runtime.JspRuntimeLibrary");
- factory.getClass().getClassLoader().loadClass( basePackage +
-
"runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
factory.getClass().getClassLoader().loadClass( basePackage +
"runtime.ServletResponseWrapperInclude");
factory.getClass().getClassLoader().loadClass( basePackage +
diff --git
a/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/JspRuntimeLibrary.java
b/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/JspRuntimeLibrary.java
index c4ca690..b1fca40 100644
---
a/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/JspRuntimeLibrary.java
+++
b/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/JspRuntimeLibrary.java
@@ -23,8 +23,6 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Enumeration;
@@ -37,7 +35,6 @@ import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyContent;
-import org.apache.sling.scripting.jsp.jasper.Constants;
import org.apache.sling.scripting.jsp.jasper.JasperException;
import org.apache.sling.scripting.jsp.jasper.compiler.Localizer;
@@ -60,32 +57,9 @@ public class JspRuntimeLibrary {
private static final String JSP_EXCEPTION
= "javax.servlet.jsp.jspException";
- protected static class PrivilegedIntrospectHelper
- implements PrivilegedExceptionAction {
-
- private Object bean;
- private String prop;
- private String value;
- private ServletRequest request;
- private String param;
- private boolean ignoreMethodNF;
-
- PrivilegedIntrospectHelper(Object bean, String prop,
- String value, ServletRequest request,
- String param, boolean ignoreMethodNF)
- {
- this.bean = bean;
- this.prop = prop;
- this.value = value;
- this.request = request;
- this.param = param;
- this.ignoreMethodNF = ignoreMethodNF;
- }
-
+ protected static class PrivilegedIntrospectHelper implements
PrivilegedExceptionAction<Object> {
public Object run() throws JasperException {
- internalIntrospecthelper(
- bean,prop,value,request,param,ignoreMethodNF);
- return null;
+ throw new
UnsupportedOperationException("PrivilegedIntrospectHelper retained only for
binary compatibility");
}
}
@@ -292,29 +266,7 @@ public class JspRuntimeLibrary {
public static void introspecthelper(Object bean, String prop,
String value, ServletRequest request,
String param, boolean ignoreMethodNF)
- throws JasperException
- {
- if( Constants.IS_SECURITY_ENABLED ) {
- try {
- PrivilegedIntrospectHelper dp =
- new PrivilegedIntrospectHelper(
- bean,prop,value,request,param,ignoreMethodNF);
- AccessController.doPrivileged(dp);
- } catch( PrivilegedActionException pe) {
- Exception e = pe.getException();
- throw (JasperException)e;
- }
- } else {
- internalIntrospecthelper(
- bean,prop,value,request,param,ignoreMethodNF);
- }
- }
-
- private static void internalIntrospecthelper(Object bean, String prop,
- String value, ServletRequest request,
- String param, boolean ignoreMethodNF)
- throws JasperException
- {
+ throws JasperException {
Method method = null;
Class type = null;
Class propertyEditorClass = null;
diff --git
a/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/package-info.java
b/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/package-info.java
index 62839ca..61eff12 100644
---
a/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/package-info.java
+++
b/src/main/java/org/apache/sling/scripting/jsp/jasper/runtime/package-info.java
@@ -19,7 +19,7 @@
/**
* This package should only be used by compiled JSP scripts when being
executed on the platform.
*/
-@Version("2.5.0")
+@Version("2.6.0")
package org.apache.sling.scripting.jsp.jasper.runtime;
import org.osgi.annotation.versioning.Version;
diff --git
a/src/main/java/org/apache/sling/scripting/jsp/jasper/security/SecurityClassLoad.java
b/src/main/java/org/apache/sling/scripting/jsp/jasper/security/SecurityClassLoad.java
index 03c931e..59e0b29 100644
---
a/src/main/java/org/apache/sling/scripting/jsp/jasper/security/SecurityClassLoad.java
+++
b/src/main/java/org/apache/sling/scripting/jsp/jasper/security/SecurityClassLoad.java
@@ -46,9 +46,6 @@ public final class SecurityClassLoad {
loader.loadClass( basePackage +
"runtime.JspRuntimeLibrary");
- loader.loadClass( basePackage +
- "runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
-
loader.loadClass( basePackage +
"runtime.ServletResponseWrapperInclude");
loader.loadClass( basePackage +