It's this time of the year again

Yeah, welcome to the 2012 edition of the full disclosure debate!


As usual, there are reasonable people who disagree about the merits of non-coordinated disclosure; a more recent trend is to debate the value of developing and publishing exploits, even for already patched bugs. The short-term risks are pretty clear to any sensible person: there is robust data to show that the availability of functioning exploits drives a good chunk of low-tier, large-scale attacks.


The long-term benefits are more speculative. I like to think of it as a necessary evil: non-disclosure does not prevent sophisticated and resourceful attackers from developing their own exploits and going after high-value targets, but it quickly leads to complacency when it comes to fixing the underlying problems and monitoring your infrastructure. We would not have Windows Update, silent autoupdates in Chrome, or MacOS X ASLR improvements weren't it for the constant stream of public exploits and the accompanying attacks.


The cost-benefit calculation here is mostly a matter of personal taste, and we won't be able to settle it any time soon. I'm a bit on the fence, too: I am at best ambivalent about the merits of exploit packs and frameworks such as CORE Impact or Metasploit. I am also deeply uncomfortable with exploit trading, a trend all-too-eagerly embraced and supported by the industry.


But the merits of the debate aside, there is a disturbing propensity for parties who struggled with security response, and have sometimes adopted openly hostile tactics to suppress security research, to be on the front lines of the anti-disclosure movement. This is why I couldn't help but find parallels between Brad Arkin's recent statements, and a position taken ten years ago by Scott Culp. Brad says:


"My goal isn't to find and fix every security bug. I'd like to drive up the cost of writing exploits. But when researchers go public with techniques and tools to defeat mitigations, they lower that cost. [...] Too much attention is being paid these days to responding to vulnerability reports instead of focusing on blocking live exploits."


"[We need to] work closer with the research community to curb the publication of information that can help malicious hackers. [...] Something hard becomes very very easy. These exploits and techniques are copied, adapted and modified very cheaply."


We all agree that bug-free products are not a realistic goal, but reducing the availability of information is probably also an ill-advised one. If it's still possible to write an exploit, and just "expensive" to do so - for example, because the knowledge on how to bypass ASLR is not common - then indeed, unskilled attackers will be less likely to go after your mom's credit card information; but going after her bank will be a fair game.


As for unintended consequences: in this scenario, the bank no longer has to deal with a steady stream of nuisance malware, so they probably care less about patching and monitoring, and the attacker is more likely to succeed.


Sure, one shouldn't be running on a vulnerability response treadmill. We can escape it to some extent simply by making the process more agile and lightweight. It is also very important to reduce the likelihood of malicious exploitation, but we should do so by tweaking factors other than the "cost" of acquiring domain-specific knowledge. We should embrace proactive approaches such as sensible coding practices, developer education, fuzzing, or tools such as ASLR, JIT randomization, and sandboxing - and when something slips through the cracks, we need to be thankful for the data point and simply make our solution more robust. Let's not obsess about what specific flavor of disclosure policies the researchers believe in: they haven't sold it to the highest bidder, and that's already pretty good.


"We have patched hundreds of CVEs over the last year. But, very, very few exploits have been written against those vulnerabilities. Over the past 24 months, we’ve seen about two dozen actual exploits."


That's a frighteningly high number of exploits, by the way.

Robin Hood-skatten

En ny avgift på finanstransaksjoner planlegges i EU. Avgiften kalles av mange for en Robin Hood-skatt. I sagnet representerer Robin en stor utfordring for sheriffen av Nottingham. For dagens investorer vil imidlertid en skatt på finanstransaksjoner være lett å unngå.

I følge Ernst & Youngs utsikter for europeisk finansnæring neste halvår kan en transaksjonsskatt komme til å koste europeiske skattebetalere dyrt. Storbritannia, som årlig eksporterer finansielle tjenester tilsvarende 2,6% av BNP i følge The Economist, kommer imidlertid til å legge ned veto mot den. I forrige uke slo likevel frankrikets europaminister fast at Frankrike og Tyskland uansett ville innføre skatten innen utgangen av året.

