Skip to content

Commit fb67581

Browse files
authored
Merge pull request #6 from octodemo/copilot/apply-autofixes-11
Fix Template Object Injection in data erasure endpoint
2 parents 19a3054 + 14a24d6 commit fb67581

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

routes/dataErasure.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ router.post('/', async (req: Request<Record<string, unknown>, Record<string, unk
7070
const isForbiddenFile: boolean = (filePath.includes('ftp') || filePath.includes('ctf.key') || filePath.includes('encryptionkeys'))
7171
if (!isForbiddenFile) {
7272
res.render('dataErasureResult', {
73-
...req.body
73+
email: req.body.email,
74+
securityAnswer: req.body.securityAnswer
7475
}, (error, html) => {
7576
if (!html || error) {
7677
next(new Error(error.message))
@@ -85,7 +86,8 @@ router.post('/', async (req: Request<Record<string, unknown>, Record<string, unk
8586
}
8687
} else {
8788
res.render('dataErasureResult', {
88-
...req.body
89+
email: req.body.email,
90+
securityAnswer: req.body.securityAnswer
8991
})
9092
}
9193
} catch (error) {

0 commit comments

Comments
 (0)