XSSI: Quick Navigation Interface - leak of private page/post titles
The Quick Navigation Interface plugin puts the titles of all posts and pages, including drafts and private ones, into an automatically generated JavaScript file. An attacker can include that file on their own page and read the titles when a logged-in user visits, because the file can be loaded cross-site.
- Triaged in 2 hours
- Fixed in 23 hours
- Paid in 2 hours
- Disclosed after 36 hours
CVSS
Medium 4.3 CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Description
The Quick Navigation Interface plugin includes the names of all posts and pages in an automatically generated JavaScript file.
By including this file in their own page, an attacker can view all post titles - including those of drafts and private posts, which should remain secret - if an authenticated user visits their website.
POC
Setup: install the plugin & create a private post (set "Visibility" to "private").
While authenticated, visit a webpage that contains the following HTML code:
<script src="http://192.168.0.104/wordpress5/wordpress/wp-admin/admin-ajax.php?action=qni_content_index"></script>
<script>
console.log(window.qniContentIndex); // in a real-world attack, this would be send to the attacker's server
</script>
Impact
disclosure of private post/page titles
Context
The target is the WordPress.org plugin directory, and specifically the Quick Navigation Interface plugin. The plugin includes the names of all posts and pages in an automatically generated JavaScript file. The proof of concept loads the index from admin-ajax.php with the qni_content_index action.
The problem is that this index is not limited to published content. It also includes the titles of drafts and private posts, which are meant to stay secret. Because the file is JavaScript, it can be loaded cross-origin with a plain <script> tag, and the browser will execute it in the context of whatever page includes it. That is the classic setup for a cross-site script inclusion (XSSI) information leak.
Setup
The setup is minimal:
- Install the Quick Navigation Interface plugin on a WordPress installation.
- Create a private post by setting its "Visibility" to "private".
- Stay authenticated in the browser as a user who can see that private post.
- Visit an attacker-controlled page while still authenticated.
The proof of concept uses a local WordPress installation reachable at [redacted] under the path /wordpress5/wordpress/. No special tools are needed beyond a browser and a page the researcher controls.
Finding it
The researcher noticed that the plugin includes the names of all posts and pages in an automatically generated JavaScript file. Since that file is generated per site and contains the full content index, it is not just navigation data: it is a list of titles, including titles of content that should not be public. The fact that the data is delivered as executable JavaScript rather than as JSON with a non-scriptable content type is what makes it readable from another origin.
Exploitation
Step 1: Prepare private content
Install the plugin and create a private post, setting "Visibility" to "private". This gives the index something secret to leak.
Step 2: Get the victim to load the index as a script
While authenticated, visit a webpage that contains the following HTML code:
<script src="http://[redacted]/wordpress5/wordpress/wp-admin/admin-ajax.php?action=qni_content_index"></script>
<script>
console.log(window.qniContentIndex); // in a real-world attack, this would be send to the attacker's server
</script>
The first <script> tag points at admin-ajax.php with action=qni_content_index. Because it is a script tag, the browser sends the victim's cookies for the WordPress site along with the request, and it executes whatever JavaScript comes back. The second script block reads the global window.qniContentIndex.
The second <script> block reads that global. In the proof of concept it only logs it to the console; as the comment notes, in a real-world attack the value would be sent to the attacker's server.
Step 3: Read the leaked titles
The attacker now has the full content index, which includes the titles of drafts and private posts alongside the public ones. The only condition is that an authenticated user visits the attacker's page while logged in to the target site.
Root cause
The plugin exposes the complete post and page index, including non-public titles, through an endpoint that returns JavaScript. Because the response is valid JavaScript that assigns to a predictable global (qniContentIndex), any other site can include it with a <script src=...> tag and read the value. The browser's same-origin policy does not prevent a script from being included cross-origin, and it does not prevent the including page from reading globals that the included script defines. The file includes the titles of drafts and private posts, which should remain secret.
Impact
An attacker can view all post titles, including those of drafts and private posts, which should remain secret, provided an authenticated user visits the attacker's website. The disclosure is limited to titles of posts and pages; the report does not claim access to post bodies or other data. The CVSS vector given is CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N, a medium score of 4.3, reflecting a confidentiality-only impact that requires user interaction.
Fix
The report does not state what change was made. The natural fix follows from the root cause: stop returning the index as executable JavaScript that assigns a global, restrict the index to content the requesting user is allowed to see, and require a mechanism that a cross-origin script tag cannot satisfy, such as a per-request token or an origin check.
Variants to test
- Look for other
admin-ajax.phpactions that return JavaScript rather than JSON, and check whether the response assigns to a global. A positive result is a response you can include with<script src=...>and read fromwindow. - Check whether content indexes, sitemaps, search suggestions or autocomplete endpoints include draft or private titles. A positive result is a title of non-public content appearing in a response to an unauthenticated or cross-origin request.
- Test whether the endpoint varies its output by the authenticated user's permissions. A positive result is private titles appearing for a user who should not see them, or appearing in a response fetched cross-origin with the victim's cookies.
Hunting notes
This kind of bug tends to hide in plugin endpoints that generate JavaScript for front-end features: navigation indexes, search autocomplete, related-posts widgets and anything that builds a global variable for other scripts to consume. During recon, the signal is an admin-ajax.php?action=... URL that returns JavaScript content rather than JSON, especially one whose output contains site content. The researcher set up a private post and included the index from another origin to show the leak.
What happened, in plain words
A WordPress plugin called Quick Navigation Interface includes the names of all posts and pages in a generated JavaScript file. It includes the names of all posts and pages in an automatically generated JavaScript file. The problem is that this list is not limited to public content. It also contains the titles of drafts and private posts, which the site owner meant to keep hidden.
Because the list is delivered as JavaScript, any other website can pull it in with a simple <script> tag. If a logged-in user of the WordPress site visits that other website, the attacker can view the titles. The attacker never needs a password: the victim's browser does the work.
This class of bug is called cross-site script inclusion, or XSSI. The report was rated medium, with a CVSS score of 4.3, and the researcher was paid a 50.00 USD bounty.
Some background you need first
Before walking through the report, here are the pieces it relies on.
- WordPress is a popular system for building websites. A site built on it has posts (articles) and pages (fixed pages such as "About").
- A plugin is an add-on that gives a WordPress site extra features. Quick Navigation Interface is one such plugin; it adds a quick navigation interface to the site.
- A post's visibility controls who can see it. A published post is visible to everyone. A private post is visible only to logged-in users who are allowed to see it. A draft is work in progress, not yet published. Titles of private posts and drafts are meant to stay secret.
- JavaScript is the programming language that runs inside web pages. A page can load JavaScript from another site with a
<script src="...">tag, and the browser will run it as part of the page that included it. admin-ajax.phpis a file that ships with WordPress. Many plugins use it as a general-purpose doorway: a request goes to that one file with anactionparameter naming what the plugin should do. Think of it as a reception desk in a building: you always walk up to the same desk, and tell the receptionist which department you want.- An endpoint is simply a URL that a program can call to get something done or get data back.
admin-ajax.php?action=qni_content_indexis an endpoint. - A global variable is a named storage slot that every script on a page can read.
window.qniContentIndexis one:windowis the browser's global object, andqniContentIndexis a property on it. - The same-origin policy is a browser safety rule. A page from one site (one origin) is normally not allowed to read data from another site. But the rule has a deliberate exception: a page may include a script from another site, and that script runs in the including page. That exception is exactly what XSSI abuses.
- Cookies are small pieces of data the browser stores for a site and sends back with every request to that site. They are how a site remembers that you are logged in. When your browser requests a script from the WordPress site, it sends your WordPress cookies along, so the server treats the request as coming from you.
- Cross-origin means "from a different site". A page on
attacker.exampleloading a script from the WordPress site is a cross-origin request. - XSSI (cross-site script inclusion) is an information leak where a site serves private data as JavaScript, and another site includes that JavaScript with a
<script>tag and then reads the data out of the global variable the script fills in. - CVSS is a standard scoring system for the severity of a security flaw. The vector string in the report is a compact way of writing down the score's ingredients.
The target and the feature
The target is the WordPress.org plugin directory, and specifically the Quick Navigation Interface plugin. The plugin builds a quick navigation interface for a WordPress site. To do that, it generates a JavaScript file containing the names of all posts and pages on the site. That generated file is served through WordPress's admin-ajax.php endpoint under the qni_content_index action.
The flaw is that this index is not limited to published content. It also includes the titles of drafts and private posts, which are meant to stay secret. And because the file is JavaScript, it can be loaded cross-origin with a plain <script> tag, and the browser will execute it in the context of whatever page includes it. That is the classic setup for an XSSI information leak.
Setting up the test
The setup is minimal:
- Install the Quick Navigation Interface plugin on a WordPress installation.
- Create a private post by setting its "Visibility" to "private".
- Stay logged in in the browser as a user who can see that private post.
- Visit a page controlled by the attacker while still logged in.
The proof of concept uses a local WordPress installation reachable at [redacted] under the path /wordpress5/wordpress/. No special tools are needed beyond a browser and a page the researcher controls.
Why each step: the plugin has to be installed because that is what creates the vulnerable endpoint. The private post exists so there is something secret in the index to leak; without it, the test would only show public titles, which proves nothing. Staying logged in matters because the leak only happens when the victim's browser carries the victim's login to the WordPress site. And the attacker-controlled page is where the malicious <script> tag lives.
Finding it
The researcher noticed that the plugin includes the names of all posts and pages in an automatically generated JavaScript file. Since that file is generated per site and contains the full content index, it is not just navigation data: it is a list of titles, including titles of content that should not be public. The fact that the data is delivered as executable JavaScript rather than as JSON with a non-scriptable content type is what makes it readable from another origin.
In plain terms: if the endpoint had returned the list as plain data (JSON) with a content type the browser refuses to run as a script, another site could still fetch it, but the browser would not hand the contents over to the including page. Because it comes back as JavaScript that stores the list in a known global, the including page can simply read that global afterwards.
Exploitation
Step 1: Prepare private content
Install the plugin and create a private post, setting "Visibility" to "private". This gives the index something secret to leak. Without a private post, you cannot tell whether the endpoint is over-sharing or just listing public content.
Step 2: Get the victim to load the index as a script
While logged in, visit a webpage that contains the following HTML code:
<script src="http://[redacted]/wordpress5/wordpress/wp-admin/admin-ajax.php?action=qni_content_index"></script>
<script>
console.log(window.qniContentIndex); // in a real-world attack, this would be send to the attacker's server
</script>
Line by line:
<script src="http://[redacted]/wordpress5/wordpress/wp-admin/admin-ajax.php?action=qni_content_index"></script>tells the browser: go to this URL and run whatever JavaScript comes back, as part of this page. The URL points at the WordPress installation on the local network, at theadmin-ajax.phpfile, withaction=qni_content_indextelling the plugin which job to do. Because it is a script tag, the browser sends the victim's WordPress cookies with the request, so the server answers as if the victim had asked. The second script block reads the globalwindow.qniContentIndex.<script>opens a second block of JavaScript that runs in the same page.console.log(window.qniContentIndex); // in a real-world attack, this would be send to the attacker's serverreads the global that the first script filled in and prints it to the browser's developer console. The comment explains the real attack: instead of printing it, the attacker's page would send the value to the attacker's own server, for example with a network request.</script>closes the block.
Why this works: the browser's same-origin policy stops one site from reading another site's responses directly, but it deliberately allows a script to be included from anywhere. Once that script has run, it has written the secret list into a global variable on the attacker's page, and the attacker's own code is free to read it.
Step 3: Read the leaked titles
The attacker now has the full content index, which includes the titles of drafts and private posts alongside the public ones. The only condition is that a logged-in user visits the attacker's page while logged in to the target site.
Root cause
The plugin exposes the complete post and page index, including non-public titles, through an endpoint that returns JavaScript. Because the response is valid JavaScript that assigns to a predictable global (qniContentIndex), any other site can include it with a <script src=...> tag and read the value. The browser's same-origin policy does not prevent a script from being included cross-origin, and it does not prevent the including page from reading globals that the included script defines. The file includes the titles of drafts and private posts, which should remain secret.
Impact
An attacker can view all post titles, including those of drafts and private posts, which should remain secret, provided a logged-in user visits the attacker's website. The disclosure is limited to titles of posts and pages; the report does not claim access to post bodies or other data. The CVSS vector given is CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N, a medium score of 4.3, reflecting a confidentiality-only impact that requires user interaction.
Reading the vector in plain words: the attack works over the network (AV:N), needs no special conditions (AC:L), needs no login for the attacker (PR:N), needs the victim to visit a page (UI:R), affects only the vulnerable site (S:U), leaks some information (C:L), changes nothing (I:N) and causes no outage (A:N).
Fix
The report does not state what change was made. The natural fix follows from the root cause: stop returning the index as executable JavaScript that assigns a global, restrict the index to content the requesting user is allowed to see, and require a mechanism that a cross-origin script tag cannot satisfy, such as a per-request token or an origin check.
Variants to test
- Look for other
admin-ajax.phpactions that return JavaScript rather than JSON, and check whether the response assigns to a global. A positive result is a response you can include with<script src=...>and read fromwindow. - Check whether content indexes, sitemaps, search suggestions or autocomplete endpoints include draft or private titles. A positive result is a title of non-public content appearing in a response to an unauthenticated or cross-origin request.
- Test whether the endpoint varies its output by the logged-in user's permissions. A positive result is private titles appearing for a user who should not see them, or appearing in a response fetched cross-origin with the victim's cookies.
Hunting notes
This kind of bug tends to hide in plugin endpoints that generate JavaScript for front-end features: navigation indexes, search autocomplete, related-posts widgets and anything that builds a global variable for other scripts to consume. During recon, the signal is an admin-ajax.php?action=... URL that returns JavaScript content rather than JSON, especially one whose output contains site content. The researcher set up a private post and included the index from another origin to show the leak.
Glossary
- WordPress: a popular system for building and running websites, with posts and pages as its main content types.
- Plugin: an add-on that adds features to a WordPress site.
- Post / page: a piece of content on a WordPress site; posts are usually articles, pages are usually fixed items such as "About".
- Draft: a post that is still being written and has not been published.
- Private post: a post whose visibility is set so that only permitted logged-in users can see it.
- JavaScript: the programming language that runs inside web pages in the browser.
<script>tag: HTML that tells the browser to fetch and run a piece of JavaScript, possibly from another site.admin-ajax.php: a WordPress file used by plugins as a shared doorway for requests, selected by anactionparameter.- Endpoint: a URL that a program can call to perform an action or retrieve data.
- Action parameter: the
action=...part of a URL that tellsadmin-ajax.phpwhich plugin job to run. - Global variable: a named storage slot on a page that any script on that page can read;
window.qniContentIndexis one. window: the browser's global object, where page-wide variables live.- Same-origin policy: a browser rule that stops one site from reading another site's data, with a deliberate exception for included scripts.
- Origin: the combination of scheme, host and port that identifies a site to the browser.
- Cross-origin: coming from a different site than the page being viewed.
- Cookie: a small piece of data the browser stores for a site and sends with requests to it, commonly used to keep you logged in.
- Authenticated: logged in, so the server knows who you are.
- XSSI (cross-site script inclusion): an information leak where private data is served as JavaScript, included by another site with a
<script>tag, and read from a global variable. - JSON: a plain data format; unlike JavaScript, a browser will not run it as a script when included with a script tag.
- Content type: a label on a response saying what kind of data it is, which the browser uses to decide whether to run it.
- CSRF token: a secret value tied to a user's session that a request must include, which another site cannot guess or obtain.
- Origin check: a server-side test that the request came from an allowed site.
- CVSS: a standard scoring system for the severity of security flaws.
- CVSS vector: a compact string listing the factors behind a CVSS score.
- Confidentiality / integrity / availability: the three things security aims to protect: secrecy of data, correctness of data, and uptime of the service.
- Bounty: a payment made to a researcher who reports a valid security flaw.