pyblock/pybitblock/clock
GaltRanch d79977ce00 Full security and code quality audit fixes across codebase
Security (Critical):
- Eliminate all shell=True command injection vectors (~95 instances in ppi.py, spvblock.py)
- Replace subprocess curl calls with requests library
- Add input validation (fiat code allowlist, IP address validation)
- Replace weak random.randint/choice with secrets module for crypto ops
- Remove token/credential exposure from print statements
- Add path traversal prevention in config.py
- Create .conf.example templates, scrub local credentials

Stability:
- Replace 63 bare except clauses with specific exceptions + logging
- Fix file handle leaks with context managers (lnd.py, apisnd.py)
- Add threading.Lock for race conditions in clock/data.py
- Cap unbounded list growth (MAX_HISTORY_LEN=50)
- Add timeout=10 to ~50 requests calls missing timeouts

Maintainability:
- Extract _load_macaroon() helper (dedup 69 instances in PyBlock.py)
- Extract _load_lnd_config() helper (dedup 33 instances in nodeconnection.py)
- Normalize json import (simplejson with stdlib fallback)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 10:57:20 -03:00
..
__init__.py Add enhanced block clock with 12 new features for Menu A 2026-04-02 08:35:59 -03:00
animations.py Add enhanced block clock with 12 new features for Menu A 2026-04-02 08:35:59 -03:00
data.py Full security and code quality audit fixes across codebase 2026-04-03 10:57:20 -03:00
generative.py Fix generative art centering to use actual terminal width 2026-04-02 09:10:53 -03:00
renderer.py Address Sourcery review: subprocess audit, dead code, renderer fix 2026-04-02 17:41:11 -03:00
sound.py Add enhanced block clock with 12 new features for Menu A 2026-04-02 08:35:59 -03:00
sparkline.py Add enhanced block clock with 12 new features for Menu A 2026-04-02 08:35:59 -03:00
widgets.py Add 5 visual features to block clock: miner pool, weight, histogram, peers, moon 2026-04-02 09:08:18 -03:00