{"uuid": "1b3e811c-2716-4a7d-808d-194f23380c7e", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "9f56dd64-161d-43a6-b9c3-555944290a09", "vulnerability": "CVE-2022-42905", "type": "seen", "source": "https://t.me/hacking_Attack/86320", "content": "Exploit Collector\nwolfSSL WOLFSSL_CALLBACKS Heap Buffer Over-Read\n\nhttps://3.bp.blogspot.com/-vLPaJ0bXchM/WWlvcii8AuI/AAAAAAAAIPY/lohzKYQrhRkUA5ocnA3xRTtIEj7YZIM-ACLcBGAs/s1600/h77.png \nwolfSSL versions prior to 5.5.2 suffer from a heap buffer over-read with WOLFSSL_CALLBACKS and can be triggered with a single Client Hello message.\n\nSHA-256 | 22c8bd75668677a45f903b9289dfd4de5cffd44e8f21af11820559278a985e59\n\nDownload\n# wolfSSL before 5.5.2: Heap-buffer over-read with WOLFSSL_CALLBACKS\n====================================================================\n\n## INFO\n=======\n\nThe CVE project has assigned the id CVE-2022-42905 to this issue.\n\nSeverity: 9.1 CRITICAL\nAffected version: before 5.5.2\nEnd of embargo: Ended October 28, 2022\nBlog Post: https://blog.trailofbits.com/2023/01/12/wolfssl-vulnerabilities-tlspuffin-fuzzing-ssh/\n\n## SUMMARY\n==========\n\nIf wolfSSL callback functions are enabled (i.e., the flag `WOLFSSL_CALLBACKS` is\nenabled), then a malicious client or network attacker can send a Client Hello\nmessage to a server that when parsed by the server will trigger a buffer\nover-read on the heap of at least 5 bytes. Similarly, a malicious server or a\nnetwork attacker can send a Hello Retry Request message to a client that when\nparsed by the client will trigger a buffer over-read on the heap of at least 15\nbytes.\n\nThe `AddPacketInfo` is given a buffer that should be the input buffer and that\nactually is shifted by 5 bytes on the left, i.e., instead of reading\n`input[0]..input[length]`, the function will read `input[-5]..input[length]` and\nstore it in a buffer that is exposed through the wolfSSL API. Note that `input`\nis stored on the heap and `input[-5]` to `input[-1]` might store sensitive data\nthat should not be given to `AddPacketInfo`, for example when callback functions\nare used as logging facility (through the API functions `wolfSSL_accept_ex` and\n`wolfSSL_connect_ex`).\n\nThis buffer over-read can be triggered at a server with a single Client Hello\nmessage. We have confirmed this with a proof-of-concept test case given below on\nwolfSSL 5.5.0, on the version from the master branch, and on version 5.4.0. A\nsimilar buffer over-read can be triggered at a client with the same wolfSSL\nversions.\n\n## DETAILS\n==========\n\n(Note: All code snippets and line numbers are with respect to the git hash\n`#43715d1bb5b8c5b8b18cba4be3171fd1dd7eb046` on remote\n`git@github.com:wolfssl/wolfssl.git`.)\n\nWhen executing the first proof of concept test case given below, we reach a call\nto `DoTls13HandShakeMsgType` from `tls13.c:DoTls13HandShakeMsg:10443` when the\nserver parses the Client Hello message, with the following values:\n\n```c\nsize = 16520;\ntotalSz = 16524;\n*inOutIdx = 4;\ntype = 1;\ninput; // buffer containing the input to be processed, before input,\nthere seems to be another input stored\n```\n\n`*inOutIdx=4` because of the call to `GetHandshakeHeader` at line\n`tls13.c:10411`.\n\nWe enter the function `tls13.c:DoTls13HandShakeMsgType` and because\n`WOLFSSL_CALLBACKS` flag is defined, we enter this snippet:\n\n```c\n#if defined(WOLFSSL_CALLBACKS)\n/* add name later, add on record and handshake header part back on */\nif (ssl-&gt;toInfoOn) {\nint add = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;\nAddPacketInfo(ssl, 0, handshake, input + *inOutIdx - add,\nsize + add, READ_PROTO, ssl-&gt;heap);\nAddLateRecordHeader(&amp;ssl-&gt;curRL, &amp;ssl-&gt;timeoutInfo);\n}", "creation_timestamp": "2026-09-02T01:01:26.646628Z"}