Skip to content

Commit 1962330

Browse files
committed
Weakness CWE-79
Weakness CWE-116
1 parent 142c49b commit 1962330

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nitrocraft",
3-
"version": "1.2.4",
3+
"version": "1.2.5",
44
"private": false,
55
"type": "module",
66
"scripts": {

public/javascript/server-list-builder.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
}
117117
}
118118

119+
function encodeSafeIconSource(value) {
120+
return encodeURI(sanitizeIconSource(value));
121+
}
122+
119123
function setNote(element, message, isError) {
120124
if (!element) {
121125
return;
@@ -539,7 +543,7 @@
539543
preview.name.textContent = fallbackName;
540544
preview.version.textContent = state.version ? ("v" + state.version) : "";
541545
preview.players.textContent = players;
542-
preview.icon.src = state.icon || defaults.icon;
546+
preview.icon.src = encodeSafeIconSource(state.icon);
543547
updatePingBars(preview.ping, state.ping);
544548

545549
scheduleMotdRender();

0 commit comments

Comments
 (0)