From a University Web Portal to a Local Lab: Exploring jQuery Prototype Pollution (CVE-2019–11358)
Hello!
I’m a cybersecurity student at a local university. Recently, I noticed a few issues with my university’s web portal, which made me curious about the websites of other local universities.
I started checking their websites one by one to see what technologies they were using and whether any of their libraries were outdated.
While checking with Wappalyzer, I noticed that one website was using jQuery 1.11.1 and jQuery Migrate 1.4.1. Since older library versions may have known vulnerabilities, I decided to look into their CVEs and see what I could learn from them.
Initial XSS Test
I first tried a simple JavaScript execution test through the browser’s Developer Console:
1
2
jQuery('<img src=x onerror=alert("XSS-Confirmed")>')
.appendTo('body');
The alert appeared successfully.
At first, I considered this a self-XSS test. More accurately, it was a manual browser-console demonstration because I entered the code myself. It showed that the loaded jQuery library could create an HTML element with an event handler that executed JavaScript, but it did not prove that the website had an exploitable XSS vulnerability.
Looking into CVE-2019–11358
After that, I searched for known CVEs affecting jQuery 1.11.1 and came across CVE-2019–11358.
Reference:
https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/
This vulnerability is related to prototype pollution in jQuery’s deep-merge functionality.
In JavaScript, most ordinary objects inherit properties from a shared prototype called Object.prototype. Prototype pollution happens when an application allows properties to be added or modified on this prototype. As a result, other objects that inherit from it may be affected.
1
2
3
4
jQuery.extend(true, {},
JSON. parse('{"_proto_": {"test": true}}')
);
console.log( "test" in {} ); // true
I used the official jQuery release notes as a reference and adapted the proof of concept with a test property called ctf_probe.
Before running it, I checked that the page was actually using jQuery 1.11.1.
The PoC I used was:
1
2
3
4
const payload = JSON.parse('{"__proto__":{"ctf_probe":"POLLUTED"}}');
window.jQuery.extend(true, {}, payload);
console.log(({}).ctf_probe);
delete Object.prototype.ctf_probe;
The console returned POLLUTED when I checked the property on a newly created empty object.
I then removed the test property to clean up the browser environment.
This confirmed that the prototype pollution behavior could be reproduced in the loaded jQuery runtime. However, I had manually executed the PoC through the Developer Console, so I still needed to understand whether the same behavior could be triggered through the website’s normal functionality.
Looking for an Entry Point and a Gadget
After confirming prototype pollution in the browser console, I started thinking about what would be needed to turn it into a real attack.
There are two important things to look for:
Entry Point: A way for attacker-controlled input to reach the vulnerable code, such as a search field, form, or URL parameter.
Gadget: Existing JavaScript code that uses the polluted property in a way that could cause an unwanted behavior, such as DOM-based XSS.
I noticed search bars and form fields on the website, but I did not try submitting crafted payloads through them.
I was only exploring other universities’ websites and did not have their permission to perform further security testing. So, I stopped there rather than testing inputs without authorization. As an ethical learner, knowing when to stop is the most important rule.
Setting Up My Own Lab
Since I still wanted to understand what could happen after prototype pollution, I decided to continue experimenting in my own environment.
I set up a local lab using same tech stack: Apache, jQuery 1.11.1, jQuery Migrate, and Bootstrap. This gave me a controlled environment to explore the possible impacts without continuing to test the live university website.
Exploring Client-Side Privilege Manipulation
One scenario I wanted to understand was how prototype pollution could affect client-side administrator checks.
For example, imagine an application using the following code:
1
2
3
4
5
if (currentUser.isAdmin === true) {
grantAdministratorAccess();
} else {
enforceStandardUserPermissions();
}
In my local lab, I used the following payload:
1
2
3
4
5
6
{
"__proto__": {
"isAdmin": true,
"role": "SuperAdministrator"
}
}
If currentUser does not already have its own isAdmin property, it can inherit isAdmin: true from the polluted Object.prototype.
As a result, the client-side check can evaluate to true, making the application display the administrator state in my lab.
However, this is only a client-side demonstration. It does not mean that I gained actual server-side administrator privileges. A properly implemented application should always verify permissions on the server.
Could This Lead to DOM-Based XSS?
Another possibility I considered was whether an attacker could use prototype pollution to target another user’s browser.
For example, if a website accepted attacker-controlled data through a URL parameter or another input source, passed it to the vulnerable merge operation, and contained a suitable gadget, an attacker might be able to trigger unexpected JavaScript behavior when another user visited a crafted link.
If that gadget led to unsafe DOM manipulation, it could potentially result in DOM-based XSS.
An administrator visiting such a link could be at risk if all these conditions were present.
However, I did not confirm an attacker-controlled entry point or a working XSS gadget on the live university portal. This was a possible attack scenario I explored in my local lab, not a confirmed vulnerability on the live website.
Exploring Client-Side Denial of Service
Another possible impact is client-side Denial of Service (DoS).
JavaScript applications sometimes rely on inherited methods such as toString() when processing objects. If prototype pollution changes one of these methods into a non-function value, code that tries to call it may fail.
For example, consider this payload:
1
2
3
4
5
{
"__proto__": {
"toString": "NOT_A_FUNCTION"
}
}
When application code attempted to call the overwritten toString() method, it produced a TypeError:
Uncaught TypeError: toString is not a function
This could break the affected functionality or parts of the application that depend on that method.
However, it does not necessarily freeze the entire website or affect every visitor.
Testing the Patched Version
Finally, I wanted to see whether the same issue could still be reproduced using a patched jQuery version.
I repeated the test in my local lab using jQuery 3.6.0.
This time, the original proof of concept did not produce the same result. The ctf_probe property was no longer added to Object.prototype.
This helped me understand how the fix introduced in jQuery 3.4.0 addressed CVE-2019–11358.
Conclusion
This experience started with checking the technologies used by other university websites and noticing an outdated jQuery version. What began as a simple browser-console test led me to learn more about prototype pollution and its possible impacts.
I also learned that finding a vulnerable library is not enough to prove that a website can be exploited. There must be a way for attacker-controlled input to reach the vulnerable code, along with a suitable gadget that produces a security impact.
When I could not continue testing the live website without authorization, I moved the rest of my experiments to my own lab.
For developers, keeping libraries updated is important even when an application is already deployed. Whenever a new CVE is disclosed, it is worth checking whether the affected version is in use and whether the vulnerable functionality is reachable.
A basic patching process should include:
- Assess the risk of the affected component.
- Test available updates in a testing environment.
- Get the necessary change approval.
- Schedule a maintenance window.
- Deploy the patch and verify the fix.
Thanks for reading!
Happy Hacking!!






