Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. Anthropic wrote a blog post about their LLM finding 0days in open source projects.

Anthropic wrote a blog post about their LLM finding 0days in open source projects.

Scheduled Pinned Locked Moved Uncategorized
11 Posts 7 Posters 1 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • reverseics@infosec.exchangeR reverseics@infosec.exchange

    Anthropic wrote a blog post about their LLM finding 0days in open source projects. I reviewed the first vulnerability they reported, in OpenSC, and as far as I can tell the bug isn't even real? I think so anyway, otherwise I'll eat some humble pie.

    I was looking at the code at the time (so a few weeks ago, before opensc removed the strcat call and replaced with strlcat):

    https://github.com/OpenSC/OpenSC/blob/33ab343a5c7d80db8cbc17d26f0edbe9dcdae299/src/libopensc/card-piv.c

    The offending lines are around line 5145. According to anthropic, this is a buffer overflow found by their predictive text algorithm.

    But it's interesting to read the code and to read the context of the code. 'fp' is a string guaranteed to be 64 bytes in length, because of line 5138. This checks the strlen(fp) and if it isn't 64, the code exits with an error.

    So the math is: 'filename' is filled with a string that is at maximum 4096-64-2 bytes long == max 4030 bytes. This value (maximum 4030) is eventually passed to a strlcat() call inside of sc_get_cache_dir(), where it is used as the 'size' argument. This means that 'filename' has a maximum size of 4030 bytes when sc_get_cache_dir() exits.

    Then the code strcat's one byte (for the '/'), onto the 'filename' buffer, then 64 more bytes (for the 'fp' string) onto 'filename' buffer, meaning the buffer cannot be overflowed because the maximum string length is now 4095 (the last byte being a null terminator).

    So, anthropic's LLM probably spent 4 seconds 'finding' this 'vulnerability'. I spent about an hour looking at the code to debunk their finding (really 20 minutes looking at the code, followed by 40 minutes of hemming and hawing about whether I'm right and making sure there wasn't a signed size or some other gotcha, then being anxious about saying anything because golly human brains are funny machines).

    I guess it's cool that opensc changed the calls to strlcat() now and that is probably a good thing, but this was never even a bug anyway so it didn't help anything today.

    Unless the compiler magically omits instructions like the strlen() check some day. Which, if we really go down the path of compilers being generated by LLMs I guess that is a valid concern 😉 .

    rrdot@infosec.exchangeR This user is from outside of this forum
    rrdot@infosec.exchangeR This user is from outside of this forum
    rrdot@infosec.exchange
    wrote last edited by
    #2

    @reverseics I think the real question is whether or not you would have gone down this path and spent that amount of time if there wasn't the llm "pointing the way."

    As part of the exercise, you've given the oh-day claim good faith and likely spent a bunch of time you might not have otherwise. This is probably because the anthropic peeps do not have a lot of experience doing vuln research, so they are pushing stuff that "qualifies" as vulns, but not from an experienced perspective. Not really, at least.

    I dunno. To quote brighter minds than mine, the llms are "typicality" matchers not "correct" matchers. Will that work sometimes? For sure. Will it waste your time sometimes? Absolutely.

    I guess it comes down to why we look for vulns. To find them, sure. But I'd argue because the hunt and the understanding and surprise is so damn rewarding. You're not surprised by what's typical. Apart from the fact that the typical keeps happening...

    bingbong@infosec.townB reverseics@infosec.exchangeR 2 Replies Last reply
    0
    • rrdot@infosec.exchangeR rrdot@infosec.exchange

      @reverseics I think the real question is whether or not you would have gone down this path and spent that amount of time if there wasn't the llm "pointing the way."

      As part of the exercise, you've given the oh-day claim good faith and likely spent a bunch of time you might not have otherwise. This is probably because the anthropic peeps do not have a lot of experience doing vuln research, so they are pushing stuff that "qualifies" as vulns, but not from an experienced perspective. Not really, at least.

      I dunno. To quote brighter minds than mine, the llms are "typicality" matchers not "correct" matchers. Will that work sometimes? For sure. Will it waste your time sometimes? Absolutely.

      I guess it comes down to why we look for vulns. To find them, sure. But I'd argue because the hunt and the understanding and surprise is so damn rewarding. You're not surprised by what's typical. Apart from the fact that the typical keeps happening...

      bingbong@infosec.townB This user is from outside of this forum
      bingbong@infosec.townB This user is from outside of this forum
      bingbong@infosec.town
      wrote last edited by
      #3

      @rrdot @reverseics idk tptacek made some pretty bold claims on HN about the credibility of Anthropic’s vuln researchers so if yr right that they don’t have a lot of experience there’s gonna be some egg on some faces

      rrdot@infosec.exchangeR 1 Reply Last reply
      0
      • bingbong@infosec.townB bingbong@infosec.town

        @rrdot @reverseics idk tptacek made some pretty bold claims on HN about the credibility of Anthropic’s vuln researchers so if yr right that they don’t have a lot of experience there’s gonna be some egg on some faces

        rrdot@infosec.exchangeR This user is from outside of this forum
        rrdot@infosec.exchangeR This user is from outside of this forum
        rrdot@infosec.exchange
        wrote last edited by
        #4

        @bingbong @reverseics ya, I freely admit I have no knowledge of the experience or quality of the anthropic team. Which goes both ways. Experienced people make mistakes, and inexperienced people find gold.

        1 Reply Last reply
        0
        • rrdot@infosec.exchangeR rrdot@infosec.exchange

          @reverseics I think the real question is whether or not you would have gone down this path and spent that amount of time if there wasn't the llm "pointing the way."

          As part of the exercise, you've given the oh-day claim good faith and likely spent a bunch of time you might not have otherwise. This is probably because the anthropic peeps do not have a lot of experience doing vuln research, so they are pushing stuff that "qualifies" as vulns, but not from an experienced perspective. Not really, at least.

          I dunno. To quote brighter minds than mine, the llms are "typicality" matchers not "correct" matchers. Will that work sometimes? For sure. Will it waste your time sometimes? Absolutely.

          I guess it comes down to why we look for vulns. To find them, sure. But I'd argue because the hunt and the understanding and surprise is so damn rewarding. You're not surprised by what's typical. Apart from the fact that the typical keeps happening...

          reverseics@infosec.exchangeR This user is from outside of this forum
          reverseics@infosec.exchangeR This user is from outside of this forum
          reverseics@infosec.exchange
          wrote last edited by
          #5

          @rrdot i would have done “find ./ -type f | xargs grep -B5 strcat” and then been convinced it was not exploitable after a few minutes, sure.

          but i am old and slow ;).

          1 Reply Last reply
          0
          • reverseics@infosec.exchangeR reverseics@infosec.exchange

            Anthropic wrote a blog post about their LLM finding 0days in open source projects. I reviewed the first vulnerability they reported, in OpenSC, and as far as I can tell the bug isn't even real? I think so anyway, otherwise I'll eat some humble pie.

            I was looking at the code at the time (so a few weeks ago, before opensc removed the strcat call and replaced with strlcat):

            https://github.com/OpenSC/OpenSC/blob/33ab343a5c7d80db8cbc17d26f0edbe9dcdae299/src/libopensc/card-piv.c

            The offending lines are around line 5145. According to anthropic, this is a buffer overflow found by their predictive text algorithm.

            But it's interesting to read the code and to read the context of the code. 'fp' is a string guaranteed to be 64 bytes in length, because of line 5138. This checks the strlen(fp) and if it isn't 64, the code exits with an error.

            So the math is: 'filename' is filled with a string that is at maximum 4096-64-2 bytes long == max 4030 bytes. This value (maximum 4030) is eventually passed to a strlcat() call inside of sc_get_cache_dir(), where it is used as the 'size' argument. This means that 'filename' has a maximum size of 4030 bytes when sc_get_cache_dir() exits.

            Then the code strcat's one byte (for the '/'), onto the 'filename' buffer, then 64 more bytes (for the 'fp' string) onto 'filename' buffer, meaning the buffer cannot be overflowed because the maximum string length is now 4095 (the last byte being a null terminator).

            So, anthropic's LLM probably spent 4 seconds 'finding' this 'vulnerability'. I spent about an hour looking at the code to debunk their finding (really 20 minutes looking at the code, followed by 40 minutes of hemming and hawing about whether I'm right and making sure there wasn't a signed size or some other gotcha, then being anxious about saying anything because golly human brains are funny machines).

            I guess it's cool that opensc changed the calls to strlcat() now and that is probably a good thing, but this was never even a bug anyway so it didn't help anything today.

            Unless the compiler magically omits instructions like the strlen() check some day. Which, if we really go down the path of compilers being generated by LLMs I guess that is a valid concern 😉 .

            da_667@infosec.exchangeD This user is from outside of this forum
            da_667@infosec.exchangeD This user is from outside of this forum
            da_667@infosec.exchange
            wrote last edited by
            #6

            @reverseics I saw some posts about people beating themselves off about how good claudecode is at finding vulns, and how they have so many vulns for OpenSSL and I'm here rolling my eyes, after seeing how so many open-source projects have had to remove bug bounties and tell AI users to fuck off because their slop generators are making shit up.

            1 Reply Last reply
            1
            0
            • R relay@relay.infosec.exchange shared this topic
            • reverseics@infosec.exchangeR reverseics@infosec.exchange

              Anthropic wrote a blog post about their LLM finding 0days in open source projects. I reviewed the first vulnerability they reported, in OpenSC, and as far as I can tell the bug isn't even real? I think so anyway, otherwise I'll eat some humble pie.

              I was looking at the code at the time (so a few weeks ago, before opensc removed the strcat call and replaced with strlcat):

              https://github.com/OpenSC/OpenSC/blob/33ab343a5c7d80db8cbc17d26f0edbe9dcdae299/src/libopensc/card-piv.c

              The offending lines are around line 5145. According to anthropic, this is a buffer overflow found by their predictive text algorithm.

              But it's interesting to read the code and to read the context of the code. 'fp' is a string guaranteed to be 64 bytes in length, because of line 5138. This checks the strlen(fp) and if it isn't 64, the code exits with an error.

              So the math is: 'filename' is filled with a string that is at maximum 4096-64-2 bytes long == max 4030 bytes. This value (maximum 4030) is eventually passed to a strlcat() call inside of sc_get_cache_dir(), where it is used as the 'size' argument. This means that 'filename' has a maximum size of 4030 bytes when sc_get_cache_dir() exits.

              Then the code strcat's one byte (for the '/'), onto the 'filename' buffer, then 64 more bytes (for the 'fp' string) onto 'filename' buffer, meaning the buffer cannot be overflowed because the maximum string length is now 4095 (the last byte being a null terminator).

              So, anthropic's LLM probably spent 4 seconds 'finding' this 'vulnerability'. I spent about an hour looking at the code to debunk their finding (really 20 minutes looking at the code, followed by 40 minutes of hemming and hawing about whether I'm right and making sure there wasn't a signed size or some other gotcha, then being anxious about saying anything because golly human brains are funny machines).

              I guess it's cool that opensc changed the calls to strlcat() now and that is probably a good thing, but this was never even a bug anyway so it didn't help anything today.

              Unless the compiler magically omits instructions like the strlen() check some day. Which, if we really go down the path of compilers being generated by LLMs I guess that is a valid concern 😉 .

              viss@mastodon.socialV This user is from outside of this forum
              viss@mastodon.socialV This user is from outside of this forum
              viss@mastodon.social
              wrote last edited by
              #7

              @reverseics i did a similar trapeze act with their last writeup about china doing the bad with a three tier framework of recon/exploit/exfil, and spent like 16 hours trying to reproduce it only to learn how fucked and broken it all is, and how its functionally equivalent to the ea lawsuit regarding lootboxes and reward systems that get children addicted to gambling

              1 Reply Last reply
              0
              • reverseics@infosec.exchangeR reverseics@infosec.exchange

                Anthropic wrote a blog post about their LLM finding 0days in open source projects. I reviewed the first vulnerability they reported, in OpenSC, and as far as I can tell the bug isn't even real? I think so anyway, otherwise I'll eat some humble pie.

                I was looking at the code at the time (so a few weeks ago, before opensc removed the strcat call and replaced with strlcat):

                https://github.com/OpenSC/OpenSC/blob/33ab343a5c7d80db8cbc17d26f0edbe9dcdae299/src/libopensc/card-piv.c

                The offending lines are around line 5145. According to anthropic, this is a buffer overflow found by their predictive text algorithm.

                But it's interesting to read the code and to read the context of the code. 'fp' is a string guaranteed to be 64 bytes in length, because of line 5138. This checks the strlen(fp) and if it isn't 64, the code exits with an error.

                So the math is: 'filename' is filled with a string that is at maximum 4096-64-2 bytes long == max 4030 bytes. This value (maximum 4030) is eventually passed to a strlcat() call inside of sc_get_cache_dir(), where it is used as the 'size' argument. This means that 'filename' has a maximum size of 4030 bytes when sc_get_cache_dir() exits.

                Then the code strcat's one byte (for the '/'), onto the 'filename' buffer, then 64 more bytes (for the 'fp' string) onto 'filename' buffer, meaning the buffer cannot be overflowed because the maximum string length is now 4095 (the last byte being a null terminator).

                So, anthropic's LLM probably spent 4 seconds 'finding' this 'vulnerability'. I spent about an hour looking at the code to debunk their finding (really 20 minutes looking at the code, followed by 40 minutes of hemming and hawing about whether I'm right and making sure there wasn't a signed size or some other gotcha, then being anxious about saying anything because golly human brains are funny machines).

                I guess it's cool that opensc changed the calls to strlcat() now and that is probably a good thing, but this was never even a bug anyway so it didn't help anything today.

                Unless the compiler magically omits instructions like the strlen() check some day. Which, if we really go down the path of compilers being generated by LLMs I guess that is a valid concern 😉 .

                J This user is from outside of this forum
                J This user is from outside of this forum
                jakuje@infosec.exchange
                wrote last edited by
                #8

                @reverseics what you are looking at is already the revision that has one of the fix for the issue applied. The Anthropic reported this issue before the https://github.com/OpenSC/OpenSC/pull/3558 was applied. The fix https://github.com/OpenSC/OpenSC/pull/3554 was mostly hardening as the strcat() is really a magnet for anything security relevant (regardless if it is an static analysis or AI scanner).

                reverseics@infosec.exchangeR 1 Reply Last reply
                1
                0
                • R relay@relay.infosec.exchange shared this topic
                • J jakuje@infosec.exchange

                  @reverseics what you are looking at is already the revision that has one of the fix for the issue applied. The Anthropic reported this issue before the https://github.com/OpenSC/OpenSC/pull/3558 was applied. The fix https://github.com/OpenSC/OpenSC/pull/3554 was mostly hardening as the strcat() is really a magnet for anything security relevant (regardless if it is an static analysis or AI scanner).

                  reverseics@infosec.exchangeR This user is from outside of this forum
                  reverseics@infosec.exchangeR This user is from outside of this forum
                  reverseics@infosec.exchange
                  wrote last edited by
                  #9

                  @jakuje Oh interesting! I missed that this strlen() check was an intermediate fix.

                  After staring at ASN.1 parser code for a few minutes I guess:

                  If the asn.1 tag type 0xf3 has a very large length field

                  and if the url string itself contains the first slash quite early (e.g. 'http:///AAAAAAA....'

                  then fp can point to a long buffer, say 10,000 bytes

                  then integer underflow makes the call to sc_get_cache_dir() somewhat unsafe (depends what kind of control we can expect to have over the directory config/environment variables, possibly a buffer overflow inside this function though)

                  and yes then 'filename' buffer could then be overflowed

                  interesting bug then. this requires physical access? assuming that this asn.1 tag is only read off of a card itself? i am guessing crl or some other feature...

                  J 1 Reply Last reply
                  1
                  0
                  • reverseics@infosec.exchangeR reverseics@infosec.exchange

                    @jakuje Oh interesting! I missed that this strlen() check was an intermediate fix.

                    After staring at ASN.1 parser code for a few minutes I guess:

                    If the asn.1 tag type 0xf3 has a very large length field

                    and if the url string itself contains the first slash quite early (e.g. 'http:///AAAAAAA....'

                    then fp can point to a long buffer, say 10,000 bytes

                    then integer underflow makes the call to sc_get_cache_dir() somewhat unsafe (depends what kind of control we can expect to have over the directory config/environment variables, possibly a buffer overflow inside this function though)

                    and yes then 'filename' buffer could then be overflowed

                    interesting bug then. this requires physical access? assuming that this asn.1 tag is only read off of a card itself? i am guessing crl or some other feature...

                    J This user is from outside of this forum
                    J This user is from outside of this forum
                    jakuje@infosec.exchange
                    wrote last edited by
                    #10

                    @reverseics correct. This data is read from objects on card/tokens. Therefore it requires a physical access to the system, plugging (malicious) stuff to USBs and having the system running opensc handling the desktop login (in most cases). Most of the issues we had over last couple of years fall into this attack vector category (and this was certainly not the last one).

                    This part of the PIV specs is something ancient logic hopefully not used by anyone these days (but code is there), that was saving the space on cards by allowing to have a certificate saved externally on disk.

                    1 Reply Last reply
                    1
                    0
                    • reverseics@infosec.exchangeR reverseics@infosec.exchange

                      Anthropic wrote a blog post about their LLM finding 0days in open source projects. I reviewed the first vulnerability they reported, in OpenSC, and as far as I can tell the bug isn't even real? I think so anyway, otherwise I'll eat some humble pie.

                      I was looking at the code at the time (so a few weeks ago, before opensc removed the strcat call and replaced with strlcat):

                      https://github.com/OpenSC/OpenSC/blob/33ab343a5c7d80db8cbc17d26f0edbe9dcdae299/src/libopensc/card-piv.c

                      The offending lines are around line 5145. According to anthropic, this is a buffer overflow found by their predictive text algorithm.

                      But it's interesting to read the code and to read the context of the code. 'fp' is a string guaranteed to be 64 bytes in length, because of line 5138. This checks the strlen(fp) and if it isn't 64, the code exits with an error.

                      So the math is: 'filename' is filled with a string that is at maximum 4096-64-2 bytes long == max 4030 bytes. This value (maximum 4030) is eventually passed to a strlcat() call inside of sc_get_cache_dir(), where it is used as the 'size' argument. This means that 'filename' has a maximum size of 4030 bytes when sc_get_cache_dir() exits.

                      Then the code strcat's one byte (for the '/'), onto the 'filename' buffer, then 64 more bytes (for the 'fp' string) onto 'filename' buffer, meaning the buffer cannot be overflowed because the maximum string length is now 4095 (the last byte being a null terminator).

                      So, anthropic's LLM probably spent 4 seconds 'finding' this 'vulnerability'. I spent about an hour looking at the code to debunk their finding (really 20 minutes looking at the code, followed by 40 minutes of hemming and hawing about whether I'm right and making sure there wasn't a signed size or some other gotcha, then being anxious about saying anything because golly human brains are funny machines).

                      I guess it's cool that opensc changed the calls to strlcat() now and that is probably a good thing, but this was never even a bug anyway so it didn't help anything today.

                      Unless the compiler magically omits instructions like the strlen() check some day. Which, if we really go down the path of compilers being generated by LLMs I guess that is a valid concern 😉 .

                      eingfoan@infosec.exchangeE This user is from outside of this forum
                      eingfoan@infosec.exchangeE This user is from outside of this forum
                      eingfoan@infosec.exchange
                      wrote last edited by
                      #11

                      @reverseics Humble pie has been eaten 🤣🤣🤣🤣🤣🤣🤣😱🧐😳🤣

                      1 Reply Last reply
                      1
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups