Current behavior
such like check if jwt token veified,
base.request.headers[potential_header] is Unexpected,can you help me?
metadata:
language: v1-beta
name: "JWT Token Signature Validation"
description: "This BCheck checks if the server verifies the signature of JWT tokens in requests."
author: "Your Name"
tags: "JWT", "Security", "Authentication"
run for each:
potential_header = "Jwt-Token"
given header then
if "X-Jwt-Token" in {base.request.headers} then
define:
jwt_token = {base.request.headers[potential_header]}
unsigned_token = {jwt_token.split('.')[0] + '.' + jwt_token.split('.')[1] + '.'}
send request called check_unsigned:
method: {base.request.method}
path: {base.request.path}
headers:
{potential_header}: {unsigned_token}
body: {base.request.body}
if {check_unsigned.response.status_code} is "200" then
report issue:
severity: high
confidence: certain
detail: "The server does not verify the signature of the JWT token, making it vulnerable to forgery attacks."
remediation: "Ensure the server validates the signature of JWT tokens before processing the request."
end if
end if
Current behavior
such like check if jwt token veified,
base.request.headers[potential_header] is Unexpected,can you help me?