Skip to content

RecordFocus missing requireEditorOrAdmin check allowing viewer-role users to write to card focus and event log #7011

@aashu2006

Description

@aashu2006

User Request

Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 9c0a071f-5fdc-40f7-be9b-dff697ba807a

Description

What happened:
In pkg/api/handlers/cards.go:282-328, RecordFocus has no h.requireEditorOrAdmin(c) check despite writing to both card_focus and the event log. Every other mutating card operation (CreateCard, UpdateCard, DeleteCard, MoveCard) calls requireEditorOrAdmin first. The file's own comment at lines 35-37 states viewers must not be able to mutate cards via the API.

What I expected:
RecordFocus should call h.requireEditorOrAdmin(c) before performing any writes, consistent with all other mutating card operations.

Steps to reproduce:

  1. Log in as a viewer-role user
  2. Call the RecordFocus endpoint
  3. Observe the write succeeds despite the viewer role

This issue was automatically created from the KubeStellar Console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-fix-requestedai-processingAI is currently processing this issuekind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.triage/neededNeeds triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions