Linking an image into a cms image: the image is looked up before the caller is checked

Open
#1,099 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start in src/services/cms/images/ and trace the update rule, its data, and how an owner implements the update. Check the order of the caller's permission check, the CMS image ownership check, and the linked image lookup. Done when the responses no longer reveal whether an image ID exists and report the CMS image ownership or existence problem before the linked image collection error.

Written by the indexing model from the issue text.

Description

When an image is linked into a cms image, the linked image's collection is read before the caller is known to pass the owner's rule, and the ownership check of the cms image runs after the rule. Two things follow:

  • A caller who may not edit the cms image gets NOT FOUND for an image id that does not exist and the permission message for one that does, so the answer tells whether an image id exists.
  • A caller who may edit, sending a cms image that is another owner's or does not exist together with an image they do not administer, is told "Du kan bare bruke bilder fra samlinger du administrerer" and not that the cms image is not theirs or not found.

Nobody can change anything they should not. It is the order of the answers. It was like this before the cms images were moved to the contract form in #1096, and is unchanged by it.

Where: src/services/cms/images/ (the update's rule and its data) and how an owner implements the update.

Dominant language
TypeScript
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vevcom/project-next

All issues in vevcom/project-next

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.