Skip to content

executor: refuse a root class the contract did not define - #5

Merged
EnzinoBB merged 4 commits into
build/reproducible-1518from
fix/confine-root-class-guard
Oct 13, 2026
Merged

EnzinoBB merged 4 commits into
build/reproducible-1518from
fix/confine-root-class-guard

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

deploySmartContract and executeContractMethod confined the contract's root class, or the deserialized instance's class, with the contract permission set.

When a contract's byte code names a class that already exists, the contract class loader returns that class. It is one of the executor's own classes or the JDK's, and it was confined for the whole process and for every later call.

A valid contract's root class is always defined by its contract loader, so the deploy or call is now refused instead.

An earlier version of this fix skipped the confinement in that case. The automated security review flagged that, because it would run the class for the contract with the executor's permissions. The second commit makes the fix fail closed.

Testing

  • Executor build on Actions (JDK 11.0.3).
  • Node testnet run 38374856915: the even nodes ran test/compatible-fixes (all phase-1 executor fixes, commit 9647fe4) and the odd nodes the release executor; 17 of 17 contract calls as expected, Counter and Ledger states equal on all 7 nodes.

Compatible: valid contracts behave as before. A build with commits on top of 1518 needs a higher executor_commit_max in the node's config.ini.

🤖 Generated with Claude Code

EnzinoBB and others added 4 commits October 13, 2026 10:50
deploySmartContract and executeContractMethod confined the contract's root
class (or the deserialized instance's class) with the contract permission
set. When the contract's byte code names a class that already exists, the
contract class loader returns that class, one of the executor's own or the
JDK's, and it was confined for the whole process and every later call.
Confine it only when its loader is a contract loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit skipped confinement when the root class (or the
deserialized instance's class) came from outside the contract loader, which
would run that class's code for the contract with the executor's own
permissions. A valid contract's root class is always defined by its
contract loader, so refuse the deploy or call instead: fail closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With appendAssemblyId=false the attached assembly replaces the main
artifact file of sc-api-support, so within the reactor contract-executor
compiles against sc-api-support-<tag>-b<n>.jar instead of
sc-api-support-0.8.5.jar. That fat jar holds one module-info.class taken
either from sc-api-support or from sc-api-internal, and when it is the
latter javac fails with "module not found: com.credits.sc.api.support".
Keep the plain jar as the project artifact; the assembly is still built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6c38193)
@EnzinoBB
EnzinoBB merged commit eecd2b2 into build/reproducible-1518 Oct 13, 2026
2 checks passed
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.

1 participant