Dangerous Errors
Podcast Posts Presentations Synthwave About
Podcast Posts Presentations Synthwave About
  • OWASP/ISSA Bletchley Park 2012, Graveyards & Zombies May 22, 2012
    The Path to HTML5

    The May 10th OWASP/ISSA meeting at Bletchley Park was a chance to discuss web security, but the bigger draw was visiting the home of British code-breaking during WWII. It was astonishing to realize how run down the buildings had become. The site's long-held secrecy ensured disrepair and inattention that is still being remedied. Never the less, it's one of the most rewarding 30-minute train trips you can take from London.

    On a different note, here are the slides for my presentation on Graveyards & Zombies -- observations on vulns that should have been quashed by good design, but continue to vex web security.

  • Security Summit 2012, HTML5 Unbound May 21, 2012

    Here are the slides for my recent HTML5 Unbound presentation at South Africa's 2012 Security Summit last week. Slides alone rarely convey the full story and leave many points ambiguous. As I settle back to my home time zone I'll post accompanying notes that provide more background on the ideas behind this presentation.

  • O[Utf-8]12 Mar 6, 2012

    Music has a universal appeal uninhibited by language. A metal head in Istanbul, Tokyo, or Oslo instinctively knows the deep power chords of Black Sabbath -- it takes maybe two beats to recognize a classic like "N.I.B." or "Paranoid." The same guitars that screamed the tapping mastery of Van Halen or led to the spandex hair excess of 80s metal also served The Beatles and Pink Floyd. And before them was Chuck Berry, laying the ground work with the power chords of "Roll Over Beethoven".

    All that from six strings and five notes: E - A - D - G - B - E. Awesome.

    Then there's the written word on the web. Thousands of symbols in 8 bits, 16 bits, and 32 bits. In ASCII, or US-ASCII as RFC 2616 puts it, or rather ISO-8859-1. Or UTF-8, which is easier to adopt because it's like an extended ASCII. On the other hand if you're dealing with GB2312 then UTF-8 isn't necessarily for you. Of course, in that case you should really be using GBK instead of GB2312. Or was it supposed to be GB18030?

    Character encodings get messy and confusing quickly. Our metal head friends like their own genre of müzik / 音楽 / musikk -- one word, three languages, many symbols. In this page, those symbols (or glyphs) share one encoding: UTF-8.

    You don't need to speak a language in order to work with its characters, words, and sentences. You just need Unicode. As Tim Berners-Lee put it,

    The W3C was founded to develop common protocols to lead the evolution of the World Wide Web. The path W3C follows to making text on the Web truly global is Unicode. Unicode is fundamental to the work of the W3C; it is a component of W3C Specifications, from the early days of HTML, to the growing XML Family of specifications and beyond.

    Unicode has its learning curve. With Normalization Forms. Characters. Code Units. Glyphs. Collation. And so on. The gist of Unicode is that it's a universal coding scheme to represent all that's to come of the characters used for written language; hopefully never to be eclipsed.

    The security problems of Unicode stem from the conversion from one character set to another. When home-town fans of 少年ナイフ want to praise their heroes in a site's comment section, they'll do so in Japanese. Yet behind the scenes, the browser, web site, or operating systems involved might be handling the characters in UTF-8, Shift-JIS, or EUC.

    The conversion of character sets introduces the chance for mistakes and breaking assumptions. The number of bytes might change, leading to a buffer overflow or underflow. The string may no longer be the C-friendly NULL-terminated array. Unsupported characters cause errors, possibly causing an XSS filter to skip over a script tag. A lot of these concerns have been documented (and here). Some have demonstrable exploits, as opposed to conceptual problems that run rampant through security conferences, but never see a decent hack.

    Unicode got more scrutiny when it was proposed for Internationalized Domain Names (IDN). Researchers warned of "homoglyph" attacks, situations where phishers or malware authors would craft URLs that used alternate characters to spoof popular sites. (Here's an example of JavaScript's early problems.)

    The first attacks didn't need IDNs. They used trivial letter substitution with look-alikes, such as swapping l (the letter L) and 1 (the number one) in dead1iestattacks.com. IDNs provided more sophistication by allowing domains with changes visually harder to detect like deạdliestattacks.com.

    What's been less well documented (from what I could find) is the range of support for character set encodings in security tools. The primary language of web security seems to be English based on the popular conferences and books. But useful tools come from all over. Wivet originated from Türkiye (here's some more UTF-8: Web Güvenlik Topluluğu). Sqlmap and w3af support Unicode. So maybe this is a non-issue for modern tools.

    In any case, it never hurts to have more "how to hack" tools in non-English languages or test suites to verify that the latest XSS finder, SQL injector, or web tool can deal with sites that aren't friendly enough to serve content as UTF-8. Or you could help out with documentation projects like the OWASP Developer Guide.

    Sometimes translation is really easy. The phrase for "heavy metal" in French is "heavy metal" -- although you'd be correct to use "Métal Hurlant" if you were talking about the magazine or movie. Character conversion can be easy, too. As long as you stick with a single representation. Once you start to dabble in the Unicode conversions from UTF-8, UTF-16, UTF-32, and beyond you'll be well-served by keeping up to date on encoding concerns and having tools that spare you the brain damage of implementing everything from scratch.

  • Parsing .NET ViewState Jan 27, 2012

    The JavaScript-based parser has been moved to a github repository.

    Background on parsing unencrypted ViewState is here followed by part two.

    .NET ViewState Byte Sequences

    Byte(s)Explanation
    0x02 [...]Unsigned integer, compose value from 7 bits of each following byte until leading 8th bit equals 0.
    0x0201 == 00000010 00000001 == 1
    0x027f == 00000010 01111111 == 127
    0x028101 == 00000010 10000001 00000001 == 1 + (1 << 7) == 129
    0x02a1b22a == 00000010 10100001 10110010 00101010 == 33 + (98 << 7) + (42 << 14) == 44052769
    0x03 [length] [...]Container of [length] Booleans
    0x05 [length] [...]String, a container of [length] bytes
    0x09RGBA component
    0x0B [...] 0x00String, usually NULL-terminated, i.e. read bytes until 0x00.
    0x0fPair (tuple of two objects)
    0x10Triplet (tuple of three objects)
    0x15 [length]Array of strings
    0x16 [length]Container of objects
    0x18Control state
    0x1b [12 bytes]Unit
    0x1e [length] [...]String (identical to 0x05)
    0x1f [number]String reference
    0x24 [36 bytes]UUID
    0x64empty node
    0x65empty string
    0x66Number 0
    0x67Boolean true
    0x68Boolean false
    0xff01ViewState preamble
    NotesThe number of elements in a container is defined by [length], which is one or more bytes interpreted as a number in the manner of 0x02.
    A container may be empty, i.e. [length] is 0x00.
  • The Twelve Web Security Truths Nov 16, 2011

    My current writing project has taken time away from adding new content lately. Here's a brief interlude of The Twelve Web Security Truths I've been toying with as a side project. They are modeled on The Twelve Networking Truths from RFC 1925.

    1. Software execution is less secure than software design, but executing code attracts actual users.
    2. The time saved by not using parameterized queries to build SQL statements should be used to read about using parameterized queries.
    3. Same Origin Policy restricts the DOM access and JavaScript behavior of content loaded from multiple origins. Malware only cares about plugin and browser versions.
    4. Content with XSS vulns are affected by the Same Origin Policy, which is nice for XSS attacks that inject into the site's origin.
    5. CSRF countermeasures like Origin headers mitigate CSRF, not XSS. Just like X-Frame-Options mitigates clickjacking, not XSS.
    6. Making data safe for serialization with JSON does not make the data safe for the site.
    7. There are four HTML injection vulns in your site today. Hackers will find two of them, the security team will find one, the dev team will introduce another one tomorrow.
    8. Deny lists miss the attack payload that works.
    9. A site that secures user data still needs to work on the privacy of user data.
    10. Hashing passwords with 1,000-round PBKDF2 increases the work factor to brute force the login page by a factor of 1. Increasing this to a 10,000-round PBKDF2 scheme provides an additional increase by a factor of 1.
    11. The vulnerabilities in "web 2.0" sites occur against the same HTML and JavaScript capabilities of "web 1.0" sites. HTML5 makes this different in the same way.
    12. A site is secure when a compromise can be detected, defined, and fixed with minimal effort and users are notified about it.
    13. Off-by-one errors only happen in C.
1 ... 20 21 22 23 24 ... 26

Dangerous Errors

  • zombie
  • mutantzombie
  • mutantzombie.bsky.app
  • SecurityWeekly

Cybersecurity and more | © Mike Shema