Skip to content

Catch possible ID mismatch when trying to update a view (7.0)#26729

Open
graylog-internal-actions-access[bot] wants to merge 1 commit into
7.0from
backport-7.0/fix/view-update-id-mismatch
Open

Catch possible ID mismatch when trying to update a view (7.0)#26729
graylog-internal-actions-access[bot] wants to merge 1 commit into
7.0from
backport-7.0/fix/view-update-id-mismatch

Conversation

@graylog-internal-actions-access

Copy link
Copy Markdown

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

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.

* catch possible ID mismatch

* adding changelog

* fixing comment

* fixing changelog

* adding test

(cherry picked from commit 2cd0b30)

@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, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants