Skip to content

Commit de97355

Browse files
brzewVCEszh
andauthored
Update Cross_Site_Scripting_Prevention_Cheat_Sheet.md (#1457)
* Update Cross_Site_Scripting_Prevention_Cheat_Sheet.md * Fix trailing space lint errors * Update cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md Co-authored-by: Shlomo Zalman Heigh <[email protected]> --------- Co-authored-by: Shlomo Zalman Heigh <[email protected]>
1 parent dd803db commit de97355

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ For JSON, verify that the `Content-Type` header is `application/json` and not `t
111111
<span style="property : $varUnsafe">Oh no</span>
112112
```
113113
114-
If you're using JavaScript to change a CSS property, look into using `style.property = x`. This is a **Safe Sink** and will automatically CSS encode data in it.
114+
If you're using JavaScript to change a CSS property, look into using
115+
`style.property = x`.
116+
This is a **Safe Sink** and will automatically CSS encode data in it.
115117
116-
// Add CSS Encoding Advice
118+
When inserting variables into CSS properties, ensure the data is properly encoded and sanitized to prevent injection attacks. Avoid placing variables directly into selectors or other CSS contexts.
117119
118120
### Output Encoding forURL Contexts”
119121

0 commit comments

Comments
 (0)