MCPcopy Index your code
hub / github.com/AI45Lab/Code / taint_input

Method taint_input

core/src/security/default.rs:237–251  ·  view source on GitHub ↗
(&self, text: &str)

Source from the content-addressed store, hash-verified

235
236impl SecurityProvider for DefaultSecurityProvider {
237 fn taint_input(&self, text: &str) {
238 if !self.config.enable_taint_tracking {
239 return;
240 }
241
242 let matches = self.detect_sensitive(text);
243 if !matches.is_empty() {
244 let mut tainted = self.tainted_data.write().unwrap();
245 for (name, value) in matches {
246 // Hash the value for privacy
247 let hash = format!("{}:{}", name, sha256::digest(value));
248 tainted.insert(hash);
249 }
250 }
251 }
252
253 fn sanitize_output(&self, text: &str) -> String {
254 if !self.config.enable_output_sanitization {

Callers 3

test_taint_trackingFunction · 0.45
test_wipeFunction · 0.45
prepare_turn_contextMethod · 0.45

Calls 4

detect_sensitiveMethod · 0.80
writeMethod · 0.80
is_emptyMethod · 0.45
insertMethod · 0.45

Tested by 2

test_taint_trackingFunction · 0.36
test_wipeFunction · 0.36