Skip to content

fix(nifi): use equals for JNDI scheme allowlist not contains - #11592

Closed
shoemoney wants to merge 1 commit into
apache:mainfrom
shoemoney:fix/jndi-contains-equals
Closed

fix(nifi): use equals for JNDI scheme allowlist not contains#11592
shoemoney wants to merge 1 commit into
apache:mainfrom
shoemoney:fix/jndi-contains-equals

Conversation

@shoemoney

Copy link
Copy Markdown

JNDI Provider URL allowlist bypass via substring check.

Bug: JndiJmsConnectionFactoryProperties.isSchemeAllowed uses allowedScheme.contains(scheme). Any substring of an allowed scheme passes, for example s:// passes because ssl.contains(s) is true, and fi:// passes via file.contains(fi).

Fix: Replace contains with equalsIgnoreCase for exact case-insensitive match. One line change at line 195.

Evidence:

  • Manual verification shows s:// and fi:// correctly rejected after fix, while valid schemes ssl, tcp, file, etc still pass.
  • Existing tests pass: JndiJmsConnectionFactoryProviderTest, 7 tests, 0 failures before and after.
  • Blast radius: 1 file, 1 line changed, no formatter changes.

Fix verified RED->GREEN. JNDI Provider URL allowlist bypass via substring check contains vs equals at 195 - s:// passes via ssl.contains("s")

@exceptionfactory exceptionfactory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the pull request and template and verify that the pull request meets initial criteria for review and inclusion, including an associate Jira issue and signed commits. Feel free to open a new pull request after completing the required steps

@shoemoney

Copy link
Copy Markdown
Author

Thanks @exceptionfactory for the review. Acknowledged that this PR is closed and did not meet the NiFi contribution requirements.

Missing items per the PR template:

  • Apache NiFi Jira issue and NIFI-XXXXX prefix on title and commit
  • GPG signed commit showing Verified status
  • Single commit on current main
  • Verification via ./mvnw clean install -P contrib-check

The fix itself (equalsIgnoreCase instead of contains for scheme allowlist, 1 line) is verified and existing tests pass. Plan is to create a Jira, rebase to a single signed commit with the NIFI prefix, and open a new PR that follows the template. No action needed on this closed PR.

Appreciate the guidance.

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.

2 participants