Commit graph

24 commits

Author SHA1 Message Date
dependabot[bot]
196423a8fc
chore(deps-dev): Bump lodash from 4.17.15 to 4.17.23 in /miner/config
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-24 12:06:31 +00:00
snider
bce309b78d docs: Add miner suite documentation and release workflow
- Create miner/README.md documenting standalone C++ mining tools
- Update miner/core and miner/proxy READMEs with EUPL-1.2 license
- Add GitHub Actions workflow for multi-platform miner releases
- Add Makefile targets: build-miner, build-miner-core, build-miner-proxy
- Update main README with standalone miner usage instructions

The miner/ directory contains standalone CPU/GPU miner and stratum
proxy that can be used independently without the GUI. Pre-built
binaries will be published alongside Go releases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:46:46 +00:00
snider
d4e131b1a3 feat: Enhance testing framework with C++ test builds and GitHub Actions integration 2026-01-02 18:05:56 +00:00
snider
c3837d118c feat: Add comprehensive testing framework and initial test cases for core components 2026-01-02 17:53:49 +00:00
snider
919b17ee9e fix: Address multiple security issues and add unit tests for various components 2026-01-02 17:39:53 +00:00
snider
1101248397 fix: Address 22 security findings from parallel code review (Pass 2)
Security fixes implemented:
- CRIT-001: SSRF IPv6 bypass protection (localhost, link-local, ULA, mapped)
- CRIT-002: cn_heavyZen3Memory leak fix with cleanup function
- CRIT-003: HTTP header size DoS prevention (8KB/16KB limits)
- CRIT-004: patchAsmVariants null check after allocation
- CRIT-005: autoPause race condition fix with atomics
- HIGH-001: OpenSSL strchr null pointer check
- HIGH-002: uv_loop_close error handling
- HIGH-004/005/006: Miner.cpp race conditions (atomic reset, mutex protection)
- HIGH-007: m_workersMemory dangling pointer fix
- HIGH-008: JIT buffer overflow bounds checking
- HIGH-009: Bearer prefix timing attack mitigation
- HIGH-010: CORS origin restriction to localhost
- HIGH-011: Per-IP connection limits (10 per IP) for DoS protection
- HIGH-012: SSRF 172.x RFC1918 range validation
- MED-002: pthread_join return value check on macOS
- MED-004: OclKawPowRunner exception-safe initialization
- MED-005: Generic error messages to prevent info disclosure
- MED-006: CRLF header injection prevention

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:28:22 +00:00
snider
b33b8eb843 fix: Address 3 security findings from code review (batch 8)
- HIGH-015: Improve TLS certificate validation
  - Enable SSL_VERIFY_PEER with system CA store
  - Support certificate pinning via fingerprint
  - Chain validation OR fingerprint match required
- HIGH-019: Document libuv single-thread model for Client state
  - TOCTOU pattern is safe due to event loop serialization
- MED-005: Fix potential alignment issues in Keccak
  - Use memcpy for unaligned uint8_t* to uint64_t access
  - Prevents undefined behavior on strict alignment architectures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:27:50 +00:00
snider
48a5f34661 fix: Address 4 security findings from code review (batch 7)
- CRIT-016: Document use-after-free safety mechanism in Client::onClose
- HIGH-006: Add IP-based rate limiting for API authentication
  (max 5 failures, 5 minute block time, periodic cleanup)
- HIGH-010: Document miner pointer lifetime constraint in CloseEvent
- MED-003: Improve TLS hardening comments for clarity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:22:51 +00:00
snider
8fb240967a fix: Address 9 security findings from code review (batch 6)
Security fixes:
- CRIT-012: Add compile-time bounds checking in Job::setBlob()
- CRIT-017: Add header count limit (64 max) to prevent DoS
- HIGH-005: Disable TLSv1.0 and TLSv1.1 (BEAST/POODLE vulnerable)
- HIGH-008: Document signal handler safety (libuv defers to event loop)
- HIGH-011: Fix memory leak in BindHost using String copy constructor
- HIGH-023: Document JSON type safety check in Client::parse()

