Skip to content
Memory corruption Disclosed report Advanced CVE-2017-7521CVE-2017-7520CVE-2017-7508CVE-2017-7522

4 severe remote + several minor OpenVPN vulnerabilities

Several memory-safety bugs were found in OpenVPN's certificate and TLS handling, including double-frees, memory leaks, forced assertion failures and stack buffer corruption. An attacker, in some cases a man-in-the-middle, could crash the server or client, leak data, or corrupt memory.

guido Follow

Originally disclosed on HackerOne

  • Disclosed after 2.3 years

CVE-2017-7521 Remote server crashes/double-free/memory leaks in certificate processing CVE-2017-7520 Remote (including MITM) client crash, data leak CVE-2017-7508 Remote server crash (forced assertion failure) CVE-2017-7522 Crash mbed TLS/PolarSSL-based server (no cve) Remote/mitm Null-pointer dereference in establish_http_proxy_passthru() (no cve) Stack buffer overflow if long –tls-cipher is given (no cve) Remote (including MITM) client stack buffer corruption

https://community.openvpn.net/openvpn/wiki/VulnerabilitiesFixedInOpenVPN243 https://guidovranken.wordpress.com/2017/06/21/the-openvpn-post-audit-bug-bonanza/

The original report as published on HackerOne, by guido. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

This report is a bundle of seven OpenVPN vulnerabilities disclosed together under the Internet Bug Bounty programme. The researcher is credited as guido. The report itself is little more than a list: each entry gives a CVE identifier where one exists, a short description of the fault, and nothing else. There are no requests, payloads, commands, versions, affected configurations or reproduction steps in the text, so this section can only restate the list faithfully.

The seven entries are:

  1. CVE-2017-7521: remote server crashes, double-free and memory leaks in certificate processing.
  2. CVE-2017-7520: remote client crash and data leak, including via a man-in-the-middle.
  3. CVE-2017-7508: remote server crash caused by a forced assertion failure.
  4. CVE-2017-7522: crash of a server built against mbed TLS/PolarSSL.
  5. No CVE: remote or man-in-the-middle null-pointer dereference in establish_http_proxy_passthru().
  6. No CVE: stack buffer overflow when a long --tls-cipher value is supplied.
  7. No CVE: remote client stack buffer corruption, including via a man-in-the-middle.

The report closes with two links: the OpenVPN community wiki page listing the vulnerabilities fixed in OpenVPN 2.4.3, and a blog post by the researcher. The platform records the severity as high and the disclosure date as 14 October 2019. The report gives no bounty amount, no CVSS score and no weakness classification, and it does not describe the fixes beyond pointing at the 2.4.3 release notes.

Root cause

Taken together, the entries point to memory-safety defects in OpenVPN's parsing of attacker-influenced input. Certificate processing is named for the double-free and memory leaks (CVE-2017-7521), a forced assertion failure for the server crash (CVE-2017-7508), and a stack buffer overflow for an over-long --tls-cipher argument. The HTTP proxy passthrough path contains a null-pointer dereference. The mbed TLS/PolarSSL entry suggests a fault that only manifests with that particular TLS backend. The report gives only short descriptions of each fault and no root-cause analysis. The report does not analyse any of these faults in detail, so the exact defective line in each case is not stated.

Impact

The report's own wording is the limit of what can be claimed. On the server side an attacker can cause crashes, a double-free and memory leaks through certificate processing, and a crash through a forced assertion failure. On the client side an attacker, including one positioned as a man-in-the-middle, can cause a crash, leak data, and corrupt the client stack. A server built against mbed TLS/PolarSSL can be crashed. The null-pointer dereference in establish_http_proxy_passthru() is reachable remotely or by a man-in-the-middle. The stack buffer overflow from a long --tls-cipher value is listed without a remote or local qualifier. Whether any of these lead to code execution is not stated; the report describes crashes, leaks and corruption, and leaves the consequence there.

How this kind of bug works

This is the family of memory-safety bugs that appear when a network daemon parses structured input from an untrusted peer. Certificates, TLS cipher lists and proxy responses are all variable-length, nested and partly attacker-controlled. A parser that assumes a field fits a fixed buffer, that frees an object on one error path and again on another, or that dereferences a pointer without checking it returned non-null, will misbehave when the input is malformed or simply larger than expected.

A double-free corrupts the allocator's bookkeeping and can be turned into controlled writes. A stack buffer overflow overwrites the return address or adjacent locals. A null-pointer dereference is usually only a crash, but in a privileged or long-running daemon a crash is still a denial of service. Assertion failures are the same story: a condition the developer believed impossible is reached by crafted input, and the process aborts. Memory leaks matter less on their own but become a denial of service when a remote peer can trigger them repeatedly.

The defences are the usual ones: bounds-checked copies, length validation before allocation, single ownership of freed objects, null checks on every allocation and lookup, and building with stack canaries, ASLR and, where possible, a memory-safe language or hardened allocator. Assertions should not be the only guard on input-reachable paths.

