OpenSSL CVE-2026-121481: CISA's 9.8 became 5.9 within a day. Check who calls EVP_EncodeBlock()

CVE-2026-121481 is an integer overflow in EVP_EncodeBlock(), OpenSSL’s one-shot Base64 encoder. NVD and the GitHub Advisory Database first showed it at CVSS 9.8. That score was added by CISA, which revised it twice within a day, down to 5.9. OpenSSL updated the CVE record on 20 November 2026 with its own rating, Low, because it knows of no path by which an attacker can trigger the bug. The caller already has to hold a buffer of roughly 2 GB before the bug can be reached.

The CVE record lists OpenSSL 4.0.0 to 4.0.3 and 4.1.0 as affected. The 3.x series is outside the range. As of 3 December (Taipei time) the fix is still not merged. OpenSSL released 4.1.1, 4.0.4 and 3.5.10 on 1 December as announced, and neither the release notes nor the advisory that followed mention this CVE. 4.1.1 and 4.0.4 still contain the previous implementation of EVP_EncodeBlock(), yet the record ends its affected ranges just below 4.1.1 and 4.0.4, so a scanner using only those ranges would flag neither release. If you run 4.x, three checks are worth doing now: which version you actually have, who calls this function, and whether the length handed to it has an upper bound.

Three things to check first

Start with the version. The table below is what I found by pulling images in arm64 containers on OrbStack, plus two package pages. I pulled the images again on 26 November and rechecked, and updated the Arch and Homebrew rows from their package pages on 3 December. For some distributions I installed the openssl package first.

Environment OpenSSL version In the CVE record’s range?
ubuntu:26.10 4.0.3 Yes
fedora:latest, fedora:rawhide 4.0.3 Yes
Arch Linux (package page, not tested) 4.1.1-1 No
Homebrew openssl (an alias for openssl@4, formula page) 4.1.1 No
debian:sid 3.6.5 No
debian:trixie, alpine:edge, alpine:3.22, node:latest (v26.13.1), python:latest, ruby:latest, php:latest 3.5.9 No
nginx:latest built with 3.5.7, running with 3.5.9 No
ubuntu:22.04 3.0.2 No

Ubuntu’s CVE page still lists 26.10 as Needs evaluation, but the package in the archive is 4.0.3-1ubuntu1, which falls inside the range. Debian, Alpine and the official language and web-server images I looked at were on 3.x; the 4.x installs were Fedora, Ubuntu 26.10, Arch and development machines using Homebrew. A language runtime may bundle its own OpenSSL or use the system one. The official node image bundles 3.5.9, while nodejs and python3 from Ubuntu 26.10’s archive report the system’s 4.0.3, so ask the runtime itself:

openssl version
node -p "process.versions.openssl"
python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"

Next, find the callers. Use grep on your own source and vendored code, and nm on dynamically linked binaries and libraries:

grep -R -n 'EVP_EncodeBlock(' --include='*.c' --include='*.h' .
nm -D --undefined-only /usr/lib/proftpd/mod_sql.so | grep -E 'EVP_(Encode|Decode)Block'

No output only means this search found nothing. Confirm the command ran without errors. Then look at the libraries the binary loads, any statically linked copy of OpenSSL, and code that looks up symbols at run time with something like dlsym.

Then trace where the length comes from. Once you have a caller, follow its length argument backwards. It may be a fixed size, a size capped by a protocol field, or whatever the other end chooses to send. On ubuntu:26.10 I installed 512 packages (nginx, Apache, PostgreSQL, MariaDB, HAProxy, Postfix, Dovecot, Squid, ProFTPD, OpenVPN and strongSwan among them) and scanned 2,449 ELF files. Of those, 228 import symbols beginning EVP_, SSL_, BIO_, X509_ or PEM_ and exactly one imports EVP_EncodeBlock: ProFTPD’s mod_sql.so. In ProFTPD’s upstream contrib/mod_sql.c on master, the thing being encoded is a digest. The input buffer is declared as mdval[EVP_MAX_MD_SIZE], and when hashing succeeds its length is set by the algorithm and does not grow with the password. I read the upstream source but did not compare it with Ubuntu’s packaged version or follow the path where hashing fails. Until those two gaps are closed I would not call mod_sql.so fully checked.

