Commit c540c9f
committed
gh-121284: Fix email address header folding with parsed encoded-word
Email generators using email.policy.default may convert an RFC 2047
encoded-word to unencoded form during header refolding. In a structured
header, this could allow 'specials' chars outside a quoted-string,
leading to invalid address headers and enabling spoofing. This change
ensures a parsed encoded-word that contains specials is kept as an
encoded-word while the header is refolded.1 parent c4e8196 commit c540c9f
File tree
3 files changed
+38
-2
lines changed- Lib
- email
- test/test_email
- Misc/NEWS.d/next/Security
3 files changed
+38
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2829 | 2829 | | |
2830 | 2830 | | |
2831 | 2831 | | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
2832 | 2839 | | |
2833 | 2840 | | |
2834 | 2841 | | |
| |||
2848 | 2855 | | |
2849 | 2856 | | |
2850 | 2857 | | |
2851 | | - | |
| 2858 | + | |
2852 | 2859 | | |
2853 | 2860 | | |
2854 | 2861 | | |
| |||
2902 | 2909 | | |
2903 | 2910 | | |
2904 | 2911 | | |
2905 | | - | |
| 2912 | + | |
2906 | 2913 | | |
2907 | 2914 | | |
2908 | 2915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3076 | 3076 | | |
3077 | 3077 | | |
3078 | 3078 | | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
3079 | 3104 | | |
3080 | 3105 | | |
3081 | 3106 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments