Best Website Builders CompanyBest Website Builders Company
    What's Hot

    Chris Wood adds AU Small Finance Bank to Jefferies’ India portfolio, removes CAMS

    June 2, 2023

    From New Tax Regime to Old, avoid these top 9 Income Tax Return (ITR) filing mistakes in 2023: Archit Gupta

    June 2, 2023

    Tata Motors, Titan, Britannia, Metro Brands among 125 NSE stocks to hit 52-week highs; 13 touch 52-week lows

    June 2, 2023
    Facebook Twitter Instagram
    Facebook Twitter Instagram
    Best Website Builders CompanyBest Website Builders Company
    • Home
    • Web Builders
      1. Joomla
      2. WordPress
      3. CSS
      4. Web Design
      5. UX
      6. PHP
      7. View All

      For $50 you can host your website for life

      May 2, 2023

      California Department of Justice Investigating Shooting Involving CHP Officer in Glenn County Under AB 1506

      May 1, 2023

      Mariposa County Daily Sheriff and Reservation Report for Sunday, April 30, 2023

      May 1, 2023

      Top 10 Best Web Development Companies In India In 2023

      May 1, 2023

      Google Ads Sign Up – Easy Steps to Create Your Account

      May 17, 2023

      1Password puts users at ease after the horror of password change notifications

      May 3, 2023

      Samsung Galaxy S23 FE could feature a 50MP main camera, but we may have to wait until then

      May 3, 2023

      Titanfall director says Respawn is ‘looking forward to something new’

      May 3, 2023

      Implementing CSS with character and spirit: Union MoS Finance

      May 3, 2023

      Street Fighter 6’s unique character select screen animation really shows how much heart goes into the game

      May 3, 2023

      Make Google Chrome run faster with these 9 tips and tweaks

      May 3, 2023

      🅰️ New Angular 16 Goes Big in 2023: Everything You Need to Know | Vitaly Shevchuk | Oct 25, 2017 May 2023

      May 3, 2023

      18-Wheeler Accidents: Fatalities and Injuries

      May 6, 2023

      What Comes First in Website Development — Design or Copy?

      February 2, 2023

      Modern Campus Honors Best Higher Education Websites of 2022

      February 2, 2023

      Premier SEO Consultant in Las Vegas, Nevada with Unparalleled Customer Service

      February 2, 2023

      The role of artificial intelligence in improving the user experience in online casinos.

      May 3, 2023

      Microsoft enhances user experience with Windows 11 ‘smart opt-out’ and improved emergency notifications

      May 3, 2023

      Nigeria’s Nestcoin Launches New Digital Financial Platform For Africans

      May 3, 2023

      ibi WebFOCUS 9.2 is ready for Modern Business Intelligence, the Cloud, and Driving User Experience – PCR.

      May 3, 2023

      Anthony Carrigan Reflects on That ‘Barry’ Scene from Season 4 Episode 4

      May 1, 2023

      TikToker Kat Abu is very happy that Tucker Carlson has been fired

      April 28, 2023

      How ‘Single Drunk Female’ Season 2 Tackled Emotional Sobriety

      April 24, 2023

      Trans-Missouri Residents Affected by Attorney General Order

      April 24, 2023

      Creating and Adding a Google Account: A Step-by-Step Guide

      May 2, 2023

      How i Create New Google Account

      February 7, 2023

      CWT powers tools for meeting and event planners

      January 31, 2023

      Best Website Builder – Website Builders

      January 24, 2023
    • Realtoz
      • Our Other Sites
    • More News
    • Investments
    Best Website Builders CompanyBest Website Builders Company
    Home»JavaScript»Ambush with AngularJS: Piwik PRO hidden CSP bypass
    JavaScript

    Ambush with AngularJS: Piwik PRO hidden CSP bypass

    websitebuildersnowBy websitebuildersnowApril 28, 2023No Comments4 Mins Read
    Facebook Twitter LinkedIn Telegram Pinterest Tumblr Reddit WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Gareth Hayes

    Photo of AngularJS style tribal people surrounding a CSP bypass vector with pits

    Individual website components can compromise the security of your entire site, and analytics platforms are no exception. With this in mind, we decided to do a quick audit of his Piwik PRO to make sure it is safe to deploy on portswigger.net.

    I decided to look for client side issues like DOM XSS. The focus was on introducing a new scripting resource and the most likely vector was a DOM XSS vulnerability. The first thing I did was browse the site with DOM Invader enabled and try to inject a canary. I didn’t get any results, but this was good news. Then I changed the DOM Invader canary to a blank value. This allowed me to see all sinks being used regardless of whether a canary was present or not. This is very useful for finding things like document.write(). Indeed, there were document.write calls and various innerHTML assignments. I got the stack trace and inspected the document.write() call and noticed there was a debug flag… which led me to my next question – what does this do?

    I added a flag to the URL and lo and behold the analytics debugger appeared. After testing that document.write calls are not vulnerable to XSS, I thought about the following questions: How was this debugger built? I started inspecting the debugger using devtools and immediately noticed the “ng-app” event. Jackpot, this is my old friend his AngularJS.

    You may wonder why I hit the jackpot. This is because AngularJS has well-known script gadgets that can be used to bypass Content Security Policy (CSP). A script gadget is JavaScript code, usually from a library, that adds additional functionality to HTML or JavaScript. Since the gadget already has JavaScript running and is allowed by policy, you can use this gadget to bypass CSP. A good example of this is AngularJS’s ng-focus. This event allows you to fire the browser’s focus event, but ng-focus is non-standard, so it’s allowed by CSP and done by AngularJS itself.

    Once you confirm that you have an AngularJS gadget, there are two possible outcomes. You can do client-side template injection (CSTI) or bypass CSP. CSTI could not run because it requires an HTML injection vulnerability to inject script resources. If your site has HTML injection vulnerabilities, it’s important to fix them as they can be escalated to XSS using CSP bypass. I’ve done this in the past to find XSS on PayPal.

    Upon further inspection, the debugger appears to be using an iframe, loading various scripting resources allowed by CSP. I went through the XSS cheat sheet to see various CSP bypasses for AngularJS. I chose the first one and typed in the console:

    document.body.innerHTML=`<iframe srcdoc="<div lang=en ng-app=application ng-csp class=ng-scope>
    <script src=https://ps.containers.piwik.pro/container-debugger/vendor.js></script>
    <script src=https://ps.containers.piwik.pro/container-debugger/scripts.js></script>
    <script src=https://ps.containers.piwik.pro/container-debugger/templates.cache.js></script>
    <input autofocus ng-focus=$event.composedPath()|orderBy:'[].constructor.from([1],alert)'>
    </div>
    ">`

    Sure enough, this bypassed CSP entirely. Because the script was allowlisted, the attacker was able to use composedPath() to inject her AngularJS directive and her ng-focus event in order to get the window objects in the array. rice field. The orderBy filter traversing the scope of that array and executing code ends up in a window object and indirectly calls the alert function using Array.from(). This bypasses CSP. He reported the issue to Piwik, who updated her CSP deployment procedures to address the vulnerability. He fixed the problem by hardening CSP to allowlist specific JavaScript files instead of entire domains. He also used his nonce in certain scripts to prevent attackers from injecting his resources into his own AngularJS scripts.

    This is valid now – if you find something we missed, please report it to the PortSwigger and Piwik PRO bug bounty programs.

    Timeline

    Mar 02, 2023 10:51 – Report CSP bypass to Piwik
    Mar 02, 2023 11:20 – Approved by Piwik
    Mar 3, 2023 13:09 – Vulnerability confirmed
    03/07/2023 12:24 – CSP deployment instructions updated to fix vulnerability
    Apr 28, 2023 13:00 – Blog post published

    back to all articles



    Source link

    Share this:

    • Tweet
    • More
    • WhatsApp
    • Print
    • Share on Tumblr
    • Mastodon

    Related

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Telegram Email
    Previous Article18 Best Pictures As 45-Year Journey Nears End
    Next Article StormGain Partners with Unstoppable Domains to Offer Discounts and Enhanced User Experience – CryptoMode
    websitebuildersnow
    • Website

    Related Posts

    Fake ChatGPT extension to steal victim’s account details

    May 2, 2023

    What to expect from ECMAScript 2023 (ES14)

    May 2, 2023

    Which one is right for your project?

    May 2, 2023
    Add A Comment

    Leave a Reply Cancel reply

    Post Your Ad Free
    Advertisement
    Demo
    Top Posts

    Subscribe to Updates

    Get the latest sports news from SportsSite about soccer, football and tennis.

    This website provides information about CSS and other things. Keep Supporting Us With the Latest News and we Will Provide the Best Of Our To Makes You Updated All Around The World News. Keep Sporting US.

    Facebook Twitter Instagram Pinterest YouTube
    Top Insights

    Chris Wood adds AU Small Finance Bank to Jefferies’ India portfolio, removes CAMS

    June 2, 2023

    From New Tax Regime to Old, avoid these top 9 Income Tax Return (ITR) filing mistakes in 2023: Archit Gupta

    June 2, 2023

    Tata Motors, Titan, Britannia, Metro Brands among 125 NSE stocks to hit 52-week highs; 13 touch 52-week lows

    June 2, 2023
    Get Informed

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    © 2023 bestwebsite-builders. Designed by bestwebsite-builders.
    • Home
    • About us
    • Contact us
    • DMCA
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.

    Go to mobile version
    x