Severity ratings and how they changed

Five sources have rated this CVE, and CISA has revised its rating twice:

Source Rating Basis
OpenSSL (the CNA) Low OpenSSL’s own security policy; no CVSS number
CISA ADP Vulnrichment (first version) 9.8, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Added at 05:20 on 20 November (Taipei time) with no stated rationale
CISA ADP Vulnrichment (second version) 8.4, CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Rewritten at 02:31 on 21 November (Taipei time) with no stated rationale
CISA ADP Vulnrichment (current) 5.9, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H Rewritten again at 03:45 on 21 November (Taipei time) with no stated rationale
Amazon Linux 6.5, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H No stated rationale; every listed package is Not Affected
Red Hat Low, 3.7, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L Statement repeats OpenSSL’s reasoning; openssl on RHEL 6 to 10 is Not affected
Ubuntu Medium priority No stated rationale; openssl is still Needs evaluation for every release

The record was published at 19:43 Taipei time on 18 November with a one-sentence description and no score. CISA added 9.8 at 05:20 on the 20th. At 18:13 that day OpenSSL replaced the description with a full write-up and marked it Low. At 02:31 on the 21st CISA changed its score to 8.4 and moved the attack vector from network to local. At 03:45 it changed the score again to 5.9. The attack vector went back to network and attack complexity went from low to high. The confidentiality and integrity impacts went from high to none, leaving availability. Between the first SSVC entry and the current one, Automatable went from yes to no and Technical Impact from total to partial. Exploitation has been none throughout.

CISA’s score has not moved since 03:45 on 21 November, but the pages that repeat it have not all caught up. When I checked, NVD was still at Awaiting Analysis and showed CISA’s 5.9. The GitHub advisory, updated on 26 November (Taipei time), still showed Critical 9.8, labelled Unreviewed. Whether you see 9.8 or 5.9 depends on which source a scanner reads and how often it syncs. CISA’s SSVC entry still says Exploitation: none, the CVE is not in its KEV catalogue (version 2026.11.30), and I found no report of exploitation.

Two sentences in OpenSSL’s text carry most of the weight: “No path by which an attacker can trigger this has been identified.” and “The caller must already hold a buffer of about two gigabytes before the defect can be reached.” It adds that OpenSSL’s own TLS, QUIC and CMS code never encodes buffers of that size and that the command-line tools cannot practically be made to do so. It describes the exposed case as an application that accepts an attacker-controlled length and forwards it to EVP_EncodeBlock() without a bound check of its own.

OpenSSL’s security policy says it does not use CVSS to set severity and that scores from independent parties may differ severely from its own rating. CISA’s Vulnrichment README says it fills in fields the CNA left empty when it has enough supporting evidence, and that the CNA’s data takes precedence where both supply CWE, CVSS or CPE data. Here OpenSSL supplied a text rating of Low and no CVSS vector, and CISA’s assessment is still in the record.

About 22 hours elapsed between CISA’s initial 9.8 and its revision to 5.9, and the record gives no reason for the changes. None of these ratings can see how your service calls the function. When they disagree or are revised, you still have to check the version, the callers and the length yourself.

Where the overflow happens

Base64 turns every 3 bytes into 4 characters, so the output is 4 * ((len + 2) / 3) bytes plus one for the NUL. EVP_EncodeBlock() takes its length as an int and returns an int. Once the input exceeds (INT_MAX / 4) * 3, which is 1,610,612,733 bytes, the encoded length no longer fits.

