Stealing Bearer Tokens with an Angular Expression Injection
1–7 of 7 posts
Re: Stealing Bearer Tokens with an Angular Expression Injection
#2Re: Stealing Bearer Tokens with an Angular Expression Injection
#3Re: Stealing Bearer Tokens with an Angular Expression Injection
#4Re: Stealing Bearer Tokens with an Angular Expression Injection
#5I bet there are a lot more production angular apps out there than people think that have this vulnerability right now.
The problem ends up being that they mix server side templates with client side templates. If user input is rendered in a server side template and ends up in an element that is part of the Angular scope, the expression will evaluate. So attaching an angular controller to your body tag and then including server side templates within the body, is bad...
Re: Stealing Bearer Tokens with an Angular Expression Injection
#6It looks like this is only possible when we are mixing server side / client side templates? Enter an expression into input, a user hard refreshes and the expression is rendered into our angular template. Are there any good approaches to always scrubbing expression input on the server side (or just avoid the client side / server side template mix?)
You should definitely avoid mixing server side and client side templates, but if that's too much work, scrubbing would work. You would need to strip the expression stand and end symbols. Default symbols are '{{' and '}}', but some apps use different symbols to avoid collisions with other template engines that use the double curly brace.