You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove `dangerouslySetInnerHTML` to prevent XSS vulnerabilities
115
+
116
+
B. Change summary:
117
+
Replaced the `dangerouslySetInnerHTML` use with standard React text content rendering to ensure data is automatically escaped, preventing potential XSS attacks.
118
+
A. Commit message:
119
+
Remove dangerouslySetInnerHTML to prevent XSS vulnerability in inline script.
120
+
121
+
B. Change summary:
122
+
Replaced the "dangerouslySetInnerHTML" with a regular script element and JSON.stringified the state to safely embed it without the risk of XSS.
123
+
124
+
C. Compatibility Risk:
125
+
Low
126
+
127
+
D. Fixed Code:
128
+
A. Commit message:
129
+
Safely embed Typekit loading script in a React component.
130
+
131
+
B. Change summary:
132
+
Replaced the `dangerouslySetInnerHTML` usage with a safe method to load and execute the Typekit script, by actively managing script insertion using native DOM manipulation techniques separate from React's JSX rendering cycle.
0 commit comments