I wrote a small probe to see what happens. It computes the correct output size in size_t and allocates a further 1 MiB guard region filled with 0xC3. After the call it reports the return value, the length of the string written and whether the guard was touched. The probe only shows how the library behaves when the output buffer is the right size, so it says nothing about a caller that gets that size wrong.

#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
    size_t n = strtoull(argv[1], NULL, 10);
    size_t need = (n + 2) / 3 * 4 + 1;
    size_t guard = 1 << 20, changed = 0, i;
    unsigned char *in = malloc(n ? n : 1);
    unsigned char *out = malloc(need + guard);
    int ret;

    if (in == NULL || out == NULL) {
        perror("malloc");
        return 2;
    }
    memset(in, 'A', n);
    memset(out + need, 0xC3, guard);
    ret = EVP_EncodeBlock(out, in, (int)n);
    for (i = 0; i < guard; i++)
        changed += out[need + i] != 0xC3;
    printf("%-28s dlen=%zu need=%zu ret=%d written=%zu guard_changed=%zu\n",
        OpenSSL_version(OPENSSL_VERSION), n, need, ret,
        strnlen((char *)out, need + guard), changed);
    return 0;
}

Built with cc -O2 on ubuntu:26.10 against the distribution’s libcrypto 4.0.3, in a container started with --memory 8g:

--- dlen=1610612733
OpenSSL 4.0.3 29 Sep 2026    dlen=1610612733 need=2147483645 ret=2147483644 written=2147483644 guard_changed=0
    exit=0
--- dlen=1610612734
OpenSSL 4.0.3 29 Sep 2026    dlen=1610612734 need=2147483649 ret=-2147483648 written=2147483648 guard_changed=0
    exit=0
--- dlen=2147483645
OpenSSL 4.0.3 29 Sep 2026    dlen=2147483645 need=2863311529 ret=-1431655768 written=2863311528 guard_changed=0
    exit=0
--- dlen=2147483646
Segmentation fault
    exit=139
--- dlen=2147483647
Segmentation fault
    exit=139

One byte past 1,610,612,733 the correct length no longer fits in an int, and in this run the return value turned negative. At INT_MAX and INT_MAX minus one the process segfaults inside the library. gdb puts the fault in evp_encodeblock_int(), where the for loop on that path uses i + 2 < dlen as its condition and i is an int. I did not find out whether the out-of-bounds access is a read or a write. Builds from the upstream 4.0.3 and 4.1.0 tags, and from master (354f1cf), behaved the same way.

On 3.0.2, 3.5.7, 3.5.9 and 3.6.5, at each over-limit length I tested, the return value also went negative. The written string had the expected length, the guard was untouched, and nothing crashed up to INT_MAX. I did not compare the output byte for byte. Signed overflow is undefined behaviour in C, so another compiler or optimisation level may do something else. This describes these builds at these lengths, and it matches the CVE record, which leaves 3.x out of range.

The test machine is Apple Silicon, so all of this took the plain C path on arm64. On x86, 4.x has a separate AVX2 path. The amd64 containers on this machine report sse4_2 and no avx2 flag in /proc/cpuinfo, so I did not test it.

Can an attacker get there?

I searched master and left out test, doc and fuzz. OpenSSL itself calls EVP_EncodeBlock() in three places, and none of them is in libssl:

Caller What it encodes
PEM_SignFinal() (crypto/pem/pem_sign.c) A signature, in a buffer sized by EVP_PKEY_get_size()
NETSCAPE_SPKI_b64_encode() (crypto/x509/x509spki.c) The DER encoding of an SPKI structure
base64encode() (crypto/http/http_client.c) HTTP proxy basic-auth credentials; until now it only rejected len > INT_MAX

The fix PR originally described a command-line demonstration: give openssl s_client an enormous -proxy_pass, read from an environment variable with env:VAR. The GOST it mentions is the Go tunnelling tool at gost.run, which the reporter said accepts a password that large when used as a proxy. I did not verify that. It has nothing to do with OpenSSL’s GOST algorithms. In review, bob-beck wrote that “the report’s reproducer is completely synthetic, and probably should not be a CVE without evidence it really happens”.

