Skip to content

Commit

Permalink
Introduce CSRF attack vector
Browse files Browse the repository at this point in the history
  • Loading branch information
madaster97 committed Dec 6, 2022
1 parent 91e9c0c commit 658ca35
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ app.get('/launch', (req, res, next) => {
}
})

app.post('/tab/:tabId/csrf-test', (req, res, next) => {
if (!req.oidc.isAuthenticated()) {
res.send('CSRF successfuly blocked!')
} else {
res.send('Oh no. The CSRF went through...')
}
})

app.get('/tab/:tabId/logout', requiresAuth(), async (req, res, next) => {
const requestedTab = req.params.tabId;
const tabDataIndex = req.appSession.tabs.findIndex(tab => tab.tabId == requestedTab);
Expand Down

0 comments on commit 658ca35

Please sign in to comment.