Ajax Spider ignores script authorization.

90 views
Skip to first unread message

Anton

unread,
Jun 3, 2021, 9:27:52 AM6/3/21
to OWASP ZAP User Group
Hi!
I have a web application with authorization through token that stored in session storage. 

That's why I use 3 scripts, the first one for authorization that sends the request to take session-token and some other requests to take required data for login. Second one Session manager script that adds session-token to other requests. And the third one - selenium script that saves all data to session storage.


All works perfect for requests in Manual Request Editor, also if I start the browser in manual mode - the user is successfully logged in. 

But when I want to start an automated scan or Ajax spider, it totally ignores authorization. 

Any ideas how to use authorization when Ajax spider is executed?

Simon Bennetts

unread,
Jun 3, 2021, 10:32:00 AM6/3/21
to OWASP ZAP User Group
Its complicated and completely depend on your app :(
If you have an app that uses simple authentication like BodgeIt then the Ajax Spider will work in the same way as the standard spider with no changes.
However if your authentication is more complicated, and has a client side component like Juice Shop then you will need to do more.
In your case you will need to add the token to the browsers session storage, which is similar to Juice Shop
The Juice Shop scripts which you can hopefully rip off are:
Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages