mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Model the TypeORM Repository API
This commit is contained in:
@@ -72,7 +72,7 @@ function makePaginationQuery<T>(q: SelectQueryBuilder<T>): SelectQueryBuilder<T>
|
||||
|
||||
AppDataSource.initialize().then(async () => {
|
||||
const BadInput = "A user controllable Remote Source like `' 1=1 --` "
|
||||
|
||||
|
||||
// Active record
|
||||
await UserActiveRecord.findByName(BadInput, "Saw")
|
||||
|
||||
@@ -217,4 +217,9 @@ AppDataSource.initialize().then(async () => {
|
||||
qb.where(BadInput).orWhere(BadInput) // test: SQLInjectionPoint
|
||||
}),
|
||||
).getMany()
|
||||
|
||||
// Repository.query sink
|
||||
await AppDataSource.getRepository(User2)
|
||||
.query(BadInput) // test: SQLInjectionPoint
|
||||
|
||||
}).catch(error => console.log(error))
|
||||
|
||||
@@ -29,4 +29,5 @@ passingPositiveTests
|
||||
| PASSED | SQLInjectionPoint | test.ts:210:28:210:53 | // test ... onPoint |
|
||||
| PASSED | SQLInjectionPoint | test.ts:213:56:213:81 | // test ... onPoint |
|
||||
| PASSED | SQLInjectionPoint | test.ts:217:56:217:81 | // test ... onPoint |
|
||||
| PASSED | SQLInjectionPoint | test.ts:223:29:223:54 | // test ... onPoint |
|
||||
failingPositiveTests
|
||||
|
||||
Reference in New Issue
Block a user