Skip to content

Html encode text fields in response against XSS attacks (Cross Site Scripting) #7751

Open
@ebicoglu

Description

@ebicoglu

Prevent client-side scripts to run in web browser.
Automatically encode HTML or escape chars in Ajax responses so that code in <script></script> tags cannot be evaluated. There maybe multiple targeted devices that's why encoding should be done only in web layer.
According to me, this should be done in the response not in the request because if a 3rd party is inserting an infected data to the database, ABP should encode those as well.

When you create a new role with the name : <script>alert(1)</script>
All the pages that return role name, evaluates this script. eg : https://localhost:44303/Identity/Users/CreateModal

image
image
image
image

https://docs.microsoft.com/en-us/aspnet/core/security/cross-site-scripting
https://docs.microsoft.com/en-us/aspnet/core/security/anti-request-forgery

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions