-
-
Notifications
You must be signed in to change notification settings - Fork 67
Domain based auto join #1360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Domain based auto join #1360
Changes from all commits
edb6238
7c858b7
30f1019
ac82dc9
d02612f
10008b1
abb4294
592ca7b
709837e
4005e7b
d5a1a1e
3420217
b354eef
550ccba
123ea26
1360418
5fb9921
2de463b
221e641
60fd6af
b6938be
eedc001
c943678
67e04fa
1134127
b39c576
a091b91
a770d35
a206f74
d9489c7
cca88af
cfb36e0
fd0a2a6
935fa3e
6066015
55c5fb3
63e8070
71e2f08
38fcdc9
9c1fa93
3d78f37
468bc28
963c4fb
b939567
d4d6108
0cd920d
fb48634
485ba19
808c45b
46dd27b
9f48201
7fc92cd
23425ee
f29a447
18d81c0
504855c
056257f
929c509
13465c2
a377a56
3f56ed5
94c23df
dfdd173
3a3ddf0
916d45d
350b61b
f51fbbd
2f4c6b3
5c4766e
1e056f9
7e7f0dc
8e1997c
37b25cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,13 +192,20 @@ function truncateText(text: string, maxLength: number): string { | |
|
|
||
| /** | ||
| * Basic HTML stripping (for simple cases) | ||
| * | ||
| * Removes all angle brackets to prevent any HTML injection, then normalizes whitespace. | ||
| * This is safe for Discord forum posts where we only need plain text content. | ||
| */ | ||
| function stripHtml(html: string): string { | ||
| if (!html) | ||
| return '' | ||
|
|
||
| // Remove all angle brackets immediately to prevent HTML tag reconstruction | ||
| // (e.g., "<scr<script>ipt>" could become "<script>" after partial removal) | ||
| // This eliminates any possibility of incomplete sanitization | ||
| return html | ||
| .replace(/<style[^>]*>.*?<\/style>/gis, '') | ||
| .replace(/<script[^>]*>.*?<\/script>/gis, '') | ||
| .replace(/<[^>]+>/g, ' ') | ||
| .replace(/\s+/g, ' ') | ||
| .replaceAll(/[<>]/g, ' ') | ||
| .replaceAll(/\s+/g, ' ') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HTML stripping leaves tag names in output textMedium Severity The |
||
| .trim() | ||
| } | ||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-greedy JSON regex breaks nested JSON extraction
Medium Severity
The change from greedy
\{[\s\S]*\}to non-greedy\{[\s\S]*?\}breaks JSON extraction for nested objects. The non-greedy pattern matches from the first{to the first}, so input like{"a": {"b": 1}}produces{"a": {"b": 1}which is invalid JSON. This causesJSON.parse()to throw an error, forcing the fallback default classification. The stated ReDoS concern doesn't apply to this pattern since[\s\S]*has linear backtracking complexity, not exponential.