From the course: Security in ASP.NET Core
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Cross-site scripting (XSS) in JavaScript - ASP.NET Tutorial
From the course: Security in ASP.NET Core
Cross-site scripting (XSS) in JavaScript
- [Instructor] I've got bad news. There still is at least one cross-site scripting vulnerability on that page, but it's not that obvious. So in line 609, we're using jQuery, but that's not a jQuery problem. It's a problem of our implementation, to write something in the HTML using the DOM of our page. And we have a string for that. And in that string we have the Search term. And, as you can see, that Search term has been properly escaped for HTML. So HTML special characters were escaped. But we are not really in HTML here. We are within a JavaScript string. In a JavaScript string, we have different special characters; for instance, the backslash. The backslash is not escaped by the at character in ASP.NET Core. But it can be used to add special characters to a string. So, for instance, using \x, we can provide the hexadecimal char code, and then that character is part of the string. Hmm, so as an attacker, if I would like to do cross site scripting, I'd like to inject angle brackets…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
OWASP Top Ten2m 45s
-
(Locked)
Cross-site scripting (XSS): The attack4m 33s
-
(Locked)
Cross-site scripting (XSS): The defense3m 25s
-
(Locked)
Cross-site scripting (XSS) in JavaScript4m 40s
-
(Locked)
Cross-site scripting (XSS) in single-page applications3m 30s
-
(Locked)
Same-origin policy and CORS4m 26s
-
(Locked)
Enabling CORS in ASP.NET Core web API6m 23s
-
(Locked)
SQL injection with ADO.NET2m 25s
-
(Locked)
SQL injection with Entity Framework Core2m 34s
-
(Locked)
Fixing SQL injection5m 23s
-
(Locked)
Cross-Site Request Forgery (CSRF): The attack5m 25s
-
(Locked)
Cross-Site Request Forgery (CSRF): The defense7m 11s
-
-
-
-
-