Miggo Logo

CVE-2022-32208: When curl < 7.84.0 does FTP transfers secured by krb5, it handles message verification failures...

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.2869%
Published
7/8/2022
Updated
4/7/2024
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability CVE-2022-32208 concerns incorrect handling of krb5 message verification failures in curl's FTP transfers. The commit 6ecdf5136b52af747e7bda08db9a748256b1cd09 directly addresses this. The function krb5_decode in lib/krb5.c is responsible for calling gss_unwrap to verify the message. The patch shows that the previous logic for handling gss_unwrap failures was flawed: it attempted a strcpy which could be an out-of-bounds write and, more importantly, did not consistently return an error, allowing the vulnerability to manifest. The fix ensures it returns -1 on failure. The read_data function in the same file calls conn->mech->decode (which points to krb5_decode in this context). It was updated to check the return value of the decode function and propagate CURLE_RECV_ERROR if the decode function (i.e., krb5_decode) indicates an error (returns < 0). This makes krb5_decode the primary vulnerable function due to its direct role in message verification and incorrect error handling, and read_data a closely related function that was part of the vulnerable execution flow and required changes for the fix to be effective.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

W**n *url < *.**.* *o*s *TP tr*ns**rs s**ur** *y kr**, it **n*l*s m*ss*** v*ri*i**tion **ilur*s wron*ly. T*is *l*w m*k*s it possi*l* *or * M*n-In-T**-Mi**l* *tt**k to *o unnoti*** *n* *v*n *llows it to inj**t **t* to t** *li*nt.

Reasoning

T** vuln*r**ility *V*-****-***** *on**rns in*orr**t **n*lin* o* kr** m*ss*** v*ri*i**tion **ilur*s in *url's *TP tr*ns**rs. T** *ommit **************************************** *ir**tly ***r*ss*s t*is. T** *un*tion `kr**_***o**` in `li*/kr**.*` is r*