trypyramid.com | trypyramid.com marketing website | Search Engine Optimization library
kandi X-RAY | trypyramid.com Summary
kandi X-RAY | trypyramid.com Summary
trypyramid.com marketing website
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of trypyramid.com
trypyramid.com Key Features
trypyramid.com Examples and Code Snippets
Community Discussions
Trending Discussions on trypyramid.com
QUESTION
I have a Pyramid application using a
I want to remove all HTML tags that a user attempts to submit in tag.
how can I do that? (I want a secure way to do that as JavaScript runs on the client side)
I also request for a simple example if possible.
here is my example:
...ANSWER
Answered 2018-Jul-31 at 16:36My default answer to this is that you probably shouldn't actually be removing those tags, but encoding them properly when they are written to the client. If someone wants their username to be Lyndsy Simon
, that should be fine. Escaping it on output means that you don't have to worry about doing so on each input, and don't have a potential code injection vector if you don't properly escape an input somewhere or an attacker is able to bypass it.
That said, if removing the HTML tags on input is definitely the path you want to take, I have used bleach in the past and recommend it. My use case has been when I needed to accept some HTML tags (bold, italic, etc.), but strip others. Bleach allows you to set a whitelist of allowable tags to fit this need.
Note that you can still use bleach to strip the tags on output, instead of input, if that's the way you decide to go.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install trypyramid.com
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page