Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.
  • Home Home Home, current page.
  • Moments Moments Moments, current page.

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
andreasdotorg's profile
andreasdotorg
andreasdotorg
andreasdotorg
@andreasdotorg

Tweets

andreasdotorg

@andreasdotorg

I'm a hacker, pretty much in the old school sense of the word. But I do know IT security too.

Joined April 2008

Tweets

  • © 2018 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    1. Don A. Bailey‏ @DonAndrewBailey May 3

      Me: OpenSSH is one of the most secure apps ever written, even in C C Haters: no it’s not! Several RCE bugs! Me: prove it. Show me a working exploit. *crickets* FUD and Security pedanticism is unbecoming of our insustry, Pals.

      23 replies 109 retweets 386 likes
    2. andreasdotorg‏ @andreasdotorg May 3
      Replying to @DonAndrewBailey

      https://dl.packetstormsecurity.net/1106-exploits/ssh_preauth_freebsd.txt …

      4 replies 0 retweets 7 likes
    3. Don A. Bailey‏ @DonAndrewBailey May 3
      Replying to @andreasdotorg

      That’s a good one and valid, but not one of the bugs anyone else has brought up 😂. Besides, having bugs isn’t the issue. Resolving, reducing, and remaining well architected is the point.

      1 reply 0 retweets 4 likes
    4. andreasdotorg‏ @andreasdotorg May 3
      Replying to @DonAndrewBailey

      Yep. And choosing a language that eliminates whole classes of exploitable vulnerabilities is part of good architecture in my book. I won't deny that OpenSSH is comparatively well written. But writing C is much harder than most people realize. Undefined behaviour everywhere.

      1 reply 1 retweet 20 likes
    5. Don A. Bailey‏ @DonAndrewBailey May 3
      Replying to @andreasdotorg

      Yeah no one is disagreeing. Ignoring better options isn’t the point. Acknowledging that good architecture is a choice is. It isn’t really “harder” now, either. In fact it’s easier today to write safe C than ever before. We know more & have better tools/OS guards. It’s easy now :)

      1 reply 0 retweets 3 likes
    6. andreasdotorg‏ @andreasdotorg May 3
      Replying to @DonAndrewBailey

      Easy really is the wrong word here. And there's still stuff sanitizers and static analyzers don't see. There's still exploits despite mitigations. In most cases, there's just no need to waste cognitive load on low level details. Higher level languages are more economical.

      1 reply 0 retweets 8 likes
    7. Don A. Bailey‏ @DonAndrewBailey May 3
      Replying to @andreasdotorg

      I’m one of the best when it comes to finding 0day in C. :) but I know it’s easy now, to write safe C. You can disagree all you want, but the tools and mitigation’s are available. Our industry failure is not making access simple and straight forward.

      2 replies 0 retweets 2 likes
      andreasdotorg‏ @andreasdotorg May 3
      Replying to @DonAndrewBailey

      #define SIZE 8192 char buf[SIZE]; void cpy(struct foo* p, int count) { int n = count * sizeof(struct foo); if ((n < SIZE) && (n > 0)) memcpy(buf, p, n); } Safe or not? Why? How many people can spot this? Which tools? Far from easy.

      11:31 PM - 3 May 2018
      • 1 Retweet
      • 10 Likes
      • CertSimple 🛂 siofaw Anyfun Frederick Ollinger Henry B. Patrick Toomey Mallory ダークソール
      6 replies 1 retweet 10 likes
        1. New conversation
        2. Don A. Bailey‏ @DonAndrewBailey May 3
          Replying to @andreasdotorg

          Creating situations that are easily avoidable doesn’t prove your point, it proves mine. :)

          1 reply 0 retweets 3 likes
        3. andreasdotorg‏ @andreasdotorg May 4
          Replying to @DonAndrewBailey

          What about the situation in the above code is easy to avoid? I've shown the snippet to rooms full of people who do code audits for a living. Maybe 1 in 30 even gets what the problem is. Regular engineers? Zero out of 30.

          5 replies 0 retweets 2 likes
        4. Don A. Bailey‏ @DonAndrewBailey May 4
          Replying to @andreasdotorg

          That’s total nonsense. No one that does professional code auditing would miss that. It’s the most basic C issue. I feel like you’re just trying hard to make your point. There are far more serious undefined issues. Evading this is cake.

          2 replies 0 retweets 4 likes
        5. Don A. Bailey‏ @DonAndrewBailey May 4
          Replying to @DonAndrewBailey @andreasdotorg

          A majority of my public exploits since ~2005 have come from this class. See the LZ4/LZO bug from 2014 as an example.

          3 replies 0 retweets 0 likes
        6. Kyle 'esSOBi' Stone‏ @essobi May 4
          Replying to @DonAndrewBailey @andreasdotorg

          *COUGH*INDUSTRYFULLOFCHARLATANS*COUGH* Computers are magic rocks that we tricked into counting time and doing math really fast with lightning. 😂

          1 reply 1 retweet 3 likes
        7. Don A. Bailey‏ @DonAndrewBailey May 4
          Replying to @essobi @andreasdotorg

          Worse issue: evaluate pointer arithmetic in kernel land and tell me if the kernel can correctly verify whether a pointer will be dereferenced in userland or kernel land ;)

          1 reply 0 retweets 1 like
        8. Don A. Bailey‏ @DonAndrewBailey May 4
          Replying to @DonAndrewBailey @essobi @andreasdotorg

          “Professional code auditors” not grokking this stuff is because infosec “professionals” are not engineers. So maybe engineers who write C for a living should be respected a bit more.

          1 reply 0 retweets 6 likes
        9. Don A. Bailey‏ @DonAndrewBailey May 4
          Replying to @DonAndrewBailey @essobi @andreasdotorg

          Just because a bunch of infosec pros don’t get this means nothing to me when infosec pros can’t code for crap.

          0 replies 2 retweets 5 likes
        10. End of conversation
        1. New conversation
        2. Luis Servin‏ @lfservin May 4
          Replying to @andreasdotorg @DonAndrewBailey

          I might be in the zero category. What seems to be the problem? Is it that in the function declaration foo pointer is not declared const? Or is SIZE the problem?

          1 reply 0 retweets 0 likes
        3. andreasdotorg‏ @andreasdotorg May 4
          Replying to @lfservin @DonAndrewBailey

          Overflow of signed integers is undefined. It is usually twos complement behaviour, as the underlying hardware. However, the compiler has leeway with optimizations. Compile the above with gcc -O0, and it generates safe code. Compile with -O3, gcc eliminates the bounds check!

          3 replies 1 retweet 1 like
        4. Luis Servin‏ @lfservin May 4
          Replying to @andreasdotorg @DonAndrewBailey

          So, if I understand correctly, n could overflow by choosing a big enough count and a big-sized struct foo. Now I see it. Thx

          1 reply 1 retweet 1 like
        5. andreasdotorg‏ @andreasdotorg May 4
          Replying to @lfservin @DonAndrewBailey

          You'd think that this would be covered by checking whether n is less than zero, which it would be if it overflowed, right? The gotcha here is that it isn't, due to interaction with the optimizer.

          0 replies 1 retweet 2 likes
        6. End of conversation
        1. New conversation
        2. (void *) &saleem‏ @spudowiar May 4
          Replying to @andreasdotorg @DonAndrewBailey

          What's the issue with that code? It should be an unsigned overflow because of the integer promotion, so there shouldn't be any undefined behaviour as far as I can tell?

          2 replies 0 retweets 1 like
        3. andreasdotorg‏ @andreasdotorg May 4
          Replying to @spudowiar @DonAndrewBailey

          Yup, I screwed that one up. Might post an actually UB example later (really, just pass the element size as an int parameter to get it).

          1 reply 0 retweets 0 likes
        4. (void *) &saleem‏ @spudowiar May 4
          Replying to @andreasdotorg @DonAndrewBailey

          But you're not demonstrating undefined behaviour, you're demonstrating using the wrong type for the job (int rather than size_t)

          1 reply 0 retweets 0 likes
        5. andreasdotorg‏ @andreasdotorg May 4
          Replying to @spudowiar @DonAndrewBailey

          The UB follows from that mistake. It's easy to make though, once the type is hidden behind a typedef, or some API chooses to use negative values for error codes.

          1 reply 0 retweets 0 likes
        6. (void *) &saleem‏ @spudowiar May 4
          Replying to @andreasdotorg @DonAndrewBailey

          Right, but I don't believe this is something that is a surprise to most engineers and auditors. Sure, the actual issues resulting from it might, but checking the types are appropriate (e.g. size_t/ssize_t for sizes and counts) is an important and well-known step.

          1 reply 0 retweets 0 likes
        7. andreasdotorg‏ @andreasdotorg May 4
          Replying to @spudowiar @DonAndrewBailey

          The argument is not that it is impossible to write correct code. Just that it takes effort and skilled people. It's still hard to get right, and easy to get wrong.

          1 reply 0 retweets 0 likes
        8. (void *) &saleem‏ @spudowiar May 4
          Replying to @andreasdotorg @DonAndrewBailey

          The only undefined behaviour that I've seen catch someone out (although it didn't cause any actual issues in practice, with any optimization level) was the left-shift casting to a 32-bit signed integer (e.g. (0x80 << 24) is an int, rather than an unsigned int).

          1 reply 0 retweets 0 likes
        9. (void *) &saleem‏ @spudowiar May 4
          Replying to @spudowiar @andreasdotorg @DonAndrewBailey

          Now, my point is that this undefined behaviour that you're talking about generally does not catch out engineers (especially with warnings emitted by modern compilers). I understand what you're trying to say but I don't find your examples compelling.

          0 replies 0 retweets 2 likes
        10. End of conversation

      Loading seems to be taking a while.

      Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

        Promoted Tweet

        false

        • © 2018 Twitter
        • About
        • Help Center
        • Terms
        • Privacy policy
        • Cookies
        • Ads info