oss-sec mailing list archives
Re: two vulns in uClibc-0.9.33.2
From: Seth Arnold <seth.arnold () canonical com>
Date: Fri, 16 Jun 2017 13:44:37 -0700
On Fri, Jun 16, 2017 at 11:53:09AM +0800, fefe wrote:
I found two vulns in uClibc-0.9.33.2 (https://uclibc.org/) [...] The poc code like: if(regcomp (®tmp,"(.+)upper\\1^", REG_EXTENDED|REG_ICASE | REG_NOSUB )==0) { reg1match_t pmatch[1]; regexec(®tmp, "upperupperupperx",1, pmatch, 0); regfree(®tmp); } [...] The poc code like: if(regcomp (®tmp,"\x28\x2E\x3F\x3F\x28\x2E\x3F\x29\x5C\x42\x44\x3F\x3F\x28\x2E\x5C\x32\x29\x2A\x5C\x32\x28\x2E\x3F\x29\x5C\x32\x29\x2A\x5C\x32\xBD", REG_EXTENDED|REG_ICASE | REG_NOSUB )==0) { reg1match_t pmatch[1]; regexec(®tmp, "\x72\xFF\xFF\xFF\xFF\xBD",1, pmatch, 0); regfree(®tmp); }
A question to the wider list: Does it make sense to assign CVEs to regex compilation? Very few toolkits handle this well, and even given how many regex toolkits use backtracking, even 'safe' regexes can lead to essentially unbounded execution time. Some regex engines like Rust's regex and Go's regex should handle untrusted inputs well: they're non-backtracking engines and type-safe languages. Hypothetical crashes like this probably would qualify for CVEs in either of these environments. But I'm less convinced it makes sense with C-based engines to allow untrusted inputs. http://www.etalabs.net/compare_libcs.html suggests that uclibc's regex is DFA-based thus it's probably intended to allow untrusted inputs -- but is that explicitely stated as a goal anywhere? Thanks
Attachment:
signature.asc
Description:
Current thread:
- two vulns in uClibc-0.9.33.2 fefe (Jun 15)
- Re: two vulns in uClibc-0.9.33.2 Andrej Nemec (Jun 15)
- Re: two vulns in uClibc-0.9.33.2 Zach W (Jun 16)
- Re: two vulns in uClibc-0.9.33.2 Peter Korsgaard (Jun 16)
- Re: two vulns in uClibc-0.9.33.2 Seth Arnold (Jun 16)
- Re: two vulns in uClibc-0.9.33.2 Kurt Seifried (Jun 16)
- Re: two vulns in uClibc-0.9.33.2 Michal Zalewski (Jun 16)
- Re: two vulns in uClibc-0.9.33.2 Bob Friesenhahn (Jun 16)
- Re: two vulns in uClibc-0.9.33.2 Florian Weimer (Jun 17)
- Re: two vulns in uClibc-0.9.33.2 Michal Zalewski (Jun 17)
- Re: two vulns in uClibc-0.9.33.2 Simon McVittie (Jun 17)
- Re: two vulns in uClibc-0.9.33.2 Jakub Wilk (Jun 17)
- <Possible follow-ups>
- Re: two vulns in uClibc-0.9.33.2 fefe (Jun 20)
- Re: two vulns in uClibc-0.9.33.2 Waldemar Brodkorb (Jun 23)
- re: two vulns in uClibc-0.9.33.2 fefe (Jun 26)
- Re: two vulns in uClibc-0.9.33.2 Waldemar Brodkorb (Jun 23)