flash/nor/nrf5: fix protection setting on nRF51
[fw/openocd] / src / server / startup.tcl
index 64ace40795e35a26033a8f6f69027f495a9e5cfc..dd1b31e417dd15942a3906dbf3b25a5734aa062e 100644 (file)
@@ -8,3 +8,14 @@ proc ocd_gdb_restart {target_id} {
        # one target
        reset halt
 }
+
+proc prevent_cps {} {
+       echo "Possible SECURITY ATTACK detected."
+       echo "It looks like somebody is sending POST or Host: commands to OpenOCD."
+       echo "This is likely due to an attacker attempting to use Cross Protocol Scripting"
+       echo "to compromise your OpenOCD instance. Connection aborted."
+       exit
+}
+
+proc POST {args} { prevent_cps }
+proc Host: {args} { prevent_cps }