Woot20 Slides Ionescu
Woot20 Slides Ionescu
InfoSec Schools
Outline
Mitigations != Solutions
Parting Thoughts
Bug Bounty
Economy
Bugs at any Cost
• Finding bugs wasn’t always that obvious
• Few, if any, automated tools
• Little knowledge on how to find bugs
• Bugs without obvious exploits, or at least without a PoC
proving severity, were never prioritized
• The know-how on exploitation, and the various techniques
we now take for granted did not yet exist (i.e.: ROP)
Before the
Bug Bounty
And there wasn’t a legitimate, paid, public, identifiable mechanism
for those who had these skills to submit vulnerabilities – so most of
them went to black market exploit brokers
•
how you usually feed a family!
In many cases, developers actively refuse to fix security
Resources
issues, even if you give them a pull request
• Slows things down, adds compatibility issues
• It’s OK – the government is here to help you
• In the EU, there’s now up to 1M EUR being offered
as bug bounty money for various “critical” FOSS
projects
• But nobody is paying the developers for the fixes
Nationalized
• Who will even triage the bugs? Bug Bounties
• Software isn’t lacking in bugs, it’s lacking in quality
and security – finding more bugs doesn’t fix that
Cyber Schools
Learning to break, not build
There’s now more and more 17-year-old kids with their
OWASP, MCSE, A+, CISSP
schools and programs which finding $5,000.00 US bugs
each month, maybe hitting
are only teaching offensive a $25,000.00 jackpot
security and bug finding occasionally
• I pointed out how outside of the human element (code reviews), everything from a
static analyzer, to the world’s simplest fuzzer should’ve caught this
• A more important point that was missed was me asking – why does such a function even need
to be a system call?
• The bug was in the population of temporal_idx, which could have values as
high as 7 since 3 bits from the stream were parsed
• This was fixed, but to this day, there’s still not a single assert()
anywhere in the array dereferences
NtCreateEnclave
• One of a half-dozen recent finds by Waleed Assar:
NTSTATUS NtCreateEnclave(..., void** BaseAddress, size_t InfoLength) {
if (InfoLength != 0) {
if (ExGetPreviousMode() == UserMode) {
ProbeForWritePointer(BaseAddress);
}
}
status = MiCreateEnclave(..., &localBase);
Exit:
if (NT_SUCCESS(status)) {
*BaseAddress = localBase;
}
return status;
}
• Each of these bugs had code reviews, static analysis, and fuzzers running
• “Someone forgot to add the function to the fuzzer (it’s a manual
process)”
• “The fuzzer doesn’t run on SGX/HVCI hardware”
• “It takes 3 months to look at the fuzzer’s output – we’re backlogged”
• “Warning level 4 isn’t enabled for this project”
• “We prioritize fuzzing brand-new or really old code, not recent code”
• “Nobody thought about fuzzing this attack surface”
• “The servicing team’s guiding principle is to minimize the lines of code
and impact of any fix”
It’s OK!
* I’m not suggesting these are bad or invalid ideas, but they attack the symptom, not the disease
Crazy Thoughts For a better future?
• Let’s not repeat the mistakes of the past
• Microsoft lowering their bug bounties may lead to a return to black
market growth…
• The complete and total lack of security awareness in the 70ies and 80ies is
what led to today’s insecure code, tooling, and mentalities
• I’m not advocating some nostalgic return to the days of yore!
•
Education? But my college-aged friends are still learning strcpy
• The ones are ivy-league schools where they teach C – otherwise
they’re probably learning OSString::Copy(OSString*) or
worse, not learning about strings at all)
• We need to revolutionize computer science instruction in schools
• Most of it is outdated, useless, and insecure
• I hope Google’s 6-month program addresses this – and doesn’t make
it worse
• The mechanical engineering equivalents of the computer
bugs shown earlier, in a bridge design, would amount to
criminal negligence
• Using high-school level formulas for objects in free-fall
(ignoring air resistance, etc.) – the equivalent of strcpy in
aeronautics – would get you stripped of your license
Licensing & • I’m not advocating for “you need a special license and degree
to use a compiler and innovate in the Valley” – this is the
Training? common strawman
• But maybe, just maybe, if you hire people to write
software that runs on 1B+ devices, they should have
some training & responsibility?
• Pilots can’t fly random planes whenever they want to,
even after finishing flight school – and they need to keep
their skills updated yearly
• I’m not saying reverse engineering / bug finding isn’t creative…
• … but it’s fundamentally a process of taking someone else’s
work apart
• If everyone gets paid $300K a year and is guaranteed a job, taking
stuff apart…
• …it follows that nobody will want to get paid $50K a year
Incentivize struggling to find a job to build stuff
• Yes, our society has loads of highly difficult, laborious, underpaid
Creativity? jobs, contrasted with certain high-paying blue-collar jobs that are
“easy”
• But they’re usually somewhat balanced with education, and
never in direct inverse relationship with each other
• How about “code bounty” programs?
• “Pay for the fix, not the bug” – such programs are now
starting!
• We live in a highly polarized society these days and everyone
wants to violently agree or disagree with an extreme viewpoint
• “Alex says fuzzers are bad and bug bounties are bad”
Conclusion • The right economic model of how and when to pay for people finding bugs