You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by al...@apache.org on 2026/08/22 23:05:55 UTC

(jspwiki) branch bug/JSPWIKI-1279 created (now 41cb959ad)

This is an automated email from the ASF dual-hosted git repository.

spyhunter99 pushed a change to branch bug/JSPWIKI-1279
in repository https://gitbox.apache.org/repos/asf/jspwiki.git


      at 41cb959ad JSPWIKI-1279 see jira for details

This branch includes the following new commits:

     new 41cb959ad JSPWIKI-1279 see jira for details

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(jspwiki) 01/01: JSPWIKI-1279 see jira for details

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spyhunter99 pushed a commit to branch bug/JSPWIKI-1279
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 41cb959ad37a29bebe5ee2ed1619db69691d7bb2
Author: Alex O'Ree <al...@apache.org>
AuthorDate: Sat Aug 22 19:05:44 2026 -0400

    JSPWIKI-1279 see jira for details
---
 .../apache/wiki/plugin/ReferringUndefinedPagesPlugin.java    |  2 +-
 .../wiki/plugin/ReferringUndefinedPagesPluginTest.java       | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/jspwiki-main/src/main/java/org/apache/wiki/plugin/ReferringUndefinedPagesPlugin.java b/jspwiki-main/src/main/java/org/apache/wiki/plugin/ReferringUndefinedPagesPlugin.java
index 5225ab44f..e60649e78 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/plugin/ReferringUndefinedPagesPlugin.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/plugin/ReferringUndefinedPagesPlugin.java
@@ -61,7 +61,7 @@ public class ReferringUndefinedPagesPlugin extends AbstractReferralPlugin {
         final ReferenceManager referenceManager = context.getEngine().getManager( ReferenceManager.class );
 
         final int items = TextUtil.parseIntParameter(params.get(PARAM_MAX), ALL_ITEMS);
-        String extras = params.get(PARAM_EXTRAS);
+        String extras = TextUtil.replaceEntities( params.get( PARAM_EXTRAS ) );
         if (extras == null) {
             extras = rb.getString("referringundefinedpagesplugin.more");
         }
diff --git a/jspwiki-main/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java b/jspwiki-main/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
index e2bad163e..811f40dd5 100644
--- a/jspwiki-main/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
+++ b/jspwiki-main/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
@@ -114,4 +114,16 @@ class ReferringUndefinedPagesPluginTest {
         Assertions.assertTrue( res.startsWith( "<div style=\"columns:2;-moz-columns:2;-webkit-columns:2;\"><a " ) );
     }
 
+    /**
+     * The 'extras' parameter is author-controlled; it must be entity-encoded before being
+     * appended to the HTML result.
+     */
+    @Test
+    void testParamExtrasEscaped() throws Exception {
+        final String res = manager.execute( context, "{INSERT ReferringUndefinedPagesPlugin} max='1' extras='<script>alert(document.cookie)</script>'}" );
+
+        Assertions.assertFalse( res.contains( "<script>" ), res );
+        Assertions.assertTrue( res.contains( "&lt;script&gt;alert(document.cookie)&lt;/script&gt;" ), res );
+    }
+
 }