Skip to content

Bound SV2 extended-channel extranonce negotiation - #1854

Open
Distortions81 wants to merge 1 commit into
bitaxeorg:masterfrom
Distortions81:fix/sv2-extranonce-bounds
Open

Bound SV2 extended-channel extranonce negotiation#1854
Distortions81 wants to merge 1 commit into
bitaxeorg:masterfrom
Distortions81:fix/sv2-extranonce-bounds

Conversation

@Distortions81

@Distortions81 Distortions81 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restrict extended-channel extranonce negotiation to the safe 2-32 byte range.
  • Require exact success-message framing and validate parser outputs.
  • Add defensive bounds and conversion checks in job creation and share submission.
  • Test 0 through 65535, including truncation and trailing data.

Root cause and impact

The pool supplies extranonce_size as 16 bits. It was accepted without a bound, narrowed to eight bits, and later used with fixed 32-byte stack arrays. Values above 32 could cause out-of-bounds access, while values such as 256 changed meaning during narrowing.

Valid 2-32 byte extended channels are unchanged. No authentication or network-policy change is added.

Related work

Validation

  • ESP-IDF 6.0.2 firmware and test builds passed
  • Exact ESP32-S3 QEMU environment: 76 passed, 0 failed
  • Focused parser and builder boundaries
  • git diff --check
  • Current GitHub checks are green

An encrypted SV2 pool smoke test remains desirable.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

  2 files    2 suites   1s ⏱️
124 tests 124 ✅ 0 💤 0 ❌
126 runs  126 ✅ 0 💤 0 ❌

Results for commit 215077d.

@Distortions81
Distortions81 marked this pull request as ready for review August 7, 2026 22:29

@0xf0xx0 0xf0xx0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

code ack

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