Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    S

    Sergey Bratus

    cs.dartmouth.edu/~sergey · Personal blog · on HN since 2012

    Sergey Bratus, a Dartmouth computer science researcher, writes on language-theoretic security, weird machines, and exploit programming.

    Visit blogHN submissions
    SecurityLanguages & Compilers
    What HN says

    HN cites his langsec work on input validation and 'weird machines' when discussing parsing flaws, exploits, and CPU bugs.

    Stats for nerds
    27HN people shared it
    13linked in comments
    89story points
    Nov 2021last shared
    2012people per year2021

    Top posts on HN

    1. 1
      Remote Code Execution Through Intel CPU Bugs (2008) [pdf]
      5 people · 44 points · first shared 2012 · Discussion on HN
    2. 2
      Langsec explained in a few slogans
      6 people · 18 points · first shared 2012 · 15 comments on HN
    3. 3
      'Borrowing' computation for fun and profit
      3 people · 7 points · first shared 2017 · 1 comments on HN
    4. 4
      The Wassenaar Arrangement’s intent fallacy [pdf]
      1 person · 7 points · first shared 2015 · Discussion on HN
    5. 5
      Exploit Programming: from Buffer Overflows to Weird Machines
      2 people · 4 points · first shared 2012 · Discussion on HN
    6. 6
      What hackers learn that the rest of us don't [pdf]
      1 person · 3 points · first shared 2017 · Discussion on HN
    7. 7
      Language Theoretic Security
      7 people · 2 points · first shared 2012 · Discussion on HN
    8. 8
      Intra-Process Memory Protection for Applications on ARM and X86 [pdf]
      1 person · 2 points · first shared 2016 · 1 comments on HN
    9. 9
      Shotgun parsers in the cross-hairs
      1 person · 1 points · first shared 2013 · Discussion on HN
    10. 10
      The Solaris Operating System on X86 Platforms (2005) [pdf]
      1 person · 1 points · first shared 2018 · Discussion on HN

    What HN people wrote when they linked it

    • tripzilchJan 2013

      There was this recent security presentation about formal language-theoretic reasons why message-length prefixes are a bad idea. http://www.cs.dartmouth.edu/~sergey/langsec/

      The problem was that it causes unnecessary complexity in validation and parsing, as <length-of-message><message>... describes a context-sensitive grammar, while a more XML-, JSON-like syntax with delimiters <delim><message></delim>... is context-free. The complexity of proper CSG validation can be exploited for resource-depletion/DOS attacks, while not validating the syntax of a message leaves part of the program that uses the data in these messages with potentially invalid data, putting it into an inconsistent state, possibly leading to DOS or worse exploits.

      At least that's what I got from their presentation, which was very interesting BTW, especially the part about "weird machines"--that's basically the inconsistent state, the emergent machine that is made out of all the things an attacker can make a system do by exploiting it. It was also extremely geeky.

      It just left me wondering: if I understood this right, every protocol that uses message-length prefixes is at least vulnerable to resource-depletion attacks, and there's no way of solving this short of proving P=NP. But that's quite a lot of protocols! Why isn't the Internet burning down as we speak?

    • carussellApr 2014

      I think gpcz was suggesting something more along the lines of an entirely new approach to protocol implementation, like VPRI's TCP/IP stack that Jeff Moser describes[1], rather than just swapping out C for something else while keeping the hand-written aspect.

      > Let's say we want to build the TCP/IP stack of an operating system. A traditional implementation might take 10,000 lines of code. What if you rethought the design from the ground up? What if you could make the IP packet handling code look almost identical to the RFC 791 diagram which defines IP?

      If the industry as whole could agree on this approach in a move similar to the Dijkstra/structured programming move that happened a few decades back, the sort of verifiable interoperability + security that Meredith Patterson and Sergey Bratus (who you may recognize from Occupy Babel![2]) call for would be closer to reach[3].

      1. Jeff Moser. Towards Moore's Law Software: Part 3 of 3. https://www.youtube.com/watch?v=UzjfeFJJseU

      2. Occupy Babel!. http://www.cs.dartmouth.edu/~sergey/langsec/occupy/

      3. Meredith Patterson. LANGSEC 2011–2016. https://www.youtube.com/watch?v=UzjfeFJJseU

    • bmn__Nov 2021

      > Naive question: is it viable if we started using [a Turing-complete programming language]

      This is actually a good question. The people who are not asking and going right ahead with that plan are doing a dangerous thing. <https://www.cs.dartmouth.edu/~sergey/langsec/occupy/> It's not viable because a subset of people would like to have the following properties upheld:

      • Parsing configuration should be decidable and finish in finite time.

      • Parsing configuration should not be a security exploit.

      • I should not have to implement the Emacs runtime just to parse its configuration file.

      > something that's both more flexible but still strict and unambiguous. I wonder if it's possible?

      This really depends on what you mean by these words; I'm interested to hear your idea in detail. Meanwhile, have a look at Dhall <https://dhall-lang.org/> and the other languages mentioned in <https://news.ycombinator.com/item?id=29221643> and compare.

    • noblethrasherFeb 2015

      Sorry, I should have made it more explicit that I'm just talking about the stuff at the edges. For instance, we can do this with something like a TCP library just by evaluating it against the state machine published in the RFC. Similarly, custom protocols are ultimately just state machines, and it's easier to effect secureness when you limit the protocol to a regular or context-free grammar[1]. But, if the vendor insists that their protocol needs a more powerful grammar, then at least we can start talking about security/feature trade-offs in formal terms (i.e. vendors would have to justify their decisions with math and computer science instead of feature checkboxes and pricing psychology).

      [1] http://www.cs.dartmouth.edu/~sergey/langsec/

    • pdkl95Jun 2017

      > Robustness_principle

      A slight variation on this is important for security. Be liberal in what you accept, but define what "liberal" means. It's important to define what counts as a valid input. If you don't have a validation/recognizer verify that the input is acceptable, you are probably creating a "weird machine"[1] waiting to be exploited in ways you didn't expect.

      I highly recommend Meredith and Sergey's talk[2][3] at 28c3, "The Science of Insecurity", where they explain this from a language-theoretic perspective.

      [1] http://www.cs.dartmouth.edu/~sergey/wm/

      [2] https://media.ccc.de/v/28c3-4763-en-the_science_of_insecurity

      [3] http://www.cs.dartmouth.edu/~sergey/langsec/insecurity-theory-28c3.pdf

    • qb45May 2017

      > This begs the question: if old features are this broken, what about the new ones

      You can find so called "specification updates", which - as the name implies - update the specs to match actually released hardware ;)

      Available for all CPU families from both Intel and AMD, easily go into tens or hundreds of positions. (Though I haven't seen the Ryzen one released yet).

      And then somebody recently linked this (2010) - allegedly there are bugs exploitable for privilege escalation:

      http://cs.dartmouth.edu/~sergey/cs258/2010/D2T1%20-%20Kris%20Kaspersky%20-%20Remote%20Code%20Execution%20Through%20Intel%20CPU%20Bugs.pdf

    Related

    Philip Guopgbovine.net132 people

    Please don't denigrate what a beginner is currently learning

    Philip Guo
    Personal · last shared 2020
    Pointers Gone Wildpointersgonewild.com88 people

    The internet changed my life

    Pointers Gone Wild
    Personal · last shared 2026
    Jeremy Sieksiek.blogspot.com15 people

    Crash Course on Notation in Programming Language Theory

    Jeremy Siek
    Personal · last shared 2024
    Faré Rideaufare.tunes.org37 people

    Who controls your computer? and how to make sure it's you

    Faré Rideau
    Personal · last shared 2026
    Lawrence Kestelootteamten.com132 people

    Java for Everything

    Lawrence Kesteloot
    Personal · last shared 2026
    David Madoremadore.org/~david48 people

    Quines: self-replicating programs (2005)

    David Madore
    Personal · last shared 2025
    Russ Coxresearch.swtch.com554 people

    Timeline of the xz open source attack

    Russ Cox
    Personal · last shared 2026
    j00ruj00ru.vexillium.org47 people

    Windows X86-64 System Call Table

    j00ru
    Personal · last shared 2025