Social

Using View > Encoding can kill you (in a manner of speaking)

Here's an interesting tidbit: you should never use the View > Encoding menu in any browser unless you fully trust the visited website.


Picking an alternative encoding through that menu overrides the character set not only for the top-level document, but also for all the nested frames - even if they happen to be cross-domain or hidden from view. And that may very well enable the owner of the visited page to carry out an XSS attack against a random third-party application without your knowledge.


Most security researchers associate encoding-related XSS problems with UTF-7, a somewhat preposterous and unnecessary encoding scheme that, by design, allows overlong encoding of 7-bit ASCII values (with disastrous consequences for HTML parsing). Not all browsers support UTF-7, and users are not likely to make that choice in the aforementioned menu. So, we're fine, right?


Well, not exactly. Many other, still popular multi-byte encodings, including Shift JIS or EUC-*, are also fairly problematic: their parsers often suffer from character consumption bugs, and in contrast to UTF-8, relatively little attention has been given to cleaning this up.


For example, with forced Shift JIS, this input is likely to be exploitable:


<img src="http://fuzzybunnies.com/[0xE0]">
...this is still a part of the markup...
" onerror="alert('Hi mom!')" x="
...

Simple demo here.

Related Posts:

  • Slik kan oljefondet deles Høyre åpner for å dele opp oljefondet i to eller flere konkurrerende fond. Det er et godt forslag. Fondet bør deles i et indeksfond og et hedgefond.… Read More
  • BomskuddEUs finansskatt er en demokratisk suksess; velgerne vil ha den. Utover det er det vanskelig å finne noe godt å si om dette skatteforslaget. EUs foresl… Read More
  • Kommentar fra Auke Lont om finansskattAuke Lont kommenterer i dagens DN mitt innlegg om Finansskatt. Jeg er i hovedsak enig med Lont i at dersom en ønsker å skattlegge finanssektoren, så f… Read More
  • Sadowski on Bullard (Guest Post) About a year ago, Jim Bullard criticized the argument that that the Fed was missing on both sides of its dual mandate. Mark Sadowski (who should have … Read More
  • Selgin on GortonI learned a lot about financial crises from Gary Gorton's work in the area. His views on what went wrong during the recent crisis and what might be do… Read More

0 nhận xét:

Đăng nhận xét