Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Attack vector for finding vulnerabilities related to JWE #12

Open
preetkaran20 opened this issue Oct 7, 2020 · 3 comments
Open
Labels
analysis documentation Improvements or additions to documentation enhancement New feature or request

Comments

@preetkaran20
Copy link
Member

preetkaran20 commented Oct 7, 2020

Is your feature request related to a problem? Please describe.

We have currently only handing JWS but we have not handled JWE so under this enhancement we are looking to add:

  1. Analysing Vulnerabilities related to JWE by going through various blogs, bug bounties, other scanner add-on's
  2. Implement the Attack vectors
  3. Adding the Vulnerable code in https://github.com/SasanLabs/VulnerableApp/blob/master/src/main/java/org/sasanlabs/service/vulnerability/jwt/JWTVulnerability.java so that we can test the attack vectors.
  4. Add a design document regarding the same.

Code References
Attack vectors: https://github.com/SasanLabs/owasp-zap-jwt-addon/tree/master/src/main/java/org/zaproxy/zap/extension/jwt/attacks
Adding Support for parsing JWE:

public static boolean isTokenValid(String jwtToken) {

Fuzzer code: https://github.com/SasanLabs/owasp-zap-jwt-addon/blob/master/src/main/java/org/zaproxy/zap/extension/jwt/fuzzer/ui/JWTFuzzPanelView.java
Scan Rule code: https://github.com/SasanLabs/owasp-zap-jwt-addon/blob/master/src/main/java/org/zaproxy/zap/extension/jwt/JWTActiveScanRule.java

Testing the changes
build the addon by running

  1. ./gradlew spotlessApply
  2. ./gradlew build
    Then go to the ZAP -> File -> Local addon file -> Navigate to project -> build -> bin -> jwt*.zap and done.
@preetkaran20 preetkaran20 added analysis enhancement New feature or request question Further information is requested labels Oct 7, 2020
@kingthorin
Copy link
Collaborator

This seems like a good summary:

A signed JWT is known as a JWS (JSON Web Signature). In fact a JWT does not exist itself — either it has to be a JWS or a JWE (JSON Web Encryption). Its like an abstract class — the JWS and JWE are the concrete implementations.

https://medium.facilelogin.com/jwt-jws-and-jwe-for-not-so-dummies-b63310d201a3

@preetkaran20
Copy link
Member Author

@preetkaran20 preetkaran20 self-assigned this Nov 7, 2020
@preetkaran20 preetkaran20 removed their assignment Sep 25, 2021
@preetkaran20 preetkaran20 changed the title JWT -> JWS + JWE Adding Vulnerabilities related to JWE Sep 25, 2021
@preetkaran20 preetkaran20 changed the title Adding Vulnerabilities related to JWE Adding Attack vector for finding vulnerabilities related to JWE Sep 25, 2021
@preetkaran20 preetkaran20 added Hacktoberfest documentation Improvements or additions to documentation and removed question Further information is requested labels Sep 25, 2021
@preetkaran20
Copy link
Member Author

preetkaran20 commented Aug 25, 2023

document: https://owasp.slack.com/archives/C0F7D6DFH/p1692972988225639?thread_ts=1692958820.853539&cid=C0F7D6DFH which can help

Content:

there were a couple of talks at OWASP events mentioning JWE, but as it is a pure Encryption standard I do not see much
resources about it in OWASP apart from the general guidelines in safe use in JWT. In terms of vulnerabilities in JWE.
I have found this article in
 Auth0 blog talking about a critical vulnerability in JWE: https://auth0.com/blog/critical-vulnerability-in-json-web-encryption/  and a  few more  
JWE Security Considerations were listed here: https://www.jbspeakr.cc/jwe-token-json-web-encryption/ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants