You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@struts.apache.org by "jefferyxhy (via GitHub)" <gi...@apache.org> on 2024/04/11 02:47:08 UTC

[PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

jefferyxhy opened a new pull request, #914:
URL: https://github.com/apache/struts/pull/914

   WW-5409
   
    &nbsp;
   
   **Reason**
   Extending packages is a very useful capability of Struts but there are some quirks, that if a developer is not aware of, can lead to critical vulnerabilities. One such misunderstood quirk is the default-interceptor-ref element.
   
   e.g. a parent package add permission interceptor for its action (say **Action A**), while child package extends parent package will inherit its actions but not interceptor. So if the develop is not aware of this, then Action A is now exposed with permission vuln through child package's namespace.
   
    &nbsp;
    
   **Changes/ Solution**
   introduce new `final` attribute on `package` element which will make it is unextendable
   
     &nbsp;
     
   **Result & Impact**
   * By default, package `final` attribute is implied as `false`, so no difference.
   * Set package `final` attribute explicitly as `true`, will make this package unextendable, so any extends to this package will cause a ConfigurationException to be thrown during application struts config xml load step.
    
    &nbsp;


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

Posted by "jefferyxhy (via GitHub)" <gi...@apache.org>.
jefferyxhy commented on code in PR #914:
URL: https://github.com/apache/struts/pull/914#discussion_r1560440790


##########
core/src/main/resources/struts-6.4.0.dtd:
##########
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<!-- START SNIPPET: strutsDtd -->
+
+<!--
+   Struts configuration DTD.
+   Use the following DOCTYPE
+
+   <!DOCTYPE struts PUBLIC
+    "-//Apache Software Foundation//DTD Struts Configuration 6.4.0//EN"
+    "https://struts.apache.org/dtds/struts-6.4.0.dtd">

Review Comment:
   updated. Thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

Posted by "jefferyxhy (via GitHub)" <gi...@apache.org>.
jefferyxhy commented on code in PR #914:
URL: https://github.com/apache/struts/pull/914#discussion_r1562054799


##########
core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java:
##########
@@ -54,6 +54,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
         put("-//Apache Software Foundation//DTD Struts Configuration 2.3//EN", "struts-2.3.dtd");
         put("-//Apache Software Foundation//DTD Struts Configuration 2.5//EN", "struts-2.5.dtd");
         put("-//Apache Software Foundation//DTD Struts Configuration 6.0//EN", "struts-6.0.dtd");
+        put("-//Apache Software Foundation//DTD Struts Configuration 6.5.0//EN", "struts-6.5.0.dtd");

Review Comment:
   Yeah. It make sense. I've updated the naming accordingly. Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

Posted by "kusalk (via GitHub)" <gi...@apache.org>.
kusalk merged PR #914:
URL: https://github.com/apache/struts/pull/914


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart commented on code in PR #914:
URL: https://github.com/apache/struts/pull/914#discussion_r1562038780


##########
core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java:
##########
@@ -54,6 +54,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
         put("-//Apache Software Foundation//DTD Struts Configuration 2.3//EN", "struts-2.3.dtd");
         put("-//Apache Software Foundation//DTD Struts Configuration 2.5//EN", "struts-2.5.dtd");
         put("-//Apache Software Foundation//DTD Struts Configuration 6.0//EN", "struts-6.0.dtd");
+        put("-//Apache Software Foundation//DTD Struts Configuration 6.5.0//EN", "struts-6.5.0.dtd");

Review Comment:
   I would keep two digits pattern as such changes cannot be introduced with `PATCH` version anyway. So instead of 
   ```java
   put("-//Apache Software Foundation//DTD Struts Configuration 6.5.0//EN", "struts-6.5.0.dtd")
   ```
   use
   ```java
   put("-//Apache Software Foundation//DTD Struts Configuration 6.5//EN", "struts-6.5.dtd")
   ```
   and rename the corresponding file.
   
   ---
   
   What do you think? does it make sense?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart commented on code in PR #914:
URL: https://github.com/apache/struts/pull/914#discussion_r1560427870


##########
core/src/main/resources/struts-6.4.0.dtd:
##########
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<!-- START SNIPPET: strutsDtd -->
+
+<!--
+   Struts configuration DTD.
+   Use the following DOCTYPE
+
+   <!DOCTYPE struts PUBLIC
+    "-//Apache Software Foundation//DTD Struts Configuration 6.4.0//EN"
+    "https://struts.apache.org/dtds/struts-6.4.0.dtd">

Review Comment:
   Yes, please. Struts 6.4.0 is out (not officially released yet) and this change will be included in 6.5.0



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WW-5409 introduce final attribute to package element which make them unextendable [struts]

Posted by "jefferyxhy (via GitHub)" <gi...@apache.org>.
jefferyxhy commented on code in PR #914:
URL: https://github.com/apache/struts/pull/914#discussion_r1560423741


##########
core/src/main/resources/struts-6.4.0.dtd:
##########
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<!-- START SNIPPET: strutsDtd -->
+
+<!--
+   Struts configuration DTD.
+   Use the following DOCTYPE
+
+   <!DOCTYPE struts PUBLIC
+    "-//Apache Software Foundation//DTD Struts Configuration 6.4.0//EN"
+    "https://struts.apache.org/dtds/struts-6.4.0.dtd">

Review Comment:
   @lukaszlenart Let us know if you want this changed to 6.5.0 cc @kusalk 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org