Want to learn more about OAuth 2.0 and OpenID Connect?
Save yourself days of digging through dozens of specs with this online course
More informationArticles tagged with "Single Page Applications"
A Critical Analysis of Refresh Token Rotation in Single-page Applications
In this article, we investigate the security properties of refresh tokens in the browser. We investigate why frontend web applications need refresh token rotation and what we gain by using refresh token rotation. Next, we dive into concrete attack scenarios that bypass refresh token rotation and discuss how sensitive SPAs should use a backend-for-frontend to secure tokens.
9 April 2021 OAuth 2.0 & OpenID Connect OAuth 2.0, XSS, Single Page Applications, Refresh tokens
Preventing XSS in Angular
A Cross-Site Scripting (XSS) vulnerability can and will lead to the full compromise of a frontend application. An XSS vulnerability allows the attacker to control the application in the user's browser, extract sensitive information, and make requests on behalf of the application. Modern frameworks come with built-in defenses against XSS, but how far do they really go? In this article, we look at Angular's built-in XSS defenses, along with insecure coding patterns that inadvertently bypass these protections.
1 February 2021 SPA Security XSS, Angular, Single Page Applications
Are you causing XSS vulnerabilities with JSON.stringify()?
JSON.stringify() is perhaps one of the most mundane APIs in modern browsers. The functionality to translate a JavaScript object into a string-based representation is hardly thrilling. But when the stars align, a simple JSON serialization operation can result in a significant XSS vulnerability. This article tells the nail-biting story of such a vulnerability in Scully, an Angular-based static site generator.
26 January 2021 SPA Security XSS, Angular, Scully, Single Page Applications
Preventing XSS in React (Part 3): escape hatches and component parsers
Preventing XSS in React is manageable when you stay within the boundaries of the framework, but becomes hard once you step out of React's safe zone. In this article, we take a closer look at escape hatches and component parsers and all the reasons you should avoid them. Read on to discover the next level of XSS in React applications.
14 June 2020 SPA Security XSS, React, Single Page Applications
Preventing XSS in React (Part 2): dangerouslySetInnerHTML
Dynamically rendering benign HTML code in React requires the use of dangerouslySetInnerHTML
. That is not a naming mistake. This property is dangerous, and using it carelessly will create XSS vulnerabilities in your application. In this article, we discuss why the property is there, how you can use it, and how the Signal messenger misused it. This article is the second in a series of three, and a must-read for every React developer.
28 May 2020 SPA Security XSS, React, Single Page Applications
Preventing XSS in React (Part 1): Data binding and URLs
A Cross-Site Scripting (XSS) vulnerability can and will lead to the full compromise of a frontend application. An XSS vulnerability allows the attacker to control the application in the user's browser, extract sensitive information, and make requests on behalf of the application. Modern frameworks come with built-in defenses against XSS, but how far do they really go? In this article series, we look at how React prevents XSS, but also how its shortcomings leave a lot in the hands of a developer. This article is the first in a series of three.
13 May 2020 SPA Security XSS, React, Single Page Applications
From the Implicit flow to PKCE: A look at OAuth 2.0 in SPAs
About a year ago, the OAuth 2.0 Implicit flow became deprecated. That decision caused a lot of confusion and frustration. In this article, we analyze the different OAuth 2.0 flows to find out why the OAuth working group made that decision. Read on to find out about current best practices for using OAuth 2.0 in modern web applications.
7 May 2020 OAuth 2.0 & OpenID Connect OAuth 2.0, PKCE, Single Page Applications
All article tags
API (3) , JWT (3) , Crypto (2) , OAuth 2.0 (8) , LocalStorage (1) , XSS (12) , Refresh tokens (2) , PKCE (1) , Single Page Applications (7) , React (3) , Recording (1) , Training (1) , OIDC (4) , Online Courses (3) , Flow Simulator (2) , Authentication (1) , Browser Security (5) , X-Frame-Options (XFO) (1) , Content Security Policy (CSP) (5) , Angular (2) , Scully (1) , Trusted Types (1)
Want to learn more about OAuth 2.0 and OpenID Connect?
Save yourself days of digging through dozens of specs with this online course
More informationDr. Philippe De Ryck
Hi, I'm Philippe, and I help developers protect companies through better web security. As the founder of Pragmatic Web Security, I travel the world to teach practitioners the ins and outs of building secure software.
Talks and workshops
You will often find me speaking and teaching at public and private events around the world. My talks always encourage developers to step up and get security right.
Security resources
Getting security right is all about knowledge. I strongly believe in sharing that knowledge to move forward as a community. Among my resources, you can find developer cheat sheets, recorded talks, and extensive slide decks.
Mailing list
Subscribe to the Pragmatic Web Security mailing list to stay up to date on the latest activities and resources.