Skip to content

Commit 3184ffc

Browse files
author
FolderView Plus Test
committed
Update hardening test for VM folder icon fallback
1 parent 5b6b47f commit 3184ffc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/security-hardening.test.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ test('runtime pages halt safely when conflicting folder view plugins are detecte
150150
test('folder display scripts sanitize folder icon and name in HTML templates', () => {
151151
for (const source of [dockerJs, vmJs, dashboardJs]) {
152152
assert.match(source, /const sanitizeImageSrc\s*=/);
153-
assert.match(source, /const safeFolderIcon = sanitizeImageSrc\(folder\.icon\)/);
154153
assert.match(source, /const safeFolderName = escapeHtml\(folder\.name\)/);
155154
}
155+
assert.match(dockerJs, /const safeFolderIcon = sanitizeImageSrc\(folder\.icon\)/);
156+
assert.match(vmJs, /const DEFAULT_FOLDER_ICON_PATH = '\/plugins\/folderview\.plus\/images\/folder-icon\.png';/);
157+
assert.match(vmJs, /const safeFolderIcon = sanitizeImageSrc\(folder\.icon, DEFAULT_FOLDER_ICON_PATH\)/);
158+
assert.match(dashboardJs, /const DEFAULT_FOLDER_ICON_PATH = '\/plugins\/folderview\.plus\/images\/folder-icon\.png';/);
159+
assert.match(dashboardJs, /const safeFolderIcon = sanitizeImageSrc\(folder\.icon, DEFAULT_FOLDER_ICON_PATH\)/);
156160
});
157161

158162
test('folder editor escapes custom action labels when rendering HTML', () => {

0 commit comments

Comments
 (0)