Quality improvements:
- MED-002: Add security headers (X-Content-Type-Options, X-Frame-Options, CSP)
- MED-007: Add URL length validation (8KB limit)
- MED-009: Reduce self-signed cert validity from 10 years to 1 year

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:14:24 +00:00
snider
c77cdb0076 fix: Address 9 security findings from code review (batch 5)
Security fixes:
- HIGH-017: Add timeout cleanup for Client results/callbacks maps
- HIGH-020: Fix iterator invalidation in SimpleSplitter::tick()
- HIGH-022: Add bounds checking in EthStratum height parsing
- HIGH-025: Remove improper CloseHandle on Windows std handles
- HIGH-027: Use std::nothrow for Miner allocation with proper null check

Quality/stability fixes:
- MED-001: Use explicit uint64_t max for custom diff validation
- MED-004: Add fork() error logging with strerror
- MED-006: Add null checks in Controller methods for safe operation
- MED-008: Optimize NonceMapper with single map lookup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 18:59:24 +00:00
snider
ab0535ed86 fix: Address 4 additional security findings in proxy (batch 4)
Security fixes:
- HIGH-014: Use OpenSSL's RAND_bytes() for cryptographic random instead
  of std::mt19937 when libsodium not available
- HIGH-021: Use find() instead of operator[] in SimpleSplitter::submit()
  to avoid inserting nullptr into map
- HIGH-024: Use CRYPTO_memcmp() for constant-time token comparison in
  Httpd::auth() to prevent timing attacks
- HIGH-026: Add overflow detection and slot reuse in Storage::add()
  counter to prevent ID collisions after many connections

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 18:45:40 +00:00
snider
daca391375 fix: Address 5 additional security findings in proxy (batch 3)
Critical fixes:
- CRIT-009: Document lifetime constraint on LoginEvent references to
  prevent use-after-free (architectural fix requires larger refactor)
- CRIT-015: Add proper libuv handle cleanup with uv_walk() before
  uv_loop_close() to prevent resource leaks

High priority fixes:
- HIGH-012: Log warning when LineReader truncates oversized lines
- HIGH-013: Add division-by-zero check in Job::setTarget() for
  malformed target values
- HIGH-016: Add MAX_UPSTREAMS limit (1000) in NonceSplitter to prevent
  unbounded memory growth under DoS conditions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 18:41:36 +00:00
snider
3d8423f6e1 fix: Address 9 additional security findings in proxy (batch 2)
Critical fixes:
- CRIT-008: Enable TLS peer certificate verification in client connections
- CRIT-010: Add null pointer checks throughout ExtraNonceSplitter
- CRIT-011: Validate JSON error message field before access in Client
- CRIT-013: Make event system thread-safe with atomic<bool> and CAS
- CRIT-018: Add bounds checking in NonceSplitter vector access

High priority fixes:
- HIGH-002: Set 0600 permissions on generated private key files
- HIGH-004: Add strtol error checking and overflow validation
- HIGH-007: Handle integer overflow in ExtraNonceStorage nonce counter
- HIGH-018: Add comprehensive JSON field validation in Miner::parse()

These fixes address TLS security, thread safety, memory safety, and
input validation issues identified during parallel code review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 18:31:48 +00:00
snider
354fd5da28 fix: Address 10 critical and high security findings in proxy
Security fixes implemented:
- CRIT-001/002: Replace static shared buffer with per-instance buffer in Miner
- CRIT-003: Redact password from API response in ApiRouter
- CRIT-004: Fix TlsContext::setCiphers returning true on failure + TLS hardening
- CRIT-005: Add null check in Controller destructor to prevent double-free
- CRIT-006: Add JSON type validation before member access in BindHost
- CRIT-007: Restrict CORS to localhost + add security headers in HttpApiResponse
- CRIT-014: Add HTTP body/header/URL size limits to prevent DoS
- HIGH-001: Make miner ID generation thread-safe with std::atomic
- HIGH-003: Make all global counters atomic in Counters class
- HIGH-009: Implement rolling window for latency vector (max 10K entries)