How to test for it

  1. Identify the parsing surface: certificate handling, cipher and protocol negotiation, proxy configuration and any option that takes a string from the peer or the operator.
  2. Build or obtain a debug build with sanitizers enabled, so that overflows, double-frees and leaks are reported rather than silently tolerated.
  3. Send well-formed traffic first to establish a baseline, then mutate one field at a time: oversized lengths, truncated structures, unexpected nulls, repeated free-triggering error paths, and very long option values.
  4. For man-in-the-middle reachable paths, place a proxy between client and server and return malformed responses, including a proxy authentication challenge.
  5. A positive result is a sanitizer report, a crash with a stack trace pointing into the parser, or a reproducible assertion failure. Record the exact input and the build that produced it.

Common false positives are crashes caused by the test harness rather than the target, sanitizer reports in third-party libraries that the project does not control, and leaks that only occur at shutdown. Confirm each finding against an unmodified build before reporting.

How it is fixed

The standard fixes are to validate lengths before copying, to check every allocation and lookup for null, to restructure error paths so each object is freed exactly once, and to replace input-reachable assertions with graceful error handling. The report links the OpenVPN wiki page listing the vulnerabilities fixed in OpenVPN 2.4.3. Where a backend such as mbed TLS/PolarSSL is involved, the fix may sit in how the project uses that library rather than in the library itself.

Hunting notes

Memory-safety bugs of this kind cluster in code that parses network input: TLS handshakes, certificate chains, proxy negotiation, protocol option strings and any custom binary format. Recon signals include a project that has recently had an external audit, a history of sanitizer fixes, C code handling untrusted lengths, and multiple TLS backends. To get a report accepted, demonstrate the crash or corruption reproducibly on a current build, include the sanitizer output and the exact input, and state clearly what an attacker gains: denial of service, information disclosure, or a path towards code execution. Where the impact is only a crash, say so plainly rather than overstating it.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

This report is a bundle of seven security bugs in OpenVPN, a widely used program that creates encrypted tunnels (VPNs) between computers. The platform records the severity as high. The researcher is credited as guido, and the report was disclosed on 14 October 2019 under the Internet Bug Bounty programme. The report itself is little more than a list: each entry gives a CVE identifier where one exists, a short description of the fault, and nothing else. There are no requests, payloads, commands, versions, affected configurations or reproduction steps in the text, so this section can only restate the list faithfully.

The seven entries are:

  1. CVE-2017-7521: remote server crashes, double-free and memory leaks in certificate processing.
  2. CVE-2017-7520: remote client crash and data leak, including via a man-in-the-middle.
  3. CVE-2017-7508: remote server crash caused by a forced assertion failure.
  4. CVE-2017-7522: crash of a server built against mbed TLS/PolarSSL.
  5. No CVE: remote or man-in-the-middle null-pointer dereference in establish_http_proxy_passthru().
  6. No CVE: stack buffer overflow when a long --tls-cipher value is supplied.
  7. No CVE: remote client stack buffer corruption, including via a man-in-the-middle.

The report closes with two links: the OpenVPN community wiki page listing the vulnerabilities fixed in OpenVPN 2.4.3, and a blog post by the researcher. The platform records the severity as high and the disclosure date as 14 October 2019. The report gives no bounty amount, no CVSS score and no weakness classification, and it does not describe the fixes beyond pointing at the 2.4.3 release notes.

Root cause

Taken together, the entries point to memory-safety defects in OpenVPN's parsing of attacker-influenced input. Certificate processing is named for the double-free and memory leaks (CVE-2017-7521), a forced assertion failure for the server crash (CVE-2017-7508), and a stack buffer overflow for an over-long --tls-cipher argument. The HTTP proxy passthrough path contains a null-pointer dereference. The mbed TLS/PolarSSL entry suggests a fault that only manifests with that particular TLS backend. The report gives only short descriptions of each fault and no root-cause analysis. The report does not analyse any of these faults in detail, so the exact defective line in each case is not stated.

Impact

The report's own wording is the limit of what can be claimed. On the server side an attacker can cause crashes, a double-free and memory leaks through certificate processing, and a crash through a forced assertion failure. On the client side an attacker, including one positioned as a man-in-the-middle, can cause a crash, leak data, and corrupt the client stack. A server built against mbed TLS/PolarSSL can be crashed. The null-pointer dereference in establish_http_proxy_passthru() is reachable remotely or by a man-in-the-middle. The stack buffer overflow from a long --tls-cipher value is listed without a remote or local qualifier. Whether any of these lead to code execution is not stated; the report describes crashes, leaks and corruption, and leaves the consequence there.

How this kind of bug works

In general, this is the family of memory-safety bugs that appear when a network daemon parses structured input from an untrusted peer. Certificates, TLS cipher lists and proxy responses are all variable-length, nested and partly attacker-controlled. A parser that assumes a field fits a fixed buffer, that frees an object on one error path and again on another, or that dereferences a pointer without checking it returned non-null, will misbehave when the input is malformed or simply larger than expected.

