Skip to content

fix(security): prepare G4 security-ready review candidate - #10

Merged
everest-an merged 5 commits into
mainfrom
security/g4-security-ready-rc
Aug 2, 2026
Merged

everest-an merged 5 commits into
mainfrom
security/g4-security-ready-rc

Conversation

@XiaoHai67890

Copy link
Copy Markdown
Collaborator

Status

G4 preparation is complete; independent external Solidity review is still pending. This PR must not be represented as External review complete or production-ready until pnpm security:rc passes with real external evidence.

Change

  • Fixes G4-INT-001 (High) in AuditGrant: each grant now persists its origin Space and rejects cross-Space acknowledgement or revocation. Previously, the controller of another registered Space could revoke a victim grant, and an auditor could emit a misattributed acknowledgement.
  • Freezes the corrected Solidity target at af5a75fb2db532fd5603554083d8895a825c2de2 and immutable tag audit/g4-rc1-source.
  • Adds a SHA-256-pinned audit scope, internal review, 12-entry residual-risk register, external-review request/template, and G4 status documentation.
  • Adds security:scope, security:test, and the full security:rc release gate. The gate rejects self-review, weakened scope, path traversal, report mismatch, unmapped accepted findings, incomplete risk assessment, and unresolved Critical/High findings.
  • Deprecates the pre-fix Sepolia AuditGrant address; no corrected deployment is allowed before G4 passes.

Frozen evidence

  • Source commit: af5a75fb2db532fd5603554083d8895a825c2de2
  • Source tree: f8d66277123391ea54de3f53842256e17e2a497e
  • Scope SHA-256: c9db7d27957c86386d8842687a2d009c0ca03bc864307e88cfed0ee25f3ae9bf
  • Risk-register SHA-256: 307a52eb0bf512aea25565bf604d92fc6b1b2d64eb910595568a5f0c04aa6019
  • Audit packet: audits/g4/README.md
  • External request: audits/g4/EXTERNAL_REVIEW_REQUEST.md

Verification

  • pnpm check: PASS
  • pnpm audit --audit-level=moderate: PASS, no known vulnerabilities
  • pnpm conformance:clean: PASS at 5ac1210969e199f29aef1211f76b6f37f35fd7ca
  • Clean workspace + core TS + minimal TS + Solidity Golden Vector: PASS
  • Foundry: 48 passed, 0 failed; invariant: 256 runs / 128,000 calls
  • G4 gate tests: 10 passed, 0 failed
  • Slither 0.11.6: 102 detectors; 6 heuristic results triaged, 0 actionable after fix
  • pnpm security:rc: EXPECTED FAIL because external-review evidence is intentionally absent

Protocol checklist

  • Core hashing, state machine, and canonical Golden Vector are unchanged.
  • Security-sensitive extension fix includes negative cross-Space tests.
  • Experimental MemoryMarket is explicitly excluded from G4.
  • Remaining risks and deployment requirements are explicit.
  • Release tooling cannot self-approve the missing external review.
  • Independent reviewer publishes and attests the final report.
  • Every accepted external finding is mapped to the residual-risk register.
  • No unresolved Critical or High finding remains.
  • pnpm security:rc passes.

Merge order

This PR is intentionally stacked on #9. Merge #8, retarget and merge #9, then retarget this PR to main and rerun hosted checks. GitHub Actions remain subject to the existing organization billing lock; local and clean-checkout evidence above is reproducible.

@XiaoHai67890

Copy link
Copy Markdown
Collaborator Author

Dependabot reconciliation

The repository-level High alert #10 applies to the current default branch, which still locks transitive postcss 8.5.17. This stacked G4 branch already contains parent PR #8's pnpm-workspace.yaml override and lock entry for patched postcss 8.5.18.

Verified at head 1fa8edd1fb45a36c9ba7692b6d04e240caee578f:

  • pnpm-lock.yaml: postcss@8.5.18
  • pnpm audit --audit-level=moderate: No known vulnerabilities found
  • No G4 Solidity source or audit-scope hash changed.

The default-branch alert should clear after #8 is merged; it is not being dismissed as a false positive.

@everest-an
everest-an force-pushed the evidence/r-002-independent-reproduction branch from 8de2b7f to c67e370 Compare August 2, 2026 22:32
@everest-an
everest-an changed the base branch from evidence/r-002-independent-reproduction to main August 2, 2026 22:41
@everest-an
everest-an force-pushed the security/g4-security-ready-rc branch from 31f4fbb to 463155c Compare August 2, 2026 22:46
… checkout

validatePinnedEntry asserted each pinned SHA-256 twice: once against the working
tree and once against the frozen review commit. Only the second is meaningful.
The review targets refs/tags/audit/g4-rc1-source (af5a75f), which is what an
external reviewer fetches and cannot drift once published; main legitimately
advances underneath it. Rebasing this branch onto a main that had added comments
to contracts/foundry.toml was enough to make the gate unrunnable, with no defect
anywhere in the review candidate.

The frozen-commit comparison is now the sole authoritative check. Divergence
between the branch and the freeze is still surfaced — it is real information —
but as a report rather than a failure. It compares committed bytes at HEAD, not
the working tree, so the answer does not change with a checkout's line-ending
normalisation (on a CRLF checkout every text file "differed", which made the old
check fail for a reason that had nothing to do with the audit).

This is the same distinction §6.1 of docs/interop/attestation-refs.md draws:
"the check ran and failed" is not "the check could not have run". Collapsing the
two is what turned a routine rebase into a red security gate.

Tests: the tampered-pin case now asserts the frozen-commit rejection (the
security property is unchanged — a mutated hash is still rejected); added a case
pinning that post-freeze drift reports and exits 0. 11/11 pass.
@everest-an
everest-an merged commit 857ac7c into main Aug 2, 2026
8 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.

2 participants