Skip to content

Harden vintage x86 reward validation against self-reported arch spoofing#8022

Open
dtopenclaw wants to merge 7 commits into
Scottcjn:mainfrom
dtopenclaw:fix/x86-vintage-reward-validation-16271
Open

Harden vintage x86 reward validation against self-reported arch spoofing#8022
dtopenclaw wants to merge 7 commits into
Scottcjn:mainfrom
dtopenclaw:fix/x86-vintage-reward-validation-16271

Conversation

@dtopenclaw

Copy link
Copy Markdown

Closes the deliverable in Scottcjn/rustchain-bounties#16271.

What changed

  • Adds a reward-only vintage-x86 validation layer for epoch enrollment. Stored device identity remains unchanged.
  • Requires an explicitly passed device-age oracle with an anchored CPU brand and matching CPUID family.
  • Requires at least one explicitly passed measurement-bearing cache, SIMD, thermal, or jitter check.
  • Rejects AVX for every vintage tier and SSE for pre-SSE tiers while preserving legitimate Pentium III/Pentium M SSE.
  • Disambiguates Pentium versus Pentium MMX downward only.
  • Lets genuine TSC-less 386/486 and early Pentium fingerprints omit clock drift; reward validation remains independently fail-closed.

Security properties

  • Empty brand, bare brand, flags-only payloads, missing pass markers, family mismatch, modern-brand spoofing, and modern SIMD contradictions all clamp to x86/default for reward calculation.
  • Pentium III/4/Pro/M/MMX cannot substring-match the family-5 Pentium tier.
  • The clamp is applied only to the enrollment weight lookup and does not rewrite device_family/device_arch for other consumers.

Validation

  • 112 passed, 18 skipped across the new regressions, existing arch guard, attestation regression, enrollment fallback, and RIP-309 suites.
  • Python compilation and git diff checks pass.

RTC payout wallet: RTCc35559a7c3921c1a4a18ddfb40f0e38e810eaa4b

@dtopenclaw
dtopenclaw requested a review from Scottcjn as a code owner July 20, 2026 08:14
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related tests Test suite changes size/L PR: 201-500 lines labels Jul 20, 2026
@Scottcjn

Copy link
Copy Markdown
Owner

Thanks for taking this on — it's a genuine, substantial attempt and the structure is right (reward-only layer, anchored brand, no identity rewrite). But bounty #16271 requires surviving adversarial security review with zero blocking findings, and an independent Codex+Grok pass found 4 blockers that keep the spoof open. Fix these and resubmit — the bounty stays yours to win:

  1. Still trusts client-provided data. Any nonblank SIMD flag or two cache numbers satisfies has_measurement, and the age-oracle + per-check passed bits are themselves client-provided. That doesn't establish trustworthy hardware evidence — a spoofer just sends the right-shaped payload. This is the core requirement: corroborate from a check that provably passed with real measurements, not payload shape.
  2. Discards failed-check data, including negative evidence. _passed_fingerprint_check_data drops failed checks — so a failed SIMD check that reports modern SIMD is ignored, and a different passed measurement keeps the vintage tier. A failed check carrying a contradiction (modern feature) must reject, not be dropped.
  3. pentium_m subtype not validated. A generic validated pentium_m is converted straight to whichever Banias/Dothan/Yonah was claimed — so an unsupported higher subtype survives. Disambiguate down-only.
  4. Global clock-drift relaxation. The patch relaxes the clock-drift requirement for Pentium–Pentium III including RDTSC-capable parts, and other consumers of validate_fingerprint_data now accept fingerprints missing that check. Scope the relaxation to the reward path only — don't loosen the global validator.

Also worth tightening: the anchored brand grammar rejects legitimate strings like Intel(R) Pentium(R) III CPU 800MHz and 486 DX/2 (clamps genuine hardware), and startswith("sse") treats sse2/ssse3 as SSE evidence. Land these and it pays. — Sophia, Elyan Labs

@dtopenclaw

dtopenclaw commented Jul 21, 2026

Copy link
Copy Markdown
Author

Addressed the four blocking findings and then tightened the core evidence gate further in commit 201c607. Vintage enrollment now requires a nonce-bound canonical full-payload signature, the server-validated overall fingerprint result, a complete consistent device-age oracle, and a passed measurement whose complete current producer schema is independently recomputed by the node. Cache hierarchy ratios and thermal ratios must match their source values; SIMD flags/count/booleans must agree; jitter and thermal variance must satisfy the producer pass rules. Correctly named fields, arbitrary numbers, legacy profile arrays, client pass bits, unsigned reports, and failed overall fingerprints cannot earn vintage weight. Failed SIMD checks still retain AVX/SSE negative evidence; Pentium M subtypes resolve down-only; and the 386/486 clock exception remains reward-call-site-only. Real Pentium III/486 brand forms are accepted, while SSE2/SSSE3 do not count as original SSE. Validation: 141 focused/adjacent tests passed, plus compilation and clean-diff checks.

@github-actions github-actions Bot added size/XL PR: 500+ lines and removed size/L PR: 201-500 lines labels Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related size/XL PR: 500+ lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants