KOSASIH / HealthGuard-Refugee-Initiative

Audit required: Use of pickle module BAN-B301
Security
Major
5 months ago5 months old
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
 84    """
 85    model_path = os.path.join(model_dir, "drug_discovery_model.pkl")
 86    with open(model_path, "rb") as f:
 87        model = pickle.load(f) 88    return model
 89
 90
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
11    - model (LogisticRegression): The pre-trained diagnosis model.
12    """
13    with open("models/diagnosis_model.pkl", "rb") as f:
14        model = pickle.load(f)15    return model
16
17
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
  9    - treatment_models (dict): A dictionary containing the pre-trained treatment models.
 10    """
 11    with open("models/treatment_models.pkl", "rb") as f:
 12        treatment_models = pickle.load(f) 13    return treatment_models
 14
 15def generate_medication_schedule(health_data):