Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 1853e99

Browse files
author
Sauyon Lee
committed
ReflectedXss: Allow regexp to match newlines
1 parent f11b956 commit 1853e99

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ql/src/semmle/go/security/ReflectedXssCustomizations.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ module ReflectedXss {
6767
// checks that the format value does not start with:
6868
// - '<', which could lead to an HTML content type being detected, or
6969
// - '%', which could be a format string.
70-
call.getArgument(1).getStringValue().regexpMatch("^[^<%].*")
70+
call.getArgument(1).getStringValue().regexpMatch("(?s)^[^<%].*")
7171
)
7272
or
7373
exists(DataFlow::Node pred | body = pred.getASuccessor*() |
7474
// data starting with a character other than `<` cannot cause an HTML content type to be detected.
75-
pred.getStringValue().regexpMatch("^[^<].*")
75+
pred.getStringValue().regexpMatch("(?s)^[^<].*")
7676
or
7777
// json data cannot begin with `<`
7878
exists(EncodingJson::MarshalFunction mf | pred = mf.getOutput().getNode(mf.getACall()))

0 commit comments

Comments
 (0)