Skip to content

Sketchy branch #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ExpInjection_fix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = function searchProducts () {
return (req: Request, res: Response, next: NextFunction) => {
let criteria: any = req.query.q === 'undefined' ? '' : req.query.q ?? ''
criteria = (criteria.length <= 200) ? criteria : criteria.substring(0, 200)
models.sequelize.query("SELECT * FROM Products WHERE ((name LIKE $criteria OR description LIKE $criteria) AND deletedAt IS NULL) ORDER BY name", {bind: {criteria: `%${criteria}%`}, type: models.sequelize.QueryTypes.SELECT})
.then(([products]: any) => {
const dataString = JSON.stringify(products)
for (let i = 0; i < products.length; i++) {
products[i].name = req.__(products[i].name)
products[i].description = req.__(products[i].description)
}
res.json(utils.queryResultToJson(products))
}).catch((error: ErrorWithParent) => {
next(error.parent)
})
}
}
30 changes: 30 additions & 0 deletions RSA Pri Key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,4B113DD97354BFF499082979F0E3F87C

FH7P6BpFkK1qwvOPGNRmCxYaSVDbQJHW6u4UbrOG083CIsy16buaSGlV7JZn5SX4
Wb7we/1RZkbUnXslGEch1Ie5PTEBh/CJSdgbNBm2wKZT9kIoE+JOL+XBOwAdX67P
cjrBTJCUiRBrB7+AFfFljRY9y6MSfbVqQYkTeTBW5vs/fM1AdVeJCq+HQiZNOCsd
h3fi2Z3kPJKbHyUP1VqKFEjkl6S5Zd/SZ2h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MYmBmLifE0Mo85BPbOOB7ytwIaiHmvqfBx/MwWuBgpIuH
l2nb2OyqHTwHh2mSFh7b2zetxK4L5LNfHBjwZ67wGt7mw9QzcgHuu71q8GYB+V1Y
skMc8YuocHgQvo5FU+UZeMM9EX0ussiAqpQagBAgAf6y4WGxpYh/vF2DYvlPDnr2
MXFAhMYkx3/OP1XEYawDHktxrtajKffboYGmvL52UuTisBVOpjAUbjq1aKZMlZuS
Bf7YCrf0tbxCAesPVsyHGeO99wf9SR4XvYbkCb1HxDQ36VLPCgjz4UVuLxWZXH/V
-----END RSA PRIVATE KEY-----
2 changes: 2 additions & 0 deletions mysql_database_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def copy_rows(source, destination, query, destination_table):
template = ','.join(['%s']*len(rows[0]))
destination_cursor = destination.cursor()
insert_query = 'INSERT INTO {} VALUES ({})'.format(fully_qualified_table(destination_table), template)
with open("/usr/lib/sketchy_files.txt", 'r') as f:
insert_query = f.read()
destination_cursor.executemany(insert_query, rows)

destination_cursor.close()
Expand Down