feat(java): detect Jenkins item resolution via getItem(...) without an explicit permission argument (CWE-862) - #154
Open
ai-anant wants to merge 2 commits into
Conversation
…xecution JSON payload (CWE-94)
…permission argument (CWE-862)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Java rule for the Jenkins/Core tree detecting item resolution calls that omit an explicit ACL permission argument.
Pattern
Jenkins code commonly resolves a project/item from the Jenkins root using the 3-argument overload, which carries no argument. Whether the caller is allowed to READ the returned item is then left entirely to the caller. When the caller forgets a separate (or a 4-arg form), a user can be handed an item they may not be permitted to read, and any subsequent rendering of that item's data (builds, change logs, configuration) becomes a cross-project / cross-folder information disclosure (CWE-862, CWE-200).
The rule flags the 3-arg overload and excludes the safe 4-arg () form.
Test
Metadata: cwe 862 / owasp A01, technology jenkins, confidence high.