I tried the environment-variable route on Linux. execve caps the length of any single string; the man page gives the limit as 32 pages, which is 131,072 bytes on a kernel with 4 KB pages:

Linux aarch64
PAGE_SIZE=4096 ARG_MAX=2097152
value_len=131069 exec ok
value_len=131070 exec failed: Argument list too long
value_len=1048576 exec failed: Argument list too long
value_len=1610612734 exec failed: Argument list too long

With a one-letter variable name, a value of 131,069 bytes still starts the program and one more byte fails, four orders of magnitude short of 1.6 GB. The PR does not say which platform it was tested on and I did not try other operating systems. OpenSSL’s later text in the CVE record also says the command-line tools cannot practically reach this length, citing the limit on reading a proxy password from a file and limits on bignum sizes.

That demonstration was challenged on 25 November (Taipei time). bob-beck commented on the PR that there is no way round the length limit via the environment. On Linux, execve() applies MAX_ARG_STRLEN, 128 KiB with 4 KiB pages, to every environment string. On macOS, ARG_MAX is 1 MiB for argv and the environment together, and a Windows environment variable is limited to 32,767 characters. He added that file:, fd: and stdin are read into a 1,024-byte buffer. The Linux figure matches my test above, and I did not test the others. The reporter, nmouha, replied that he could substantiate the original claim but did not want to publish steps before a fix ships. He removed the paragraph from the PR description. nhorman then asked for the reproducer because “we’re having trouble seeing the reachability”. At 01:30 on 26 November nmouha answered that he had sent one to openssl-security, adding “I am not aware of any realistic path to exploitation”. At 01:53 nhorman posted the commands from that email: LD_PRELOAD loads a libinject_size.so, s_client then reads the password from env:INJECTED_VAR, and the run ends in a segmentation fault. His reading was “Thats not reachability through a protocol”: the failure comes from code deliberately injected to misuse the API. Only the commands and their output were posted, without the source of the injected library, so I could not rerun it.

For an outsider to trigger the bug, then, an application has to let an outsider choose the length, have no layer along the way that bounds the length actually being encoded, and pass this function a length beyond its limit, which is about 1.5 GiB. I did not find such a service, and OpenSSL says it has not found one either. That does not cover your own code, where you still have to follow the length argument back along the real call path.

An interface that never stated its limit

The signature is int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n). It does not take the capacity of the output buffer, so it cannot check that the caller allocated enough. The int it returns is the encoded length. The documentation defines no error value, and 0 is a legitimate success for empty input. The parameter type admits anything up to INT_MAX, while the arithmetic is only correct for three quarters of that. Neither the interface nor the documentation mentioned the gap.

That is why the fix has been argued over for more than two weeks, has taken four forms and is still not merged.

The first version returned -1 for invalid input. Reviewer t8m worried that existing third-party code casts the return value straight to size_t, which would turn a negative number into a huge length. esyr suggested deprecating the function and adding an EVP_EncodeBlock_ex() with a clearer contract, which the author considered out of scope.

The second version (ad8169a, 19 November) used assertions: a negative dlen, or one above (INT_MAX / 4) * 3, terminated the process. When I built it and ran the same probe, all four over-limit lengths ended with assertion failed and exit code 134. At 19:22 Taipei time on 20 November mattcaswell objected in review: “This is a DoS waiting to happen. We should simply return 0 and document it.” kroeckx added that the project’s STYLE.md advises against OPENSSL_assert in the library.

The third version (7b4d92a, 21 November) handled a negative or over-limit dlen by writing a single NUL to the output, putting ERR_R_PASSED_INVALID_ARGUMENT on the error stack and returning 0. When I built it, the same probe gave ret=0 and written=0 at every over-limit length, with no crash. At 03:16 Taipei time on 24 November bob-beck objected to that combination in review: “We should not be raising an error code with a valid return value. This function can return 0 on success.”

