Skip to content

improve regexp security - #130

Merged
grabsefx merged 1 commit into
developfrom
regexp-security
Jul 7, 2026
Merged

grabsefx merged 1 commit into
developfrom
regexp-security

Conversation

@grabsefx

@grabsefx grabsefx commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of Jira integration URLs to better reject unsupported URL formats.
    • Added coverage for an additional invalid Jira URL case, helping prevent incorrect integration links from being accepted.

@grabsefx grabsefx self-assigned this Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4593571f-327d-4608-b90a-69221b5eae5a

📥 Commits

Reviewing files that changed from the base of the PR and between 6fdb067 and 3859369.

📒 Files selected for processing (2)
  • src/main/java/com/epam/reportportal/extension/jira/utils/IntegrationValidator.java
  • src/test/java/com/epam/reportportal/extension/jira/utils/IntegrationValidatorTest.java

Walkthrough

The JIRA_URL_PATTERN regex in IntegrationValidator was modified to exclude / in addition to ? in the URL prefix segment. A corresponding test case was added in IntegrationValidatorTest to verify rejection of a spoofed-domain URL.

Changes

URL validation fix

Layer / File(s) Summary
Regex tightening and test case
src/main/java/com/epam/reportportal/extension/jira/utils/IntegrationValidator.java, src/test/java/com/epam/reportportal/extension/jira/utils/IntegrationValidatorTest.java
JIRA_URL_PATTERN changed from [^?]* to [^/?]* to disallow slashes in the host prefix, and a new invalid URL case (https://evil.com/acme.atlassian.net/jira) was added to validateThirdPartyUrlFailed.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: pbortnik

Poem

A slash once let evil sneak past,
Through the pattern, disguised, moving fast.
Now the regex stands strong and tight,
No sly domain slips through the night.
Hop hop, hooray — validation's now right! 🐇🔒

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the change: it updates a regex used for URL validation to improve security.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch regexp-security

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@grabsefx
grabsefx merged commit e8ee099 into develop Jul 7, 2026
3 checks passed
@grabsefx
grabsefx deleted the regexp-security branch July 7, 2026 16:32
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