Update to WordPress 7.1.5. Then, if you write themes or plugins, read on: most of the 20 fixes in this release are mistakes your own code can make too. WordPress 7.1.5 shipped on November 18, three weeks after 7.1.4. It fixes an SQL injection reachable without a login, a site-editor link that can trick an administrator into creating a new administrator, stored XSS that anyone who can leave a comment can plant, and a long list of smaller problems. No attacks have been reported. I compared the 7.1.4 and 7.1.5 code, and the fixes make a useful code-review checklist.
At a glance
| Release | WordPress 7.1.5, November 18, 2026 (security release) |
|---|---|
| Fixes | 20 items in the release post: 8 XSS, 2 SQL injection, information disclosures, authorization bypasses, a denial of service, a multisite privilege escalation and two hardening changes |
| Worst | Template Part link that gets an administrator to create a new administrator (Wordfence 8.8). SQL injection via nested meta query relations (7.5, no login) |
| Affected | Varies by bug, as far back as 1.5. Most go back years |
| Fixed | 7.1.5. Backports to older branches (back to 4.7) announced as “in progress” |
| Status | No exploitation reported. No CVEs assigned yet |
The ones to know about
Template Part entity key: one click to a new administrator
The site editor loads templates and template parts by an ID, the “entity key,” and builds REST requests from it. That ID could come from a link. In 7.1.4 and earlier, a crafted key could carry encoded path segments, so the editor built a request to a different endpoint than the one it meant to call, with the administrator’s nonce attached. Wordfence’s test produced a working administrator account created by the victim’s own browser. 7.1.5 adds an isSafeEntityKey() check to the editor’s data layer that rejects keys containing encoded slashes or path tricks. It affects 5.9 and later. Reported by Logan Homolka.
SQL injection in WP_Meta_Query
WP_Meta_Query accepts a relation of AND or OR, and can nest clauses inside each other. The top level was checked. A nested clause that lost its empty value during sanitizing could skip the check and keep whatever relation it arrived with, which went into the SQL as written. 7.1.5 adds a sanitize_relation() method that only ever returns AND or OR, and calls it everywhere a relation is read. It affects 4.1 and later. Reported by Christiaan Swiers.
Wordfence rates it unauthenticated, but core doesn’t take a meta_query from visitors. The real exposure is themes and plugins that build one from request data, such as filters, faceted search and directory listings. If your code does that, this one was yours.
Stored XSS via escaped shortcode attributes in comments
Shortcode attributes run through stripcslashes(), so \x3c in an attribute becomes <. Content filtered by KSES, such as a comment, could carry harmless-looking escapes that only turned into markup after shortcode parsing. 7.1.5 decodes those escapes to HTML entities (< and so on) when they would produce <, > or a quote. It affects 2.5 and later. Reported by Rafie Muhammad.
Six lessons for your own code
1. Allow lists for SQL keywords, not escaping
The meta query fix is the pattern for anything that ends up in SQL as a keyword: ASC/DESC, AND/OR, column names. You can’t escape those, so map the input to a fixed set of known values and fall back to a safe default:
$relation = ( is_string( $raw ) && 'OR' === strtoupper( $raw ) ) ? 'OR' : 'AND';
Validate on every path the value takes, including nested and recursive ones. That’s where this bug lived.
2. prepare() even when you think it’s an integer
7.1.5 also rewrites a dozen places in WP_Query that built SQL by concatenating values that were supposed to be numbers or known statuses: p, page_id, menu_order, the date parts of m, and post status lists. None is listed as a vulnerability. They were changed to $wpdb->prepare() because “supposed to be” isn’t proof. Wrapping the value in an array, as core now does, means an array input becomes 0 instead of silently dropping the condition.
grep -rnE "\\\$wpdb->(query|get_results|get_var|get_row|get_col)\(\s*\"[^\"]*\\\$" wp-content/themes wp-content/plugins --include=*.php | grep -v prepare
That finds queries with variables interpolated directly into the string. Every hit deserves a look.
3. Escape the output of format functions
The Comment Date block printed whatever date() returned for the format the author chose. PHP date formats let you put literal characters in with backslashes, so a format string can produce markup. 7.1.5 wraps the result in esc_html(). It’s the same family as last month’s sprintf() bug in the Categories block. A format string the user controls is user input, and so is whatever it produces.
4. Hash with a context prefix
Customizer menu previews signed their arguments with wp_hash( serialize( $args ) ). Other code used the same construction for different purposes, so a hash made for one purpose could be accepted for another. On multisite, that let a site administrator take over a Super Admin account. The fix is one line:
wp_hash( 'customize_nav_menu_args|' . serialize( $args ) );
If you sign or verify anything with wp_hash() or hash_hmac(), put a unique purpose string first. It costs nothing and makes your tokens impossible to swap between uses.
5. Escape the hyphen in a character class
This is my favorite fix in the release. wp_is_json_media_type() used this pattern:
[\w!#\$&-\^\.\+]
The unescaped - between & and \^ doesn’t mean “a hyphen.” It means “every character from & to ^,” which includes digits, uppercase letters, and <, =, >, ? and @. The fix is a single backslash: &\-\^. It was filed as hardening, but your own regular expressions can hide the same thing. Put a literal hyphen first or last in a character class, or escape it.
6. Never build request paths from strings you didn’t make
The Template Part bug is a path traversal in JavaScript. If your block or admin screen builds a wp.apiFetch path from an ID that came from a URL, a crafted ID can point the request somewhere else, and apiFetch attaches the nonce wherever it goes. Validate IDs against the format you expect (a number, or a slug) before they become part of a path, and reject anything with /, %2f or ...
The rest of the release
- XML-RPC: one
system.multicallrequest could batch many pingbacks, multiplying the server work (an unauthenticated denial of service). Now one pingback per request. Separately,wp.getCommentsno longer shows commenter emails and IPs to Subscribers, or comments on private posts. - oEmbed: the oEmbed proxy no longer passes a provider’s
scriptsto the editor, which let a Contributor’s embed run script when an editor opened the draft. - Interactivity API: the store namespace in
wp_interactivity_data_wp_context()is now escaped. - Block editor XSS: Openverse image metadata, and media filenames when converting a block to a File block.
- Customizer: an SQL injection through the front page setting in changeset previews (Administrator only), and stored XSS in previews. The
show_on_frontoption is now forced topageorposts. - Comments and Notes: Authors could move a comment onto a post they can’t edit, turn a private editorial Note into a public comment, and read user emails through the REST comments endpoint.
- REST: private taxonomy terms leaked through the search endpoint with an empty subtype, and author assignment revealed which user IDs exist on a multisite network.
- Legacy media popup: a reflected XSS through
rest_route. - Hardening: the block editor’s Imgur embed variation is removed, since the server side was already gone.
What to do
1. Update
wp core version
wp core update
wp core verify-checksums
Sites with automatic background updates should already be on 7.1.5. Older branches get backports as they’re ready. The release also applies the 7.0 change that removed 1024-bit root certificates to 6.9.12 and earlier.
2. Turn off XML-RPC if you don’t use it
Two of the 20 fixes are in XML-RPC. Most sites today don’t need it: the block editor, the mobile apps and most integrations use the REST API. If nothing of yours uses XML-RPC, turn it off:
add_filter( 'xmlrpc_enabled', '__return_false' );
That stops authenticated XML-RPC methods. To block the endpoint completely, including pingbacks, deny xmlrpc.php at the server.
3. Check your meta queries
grep -rnE "meta_query|'relation'" wp-content/themes wp-content/plugins --include=*.php | grep -E "\\\$_(GET|POST|REQUEST)|get_query_var|wp_unslash"
Anything that builds a meta query from request data should map relation, compare and type to allowed values itself, not count on core to clean them up.
4. Test your custom editor code
If you’ve built site-editor extensions that open templates or template parts by ID, check them against 7.1.5. The editor now throws “Invalid entity record key” for IDs it considers unsafe.
Where sources disagree
- The Template Part bug. The release post calls it “unauthenticated privilege escalation … that could lead to remote code execution.” Wordfence describes the path it proved as cross-site request forgery: it needs an administrator to open the attacker’s link, and remote code execution “was not demonstrated.” A new administrator account is close to code execution on most sites, because administrators can install plugins. But it takes a click.
- Meta query severity. Wordfence scores it as an unauthenticated 7.5. Core alone doesn’t pass visitor input into a meta query, so the risk depends on your theme and plugins.
- Count. The release post has 20 items. Wordfence lists 19: it leaves out the two hardening changes and splits the comment-editing fix into two entries.
The bigger lesson
Look at the dates in Wordfence’s list. Some of these bugs go back to WordPress 1.5, 2.5, 3.4 and 4.1, in code that has been read thousands of times. These aren’t exotic mistakes. They’re an unescaped hyphen, a value concatenated into SQL, a hash without context, a format string. Old code isn’t proven code, it’s code nobody has looked at in a while. The fixes in this release are a free code review for your own themes and plugins: take the six lessons above and grep for them.
Sources
- WordPress.org: WordPress 7.1.5 release announcement
- Wordfence: CSRF to administrator account creation via Template Part entity key
- Wordfence: Unauthenticated SQL injection via nested WP_Meta_Query relation
- Wordfence: Unauthenticated stored XSS via escaped shortcode attributes in comments
- Wordfence Intelligence: WordPress core vulnerabilities
- WordPress Developer Resources: wpdb::prepare()