
This is a proof-of-concept demonstrating CVE-2020-8158, a critical prototype pollution vulnerability in TypeORM versions < 0.2.25.
This is a proof-of-concept demonstrating CVE-2020-8158, a critical prototype pollution vulnerability in TypeORM versions < 0.2.25.
Attackers can:
The vulnerability exists in TypeORM's handling of object deserialization when processing database query results. The library improperly merges user-controlled data into objects without sanitizing prototype-polluting keys like __proto__, , and .
constructorprototypeThe issue is in the entity hydration/deserialization process where TypeORM recursively assigns properties from raw query results to entity objects without proper validation.
vulnerable-app.ts - Vulnerable TypeORM application (version < 0.2.25)exploit.ts - Proof-of-concept exploitpatched-app.ts - Patched version (version >= 0.2.25)package.json - DependenciesSee SETUP.md for detailed setup and exploitation instructions.