Skip to content

Commit 0efe00d

Browse files
committed
Try decode possible uri encoded strings
1 parent 200ba21 commit 0efe00d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/helpers/extractStringsFromUserInput.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ export function extractStringsFromUserInput(obj: unknown): Set<UserString> {
3131
if (typeof obj == "string") {
3232
results.add(obj);
3333

34+
if (obj.includes("%")) {
35+
try {
36+
results.add(decodeURIComponent(obj));
37+
} catch {
38+
// Ignore
39+
}
40+
}
41+
3442
const jwt = tryDecodeAsJWT(obj);
3543
if (jwt.jwt) {
3644
// Do not add the issuer of the JWT as a string because it can contain a domain / url and produce false positives

0 commit comments

Comments
 (0)