Commit 2f01be8
fix(pydantic-ai): Fix DATA_URL_BASE64_REGEX to match complex MIME types
The regex used to detect and redact base64 data URLs only allowed
alphabetic characters in MIME types, causing it to fail for types like
`image/svg+xml`, `application/vnd.ms-excel`, or `font/woff2`.
When the match failed, the full raw data URL (including base64 content)
was passed through to Sentry instead of being redacted with
BLOB_DATA_SUBSTITUTE, resulting in unintended data leakage.
Expand the MIME type character class to include digits, `.`, `+`, and
`-` to match all common MIME types per RFC 2045.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 9c24bd9 commit 2f01be8
2 files changed
Lines changed: 32 additions & 1 deletion
File tree
- sentry_sdk/integrations/pydantic_ai
- tests/integrations/pydantic_ai
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2956 | 2956 | | |
2957 | 2957 | | |
2958 | 2958 | | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
2959 | 2990 | | |
2960 | 2991 | | |
2961 | 2992 | | |
| |||
0 commit comments