Commit graph

76 commits

Author SHA1 Message Date
GaltRanch
cfe4e5c912 Fix 5 critical security issues from audit
1. Shell injection in readHexBlock/readHexTx (PyBlock.py):
   - Validate user input with hex-only regex before use
   - Replace shell=True pipe chain with subprocess list + piped stdin
   - Same fix for OP_RETURN loop TX decoding

2. Shell injection in weather commands (ppi.py):
   - Replace curl shell commands with requests.get()
   - User input (city, lang, unit) no longer touches shell
   - Upgraded from HTTP to HTTPS

3. Runtime crash in SPV/spvblock.py:
   - os.path.isfile() called with 2 args (TypeError)
   - Fixed to use 'and' for two separate checks

4. Config files added to .gitignore:
   - pybitblock/config/*.conf (RPC creds, API keys, tokens)
   - pybitblock/SPV/config/*.conf
   - *.log files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:28:30 -03:00
GaltRanch
cf69861dcf Convert LNBits, OpenNode, and TallyCoin curl calls to requests library
Replace 23 subprocess curl API calls with native Python requests:
- LNBits: create/check invoice, pay invoice, paywall CRUD, LNURL withdraw
- OpenNode: create charge, list funds, list payments, initiate withdrawal,
  check status (RSS), decode invoice
- TallyCoin: payment requests (2 functions)

Remaining shell=True in ppi.py are pipe chains (curl|grep|html2text)
that require shell for processing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:27:41 -03:00
GaltRanch
273d806d37 Rename shadowed builtin 'list' variable to 'cmd'
Replace all uses of 'list' as a variable name for shell command strings
with 'cmd' to avoid shadowing Python's built-in list type.
Affects ppi.py, PyBlock.py, SPV/ppi.py, and SPV/spvblock.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:10:49 -03:00
GaltRanch
a746b36420 Replace star imports with explicit imports in core files
- PyBlock.py: Replace 14 star imports with explicit named imports,
  remove unused `from art import *` and `from SPV.spvblock import *`
- ppi.py: Replace star imports, remove unused art/nodeconnection imports,
  remove duplicate `import requests` and dead lnpay_py comments
- nodeconnection.py: Replace star imports, remove unused art import

This improves code clarity, prevents namespace pollution, and makes
dependencies between modules explicit and traceable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:03:52 -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
curly60e
318cbf3c41
Update ppi.py 2024-07-23 11:42:52 -03:00
Satoshi Nakamoto
cdcb0880f2
Update ppi.py 2024-07-23 16:33:34 +02:00
Satoshi Nakamoto
24d9e75ef4
Update ppi.py 2024-07-23 16:28:33 +02:00
curly60e
8114918751
Update ppi.py 2024-07-23 08:01:59 -03:00
Satoshi Nakamoto
c65b3eee9b
Update ppi.py 2024-07-23 02:11:05 +02:00
Satoshi Nakamoto
9637f75ccd
Update ppi.py 2024-07-23 02:04:36 +02:00
Satoshi Nakamoto
7895253aec
Update ppi.py 2024-07-23 01:36:43 +02:00
curly60e
0b44f03a57
Update ppi.py 2023-12-07 11:09:22 -03:00
curly60e
0c6b832720
Update ppi.py 2023-12-07 11:08:22 -03:00
curly60e
b606c148e7
Update ppi.py 2023-12-07 11:04:55 -03:00
curly60e
28d564440c
Update ppi.py 2023-12-07 10:57:21 -03:00
curly60e
4a792f19e9
Update ppi.py 2023-12-07 10:55:09 -03:00
curly60e
2358e3e23b
Update ppi.py 2023-12-07 10:53:45 -03:00
curly60e
717fb8300a
Update ppi.py 2023-12-07 10:49:45 -03:00
curly60e
049a8ee084
Update ppi.py 2023-12-07 10:46:46 -03:00
Satoshi Nakamoto
d403279e71
Update ppi.py 2023-11-11 14:55:46 +01:00
Satoshi Nakamoto
d97b0624f3
Update ppi.py 2023-09-23 01:04:47 +02:00
Satoshi Nakamoto
88c572c08d
Update ppi.py 2023-09-22 21:51:00 +02:00
Satoshi Nakamoto
fd3c8cd5a2
Update ppi.py 2023-09-22 20:12:46 +02:00
Satoshi Nakamoto
c56eabe3f8
Update ppi.py 2023-09-22 19:37:49 +02:00
Satoshi Nakamoto
609bb26afe
Update ppi.py 2023-09-20 19:37:43 +02:00
Satoshi Nakamoto
c366778c64
Update ppi.py 2023-09-10 18:20:16 +02:00
Satoshi Nakamoto
b6fad92271
Update ppi.py 2023-09-10 18:01:53 +02:00
Satoshi Nakamoto
bef1445018
Update ppi.py 2023-09-05 21:01:07 +02:00
Satoshi Nakamoto
e1ad57186d
Update ppi.py 2023-09-05 20:42:01 +02:00
Satoshi Nakamoto
f52ee2fe13
Update ppi.py 2023-09-05 20:17:41 +02:00
Satoshi Nakamoto
a81805bae1
Update ppi.py 2023-09-05 18:45:49 +02:00
Satoshi Nakamoto
4457388d31
Update ppi.py 2023-09-04 21:40:42 +02:00
Satoshi Nakamoto
74b6e509b9
Update ppi.py 2023-09-04 21:04:21 +02:00
Satoshi Nakamoto
c096309f90
Update ppi.py 2023-08-04 22:17:52 +02:00
Satoshi Nakamoto
61bc82290a
Update ppi.py 2023-06-15 23:59:38 +02:00
Satoshi Nakamoto
dad8e9f0c6
Update ppi.py 2023-06-15 23:23:35 +02:00
Satoshi Nakamoto
13de14425f
Update ppi.py 2023-06-15 23:11:48 +02:00
Satoshi Nakamoto
43554402ce
Update ppi.py 2023-06-15 22:28:11 +02:00
Satoshi Nakamoto
a7cd228981
Update ppi.py 2023-06-15 21:59:24 +02:00
Satoshi Nakamoto
94e47cb726
Update ppi.py 2023-05-25 22:40:32 +02:00
Satoshi Nakamoto
bf9728859a
Update ppi.py 2022-10-09 17:30:24 +02:00
Sourcery AI
887d58ff8f 'Refactored by Sourcery' 2022-10-08 17:29:08 +00:00
Satoshi Nakamoto
7931361ded
Update ppi.py 2022-10-08 19:28:16 +02:00
curly60e
8a174dc2ed
Add files via upload 2022-10-04 15:20:25 -03:00
Sourcery AI
e14a608634 'Refactored by Sourcery' 2022-05-09 18:28:47 +00:00
Satoshi Nakamoto
45d07eaa6f
Update ppi.py 2022-05-09 20:28:07 +02:00
Satoshi Nakamoto
52fa7c03e9
Update ppi.py 2022-03-26 14:35:13 +01:00
Satoshi Nakamoto
f669cb6249
Update ppi.py 2022-03-25 21:21:06 +01:00