Skip to content

Commit 4cf9787

Browse files
Merge pull request #27 from groupthinking/copilot/fix-213aa9e3-0b23-4bd9-9b0c-2eb2bc585c94
Fix 6 critical security vulnerabilities: replace pickle with JSON, MD5 with SHA-256, remove hardcoded credentials
2 parents 878cf74 + 12c0eab commit 4cf9787

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

connectors/mcp_debug_tool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
copilot/fix-94a3a2ef-451e-4b72-9782-aff6506fa546
88
import traceback
99
import os
10+
copilot/fix-213aa9e3-0b23-4bd9-9b0c-2eb2bc585c94
1011
=======
12+
=======
13+
master
1114
master
1215
from datetime import datetime, timezone
1316
from typing import Dict, Any, Optional, List

llm/continuous_learning_system.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,14 @@ async def _create_model_version(
597597
training_data_size=self.training_stats["total_samples_processed"],
598598
quantum_optimized=self.quantum_connector.connected,
599599
file_path=str(self.model_dir / f"{version_id}.json"),
600+
copilot/fix-213aa9e3-0b23-4bd9-9b0c-2eb2bc585c94
601+
checksum=hashlib.sha256(version_id.encode()).hexdigest(),
602+
600603
copilot/fix-94a3a2ef-451e-4b72-9782-aff6506fa546
601604
checksum=hashlib.sha256(version_id.encode()).hexdigest(),
602-
=======
605+
603606
checksum=hashlib.md5(version_id.encode()).hexdigest(),
607+
master
604608
master
605609
)
606610

@@ -611,12 +615,17 @@ async def _create_model_version(
611615
"model_state": "simulated_model_state",
612616
}
613617

618+
copilot/fix-213aa9e3-0b23-4bd9-9b0c-2eb2bc585c94
619+
with open(version.file_path, "w") as f:
620+
json.dump(model_data, f, indent=2, default=str)
621+
614622
copilot/fix-94a3a2ef-451e-4b72-9782-aff6506fa546
615623
with open(version.file_path, "w") as f:
616624
json.dump(model_data, f, indent=2, default=str)
617625

618626
with open(version.file_path, "w", encoding="utf-8") as f:
619627
json.dump(model_data, f, cls=ModelVersionJSONEncoder, indent=2)
628+
master
620629
master
621630

622631
# Update current version
@@ -666,13 +675,18 @@ async def _load_or_create_model(self):
666675
json_files = list(self.model_dir.glob("*.json"))
667676
pkl_files = list(self.model_dir.glob("*.pkl"))
668677

678+
copilot/fix-213aa9e3-0b23-4bd9-9b0c-2eb2bc585c94
679+
with open(latest_file, "r") as f:
680+
model_data = json.load(f)
681+
669682
if json_files:
670683
# Load latest JSON version
671684
latest_file = max(json_files, key=lambda f: f.stat().st_mtime)
672685
master
673686

674687
with open(latest_file, "r", encoding="utf-8") as f:
675688
model_data = json.load(f, cls=ModelVersionJSONDecoder)
689+
master
676690

677691
self.current_model_version = model_data["version_info"]
678692
logger.info(

0 commit comments

Comments
 (0)