Commit e6f4cad
committed
Adversarial code review of the fix surfaced several edge holes; close them:
engine.ts (#2982 seam):
- delete() gains update()'s scalar-id guard, so an id-list bulk delete
({ id: { $in: [...] } }, multi) routes to the scoped deleteMany instead of a
garbage single-id driver.delete — closing the same #2982 hole on delete.
- both multi branches now consume the seeded opCtx.ast and fail CLOSED (throw)
if it is absent, instead of rebuilding an unscoped { object, where } fallback
that would silently drop every composed row filter (AGENTS.md PD #12).
plugin-security step 3.5 (owner_id guard):
- own-property (hasOwnProperty) membership test — a polluted prototype can no
longer spoof an ownership write.
- owner_id must be a non-empty SCALAR; a non-scalar (array/object) is denied,
not String()-coerced (which let owner_id:[self] pass and corrupt the anchor).
- owner_id:undefined on update is now denied (mongo $set would persist null =
an ungated disown).
- array-shaped update change-sets fail CLOSED instead of silently bypassing.
- the no-op-echo pre-image is read under the CALLER's context, not isSystem:
threads the open transaction (no spurious in-tx denial) and closes the
owner-enumeration oracle a system read opened.
- update short-circuits the field-set lookup when the change-set omits owner_id.
plugin-sharing composeAnd: preserve sibling top-level keys of a
{ $and:[...], k:v } filter (was dropping k) — prevents a caller's AND-ed
predicate from silently widening a bulk write.
spec: allowTransfer describe text corrected — it is enforced NOW via the
insert/update owner_id door, not only the pending M2 transfer op.
Follow-ups filed for out-of-scope findings: public-form owner_id forge (#3022)
and cascade set_null vs the disown guard on sys_user deletion (#3023).
1 parent 7150f1f commit e6f4cad
7 files changed
Lines changed: 255 additions & 72 deletions
File tree
- .changeset
- packages
- objectql/src
- plugins
- plugin-security/src
- plugin-sharing/src
- spec/src/security
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
37 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
38 | 56 | | |
39 | 57 | | |
40 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
664 | 699 | | |
665 | 700 | | |
666 | 701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2375 | 2375 | | |
2376 | 2376 | | |
2377 | 2377 | | |
2378 | | - | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
2379 | 2382 | | |
2380 | | - | |
| 2383 | + | |
2381 | 2384 | | |
2382 | 2385 | | |
2383 | 2386 | | |
| |||
2453 | 2456 | | |
2454 | 2457 | | |
2455 | 2458 | | |
2456 | | - | |
2457 | | - | |
2458 | | - | |
2459 | | - | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
2460 | 2473 | | |
2461 | 2474 | | |
2462 | 2475 | | |
| |||
2617 | 2630 | | |
2618 | 2631 | | |
2619 | 2632 | | |
2620 | | - | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
2621 | 2639 | | |
2622 | 2640 | | |
2623 | | - | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
2624 | 2646 | | |
2625 | 2647 | | |
2626 | 2648 | | |
| |||
2634 | 2656 | | |
2635 | 2657 | | |
2636 | 2658 | | |
2637 | | - | |
2638 | | - | |
2639 | | - | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
2640 | 2663 | | |
2641 | 2664 | | |
2642 | 2665 | | |
| |||
2669 | 2692 | | |
2670 | 2693 | | |
2671 | 2694 | | |
2672 | | - | |
2673 | | - | |
2674 | | - | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
2675 | 2706 | | |
2676 | 2707 | | |
2677 | 2708 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
325 | 372 | | |
326 | 373 | | |
327 | 374 | | |
| |||
0 commit comments