aboutsummaryrefslogtreecommitdiff
path: root/modules/ext/filemgr.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-06-18 06:00:40 +0200
committerAgando <roduccomm@gmail.com>2026-06-18 06:00:40 +0200
commitfba6df22dae297c89fa0df065628dddded66c69c (patch)
treef954a04ee1effe56361282a16444deaa93bd0151 /modules/ext/filemgr.js
parenta02db2f506dec15c0c89dd4f8f21f975f627e4fe (diff)
auto: 2026-06-18_06:00 changes
Diffstat (limited to 'modules/ext/filemgr.js')
-rw-r--r--modules/ext/filemgr.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/ext/filemgr.js b/modules/ext/filemgr.js
index 3cd2687..141bee4 100644
--- a/modules/ext/filemgr.js
+++ b/modules/ext/filemgr.js
@@ -93,8 +93,11 @@ class FileManagerModule {
html = html.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>');
// italic
html = html.replace(/\*(.+?)\*/g, '<em>$1</em>');
- // links
- html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" style="color:var(--info-color)">$1</a>');
+ // links — v4.5.67: sanitize URL to prevent javascript: scheme injection
+ html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
+ const safeUrl = /^(https?:\/\/|mailto:|\/|#)/.test(url) ? url : '#';
+ return `<a href="${safeUrl}" target="_blank" style="color:var(--info-color)">${text}</a>`;
+ });
// horizontal rules
html = html.replace(/^---$/gm, '<hr style="border-color:var(--border-color);margin:8px 0">');
// unordered lists