Tilhengerne av en finansskatt har lenge manglet et godt problem for sin løsning. En stund ble det argumentert med at en slik skatt ville gi mer stabile finansmarkeder. Nå viser imidlertid forskningen at en slik avgift ikke har noen stabiliserende effekt. Tvert imot peker mye i retning av at når mesteparten av handelen i et verdipapir fjernes så vil markedet miste evne til å absorbere selv beskjedene ordrevolum. Prisene blir derfor mindre og ikke mer stabile. Det er da også dette EU-kommisjonens konsekvensutredning konkluderer med. Man må derfor være nokså hemningsløs fan av finanstransaksjonskatt for å klare å overbevise seg selv om at verden trenger dette.

Det største problemet med en finansskatt er at skattegrunnlaget har en tendens til å rømme. 90% av derivathandelen forsvant til London når Sverige gjorde et eksperiment med en slik skatt på 80-tallet. Kommisjonen har naturligvis tenkt på dette, og regner med at 70-90% av derivathandelen vil forsvinne. Men med dagens elektroniske plattformer og internett er det mye enklere å flytte handel til utlandet enn det var i Sverige på 80-tallet. Kommisjonens antakelser kan derfor være noe konservative.

Årsaken til at enkeltland likevel vurderer å innføre skatten unilateralt er at kommisjonen har funnet en snedig måte å implementere skatten på som skal gjøre det vanskelig å unngå den. Skatten belastes basert på hvilket land personen eller selskapet bak transaksjonen er registrert og ikke hvor transaksjonen finner sted. Det betyr at alle transaksjoner av et lands borgere eller selskap beskattes, enten de skjer i Frankfurt eller New York. Det vil derfor i prinsippet ikke være mulig for en person å unndra seg beskatning ved å flytte transaksjonene utenlands.

Dersom transaksjonen går gjennom et amerikansk selskap vil den imidlertid være underlagt amerikansk lov og beskatning. EU har jo ikke jurisdiksjon til å beskatte amerikanske selskaper. Kostnaden ved å opprette et slikt selskap vil være neglisjerbar sammenlignet med transaksjonsskatten, som er på 0,1% av investeringsbeløpet.

Om en slik skatt mot formodning skulle bli innført, ville resultatet derfor bli en massiv flytting av transaksjoner over Atlanteren. Dette er ikke en hypotetisk trussel. Her kan finansinstitusjoner og privatpersoner velge om de ønsker å betale skatt eller ikke. De fleste vil nok dessverre velge sistnevnte alternativ. Kommisjonen diskuterer naturligvis dette problemet i sin konsekvensutredning, men kommer ikke med noen løsning. Det skyldes nok at det ikke finnes noen.

Kommisjonen forventer at tiltaket vil redusere BNP med 0,5-1,8 %, hvilket vel neppe er hva EU trenger nå, så hva er hensikten med denne selvpiningen? Jo, kommisjonen vil beskatte finansbransjen hardere på grunn av de kostnader den har påført og kanskje vil påføre samfunnet. Det er et legitimt mål. Det kan imidlertid oppnås på mange måter. Det er uklart hvorfor man ønsker den dyreste og mest destruktive løsningen.


Robin Hood-skatt:
  • En liten skatt på finansielle transaksjoner for å redusere handel/spekulasjon i finansielle verdipapir.
  • Kalles gjerne Tobinskatt når den rettet mot valutatransaksjoner spesielt.
  • For en langsiktig investor som skal eie en aksje lenger enn ett år vil skatten være ubetydelig.
  • For en kortsiktig investor/daytrader vil skatten kunne spise opp over 20% av investeringsbeløpet i løpet av et år.
  • Med kun langsiktige investorer igjen i markedet vil likviditeten forvitre og risikoen øke.

p0f is back!

I decided to spend some time rewriting and greatly improving my ancient but strangely popular passive fingerprinting tool:



Version 3 is a complete rewrite, bringing you much improved SYN and SYN+ACK fingerprinting capabilities, auto-calibrated uptime measurements, completely redone databases and signatures, new API design, IPv6 support (who knows, maybe it even works?), stateful traffic inspection with thorough cross-correlation of collected data, application-level fingerprinting modules (for HTTP now, more to come), and a lot more.

Notes about the post-XSS world