A double-free corrupts the allocator's bookkeeping and can be turned into controlled writes. A stack buffer overflow overwrites the return address or adjacent locals. A null-pointer dereference is usually only a crash, but in a privileged or long-running daemon a crash is still a denial of service. Assertion failures are the same story: a condition the developer believed impossible is reached by crafted input, and the process aborts. Memory leaks matter less on their own but become a denial of service when a remote peer can trigger them repeatedly.

The defences are the usual ones: bounds-checked copies, length validation before allocation, single ownership of freed objects, null checks on every allocation and lookup, and building with stack canaries, ASLR and, where possible, a memory-safe language or hardened allocator. Assertions should not be the only guard on input-reachable paths.

How to test for it

  1. Identify the parsing surface: certificate handling, cipher and protocol negotiation, proxy configuration and any option that takes a string from the peer or the operator.
  2. Build or obtain a debug build with sanitizers enabled, so that overflows, double-frees and leaks are reported rather than silently tolerated.
  3. Send well-formed traffic first to establish a baseline, then mutate one field at a time: oversized lengths, truncated structures, unexpected nulls, repeated free-triggering error paths, and very long option values.
  4. For man-in-the-middle reachable paths, place a proxy between client and server and return malformed responses, including a proxy authentication challenge.
  5. A positive result is a sanitizer report, a crash with a stack trace pointing into the parser, or a reproducible assertion failure. Record the exact input and the build that produced it.

Common false positives are crashes caused by the test harness rather than the target, sanitizer reports in third-party libraries that the project does not control, and leaks that only occur at shutdown. Confirm each finding against an unmodified build before reporting.

How it is fixed

The standard fixes are to validate lengths before copying, to check every allocation and lookup for null, to restructure error paths so each object is freed exactly once, and to replace input-reachable assertions with graceful error handling. The report links the OpenVPN wiki page listing the vulnerabilities fixed in OpenVPN 2.4.3. Where a backend such as mbed TLS/PolarSSL is involved, the fix may sit in how the project uses that library rather than in the library itself.

Hunting notes

Memory-safety bugs of this kind cluster in code that parses network input: TLS handshakes, certificate chains, proxy negotiation, protocol option strings and any custom binary format. Recon signals include a project that has recently had an external audit, a history of sanitizer fixes, C code handling untrusted lengths, and multiple TLS backends. To get a report accepted, demonstrate the crash or corruption reproducibly on a current build, include the sanitizer output and the exact input, and state clearly what an attacker gains: denial of service, information disclosure, or a path towards code execution. Where the impact is only a crash, say so plainly rather than overstating it.

Glossary

  • OpenVPN: a program that builds encrypted tunnels (VPNs) between computers over the internet.
  • VPN: a private network connection carried over a public network, so traffic is encrypted and appears to come from the VPN endpoint.
  • CVE: a public identifier for a known security vulnerability, so people can refer to the same bug unambiguously.
  • Internet Bug Bounty: a programme that pays researchers for reporting security bugs in widely used internet software.
  • Severity: a rough rating of how serious a bug is, often high, medium or low.
  • CVSS: a standard scoring system that turns the characteristics of a vulnerability into a number.
  • Double-free: a bug where the same block of memory is released twice, corrupting the memory manager's records.
  • Memory leak: a bug where memory is reserved and never released, so the program's memory use keeps growing.
  • Certificate processing: the part of a program that reads and checks digital certificates, which are files that prove identity in encrypted connections.
  • Man-in-the-middle (MITM): an attacker who sits between two parties and can read or alter their traffic.
  • Assertion failure: a check in the code that says "this should never happen"; when it does happen, the program stops.
  • mbed TLS/PolarSSL: a small library that implements TLS, the encryption protocol behind HTTPS and VPNs; OpenVPN can be built to use it.
  • Null-pointer dereference: using a pointer that points to nothing, which usually makes the program crash.
  • Stack buffer overflow: writing more data into a fixed-size area of memory than it can hold, overwriting nearby data.
  • Stack buffer corruption: damage to that same fixed-size memory area, which can change the program's behaviour or crash it.
  • --tls-cipher: an OpenVPN command-line option that lists which encryption ciphers to allow.
  • TLS: the protocol that encrypts and authenticates connections, used by HTTPS and by OpenVPN.
  • Cipher: an algorithm that encrypts and decrypts data.
  • Parser: the part of a program that reads structured input and turns it into internal data.
  • Allocator: the part of a program that hands out and reclaims memory.
  • Denial of service (DoS): making a service unavailable, for example by crashing it repeatedly.
  • Sanitizer: a debugging tool that detects memory errors such as overflows and double-frees while a program runs.
  • Stack canary: a small value placed on the stack to detect overflow before it can do damage.
  • ASLR: address space layout randomisation, which makes memory addresses unpredictable to attackers.
  • Hardened allocator: a memory manager built to detect and resist common memory-corruption attacks.
  • False positive: a finding that looks like a bug but is not a real problem in the target.
  • Point release: a small update that fixes bugs without adding major new features.

More by guido

View all

49 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.