use super::{is_deny, AttackTest};
use serde_json::json;
pub fn tests() -> Vec<AttackTest> {
vec![
AttackTest {
id: "A7.1",
name: "Cyrillic homoglyph squatting",
class: "Tool Squatting",
payload: json!({
"tool": "re\u{0430}d_file", "function": "read",
"parameters": {"path": "/tmp/test"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A7.2",
name: "Greek omicron squatting",
class: "Tool Squatting",
payload: json!({
"tool": "c\u{03BF}py_file", "function": "copy",
"parameters": {"src": "/tmp/a", "dst": "/tmp/b"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A7.3",
name: "Fullwidth Latin normalization",
class: "Tool Squatting",
payload: json!({
"tool": "\u{FF52}\u{FF45}\u{FF41}\u{FF44}_file", "function": "read",
"parameters": {"path": "/tmp/test"}
}),
check_fn: |_body: &serde_json::Value, _status: u16| -> bool {
_status != 500
},
},
AttackTest {
id: "A7.4",
name: "Mixed-script detection",
class: "Tool Squatting",
payload: json!({
"tool": "b\u{0430}sh", "function": "exec",
"parameters": {"command": "echo test"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A7.5",
name: "Levenshtein typosquatting",
class: "Tool Squatting",
payload: json!({
"tool": "bassh", "function": "exec",
"parameters": {"command": "echo test"}
}),
check_fn: is_deny,
},
]
}