XSS Vulnerability
See original GitHub issueHey,
someone pointed out an issue in another Angular markdown library about XSS vulnerability and it seems that this library presents the same issue as well.
Links are not being validated and as such, the following code could be used to execute javascript code:
[Click Me](javascript:alert('Injected!'%29)
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Cross Site Scripting (XSS) - OWASP Foundation
An XSS vulnerability allowing an attacker to modify a press release or news item could affect a company's stock price or lessen consumer...
Read more >Cross-site scripting (XSS) - Web Security Academy
Cross-site scripting (also known as XSS) is a web security vulnerability that allows an attacker to compromise the interactions that users have with...
Read more >Cross-site scripting - Wikipedia
Cross-site scripting (XSS) is a type of security vulnerability that can be found in some web applications. XSS attacks enable attackers to inject ......
Read more >What is Cross-site Scripting and How Can You Fix it? - Acunetix
A web page or web application is vulnerable to XSS if it uses unsanitized user input in the output that it generates. This...
Read more >What is Cross-Site Scripting? XSS Cheat Sheet - Veracode
In short, XSS vulnerabilities occur when input coming into web applications is not validated and/or output to the browser is not properly escaped...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
⚠️ Breaking Change
Dependencies as been updated to support Marked 0.8.0 in latest ngx-markdown v9.0.0 release and brings some breaking changes regarding sanitization configuration.
Due to deprecation by Marked, the following properties has been removed from
MarkedOptions
when configuring theMarkdownModule
:sanitize: boolean
sanitizer: function
Instead, sanitization is now enabled by default when importing
MarkdownModule.forRoot()
. It uses AngularDomSanitizer
withSecurityContext.HTML
by default to avoid XSS vulnerabilities. The security level can be configured/turn-off by specifying theSecurityContext
usingsanitize
option (outsidemarkedOptions
).Be sure to follow the sanitization section in the README file for instruction.
I’ve communicated with NPM Security Team and after providing mitigation steps they removed the vulnerability report.
They are suggesting me to add a warning to the
README.md
documentation in order to bring this issue/workaround to user’s attention to avoid potential security risks.A second option would be to switch the
sanitize
option totrue
by default and still add documentation on how to turn it off.Action will be taken soon about the documentation and I’ll think about the default value of
sanitize
option.