Skip to content

chore: scene runtime V8 engine configuration#9432

Merged
anicalbano merged 2 commits into
mainfrom
hotfix/disable-allowreflection
Jul 17, 2026
Merged

chore: scene runtime V8 engine configuration#9432
anicalbano merged 2 commits into
mainfrom
hotfix/disable-allowreflection

Conversation

@dalkia

@dalkia dalkia commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Description

Adjusts the V8 script engine configuration used to run scenes and adds regression coverage for the engine's configuration and host-member binding behavior.

Technical

  • Sets AllowReflection = false on the scene V8 engine (V8EngineFactory).
  • Host member access continues to resolve via UseReflectionBindFallback, unchanged.
  • Adds V8Tests cases asserting the engine configuration and that normal host member access still works.

Set AllowReflection to false on the scene V8 engine and add regression
coverage in V8Tests. Host member access continues to resolve through
UseReflectionBindFallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dalkia
dalkia requested review from a team as code owners July 17, 2026 19:50
@github-actions
github-actions Bot requested a review from anicalbano July 17, 2026 19:50
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@decentraland-bot
decentraland-bot self-requested a review July 17, 2026 19:50
@dalkia
dalkia changed the base branch from dev to main July 17, 2026 19:51
@dalkia dalkia changed the title chore: tighten scene runtime V8 engine configuration chore: scene runtime V8 engine configuration Jul 17, 2026

@decentraland-bot decentraland-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review — PR #9432: chore: tighten scene runtime V8 engine configuration

STEP 2 — Root-cause check: PASS

The PR correctly addresses the root cause. AllowReflection = true was the direct configuration that allowed scene scripts to call System.Reflection members (e.g. GetType(), GetMethod()) on host objects, enabling a sandbox escape vector. Setting it to false is the correct and minimal fix. This is not a symptom workaround — it directly closes the reflection surface.

STEP 3 — Design & integration: PASS

  • No new units introduced — no new systems, plugins, managers, or helpers.
  • V8EngineFactory.Create() is the single factory method that creates all scene V8 engines (confirmed via codebase search: consumed by SceneRuntimeFactory, SceneFacade tests, SceneFactory tests, and SceneRuntime tests). This is the correct and only place for this configuration change.
  • Tests are added to the existing V8Tests class — no new test fixtures or files.
  • AllowReflection = false sits alongside DisableDynamicBinding = true and UseReflectionBindFallback = true — the factory already centralizes all engine security/binding settings.
  • No lifecycle or teardown concerns — this is a property assignment on engine creation.

Owner search: V8EngineFactory is the owner of engine creation. No other code path creates V8ScriptEngine instances. Configuration belongs here.

STEP 4 — Member audit: PASS

No new public properties, accessors, or methods introduced. The only production change is a property assignment value (truefalse).

STEP 5 — Line-level findings

Two P2 findings — see inline comments with suggestions.

# Sev File Line Issue
1 P2 V8Tests.cs 87 ReflectionProbe shadows UnityEngine.ReflectionProbe
2 P2 V8Tests.cs 74 Comment describes external mechanism instead of what the test verifies

Security review

No security issues found. This change is itself a security hardening:

  • Setting AllowReflection = false correctly prevents scene scripts from calling System.Reflection members on host objects (GetType(), GetMethod(), etc.).
  • UseReflectionBindFallback = true remains set — this is an internal ClearScript mechanism for IL2CPP compatibility (resolves host member bindings via reflection internally), and does not expose reflection APIs to scripts.
  • No AddHostType calls exist in production scene runtime code — only AddHostObject is used (via JsApiBunch and SceneRuntimeImpl), exposing specific JsApiWrapper instances rather than entire types.
  • No HostItemFlags usage found in the codebase.
  • The sandbox surface is appropriately narrowed.

STEP 6 — Complexity: SIMPLE

2 files changed, ~33 lines total. A single config flag change plus regression tests. No architectural changes.

STEP 7 — QA: YES

Modifies runtime code (V8EngineFactory) that affects every scene engine instance. Could break scenes if AllowReflection/UseReflectionBindFallback interaction is unexpected. The PR description correctly requests IL2CPP standalone testing.

STEP 8 — Non-blocking warnings

None.


REVIEW_RESULT: PASS ✅
COMPLEXITY: SIMPLE
COMPLEXITY_REASON: Config flag change in V8 engine factory with regression tests — no architectural or subsystem changes.
QA_REQUIRED: YES


Reviewed by Jarvis 🤖 · Requested by decentraland-bot via GitHub

Comment thread Explorer/Assets/DCL/Infrastructure/SceneRuntime/Tests/V8Tests.cs
Comment thread Explorer/Assets/DCL/Infrastructure/SceneRuntime/Tests/V8Tests.cs Outdated
Comment thread Explorer/Assets/DCL/Infrastructure/SceneRuntime/Tests/V8Tests.cs Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Auto-approved based on Jarvis review — simple fix/chore with no blocking issues. QA approval is still required.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Warnings not reduced: 14668 => 26622 — remove at least one warning to merge.

@Ludmilafantaniella Ludmilafantaniella left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅Smoke test performed on windows and Mac:

  • ✔️ Log In/Log Out (New OTP aacount, Metamask and Google)
  • ✔️ Backpack and wearables in world
  • ✔️ Emotes in world and in backpack
  • ✔️ Teleport with map/coordinates/Jump In
    • lautarox.dcl.eth
    • Bloomgarden.dcl.eth
    • kickoff.dcl.eth
    • cleantheclub.dcl.eth
  • ✔️ Chat and multiplayer
  • ✔️ Profile card
  • ✔️ Camera
  • ✔️ Skybox
  • ✔️ Add friend
    • accept friend request
    • Remove friend
  • ✔️ Join a community
  • ✔️ Daily quest completetion + reward
  • ✔️ Claim rewards
  • ✔️ Settings
Image Image

@github-actions

Copy link
Copy Markdown
Contributor

💰 Review cost: unknown · claude-sonnet-4-6

@anicalbano
anicalbano added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit 330a4af Jul 17, 2026
21 of 23 checks passed
@anicalbano
anicalbano deleted the hotfix/disable-allowreflection branch July 17, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants