Commit graph

18 commits

Author SHA1 Message Date
GaltRanch
68e235f457 Fix dangerous-subprocess-use-audit across codebase
Replace all dynamic .split() patterns in subprocess calls with safe
alternatives: shlex.split(), explicit list args, and _run_btc/_run_ln
helpers in PyBlock.py. Covers PyBlock, block_visualizer, clockscript,
lastblockdetail, mempoolclock, nodeconnection, and ai/context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:35:03 -03:00
GaltRanch
0a70a7260a Eliminate all star imports across the entire codebase
Replace every `from X import *` with explicit named imports:
- SPV/spvblock.py: 11 star imports resolved
- SPV/ppi.py: 4 star imports resolved, duplicate import removed
- SPV/nodeconnection.py, SPV/sysinf.py, SPV/apisnd.py, SPV/donation.py
- mempoolclock.py, sysinf.py, apisnd.py, donation.py

Removed unused imports (art, nodeconnection in donation, logos in apisnd).
Zero star imports remain in the project.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:13:33 -03:00
GaltRanch
cdfb258e95 Harden file handling, exception specificity, and API key management
- Replace open() without context managers with `with` statements across all modified files
- Change bare `except:` to `except Exception:` for safer exception handling
- Move Whale Alert API key from hardcoded to environment variable
- Use raw strings for ASCII art to prevent escape sequence issues
- Simplify image file handling in nodeconnection.py
- Convert unsafe shell subprocess calls to list-based format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 11:52:26 -03:00
GaltRanch
0224cfe230 Fix critical security vulnerabilities across the codebase
Replace insecure patterns that exposed the application to command injection,
arbitrary code execution, and data interception attacks.

- Replace os.popen/os.system with subprocess.run using argument lists
- Migrate pickle config serialization to JSON format
- Replace bare except: blocks with specific exception types
- Fix insecure HTTP URLs to HTTPS (opreturnbot.com, ascii.live)
- Replace shell curl commands with requests library calls
- Add migrate_config.py script for pickle-to-JSON config migration
- Convert existing SPV config files to JSON format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:24:47 -03:00
Satoshi Nakamoto
61e88d049a
Update print statement for Bitcoin Node connection 2026-03-21 04:13:53 +01:00
Satoshi Nakamoto
8c5182e0a7
Update mempoolclock.py 2024-06-26 21:19:52 +02:00
Sourcery AI
5768d8b886 'Refactored by Sourcery' 2022-03-22 22:19:38 +00:00
Satoshi Nakamoto
3f6923226f
Update mempoolclock.py 2022-03-22 23:19:24 +01:00
curly60e
404bc427b7
Add files via upload 2022-03-21 10:27:19 -03:00
curly60e
68fdcb5bec
Update mempoolclock.py 2022-03-20 20:34:51 -03:00
curly60e
68611f62db
Add files via upload 2022-03-20 20:22:08 -03:00
curly60e
cc7b27ba8b
Add files via upload 2022-03-20 16:58:23 -03:00
curly60e
7180fe8c53
Add files via upload 2022-03-19 18:58:06 -03:00
Sourcery AI
eca53d2467 'Refactored by Sourcery' 2022-03-19 01:57:07 +00:00
Satoshi Nakamoto
f09806b6cf
Update mempoolclock.py 2022-03-19 02:56:47 +01:00
curly60e
21edcad3aa
Update mempoolclock.py 2022-03-18 18:54:37 -03:00
curly60e
b9d3652423
Update mempoolclock.py 2022-03-18 18:50:11 -03:00
curly60e
114340cff8
Add files via upload 2022-03-18 18:49:32 -03:00