Skip to content

Commit 28c8dae

Browse files
committed
Fix potential XSS issue with [layers] tag.
1 parent 88f9035 commit 28c8dae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

maptemplate.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -3671,7 +3671,9 @@ static char *processLine(mapservObj *mapserv, char *instr, FILE *stream, int mod
36713671
strlcat(repstr, " ", sizeof(repstr));
36723672
}
36733673
msStringTrimBlanks(repstr);
3674-
outstr = msReplaceSubstring(outstr, "[layers]", repstr);
3674+
encodedstr = msEncodeHTMLEntities(repstr);
3675+
outstr = msReplaceSubstring(outstr, "[layers]", encodedstr);
3676+
free(encodedstr);
36753677

36763678
encodedstr = msEncodeUrl(repstr);
36773679
outstr = msReplaceSubstring(outstr, "[layers_esc]", encodedstr);

0 commit comments

Comments
 (0)