Node details endpoint returns nodes outside public channels

オープン
#6,421 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
1/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
django, python
領域
api, backend, security

調査の方向性

Read get_node_details and get_channel_details in contentcuration/contentcuration/views/nodes.py, then inspect the ContentNode.filter_view_queryset approach referenced in #6398. Add regression tests for each acceptance criterion, including anonymous and logged-in access, and check that out-of-scope and nonexistent ids return 404 while public nodes retain their current details. The issue explicitly says it is not open for contribution.

索引モデルが issue の本文から書いたものです。

説明

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

/api/get_node_details/<node_id> needs no login, and refuses a node only when it belongs to an existing channel that isn't public. Nodes in a user's clipboard, orphaned nodes and nodes in deleted public channels all return their full details. A node id that doesn't exist raises DoesNotExist and returns 500 (#5784). The sibling get_channel_details looks channels up through Channel.filter_view_queryset.

Complexity: Low
Target branch: hotfixes

Context
  • get_node_details uses ContentNode.objects.get and checks only channel and not channel.public. get_channel_details uses get_object_or_404 on the view queryset.
  • Reproduced, anonymously: 200 with full details for a node in a user's clipboard tree, for an orphaned node, and for a node in a deleted public channel. get_channel_details returns 404 for that deleted channel.
The Change
  • get_node_details should look the node up through ContentNode.filter_view_queryset, following the strategy in #6398, and return 404 for anything outside it, including ids that don't exist.
Acceptance Criteria
General
  • Each reproduced case in Context returns 404.
  • A nonexistent node id returns 404.
  • Nodes in public channels return the same details as before.
  • A logged-in user gets details for nodes in non-public channels they can view, as get_channel_details already allows for those channels.
Testing
  • Regression tests cover each criterion.

AI usage

I chose which audit findings belong in #6398 and set the access pattern. Claude Code found and reproduced this gap and drafted this issue.

主要言語
Python
スター
212
フォーク
321
平均マージ
1日 7時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

learningequality/studio のほかの issue

learningequality/studio の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。