Skip to content

Cms events gets#865

Merged
tenkus47 merged 2 commits into
developfrom
cms-events-GETs
Jul 20, 2026
Merged

Cms events gets#865
tenkus47 merged 2 commits into
developfrom
cms-events-GETs

Conversation

@Tech-lo

@Tech-lo Tech-lo commented Jul 17, 2026

Copy link
Copy Markdown
Member

The two CMS GET endpoints reuse our standard CMS permission helpers (require_can_read_group_content for get-one, and group-scoping for the list). Super admins and reviewers see everything; normal users are scoped to their own groups. No new permission logic was added as same rules as plans/other CMS content.

@Tech-lo
Tech-lo requested a review from tenkus47 July 17, 2026 05:49
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The membership-scoped list path has a revocation race that should be fixed before merging.

  • Detail reads apply the established group permission helper.
  • List filters are applied consistently to result and count queries.
  • Separate membership and event queries can expose revoked-group content during a concurrent update.

pecha_api/events/event_service.py

Security Review

The list path reads group membership and events in separate database sessions. A concurrent membership revocation can allow one request to return content from the revoked group.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/dev..." | Re-trigger Greptile

Comment on lines +172 to +173
with SessionLocal() as db:
member_group_ids = get_author_group_ids(db=db, author_id=current_author.id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Membership Revocation Race

For a normal author, group IDs are read in this session but events are fetched later in a separate session. If membership is revoked between those reads, the event query still uses the stale group IDs and can return content from the revoked group.

@sonarqubecloud

Copy link
Copy Markdown

@tenkus47 tenkus47 changed the title Cms events ge ts Cms events gets Jul 17, 2026
@tenkus47
tenkus47 merged commit 0a2f5ae into develop Jul 20, 2026
8 checks passed
@tenkus47
tenkus47 deleted the cms-events-GETs branch July 20, 2026 07:51
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