Security research12 min read

The WordPress SVG Security Gap Nobody Is Incentivized to Report

Why SVG uploads keep producing stored XSS in WordPress plugins, why those findings are increasingly out of scope for CVE assignment, and how site owners should audit their own stack.

SVG is one of the most useful image formats on the web.

It is scalable, lightweight, editable, searchable, and ideal for logos, icons, illustrations, diagrams, and modern interfaces. There is nothing inherently malicious about using SVG files.

But an SVG is not just a conventional image.

Unlike a JPEG or PNG, an SVG is an XML document capable of containing links, event handlers, external resources, animations, and executable scripts. When an application accepts an SVG from an untrusted source and serves it without adequate sanitization, what appears to be an image upload can become a stored cross-site scripting vulnerability.

That distinction creates an important, and largely overlooked, security gap in the WordPress ecosystem.

WordPress Does Not Handle SVG Uploads by Default

WordPress does not normally include SVG among the file types users can upload through the Media Library. Developers can add it through the upload_mimes filter, but enabling the MIME type alone does not sanitize the file.

This is not an accidental omission. The WordPress Core discussion about adding SVG support has remained tied to the need for a reliable sanitization mechanism comparable to the protections WordPress applies to HTML.

As a result, SVG functionality is usually introduced through one of three paths:

  • A plugin specifically designed to enable SVG uploads.
  • Custom code added by a developer.
  • A plugin or theme whose primary purpose has nothing to do with SVG, but which accepts SVG files as part of another feature.

That third category concerns me the most.

A plugin may support custom icons, logos, templates, import files, page-builder elements, font packages, option panels, or frontend submissions. SVG support is added as a convenience, not as the plugin's primary feature.

Because it is secondary functionality, its security often receives secondary attention.

The Problem Is Not SVG Support. It Is Unsafe SVG Support.

A properly sanitized SVG is not inherently unsafe.

The problem begins when a plugin merely checks the extension or MIME type and then stores the file without deeply inspecting its contents. The same problem appears when developers attempt to sanitize SVGs with a few custom regular expressions.

SVG is a complex XML-based format. Removing <script> tags alone is not sufficient. Script execution may be introduced through event handlers, external references, dangerous URLs, embedded content, namespace tricks, malformed markup, or combinations that a simplistic filter does not anticipate.

Browsers explicitly support scripting inside SVG documents. When malicious SVG content is rendered in a dangerous context, that capability can become an XSS vector.

This is why regex-based sanitization should be treated as a warning sign rather than a security control.

Why SVG-Based XSS Matters in WordPress

Cross-site scripting is sometimes dismissed as less serious than remote code execution or an unauthenticated account takeover.

That is a mistake.

XSS gives an attacker the ability to execute JavaScript in another user's browser within the affected site's security context. Depending on the circumstances, an attacker may be able to:

  • Perform administrative actions through the victim's authenticated session.
  • Create or modify WordPress users.
  • Install or alter plugins and themes.
  • Steal sensitive information accessible through the page.
  • Capture non-HttpOnly tokens or other browser-accessible data.
  • Redirect users to phishing pages.
  • Modify content or inject persistent backdoors into site settings.
  • Chain the XSS with another weakness to achieve broader compromise.

When the person who triggers the payload is a WordPress administrator, the JavaScript may operate with the practical authority of that administrator.

OWASP notes that severe XSS attacks can result in session hijacking, account impersonation, sensitive-data theft, content manipulation, and actions performed on behalf of the victim.

In other words, an SVG stored XSS vulnerability does not have to end with an alert box. The alert box is merely proof that arbitrary JavaScript execution is possible.

The Reporting Blind Spot

There is another side to this issue that site owners and agencies rarely see: the vulnerability-reporting incentive structure.

WordPress security products and vulnerability databases do valuable work, but they are still operated under business rules, program scopes, eligibility requirements, and resource constraints.

A scanner cannot warn you about a vulnerability that was never accepted, assigned an identifier, published, or added to its database.

In February, I submitted an SVG-related stored XSS finding affecting Redux Framework. The submission was declined. The explanation was, in substance, that Wordfence no longer assigns CVE IDs to SVG upload issues because safe SVG handling should ultimately be addressed through a default Core-level sanitizer. Under that interpretation, SVG upload behavior is treated as a platform responsibility rather than a vulnerability in an individual plugin or theme.

I understand the architectural argument.

WordPress Core providing a standard, well-maintained SVG sanitizer would significantly improve the ecosystem. Plugin and theme developers should not have to independently solve the same difficult sanitization problem hundreds of times.

But there is also an immediate operational reality:

WordPress does not currently provide that protection, while plugins and themes are already enabling SVG uploads today.

The absence of a Core-level solution does not prevent vulnerable implementations from being exploited.

It only means responsibility is fragmented.

What Happens When Reports Are Out of Scope?

When a vulnerability class is excluded from a bounty or CVE-assignment process, researchers have fewer reasons to spend time investigating it.

