Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
curl
curl-7.37-CVE-2017-1000254.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File curl-7.37-CVE-2017-1000254.patch of Package curl
From 29b251362e1839d7094993edbed8f9467069773f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg <daniel@haxx.se> Date: Mon, 25 Sep 2017 00:35:22 +0200 Subject: [PATCH] FTP: zero terminate the entry path even on bad input ... a single double quote could leave the entry path buffer without a zero terminating byte. CVE-2017-1000254 Test 1152 added to verify. Reported-by: Max Dymond Bug: https://curl.haxx.se/docs/adv_20171004.html --- lib/ftp.c | 7 ++++-- tests/data/Makefile.inc | 1 + tests/data/test1152 | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 tests/data/test1152 Index: curl-7.37.0/lib/ftp.c =================================================================== --- curl-7.37.0.orig/lib/ftp.c +++ curl-7.37.0/lib/ftp.c @@ -2851,6 +2851,7 @@ static CURLcode ftp_statemach_act(struct char *ptr=&data->state.buffer[4]; /* start on the first letter */ char *dir; char *store; + bool entry_extracted = FALSE; dir = malloc(nread + 1); if(!dir) @@ -2882,7 +2883,7 @@ static CURLcode ftp_statemach_act(struct } else { /* end of path */ - *store = '\0'; /* zero terminate */ + entry_extracted = TRUE; break; /* get out of this loop */ } } @@ -2891,7 +2892,9 @@ static CURLcode ftp_statemach_act(struct store++; ptr++; } - + *store = '\0'; /* zero terminate */ + } + if(entry_extracted) { /* If the path name does not look like an absolute path (i.e.: it does not start with a '/'), we probably need some server-dependent adjustments. For example, this is the case when connecting to Index: curl-7.37.0/tests/data/test1152 =================================================================== --- /dev/null +++ curl-7.37.0/tests/data/test1152 @@ -0,0 +1,61 @@ +<testcase> +<info> +<keywords> +FTP +PASV +LIST +</keywords> +</info> +# +# Server-side +<reply> +<servercmd> +REPLY PWD 257 "just one +</servercmd> + +# When doing LIST, we get the default list output hard-coded in the test +# FTP server +<data mode="text"> +total 20 +drwxr-xr-x 8 98 98 512 Oct 22 13:06 . +drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. +drwxr-xr-x 2 98 98 512 May 2 1996 curl-releases +-r--r--r-- 1 0 1 35 Jul 16 1996 README +lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin +dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev +drwxrwxrwx 2 98 98 512 May 29 16:04 download.html +dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc +drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub +dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr +</data> +</reply> + +# +# Client-side +<client> +<server> +ftp +</server> + <name> +FTP with uneven quote in PWD response + </name> + <command> +ftp://%HOSTIP:%FTPPORT/test-1152/ +</command> +</client> + +# +# Verify data after the test has been "shot" +<verify> +<protocol> +USER anonymous +PASS ftp@example.com +PWD +CWD test-1152 +EPSV +TYPE A +LIST +QUIT +</protocol> +</verify> +</testcase> Index: curl-7.37.0/tests/data/Makefile.am =================================================================== --- curl-7.37.0.orig/tests/data/Makefile.am +++ curl-7.37.0/tests/data/Makefile.am @@ -97,7 +97,7 @@ test1096 test1097 test1098 test1099 test test1104 test1105 test1106 test1107 test1108 test1109 test1110 test1111 \ test1112 test1113 test1114 test1115 test1116 test1117 test1118 test1119 \ test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \ -test1128 test1129 test1130 test1131 test1132 test1133 test1134 \ +test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1152 \ \ test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ Index: curl-7.37.0/tests/data/Makefile.in =================================================================== --- curl-7.37.0.orig/tests/data/Makefile.in +++ curl-7.37.0/tests/data/Makefile.in @@ -405,7 +405,7 @@ test1096 test1097 test1098 test1099 test test1104 test1105 test1106 test1107 test1108 test1109 test1110 test1111 \ test1112 test1113 test1114 test1115 test1116 test1117 test1118 test1119 \ test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \ -test1128 test1129 test1130 test1131 test1132 test1133 test1134 \ +test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1152 \ \ test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor