Cloudflare Image Transformation Flaw Allows Hackers to Bypass CSP and Execute Malicious JavaScript
Researchers showed how a flaw in Cloudflare's image service lets hackers bypass security rules to run malicious code on websites.
Overview
Security researchers demonstrated an attack chainThe full sequence of steps an intruder takes from initial break-in to final goal against Cloudflare's Image Transformations service that bypasses SVGA vector image format written in text tags that can also contain interactive web scripts sanitization and Content Security PolicyAn HTTP response header that tells browsers which domains are allowed to load scripts on a web page. This flaw allows malicious JavaScriptThe programming language that web browsers run to make web pages interactive, and that also runs on servers execution on a targeted website's origin by exploiting an XML serialization weakness in the svg-hush sanitizerA software filter or compiler check that cleans untrusted input or catches memory bugs during testing. The attack also uses Chromium cache behavior and redirectsA web flaw where a trusted site accepts an outside URL parameter and forwards visitors there to circumvent image source restrictions. The vulnerability targets the /cdn-cgi/image/ endpointAny user device or server, such as a laptop, phone, or workstation, connected to a network, which is served from customers' own hostnamesThe human-readable label assigned to a computer or server on a local network or the internet. If an attacker defeats the endpoint's safeguards, they can retrieve attacker-controlled content and turn it into a same-origin cross-site scriptingA web flaw where an attacker sneaks malicious script into a page that other visitors' browsers run payloadThe part of an attack or malware file that carries out the harmful action on the target. The exploitationA piece of code or technique that uses a software flaw to break into or crash a system depends on specific service configurations and browser navigation conditions, so it will not affect every Cloudflare customer automatically.
Terms in this story
- attack chain
- The full sequence of steps an intruder takes from initial break-in to final goal. Incident reports map out the full attack chain, such as a phishing email that drops a loader, steals domain credentials, and finally deploys ransomware across servers.
- SVG
- A vector image format written in text tags that can also contain interactive web scripts. Because browsers treat an SVG file like a small web document rather than a simple grid of pixels, phishers attach SVG files to emails to hide links and login forms from scanners.
- Content Security Policy
- An HTTP response header that tells browsers which domains are allowed to load scripts on a web page. When a website sets a strict Content Security Policy, a visitor's browser refuses to run unauthorized inline scripts or send stolen data to an attacker's server during a cross-site scripting attack.
- JavaScript
- The programming language that web browsers run to make web pages interactive, and that also runs on servers. Because every browser runs JavaScript automatically when loading a page, attackers use malicious JavaScript in cross-site scripting, fake browser updates, and compromised software packages.
- script
- A short program written in an interpreted language to automate tasks in a browser, shell, or application. System administrators write scripts to automate daily maintenance, while attackers often use a script to download malware and disable security settings without dropping a compiled file.
- sanitizer
- A software filter or compiler check that cleans untrusted input or catches memory bugs during testing. Web apps run user comments through an HTML sanitizer to strip out script tags, and developers compile system programs with an address sanitizer to catch buffer overflows before release.
- redirects
- A web flaw where a trusted site accepts an outside URL parameter and forwards visitors there. Attackers abuse an open redirect on a well-known website so the link in their email starts with a trusted domain name before forwarding the victim to a fake login page.
- endpoint
- Any user device or server, such as a laptop, phone, or workstation, connected to a network. Security teams install monitoring tools on every company endpoint because a single employee laptop infected at home can carry malware onto the corporate network.
- hostnames
- The human-readable label assigned to a computer or server on a local network or the internet. During an intrusion investigation, logs often identify which employee laptop or internal server was accessed by its hostname alongside its IP address.
- cross-site scripting
- A web flaw where an attacker sneaks malicious script into a page that other visitors' browsers run. If a forum or comment box shows user text without filtering out script tags, an attacker can use cross-site scripting to steal session cookies from anyone who views the page. Security+ objective 2.3 lists the term
- payload
- The part of an attack or malware file that carries out the harmful action on the target. A phishing email and an exploit are only the delivery steps, while the payload is the ransomware or spyware that actually runs once the computer is compromised.
- Exploitation
- A piece of code or technique that uses a software flaw to break into or crash a system. Finding a vulnerability is only the discovery of a weakness, whereas an exploit is the working code or sequence of inputs that triggers that weakness in practice. Security+ objective 2.4 lists the term
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the GBHackers website. Cite the article, not this page.
Read the full article on GBHackers (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Vulnerability and patch
"...bypasses SVG sanitization and Content Security Policy..." Found by reading the article; these exact words are in it - Security+ 2.3 Explain various types of vulnerabilities.
"Cloudflare Image Transformation Flaw Allows Hackers to Bypass CSP and Execute..." Found in the headline - Security+ 4.2 Explain the security implications of proper hardware, software, and data asset management.
"......Cloudflare's Image Transformations service that bypasses SVG sanitization and Content Security Policy (CSP), enabling malicious..." Found in the opening sentences - Security+ 5.1 Summarize elements of effective security governance.
"......service that bypasses SVG sanitization and Content Security Policy (CSP), enabling malicious JavaScript execution on a..." Found in the opening sentences - CYBR 101 week 10: the web, cookies, phishing, incident response and logs
"......enabling malicious JavaScript execution on a targeted website's origin. Published on October 28, 2026,..." Found in the opening sentences - CYBR 101 week 11: penetration testing, OSINT, MITRE ATT&CK and hacking back
"Security researchers have demonstrated an attack chain against Cloudflare's..." Found in the opening sentences - CYBR 101 week 8: networks, ports, DNS and packets
"Cloudflare Image Transformation Flaw Allows Hackers to Bypass..." Found in the headline - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Knowledge of web application vulnerabilities.
"...bypasses SVG sanitization and Content Security Policy..." Found by reading the article; these exact words are in it - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Analyze countermeasures and mitigations against potential exploitations of programming language weaknesses and vulnerabilities in system and elements.
"...bypasses SVG sanitization and Content Security Policy..." Found by reading the article; these exact words are in it
How a story is connected to the course, and every objective, week and job role