There may be:

  • No bounty.
  • No CVE.
  • No public recognition.
  • No vulnerability-database entry.
  • No guarantee that the vendor will respond.
  • No efficient disclosure path.

A researcher can still report the issue directly to the developer, of course. Some vendors respond quickly and professionally.

Others are extremely difficult to contact, do not maintain a security channel, or never acknowledge vulnerability reports.

The result is predictable: researchers remove that vulnerability class from their pipelines and focus on findings that programs will actually process.

That is what I did.

After the Redux Framework response, I stopped submitting this category of findings through that channel and removed general SVG testing from my broad vulnerability-research pipeline. I now review it primarily for clients whose WordPress stacks contain features that accept or process SVG files.

This does not mean the vulnerabilities disappeared.

It means fewer people are looking for them, fewer people are reporting them, and fewer site owners will receive automated warnings about them.

Why Security Alerts Are Not Enough

Many WordPress agencies rely on vulnerability alerts from hosting providers, security plugins, vulnerability databases, or management dashboards.

Those alerts are useful, but they are downstream controls. They generally depend on a vulnerability first being discovered, accepted, documented, published, and mapped to the affected software and versions.

A clean security dashboard therefore does not prove that a stack is secure.

It may only prove that no matching issue has reached the dashboard's data source.

This distinction becomes especially important for vulnerabilities that fall outside a reporting program's scope.

The affected plugin may remain installed on thousands of sites. The vulnerable code may remain accessible. The vendor may never receive a report. Yet every security scanner can still show green because no recognized advisory exists.

What WordPress Site Owners and Agencies Should Do

The first step is to identify every place in the stack where SVG files can enter the application.

Do not limit the review to plugins with "SVG" in their names. Look for:

  • Media Library extensions.
  • Page builders and block libraries.
  • Theme option frameworks.
  • Custom logo and icon uploaders.
  • Frontend submission forms.
  • Import and export functionality.
  • Template libraries.
  • User avatars and profile images.
  • Product customization tools.
  • Custom fields that accept files.
  • REST or AJAX upload endpoints.
  • ZIP packages that may contain SVG files.

For every upload path, determine:

  1. Who can upload the file? Administrator-only access reduces exposure, but it does not automatically make unsafe handling acceptable. Compromised accounts, delegated site management, multisite environments, and stored payloads can still create risk.

  2. How is the SVG validated? Extension and MIME checks are not sanitization.

  3. Which sanitizer is used? Prefer a mature, actively maintained SVG sanitization library over custom regex rules.

  4. When is sanitization performed? The file should be sanitized before it becomes publicly accessible, not only when inserted into a page.

  5. How is the file served or embedded? An SVG loaded through an <img> element may behave differently from one rendered inline, opened directly, embedded as an object, or processed by another component.

  6. Can dangerous content survive transformations? Renaming, importing, optimizing, generating thumbnails, or re-saving the file may bypass the original validation path.

  7. Is the feature actually necessary? Disable unused SVG upload functionality and restrict it to the minimum required roles.

A restrictive Content Security Policy can also reduce the impact of some script-injection paths, although it should be treated as defense in depth, not as a substitute for correct sanitization.

AI Can Help, but It Is Not the Entire Review

Modern code-analysis models can make this type of review much faster.

They can help identify upload endpoints, trace MIME checks, locate custom regex filters, compare sanitization paths, and flag places where a file is stored or rendered without passing through the expected validation.

That makes an AI-assisted review of a WordPress plugin stack practical for more agencies than it was a few years ago.

But AI output still requires validation.

A model may miss indirect data flows, misunderstand WordPress hooks, incorrectly assume a function sanitizes content, or flag code that is not actually reachable. The ideal process combines automated analysis, AI-assisted code review, and manual verification by someone familiar with WordPress security.

For organizations that maintain a relatively stable plugin stack across many client websites, periodic review can be especially valuable. Once the baseline is understood, future updates can be checked for changes to the relevant upload and rendering paths.

The Larger Lesson

The WordPress SVG problem reveals a broader truth about software security:

The absence of a vulnerability alert is not the absence of a vulnerability.

Security databases show what passed through their collection and publication processes. Bug bounty programs show what fits their scopes and incentive structures. Neither represents every weakness that may exist in the software running on a website.

SVG support should eventually be handled consistently at the WordPress Core level. That would reduce duplicated effort, establish a safer default, and prevent each plugin author from having to invent a sanitizer.

Until that exists, however, plugins and themes that choose to accept SVG files are making a security-sensitive implementation decision.

Site owners cannot afford to pretend that the responsibility disappears simply because a reporting program considers the issue out of scope.

For agencies and organizations using WordPress, the practical response is to review the actual stack, not just the vulnerability notifications associated with it.

If SVG files are part of your WordPress workflow, it is worth verifying who is responsible for making them safe.

Right now, the answer may be: nobody.