These fixes address race conditions, memory exhaustion DoS vectors,
information disclosure, and thread safety issues identified during
parallel code review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 18:22:28 +00:00
snider
ae68119329 feat: Rename XMRig references to Miner and add miner.cpp for new platform 2025-12-31 16:38:48 +00:00
snider
09df6f0e4f feat: Add security and resilience middleware
- SEC-MED-3: Add CSRF protection middleware for browser requests
- RESIL-MED-8: Add request timeout middleware (30s default)
- API-MED-7: Add Cache-Control headers for appropriate endpoints
- Update CORS to allow X-Requested-With header

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 15:54:37 +00:00
snider
473c72814f fix: Update documentation for miner-cuda plugin and improve build instructions 2025-12-31 01:53:53 +00:00
snider
dd8a1807c5 fix: Update documentation for miner-cuda plugin and improve build instructions 2025-12-31 01:53:44 +00:00
snider
bec2accf1a feat: Add OpenCL GPU support for ProgPowZ, ETChash, and Blake3DCR
Implement GPU mining backends for three new algorithms:

- ProgPowZ (Zano): DAG-based ProgPow variant with 512 parents, dynamic
  program generation per period
- ETChash (Ethereum Classic): Standard Ethash with 256 parents and
  ECIP-1099 epoch calculation for post-block 11.7M
- Blake3DCR (Decred): Simple Blake3 hash kernel with no DAG requirement,
  processing 180-byte block headers

Each implementation includes OpenCL kernels, GPU runners, thread
generators, and build system integration. Also adds fast modulo
optimization to ETCCache for GPU kernel performance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:01:16 +00:00
snider
b1aced8341 feat: Add stratum integration and mining support for new algorithms
- Stratum protocol integration for ETChash, ProgPowZ, Blake3DCR
- EthStratumClient selection for DAG-based algorithms
- Nonce offset handling for all new algorithm families
- AutoClient support for new algorithm detection
- Coin definitions for ETC, ETH, ZANO, DCR

Worker integration:
- CPU worker support for Blake3DCR mining
- GPU worker stubs for ETChash, ProgPowZ, Blake3
- Proper algorithm family handling in CpuWorker/OclWorker

Go CLI integration:
- Updated xmrig_start.go with coin field support
- Improved pool configuration for new algorithms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:56:19 +00:00
snider
9cf0db802a feat: Add Blake3DCR algorithm support (Decred)
- Add Blake3 cryptographic hash library (portable C implementation)
- Create Blake3DCR wrapper for Decred mining (180-byte block headers)
- Register BLAKE3_DCR algorithm ID (0x62100000) with dcr/decred aliases
- Support for block header hashing and nonce iteration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:30:05 +00:00
snider
b7af288374 feat: Add ProgPowZ algorithm support (Zano)
- Add core crypto implementation (ProgPowZHash.cpp, ProgPowZCache.cpp)
- ProgPowZ uses standard Ethash 30000 block epochs
- Period length 50 (vs 3 for KawPow), CNT_CACHE 12, CNT_MATH 20
- Integrate with OpenCL and CUDA backends for memory calculation
- Register PROGPOWZ_ZANO algorithm ID (0x70100000)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:19:54 +00:00
snider
353afe46ae feat: Add ETChash/Ethash algorithm support
- Add core crypto implementation (ETChash.cpp, ETCCache.cpp)
- Implement ECIP-1099 epoch calculation for Ethereum Classic
- Add Ethash support with standard 30000 block epochs
- Integrate with OpenCL and CUDA backends for memory calculation
- Register ETCHASH_ETC and ETHASH_ETH algorithm IDs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:08:36 +00:00
snider
69376b886f feat: Rebrand xmrig to miner and vendor XMRig ecosystem
Complete rebranding of all components:
- Core miner: xmrig -> miner (binary, version.h, CMakeLists.txt)
- Proxy: xmrig-proxy -> miner-proxy
- CUDA plugin: xmrig-cuda -> miner-cuda
- Heatmap: xmrig-nonces-heatmap -> miner-nonces-heatmap
- Go CLI wrapper: miner-cli -> miner-ctrl

Vendored XMRig ecosystem into miner/ directory:
- miner/core - XMRig CPU/GPU miner
- miner/proxy - Stratum proxy
- miner/cuda - NVIDIA CUDA plugin
- miner/heatmap - Nonce visualization tool
- miner/config - Configuration UI
- miner/deps - Pre-built dependencies

Updated dev fee to use project wallet with opt-out (kMinimumDonateLevel=0)
Updated branding to Lethean (domain, copyright, version 0.1.0)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:43:02 +00:00