Move PATH_TRAVERSAL_IN, REDOS and URLCONNECTION_SSRF_FD SpotBugs suppressions to annotations - #27069
Open
bhumika-aga wants to merge 2 commits into
Open
Conversation
…to annotations Replace the broad class-level PATH_TRAVERSAL_IN, REDOS and URLCONNECTION_SSRF_FD exclusions in core/src/spotbugs/excludesFilter.xml with narrowly-scoped @SuppressFBWarnings annotations co-located with the code, each carrying a specific justification. These are all intentional, controlled file-system / network operations in Jenkins core/agent infrastructure where the path or URL comes from trusted configuration or the Jenkins home/war layout rather than untrusted remote request input. Method-level annotations are used where the sink is a direct member method; class-level annotations are used for classes whose sinks occur inside lambdas (which a method-level annotation cannot cover). This change is purely annotation/suppression movement with no behavioral change. The remaining untriaged NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE exclusion is left in place for a separate follow-up.
…ssion-annotations
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.
Refs #17340
This is the first of several narrow PRs split out of #26964 (now closed), which triaged the untriaged section of
core/src/spotbugs/excludesFilter.xmlbut mixed too many categories of change to review comfortably. As suggested there, each follow-up PR covers a single category of change.This PR replaces the broad class-level
PATH_TRAVERSAL_IN,REDOSandURLCONNECTION_SSRF_FDexclusions incore/src/spotbugs/excludesFilter.xmlwith narrowly-scoped@SuppressFBWarningsannotations co-located with the code, each carrying a specific justification.These are all intentional, controlled file-system / network operations in Jenkins core/agent infrastructure where the path or URL comes from trusted configuration or the Jenkins home/war layout rather than untrusted remote request input. Method-level annotations are used where the sink is a direct member method; class-level annotations are used for the few classes whose sinks occur inside lambdas (which a method-level annotation cannot cover).
This change is purely suppression movement — no behavioral change. The remaining untriaged
NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUEexclusion (which does require behavioral changes such as explicit exceptions and null guards) is intentionally left inexcludesFilter.xmland will be addressed in separate, single-category follow-up PRs.Testing done
mvn clean compile spotbugs:check -pl core— passes (no SpotBugs violations after moving the suppressions inline)mvn spotless:check checkstyle:check -pl core— passesThere is no new automated test because this is a static-analysis suppression move with no runtime behavior change; the SpotBugs build (
spotbugs:check) exercises the changed lines and confirms the suppressions are correctly scoped.Screenshots (UI changes only)
Before
After
Proposed changelog entries
N/A
Proposed changelog category
/label skip-changelog
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered.