summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo <leo@yacy-contrib>2026-04-20 22:51:37 +0800
committerLeo <leo@yacy-contrib>2026-04-20 22:51:37 +0800
commitbabfe58049c079bbb1e476e1d251aa72a0bba469 (patch)
treeec33ad870af939e168d65d27e668f820dfae0c7b
parent7b303b6f82b1eee57c05e984ce7f4f42fc992405 (diff)
fix: HTML-escape prefermaskfilter in early-return path to prevent reflected XSS (#401)
In the early return path (no index / search not allowed), prefermaskfilter was reflected into value="#[prefermaskfilter]#" in yacysearch.html using prop.put(), allowing attribute-breaking XSS. The normal search path already used putHTML; apply the same to the early-return path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--source/net/yacy/htroot/yacysearch.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/net/yacy/htroot/yacysearch.java b/source/net/yacy/htroot/yacysearch.java
index dbe77d1ec..05647672d 100644
--- a/source/net/yacy/htroot/yacysearch.java
+++ b/source/net/yacy/htroot/yacysearch.java
@@ -188,7 +188,7 @@ public class yacysearch {
prop.put("offset", "0");
prop.put("resource", "global");
prop.put("urlmaskfilter", (post == null) ? ".*" : post.get("urlmaskfilter", ".*"));
- prop.put("prefermaskfilter", (post == null) ? "" : post.get("prefermaskfilter", ""));
+ prop.putHTML("prefermaskfilter", (post == null) ? "" : post.get("prefermaskfilter", ""));
prop.put("indexof", "off");
prop.put("constraint", "");
prop.put("depth", "0");