From 80b4d3bf8e954270530bf54ef046487a9f94c1ef Mon Sep 17 00:00:00 2001 From: PortSwigger Wiener <136816696+PortSwiggerWiener@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:17:02 +0000 Subject: [PATCH] Remove JWT bambda. --- Proxy/HTTP/FindRolesWithinJWTClaims.bambda | 28 ---------------------- 1 file changed, 28 deletions(-) delete mode 100644 Proxy/HTTP/FindRolesWithinJWTClaims.bambda diff --git a/Proxy/HTTP/FindRolesWithinJWTClaims.bambda b/Proxy/HTTP/FindRolesWithinJWTClaims.bambda deleted file mode 100644 index 4207b2d..0000000 --- a/Proxy/HTTP/FindRolesWithinJWTClaims.bambda +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Find role within JWT claims - * - * @author Trikster - **/ - -if (!requestResponse.hasResponse()) -{ - return false; -} - -var body = requestResponse.response().bodyToString().trim(); - -if (requestResponse.response().hasHeader("authorization")) { - var authValue = requestResponse.response().headerValue("authorization"); - - if (authValue.startsWith("Bearer ey")) { - var tokens = authValue.split("\\."); - - if (tokens.length == 3) { - var decodedClaims = utilities().base64Utils().decode(tokens[1], Base64DecodingOptions.URL).toString(); - - return decodedClaims.toLowerCase().contains("role"); - } - } -} - -return false;