A Semantic Attack on Google Gemini - Read the Latest Research
The vulnerability CVE-2021-22898 describes an information disclosure in curl's TELNET option parser. The provided commit 39ce47f219b09c380b81f89fe54ac586c8db6bde directly addresses this. The patch modifies the suboption function in lib/telnet.c. The key change is the addition of a check for the return value of sscanf. Previously, sscanf was called to parse variable=content pairs, but its return value (number of items successfully matched) was not checked. If the input string v->data did not contain a comma (e.g., only a variable name was provided), varval would not be initialized by sscanf. Subsequently, the potentially uninitialized varval (which could contain sensitive data from the stack) was used in msnprintf to construct the TELNET NEW_ENV option string, which was then sent to the server. The fix ensures that sscanf successfully matches and populates both varname and varval (returns 2) before proceeding, thus preventing the use of uninitialized data.