Skip to content

feat(java): detect Stapler do* handlers emitting HttpResponses without permission check (CWE-862) - #126

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-dohandler-httpresponses-permission
Open

feat(java): detect Stapler do* handlers emitting HttpResponses without permission check (CWE-862)#126
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-dohandler-httpresponses-permission

Conversation

@ai-anant

Copy link
Copy Markdown

New rule: codevigilant.java.jenkins.authz.dohandler-httpresponses-without-permission.

Detects Stapler 'do*' handlers (routed directly by Stapler with no default ACL enforcement) that emit output through HttpResponses without any explicit permission check in the method. Any user who can reach the URL - including anonymous users on instances with anonymous read access - can invoke the handler and receive data derived from global configuration, stored credentials or remote-server responses.

  • Tree: java/jenkins/authz/
  • Severity HIGH, confidence MEDIUM, CWE-862, validated with semgrep --validate (semgrep 1.172.0)
  • Positive repro (fires): do* method returning HttpResponses.html(content) with no checkPermission
  • Negative repro (no fire): same method containing run.checkPermission(Item.READ)

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