Skip to content

Commit

Permalink
Updates to rec for Self-Stored XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
RRudder committed May 8, 2023
1 parent e6286ff commit 9784af0
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
There is no single technique to stop XSS from occurring. However, implementing the right combination of defensive measures within the application will prevent and limit the impact of XSS. Some best practices include the following:

- All user input fields should be sanitized based on what the field is likely to contain. For example, a date field (01/01/2001) should only contain a maximum of 10 characters consisting of numbers and forward slashes. Additionally, drop down or pick lists can be used for allowable inputs to ensure expected values are sent to the server.
- Use appropriate HTTP response headers to ensure the browser correctly interprets responses. These should be customized specific to the application and its environment. For example:
- Implement a Content Security Policy (CSP) to ensure the browser correctly interprets responses and restricts which sources can be used to execute scripts. This should be customized specific to the application and its environment. For example:

``` HTTP
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src ‘self’; script-src ‘self’
```
Expand Down

0 comments on commit 9784af0

Please sign in to comment.