pyblock/pybitblock/execute_load_config.py
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

23 lines
806 B
Python

import json
import os
import sys
def load_config():
settings = {"gradient": "", "design": "block", "colorA": "green", "colorB": "yellow"}
settingsClock = {"gradient": "", "colorA": "green", "colorB": "yellow"}
path = {"ip_port": "", "rpcuser": "", "rpcpass": "", "bitcoincli": ""}
try:
if os.path.isfile('config/bclock.conf'):
with open("config/bclock.conf", "r") as f:
pathv = json.load(f)
path = pathv
if os.path.isfile('config/blndconnect.conf'):
with open("config/blndconnect.conf", "r") as f:
lndconnectData = json.load(f)
lndconnectload = lndconnectData
except Exception as e:
print(f"An error occurred: {e}")
sys.exit(101)
return path, settings, settingsClock