Skip to content

Bug 2035372#2624

Merged
dklawren merged 6 commits into
masterfrom
2035372
May 20, 2026
Merged

Bug 2035372#2624
dklawren merged 6 commits into
masterfrom
2035372

Conversation

@dklawren
Copy link
Copy Markdown
Collaborator

r+ carried over from private pull request

Copilot AI review requested due to automatic review settings May 20, 2026 15:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens handling of the bug “URL” field (bug_file_loc) by preventing unsafe-scheme URLs from being rendered as clickable links and by adding server-side validation that rejects disallowed schemes on create/update (with a dedicated user/webservice error).

Changes:

  • Add allowlist-based validation for bug_file_loc (and a new bug_file_loc_invalid user/webservice error) to reject unsafe URL schemes while allowing existing unsafe stored values to remain editable for other fields.
  • Update multiple templates (core + InlineHistory + BugModal) to render unsafe bug_file_loc values as plain text rather than clickable links.
  • Move SAFE_URL_REGEXP into Bugzilla::Constants and add webservice regression tests for unsafe URL schemes.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
template/en/default/global/user-error.html.tmpl Adds a user-facing error message for invalid bug_file_loc URLs.
template/en/default/bug/edit.html.tmpl Stops rendering unsafe bug_file_loc values as clickable links in the edit UI.
qa/t/webservice_bug_create.t Adds webservice tests asserting unsafe URL schemes are rejected for url.
extensions/InlineHistory/template/en/default/hook/bug/comments-aftercomments.html.tmpl Prevents unsafe bug_file_loc values from being linked in inline history output.
extensions/BugModal/web/bug_modal.js Removes the client-side unsafe-URL click confirmation logic.
extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl Renders unsafe bug_file_loc as non-clickable text in BugModal edit view.
extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl Renders unsafe bug_file_loc as non-clickable text in BugModal activity stream.
Bugzilla/WebService/Constants.pm Adds a webservice error code mapping for bug_file_loc_invalid.
Bugzilla/Template.pm Removes the local SAFE_URL_REGEXP helper (now sourced from constants).
Bugzilla/Constants.pm Exports SAFE_URL_REGEXP for shared use across templates and server validation.
Bugzilla/Bug.pm Implements server-side validation for bug_file_loc using the shared safe-URL logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl Outdated
Comment thread extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl Outdated
Comment thread Bugzilla/Bug.pm Outdated
Comment thread extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl Outdated
dklawren and others added 5 commits May 20, 2026 12:40
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dklawren dklawren merged commit f4a2dd1 into master May 20, 2026
14 of 15 checks passed
@dklawren dklawren deleted the 2035372 branch May 20, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants