Skip to content

Commit 665ab60

Browse files
authored
Updated denylist to include other widely used cookies/headers (#1972)
* Updated denylist to include other widely used cookies/headers * Made check case insensitive
1 parent f9ec128 commit 665ab60

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sentry_sdk/scrubber.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,27 @@
4242
"x_api_key",
4343
"x_forwarded_for",
4444
"x_real_ip",
45+
# other common names used in the wild
46+
"aiohttp_session", # aiohttp
47+
"connect.sid", # Express
48+
"csrf_token", # Pyramid
49+
"csrf", # (this is a cookie name used in accepted answers on stack overflow)
50+
"_csrf", # Express
51+
"_csrf_token", # Bottle
52+
"PHPSESSID", # PHP
53+
"_session", # Sanic
54+
"symfony", # Symfony
55+
"user_session", # Vue
56+
"_xsrf", # Tornado
57+
"XSRF-TOKEN", # Angular, Laravel
4558
]
4659

4760

4861
class EventScrubber(object):
4962
def __init__(self, denylist=None):
5063
# type: (Optional[List[str]]) -> None
5164
self.denylist = DEFAULT_DENYLIST if denylist is None else denylist
65+
self.denylist = [x.lower() for x in self.denylist]
5266

5367
def scrub_dict(self, d):
5468
# type: (Dict[str, Any]) -> None

0 commit comments

Comments
 (0)