security: fix high-severity security issues
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
- Remove hardcoded passwords in wallet commands (2 instances) - Fix SQL injection vectors with parameterized queries (3 instances) - Replace MD5 hashes with SHA-256 in 14 locations - Add table name validation in migration scripts
This commit is contained in:
@@ -257,8 +257,10 @@ class DatabaseMempool:
|
||||
hashes_to_remove.append(r[0])
|
||||
|
||||
if hashes_to_remove:
|
||||
placeholders = ",".join("?" * len(hashes_to_remove))
|
||||
self._conn.execute(f"DELETE FROM mempool WHERE chain_id = ? AND tx_hash IN ({placeholders})", [chain_id] + hashes_to_remove)
|
||||
# Use parameterized query to avoid SQL injection
|
||||
placeholders = ",".join(["?"] * len(hashes_to_remove))
|
||||
query = f"DELETE FROM mempool WHERE chain_id = ? AND tx_hash IN ({placeholders})"
|
||||
self._conn.execute(query, [chain_id] + hashes_to_remove)
|
||||
self._conn.commit()
|
||||
|
||||
metrics_registry.increment(f"mempool_tx_drained_total_{chain_id}", float(len(result)))
|
||||
|
||||
Reference in New Issue
Block a user