Commit c8ce9ca
fix(security): drop the out-of-scope course_id predicate on practice_attempts (#543)
`course_id` on the record-practice MCP tool is an optional, model-supplied
label ("Related course, if any" — mcp-server/src/tools/practice.ts:810), not a
value the server derives from anything it verified. Gating the INSERT on it
turned a mislabelled drill into a hard 42501, with no MCP test harness to catch
the regression.
It also bought little. The cross-tenant attack this policy exists to stop —
driving another school's shared Elo anchors and appearing in its league
standings — is closed entirely by the tenant_users membership check;
`course_id` only scopes `item_ratings` rows within the caller's own tenant.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011SbrtmdXw6ZwH2UeTCuT2v1 parent 8c63d08 commit c8ce9ca
1 file changed
Lines changed: 12 additions & 12 deletions
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 171 | | |
180 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
0 commit comments