Content Security Policy is gaining steam, and we've seen a flurry of other complementary approaches that share a common goal: to minimize the impact of markup injection vulnerabilities by preventing the attacker from executing unauthorized JavaScript. We are so accustomed to thinking about markup injection in terms of cross-site scripting that we don't question this approach - but perhaps we should?


This collection of notes is a very crude thought experiment in imagining the attack opportunities in a post-XSS world. The startling realization I had by the end of that half-baked effort is that the landscape would not change that much: The hypothetical universal deployment of CSP places some additional constraints on what you can do, but the differences are not as substantial as you may suspect. In that sense, the frameworks are conceptually similar to DEP, stack canaries, or ASLR: They make your life harder, but reliably prevent exploitation far less frequently than we would have thought.


Credit where credit is due: The idea for writing down some of the possible attack scenarios comes from Mario Heiderich and Elie Bursztein, who are aiming to write a more coherent and nuanced academic paper on this topic, complete with vectors of their design, and some very interesting 0-day bugs; I hope to be able to contribute to that work. In the meantime, though, it seems that everybody else is thinking out loud about the same problems - including Devdatta Akhawe and Collin Jackson - so I thought that sharing the current notes may be useful, even if the observations are not particularly groundbreaking.

X-Frame-Options, or solving the wrong problem

On modern computers, JavaScript allows you to exploit the limits of human perception: you can open, reposition, and close browser windows, or load and navigate away from specific HTML documents, without giving the user any chance to register this event, let alone react consciously.


I have discussed some aspects of this problem in the past:
my recent entry showcased an exploit that flips between two unrelated websites so quickly that you can't see it happening; and my earlier geolocation hack leveraged the delay between visual stimulus and premeditated response to attack browser security UIs.


A broader treatment of these problems - something that I consider to be one of the great unsolved problems in browser engineering - is given in "The Tangled Web". But today, I wanted to showcase another crude proof-of-concept illustrating why our response to
clickjacking - and the treatment of it as a very narrow challenge specific to mouse clicks and <iframe> tags - is somewhat short-sighted. So, without further ado:


There are more complicated but comprehensive approaches that may make it possible for web applications to ensure that they are given a certain amount of non-disrupted, meaningful screen time; but they are unpopular with browser vendors, and unlikely to fly any time soon.

Fortsatt gambling

I sitt tilsvar til meg i DN i går fortsetter Bjørn Nesse Hunderi å argumentere for at kraftaksjer er så fantastiske investeringer for norske kommuner at vi må ha en lov som påtvinger dem eierskap.


Det er imidlertid fortsatt slik at både empiri og teori tilser at en mer spredt investering gir høyere avkastning i forhold til risiko enn eierskap i én enkelt bedrift.

Hunderi forklarer oss videre at Troms Krafts sørgelige svenske eventyr kunne vært unngått om bare man hadde forstått at man ikke burde investere i utlandet. Dette er en ad hoc argumentasjon som er veldig enkel å komme med i ettertid. Alle slike saker har noe spesielt ved seg, så en vil alltid kunne bortforklare dem som særtilfeller.

Så lenge Hunderi ikke framsatte denne kritikken for ti år siden blir imidlertid disse bortforklaringene helt uinteressante. All næringsvirksomhet innebærer risiko for tap. Kraftselskap er dessverre ikke noe unntak.

Det eneste som gjenstår av argumenter er dermed at kommunene må tvinges til ikke å bruke opp investeringene på forbruk. Det kan være fornuftig, men dersom dette er hovedproblemet så burde man vel ha en lov som regulerer akkurat det? Å lovregulere at kommuner skal ta stor risiko ved å eie kraftselskaper når målet er at de ikke skal bruke for mye penger virker lite treffsikkert.

The old switcharoo

Another tiny proof-of-concept for the day:



While the idea is fairly trivial, it seems pretty frightening to me - and neatly illustrates one of the points I'm making in
The Tangled Web. I highly doubt that even the most proficient and attentive users would be able to spot this happening in the wild.


(If you don't get it, try again, and follow instructions on the screen.)


Interesting results can be also achieved in some browsers with history.back(), but I'll leave this as an exercise for readers. The same goes for the implications it has for clickjacking, drag-and-drop, and other attacks normally associated with frames.


PS. Another silly proof-of-concept as a bonus: click here.