The Seven Turrets of Babel:
Data Format is Code's Destiny: Security Anti-Patterns Of Protocol Design.
Sergey Bratus with Falcon Momot Sven Hallberg Meredith L. Patterson
Data Format is Code's Destiny: Security Anti-Patterns Of Protocol - - PowerPoint PPT Presentation
The Seven Turrets of Babel: Data Format is Code's Destiny: Security Anti-Patterns Of Protocol Design. Sergey Bratus with Falcon Momot Sven Hallberg Meredith L. Patterson Economics Pen test, code audit "2+2" : 2 persons, 2
Sergey Bratus with Falcon Momot Sven Hallberg Meredith L. Patterson
weakness is evident
practices is more helpful than proof of exploitability
code / data format design:
input validation" etc.
2009$CWE/SANS$Top$25$ 2010$CWE/SANS$Top$25$ 2011$CWE/SANS$Top$25$ (and$s6ll$current)$
SQL, and web contexts (CWE-{78,79,89})
design, not description of one.
for security". But what does it mean?
running valid C on your system is not safe!
active, must be made "inert" to be safe
very hard, unless they are very simple.
can be verified
complete programs can't be verified
automatically verified
"Data format is code's destiny" "Everything is an interpreter (=parser)" "Every sufficiently complex input processor is indistinguishable from a VM running inputs as bytecode"
"trouble"/ weakness
Your program is a CPU/VM for adversary-controlled inputs You must prevent run-away computation (a.k.a. exploit) You must formulate & verify assumptions Even strict C.A.R. Hoare-style verification is brittle if any assumptions are violated
"Failure to communicate assumptions to interacting modules" P {M1 } R P' {M2} R' P'' {M3} R'' P''' {M4} R'''
Is the P { Q } R chain like this:
Input&
Processing:&&
no&raw&inputs&& &
Recognizer& for&input& language& Language grammar& Spec& Reject&& invalid& inputs& Only&valid/expected&inputs,& semanCc&acCons&past&this&line&
handing
invalid input
Christopher Ulrich, "Alchemy"
and spread across processing code
considered fully checked & safe to operate on
checked & which have been checked
SSL3_RECORD
HeartbeatMessage
hbtype payload
computation on my program?"
"regular or context-free, syntactically valid == safe"
complexity (Chomsky hierarchy)
Turing-complete inputs. Don't even try!
Project Robus: Master Serial Killer, Crain & Sistrunk, S4x14
Project Robus: Master Serial Killer, Crain & Sistrunk, S4x14
Project Robus: Master Serial Killer, Crain & Sistrunk, S4x14
Project Robus: Master Serial Killer, Crain & Sistrunk, S4x14
Project Robus: Master Serial Killer, Crain & Sistrunk, S4x14
consume input, validate it (correctly) & deserialize it
create well-typed objects
handling code (even if "sanitized")
given away to attacker
Egor Homakov ("Don't let YAML.load close to any user input"), ...
parameter to a string before passing it to Active Record"
CVE-2014-6271, CVE-2014-6277, CVE-2014-6278, CVE-2014-7169, CVE-2014-7186, CVE-2014-7187
Rich interpreter
Intended function
Input
Some kind
ad-hoc black- list filter
message is
CA sees (and signs) a different CN in CSR than client in the signed cert
different package structure than C++ installer (~signed vs unsigned ints in zipped stream)
(must deal with complexity of unzip before validating!)
P {Q} R chain of assumptions & checks breaks
is involved
computational behavior on your system.
become a part of the attacker's exploit machine
Don't give the attacker any of it.
handing
invalid input
Christopher Ulrich, "Alchemy"
4th IEEE Security & Privacy LangSec Workshop May 25, 2017 San Jose, CA http://spw17.langsec.org http://langsec.org Join us for