Lucene search

K
hackeroneL00p3rH1:550696
HistoryApr 29, 2019 - 6:08 p.m.

curl: Heap Buffer Overflow at lib/tftp.c

2019-04-2918:08:38
l00p3r
hackerone.com
$200
59

7.8 High

CVSS3

Attack Vector

LOCAL

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

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

4.6 Medium

CVSS2

Access Vector

LOCAL

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:L/AC:L/Au:N/C:P/I:P/A:P

0.081 Low

EPSS

Percentile

93.4%

Summary:

A heap buffer overflow can occur at line 1114 in file lib/tftp.c due to the fact of state->blksize containing the default size instead of containing the one specified in the --tftp-blksize parameter.

This bug could lead to a crash or maybe toRCE in the case the attacker also had a memory leak.

Vulnerable line:

state->rbytes = (int)recvfrom(state->sockfd,
                                (void *)state->rpacket.data,
                                state->blksize + 4,
                                0,
                                (struct sockaddr *)&fromaddr,
                                &fromlen);

Steps To Reproduce:

  1. Download the server script
  2. Run it and bind to an address: $ python evil-server.py IP PORT
  3. Connect to that server with curl: $ curl --tftp-blksize N tftp://IP:PORT
    Where N should be a number lower than 293.

Impact

  • An attacker would also need a memory leak in order to gain full RCE.
  • The victim should explicitly set the --blksize argument to a value inferior to 293.

Thus, the impact is not very high but it’s still quite dangerous to not release a patch.

7.8 High

CVSS3

Attack Vector

LOCAL

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

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

4.6 Medium

CVSS2

Access Vector

LOCAL

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:L/AC:L/Au:N/C:P/I:P/A:P

0.081 Low

EPSS

Percentile

93.4%