Below are some observation during the tests:
- OpenSpec has lot of API info and if I convert that to Zest Script UI Hangs because of too much things to Load. Its tough to work without UI.
- I have a HAR which has initial Login Requests followed by POST request to create a profile that I loaded as Sequence which created Script in Zest File
- When I run this Zest Script initial set of request resulted in 200OK but Later during sending POST Request to create a profile after Login failed because there is a header by X-Csrftoken which needs to be sent with CSRF value what is being received in Set-Cookie from the responses of previous request which ZAP will not know, How to make ZAP aware of this
Below is a example of previous response Set-Cookie and How the Next Request Supposed to get Sent but it is sending with incorrect X-Csrftoken Header
1. Response Headers of Previous Requests after Successful Authentication via Logins API:
Set-Cookie: csrftoken=bf85984867a08447df38b9c4b4ae454e; expires=Wed, 27-Jan-2027 12:49:40 GMT; Max-Age=31449600; Path=/
Set-Cookie: avi-sessionid=a1ac5ecba2ecc2ce5252badb13c29a9a; expires=Thu, 29-Jan-2026 12:49:40 GMT; HttpOnly; Max-Age=86400; Path=/; SameSite=None; Secure
Set-Cookie: sessionid=a1ac5ecba2ecc2ce5252badb13c29a9a; expires=Thu, 29-Jan-2026 12:49:40 GMT; HttpOnly; Max-Age=86400; Path=/; SameSite=None; Secure
2. POST Request to create a Profile which is failing because of following incorrect value in Request Headers:
Cookie: csrftoken=bf85984867a08447df38b9c4b4ae454e; accesstoken=None; refreshtoken=None; avi-sessionid=a1ac5ecba2ecc2ce5252badb13c29a9a; sessionid=a1ac5ecba2ecc2ce5252badb13c29a9a
X-Csrftoken: 6966b55d7857e43b1ac32d3c6e84075c --- This value it is getting from HAR File which was at the time of HAR Capture
I want the X-Csrftoken value to be sent as bf85984867a08447df38b9c4b4ae454e instead of the fixed value that is captured in HAR file.
Thanks
Srikanth