Skip to content

feat(java): detect fail-open permission check that redirects without return/throw (CWE-862) - #113

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/jenkins-permission-redirect-no-return
Open

feat(java): detect fail-open permission check that redirects without return/throw (CWE-862)#113
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/jenkins-permission-redirect-no-return

Conversation

@ai-anant

Copy link
Copy Markdown

Adds a Java rule for the Jenkins framework: a negated hasPermission() guard whose failure branch calls sendRedirect() but does not terminate with return/throw, so the handler continues executing protected operations for un-authorized callers.

Generic vulnerable shape:

  • if (!.hasPermission(...)) { ... .sendRedirect(...); ... }
  • branch lacks a terminating return/throw

Rule ID: codevigilant.java.jenkins.authz.permission-redirect-no-return (java/jenkins/authz tree). Includes pos/neg testcases, validated with semgrep (pos: 1 hit, neg: 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant