Learn as if you will live forever, live like you will die tomorrow.

   +1 555 87 89 56   80 Harrison Lane, FL 32547

HomeBlogWebsite SecurityThe 2017 WordPress REST API Attack That Defaced 1.5 Million Pages

The 2017 WordPress REST API Attack That Defaced 1.5 Million Pages

⚡ The fix in short
  • Update WordPress immediately — this class of attack only works on unpatched versions
  • Restore edited content from Revisions or a clean backup rather than hand-editing defaced pages
  • Audit admin users and settings; content access was unauthenticated, but attackers who found it often added persistence
  • Turn on auto-updates for core so the next silent security release protects you without a human remembering

This post is part of our series on WordPress attacks in the last 10 years — one major attack per day, what it was, how to detect it, how to remove it and how to keep it out. This instalment covers The 2017 WordPress REST API Defacement (February 2017).

What happened

WordPress 4.7 added REST API endpoints that contained a content-injection flaw: an unauthenticated attacker could modify any post or page by sending a crafted request. WordPress quietly fixed it in 4.7.2 (January 2017) and delayed public disclosure for a week to let sites update. Many didn’t. When the flaw became public, defacement campaigns industrialised it within 48 hours — attackers first replaced page content with ‘Hacked by…’ messages, and researchers warned the same access would soon be monetised with SEO spam instead of graffiti.

Who was exposed: WordPress core 4.7.0 and 4.7.1 — a core flaw, not a plugin. Why it mattered: More than 1.5 million pages on over 39,000 sites were defaced within days, across around 20 separate attack campaigns — the largest mass defacement in WordPress history.

How this attack works

No login, no password, no plugin was needed — just a request to a public API endpoint with a manipulated ID parameter, which WordPress treated as permission to edit. Automated scripts walked lists of WordPress sites, checked the version, and rewrote pages in bulk. The entire attack was a lesson in patch latency: the fix existed before the attacks peaked, so the victim list was effectively ‘everyone who had not updated’.

The exploitation itself is usually automated end to end. Bots continuously scan the web reading plugin readme files and version strings; the moment a vulnerable version is fingerprinted, an exploit script fires — creating an admin account, uploading a web shell, or injecting a database payload, depending on the flaw. The site owner typically did nothing ‘wrong’ on the day it happened beyond running a popular plugin a few versions behind, which is why the median time from disclosure to mass attack — about five hours for the worst flaws in 2025 — matters so much.

Signs your site has it — and how to confirm

  • Pages or posts whose content changed without anyone on your team editing them (check Revisions and the post modified dates)
  • Defacement text, unfamiliar links or spam appearing in post content itself — unlike cloaked spam, this attack edited the real content
  • A site still running a WordPress version with known, publicised flaws
  • Modified timestamps clustering on a single date across many posts

Confirm the plugin and its version on your site against the affected versions in the advisory — if you are at or below the vulnerable version, treat the site as exposed, not just at risk. Then check for the fingerprints of a successful exploit: admin users you did not create, files modified after the disclosure date, PHP files in uploads, and unfamiliar options or cron jobs in the database.

Step-by-step removal and recovery

Immediate actions for this attack

  • Update WordPress immediately — this class of attack only works on unpatched versions
  • Restore edited content from Revisions or a clean backup rather than hand-editing defaced pages
  • Audit admin users and settings; content access was unauthenticated, but attackers who found it often added persistence
  • Turn on auto-updates for core so the next silent security release protects you without a human remembering

The full protocol

  1. Back up first, labelled infected — you may need it for evidence or rollback.
  2. Update the vulnerable plugin immediately if a fix exists; if none exists, deactivate and delete it — an unpatched known flaw is an open door.
  3. Assume entry may already have happened: audit every administrator account (including in the database, where hidden admins do not show in wp-admin).
  4. Scan files and database: recently modified PHP, PHP in uploads, encoded payloads in wp_options, rogue cron jobs.
  5. Reinstall the plugin (and ideally core and theme) from clean official sources rather than trusting edited files.
  6. Rotate wp-admin, hosting, database and FTP credentials, and regenerate wp-config.php salt keys to kill every existing session.
  7. Verify with a fresh fetch of key pages and a server-side scan, then watch file-change alerts closely for two weeks — reinfection almost always means a persistence point survived.

How to prevent it

  • Enable automatic core updates — the single change that would have saved nearly every 2017 victim
  • Keep a security plugin’s firewall active; WAF rules blocked this exploit for protected sites before many owners updated
  • Subscribe to WordPress release news; security releases are rare and always urgent
  • Back up off-server so a mass content change is an inconvenience, not a rebuild

The defences repeat across this whole series for a reason: kept-updated software, unique passwords with 2FA, the fewest possible plugins, backups stored off the server, and monitoring that looks at your site the way an attacker — or Google — does. Sites rarely fall to one exotic trick; they fall to one ordinary gap.

FAQs

Was this WordPress core’s fault or a plugin’s?

Core’s — one of the very few mass incidents in ten years where core itself was the entry point. The pattern since then has been overwhelmingly plugins and themes.

Could this exact attack work today?

Not against an updated site — it was patched in 4.7.2 in January 2017. Its modern equivalent is a newly disclosed plugin flaw being mass-exploited within hours, which is why update speed is the real defence.

My content was defaced but nothing else seems wrong. Am I safe after restoring it?

Restore, then still audit users, files and database. Defacement was the visible act; professional attackers who found the same door often left quieter things behind.

Next in the series and the full timeline: WordPress Attacks in the Last 10 Years — the complete guide.

JUNOBIZZ WEBSITE SECURITY
Worried your site is already compromised?

JunoBizz audits, cleans and hardens WordPress sites — cloaked spam, rogue admins, poisoned plugins and everything in this series. Get the checks run before Google finds the problem.

Talk to JunoBizz

© UiCore 2026. All Rights Reserved.