girisagar46 / FYPFruitClassifier

Audit required: Use of pickle module BAN-B301
Security
Major
3 occurrences in this check
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
21ehfe = EdgeHistogramFeatureExtractor(10)
22
23classifier = pickle.load(open(os.path.join(dataDir, "../data/classifier.pkl"), 'rb'))
24labels = pickle.load(open(os.path.join(dataDir, "../data/featLabel.pkl"), 'rb'))25
26
27def predictor():
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
20hhfe = HueHistogramFeatureExtractor(10)
21ehfe = EdgeHistogramFeatureExtractor(10)
22
23classifier = pickle.load(open(os.path.join(dataDir, "../data/classifier.pkl"), 'rb'))24labels = pickle.load(open(os.path.join(dataDir, "../data/featLabel.pkl"), 'rb'))
25
26
Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
88                    ]
89                )
90            ]
91            t_data = pickle.load(file)92            print(t_data.predict_proba(np.asarray(features2)))
93            print(t_data.predict(np.asanyarray(features2)))
94