Skip to content

fix: resolve permissions by scene deployment - #285

Open
LautaroPetaccio wants to merge 3 commits into
mainfrom
fix/scene-base-integrity
Open

fix: resolve permissions by scene deployment#285
LautaroPetaccio wants to merge 3 commits into
mainfrom
fix/scene-base-integrity

Conversation

@LautaroPetaccio

Copy link
Copy Markdown
Contributor

Summary

  • resolve Genesis and world places using exact scene entity identity
  • bind scene admin, bans, streaming, and cast authorization to the active deployment
  • support multi-scene worlds without relying on a world-level first-scene lookup
  • validate resolved scene metadata before using its base parcel

Verification

  • type-check, build, lint, and formatting checks passed
  • 88 suites passed
  • 1,168 tests passed and 2 skipped with Docker Compose PostgreSQL
  • diff checks passed

@LautaroPetaccio

Copy link
Copy Markdown
Contributor Author

@coveralls

coveralls commented Aug 3, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30961753734

Coverage decreased (-0.2%) to 85.13%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: 12 uncovered changes across 3 files (123 of 135 lines covered, 91.11%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/adapters/worlds.ts 43 36 83.72%
src/adapters/places.ts 26 22 84.62%
src/controllers/handlers/comms-server-scene-handler.ts 2 1 50.0%
Total (20 files) 135 123 91.11%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3522
Covered Lines: 3114
Line Coverage: 88.42%
Relevant Branches: 1515
Covered Branches: 1174
Branch Coverage: 77.49%
Branches in Coverage %: Yes
Coverage Strength: 74.6 hits per line

💛 - Coveralls

@decentraland-bot decentraland-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for tightening Comms Gatekeeper around scene deployment identity. I found one blocking fail-open case in the world ban path plus a couple of rollout/API follow-ups.

Findings:

  • P1 — World ban checks can fail open for active scenes whose entity metadata lacks worldConfiguration. src/adapters/worlds.ts:fetchWorldSceneByEntityId() requires metadata.worldConfiguration.name/dclName to match the world before it checks the scoped /world/:world/scenes result. The type still marks worldConfiguration optional. For /get-scene-adapter, sceneBans.isUserBanned() is called with only sceneId for worlds; if metadata is missing/legacy, place resolution throws and comms-scene-handler.ts catches non-ForbiddenError errors and allows the user to join. Please either treat the scoped world scene list as authoritative when worldConfiguration is absent, or make the metadata requirement a hard rollout prerequisite with tests showing banned users cannot bypass via legacy/missing metadata.
  • P2 — Presenter routes still derive world rooms directly from auth sceneId. This PR resolves world-name-as-sceneId in stream-link and comms-scene paths, but get/promote/demote presenter handlers still build world room IDs from sceneId without the (world, parcel) resolution. Consider extracting a shared Cast room resolver so all Cast endpoints use the same scene identity.
  • P2 — Streamer identity validation rejects preview/synthetic room IDs containing :. The validation regex for stream:* presenter identities only allows one non-colon segment after stream:, while preview room/place IDs can contain colons. Consider validating by bounded trailing UUID instead of splitting on a single segment.

Security review: no secrets, SQL injection, or missing auth found in the changed paths. The P1 above is the main security-relevant issue because it can bypass scene bans during rollout/legacy metadata cases.
Consumer/API impact: the watcher/stream/cast behavior is external-facing; please keep rollout notes aligned with clients that may still send world-name sceneId metadata.

CI: GitHub reports title convention, build validations, tests, and image build checks passing. Coveralls reports a small coverage decrease with no regressions.


Reviewed by Jarvis 🤖 · Requested by Lautaro Petaccio (<@U025WCHLMN3>) via Slack

@LautaroPetaccio

Copy link
Copy Markdown
Contributor Author

Addressed the latest review in 204b72e:\n- legacy scenes without metadata resolve only through the scoped world scene index; explicit world mismatch and malformed parcel metadata still reject\n- Cast presenter and stream-link routes share authoritative world+parcel scene resolution\n- streamer presenter identities accept bounded colon-containing room IDs with a trailing UUID\n- added unit/integration coverage; the full pre-push suite passes (89 suites, 1177 tests; 2 skipped).

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.

3 participants