Bug 1360743 (CVE-2016-6354)
Summary: | CVE-2016-6354 flex: buffer overflow in generated code (yy_get_next_buffer) | ||
---|---|---|---|
Product: | [Other] Security Response | Reporter: | Martin Prpič <mprpic> |
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | unspecified | CC: | adrian, fidencio, me, pfrankli |
Target Milestone: | --- | Keywords: | Security |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | flex 2.6.1 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-12-14 05:56:04 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1360744 | ||
Bug Blocks: | 1360746 |
Description
Martin Prpič
2016-07-27 11:46:07 UTC
Created flex tracking bugs for this issue: Affects: fedora-all [bug 1360744] flex-2.6.0-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report. This flaw was introduced in flex-2.5.36, fixed in 2.6.1. Testing with flex-2.5.37 on rhel-7 and using a simple lexer that consumes arbitrarily long tokens, I have been unable to cause a segmentation fault or oob read (using valgrind and clang/asan). Instrumenting the generated lex.yy.c to track yyalloc()/yyrealloc(), the lexer's behaviour seems to be safe. I think the potential security impact is mitigated by the following code immediately after the affected loop, which constrains the max number of bytes read to 8192: if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; Once num_to_read reaches 0, the buffer is reallocated correctly and filled in 8192-byte (or smaller) chunks. Looks like this may not be a security flaw at all, though this analysis should be confirmed with upstream. |