Skip to content
XSS Disclosed report Intermediate

Angular injection in the profile name of onpatient

The profile name fields on the onpatient site evaluate AngularJS expressions, allowing an attacker to inject expressions that are evaluated when the page is rendered. This could potentially lead to cross-site scripting (XSS) if field length limitations were bypassed or if the fields are rendered elsewhere without escaping.

yaworsk Follow

Originally disclosed on HackerOne

  • Triaged in 11 hours
  • Fixed in 5 days
  • Paid in 5 days
  • Disclosed after 6 months

Hi All, You have an angular injection vulnerability in the profile name fields on the onpatient site. If you add a value [[5*5]] in the first name or last name field, the expression will be evaluated and when the page is rendered, the first and last name will be 25. Here I'm entering the values

angular_injection.png
angular_injection.png From the original on HackerOne

and here is the result

angular_injection_result.png
angular_injection_result.png From the original on HackerOne

Interestingly, because these fields are rendered together, you can also chain them together with something like first name [[5* and last name 5]] which will still be evaluated.

Now that said, I couldn't actually achieve XSS here because of the field length limitations. However, you should still fix this as:

  1. Google states that sandboxing should not be considered a security measure and any injection should be treated as xss Google bug hunter university

In fact, we think that, even if perfect, the AngularJS expression sandbox cannot be a security boundary. Whether the sandbox existed or not, the attacker able to execute Angular expressions, can access the exposed scope and alter the state of the application in an unexpected way, and that's already a vulnerability.

Therefore, an expression injection flaw in the AngularJS template is no different than a regular code injection (XSS). In short, if you're able to make AngularJS evaluate your {{31338-1}} expression to 31337, it's already a potential script execution flaw, equivalent to eval("31338-1") in non-AngularJS applications.

  1. Right now it is not exploitable, but in the future if you change the field limitations, you may inadvertently expose yourself and users to XSS

  2. There are numerous bypasses for angular, one may exist with these short fields which i'm not aware of Existing disclosed angular escapes from Portswigger

I recognize that onpatient isn't a multiple user platform per account, however, this field may be rendered elsewhere and depending on your setup, if admins can see the profile name and it too is not escaped, it could lead to a vulnerability.

The original report as published on HackerOne, by yaworsk. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the application uses AngularJS to render user-controlled profile name fields without proper sanitisation, allowing expression injection.

Impact

An attacker could execute Angular expressions, potentially leading to XSS if field length limitations are bypassed or if the fields are rendered elsewhere without escaping; however, the reporter could not achieve XSS due to field length limitations.

What the attacker needed

Ability to set profile name

The fix

The application should treat Angular expression injection as a security issue and properly sanitise or escape user input in profile name fields to prevent expression evaluation.

How it was found

  1. Enter an Angular expression such as [[5*5]] in the first name or last name field.
  2. Have the profile page rendered.
  3. Observe that the expression is evaluated and the name displays as 25.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

AngularJS is a JavaScript framework that can evaluate expressions written in double curly braces or other delimiters. Here, the profile name fields are treated as templates, so user input like [[5*5]] gets calculated and displayed as 25. This is dangerous because an attacker might inject malicious code that runs in other users' browsers, though the reporter could not achieve that due to input length limits.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by yaworsk

View all

21 more disclosed reports, best first.

More from drchrono

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.