Commit 5de0300
fix(integrations): Validate webhook header count and name characters
Two gaps in the custom webhook headers validator:
- No upper bound on the number of headers allowed a user to configure
hundreds, inflating every outgoing webhook request and the stored
ArrayField without limit. Cap at 20.
- Header names were only checked for CR/LF (header injection) but not
for RFC 7230 token characters. urllib3 does not validate names before
sending, so a control character embedded in an x-* name (e.g.
X-Evil\x01Header) would be sent verbatim. Add _HTTP_TOKEN_RE to
enforce the token character set after partitioning the name.
Three new tests cover the count limit, a control-character name, and a
space in a header name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6d66a27 commit 5de0300
2 files changed
Lines changed: 30 additions & 0 deletions
File tree
- src/sentry/sentry_apps/api/parsers
- tests/sentry/sentry_apps/api/endpoints
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
226 | 231 | | |
227 | 232 | | |
228 | 233 | | |
| 234 | + | |
| 235 | + | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| |||
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
827 | 845 | | |
828 | 846 | | |
829 | 847 | | |
| |||
0 commit comments