The fourth version is the PR head when I checked (fb4d336, 05:14 Taipei time on 25 November). For a dlen of zero or less, or above the limit, the function writes a single NUL and returns 0. It no longer touches the error stack. The documentation describes this and gains a BUGS section with two points. For an out-of-range length the function still assumes t has room for a NUL, with undefined behaviour if it does not. Such a length also cannot be told apart from a successful encoding of empty input. The same probe against that build:

--- dlen=1610612733
OpenSSL 4.2.0-dev            dlen=1610612733 need=2147483645 ret=2147483644 written=2147483644 guard_changed=0
    exit=0
--- dlen=1610612734
OpenSSL 4.2.0-dev            dlen=1610612734 need=2147483649 ret=0 written=0 guard_changed=0
    exit=0
--- dlen=2147483646
OpenSSL 4.2.0-dev            dlen=2147483646 need=2863311529 ret=0 written=0 guard_changed=0
    exit=0
--- dlen=2147483647
OpenSSL 4.2.0-dev            dlen=2147483647 need=2863311533 ret=0 written=0 guard_changed=0
    exit=0

A second, shorter program calls ERR_clear_error() before each call and afterwards prints the return value, the first output byte and ERR_peek_error():

dlen=0 ret=0 out[0]=0 err=0
dlen=-1 ret=0 out[0]=0 err=0
dlen=1610612734 ret=0 out[0]=0 err=0
dlen=2147483647 ret=0 out[0]=0 err=0

As long as the output buffer has room for a NUL, over-limit input no longer crashes or terminates the process. The caller gets an empty string and a return value of 0, and the function adds nothing to the error stack (the test cleared it first, hence the 0). Empty input produces exactly the same, so the output, the return value and the error stack cannot tell the two apart. The caller has to check the length before the call; one that skips that check will carry on with an empty string. That is gentler than a crash. The caller still has to decide first whether the length should have been passed in at all.

At 02:48 on 25 November bob-beck requested changes again, on the commit before the current head: “It seems very odd to have an out of range size, and yet assume we can write a nul byte at the provided pointer.” In a comment he said his preference is still to leave the behaviour alone and document out-of-range sizes as undefined behaviour. The BUGS section was added after that. In a comment on 26 November (Taipei time) he disagreed that this is an OpenSSL CVE at all: OpenSSL’s own code cannot reach it, and a security problem caused by misusing the API belongs to the caller. On 28 November he opened PR #34055, which only documents which pointers may be NULL, the valid length range and the required output size, and calls any violation undefined behaviour. On 2 December he removed his hold, saying the SRT had apparently decided how to fix this. In the early hours of 3 December t8m approved fb4d336, and bob-beck then closed #34055, saying he thought the SRT had chosen another approach. When I checked, #33652 was still not merged, its label read approval: review pending and bob-beck’s earlier request for changes had not been withdrawn, so what finally lands may still change.

EVP_EncodeBlock() has been public for a long time and callers rely on its existing return values. The limit it could handle was never written into its types or its documentation. Returning -1, asserting, returning 0 with an error and returning a bare 0 have been proposed in turn, and reviewers have raised concerns in turn about compatibility, process termination, error reporting and what is assumed of the output pointer.

Cap the length before it reaches the encoder

Before 2 GB of data arriving over a network reaches a Base64 encoder it has passed through a connection, a protocol parser and a memory allocation. The entry point usually knows the size before the encoder does and can refuse it there: a body-size limit on the reverse proxy, a length field in the protocol, the application’s own upload cap. For an oversized HTTP request body that refusal is a 413. If the size is only noticed at EVP_EncodeBlock(), the current PR hands back a bare 0, the same result as empty input, and the function’s results alone cannot tell them apart.

