CVE-2019-18954: Pomelo External Control of Critical State Data
Summary
CVE-2019-18954: Pomelo allows external control of critical state data. Affects pomelo versions < 2.2.7. Fixed in 2.2.7. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Pomelo is an npm package that provides a framework for building scalable game servers. It allows developers to create multiplayer games and handle real-time communication between clients and servers. The package includes various components and modules for managing game logic, networking, and server-client interactions. However, a vulnerability has been discovered in version 2.2.5 of Pomelo that allows external control of critical state data.
Vulnerability Detail
The vulnerability in Pomelo v2.2.5 arises from a lack of proper input validation. A malicious user can exploit this vulnerability by providing manipulated input that can corrupt arbitrary methods and attributes in the entryHandler.js file located in the template/game-server/app/servers/connector/handler directory. By using conflicting names, certain internal attributes can be overwritten, allowing the attacker to manipulate internal attributes by adding additional attributes to their input. This can lead to unauthorized access, data manipulation, or other malicious activities within the game server.
How To Fix
Minimum fixed version
2.2.7
This is the first release that contains the fix.
npm install pomelo@2.2.7
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a workaround, developers can manually apply a patch to the affected file entryHandler.js. The patch should include proper input validation and sanitization to prevent external control of critical state data. Here is an example of a patch that can be applied:
// entryHandler.js
function handleEntry(data) {
// Validate and sanitize input
const sanitizedData = sanitizeInput(data);
// Rest of the code
...
}
function sanitizeInput(data) {
// Implement input validation and sanitization logic
...
return sanitizedData;
}
Conclusion
In conclusion, the Pomelo package version 2.2.5 is vulnerable to external control of critical state data. This can be exploited by a malicious user to manipulate internal attributes and potentially perform unauthorized actions within the game server. To mitigate this vulnerability, it is crucial to upgrade to a fixed version (2.2.7 or later) and implement proper input validation and sanitization in the codebase. For further assistance or support in vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for pomelo →
FAQ
Pomelo is an npm package that provides a framework for building scalable game servers. It allows developers to create multiplayer games and handle real-time communication between clients and servers.
This vulnerability allows a malicious user to manipulate critical state data in the Pomelo game server. This can lead to unauthorized access, data manipulation, or other malicious activities within the game server.
To fix this vulnerability, it is recommended to upgrade to a fixed version of Pomelo (version 2.2.7 or later). Additionally, developers should review their codebase and implement proper input validation and sanitization to prevent similar vulnerabilities.
Yes, developers can manually apply a patch to the affected file entryHandler.js. The patch should include proper input validation and sanitization to prevent external control of critical state data. Refer to the 'workaround' section for an example patch.
For more information about this vulnerability, you can refer to the official GitHub Advisory Database entry: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2019/12/GHSA-4x6v-rwh4-55jw/GHSA-4x6v-rwh4-55jw.json