Skip to content

Commit a33b2f9

Browse files
committed
adv_20170620: CVE-2017-XXXX
1 parent 399e3f4 commit a33b2f9

5 files changed

+128
-1
lines changed

CVE-2017-1000381.patch

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From e1f43d4d7e89ef8db479d6efd0389c6b6ee1d116 Mon Sep 17 00:00:00 2001
2+
From: David Drysdale <[email protected]>
3+
Date: Mon, 22 May 2017 10:54:10 +0100
4+
Subject: [PATCH 5/5] ares_parse_naptr_reply: check sufficient data
5+
6+
Check that there is enough data for the required elements
7+
of an NAPTR record (2 int16, 3 bytes for string lengths)
8+
before processing a record.
9+
---
10+
ares_parse_naptr_reply.c | 7 ++++++-
11+
1 file changed, 6 insertions(+), 1 deletion(-)
12+
13+
diff --git a/ares_parse_naptr_reply.c b/ares_parse_naptr_reply.c
14+
index 11634df9847c..717d35577811 100644
15+
--- a/ares_parse_naptr_reply.c
16+
+++ b/ares_parse_naptr_reply.c
17+
@@ -110,6 +110,12 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
18+
status = ARES_EBADRESP;
19+
break;
20+
}
21+
+ /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
22+
+ if (rr_len < 7)
23+
+ {
24+
+ status = ARES_EBADRESP;
25+
+ break;
26+
+ }
27+
28+
/* Check if we are really looking at a NAPTR record */
29+
if (rr_class == C_IN && rr_type == T_NAPTR)
30+
@@ -185,4 +191,3 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
31+
32+
return ARES_SUCCESS;
33+
}
34+
-
35+
--
36+
2.13.0.303.g4ebf302169-goog
37+

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ all: index.html license.html ares_init.html ares_init_options.html \
3232
ares_gethostbyname_file.html ares_set_socket_callback.html \
3333
ares_set_socket_configure_callback.html ares_set_sortlist.html \
3434
ares_parse_mx_reply.html ares_parse_naptr_reply.html \
35-
ares_set_local_dev.html ares_set_socket_functions.html
35+
ares_set_local_dev.html ares_set_socket_functions.html \
36+
adv_20170620.html
3637
make -C download
3738

3839
index.html: index.t $(MAINPARTS)
@@ -55,6 +56,11 @@ adv_20160929.html: adv_20160929.t $(MAINPARTS) adv_20160929.gen
5556
adv_20160929.gen: adv_20160929.md
5657
$(MARKDOWN) < $< > $@
5758

59+
adv_20170620.html: adv_20170620.t $(MAINPARTS) adv_20170620.gen
60+
$(ACTION)
61+
adv_20170620.gen: adv_20170620.md
62+
$(MARKDOWN) < $< > $@
63+
5864
old.html: old.t $(MAINPARTS)
5965
$(ACTION)
6066

adv_20170620.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
c-ares NAPTR parser out of bounds access
2+
========================================
3+
4+
Project c-ares Security Advisory, June 20, 2017 -
5+
[Permalink](https://c-ares.haxx.se/adv_20170620.html)
6+
7+
VULNERABILITY
8+
-------------
9+
10+
The c-ares function `ares_parse_naptr_reply()`, which is used for parsing
11+
NAPTR responses, could be triggered to read memory outside of the given input
12+
buffer if the passed in DNS response packet was crafted in a particular way.
13+
14+
We are not aware of any exploits of this flaw.
15+
16+
INFO
17+
----
18+
19+
The Common Vulnerabilities and Exposures (CVE) project has assigned the name
20+
CVE-2017-1000381 to this issue.
21+
22+
AFFECTED VERSIONS
23+
-----------------
24+
25+
This flaw exists in the following c-ares versions.
26+
27+
- Affected versions: c-ares 1.8.0 to and including 1.12.0
28+
- Not affected versions: c-ares >= 1.13.0
29+
30+
THE SOLUTION
31+
------------
32+
33+
In version 1.13.0, the `RR_len` value gets checked properly and the function
34+
is also added to the fuzz testing. It was previously accidentally left out
35+
from that.
36+
37+
A [patch for CVE-2017-1000381](https://c-ares.haxx.se/CVE-2017-1000381.patch)
38+
is available.
39+
40+
RECOMMENDATIONS
41+
---------------
42+
43+
We suggest you take one of the following actions immediately, in order of
44+
preference:
45+
46+
A - Upgrade c-ares to version 1.13.0
47+
48+
B - Apply the patch to your version and rebuild
49+
50+
C - Do not use `ares_parse_naptr_reply()`.
51+
52+
TIME LINE
53+
---------
54+
55+
It was reported to the c-ares project on May 20. We contacted distros@openall
56+
on June 16.
57+
58+
c-ares 1.13.0 was released on June 20 2017, coordinated with the publication
59+
of this advisory.
60+
61+
CREDITS
62+
-------
63+
64+
Thanks to LCatro for the report and to David Drysdale for the fix.

adv_20170620.t

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "doctype.t"
2+
<head>
3+
<title>ares_create_query single byte out of buffer write</title>
4+
#include "css.t"
5+
</head>
6+
#include "body.t"
7+
#include "setup.t"
8+
#include "menu.t"
9+
10+
TITLE(CVE-2017-1000381)
11+
BOXTOP
12+
#include "adv_20170620.gen"
13+
BOXBOT
14+
15+
#include "footer.t"

vulns.t

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ BOXTOP
1313
This is all known and public c-ares vulnerabilities to date. See also our <a
1414
href="security.html">security incident process</a>.
1515

16+
<p>
17+
SUBTITLE(CVE-2017-1000381 - June 20 2017)
18+
<p>
19+
<a href="adv_20170620.html">NAPTR parser out of bounds access</a>
20+
1621
<p>
1722
SUBTITLE(CVE-2016-5180 - Sep 29 2016)
1823
<p>

0 commit comments

Comments
 (0)