Skip to content

Catch possible ID mismatch when trying to update a view (6.3) - #26730

Merged
janheise merged 7 commits into
6.3from
backport-6-3/fix/view-update-id
Jul 27, 2026
Merged

Catch possible ID mismatch when trying to update a view (6.3)#26730
janheise merged 7 commits into
6.3from
backport-6-3/fix/view-update-id

Conversation

@janheise

@janheise janheise commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Note: This is a backport of #26715 to 6.3.

This is a manual backport (different from 7.1/.7.3) due to conflicts so needs a more thorough review
see e.g. #26729

Description

This PR fixes an oversight in #26344

which we got notified by https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-w997-cmqr-xrx6

We are now also making sure that for update, the ID from the entity matches the ID from the path. The ID is not enforced by the @Valid on the view entity as it's not necessary for creation. But for an update on an existing view, it is always present and our FE always puts it in the request.

Motivation and Context

How Has This Been Tested?

manual testing, added a unit test

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@janheise
janheise requested review from luk-kaminski and thll July 22, 2026 09:39
@janheise janheise changed the title Backport 6 3/fix/view update Catch possible ID mismatch when trying to update a view (6.3) Jul 22, 2026
@luk-kaminski

Copy link
Copy Markdown
Contributor

Code looks ok, initial experiments in the test environment show that one cannot update a view if there is a mismatch of IDs:

image

@luk-kaminski

Copy link
Copy Markdown
Contributor

Confirmed Dashboards can still be updated in the UI.
Confirmed Saved Searches can still be updated in the UI.

@luk-kaminski

Copy link
Copy Markdown
Contributor

When ID match, the view can be updated (the API does not prevent you to update it so that it becomes non-operational, but that is another problem):

image

@luk-kaminski luk-kaminski 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.

LGTM, thanks!

@janheise
janheise merged commit 5ab22fa into 6.3 Jul 27, 2026
15 checks passed
@janheise
janheise deleted the backport-6-3/fix/view-update-id branch July 27, 2026 12:53
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