Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cross_Site_Scripting_Prevention_Cheat_Sheet.md #1457

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ For JSON, verify that the `Content-Type` header is `application/json` and not `t
<span style="property : $varUnsafe">Oh no</span>
```

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.
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.

// Add CSS Encoding Advice
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.

### Output Encoding for “URL Contexts”

Expand Down
Loading