Limits at the entry point do not catch everything. Data can be larger after decompression or assembly than it was on arrival, so the caller still needs to check the length it is about to encode. Look at the cast from size_t to int in particular: compare against the limit before that line and take your own error path if it is exceeded. The entry point only sees the size at arrival and is the cheapest place to refuse. EVP_EncodeBlock() cannot see whether anything upstream refused, so the length still has to be checked before the cast to int.

OpenSSL’s policy for Low severity is to fix in public and ship it in the next scheduled patch release. It recommends scheduling updates “without undue haste”. Its oss-security notices of 17 and 24 November list seven Low fixes that are already merged and shipped in the 1 December releases. This CVE is in neither notice. Alan Coopersmith of Oracle asked on the list whether that was because the PR is not merged, and Norbert Pócs of OpenSSL replied at 14:52 Taipei time on 25 November: “Yes, exactly.” and “CVE-2026-121481 is still under review.” 4.1.1, 4.0.4 and 3.5.10 came out on the evening of 1 December (Taipei time). The advisory OpenSSL posted to oss-security in the early hours of 2 December (Taipei time) lists three Moderate issues and one Low and confirms that the 12 previously announced Low issues are fixed; neither it nor the release notes include this CVE, and comparing 4.1.0 with 4.1.1 and 4.0.3 with 4.0.4, crypto/evp/encode.c is unchanged on both branches. The CVE record ends its affected ranges just below 4.0.4 and 4.1.1, entered while the PR was still open, so a scanner using only those ranges will not flag machines already on 4.1.1 or 4.0.4. When I checked, Homebrew and Arch were both on 4.1.1. If your checks show no reachable caller, there is no need to downgrade, restart or disable features for this CVE; each of those touches a running service. If a caller might receive over-limit input, put a length limit in front of it first. Consider suspending the feature only if you cannot add that limit. Keep a note of what you found and check again once OpenSSL announces a release carrying the fix.

Notes

  • CISA’s ADP first scored it 9.8 and revised that twice in about 22 hours, to 8.4 and then 5.9. OpenSSL, as the CNA, rates the issue Low because it knows of no attacker-controlled path. Amazon Linux puts it at 6.5 and Red Hat at Low with 3.7. The GitHub advisory still showed 9.8 when I checked, and the CVE is not in KEV.
  • The CVE record covers 4.0.0 to 4.0.3 and 4.1.0. 4.1.1 and 4.0.4, released on 1 December, fall outside those ranges but still contain the previous EVP_EncodeBlock(). t8m has approved the current head of PR #33652, which was still not merged when I checked.
  • The 4.x environments I found were ubuntu:26.10, Fedora, Arch and Homebrew. Debian, Alpine and the official language-runtime and web-server images I checked were on 3.x.
  • In the arm64 builds I tested, 4.0.3, 4.1.0 and master segfaulted at INT_MAX and INT_MAX minus one. The 3.x builds returned negative values without crashing at the over-limit lengths I tried. The x86 AVX2 path was not tested.
  • OpenSSL has three internal callers. Among 512 packages on ubuntu:26.10 only ProFTPD’s mod_sql.so imports the symbol, and on its upstream success path it encodes a digest.
  • The PR has taken four forms (return -1, assert, return 0 with an error, return a bare 0). It was the fourth form and unmerged when I checked. Callers still need an early cap on input and a check of the actual length before the cast to int.

Further reading

Ideas and technical judgement by Sheng; drafted with Claude · tone adjusted with Grok, reviewed by Codex; tests ran on OrbStack (Apple Silicon, arm64) against OpenSSL 3.0.2, 3.5.7, 3.5.9, 3.6.5, 4.0.3, 4.1.0, master 354f1cf and PR heads 7b4d92a and fb4d336, and the x86 AVX2 path was not tested; containers rechecked on 26 November, and the PR, upstream releases and package pages checked up to 3 December 2026 (Taipei time)