cve_id
stringlengths
13
16
obtain_all_privilege
stringclasses
3 values
obtain_user_privilege
stringclasses
2 values
obtain_other_privilege
stringclasses
2 values
user_interaction_required
stringclasses
3 values
cvss2_vector_string
stringclasses
106 values
cvss2_access_vector
stringclasses
4 values
cvss2_access_complexity
stringclasses
4 values
cvss2_authentication
stringclasses
3 values
cvss2_confidentiality_impact
stringclasses
4 values
cvss2_integrity_impact
stringclasses
4 values
cvss2_availability_impact
stringclasses
4 values
cvss2_base_score
stringclasses
50 values
cvss3_vector_string
stringclasses
226 values
cvss3_attack_vector
stringclasses
5 values
cvss3_attack_complexity
stringclasses
3 values
cvss3_privileges_required
stringclasses
4 values
cvss3_user_interaction
stringclasses
3 values
cvss3_scope
stringclasses
3 values
cvss3_confidentiality_impact
stringclasses
4 values
cvss3_integrity_impact
stringclasses
4 values
cvss3_availability_impact
stringclasses
4 values
cvss3_base_score
stringclasses
55 values
cvss3_base_severity
stringclasses
5 values
exploitability_score
stringclasses
22 values
impact_score
stringclasses
15 values
ac_insuf_info
stringclasses
3 values
reference_json
stringlengths
221
23.3k
problemtype_json
stringclasses
200 values
severity
stringclasses
4 values
cve_nodes
stringlengths
2
33.1k
cve_description
stringlengths
64
1.99k
cve_last_modified_date
stringlengths
17
17
cve_published_date
stringlengths
17
17
cwe_name
stringclasses
125 values
cwe_description
stringclasses
124 values
cwe_extended_description
stringclasses
95 values
cwe_url
stringclasses
124 values
cwe_is_category
int64
0
1
commit_author
stringlengths
0
34
commit_author_date
stringlengths
25
25
commit_msg
stringlengths
0
13.3k
commit_hash
stringlengths
40
40
commit_is_merge
stringclasses
1 value
repo_name
stringclasses
467 values
repo_description
stringclasses
459 values
repo_date_created
stringclasses
467 values
repo_date_last_push
stringclasses
467 values
repo_homepage
stringclasses
294 values
repo_owner
stringclasses
470 values
repo_stars
stringclasses
406 values
repo_forks
stringclasses
352 values
function_name
stringlengths
3
120
function_signature
stringlengths
6
640
function_parameters
stringlengths
2
302
function
stringlengths
12
114k
function_token_count
stringlengths
1
5
function_before_change
stringclasses
1 value
labels
int64
1
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_async_funcdef
ast_for_async_funcdef( struct compiling * c , const node * n , asdl_seq * decorator_seq)
['c', 'n', 'decorator_seq']
ast_for_async_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* async_funcdef: ASYNC funcdef */ REQ(n, async_funcdef); REQ(CHILD(n, 0), ASYNC); REQ(CHILD(n, 1), funcdef); return ast_for_funcdef_impl(c, CHILD(n, 1), decorator_seq, 1 /* is_async */); }
66
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_async_stmt
ast_for_async_stmt( struct compiling * c , const node * n)
['c', 'n']
ast_for_async_stmt(struct compiling *c, const node *n) { /* async_stmt: ASYNC (funcdef | with_stmt | for_stmt) */ REQ(n, async_stmt); REQ(CHILD(n, 0), ASYNC); switch (TYPE(CHILD(n, 1))) { case funcdef: return ast_for_funcdef_impl(c, CHILD(n, 1), NULL, 1 /* is_async */); case with_stmt: return ast_for_with_stmt(c, CHILD(n, 1), 1 /* is_async */); case for_stmt: return ast_for_for_stmt(c, CHILD(n, 1), 1 /* is_async */); default: PyErr_Format(PyExc_SystemError, "invalid async stament: %s", STR(CHILD(n, 1))); return NULL; } }
125
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_async_stmt
ast_for_async_stmt( struct compiling * c , const node * n)
['c', 'n']
ast_for_async_stmt(struct compiling *c, const node *n) { /* async_stmt: ASYNC (funcdef | with_stmt | for_stmt) */ REQ(n, async_stmt); REQ(CHILD(n, 0), ASYNC); switch (TYPE(CHILD(n, 1))) { case funcdef: return ast_for_funcdef_impl(c, CHILD(n, 1), NULL, 1 /* is_async */); case with_stmt: return ast_for_with_stmt(c, CHILD(n, 1), 1 /* is_async */); case for_stmt: return ast_for_for_stmt(c, CHILD(n, 1), 1 /* is_async */); default: PyErr_Format(PyExc_SystemError, "invalid async stament: %s", STR(CHILD(n, 1))); return NULL; } }
125
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_atom
ast_for_atom( struct compiling * c , const node * n)
['c', 'n']
ast_for_atom(struct compiling *c, const node *n) { /* atom: '(' [yield_expr|testlist_comp] ')' | '[' [testlist_comp] ']' | '{' [dictmaker|testlist_comp] '}' | NAME | NUMBER | STRING+ | '...' | 'None' | 'True' | 'False' */ node *ch = CHILD(n, 0); switch (TYPE(ch)) { case NAME: { PyObject *name; const char *s = STR(ch); size_t len = strlen(s); if (len >= 4 && len <= 5) { if (!strcmp(s, "None")) return NameConstant(Py_None, LINENO(n), n->n_col_offset, c->c_arena); if (!strcmp(s, "True")) return NameConstant(Py_True, LINENO(n), n->n_col_offset, c->c_arena); if (!strcmp(s, "False")) return NameConstant(Py_False, LINENO(n), n->n_col_offset, c->c_arena); } name = new_identifier(s, c); if (!name) return NULL; /* All names start in Load context, but may later be changed. */ return Name(name, Load, LINENO(n), n->n_col_offset, c->c_arena); } case STRING: { expr_ty str = parsestrplus(c, n); if (!str) { const char *errtype = NULL; if (PyErr_ExceptionMatches(PyExc_UnicodeError)) errtype = "unicode error"; else if (PyErr_ExceptionMatches(PyExc_ValueError)) errtype = "value error"; if (errtype) { char buf[128]; const char *s = NULL; PyObject *type, *value, *tback, *errstr; PyErr_Fetch(&type, &value, &tback); errstr = PyObject_Str(value); if (errstr) s = PyUnicode_AsUTF8(errstr); if (s) { PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s); } else { PyErr_Clear(); PyOS_snprintf(buf, sizeof(buf), "(%s) unknown error", errtype); } Py_XDECREF(errstr); ast_error(c, n, buf); Py_DECREF(type); Py_XDECREF(value); Py_XDECREF(tback); } return NULL; } return str; } case NUMBER: { PyObject *pynum; const char *s = STR(ch); /* Underscores in numeric literals are only allowed in Python 3.6 or greater */ /* Check for underscores here rather than in parse_number so we can report a line number on error */ if (c->c_feature_version < 6 && strchr(s, '_') != NULL) { ast_error(c, ch, "Underscores in numeric literals are only supported in Python 3.6 and greater"); return NULL; } pynum = parsenumber(c, s); if (!pynum) return NULL; if (PyArena_AddPyObject(c->c_arena, pynum) < 0) { Py_DECREF(pynum); return NULL; } return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena); } case ELLIPSIS: /* Ellipsis */ return Ellipsis(LINENO(n), n->n_col_offset, c->c_arena); case LPAR: /* some parenthesized expressions */ ch = CHILD(n, 1); if (TYPE(ch) == RPAR) return Tuple(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena); if (TYPE(ch) == yield_expr) return ast_for_expr(c, ch); /* testlist_comp: test ( comp_for | (',' test)* [','] ) */ if ((NCH(ch) > 1) && (TYPE(CHILD(ch, 1)) == comp_for)) return ast_for_genexp(c, ch); return ast_for_testlist(c, ch); case LSQB: /* list (or list comprehension) */ ch = CHILD(n, 1); if (TYPE(ch) == RSQB) return List(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena); REQ(ch, testlist_comp); if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) { asdl_seq *elts = seq_for_testlist(c, ch); if (!elts) return NULL; return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena); } else return ast_for_listcomp(c, ch); case LBRACE: { /* dictorsetmaker: ( ((test ':' test | '**' test) * (comp_for | (',' (test ':' test | '**' test))* [','])) | * ((test | '*' test) * (comp_for | (',' (test | '*' test))* [','])) ) */ expr_ty res; ch = CHILD(n, 1); if (TYPE(ch) == RBRACE) { /* It's an empty dict. */ return Dict(NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); } else { int is_dict = (TYPE(CHILD(ch, 0)) == DOUBLESTAR); if (NCH(ch) == 1 || (NCH(ch) > 1 && TYPE(CHILD(ch, 1)) == COMMA)) { /* It's a set display. */ res = ast_for_setdisplay(c, ch); } else if (NCH(ch) > 1 && TYPE(CHILD(ch, 1)) == comp_for) { /* It's a set comprehension. */ res = ast_for_setcomp(c, ch); } else if (NCH(ch) > 3 - is_dict && TYPE(CHILD(ch, 3 - is_dict)) == comp_for) { /* It's a dictionary comprehension. */ if (is_dict) { ast_error(c, n, "dict unpacking cannot be used in " "dict comprehension"); return NULL; } res = ast_for_dictcomp(c, ch); } else { /* It's a dictionary display. */ res = ast_for_dictdisplay(c, ch); } if (res) { res->lineno = LINENO(n); res->col_offset = n->n_col_offset; } return res; } } default: PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch)); return NULL; } }
994
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_atom
ast_for_atom( struct compiling * c , const node * n)
['c', 'n']
ast_for_atom(struct compiling *c, const node *n) { /* atom: '(' [yield_expr|testlist_comp] ')' | '[' [testlist_comp] ']' | '{' [dictmaker|testlist_comp] '}' | NAME | NUMBER | STRING+ | '...' | 'None' | 'True' | 'False' */ node *ch = CHILD(n, 0); switch (TYPE(ch)) { case NAME: { PyObject *name; const char *s = STR(ch); size_t len = strlen(s); if (len >= 4 && len <= 5) { if (!strcmp(s, "None")) return NameConstant(Py_None, LINENO(n), n->n_col_offset, c->c_arena); if (!strcmp(s, "True")) return NameConstant(Py_True, LINENO(n), n->n_col_offset, c->c_arena); if (!strcmp(s, "False")) return NameConstant(Py_False, LINENO(n), n->n_col_offset, c->c_arena); } name = new_identifier(s, c); if (!name) return NULL; /* All names start in Load context, but may later be changed. */ return Name(name, Load, LINENO(n), n->n_col_offset, c->c_arena); } case STRING: { expr_ty str = parsestrplus(c, n); if (!str) { const char *errtype = NULL; if (PyErr_ExceptionMatches(PyExc_UnicodeError)) errtype = "unicode error"; else if (PyErr_ExceptionMatches(PyExc_ValueError)) errtype = "value error"; if (errtype) { char buf[128]; const char *s = NULL; PyObject *type, *value, *tback, *errstr; PyErr_Fetch(&type, &value, &tback); errstr = PyObject_Str(value); if (errstr) s = PyUnicode_AsUTF8(errstr); if (s) { PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s); } else { PyErr_Clear(); PyOS_snprintf(buf, sizeof(buf), "(%s) unknown error", errtype); } Py_XDECREF(errstr); ast_error(c, n, buf); Py_DECREF(type); Py_XDECREF(value); Py_XDECREF(tback); } return NULL; } return str; } case NUMBER: { PyObject *pynum; const char *s = STR(ch); /* Underscores in numeric literals are only allowed in Python 3.6 or greater */ /* Check for underscores here rather than in parse_number so we can report a line number on error */ if (c->c_feature_version < 6 && strchr(s, '_') != NULL) { ast_error(c, ch, "Underscores in numeric literals are only supported in Python 3.6 and greater"); return NULL; } pynum = parsenumber(c, s); if (!pynum) return NULL; if (PyArena_AddPyObject(c->c_arena, pynum) < 0) { Py_DECREF(pynum); return NULL; } return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena); } case ELLIPSIS: /* Ellipsis */ return Ellipsis(LINENO(n), n->n_col_offset, c->c_arena); case LPAR: /* some parenthesized expressions */ ch = CHILD(n, 1); if (TYPE(ch) == RPAR) return Tuple(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena); if (TYPE(ch) == yield_expr) return ast_for_expr(c, ch); /* testlist_comp: test ( comp_for | (',' test)* [','] ) */ if ((NCH(ch) > 1) && (TYPE(CHILD(ch, 1)) == comp_for)) return ast_for_genexp(c, ch); return ast_for_testlist(c, ch); case LSQB: /* list (or list comprehension) */ ch = CHILD(n, 1); if (TYPE(ch) == RSQB) return List(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena); REQ(ch, testlist_comp); if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) { asdl_seq *elts = seq_for_testlist(c, ch); if (!elts) return NULL; return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena); } else return ast_for_listcomp(c, ch); case LBRACE: { /* dictorsetmaker: ( ((test ':' test | '**' test) * (comp_for | (',' (test ':' test | '**' test))* [','])) | * ((test | '*' test) * (comp_for | (',' (test | '*' test))* [','])) ) */ expr_ty res; ch = CHILD(n, 1); if (TYPE(ch) == RBRACE) { /* It's an empty dict. */ return Dict(NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); } else { int is_dict = (TYPE(CHILD(ch, 0)) == DOUBLESTAR); if (NCH(ch) == 1 || (NCH(ch) > 1 && TYPE(CHILD(ch, 1)) == COMMA)) { /* It's a set display. */ res = ast_for_setdisplay(c, ch); } else if (NCH(ch) > 1 && TYPE(CHILD(ch, 1)) == comp_for) { /* It's a set comprehension. */ res = ast_for_setcomp(c, ch); } else if (NCH(ch) > 3 - is_dict && TYPE(CHILD(ch, 3 - is_dict)) == comp_for) { /* It's a dictionary comprehension. */ if (is_dict) { ast_error(c, n, "dict unpacking cannot be used in " "dict comprehension"); return NULL; } res = ast_for_dictcomp(c, ch); } else { /* It's a dictionary display. */ res = ast_for_dictdisplay(c, ch); } if (res) { res->lineno = LINENO(n); res->col_offset = n->n_col_offset; } return res; } } default: PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch)); return NULL; } }
994
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_atom_expr
ast_for_atom_expr( struct compiling * c , const node * n)
['c', 'n']
ast_for_atom_expr(struct compiling *c, const node *n) { int i, nch, start = 0; expr_ty e, tmp; REQ(n, atom_expr); nch = NCH(n); if (TYPE(CHILD(n, 0)) == AWAIT) { if (c->c_feature_version < 5) { ast_error(c, n, "Await expressions are only supported in Python 3.5 and greater"); return NULL; } start = 1; assert(nch > 1); } e = ast_for_atom(c, CHILD(n, start)); if (!e) return NULL; if (nch == 1) return e; if (start && nch == 2) { return Await(e, LINENO(n), n->n_col_offset, c->c_arena); } for (i = start + 1; i < nch; i++) { node *ch = CHILD(n, i); if (TYPE(ch) != trailer) break; tmp = ast_for_trailer(c, ch, e); if (!tmp) return NULL; tmp->lineno = e->lineno; tmp->col_offset = e->col_offset; e = tmp; } if (start) { /* there was an AWAIT */ return Await(e, LINENO(n), n->n_col_offset, c->c_arena); } else { return e; } }
260
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_atom_expr
ast_for_atom_expr( struct compiling * c , const node * n)
['c', 'n']
ast_for_atom_expr(struct compiling *c, const node *n) { int i, nch, start = 0; expr_ty e, tmp; REQ(n, atom_expr); nch = NCH(n); if (TYPE(CHILD(n, 0)) == AWAIT) { if (c->c_feature_version < 5) { ast_error(c, n, "Await expressions are only supported in Python 3.5 and greater"); return NULL; } start = 1; assert(nch > 1); } e = ast_for_atom(c, CHILD(n, start)); if (!e) return NULL; if (nch == 1) return e; if (start && nch == 2) { return Await(e, LINENO(n), n->n_col_offset, c->c_arena); } for (i = start + 1; i < nch; i++) { node *ch = CHILD(n, i); if (TYPE(ch) != trailer) break; tmp = ast_for_trailer(c, ch, e); if (!tmp) return NULL; tmp->lineno = e->lineno; tmp->col_offset = e->col_offset; e = tmp; } if (start) { /* there was an AWAIT */ return Await(e, LINENO(n), n->n_col_offset, c->c_arena); } else { return e; } }
260
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_call
ast_for_call( struct compiling * c , const node * n , expr_ty func)
['c', 'n', 'func']
ast_for_call(struct compiling *c, const node *n, expr_ty func) { /* arglist: argument (',' argument)* [','] argument: ( test [comp_for] | '*' test | test '=' test | '**' test ) */ int i, nargs, nkeywords, ngens; int ndoublestars; asdl_seq *args; asdl_seq *keywords; REQ(n, arglist); nargs = 0; nkeywords = 0; ngens = 0; for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == argument) { if (NCH(ch) == 1) nargs++; else if (TYPE(CHILD(ch, 1)) == comp_for) ngens++; else if (TYPE(CHILD(ch, 0)) == STAR) nargs++; else /* TYPE(CHILD(ch, 0)) == DOUBLESTAR or keyword argument */ nkeywords++; } } if (ngens > 1 || (ngens && (nargs || nkeywords))) { ast_error(c, n, "Generator expression must be parenthesized " "if not sole argument"); return NULL; } if (nargs + nkeywords + ngens > 255) { ast_error(c, n, "more than 255 arguments"); return NULL; } args = _Ta3_asdl_seq_new(nargs + ngens, c->c_arena); if (!args) return NULL; keywords = _Ta3_asdl_seq_new(nkeywords, c->c_arena); if (!keywords) return NULL; nargs = 0; /* positional arguments + iterable argument unpackings */ nkeywords = 0; /* keyword arguments + keyword argument unpackings */ ndoublestars = 0; /* just keyword argument unpackings */ for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == argument) { expr_ty e; node *chch = CHILD(ch, 0); if (NCH(ch) == 1) { /* a positional argument */ if (nkeywords) { if (ndoublestars) { ast_error(c, chch, "positional argument follows " "keyword argument unpacking"); } else { ast_error(c, chch, "positional argument follows " "keyword argument"); } return NULL; } e = ast_for_expr(c, chch); if (!e) return NULL; asdl_seq_SET(args, nargs++, e); } else if (TYPE(chch) == STAR) { /* an iterable argument unpacking */ expr_ty starred; if (ndoublestars) { ast_error(c, chch, "iterable argument unpacking follows " "keyword argument unpacking"); return NULL; } e = ast_for_expr(c, CHILD(ch, 1)); if (!e) return NULL; starred = Starred(e, Load, LINENO(chch), chch->n_col_offset, c->c_arena); if (!starred) return NULL; asdl_seq_SET(args, nargs++, starred); } else if (TYPE(chch) == DOUBLESTAR) { /* a keyword argument unpacking */ keyword_ty kw; i++; e = ast_for_expr(c, CHILD(ch, 1)); if (!e) return NULL; kw = keyword(NULL, e, c->c_arena); asdl_seq_SET(keywords, nkeywords++, kw); ndoublestars++; } else if (TYPE(CHILD(ch, 1)) == comp_for) { /* the lone generator expression */ e = ast_for_genexp(c, ch); if (!e) return NULL; asdl_seq_SET(args, nargs++, e); } else { /* a keyword argument */ keyword_ty kw; identifier key, tmp; int k; /* chch is test, but must be an identifier? */ e = ast_for_expr(c, chch); if (!e) return NULL; /* f(lambda x: x[0] = 3) ends up getting parsed with * LHS test = lambda x: x[0], and RHS test = 3. * SF bug 132313 points out that complaining about a keyword * then is very confusing. */ if (e->kind == Lambda_kind) { ast_error(c, chch, "lambda cannot contain assignment"); return NULL; } else if (e->kind != Name_kind) { ast_error(c, chch, "keyword can't be an expression"); return NULL; } else if (forbidden_name(c, e->v.Name.id, ch, 1)) { return NULL; } key = e->v.Name.id; for (k = 0; k < nkeywords; k++) { tmp = ((keyword_ty)asdl_seq_GET(keywords, k))->arg; if (tmp && !PyUnicode_Compare(tmp, key)) { ast_error(c, chch, "keyword argument repeated"); return NULL; } } e = ast_for_expr(c, CHILD(ch, 2)); if (!e) return NULL; kw = keyword(key, e, c->c_arena); if (!kw) return NULL; asdl_seq_SET(keywords, nkeywords++, kw); } } } return Call(func, args, keywords, func->lineno, func->col_offset, c->c_arena); }
834
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_call
ast_for_call( struct compiling * c , const node * n , expr_ty func)
['c', 'n', 'func']
ast_for_call(struct compiling *c, const node *n, expr_ty func) { /* arglist: argument (',' argument)* [','] argument: ( test [comp_for] | '*' test | test '=' test | '**' test ) */ int i, nargs, nkeywords, ngens; int ndoublestars; asdl_seq *args; asdl_seq *keywords; REQ(n, arglist); nargs = 0; nkeywords = 0; ngens = 0; for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == argument) { if (NCH(ch) == 1) nargs++; else if (TYPE(CHILD(ch, 1)) == comp_for) ngens++; else if (TYPE(CHILD(ch, 0)) == STAR) nargs++; else /* TYPE(CHILD(ch, 0)) == DOUBLESTAR or keyword argument */ nkeywords++; } } if (ngens > 1 || (ngens && (nargs || nkeywords))) { ast_error(c, n, "Generator expression must be parenthesized " "if not sole argument"); return NULL; } if (nargs + nkeywords + ngens > 255) { ast_error(c, n, "more than 255 arguments"); return NULL; } args = _Ta3_asdl_seq_new(nargs + ngens, c->c_arena); if (!args) return NULL; keywords = _Ta3_asdl_seq_new(nkeywords, c->c_arena); if (!keywords) return NULL; nargs = 0; /* positional arguments + iterable argument unpackings */ nkeywords = 0; /* keyword arguments + keyword argument unpackings */ ndoublestars = 0; /* just keyword argument unpackings */ for (i = 0; i < NCH(n); i++) { node *ch = CHILD(n, i); if (TYPE(ch) == argument) { expr_ty e; node *chch = CHILD(ch, 0); if (NCH(ch) == 1) { /* a positional argument */ if (nkeywords) { if (ndoublestars) { ast_error(c, chch, "positional argument follows " "keyword argument unpacking"); } else { ast_error(c, chch, "positional argument follows " "keyword argument"); } return NULL; } e = ast_for_expr(c, chch); if (!e) return NULL; asdl_seq_SET(args, nargs++, e); } else if (TYPE(chch) == STAR) { /* an iterable argument unpacking */ expr_ty starred; if (ndoublestars) { ast_error(c, chch, "iterable argument unpacking follows " "keyword argument unpacking"); return NULL; } e = ast_for_expr(c, CHILD(ch, 1)); if (!e) return NULL; starred = Starred(e, Load, LINENO(chch), chch->n_col_offset, c->c_arena); if (!starred) return NULL; asdl_seq_SET(args, nargs++, starred); } else if (TYPE(chch) == DOUBLESTAR) { /* a keyword argument unpacking */ keyword_ty kw; i++; e = ast_for_expr(c, CHILD(ch, 1)); if (!e) return NULL; kw = keyword(NULL, e, c->c_arena); asdl_seq_SET(keywords, nkeywords++, kw); ndoublestars++; } else if (TYPE(CHILD(ch, 1)) == comp_for) { /* the lone generator expression */ e = ast_for_genexp(c, ch); if (!e) return NULL; asdl_seq_SET(args, nargs++, e); } else { /* a keyword argument */ keyword_ty kw; identifier key, tmp; int k; /* chch is test, but must be an identifier? */ e = ast_for_expr(c, chch); if (!e) return NULL; /* f(lambda x: x[0] = 3) ends up getting parsed with * LHS test = lambda x: x[0], and RHS test = 3. * SF bug 132313 points out that complaining about a keyword * then is very confusing. */ if (e->kind == Lambda_kind) { ast_error(c, chch, "lambda cannot contain assignment"); return NULL; } else if (e->kind != Name_kind) { ast_error(c, chch, "keyword can't be an expression"); return NULL; } else if (forbidden_name(c, e->v.Name.id, ch, 1)) { return NULL; } key = e->v.Name.id; for (k = 0; k < nkeywords; k++) { tmp = ((keyword_ty)asdl_seq_GET(keywords, k))->arg; if (tmp && !PyUnicode_Compare(tmp, key)) { ast_error(c, chch, "keyword argument repeated"); return NULL; } } e = ast_for_expr(c, CHILD(ch, 2)); if (!e) return NULL; kw = keyword(key, e, c->c_arena); if (!kw) return NULL; asdl_seq_SET(keywords, nkeywords++, kw); } } } return Call(func, args, keywords, func->lineno, func->col_offset, c->c_arena); }
834
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_classdef
ast_for_classdef( struct compiling * c , const node * n , asdl_seq * decorator_seq)
['c', 'n', 'decorator_seq']
ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* classdef: 'class' NAME ['(' arglist ')'] ':' suite */ PyObject *classname; asdl_seq *s; expr_ty call; REQ(n, classdef); if (NCH(n) == 4) { /* class NAME ':' suite */ s = ast_for_suite(c, CHILD(n, 3)); if (!s) return NULL; classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 3), 0)) return NULL; return ClassDef(classname, NULL, NULL, s, decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } if (TYPE(CHILD(n, 3)) == RPAR) { /* class NAME '(' ')' ':' suite */ s = ast_for_suite(c, CHILD(n,5)); if (!s) return NULL; classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 3), 0)) return NULL; return ClassDef(classname, NULL, NULL, s, decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } /* class NAME '(' arglist ')' ':' suite */ /* build up a fake Call node so we can extract its pieces */ { PyObject *dummy_name; expr_ty dummy; dummy_name = NEW_IDENTIFIER(CHILD(n, 1)); if (!dummy_name) return NULL; dummy = Name(dummy_name, Load, LINENO(n), n->n_col_offset, c->c_arena); call = ast_for_call(c, CHILD(n, 3), dummy); if (!call) return NULL; } s = ast_for_suite(c, CHILD(n, 6)); if (!s) return NULL; classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 1), 0)) return NULL; return ClassDef(classname, call->v.Call.args, call->v.Call.keywords, s, decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); }
420
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_classdef
ast_for_classdef( struct compiling * c , const node * n , asdl_seq * decorator_seq)
['c', 'n', 'decorator_seq']
ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* classdef: 'class' NAME ['(' arglist ')'] ':' suite */ PyObject *classname; asdl_seq *s; expr_ty call; REQ(n, classdef); if (NCH(n) == 4) { /* class NAME ':' suite */ s = ast_for_suite(c, CHILD(n, 3)); if (!s) return NULL; classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 3), 0)) return NULL; return ClassDef(classname, NULL, NULL, s, decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } if (TYPE(CHILD(n, 3)) == RPAR) { /* class NAME '(' ')' ':' suite */ s = ast_for_suite(c, CHILD(n,5)); if (!s) return NULL; classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 3), 0)) return NULL; return ClassDef(classname, NULL, NULL, s, decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); } /* class NAME '(' arglist ')' ':' suite */ /* build up a fake Call node so we can extract its pieces */ { PyObject *dummy_name; expr_ty dummy; dummy_name = NEW_IDENTIFIER(CHILD(n, 1)); if (!dummy_name) return NULL; dummy = Name(dummy_name, Load, LINENO(n), n->n_col_offset, c->c_arena); call = ast_for_call(c, CHILD(n, 3), dummy); if (!call) return NULL; } s = ast_for_suite(c, CHILD(n, 6)); if (!s) return NULL; classname = NEW_IDENTIFIER(CHILD(n, 1)); if (!classname) return NULL; if (forbidden_name(c, classname, CHILD(n, 1), 0)) return NULL; return ClassDef(classname, call->v.Call.args, call->v.Call.keywords, s, decorator_seq, LINENO(n), n->n_col_offset, c->c_arena); }
420
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_comprehension
ast_for_comprehension( struct compiling * c , const node * n)
['c', 'n']
ast_for_comprehension(struct compiling *c, const node *n) { int i, n_fors; asdl_seq *comps; n_fors = count_comp_fors(c, n); if (n_fors == -1) return NULL; comps = _Ta3_asdl_seq_new(n_fors, c->c_arena); if (!comps) return NULL; for (i = 0; i < n_fors; i++) { comprehension_ty comp; asdl_seq *t; expr_ty expression, first; node *for_ch; int is_async = 0; REQ(n, comp_for); if (TYPE(CHILD(n, 0)) == ASYNC) { is_async = 1; } /* Async comprehensions only allowed in Python 3.6 and greater */ if (is_async && c->c_feature_version < 6) { ast_error(c, n, "Async comprehensions are only supported in Python 3.6 and greater"); return NULL; } for_ch = CHILD(n, 1 + is_async); t = ast_for_exprlist(c, for_ch, Store); if (!t) return NULL; expression = ast_for_expr(c, CHILD(n, 3 + is_async)); if (!expression) return NULL; /* Check the # of children rather than the length of t, since (x for x, in ...) has 1 element in t, but still requires a Tuple. */ first = (expr_ty)asdl_seq_GET(t, 0); if (NCH(for_ch) == 1) comp = comprehension(first, expression, NULL, is_async, c->c_arena); else comp = comprehension(Tuple(t, Store, first->lineno, first->col_offset, c->c_arena), expression, NULL, is_async, c->c_arena); if (!comp) return NULL; if (NCH(n) == (5 + is_async)) { int j, n_ifs; asdl_seq *ifs; n = CHILD(n, 4 + is_async); n_ifs = count_comp_ifs(c, n); if (n_ifs == -1) return NULL; ifs = _Ta3_asdl_seq_new(n_ifs, c->c_arena); if (!ifs) return NULL; for (j = 0; j < n_ifs; j++) { REQ(n, comp_iter); n = CHILD(n, 0); REQ(n, comp_if); expression = ast_for_expr(c, CHILD(n, 1)); if (!expression) return NULL; asdl_seq_SET(ifs, j, expression); if (NCH(n) == 3) n = CHILD(n, 2); } /* on exit, must guarantee that n is a comp_for */ if (TYPE(n) == comp_iter) n = CHILD(n, 0); comp->ifs = ifs; } asdl_seq_SET(comps, i, comp); } return comps; }
479
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_comprehension
ast_for_comprehension( struct compiling * c , const node * n)
['c', 'n']
ast_for_comprehension(struct compiling *c, const node *n) { int i, n_fors; asdl_seq *comps; n_fors = count_comp_fors(c, n); if (n_fors == -1) return NULL; comps = _Ta3_asdl_seq_new(n_fors, c->c_arena); if (!comps) return NULL; for (i = 0; i < n_fors; i++) { comprehension_ty comp; asdl_seq *t; expr_ty expression, first; node *for_ch; int is_async = 0; REQ(n, comp_for); if (TYPE(CHILD(n, 0)) == ASYNC) { is_async = 1; } /* Async comprehensions only allowed in Python 3.6 and greater */ if (is_async && c->c_feature_version < 6) { ast_error(c, n, "Async comprehensions are only supported in Python 3.6 and greater"); return NULL; } for_ch = CHILD(n, 1 + is_async); t = ast_for_exprlist(c, for_ch, Store); if (!t) return NULL; expression = ast_for_expr(c, CHILD(n, 3 + is_async)); if (!expression) return NULL; /* Check the # of children rather than the length of t, since (x for x, in ...) has 1 element in t, but still requires a Tuple. */ first = (expr_ty)asdl_seq_GET(t, 0); if (NCH(for_ch) == 1) comp = comprehension(first, expression, NULL, is_async, c->c_arena); else comp = comprehension(Tuple(t, Store, first->lineno, first->col_offset, c->c_arena), expression, NULL, is_async, c->c_arena); if (!comp) return NULL; if (NCH(n) == (5 + is_async)) { int j, n_ifs; asdl_seq *ifs; n = CHILD(n, 4 + is_async); n_ifs = count_comp_ifs(c, n); if (n_ifs == -1) return NULL; ifs = _Ta3_asdl_seq_new(n_ifs, c->c_arena); if (!ifs) return NULL; for (j = 0; j < n_ifs; j++) { REQ(n, comp_iter); n = CHILD(n, 0); REQ(n, comp_if); expression = ast_for_expr(c, CHILD(n, 1)); if (!expression) return NULL; asdl_seq_SET(ifs, j, expression); if (NCH(n) == 3) n = CHILD(n, 2); } /* on exit, must guarantee that n is a comp_for */ if (TYPE(n) == comp_iter) n = CHILD(n, 0); comp->ifs = ifs; } asdl_seq_SET(comps, i, comp); } return comps; }
479
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_decorator
ast_for_decorator( struct compiling * c , const node * n)
['c', 'n']
ast_for_decorator(struct compiling *c, const node *n) { /* decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE */ expr_ty d = NULL; expr_ty name_expr; REQ(n, decorator); REQ(CHILD(n, 0), AT); REQ(RCHILD(n, -1), NEWLINE); name_expr = ast_for_dotted_name(c, CHILD(n, 1)); if (!name_expr) return NULL; if (NCH(n) == 3) { /* No arguments */ d = name_expr; name_expr = NULL; } else if (NCH(n) == 5) { /* Call with no arguments */ d = Call(name_expr, NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); if (!d) return NULL; name_expr = NULL; } else { d = ast_for_call(c, CHILD(n, 3), name_expr); if (!d) return NULL; name_expr = NULL; } return d; }
177
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_decorator
ast_for_decorator( struct compiling * c , const node * n)
['c', 'n']
ast_for_decorator(struct compiling *c, const node *n) { /* decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE */ expr_ty d = NULL; expr_ty name_expr; REQ(n, decorator); REQ(CHILD(n, 0), AT); REQ(RCHILD(n, -1), NEWLINE); name_expr = ast_for_dotted_name(c, CHILD(n, 1)); if (!name_expr) return NULL; if (NCH(n) == 3) { /* No arguments */ d = name_expr; name_expr = NULL; } else if (NCH(n) == 5) { /* Call with no arguments */ d = Call(name_expr, NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); if (!d) return NULL; name_expr = NULL; } else { d = ast_for_call(c, CHILD(n, 3), name_expr); if (!d) return NULL; name_expr = NULL; } return d; }
177
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_expr
ast_for_expr( struct compiling * c , const node * n)
['c', 'n']
ast_for_expr(struct compiling *c, const node *n) { /* handle the full range of simple expressions test: or_test ['if' or_test 'else' test] | lambdef test_nocond: or_test | lambdef_nocond or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison comparison: expr (comp_op expr)* expr: xor_expr ('|' xor_expr)* xor_expr: and_expr ('^' and_expr)* and_expr: shift_expr ('&' shift_expr)* shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* term: factor (('*'|'@'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power power: atom_expr ['**' factor] atom_expr: [AWAIT] atom trailer* yield_expr: 'yield' [yield_arg] */ asdl_seq *seq; int i; loop: switch (TYPE(n)) { case test: case test_nocond: if (TYPE(CHILD(n, 0)) == lambdef || TYPE(CHILD(n, 0)) == lambdef_nocond) return ast_for_lambdef(c, CHILD(n, 0)); else if (NCH(n) > 1) return ast_for_ifexpr(c, n); /* Fallthrough */ case or_test: case and_test: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } seq = _Ta3_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); if (!seq) return NULL; for (i = 0; i < NCH(n); i += 2) { expr_ty e = ast_for_expr(c, CHILD(n, i)); if (!e) return NULL; asdl_seq_SET(seq, i / 2, e); } if (!strcmp(STR(CHILD(n, 1)), "and")) return BoolOp(And, seq, LINENO(n), n->n_col_offset, c->c_arena); assert(!strcmp(STR(CHILD(n, 1)), "or")); return BoolOp(Or, seq, LINENO(n), n->n_col_offset, c->c_arena); case not_test: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } else { expr_ty expression = ast_for_expr(c, CHILD(n, 1)); if (!expression) return NULL; return UnaryOp(Not, expression, LINENO(n), n->n_col_offset, c->c_arena); } case comparison: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } else { expr_ty expression; asdl_int_seq *ops; asdl_seq *cmps; ops = _Ta3_asdl_int_seq_new(NCH(n) / 2, c->c_arena); if (!ops) return NULL; cmps = _Ta3_asdl_seq_new(NCH(n) / 2, c->c_arena); if (!cmps) { return NULL; } for (i = 1; i < NCH(n); i += 2) { cmpop_ty newoperator; newoperator = ast_for_comp_op(c, CHILD(n, i)); if (!newoperator) { return NULL; } expression = ast_for_expr(c, CHILD(n, i + 1)); if (!expression) { return NULL; } asdl_seq_SET(ops, i / 2, newoperator); asdl_seq_SET(cmps, i / 2, expression); } expression = ast_for_expr(c, CHILD(n, 0)); if (!expression) { return NULL; } return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset, c->c_arena); } break; case star_expr: return ast_for_starred(c, n); /* The next five cases all handle BinOps. The main body of code is the same in each case, but the switch turned inside out to reuse the code for each type of operator. */ case expr: case xor_expr: case and_expr: case shift_expr: case arith_expr: case term: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } return ast_for_binop(c, n); case yield_expr: { node *an = NULL; node *en = NULL; int is_from = 0; expr_ty exp = NULL; if (NCH(n) > 1) an = CHILD(n, 1); /* yield_arg */ if (an) { en = CHILD(an, NCH(an) - 1); if (NCH(an) == 2) { is_from = 1; exp = ast_for_expr(c, en); } else exp = ast_for_testlist(c, en); if (!exp) return NULL; } if (is_from) return YieldFrom(exp, LINENO(n), n->n_col_offset, c->c_arena); return Yield(exp, LINENO(n), n->n_col_offset, c->c_arena); } case factor: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } return ast_for_factor(c, n); case power: return ast_for_power(c, n); default: PyErr_Format(PyExc_SystemError, "unhandled expr: %d", TYPE(n)); return NULL; } /* should never get here unless if error is set */ return NULL; }
864
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_expr
ast_for_expr( struct compiling * c , const node * n)
['c', 'n']
ast_for_expr(struct compiling *c, const node *n) { /* handle the full range of simple expressions test: or_test ['if' or_test 'else' test] | lambdef test_nocond: or_test | lambdef_nocond or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison comparison: expr (comp_op expr)* expr: xor_expr ('|' xor_expr)* xor_expr: and_expr ('^' and_expr)* and_expr: shift_expr ('&' shift_expr)* shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* term: factor (('*'|'@'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power power: atom_expr ['**' factor] atom_expr: [AWAIT] atom trailer* yield_expr: 'yield' [yield_arg] */ asdl_seq *seq; int i; loop: switch (TYPE(n)) { case test: case test_nocond: if (TYPE(CHILD(n, 0)) == lambdef || TYPE(CHILD(n, 0)) == lambdef_nocond) return ast_for_lambdef(c, CHILD(n, 0)); else if (NCH(n) > 1) return ast_for_ifexpr(c, n); /* Fallthrough */ case or_test: case and_test: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } seq = _Ta3_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); if (!seq) return NULL; for (i = 0; i < NCH(n); i += 2) { expr_ty e = ast_for_expr(c, CHILD(n, i)); if (!e) return NULL; asdl_seq_SET(seq, i / 2, e); } if (!strcmp(STR(CHILD(n, 1)), "and")) return BoolOp(And, seq, LINENO(n), n->n_col_offset, c->c_arena); assert(!strcmp(STR(CHILD(n, 1)), "or")); return BoolOp(Or, seq, LINENO(n), n->n_col_offset, c->c_arena); case not_test: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } else { expr_ty expression = ast_for_expr(c, CHILD(n, 1)); if (!expression) return NULL; return UnaryOp(Not, expression, LINENO(n), n->n_col_offset, c->c_arena); } case comparison: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } else { expr_ty expression; asdl_int_seq *ops; asdl_seq *cmps; ops = _Ta3_asdl_int_seq_new(NCH(n) / 2, c->c_arena); if (!ops) return NULL; cmps = _Ta3_asdl_seq_new(NCH(n) / 2, c->c_arena); if (!cmps) { return NULL; } for (i = 1; i < NCH(n); i += 2) { cmpop_ty newoperator; newoperator = ast_for_comp_op(c, CHILD(n, i)); if (!newoperator) { return NULL; } expression = ast_for_expr(c, CHILD(n, i + 1)); if (!expression) { return NULL; } asdl_seq_SET(ops, i / 2, newoperator); asdl_seq_SET(cmps, i / 2, expression); } expression = ast_for_expr(c, CHILD(n, 0)); if (!expression) { return NULL; } return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset, c->c_arena); } break; case star_expr: return ast_for_starred(c, n); /* The next five cases all handle BinOps. The main body of code is the same in each case, but the switch turned inside out to reuse the code for each type of operator. */ case expr: case xor_expr: case and_expr: case shift_expr: case arith_expr: case term: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } return ast_for_binop(c, n); case yield_expr: { node *an = NULL; node *en = NULL; int is_from = 0; expr_ty exp = NULL; if (NCH(n) > 1) an = CHILD(n, 1); /* yield_arg */ if (an) { en = CHILD(an, NCH(an) - 1); if (NCH(an) == 2) { is_from = 1; exp = ast_for_expr(c, en); } else exp = ast_for_testlist(c, en); if (!exp) return NULL; } if (is_from) return YieldFrom(exp, LINENO(n), n->n_col_offset, c->c_arena); return Yield(exp, LINENO(n), n->n_col_offset, c->c_arena); } case factor: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } return ast_for_factor(c, n); case power: return ast_for_power(c, n); default: PyErr_Format(PyExc_SystemError, "unhandled expr: %d", TYPE(n)); return NULL; } /* should never get here unless if error is set */ return NULL; }
864
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_for_stmt
ast_for_for_stmt( struct compiling * c , const node * n , int is_async)
['c', 'n', 'is_async']
ast_for_for_stmt(struct compiling *c, const node *n, int is_async) { asdl_seq *_target, *seq = NULL, *suite_seq; expr_ty expression; expr_ty target, first; const node *node_target; int has_type_comment; string type_comment; if (is_async && c->c_feature_version < 5) { ast_error(c, n, "Async for loops are only supported in Python 3.5 and greater"); return NULL; } /* for_stmt: 'for' exprlist 'in' testlist ':' [TYPE_COMMENT] suite ['else' ':' suite] */ REQ(n, for_stmt); has_type_comment = TYPE(CHILD(n, 5)) == TYPE_COMMENT; if (NCH(n) == 9 + has_type_comment) { seq = ast_for_suite(c, CHILD(n, 8 + has_type_comment)); if (!seq) return NULL; } node_target = CHILD(n, 1); _target = ast_for_exprlist(c, node_target, Store); if (!_target) return NULL; /* Check the # of children rather than the length of _target, since for x, in ... has 1 element in _target, but still requires a Tuple. */ first = (expr_ty)asdl_seq_GET(_target, 0); if (NCH(node_target) == 1) target = first; else target = Tuple(_target, Store, first->lineno, first->col_offset, c->c_arena); expression = ast_for_testlist(c, CHILD(n, 3)); if (!expression) return NULL; suite_seq = ast_for_suite(c, CHILD(n, 5 + has_type_comment)); if (!suite_seq) return NULL; if (has_type_comment) type_comment = NEW_TYPE_COMMENT(CHILD(n, 5)); else type_comment = NULL; if (is_async) return AsyncFor(target, expression, suite_seq, seq, type_comment, LINENO(n), n->n_col_offset, c->c_arena); else return For(target, expression, suite_seq, seq, type_comment, LINENO(n), n->n_col_offset, c->c_arena); }
331
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_for_stmt
ast_for_for_stmt( struct compiling * c , const node * n , int is_async)
['c', 'n', 'is_async']
ast_for_for_stmt(struct compiling *c, const node *n, int is_async) { asdl_seq *_target, *seq = NULL, *suite_seq; expr_ty expression; expr_ty target, first; const node *node_target; int has_type_comment; string type_comment; if (is_async && c->c_feature_version < 5) { ast_error(c, n, "Async for loops are only supported in Python 3.5 and greater"); return NULL; } /* for_stmt: 'for' exprlist 'in' testlist ':' [TYPE_COMMENT] suite ['else' ':' suite] */ REQ(n, for_stmt); has_type_comment = TYPE(CHILD(n, 5)) == TYPE_COMMENT; if (NCH(n) == 9 + has_type_comment) { seq = ast_for_suite(c, CHILD(n, 8 + has_type_comment)); if (!seq) return NULL; } node_target = CHILD(n, 1); _target = ast_for_exprlist(c, node_target, Store); if (!_target) return NULL; /* Check the # of children rather than the length of _target, since for x, in ... has 1 element in _target, but still requires a Tuple. */ first = (expr_ty)asdl_seq_GET(_target, 0); if (NCH(node_target) == 1) target = first; else target = Tuple(_target, Store, first->lineno, first->col_offset, c->c_arena); expression = ast_for_testlist(c, CHILD(n, 3)); if (!expression) return NULL; suite_seq = ast_for_suite(c, CHILD(n, 5 + has_type_comment)); if (!suite_seq) return NULL; if (has_type_comment) type_comment = NEW_TYPE_COMMENT(CHILD(n, 5)); else type_comment = NULL; if (is_async) return AsyncFor(target, expression, suite_seq, seq, type_comment, LINENO(n), n->n_col_offset, c->c_arena); else return For(target, expression, suite_seq, seq, type_comment, LINENO(n), n->n_col_offset, c->c_arena); }
331
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_funcdef
ast_for_funcdef( struct compiling * c , const node * n , asdl_seq * decorator_seq)
['c', 'n', 'decorator_seq']
ast_for_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* funcdef: 'def' NAME parameters ['->' test] ':' suite */ return ast_for_funcdef_impl(c, n, decorator_seq, 0 /* is_async */); }
30
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_funcdef
ast_for_funcdef( struct compiling * c , const node * n , asdl_seq * decorator_seq)
['c', 'n', 'decorator_seq']
ast_for_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) { /* funcdef: 'def' NAME parameters ['->' test] ':' suite */ return ast_for_funcdef_impl(c, n, decorator_seq, 0 /* is_async */); }
30
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_funcdef_impl
ast_for_funcdef_impl( struct compiling * c , const node * n , asdl_seq * decorator_seq , int is_async)
['c', 'n', 'decorator_seq', 'is_async']
ast_for_funcdef_impl(struct compiling *c, const node *n, asdl_seq *decorator_seq, int is_async) { /* funcdef: 'def' NAME parameters ['->' test] ':' [TYPE_COMMENT] suite */ identifier name; arguments_ty args; asdl_seq *body; expr_ty returns = NULL; int name_i = 1; node *tc; string type_comment = NULL; if (is_async && c->c_feature_version < 5) { ast_error(c, n, "Async functions are only supported in Python 3.5 and greater"); return NULL; } REQ(n, funcdef); name = NEW_IDENTIFIER(CHILD(n, name_i)); if (!name) return NULL; if (forbidden_name(c, name, CHILD(n, name_i), 0)) return NULL; args = ast_for_arguments(c, CHILD(n, name_i + 1)); if (!args) return NULL; if (TYPE(CHILD(n, name_i+2)) == RARROW) { returns = ast_for_expr(c, CHILD(n, name_i + 3)); if (!returns) return NULL; name_i += 2; } if (TYPE(CHILD(n, name_i + 3)) == TYPE_COMMENT) { type_comment = NEW_TYPE_COMMENT(CHILD(n, name_i + 3)); name_i += 1; } body = ast_for_suite(c, CHILD(n, name_i + 3)); if (!body) return NULL; if (!type_comment && NCH(CHILD(n, name_i + 3)) > 1) { /* If the function doesn't have a type comment on the same line, check * if the suite has a type comment in it. */ tc = CHILD(CHILD(n, name_i + 3), 1); if (TYPE(tc) == TYPE_COMMENT) type_comment = NEW_TYPE_COMMENT(tc); } if (is_async) return AsyncFunctionDef(name, args, body, decorator_seq, returns, type_comment, LINENO(n), n->n_col_offset, c->c_arena); else return FunctionDef(name, args, body, decorator_seq, returns, type_comment, LINENO(n), n->n_col_offset, c->c_arena); }
368
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_funcdef_impl
ast_for_funcdef_impl( struct compiling * c , const node * n , asdl_seq * decorator_seq , int is_async)
['c', 'n', 'decorator_seq', 'is_async']
ast_for_funcdef_impl(struct compiling *c, const node *n, asdl_seq *decorator_seq, int is_async) { /* funcdef: 'def' NAME parameters ['->' test] ':' [TYPE_COMMENT] suite */ identifier name; arguments_ty args; asdl_seq *body; expr_ty returns = NULL; int name_i = 1; node *tc; string type_comment = NULL; if (is_async && c->c_feature_version < 5) { ast_error(c, n, "Async functions are only supported in Python 3.5 and greater"); return NULL; } REQ(n, funcdef); name = NEW_IDENTIFIER(CHILD(n, name_i)); if (!name) return NULL; if (forbidden_name(c, name, CHILD(n, name_i), 0)) return NULL; args = ast_for_arguments(c, CHILD(n, name_i + 1)); if (!args) return NULL; if (TYPE(CHILD(n, name_i+2)) == RARROW) { returns = ast_for_expr(c, CHILD(n, name_i + 3)); if (!returns) return NULL; name_i += 2; } if (TYPE(CHILD(n, name_i + 3)) == TYPE_COMMENT) { type_comment = NEW_TYPE_COMMENT(CHILD(n, name_i + 3)); name_i += 1; } body = ast_for_suite(c, CHILD(n, name_i + 3)); if (!body) return NULL; if (!type_comment && NCH(CHILD(n, name_i + 3)) > 1) { /* If the function doesn't have a type comment on the same line, check * if the suite has a type comment in it. */ tc = CHILD(CHILD(n, name_i + 3), 1); if (TYPE(tc) == TYPE_COMMENT) type_comment = NEW_TYPE_COMMENT(tc); } if (is_async) return AsyncFunctionDef(name, args, body, decorator_seq, returns, type_comment, LINENO(n), n->n_col_offset, c->c_arena); else return FunctionDef(name, args, body, decorator_seq, returns, type_comment, LINENO(n), n->n_col_offset, c->c_arena); }
368
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_trailer
ast_for_trailer( struct compiling * c , const node * n , expr_ty left_expr)
['c', 'n', 'left_expr']
ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr) { /* trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] */ REQ(n, trailer); if (TYPE(CHILD(n, 0)) == LPAR) { if (NCH(n) == 2) return Call(left_expr, NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); else return ast_for_call(c, CHILD(n, 1), left_expr); } else if (TYPE(CHILD(n, 0)) == DOT) { PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1)); if (!attr_id) return NULL; return Attribute(left_expr, attr_id, Load, LINENO(n), n->n_col_offset, c->c_arena); } else { REQ(CHILD(n, 0), LSQB); REQ(CHILD(n, 2), RSQB); n = CHILD(n, 1); if (NCH(n) == 1) { slice_ty slc = ast_for_slice(c, CHILD(n, 0)); if (!slc) return NULL; return Subscript(left_expr, slc, Load, LINENO(n), n->n_col_offset, c->c_arena); } else { /* The grammar is ambiguous here. The ambiguity is resolved by treating the sequence as a tuple literal if there are no slice features. */ int j; slice_ty slc; expr_ty e; int simple = 1; asdl_seq *slices, *elts; slices = _Ta3_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); if (!slices) return NULL; for (j = 0; j < NCH(n); j += 2) { slc = ast_for_slice(c, CHILD(n, j)); if (!slc) return NULL; if (slc->kind != Index_kind) simple = 0; asdl_seq_SET(slices, j / 2, slc); } if (!simple) { return Subscript(left_expr, ExtSlice(slices, c->c_arena), Load, LINENO(n), n->n_col_offset, c->c_arena); } /* extract Index values and put them in a Tuple */ elts = _Ta3_asdl_seq_new(asdl_seq_LEN(slices), c->c_arena); if (!elts) return NULL; for (j = 0; j < asdl_seq_LEN(slices); ++j) { slc = (slice_ty)asdl_seq_GET(slices, j); assert(slc->kind == Index_kind && slc->v.Index.value); asdl_seq_SET(elts, j, slc->v.Index.value); } e = Tuple(elts, Load, LINENO(n), n->n_col_offset, c->c_arena); if (!e) return NULL; return Subscript(left_expr, Index(e, c->c_arena), Load, LINENO(n), n->n_col_offset, c->c_arena); } } }
540
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_trailer
ast_for_trailer( struct compiling * c , const node * n , expr_ty left_expr)
['c', 'n', 'left_expr']
ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr) { /* trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] */ REQ(n, trailer); if (TYPE(CHILD(n, 0)) == LPAR) { if (NCH(n) == 2) return Call(left_expr, NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena); else return ast_for_call(c, CHILD(n, 1), left_expr); } else if (TYPE(CHILD(n, 0)) == DOT) { PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1)); if (!attr_id) return NULL; return Attribute(left_expr, attr_id, Load, LINENO(n), n->n_col_offset, c->c_arena); } else { REQ(CHILD(n, 0), LSQB); REQ(CHILD(n, 2), RSQB); n = CHILD(n, 1); if (NCH(n) == 1) { slice_ty slc = ast_for_slice(c, CHILD(n, 0)); if (!slc) return NULL; return Subscript(left_expr, slc, Load, LINENO(n), n->n_col_offset, c->c_arena); } else { /* The grammar is ambiguous here. The ambiguity is resolved by treating the sequence as a tuple literal if there are no slice features. */ int j; slice_ty slc; expr_ty e; int simple = 1; asdl_seq *slices, *elts; slices = _Ta3_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); if (!slices) return NULL; for (j = 0; j < NCH(n); j += 2) { slc = ast_for_slice(c, CHILD(n, j)); if (!slc) return NULL; if (slc->kind != Index_kind) simple = 0; asdl_seq_SET(slices, j / 2, slc); } if (!simple) { return Subscript(left_expr, ExtSlice(slices, c->c_arena), Load, LINENO(n), n->n_col_offset, c->c_arena); } /* extract Index values and put them in a Tuple */ elts = _Ta3_asdl_seq_new(asdl_seq_LEN(slices), c->c_arena); if (!elts) return NULL; for (j = 0; j < asdl_seq_LEN(slices); ++j) { slc = (slice_ty)asdl_seq_GET(slices, j); assert(slc->kind == Index_kind && slc->v.Index.value); asdl_seq_SET(elts, j, slc->v.Index.value); } e = Tuple(elts, Load, LINENO(n), n->n_col_offset, c->c_arena); if (!e) return NULL; return Subscript(left_expr, Index(e, c->c_arena), Load, LINENO(n), n->n_col_offset, c->c_arena); } } }
540
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_with_stmt
ast_for_with_stmt( struct compiling * c , const node * n , int is_async)
['c', 'n', 'is_async']
ast_for_with_stmt(struct compiling *c, const node *n, int is_async) { int i, n_items, nch_minus_type, has_type_comment; asdl_seq *items, *body; string type_comment; if (is_async && c->c_feature_version < 5) { ast_error(c, n, "Async with statements are only supported in Python 3.5 and greater"); return NULL; } REQ(n, with_stmt); has_type_comment = TYPE(CHILD(n, NCH(n) - 2)) == TYPE_COMMENT; nch_minus_type = NCH(n) - has_type_comment; n_items = (nch_minus_type - 2) / 2; items = _Ta3_asdl_seq_new(n_items, c->c_arena); if (!items) return NULL; for (i = 1; i < nch_minus_type - 2; i += 2) { withitem_ty item = ast_for_with_item(c, CHILD(n, i)); if (!item) return NULL; asdl_seq_SET(items, (i - 1) / 2, item); } body = ast_for_suite(c, CHILD(n, NCH(n) - 1)); if (!body) return NULL; if (has_type_comment) type_comment = NEW_TYPE_COMMENT(CHILD(n, NCH(n) - 2)); else type_comment = NULL; if (is_async) return AsyncWith(items, body, type_comment, LINENO(n), n->n_col_offset, c->c_arena); else return With(items, body, type_comment, LINENO(n), n->n_col_offset, c->c_arena); }
284
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_with_stmt
ast_for_with_stmt( struct compiling * c , const node * n , int is_async)
['c', 'n', 'is_async']
ast_for_with_stmt(struct compiling *c, const node *n, int is_async) { int i, n_items, nch_minus_type, has_type_comment; asdl_seq *items, *body; string type_comment; if (is_async && c->c_feature_version < 5) { ast_error(c, n, "Async with statements are only supported in Python 3.5 and greater"); return NULL; } REQ(n, with_stmt); has_type_comment = TYPE(CHILD(n, NCH(n) - 2)) == TYPE_COMMENT; nch_minus_type = NCH(n) - has_type_comment; n_items = (nch_minus_type - 2) / 2; items = _Ta3_asdl_seq_new(n_items, c->c_arena); if (!items) return NULL; for (i = 1; i < nch_minus_type - 2; i += 2) { withitem_ty item = ast_for_with_item(c, CHILD(n, i)); if (!item) return NULL; asdl_seq_SET(items, (i - 1) / 2, item); } body = ast_for_suite(c, CHILD(n, NCH(n) - 1)); if (!body) return NULL; if (has_type_comment) type_comment = NEW_TYPE_COMMENT(CHILD(n, NCH(n) - 2)); else type_comment = NULL; if (is_async) return AsyncWith(items, body, type_comment, LINENO(n), n->n_col_offset, c->c_arena); else return With(items, body, type_comment, LINENO(n), n->n_col_offset, c->c_arena); }
284
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
count_comp_fors
count_comp_fors( struct compiling * c , const node * n)
['c', 'n']
count_comp_fors(struct compiling *c, const node *n) { int n_fors = 0; int is_async; count_comp_for: is_async = 0; n_fors++; REQ(n, comp_for); if (TYPE(CHILD(n, 0)) == ASYNC) { is_async = 1; } if (NCH(n) == (5 + is_async)) { n = CHILD(n, 4 + is_async); } else { return n_fors; } count_comp_iter: REQ(n, comp_iter); n = CHILD(n, 0); if (TYPE(n) == comp_for) goto count_comp_for; else if (TYPE(n) == comp_if) { if (NCH(n) == 3) { n = CHILD(n, 2); goto count_comp_iter; } else return n_fors; } /* Should never be reached */ PyErr_SetString(PyExc_SystemError, "logic error in count_comp_fors"); return -1; }
170
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
count_comp_fors
count_comp_fors( struct compiling * c , const node * n)
['c', 'n']
count_comp_fors(struct compiling *c, const node *n) { int n_fors = 0; int is_async; count_comp_for: is_async = 0; n_fors++; REQ(n, comp_for); if (TYPE(CHILD(n, 0)) == ASYNC) { is_async = 1; } if (NCH(n) == (5 + is_async)) { n = CHILD(n, 4 + is_async); } else { return n_fors; } count_comp_iter: REQ(n, comp_iter); n = CHILD(n, 0); if (TYPE(n) == comp_for) goto count_comp_for; else if (TYPE(n) == comp_if) { if (NCH(n) == 3) { n = CHILD(n, 2); goto count_comp_iter; } else return n_fors; } /* Should never be reached */ PyErr_SetString(PyExc_SystemError, "logic error in count_comp_fors"); return -1; }
170
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
decode_bytes_with_escapes
decode_bytes_with_escapes( struct compiling * c , const node * n , const char * s , size_t len)
['c', 'n', 's', 'len']
decode_bytes_with_escapes(struct compiling *c, const node *n, const char *s, size_t len) { return PyBytes_DecodeEscape(s, len, NULL, 0, NULL); }
36
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
decode_bytes_with_escapes
decode_bytes_with_escapes( struct compiling * c , const node * n , const char * s , size_t len)
['c', 'n', 's', 'len']
decode_bytes_with_escapes(struct compiling *c, const node *n, const char *s, size_t len) { return PyBytes_DecodeEscape(s, len, NULL, 0, NULL); }
36
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
decode_unicode_with_escapes
decode_unicode_with_escapes( struct compiling * c , const node * n , const char * s , size_t len)
['c', 'n', 's', 'len']
decode_unicode_with_escapes(struct compiling *c, const node *n, const char *s, size_t len) { PyObject *u; char *buf; char *p; const char *end; /* check for integer overflow */ if (len > SIZE_MAX / 6) return NULL; /* "ä" (2 bytes) may become "\U000000E4" (10 bytes), or 1:5 "\ä" (3 bytes) may become "\u005c\U000000E4" (16 bytes), or ~1:6 */ u = PyBytes_FromStringAndSize((char *)NULL, len * 6); if (u == NULL) return NULL; p = buf = PyBytes_AsString(u); end = s + len; while (s < end) { if (*s == '\\') { *p++ = *s++; if (*s & 0x80) { strcpy(p, "u005c"); p += 5; } } if (*s & 0x80) { /* XXX inefficient */ PyObject *w; int kind; void *data; Py_ssize_t len, i; w = decode_utf8(c, &s, end); if (w == NULL) { Py_DECREF(u); return NULL; } kind = PyUnicode_KIND(w); data = PyUnicode_DATA(w); len = PyUnicode_GET_LENGTH(w); for (i = 0; i < len; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); sprintf(p, "\\U%08x", chr); p += 10; } /* Should be impossible to overflow */ assert(p - buf <= Py_SIZE(u)); Py_DECREF(w); } else { *p++ = *s++; } } len = p - buf; s = buf; return PyUnicode_DecodeUnicodeEscape(s, len, NULL); }
296
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
decode_unicode_with_escapes
decode_unicode_with_escapes( struct compiling * c , const node * n , const char * s , size_t len)
['c', 'n', 's', 'len']
decode_unicode_with_escapes(struct compiling *c, const node *n, const char *s, size_t len) { PyObject *u; char *buf; char *p; const char *end; /* check for integer overflow */ if (len > SIZE_MAX / 6) return NULL; /* "ä" (2 bytes) may become "\U000000E4" (10 bytes), or 1:5 "\ä" (3 bytes) may become "\u005c\U000000E4" (16 bytes), or ~1:6 */ u = PyBytes_FromStringAndSize((char *)NULL, len * 6); if (u == NULL) return NULL; p = buf = PyBytes_AsString(u); end = s + len; while (s < end) { if (*s == '\\') { *p++ = *s++; if (*s & 0x80) { strcpy(p, "u005c"); p += 5; } } if (*s & 0x80) { /* XXX inefficient */ PyObject *w; int kind; void *data; Py_ssize_t len, i; w = decode_utf8(c, &s, end); if (w == NULL) { Py_DECREF(u); return NULL; } kind = PyUnicode_KIND(w); data = PyUnicode_DATA(w); len = PyUnicode_GET_LENGTH(w); for (i = 0; i < len; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); sprintf(p, "\\U%08x", chr); p += 10; } /* Should be impossible to overflow */ assert(p - buf <= Py_SIZE(u)); Py_DECREF(w); } else { *p++ = *s++; } } len = p - buf; s = buf; return PyUnicode_DecodeUnicodeEscape(s, len, NULL); }
296
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
expr_context_name
expr_context_name( expr_context_ty ctx)
['ctx']
expr_context_name(expr_context_ty ctx) { switch (ctx) { case Load: return "Load"; case Store: return "Store"; case Del: return "Del"; case AugLoad: return "AugLoad"; case AugStore: return "AugStore"; case Param: return "Param"; default: assert(0); return "(unknown)"; } }
59
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
expr_context_name
expr_context_name( expr_context_ty ctx)
['ctx']
expr_context_name(expr_context_ty ctx) { switch (ctx) { case Load: return "Load"; case Store: return "Store"; case Del: return "Del"; case AugLoad: return "AugLoad"; case AugStore: return "AugStore"; case Param: return "Param"; default: assert(0); return "(unknown)"; } }
59
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
forbidden_name
forbidden_name( struct compiling * c , identifier name , const node * n , int full_checks)
['c', 'name', 'n', 'full_checks']
forbidden_name(struct compiling *c, identifier name, const node *n, int full_checks) { assert(PyUnicode_Check(name)); if (PyUnicode_CompareWithASCIIString(name, "__debug__") == 0) { ast_error(c, n, "assignment to keyword"); return 1; } if (full_checks) { const char * const *p; for (p = FORBIDDEN; *p; p++) { if (PyUnicode_CompareWithASCIIString(name, *p) == 0) { ast_error(c, n, "assignment to keyword"); return 1; } } } return 0; }
109
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
forbidden_name
forbidden_name( struct compiling * c , identifier name , const node * n , int full_checks)
['c', 'name', 'n', 'full_checks']
forbidden_name(struct compiling *c, identifier name, const node *n, int full_checks) { assert(PyUnicode_Check(name)); if (PyUnicode_CompareWithASCIIString(name, "__debug__") == 0) { ast_error(c, n, "assignment to keyword"); return 1; } if (full_checks) { const char * const *p; for (p = FORBIDDEN; *p; p++) { if (PyUnicode_CompareWithASCIIString(name, *p) == 0) { ast_error(c, n, "assignment to keyword"); return 1; } } } return 0; }
109
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
fstring_compile_expr
fstring_compile_expr( const char * expr_start , const char * expr_end , struct compiling * c , const node * n)
['expr_start', 'expr_end', 'c', 'n']
fstring_compile_expr(const char *expr_start, const char *expr_end, struct compiling *c, const node *n) { int all_whitespace = 1; int kind; void *data; PyCompilerFlags cf; mod_ty mod; char *str; PyObject *o, *fstring_name; Py_ssize_t len; Py_ssize_t i; assert(expr_end >= expr_start); assert(*(expr_start-1) == '{'); assert(*expr_end == '}' || *expr_end == '!' || *expr_end == ':'); /* We know there are no escapes here, because backslashes are not allowed, and we know it's utf-8 encoded (per PEP 263). But, in order to check that each char is not whitespace, we need to decode it to unicode. Which is unfortunate, but such is life. */ /* If the substring is all whitespace, it's an error. We need to catch this here, and not when we call PyParser_ASTFromString, because turning the expression '' in to '()' would go from being invalid to valid. */ /* Note that this code says an empty string is all whitespace. That's important. There's a test for it: f'{}'. */ o = PyUnicode_DecodeUTF8(expr_start, expr_end-expr_start, NULL); if (o == NULL) return NULL; len = PyUnicode_GET_LENGTH(o); kind = PyUnicode_KIND(o); data = PyUnicode_DATA(o); for (i = 0; i < len; i++) { if (!Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, i))) { all_whitespace = 0; break; } } Py_DECREF(o); if (all_whitespace) { ast_error(c, n, "f-string: empty expression not allowed"); return NULL; } /* Reuse len to be the length of the utf-8 input string. */ len = expr_end - expr_start; /* Allocate 3 extra bytes: open paren, close paren, null byte. */ str = PyMem_RawMalloc(len + 3); if (str == NULL) return NULL; str[0] = '('; memcpy(str+1, expr_start, len); str[len+1] = ')'; str[len+2] = 0; cf.cf_flags = PyCF_ONLY_AST; fstring_name = PyUnicode_FromString("<fstring>"); mod = string_object_to_c_ast(str, fstring_name, Py_eval_input, &cf, c->c_feature_version, c->c_arena); Py_DECREF(fstring_name); PyMem_RawFree(str); if (!mod) return NULL; return mod->v.Expression.body; }
322
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
fstring_compile_expr
fstring_compile_expr( const char * expr_start , const char * expr_end , struct compiling * c , const node * n)
['expr_start', 'expr_end', 'c', 'n']
fstring_compile_expr(const char *expr_start, const char *expr_end, struct compiling *c, const node *n) { int all_whitespace = 1; int kind; void *data; PyCompilerFlags cf; mod_ty mod; char *str; PyObject *o, *fstring_name; Py_ssize_t len; Py_ssize_t i; assert(expr_end >= expr_start); assert(*(expr_start-1) == '{'); assert(*expr_end == '}' || *expr_end == '!' || *expr_end == ':'); /* We know there are no escapes here, because backslashes are not allowed, and we know it's utf-8 encoded (per PEP 263). But, in order to check that each char is not whitespace, we need to decode it to unicode. Which is unfortunate, but such is life. */ /* If the substring is all whitespace, it's an error. We need to catch this here, and not when we call PyParser_ASTFromString, because turning the expression '' in to '()' would go from being invalid to valid. */ /* Note that this code says an empty string is all whitespace. That's important. There's a test for it: f'{}'. */ o = PyUnicode_DecodeUTF8(expr_start, expr_end-expr_start, NULL); if (o == NULL) return NULL; len = PyUnicode_GET_LENGTH(o); kind = PyUnicode_KIND(o); data = PyUnicode_DATA(o); for (i = 0; i < len; i++) { if (!Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, i))) { all_whitespace = 0; break; } } Py_DECREF(o); if (all_whitespace) { ast_error(c, n, "f-string: empty expression not allowed"); return NULL; } /* Reuse len to be the length of the utf-8 input string. */ len = expr_end - expr_start; /* Allocate 3 extra bytes: open paren, close paren, null byte. */ str = PyMem_RawMalloc(len + 3); if (str == NULL) return NULL; str[0] = '('; memcpy(str+1, expr_start, len); str[len+1] = ')'; str[len+2] = 0; cf.cf_flags = PyCF_ONLY_AST; fstring_name = PyUnicode_FromString("<fstring>"); mod = string_object_to_c_ast(str, fstring_name, Py_eval_input, &cf, c->c_feature_version, c->c_arena); Py_DECREF(fstring_name); PyMem_RawFree(str); if (!mod) return NULL; return mod->v.Expression.body; }
322
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
fstring_find_literal
fstring_find_literal( const char ** str , const char * end , int raw , PyObject ** literal , int recurse_lvl , struct compiling * c , const node * n)
['str', 'end', 'raw', 'literal', 'recurse_lvl', 'c', 'n']
fstring_find_literal(const char **str, const char *end, int raw, PyObject **literal, int recurse_lvl, struct compiling *c, const node *n) { /* Get any literal string. It ends when we hit an un-doubled left brace (which isn't part of a unicode name escape such as "\N{EULER CONSTANT}"), or the end of the string. */ const char *literal_start = *str; const char *literal_end; int in_named_escape = 0; int result = 0; assert(*literal == NULL); for (; *str < end; (*str)++) { char ch = **str; if (!in_named_escape && ch == '{' && (*str)-literal_start >= 2 && *(*str-2) == '\\' && *(*str-1) == 'N') { in_named_escape = 1; } else if (in_named_escape && ch == '}') { in_named_escape = 0; } else if (ch == '{' || ch == '}') { /* Check for doubled braces, but only at the top level. If we checked at every level, then f'{0:{3}}' would fail with the two closing braces. */ if (recurse_lvl == 0) { if (*str+1 < end && *(*str+1) == ch) { /* We're going to tell the caller that the literal ends here, but that they should continue scanning. But also skip over the second brace when we resume scanning. */ literal_end = *str+1; *str += 2; result = 1; goto done; } /* Where a single '{' is the start of a new expression, a single '}' is not allowed. */ if (ch == '}') { ast_error(c, n, "f-string: single '}' is not allowed"); return -1; } } /* We're either at a '{', which means we're starting another expression; or a '}', which means we're at the end of this f-string (for a nested format_spec). */ break; } } literal_end = *str; assert(*str <= end); assert(*str == end || **str == '{' || **str == '}'); done: if (literal_start != literal_end) { if (raw) *literal = PyUnicode_DecodeUTF8Stateful(literal_start, literal_end-literal_start, NULL, NULL); else *literal = decode_unicode_with_escapes(c, n, literal_start, literal_end-literal_start); if (!*literal) return -1; } return result; }
321
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
fstring_find_literal
fstring_find_literal( const char ** str , const char * end , int raw , PyObject ** literal , int recurse_lvl , struct compiling * c , const node * n)
['str', 'end', 'raw', 'literal', 'recurse_lvl', 'c', 'n']
fstring_find_literal(const char **str, const char *end, int raw, PyObject **literal, int recurse_lvl, struct compiling *c, const node *n) { /* Get any literal string. It ends when we hit an un-doubled left brace (which isn't part of a unicode name escape such as "\N{EULER CONSTANT}"), or the end of the string. */ const char *literal_start = *str; const char *literal_end; int in_named_escape = 0; int result = 0; assert(*literal == NULL); for (; *str < end; (*str)++) { char ch = **str; if (!in_named_escape && ch == '{' && (*str)-literal_start >= 2 && *(*str-2) == '\\' && *(*str-1) == 'N') { in_named_escape = 1; } else if (in_named_escape && ch == '}') { in_named_escape = 0; } else if (ch == '{' || ch == '}') { /* Check for doubled braces, but only at the top level. If we checked at every level, then f'{0:{3}}' would fail with the two closing braces. */ if (recurse_lvl == 0) { if (*str+1 < end && *(*str+1) == ch) { /* We're going to tell the caller that the literal ends here, but that they should continue scanning. But also skip over the second brace when we resume scanning. */ literal_end = *str+1; *str += 2; result = 1; goto done; } /* Where a single '{' is the start of a new expression, a single '}' is not allowed. */ if (ch == '}') { ast_error(c, n, "f-string: single '}' is not allowed"); return -1; } } /* We're either at a '{', which means we're starting another expression; or a '}', which means we're at the end of this f-string (for a nested format_spec). */ break; } } literal_end = *str; assert(*str <= end); assert(*str == end || **str == '{' || **str == '}'); done: if (literal_start != literal_end) { if (raw) *literal = PyUnicode_DecodeUTF8Stateful(literal_start, literal_end-literal_start, NULL, NULL); else *literal = decode_unicode_with_escapes(c, n, literal_start, literal_end-literal_start); if (!*literal) return -1; } return result; }
321
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
handle_keywordonly_args
handle_keywordonly_args( struct compiling * c , const node * n , int start , asdl_seq * kwonlyargs , asdl_seq * kwdefaults)
['c', 'n', 'start', 'kwonlyargs', 'kwdefaults']
handle_keywordonly_args(struct compiling *c, const node *n, int start, asdl_seq *kwonlyargs, asdl_seq *kwdefaults) { PyObject *argname; node *ch; expr_ty expression, annotation; arg_ty arg; int i = start; int j = 0; /* index for kwdefaults and kwonlyargs */ if (kwonlyargs == NULL) { ast_error(c, CHILD(n, start), "named arguments must follow bare *"); return -1; } assert(kwdefaults != NULL); while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { case vfpdef: case tfpdef: if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) goto error; asdl_seq_SET(kwdefaults, j, expression); i += 2; /* '=' and test */ } else { /* setting NULL if no default value exists */ asdl_seq_SET(kwdefaults, j, NULL); } if (NCH(ch) == 3) { /* ch is NAME ':' test */ annotation = ast_for_expr(c, CHILD(ch, 2)); if (!annotation) goto error; } else { annotation = NULL; } ch = CHILD(ch, 0); argname = NEW_IDENTIFIER(ch); if (!argname) goto error; if (forbidden_name(c, argname, ch, 0)) goto error; arg = arg(argname, annotation, NULL, LINENO(ch), ch->n_col_offset, c->c_arena); if (!arg) goto error; asdl_seq_SET(kwonlyargs, j++, arg); i += 1; /* the name */ if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case TYPE_COMMENT: /* arg will be equal to the last argument processed */ arg->type_comment = NEW_TYPE_COMMENT(ch); i += 1; break; case DOUBLESTAR: return i; default: ast_error(c, ch, "unexpected node"); goto error; } } return i; error: return -1; }
395
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
handle_keywordonly_args
handle_keywordonly_args( struct compiling * c , const node * n , int start , asdl_seq * kwonlyargs , asdl_seq * kwdefaults)
['c', 'n', 'start', 'kwonlyargs', 'kwdefaults']
handle_keywordonly_args(struct compiling *c, const node *n, int start, asdl_seq *kwonlyargs, asdl_seq *kwdefaults) { PyObject *argname; node *ch; expr_ty expression, annotation; arg_ty arg; int i = start; int j = 0; /* index for kwdefaults and kwonlyargs */ if (kwonlyargs == NULL) { ast_error(c, CHILD(n, start), "named arguments must follow bare *"); return -1; } assert(kwdefaults != NULL); while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { case vfpdef: case tfpdef: if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) goto error; asdl_seq_SET(kwdefaults, j, expression); i += 2; /* '=' and test */ } else { /* setting NULL if no default value exists */ asdl_seq_SET(kwdefaults, j, NULL); } if (NCH(ch) == 3) { /* ch is NAME ':' test */ annotation = ast_for_expr(c, CHILD(ch, 2)); if (!annotation) goto error; } else { annotation = NULL; } ch = CHILD(ch, 0); argname = NEW_IDENTIFIER(ch); if (!argname) goto error; if (forbidden_name(c, argname, ch, 0)) goto error; arg = arg(argname, annotation, NULL, LINENO(ch), ch->n_col_offset, c->c_arena); if (!arg) goto error; asdl_seq_SET(kwonlyargs, j++, arg); i += 1; /* the name */ if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case TYPE_COMMENT: /* arg will be equal to the last argument processed */ arg->type_comment = NEW_TYPE_COMMENT(ch); i += 1; break; case DOUBLESTAR: return i; default: ast_error(c, ch, "unexpected node"); goto error; } } return i; error: return -1; }
395
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
init_normalization
init_normalization( struct compiling * c)
['c']
init_normalization(struct compiling *c) { PyObject *m = PyImport_ImportModuleNoBlock("unicodedata"); if (!m) return 0; c->c_normalize = PyObject_GetAttrString(m, "normalize"); Py_DECREF(m); if (!c->c_normalize) return 0; c->c_normalize_args = Py_BuildValue("(sN)", "NFKC", Py_None); if (!c->c_normalize_args) { Py_CLEAR(c->c_normalize); return 0; } PyTuple_SET_ITEM(c->c_normalize_args, 1, NULL); return 1; }
98
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
init_normalization
init_normalization( struct compiling * c)
['c']
init_normalization(struct compiling *c) { PyObject *m = PyImport_ImportModuleNoBlock("unicodedata"); if (!m) return 0; c->c_normalize = PyObject_GetAttrString(m, "normalize"); Py_DECREF(m); if (!c->c_normalize) return 0; c->c_normalize_args = Py_BuildValue("(sN)", "NFKC", Py_None); if (!c->c_normalize_args) { Py_CLEAR(c->c_normalize); return 0; } PyTuple_SET_ITEM(c->c_normalize_args, 1, NULL); return 1; }
98
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
new_identifier
new_identifier( const char * n , struct compiling * c)
['n', 'c']
new_identifier(const char *n, struct compiling *c) { PyObject *id = PyUnicode_DecodeUTF8(n, strlen(n), NULL); if (!id) return NULL; /* PyUnicode_DecodeUTF8 should always return a ready string. */ assert(PyUnicode_IS_READY(id)); /* Check whether there are non-ASCII characters in the identifier; if so, normalize to NFKC. */ if (!PyUnicode_IS_ASCII(id)) { PyObject *id2; if (!c->c_normalize && !init_normalization(c)) { Py_DECREF(id); return NULL; } PyTuple_SET_ITEM(c->c_normalize_args, 1, id); id2 = PyObject_Call(c->c_normalize, c->c_normalize_args, NULL); Py_DECREF(id); if (!id2) return NULL; id = id2; } PyUnicode_InternInPlace(&id); if (PyArena_AddPyObject(c->c_arena, id) < 0) { Py_DECREF(id); return NULL; } return id; }
158
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
new_identifier
new_identifier( const char * n , struct compiling * c)
['n', 'c']
new_identifier(const char *n, struct compiling *c) { PyObject *id = PyUnicode_DecodeUTF8(n, strlen(n), NULL); if (!id) return NULL; /* PyUnicode_DecodeUTF8 should always return a ready string. */ assert(PyUnicode_IS_READY(id)); /* Check whether there are non-ASCII characters in the identifier; if so, normalize to NFKC. */ if (!PyUnicode_IS_ASCII(id)) { PyObject *id2; if (!c->c_normalize && !init_normalization(c)) { Py_DECREF(id); return NULL; } PyTuple_SET_ITEM(c->c_normalize_args, 1, id); id2 = PyObject_Call(c->c_normalize, c->c_normalize_args, NULL); Py_DECREF(id); if (!id2) return NULL; id = id2; } PyUnicode_InternInPlace(&id); if (PyArena_AddPyObject(c->c_arena, id) < 0) { Py_DECREF(id); return NULL; } return id; }
158
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
num_stmts
num_stmts( const node * n)
['n']
num_stmts(const node *n) { int i, l; node *ch; switch (TYPE(n)) { case single_input: if (TYPE(CHILD(n, 0)) == NEWLINE) return 0; else return num_stmts(CHILD(n, 0)); case file_input: l = 0; for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); if (TYPE(ch) == stmt) l += num_stmts(ch); } return l; case stmt: return num_stmts(CHILD(n, 0)); case compound_stmt: return 1; case simple_stmt: return NCH(n) / 2; /* Divide by 2 to remove count of semi-colons */ case suite: /* suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ if (NCH(n) == 1) return num_stmts(CHILD(n, 0)); else { i = 2; l = 0; if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) i += 2; for (; i < (NCH(n) - 1); i++) l += num_stmts(CHILD(n, i)); return l; } default: { char buf[128]; sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } } assert(0); return 0; }
267
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Guido van Rossum
2019-01-22 19:09:26-08:00
Fully incorporate the code from Python 3.7.2 (#78) This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor.
156afcb26c198e162504a57caddfe0acd9ed7dce
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
num_stmts
num_stmts( const node * n)
['n']
num_stmts(const node *n) { int i, l; node *ch; switch (TYPE(n)) { case single_input: if (TYPE(CHILD(n, 0)) == NEWLINE) return 0; else return num_stmts(CHILD(n, 0)); case file_input: l = 0; for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); if (TYPE(ch) == stmt) l += num_stmts(ch); } return l; case stmt: return num_stmts(CHILD(n, 0)); case compound_stmt: return 1; case simple_stmt: return NCH(n) / 2; /* Divide by 2 to remove count of semi-colons */ case suite: /* suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ if (NCH(n) == 1) return num_stmts(CHILD(n, 0)); else { i = 2; l = 0; if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) i += 2; for (; i < (NCH(n) - 1); i++) l += num_stmts(CHILD(n, i)); return l; } default: { char buf[128]; sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } } assert(0); return 0; }
267
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Wictor Lund
2019-04-09 22:51:30+03:00
Fix two out-of-bounds array reads (#99) The patch is taken from a commit to the CPython repo with the message: bpo-36495: Fix two out-of-bounds array reads (GH-12641) Research and fix by @bradlarsen.
dc317ac9cff859aa84eeabe03fb5004982545b3b
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_arguments
ast_for_arguments( struct compiling * c , const node * n)
['c', 'n']
ast_for_arguments(struct compiling *c, const node *n) { /* This function handles both typedargslist (function definition) and varargslist (lambda definition). parameters: '(' [typedargslist] ')' typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] | '**' tfpdef [',']]] | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] | '**' tfpdef [',']) tfpdef: NAME [':' test] varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] | '**' vfpdef [',']]] | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] | '**' vfpdef [','] ) vfpdef: NAME */ int i, j, k, nposargs = 0, nkwonlyargs = 0; int nposdefaults = 0, found_default = 0; asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults; arg_ty vararg = NULL, kwarg = NULL; arg_ty arg = NULL; node *ch; if (TYPE(n) == parameters) { if (NCH(n) == 2) /* () as argument list */ return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena); n = CHILD(n, 1); } assert(TYPE(n) == typedargslist || TYPE(n) == varargslist); /* First count the number of positional args & defaults. The variable i is the loop index for this for loop and the next. The next loop picks up where the first leaves off. */ for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); if (TYPE(ch) == STAR) { /* skip star */ i++; if (i < NCH(n) && /* skip argument following star */ (TYPE(CHILD(n, i)) == tfpdef || TYPE(CHILD(n, i)) == vfpdef)) { i++; } break; } if (TYPE(ch) == DOUBLESTAR) break; if (TYPE(ch) == vfpdef || TYPE(ch) == tfpdef) nposargs++; if (TYPE(ch) == EQUAL) nposdefaults++; } /* count the number of keyword only args & defaults for keyword only args */ for ( ; i < NCH(n); ++i) { ch = CHILD(n, i); if (TYPE(ch) == DOUBLESTAR) break; if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++; } posargs = (nposargs ? _Ta3_asdl_seq_new(nposargs, c->c_arena) : NULL); if (!posargs && nposargs) return NULL; kwonlyargs = (nkwonlyargs ? _Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL); if (!kwonlyargs && nkwonlyargs) return NULL; posdefaults = (nposdefaults ? _Ta3_asdl_seq_new(nposdefaults, c->c_arena) : NULL); if (!posdefaults && nposdefaults) return NULL; /* The length of kwonlyargs and kwdefaults are same since we set NULL as default for keyword only argument w/o default - we have sequence data structure, but no dictionary */ kwdefaults = (nkwonlyargs ? _Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL); if (!kwdefaults && nkwonlyargs) return NULL; /* tfpdef: NAME [':' test] vfpdef: NAME */ i = 0; j = 0; /* index for defaults */ k = 0; /* index for args */ while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { case tfpdef: case vfpdef: /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is anything other than EQUAL or a comma? */ /* XXX Should NCH(n) check be made a separate check? */ if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { expr_ty expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) return NULL; assert(posdefaults != NULL); asdl_seq_SET(posdefaults, j++, expression); i += 2; found_default = 1; } else if (found_default) { ast_error(c, n, "non-default argument follows default argument"); return NULL; } arg = ast_for_arg(c, ch); if (!arg) return NULL; asdl_seq_SET(posargs, k++, arg); i += 1; /* the name */ if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case STAR: if (i+1 >= NCH(n) || (i+2 == NCH(n) && (TYPE(CHILD(n, i+1)) == COMMA || TYPE(CHILD(n, i+1)) == TYPE_COMMENT))) { ast_error(c, CHILD(n, i), "named arguments must follow bare *"); return NULL; } ch = CHILD(n, i+1); /* tfpdef or COMMA */ if (TYPE(ch) == COMMA) { int res = 0; i += 2; /* now follows keyword only arguments */ if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { ast_error(c, CHILD(n, i), "bare * has associated type comment"); return NULL; } res = handle_keywordonly_args(c, n, i, kwonlyargs, kwdefaults); if (res == -1) return NULL; i = res; /* res has new position to process */ } else { vararg = ast_for_arg(c, ch); if (!vararg) return NULL; i += 2; /* the star and the name */ if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { vararg->type_comment = NEW_TYPE_COMMENT(CHILD(n, i)); if (!vararg->type_comment) return NULL; i += 1; } if (i < NCH(n) && (TYPE(CHILD(n, i)) == tfpdef || TYPE(CHILD(n, i)) == vfpdef)) { int res = 0; res = handle_keywordonly_args(c, n, i, kwonlyargs, kwdefaults); if (res == -1) return NULL; i = res; /* res has new position to process */ } } break; case DOUBLESTAR: ch = CHILD(n, i+1); /* tfpdef */ assert(TYPE(ch) == tfpdef || TYPE(ch) == vfpdef); kwarg = ast_for_arg(c, ch); if (!kwarg) return NULL; i += 2; /* the double star and the name */ if (TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case TYPE_COMMENT: assert(i); if (kwarg) arg = kwarg; /* arg will be equal to the last argument processed */ arg->type_comment = NEW_TYPE_COMMENT(ch); if (!arg->type_comment) return NULL; i += 1; break; default: PyErr_Format(PyExc_SystemError, "unexpected node in varargslist: %d @ %d", TYPE(ch), i); return NULL; } } return arguments(posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena); }
1122
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Wictor Lund
2019-04-09 22:51:30+03:00
Fix two out-of-bounds array reads (#99) The patch is taken from a commit to the CPython repo with the message: bpo-36495: Fix two out-of-bounds array reads (GH-12641) Research and fix by @bradlarsen.
dc317ac9cff859aa84eeabe03fb5004982545b3b
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
ast_for_arguments
ast_for_arguments( struct compiling * c , const node * n)
['c', 'n']
ast_for_arguments(struct compiling *c, const node *n) { /* This function handles both typedargslist (function definition) and varargslist (lambda definition). parameters: '(' [typedargslist] ')' typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] | '**' tfpdef [',']]] | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] | '**' tfpdef [',']) tfpdef: NAME [':' test] varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] | '**' vfpdef [',']]] | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] | '**' vfpdef [','] ) vfpdef: NAME */ int i, j, k, nposargs = 0, nkwonlyargs = 0; int nposdefaults = 0, found_default = 0; asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults; arg_ty vararg = NULL, kwarg = NULL; arg_ty arg = NULL; node *ch; if (TYPE(n) == parameters) { if (NCH(n) == 2) /* () as argument list */ return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena); n = CHILD(n, 1); } assert(TYPE(n) == typedargslist || TYPE(n) == varargslist); /* First count the number of positional args & defaults. The variable i is the loop index for this for loop and the next. The next loop picks up where the first leaves off. */ for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); if (TYPE(ch) == STAR) { /* skip star */ i++; if (i < NCH(n) && /* skip argument following star */ (TYPE(CHILD(n, i)) == tfpdef || TYPE(CHILD(n, i)) == vfpdef)) { i++; } break; } if (TYPE(ch) == DOUBLESTAR) break; if (TYPE(ch) == vfpdef || TYPE(ch) == tfpdef) nposargs++; if (TYPE(ch) == EQUAL) nposdefaults++; } /* count the number of keyword only args & defaults for keyword only args */ for ( ; i < NCH(n); ++i) { ch = CHILD(n, i); if (TYPE(ch) == DOUBLESTAR) break; if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++; } posargs = (nposargs ? _Ta3_asdl_seq_new(nposargs, c->c_arena) : NULL); if (!posargs && nposargs) return NULL; kwonlyargs = (nkwonlyargs ? _Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL); if (!kwonlyargs && nkwonlyargs) return NULL; posdefaults = (nposdefaults ? _Ta3_asdl_seq_new(nposdefaults, c->c_arena) : NULL); if (!posdefaults && nposdefaults) return NULL; /* The length of kwonlyargs and kwdefaults are same since we set NULL as default for keyword only argument w/o default - we have sequence data structure, but no dictionary */ kwdefaults = (nkwonlyargs ? _Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL); if (!kwdefaults && nkwonlyargs) return NULL; /* tfpdef: NAME [':' test] vfpdef: NAME */ i = 0; j = 0; /* index for defaults */ k = 0; /* index for args */ while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { case tfpdef: case vfpdef: /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is anything other than EQUAL or a comma? */ /* XXX Should NCH(n) check be made a separate check? */ if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { expr_ty expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) return NULL; assert(posdefaults != NULL); asdl_seq_SET(posdefaults, j++, expression); i += 2; found_default = 1; } else if (found_default) { ast_error(c, n, "non-default argument follows default argument"); return NULL; } arg = ast_for_arg(c, ch); if (!arg) return NULL; asdl_seq_SET(posargs, k++, arg); i += 1; /* the name */ if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case STAR: if (i+1 >= NCH(n) || (i+2 == NCH(n) && (TYPE(CHILD(n, i+1)) == COMMA || TYPE(CHILD(n, i+1)) == TYPE_COMMENT))) { ast_error(c, CHILD(n, i), "named arguments must follow bare *"); return NULL; } ch = CHILD(n, i+1); /* tfpdef or COMMA */ if (TYPE(ch) == COMMA) { int res = 0; i += 2; /* now follows keyword only arguments */ if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { ast_error(c, CHILD(n, i), "bare * has associated type comment"); return NULL; } res = handle_keywordonly_args(c, n, i, kwonlyargs, kwdefaults); if (res == -1) return NULL; i = res; /* res has new position to process */ } else { vararg = ast_for_arg(c, ch); if (!vararg) return NULL; i += 2; /* the star and the name */ if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) { vararg->type_comment = NEW_TYPE_COMMENT(CHILD(n, i)); if (!vararg->type_comment) return NULL; i += 1; } if (i < NCH(n) && (TYPE(CHILD(n, i)) == tfpdef || TYPE(CHILD(n, i)) == vfpdef)) { int res = 0; res = handle_keywordonly_args(c, n, i, kwonlyargs, kwdefaults); if (res == -1) return NULL; i = res; /* res has new position to process */ } } break; case DOUBLESTAR: ch = CHILD(n, i+1); /* tfpdef */ assert(TYPE(ch) == tfpdef || TYPE(ch) == vfpdef); kwarg = ast_for_arg(c, ch); if (!kwarg) return NULL; i += 2; /* the double star and the name */ if (TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case TYPE_COMMENT: assert(i); if (kwarg) arg = kwarg; /* arg will be equal to the last argument processed */ arg->type_comment = NEW_TYPE_COMMENT(ch); if (!arg->type_comment) return NULL; i += 1; break; default: PyErr_Format(PyExc_SystemError, "unexpected node in varargslist: %d @ %d", TYPE(ch), i); return NULL; } } return arguments(posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena); }
1122
True
1
CVE-2019-19274
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Wictor Lund
2019-04-09 22:51:30+03:00
Fix two out-of-bounds array reads (#99) The patch is taken from a commit to the CPython repo with the message: bpo-36495: Fix two out-of-bounds array reads (GH-12641) Research and fix by @bradlarsen.
dc317ac9cff859aa84eeabe03fb5004982545b3b
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
handle_keywordonly_args
handle_keywordonly_args( struct compiling * c , const node * n , int start , asdl_seq * kwonlyargs , asdl_seq * kwdefaults)
['c', 'n', 'start', 'kwonlyargs', 'kwdefaults']
handle_keywordonly_args(struct compiling *c, const node *n, int start, asdl_seq *kwonlyargs, asdl_seq *kwdefaults) { PyObject *argname; node *ch; expr_ty expression, annotation; arg_ty arg = NULL; int i = start; int j = 0; /* index for kwdefaults and kwonlyargs */ if (kwonlyargs == NULL) { ast_error(c, CHILD(n, start), "named arguments must follow bare *"); return -1; } assert(kwdefaults != NULL); while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { case vfpdef: case tfpdef: if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) goto error; asdl_seq_SET(kwdefaults, j, expression); i += 2; /* '=' and test */ } else { /* setting NULL if no default value exists */ asdl_seq_SET(kwdefaults, j, NULL); } if (NCH(ch) == 3) { /* ch is NAME ':' test */ annotation = ast_for_expr(c, CHILD(ch, 2)); if (!annotation) goto error; } else { annotation = NULL; } ch = CHILD(ch, 0); argname = NEW_IDENTIFIER(ch); if (!argname) goto error; if (forbidden_name(c, argname, ch, 0)) goto error; arg = arg(argname, annotation, NULL, LINENO(ch), ch->n_col_offset, c->c_arena); if (!arg) goto error; asdl_seq_SET(kwonlyargs, j++, arg); i += 1; /* the name */ if (TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case TYPE_COMMENT: /* arg will be equal to the last argument processed */ arg->type_comment = NEW_TYPE_COMMENT(ch); if (!arg->type_comment) goto error; i += 1; break; case DOUBLESTAR: return i; default: ast_error(c, ch, "unexpected node"); goto error; } } return i; error: return -1; }
400
True
1
CVE-2019-19275
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}]
2020-03-14T02:15Z
2019-11-26T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Wictor Lund
2019-04-09 22:51:30+03:00
Fix two out-of-bounds array reads (#99) The patch is taken from a commit to the CPython repo with the message: bpo-36495: Fix two out-of-bounds array reads (GH-12641) Research and fix by @bradlarsen.
dc317ac9cff859aa84eeabe03fb5004982545b3b
False
python/typed_ast
Modified fork of CPython's ast module that parses `# type:` comments
2016-02-16 22:40:09
2022-07-15 06:04:03
python
212.0
53.0
handle_keywordonly_args
handle_keywordonly_args( struct compiling * c , const node * n , int start , asdl_seq * kwonlyargs , asdl_seq * kwdefaults)
['c', 'n', 'start', 'kwonlyargs', 'kwdefaults']
handle_keywordonly_args(struct compiling *c, const node *n, int start, asdl_seq *kwonlyargs, asdl_seq *kwdefaults) { PyObject *argname; node *ch; expr_ty expression, annotation; arg_ty arg = NULL; int i = start; int j = 0; /* index for kwdefaults and kwonlyargs */ if (kwonlyargs == NULL) { ast_error(c, CHILD(n, start), "named arguments must follow bare *"); return -1; } assert(kwdefaults != NULL); while (i < NCH(n)) { ch = CHILD(n, i); switch (TYPE(ch)) { case vfpdef: case tfpdef: if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) goto error; asdl_seq_SET(kwdefaults, j, expression); i += 2; /* '=' and test */ } else { /* setting NULL if no default value exists */ asdl_seq_SET(kwdefaults, j, NULL); } if (NCH(ch) == 3) { /* ch is NAME ':' test */ annotation = ast_for_expr(c, CHILD(ch, 2)); if (!annotation) goto error; } else { annotation = NULL; } ch = CHILD(ch, 0); argname = NEW_IDENTIFIER(ch); if (!argname) goto error; if (forbidden_name(c, argname, ch, 0)) goto error; arg = arg(argname, annotation, NULL, LINENO(ch), ch->n_col_offset, c->c_arena); if (!arg) goto error; asdl_seq_SET(kwonlyargs, j++, arg); i += 1; /* the name */ if (TYPE(CHILD(n, i)) == COMMA) i += 1; /* the comma, if present */ break; case TYPE_COMMENT: /* arg will be equal to the last argument processed */ arg->type_comment = NEW_TYPE_COMMENT(ch); if (!arg->type_comment) goto error; i += 1; break; case DOUBLESTAR: return i; default: ast_error(c, ch, "unexpected node"); goto error; } } return i; error: return -1; }
400
True
1
CVE-2019-19624
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:P
NETWORK
LOW
NONE
PARTIAL
NONE
PARTIAL
6.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
LOW
6.5
MEDIUM
3.9
2.5
False
[{'url': 'https://github.com/opencv/opencv/issues/14554', 'name': 'https://github.com/opencv/opencv/issues/14554', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/opencv/opencv/commit/d1615ba11a93062b1429fce9f0f638d1572d3418', 'name': 'https://github.com/opencv/opencv/commit/d1615ba11a93062b1429fce9f0f638d1572d3418', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2019-19624', 'name': 'https://access.redhat.com/security/cve/cve-2019-19624', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opencv:opencv:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An out-of-bounds read was discovered in OpenCV before 4.1.1. Specifically, variable coarsest_scale is assumed to be greater than or equal to finest_scale within the calc()/ocl_calc() functions in dis_flow.cpp. However, this is not true when dealing with small images, leading to an out-of-bounds read of the heap-allocated arrays Ux and Uy.'}]
2019-12-17T20:48Z
2019-12-06T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Thang Tran
2019-05-27 08:18:26+02:00
video:fixed DISOpticalFlow segfault from small img
d1615ba11a93062b1429fce9f0f638d1572d3418
False
opencv/opencv
Open Source Computer Vision Library
2012-07-19 09:40:17
2022-08-27 20:47:45
https://opencv.org
opencv
63438.0
52347.0
cv::DISOpticalFlowImpl::calc
cv::DISOpticalFlowImpl::calc( InputArray I0 , InputArray I1 , InputOutputArray flow)
['I0', 'I1', 'flow']
void DISOpticalFlowImpl::calc(InputArray I0, InputArray I1, InputOutputArray flow) { CV_Assert(!I0.empty() && I0.depth() == CV_8U && I0.channels() == 1); CV_Assert(!I1.empty() && I1.depth() == CV_8U && I1.channels() == 1); CV_Assert(I0.sameSize(I1)); CV_Assert(I0.isContinuous()); CV_Assert(I1.isContinuous()); CV_OCL_RUN(flow.isUMat() && (patch_size == 8) && (use_spatial_propagation == true), ocl_calc(I0, I1, flow)); Mat I0Mat = I0.getMat(); Mat I1Mat = I1.getMat(); bool use_input_flow = false; if (flow.sameSize(I0) && flow.depth() == CV_32F && flow.channels() == 2) use_input_flow = true; else flow.create(I1Mat.size(), CV_32FC2); Mat flowMat = flow.getMat(); coarsest_scale = min((int)(log(max(I0Mat.cols, I0Mat.rows) / (4.0 * patch_size)) / log(2.0) + 0.5), /* Original code serach for maximal movement of width/4 */ (int)(log(min(I0Mat.cols, I0Mat.rows) / patch_size) / log(2.0))); /* Deepest pyramid level greater or equal than patch*/ int num_stripes = getNumThreads(); prepareBuffers(I0Mat, I1Mat, flowMat, use_input_flow); Ux[coarsest_scale].setTo(0.0f); Uy[coarsest_scale].setTo(0.0f); for (int i = coarsest_scale; i >= finest_scale; i--) { w = I0s[i].cols; h = I0s[i].rows; ws = 1 + (w - patch_size) / patch_stride; hs = 1 + (h - patch_size) / patch_stride; precomputeStructureTensor(I0xx_buf, I0yy_buf, I0xy_buf, I0x_buf, I0y_buf, I0xs[i], I0ys[i]); if (use_spatial_propagation) { /* Use a fixed number of stripes regardless the number of threads to make inverse search * with spatial propagation reproducible */ parallel_for_(Range(0, 8), PatchInverseSearch_ParBody(*this, 8, hs, Sx, Sy, Ux[i], Uy[i], I0s[i], I1s_ext[i], I0xs[i], I0ys[i], 2, i)); } else { parallel_for_(Range(0, num_stripes), PatchInverseSearch_ParBody(*this, num_stripes, hs, Sx, Sy, Ux[i], Uy[i], I0s[i], I1s_ext[i], I0xs[i], I0ys[i], 1, i)); } parallel_for_(Range(0, num_stripes), Densification_ParBody(*this, num_stripes, I0s[i].rows, Ux[i], Uy[i], Sx, Sy, I0s[i], I1s[i])); if (variational_refinement_iter > 0) variational_refinement_processors[i]->calcUV(I0s[i], I1s[i], Ux[i], Uy[i]); if (i > finest_scale) { resize(Ux[i], Ux[i - 1], Ux[i - 1].size()); resize(Uy[i], Uy[i - 1], Uy[i - 1].size()); Ux[i - 1] *= 2; Uy[i - 1] *= 2; } } Mat uxy[] = {Ux[finest_scale], Uy[finest_scale]}; merge(uxy, 2, U); resize(U, flowMat, flowMat.size()); flowMat *= 1 << finest_scale; }
729
True
1
CVE-2019-19624
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:P
NETWORK
LOW
NONE
PARTIAL
NONE
PARTIAL
6.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
LOW
6.5
MEDIUM
3.9
2.5
False
[{'url': 'https://github.com/opencv/opencv/issues/14554', 'name': 'https://github.com/opencv/opencv/issues/14554', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/opencv/opencv/commit/d1615ba11a93062b1429fce9f0f638d1572d3418', 'name': 'https://github.com/opencv/opencv/commit/d1615ba11a93062b1429fce9f0f638d1572d3418', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2019-19624', 'name': 'https://access.redhat.com/security/cve/cve-2019-19624', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opencv:opencv:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An out-of-bounds read was discovered in OpenCV before 4.1.1. Specifically, variable coarsest_scale is assumed to be greater than or equal to finest_scale within the calc()/ocl_calc() functions in dis_flow.cpp. However, this is not true when dealing with small images, leading to an out-of-bounds read of the heap-allocated arrays Ux and Uy.'}]
2019-12-17T20:48Z
2019-12-06T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Thang Tran
2019-05-27 08:18:26+02:00
video:fixed DISOpticalFlow segfault from small img
d1615ba11a93062b1429fce9f0f638d1572d3418
False
opencv/opencv
Open Source Computer Vision Library
2012-07-19 09:40:17
2022-08-27 20:47:45
https://opencv.org
opencv
63438.0
52347.0
cv::DISOpticalFlowImpl::ocl_calc
cv::DISOpticalFlowImpl::ocl_calc( InputArray I0 , InputArray I1 , InputOutputArray flow)
['I0', 'I1', 'flow']
bool DISOpticalFlowImpl::ocl_calc(InputArray I0, InputArray I1, InputOutputArray flow) { UMat I0Mat = I0.getUMat(); UMat I1Mat = I1.getUMat(); bool use_input_flow = false; if (flow.sameSize(I0) && flow.depth() == CV_32F && flow.channels() == 2) use_input_flow = true; else flow.create(I1Mat.size(), CV_32FC2); UMat &u_flowMat = flow.getUMatRef(); coarsest_scale = min((int)(log(max(I0Mat.cols, I0Mat.rows) / (4.0 * patch_size)) / log(2.0) + 0.5), /* Original code serach for maximal movement of width/4 */ (int)(log(min(I0Mat.cols, I0Mat.rows) / patch_size) / log(2.0))); /* Deepest pyramid level greater or equal than patch*/ ocl_prepareBuffers(I0Mat, I1Mat, u_flowMat, use_input_flow); u_Ux[coarsest_scale].setTo(0.0f); u_Uy[coarsest_scale].setTo(0.0f); for (int i = coarsest_scale; i >= finest_scale; i--) { w = u_I0s[i].cols; h = u_I0s[i].rows; ws = 1 + (w - patch_size) / patch_stride; hs = 1 + (h - patch_size) / patch_stride; if (!ocl_precomputeStructureTensor(u_I0xx_buf, u_I0yy_buf, u_I0xy_buf, u_I0x_buf, u_I0y_buf, u_I0xs[i], u_I0ys[i])) return false; if (!ocl_PatchInverseSearch(u_Ux[i], u_Uy[i], u_I0s[i], u_I1s_ext[i], u_I0xs[i], u_I0ys[i], 2, i)) return false; if (!ocl_Densification(u_Ux[i], u_Uy[i], u_Sx, u_Sy, u_I0s[i], u_I1s[i])) return false; if (variational_refinement_iter > 0) variational_refinement_processors[i]->calcUV(u_I0s[i], u_I1s[i], u_Ux[i].getMat(ACCESS_WRITE), u_Uy[i].getMat(ACCESS_WRITE)); if (i > finest_scale) { resize(u_Ux[i], u_Ux[i - 1], u_Ux[i - 1].size()); resize(u_Uy[i], u_Uy[i - 1], u_Uy[i - 1].size()); multiply(u_Ux[i - 1], 2, u_Ux[i - 1]); multiply(u_Uy[i - 1], 2, u_Uy[i - 1]); } } vector<UMat> uxy(2); uxy[0] = u_Ux[finest_scale]; uxy[1] = u_Uy[finest_scale]; merge(uxy, u_U); resize(u_U, u_flowMat, u_flowMat.size()); multiply(u_flowMat, 1 << finest_scale, u_flowMat); return true; }
566
True
1
CVE-2020-5209
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-fw72-r8xm-45p8', 'name': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-fw72-r8xm-45p8', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'name': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nethack:nethack:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.6.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In NetHack before 3.6.5, unknown options starting with -de and -i can cause a buffer overflow resulting in a crash or remote code execution/privilege escalation. This vulnerability affects systems that have NetHack installed suid/sgid and shared systems that allow users to influence command line options. Users should upgrade to NetHack 3.6.5.'}]
2020-02-03T18:10Z
2020-01-28T18:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
PatR
2020-01-16 05:22:18-08:00
command line triggered buffer overruns Prevent extremely long command line arguments from overflowing local buffers in raw_printf or config_error_add. The increased buffer sizes they recently got to deal with long configuration file values aren't sufficient to handle command line induced overflows. choose_windows(core): copy and truncate the window_type argument in case it gets passed to config_error_add(). process_options(unix): report bad values with "%.60s" so that vsprintf will implicitly truncate when formatted by raw_printf().
f3def5c0b999478da2d0a8f0b6a7c370a2065f77
False
NetHack/NetHack
Official NetHack Git Repository
2015-12-08 02:33:01
2022-08-27 19:19:47
NetHack
2088.0
387.0
choose_windows
choose_windows( s) const
['s']
choose_windows(s) const char *s; { register int i; for (i = 0; winchoices[i].procs; i++) { if ('+' == winchoices[i].procs->name[0]) continue; if ('-' == winchoices[i].procs->name[0]) continue; if (!strcmpi(s, winchoices[i].procs->name)) { windowprocs = *winchoices[i].procs; if (last_winchoice && last_winchoice->ini_routine) (*last_winchoice->ini_routine)(WININIT_UNDO); if (winchoices[i].ini_routine) (*winchoices[i].ini_routine)(WININIT); last_winchoice = &winchoices[i]; return; } } if (!windowprocs.win_raw_print) windowprocs.win_raw_print = def_raw_print; if (!windowprocs.win_wait_synch) /* early config file error processing routines call this */ windowprocs.win_wait_synch = def_wait_synch; if (!winchoices[0].procs) { raw_printf("No window types?"); nh_terminate(EXIT_FAILURE); } if (!winchoices[1].procs) { config_error_add( "Window type %s not recognized. The only choice is: %s", s, winchoices[0].procs->name); } else { char buf[BUFSZ]; boolean first = TRUE; buf[0] = '\0'; for (i = 0; winchoices[i].procs; i++) { if ('+' == winchoices[i].procs->name[0]) continue; if ('-' == winchoices[i].procs->name[0]) continue; Sprintf(eos(buf), "%s%s", first ? "" : ", ", winchoices[i].procs->name); first = FALSE; } config_error_add("Window type %s not recognized. Choices are: %s", s, buf); } if (windowprocs.win_raw_print == def_raw_print || WINDOWPORT("safe-startup")) nh_terminate(EXIT_SUCCESS); }
355
True
1
CVE-2020-5210
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-v5pg-hpjg-9rpp', 'name': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-v5pg-hpjg-9rpp', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'name': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nethack:nethack:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.6.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In NetHack before 3.6.5, an invalid argument to the -w command line option can cause a buffer overflow resulting in a crash or remote code execution/privilege escalation. This vulnerability affects systems that have NetHack installed suid/sgid and shared systems that allow users to influence command line options. Users should upgrade to NetHack 3.6.5.'}]
2020-02-03T18:13Z
2020-01-28T18:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
PatR
2020-01-16 05:22:18-08:00
command line triggered buffer overruns Prevent extremely long command line arguments from overflowing local buffers in raw_printf or config_error_add. The increased buffer sizes they recently got to deal with long configuration file values aren't sufficient to handle command line induced overflows. choose_windows(core): copy and truncate the window_type argument in case it gets passed to config_error_add(). process_options(unix): report bad values with "%.60s" so that vsprintf will implicitly truncate when formatted by raw_printf().
f3def5c0b999478da2d0a8f0b6a7c370a2065f77
False
NetHack/NetHack
Official NetHack Git Repository
2015-12-08 02:33:01
2022-08-27 19:19:47
NetHack
2088.0
387.0
choose_windows
choose_windows( s) const
['s']
choose_windows(s) const char *s; { register int i; for (i = 0; winchoices[i].procs; i++) { if ('+' == winchoices[i].procs->name[0]) continue; if ('-' == winchoices[i].procs->name[0]) continue; if (!strcmpi(s, winchoices[i].procs->name)) { windowprocs = *winchoices[i].procs; if (last_winchoice && last_winchoice->ini_routine) (*last_winchoice->ini_routine)(WININIT_UNDO); if (winchoices[i].ini_routine) (*winchoices[i].ini_routine)(WININIT); last_winchoice = &winchoices[i]; return; } } if (!windowprocs.win_raw_print) windowprocs.win_raw_print = def_raw_print; if (!windowprocs.win_wait_synch) /* early config file error processing routines call this */ windowprocs.win_wait_synch = def_wait_synch; if (!winchoices[0].procs) { raw_printf("No window types?"); nh_terminate(EXIT_FAILURE); } if (!winchoices[1].procs) { config_error_add( "Window type %s not recognized. The only choice is: %s", s, winchoices[0].procs->name); } else { char buf[BUFSZ]; boolean first = TRUE; buf[0] = '\0'; for (i = 0; winchoices[i].procs; i++) { if ('+' == winchoices[i].procs->name[0]) continue; if ('-' == winchoices[i].procs->name[0]) continue; Sprintf(eos(buf), "%s%s", first ? "" : ", ", winchoices[i].procs->name); first = FALSE; } config_error_add("Window type %s not recognized. Choices are: %s", s, buf); } if (windowprocs.win_raw_print == def_raw_print || WINDOWPORT("safe-startup")) nh_terminate(EXIT_SUCCESS); }
355
True
1
CVE-2020-5209
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-fw72-r8xm-45p8', 'name': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-fw72-r8xm-45p8', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'name': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nethack:nethack:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.6.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In NetHack before 3.6.5, unknown options starting with -de and -i can cause a buffer overflow resulting in a crash or remote code execution/privilege escalation. This vulnerability affects systems that have NetHack installed suid/sgid and shared systems that allow users to influence command line options. Users should upgrade to NetHack 3.6.5.'}]
2020-02-03T18:10Z
2020-01-28T18:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
PatR
2020-01-16 05:22:18-08:00
command line triggered buffer overruns Prevent extremely long command line arguments from overflowing local buffers in raw_printf or config_error_add. The increased buffer sizes they recently got to deal with long configuration file values aren't sufficient to handle command line induced overflows. choose_windows(core): copy and truncate the window_type argument in case it gets passed to config_error_add(). process_options(unix): report bad values with "%.60s" so that vsprintf will implicitly truncate when formatted by raw_printf().
f3def5c0b999478da2d0a8f0b6a7c370a2065f77
False
NetHack/NetHack
Official NetHack Git Repository
2015-12-08 02:33:01
2022-08-27 19:19:47
NetHack
2088.0
387.0
process_options
process_options( argc , argv)
['argc', 'argv']
process_options(argc, argv) int argc; char *argv[]; { int i, l; /* * Process options. */ while (argc > 1 && argv[1][0] == '-') { argv++; argc--; l = (int) strlen(*argv); /* must supply at least 4 chars to match "-XXXgraphics" */ if (l < 4) l = 4; switch (argv[0][1]) { case 'D': case 'd': if ((argv[0][1] == 'D' && !argv[0][2]) || !strcmpi(*argv, "-debug")) { wizard = TRUE, discover = FALSE; } else if (!strncmpi(*argv, "-DECgraphics", l)) { load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); } else { raw_printf("Unknown option: %s", *argv); } break; case 'X': discover = TRUE, wizard = FALSE; break; #ifdef NEWS case 'n': iflags.news = FALSE; break; #endif case 'u': if (argv[0][2]) { (void) strncpy(plname, argv[0] + 2, sizeof plname - 1); } else if (argc > 1) { argc--; argv++; (void) strncpy(plname, argv[0], sizeof plname - 1); } else { raw_print("Player name expected after -u"); } break; case 'I': case 'i': if (!strncmpi(*argv, "-IBMgraphics", l)) { load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); } else { raw_printf("Unknown option: %s", *argv); } break; case 'p': /* profession (role) */ if (argv[0][2]) { if ((i = str2role(&argv[0][2])) >= 0) flags.initrole = i; } else if (argc > 1) { argc--; argv++; if ((i = str2role(argv[0])) >= 0) flags.initrole = i; } break; case 'r': /* race */ if (argv[0][2]) { if ((i = str2race(&argv[0][2])) >= 0) flags.initrace = i; } else if (argc > 1) { argc--; argv++; if ((i = str2race(argv[0])) >= 0) flags.initrace = i; } break; case 'w': /* windowtype */ config_error_init(FALSE, "command line", FALSE); choose_windows(&argv[0][2]); config_error_done(); break; case '@': flags.randomall = 1; break; default: if ((i = str2role(&argv[0][1])) >= 0) { flags.initrole = i; break; } /* else raw_printf("Unknown option: %s", *argv); */ } } #ifdef SYSCF if (argc > 1) raw_printf("MAXPLAYERS are set in sysconf file.\n"); #else /* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */ if (argc > 1) locknum = atoi(argv[1]); #endif #ifdef MAX_NR_OF_PLAYERS /* limit to compile-time limit */ if (!locknum || locknum > MAX_NR_OF_PLAYERS) locknum = MAX_NR_OF_PLAYERS; #endif #ifdef SYSCF /* let syscf override compile-time limit */ if (!locknum || (sysopt.maxplayers && locknum > sysopt.maxplayers)) locknum = sysopt.maxplayers; #endif }
619
True
1
CVE-2020-5210
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-v5pg-hpjg-9rpp', 'name': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-v5pg-hpjg-9rpp', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'name': 'https://github.com/NetHack/NetHack/commit/f3def5c0b999478da2d0a8f0b6a7c370a2065f77', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nethack:nethack:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.6.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In NetHack before 3.6.5, an invalid argument to the -w command line option can cause a buffer overflow resulting in a crash or remote code execution/privilege escalation. This vulnerability affects systems that have NetHack installed suid/sgid and shared systems that allow users to influence command line options. Users should upgrade to NetHack 3.6.5.'}]
2020-02-03T18:13Z
2020-01-28T18:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
PatR
2020-01-16 05:22:18-08:00
command line triggered buffer overruns Prevent extremely long command line arguments from overflowing local buffers in raw_printf or config_error_add. The increased buffer sizes they recently got to deal with long configuration file values aren't sufficient to handle command line induced overflows. choose_windows(core): copy and truncate the window_type argument in case it gets passed to config_error_add(). process_options(unix): report bad values with "%.60s" so that vsprintf will implicitly truncate when formatted by raw_printf().
f3def5c0b999478da2d0a8f0b6a7c370a2065f77
False
NetHack/NetHack
Official NetHack Git Repository
2015-12-08 02:33:01
2022-08-27 19:19:47
NetHack
2088.0
387.0
process_options
process_options( argc , argv)
['argc', 'argv']
process_options(argc, argv) int argc; char *argv[]; { int i, l; /* * Process options. */ while (argc > 1 && argv[1][0] == '-') { argv++; argc--; l = (int) strlen(*argv); /* must supply at least 4 chars to match "-XXXgraphics" */ if (l < 4) l = 4; switch (argv[0][1]) { case 'D': case 'd': if ((argv[0][1] == 'D' && !argv[0][2]) || !strcmpi(*argv, "-debug")) { wizard = TRUE, discover = FALSE; } else if (!strncmpi(*argv, "-DECgraphics", l)) { load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); } else { raw_printf("Unknown option: %s", *argv); } break; case 'X': discover = TRUE, wizard = FALSE; break; #ifdef NEWS case 'n': iflags.news = FALSE; break; #endif case 'u': if (argv[0][2]) { (void) strncpy(plname, argv[0] + 2, sizeof plname - 1); } else if (argc > 1) { argc--; argv++; (void) strncpy(plname, argv[0], sizeof plname - 1); } else { raw_print("Player name expected after -u"); } break; case 'I': case 'i': if (!strncmpi(*argv, "-IBMgraphics", l)) { load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); } else { raw_printf("Unknown option: %s", *argv); } break; case 'p': /* profession (role) */ if (argv[0][2]) { if ((i = str2role(&argv[0][2])) >= 0) flags.initrole = i; } else if (argc > 1) { argc--; argv++; if ((i = str2role(argv[0])) >= 0) flags.initrole = i; } break; case 'r': /* race */ if (argv[0][2]) { if ((i = str2race(&argv[0][2])) >= 0) flags.initrace = i; } else if (argc > 1) { argc--; argv++; if ((i = str2race(argv[0])) >= 0) flags.initrace = i; } break; case 'w': /* windowtype */ config_error_init(FALSE, "command line", FALSE); choose_windows(&argv[0][2]); config_error_done(); break; case '@': flags.randomall = 1; break; default: if ((i = str2role(&argv[0][1])) >= 0) { flags.initrole = i; break; } /* else raw_printf("Unknown option: %s", *argv); */ } } #ifdef SYSCF if (argc > 1) raw_printf("MAXPLAYERS are set in sysconf file.\n"); #else /* XXX This is deprecated in favor of SYSCF with MAXPLAYERS */ if (argc > 1) locknum = atoi(argv[1]); #endif #ifdef MAX_NR_OF_PLAYERS /* limit to compile-time limit */ if (!locknum || locknum > MAX_NR_OF_PLAYERS) locknum = MAX_NR_OF_PLAYERS; #endif #ifdef SYSCF /* let syscf override compile-time limit */ if (!locknum || (sysopt.maxplayers && locknum > sysopt.maxplayers)) locknum = sysopt.maxplayers; #endif }
619
True
1
CVE-2020-5253
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://github.com/NetHack/NetHack/commits/612755bfb5c412079795c68ba392df5d93874ed8', 'name': 'https://github.com/NetHack/NetHack/commits/612755bfb5c412079795c68ba392df5d93874ed8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-2c7p-3fj4-223m', 'name': 'https://github.com/NetHack/NetHack/security/advisories/GHSA-2c7p-3fj4-223m', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-269'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nethack:nethack:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'NetHack before version 3.6.0 allowed malicious use of escaping of characters in the configuration file (usually .nethackrc) which could be exploited. This bug is patched in NetHack 3.6.0.'}]
2020-03-20T14:48Z
2020-03-10T17:15Z
Improper Privilege Management
The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.
https://cwe.mitre.org/data/definitions/269.html
0
nethack.rankin
2011-08-04 02:41:44+00:00
escapes() revamp Partial rewrite of escapes(), mostly changing its if-then-else logic so that end-of-string can be checked once instead for each case. The previous version had a bug if the input string ended with backslash and one decimal digit (due to being lumped together with the handling for trailing \X or \O).
612755bfb5c412079795c68ba392df5d93874ed8
False
NetHack/NetHack
Official NetHack Git Repository
2015-12-08 02:33:01
2022-08-27 19:19:47
NetHack
2088.0
387.0
escapes
escapes( cp , tp) const
['cp', 'tp']
escapes(cp, tp) const char *cp; char *tp; { while (*cp) { int cval = 0, meta = 0; if (*cp == '\\' && cp[1] && index("mM", cp[1]) && cp[2]) { meta = 1; cp += 2; } if (*cp == '\\' && cp[1] && index("0123456789xXoO", cp[1]) && cp[2]) { NEARDATA const char hex[] = "00112233445566778899aAbBcCdDeEfF"; const char *dp; int dcount = 0; cp++; if (*cp == 'x' || *cp == 'X') for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 2); cp++) cval = (cval * 16) + ((int)(dp - hex) / 2); else if (*cp == 'o' || *cp == 'O') for (++cp; *cp && (index("01234567",*cp)) && (dcount++ < 3); cp++) cval = (cval * 8) + (*cp - '0'); else for (; *cp && (index("0123456789",*cp)) && (dcount++ < 3); cp++) cval = (cval * 10) + (*cp - '0'); } else if (*cp == '\\' && cp[1]) { /* C-style character escapes */ switch (*++cp) { case '\\': cval = '\\'; break; case 'n': cval = '\n'; break; case 't': cval = '\t'; break; case 'b': cval = '\b'; break; case 'r': cval = '\r'; break; default: cval = *cp; } cp++; } else if (*cp == '^' && cp[1]) { /* expand control-character syntax */ cval = (*++cp & 0x1f); cp++; } else cval = *cp++; if (meta) cval |= 0x80; *tp++ = cval; } *tp = '\0'; }
414
True
1
CVE-2019-20172
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/Fire30/CTF-WRITEUPS/tree/master/36c3_ctf/wisdom', 'name': 'https://github.com/Fire30/CTF-WRITEUPS/tree/master/36c3_ctf/wisdom', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/commit/0fc24fe2564736689859e7edfa177a86dac36bf9', 'name': 'https://github.com/SerenityOS/serenity/commit/0fc24fe2564736689859e7edfa177a86dac36bf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019-12-30', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Kernel/VM/MemoryManager.cpp in SerenityOS before 2019-12-30 does not reject syscalls with pointers into the kernel-only virtual address space, which allows local users to gain privileges by overwriting a return address that was found on the kernel stack.'}]
2020-08-24T17:37Z
2019-12-31T03:15Z
Improper Restriction of Operations within the Bounds of a Memory Buffer
The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.
Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data. As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.
https://cwe.mitre.org/data/definitions/119.html
0
Andreas Kling
2019-12-31 00:21:50+01:00
Kernel: User pointer validation should reject kernel-only addresses We were happily allowing syscalls with pointers into kernel-only regions (virtual address >= 0xc0000000). This patch fixes that by only considering user regions in the current process, and also double-checking the Region::is_user_accessible() flag before approving an access. Thanks to Fire30 for finding the bug! :^)
0fc24fe2564736689859e7edfa177a86dac36bf9
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
MemoryManager::validate_user_read
MemoryManager::validate_user_read( const Process & process , VirtualAddress vaddr) const
['process', 'vaddr']
bool MemoryManager::validate_user_read(const Process& process, VirtualAddress vaddr) const { auto* region = region_from_vaddr(process, vaddr); return region && region->is_readable(); }
35
True
1
CVE-2019-20172
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/Fire30/CTF-WRITEUPS/tree/master/36c3_ctf/wisdom', 'name': 'https://github.com/Fire30/CTF-WRITEUPS/tree/master/36c3_ctf/wisdom', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/commit/0fc24fe2564736689859e7edfa177a86dac36bf9', 'name': 'https://github.com/SerenityOS/serenity/commit/0fc24fe2564736689859e7edfa177a86dac36bf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019-12-30', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Kernel/VM/MemoryManager.cpp in SerenityOS before 2019-12-30 does not reject syscalls with pointers into the kernel-only virtual address space, which allows local users to gain privileges by overwriting a return address that was found on the kernel stack.'}]
2020-08-24T17:37Z
2019-12-31T03:15Z
Improper Restriction of Operations within the Bounds of a Memory Buffer
The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.
Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data. As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.
https://cwe.mitre.org/data/definitions/119.html
0
Andreas Kling
2019-12-31 00:21:50+01:00
Kernel: User pointer validation should reject kernel-only addresses We were happily allowing syscalls with pointers into kernel-only regions (virtual address >= 0xc0000000). This patch fixes that by only considering user regions in the current process, and also double-checking the Region::is_user_accessible() flag before approving an access. Thanks to Fire30 for finding the bug! :^)
0fc24fe2564736689859e7edfa177a86dac36bf9
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
MemoryManager::validate_user_write
MemoryManager::validate_user_write( const Process & process , VirtualAddress vaddr) const
['process', 'vaddr']
bool MemoryManager::validate_user_write(const Process& process, VirtualAddress vaddr) const { auto* region = region_from_vaddr(process, vaddr); return region && region->is_writable(); }
35
True
1
CVE-2021-27343
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:N
NETWORK
LOW
NONE
PARTIAL
NONE
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/SerenityOS/serenity/issues/5317', 'name': 'https://github.com/SerenityOS/serenity/issues/5317', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/commit/48fbf6a88d4822a1e5470cf08f29464511bd72c1', 'name': 'https://github.com/SerenityOS/serenity/commit/48fbf6a88d4822a1e5470cf08f29464511bd72c1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/pull/5344', 'name': 'https://github.com/SerenityOS/serenity/pull/5344', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SerenityOS Unspecified is affected by: Buffer Overflow. The impact is: obtain sensitive information (context-dependent). The component is: /Userland/Libraries/LibCrypto/ASN1/DER.h Crypto::der_decode_sequence() function. The attack vector is: Parsing RSA Key ASN.1.'}]
2021-04-09T19:57Z
2021-04-06T13:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
AnotherTest
2021-02-14 14:40:18+03:18
LibCrypto: Don't copy the prime test candidates This was copying a bunch of bigints for no reason.
48fbf6a88d4822a1e5470cf08f29464511bd72c1
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
Crypto::NumberTheory::MR_primality_test
Crypto::NumberTheory::MR_primality_test( UnsignedBigInteger n , const Vector<UnsignedBigInteger,256> & tests)
['n', 'tests']
static bool MR_primality_test(UnsignedBigInteger n, const Vector<UnsignedBigInteger, 256>& tests) { // Written using Wikipedia: // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Miller%E2%80%93Rabin_test ASSERT(!(n < 4)); auto predecessor = n.minus({ 1 }); auto d = predecessor; size_t r = 0; { auto div_result = d.divided_by(2); while (div_result.remainder == 0) { d = div_result.quotient; div_result = d.divided_by(2); ++r; } } if (r == 0) { // n - 1 is odd, so n was even. But there is only one even prime: return n == 2; } for (auto a : tests) { // Technically: ASSERT(2 <= a && a <= n - 2) ASSERT(a < n); auto x = ModularPower(a, d, n); if (x == 1 || x == predecessor) continue; bool skip_this_witness = false; // r − 1 iterations. for (size_t i = 0; i < r - 1; ++i) { x = ModularPower(x, 2, n); if (x == predecessor) { skip_this_witness = true; break; } } if (skip_this_witness) continue; return false; // "composite" } return true; // "probably prime" }
202
True
1
CVE-2021-28874
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/SerenityOS/serenity/commit/c9f25bca048443e317f1994ba9b106f2386688c3', 'name': 'https://github.com/SerenityOS/serenity/commit/c9f25bca048443e317f1994ba9b106f2386688c3', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/pull/5802', 'name': 'https://github.com/SerenityOS/serenity/pull/5802', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/issues/5769', 'name': 'https://github.com/SerenityOS/serenity/issues/5769', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2021-03-15', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SerenityOS fixed as of c9f25bca048443e317f1994ba9b106f2386688c3 contains a buffer overflow vulnerability in LibTextCode through opening a crafted file.'}]
2021-04-09T20:11Z
2021-04-06T13:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Idan Horowitz
2021-03-15 16:26:56+02:00
LibTextCodec: Make UTF16BEDecoder read only up to an even offset Reading up to the end of the input string of odd length results in an out-of-bounds read
c9f25bca048443e317f1994ba9b106f2386688c3
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
TextCodec::UTF16BEDecoder::to_utf8
TextCodec::UTF16BEDecoder::to_utf8( const StringView & input)
['input']
String UTF16BEDecoder::to_utf8(const StringView& input) { StringBuilder builder(input.length() / 2); for (size_t i = 0; i < input.length(); i += 2) { u16 code_point = (input[i] << 8) | input[i + 1]; builder.append_code_point(code_point); } return builder.to_string(); }
78
True
1
CVE-2021-30045
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:P
NETWORK
LOW
NONE
PARTIAL
NONE
PARTIAL
6.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
HIGH
9.1
CRITICAL
3.9
5.2
False
[{'url': 'https://github.com/SerenityOS/serenity/issues/5975', 'name': 'https://github.com/SerenityOS/serenity/issues/5975', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/commit/4317db7498eaa5a37068052bb0310fbc6a5f78e4', 'name': 'https://github.com/SerenityOS/serenity/commit/4317db7498eaa5a37068052bb0310fbc6a5f78e4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/pull/5977', 'name': 'https://github.com/SerenityOS/serenity/pull/5977', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:2021-03-27:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SerenityOS 2021-03-27 contains a buffer overflow vulnerability in the EndOfCentralDirectory::read() function.'}]
2021-04-12T14:10Z
2021-04-06T13:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Idan Horowitz
2021-03-27 17:28:22+03:00
LibArchive: Make bounds checks stricter in the Zip parser We now also check we have enough space in the incoming buffer for the various signatures and optional (length specified) fields. This helps prevents a possible heap overflow read.
4317db7498eaa5a37068052bb0310fbc6a5f78e4
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
Archive::CentralDirectoryRecord::read
Archive::CentralDirectoryRecord::read( ReadonlyBytes buffer)
['buffer']
bool read(ReadonlyBytes buffer) { auto fields_size = sizeof(CentralDirectoryRecord) - (sizeof(u8*) * 3); if (buffer.size() < fields_size) return false; if (memcmp(buffer.data(), central_directory_record_signature, sizeof(central_directory_record_signature)) != 0) return false; memcpy(reinterpret_cast<void*>(&made_by_version), buffer.data() + sizeof(central_directory_record_signature), fields_size); name = buffer.data() + sizeof(central_directory_record_signature) + fields_size; extra_data = name + name_length; comment = extra_data + extra_data_length; return true; }
117
True
1
CVE-2021-30045
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:P
NETWORK
LOW
NONE
PARTIAL
NONE
PARTIAL
6.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
HIGH
9.1
CRITICAL
3.9
5.2
False
[{'url': 'https://github.com/SerenityOS/serenity/issues/5975', 'name': 'https://github.com/SerenityOS/serenity/issues/5975', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/commit/4317db7498eaa5a37068052bb0310fbc6a5f78e4', 'name': 'https://github.com/SerenityOS/serenity/commit/4317db7498eaa5a37068052bb0310fbc6a5f78e4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/pull/5977', 'name': 'https://github.com/SerenityOS/serenity/pull/5977', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:2021-03-27:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SerenityOS 2021-03-27 contains a buffer overflow vulnerability in the EndOfCentralDirectory::read() function.'}]
2021-04-12T14:10Z
2021-04-06T13:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Idan Horowitz
2021-03-27 17:28:22+03:00
LibArchive: Make bounds checks stricter in the Zip parser We now also check we have enough space in the incoming buffer for the various signatures and optional (length specified) fields. This helps prevents a possible heap overflow read.
4317db7498eaa5a37068052bb0310fbc6a5f78e4
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
Archive::EndOfCentralDirectory::read
Archive::EndOfCentralDirectory::read( ReadonlyBytes buffer)
['buffer']
bool read(ReadonlyBytes buffer) { auto fields_size = sizeof(EndOfCentralDirectory) - sizeof(u8*); if (buffer.size() < fields_size) return false; if (memcmp(buffer.data(), end_of_central_directory_signature, sizeof(end_of_central_directory_signature)) != 0) return false; memcpy(reinterpret_cast<void*>(&disk_number), buffer.data() + sizeof(end_of_central_directory_signature), fields_size); comment = buffer.data() + sizeof(end_of_central_directory_signature) + fields_size; return true; }
101
True
1
CVE-2021-30045
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:P
NETWORK
LOW
NONE
PARTIAL
NONE
PARTIAL
6.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
HIGH
9.1
CRITICAL
3.9
5.2
False
[{'url': 'https://github.com/SerenityOS/serenity/issues/5975', 'name': 'https://github.com/SerenityOS/serenity/issues/5975', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/commit/4317db7498eaa5a37068052bb0310fbc6a5f78e4', 'name': 'https://github.com/SerenityOS/serenity/commit/4317db7498eaa5a37068052bb0310fbc6a5f78e4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/SerenityOS/serenity/pull/5977', 'name': 'https://github.com/SerenityOS/serenity/pull/5977', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:serenityos:serenity:2021-03-27:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SerenityOS 2021-03-27 contains a buffer overflow vulnerability in the EndOfCentralDirectory::read() function.'}]
2021-04-12T14:10Z
2021-04-06T13:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Idan Horowitz
2021-03-27 17:28:22+03:00
LibArchive: Make bounds checks stricter in the Zip parser We now also check we have enough space in the incoming buffer for the various signatures and optional (length specified) fields. This helps prevents a possible heap overflow read.
4317db7498eaa5a37068052bb0310fbc6a5f78e4
False
SerenityOS/serenity
The Serenity Operating System 🐞
2018-12-02 19:28:41
2022-08-27 21:33:35
https://serenityos.org
SerenityOS
20846.0
2264.0
Archive::LocalFileHeader::read
Archive::LocalFileHeader::read( ReadonlyBytes buffer)
['buffer']
bool read(ReadonlyBytes buffer) { auto fields_size = sizeof(LocalFileHeader) - (sizeof(u8*) * 3); if (buffer.size() < fields_size) return false; if (memcmp(buffer.data(), local_file_header_signature, sizeof(local_file_header_signature)) != 0) return false; memcpy(reinterpret_cast<void*>(&minimum_version), buffer.data() + sizeof(local_file_header_signature), fields_size); name = buffer.data() + sizeof(local_file_header_signature) + fields_size; extra_data = name + name_length; compressed_data = extra_data + extra_data_length; return true; }
117
True
1
CVE-2019-20376
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:P/A:N
NETWORK
MEDIUM
NONE
NONE
PARTIAL
NONE
4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NETWORK
LOW
NONE
REQUIRED
CHANGED
LOW
LOW
NONE
6.1
MEDIUM
2.8
2.7
False
[{'url': 'https://bitbucket.org/ritt/elog/commits/993bed4923c88593cc6b1186e0d1b9564994a25a', 'name': 'https://bitbucket.org/ritt/elog/commits/993bed4923c88593cc6b1186e0d1b9564994a25a', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-79'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:psi:electronic_logbook:3.1.4:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A cross-site scripting (XSS) vulnerability in Electronic Logbook (ELOG) 3.1.4 allows remote attackers to inject arbitrary web script or HTML via a crafted SVG document to elogd.c.'}]
2020-01-14T16:01Z
2020-01-10T05:15Z
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Cross-site scripting (XSS) vulnerabilities occur when: Untrusted data enters a web application, typically from a web request. The web application dynamically generates a web page that contains this untrusted data. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain. There are three main kinds of XSS: Type 1: Reflected XSS (or Non-Persistent) - The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser. Type 2: Stored XSS (or Persistent) - The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs. Type 0: DOM-Based XSS - In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible. Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as "drive-by hacking." In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.
https://cwe.mitre.org/data/definitions/79.html
0
ritt
2019-12-09 16:48:20+01:00
Serve SVG files as attachments only to avoid XSS vulnerabilities
993bed4923c88593cc6b1186e0d1b9564994a25a
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
ritt
visit repo url
visit repo url
send_file_direct
send_file_direct( char * file_name)
['file_name']
void send_file_direct(char *file_name) { int fh, i, length, delta; char str[MAX_PATH_LENGTH], dir[MAX_PATH_LENGTH], charset[80]; getcwd(dir, sizeof(dir)); fh = open(file_name, O_RDONLY | O_BINARY); if (fh > 0) { lseek(fh, 0, SEEK_END); length = TELL(fh); lseek(fh, 0, SEEK_SET); rsprintf("HTTP/1.1 200 Document follows\r\n"); rsprintf("Server: ELOG HTTP %s-%s\r\n", VERSION, git_revision()); rsprintf("Accept-Ranges: bytes\r\n"); /* set expiration time to one day if no thumbnail */ if (isparam("thumb")) { rsprintf("Pragma: no-cache\r\n"); rsprintf("Cache-control: private, max-age=0, no-cache, no-store\r\n"); } else { rsprintf("Cache-control: public, max-age=86400\r\n"); } if (keep_alive) { rsprintf("Connection: Keep-Alive\r\n"); rsprintf("Keep-Alive: timeout=60, max=10\r\n"); } /* return proper header for file type */ for (i = 0; i < (int) strlen(file_name); i++) str[i] = toupper(file_name[i]); str[i] = 0; for (i = 0; filetype[i].ext[0]; i++) if (chkext(str, filetype[i].ext)) break; if (!getcfg("global", "charset", charset, sizeof(charset))) strcpy(charset, DEFAULT_HTTP_CHARSET); if (filetype[i].ext[0]) { if (strncmp(filetype[i].type, "text", 4) == 0) rsprintf("Content-Type: %s;charset=%s\r\n", filetype[i].type, charset); else rsprintf("Content-Type: %s\r\n", filetype[i].type); } else if (is_ascii(file_name)) rsprintf("Content-Type: text/plain;charset=%s\r\n", charset); else rsprintf("Content-Type: application/octet-stream;charset=%s\r\n", charset); rsprintf("Content-Length: %d\r\n\r\n", length); /* increase return buffer size if file too big */ if (length > return_buffer_size - (int) strlen(return_buffer)) { delta = length - (return_buffer_size - strlen(return_buffer)) + 1000; return_buffer = xrealloc(return_buffer, return_buffer_size + delta); memset(return_buffer + return_buffer_size, 0, delta); return_buffer_size += delta; } return_length = strlen(return_buffer) + length; read(fh, return_buffer + strlen(return_buffer), length); close(fh); } else { char encodedname[256]; show_html_header(NULL, FALSE, "404 Not Found", TRUE, FALSE, NULL, FALSE, 0); rsprintf("<body><h1>Not Found</h1>\r\n"); rsprintf("The requested file <b>"); strencode2(encodedname, file_name, sizeof(encodedname)); if (strchr(file_name, DIR_SEPARATOR)) rsprintf("%s", encodedname); else rsprintf("%s%c%s", dir, DIR_SEPARATOR, encodedname); rsprintf("</b> was not found on this server<p>\r\n"); rsprintf("<hr><address>ELOG version %s</address></body></html>\r\n\r\n", VERSION); return_length = strlen_retbuf; keep_alive = FALSE; } }
521
True
1
CVE-2019-20387
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/openSUSE/libsolv/compare/0.7.5...0.7.6', 'name': 'https://github.com/openSUSE/libsolv/compare/0.7.5...0.7.6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openSUSE/libsolv/commit/fdb9c9c03508990e4583046b590c30d958f272da', 'name': 'https://github.com/openSUSE/libsolv/commit/fdb9c9c03508990e4583046b590c30d958f272da', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00034.html', 'name': '[debian-lts-announce] 20200130 [SECURITY] [DLA 2088-1] libsolv security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opensuse:libsolv:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7.6', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'repodata_schema2id in repodata.c in libsolv before 0.7.6 has a heap-based buffer over-read via a last schema whose length is less than the length of the input schema.'}]
2020-01-30T21:15Z
2020-01-21T23:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Zhipeng Xie
2019-08-06 09:50:57+08:00
repodata_schema2id: fix heap-buffer-overflow in memcmp When the length of last schema in data->schemadata is less than length of input schema, we got a read overflow in asan test. Signed-off-by: Zhipeng Xie <[email protected]>
fdb9c9c03508990e4583046b590c30d958f272da
False
openSUSE/libsolv
Library for solving packages and reading repositories
2011-07-29 10:23:28
2022-08-15 11:33:31
http://en.opensuse.org/openSUSE:Libzypp_satsolver
openSUSE
405.0
137.0
repodata_schema2id
repodata_schema2id( Repodata * data , Id * schema , int create)
['data', 'schema', 'create']
repodata_schema2id(Repodata *data, Id *schema, int create) { int h, len, i; Id *sp, cid; Id *schematahash; if (!*schema) return 0; /* XXX: allow empty schema? */ if ((schematahash = data->schematahash) == 0) { data->schematahash = schematahash = solv_calloc(256, sizeof(Id)); for (i = 1; i < data->nschemata; i++) { for (sp = data->schemadata + data->schemata[i], h = 0; *sp;) h = h * 7 + *sp++; h &= 255; schematahash[h] = i; } data->schemadata = solv_extend_resize(data->schemadata, data->schemadatalen, sizeof(Id), SCHEMATADATA_BLOCK); data->schemata = solv_extend_resize(data->schemata, data->nschemata, sizeof(Id), SCHEMATA_BLOCK); } for (sp = schema, len = 0, h = 0; *sp; len++) h = h * 7 + *sp++; h &= 255; len++; cid = schematahash[h]; if (cid) { if (!memcmp(data->schemadata + data->schemata[cid], schema, len * sizeof(Id))) return cid; /* cache conflict, do a slow search */ for (cid = 1; cid < data->nschemata; cid++) if (!memcmp(data->schemadata + data->schemata[cid], schema, len * sizeof(Id))) return cid; } /* a new one */ if (!create) return 0; data->schemadata = solv_extend(data->schemadata, data->schemadatalen, len, sizeof(Id), SCHEMATADATA_BLOCK); data->schemata = solv_extend(data->schemata, data->nschemata, 1, sizeof(Id), SCHEMATA_BLOCK); /* add schema */ memcpy(data->schemadata + data->schemadatalen, schema, len * sizeof(Id)); data->schemata[data->nschemata] = data->schemadatalen; data->schemadatalen += len; schematahash[h] = data->nschemata; #if 0 fprintf(stderr, "schema2id: new schema\n"); #endif return data->nschemata++; }
416
True
1
CVE-2021-29464
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/Exiv2/exiv2/commit/f9308839198aca5e68a65194f151a1de92398f54', 'name': 'https://github.com/Exiv2/exiv2/commit/f9308839198aca5e68a65194f151a1de92398f54', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Exiv2/exiv2/security/advisories/GHSA-jgm9-5fw5-pw9p', 'name': 'https://github.com/Exiv2/exiv2/security/advisories/GHSA-jgm9-5fw5-pw9p', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/K3HKXR6JOVKMBE4HY4FDXNVZGNCQG6T3/', 'name': 'FEDORA-2021-dde4d7d47e', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NDMZTVQAZSMLPTDVDYLBHAAF7I5QXVYQ/', 'name': 'FEDORA-2021-0b27f220bd', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:exiv2:exiv2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.27.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Exiv2 is a command-line utility and C++ library for reading, writing, deleting, and modifying the metadata of image files. A heap buffer overflow was found in Exiv2 versions v0.27.3 and earlier. The heap overflow is triggered when Exiv2 is used to write metadata into a crafted image file. An attacker could potentially exploit the vulnerability to gain code execution, if they can trick the victim into running Exiv2 on a crafted image file. Note that this bug is only triggered when writing the metadata, which is a less frequently used Exiv2 operation than reading the metadata. For example, to trigger the bug in the Exiv2 command-line application, you need to add an extra command-line argument such as `insert`. The bug is fixed in version v0.27.4.'}]
2022-04-05T18:02Z
2021-04-30T19:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Kevin Backhouse
2021-04-20 12:04:13+01:00
Better bounds checking in Jp2Image::encodeJp2Header()
f9308839198aca5e68a65194f151a1de92398f54
False
Exiv2/exiv2
Image metadata library and tools
2017-04-27 17:25:13
2022-08-27 20:28:30
http://www.exiv2.org/
Exiv2
646.0
241.0
Exiv2::Jp2Image::encodeJp2Header
Exiv2::Jp2Image::encodeJp2Header( const DataBuf & boxBuf , DataBuf & outBuf)
['boxBuf', 'outBuf']
void Jp2Image::encodeJp2Header(const DataBuf& boxBuf,DataBuf& outBuf) { DataBuf output(boxBuf.size_ + iccProfile_.size_ + 100); // allocate sufficient space int outlen = sizeof(Jp2BoxHeader) ; // now many bytes have we written to output? int inlen = sizeof(Jp2BoxHeader) ; // how many bytes have we read from boxBuf? Jp2BoxHeader* pBox = (Jp2BoxHeader*) boxBuf.pData_; int32_t length = getLong((byte*)&pBox->length, bigEndian); int32_t count = sizeof (Jp2BoxHeader); char* p = (char*) boxBuf.pData_; bool bWroteColor = false ; while ( count < length || !bWroteColor ) { Jp2BoxHeader* pSubBox = (Jp2BoxHeader*) (p+count) ; // copy data. pointer could be into a memory mapped file which we will decode! Jp2BoxHeader subBox ; memcpy(&subBox,pSubBox,sizeof(subBox)); Jp2BoxHeader newBox = subBox; if ( count < length ) { subBox.length = getLong((byte*)&subBox.length, bigEndian); subBox.type = getLong((byte*)&subBox.type , bigEndian); #ifdef EXIV2_DEBUG_MESSAGES std::cout << "Jp2Image::encodeJp2Header subbox: "<< toAscii(subBox.type) << " length = " << subBox.length << std::endl; #endif count += subBox.length; newBox.type = subBox.type; } else { subBox.length=0; newBox.type = kJp2BoxTypeColorHeader; count = length; } int32_t newlen = subBox.length; if ( newBox.type == kJp2BoxTypeColorHeader ) { bWroteColor = true ; if ( ! iccProfileDefined() ) { const char* pad = "\x01\x00\x00\x00\x00\x00\x10\x00\x00\x05\x1cuuid"; uint32_t psize = 15; newlen = sizeof(newBox) + psize ; ul2Data((byte*)&newBox.length,psize ,bigEndian); ul2Data((byte*)&newBox.type ,newBox.type,bigEndian); ::memcpy(output.pData_+outlen ,&newBox ,sizeof(newBox)); ::memcpy(output.pData_+outlen+sizeof(newBox) ,pad ,psize ); } else { const char* pad = "\x02\x00\x00"; uint32_t psize = 3; newlen = sizeof(newBox) + psize + iccProfile_.size_; ul2Data((byte*)&newBox.length,newlen,bigEndian); ul2Data((byte*)&newBox.type,newBox.type,bigEndian); ::memcpy(output.pData_+outlen ,&newBox ,sizeof(newBox) ); ::memcpy(output.pData_+outlen+sizeof(newBox) , pad ,psize ); ::memcpy(output.pData_+outlen+sizeof(newBox)+psize,iccProfile_.pData_,iccProfile_.size_); } } else { ::memcpy(output.pData_+outlen,boxBuf.pData_+inlen,subBox.length); } outlen += newlen; inlen += subBox.length; } // allocate the correct number of bytes, copy the data and update the box header outBuf.alloc(outlen); ::memcpy(outBuf.pData_,output.pData_,outlen); pBox = (Jp2BoxHeader*) outBuf.pData_; ul2Data((byte*)&pBox->type,kJp2BoxTypeJp2Header,bigEndian); ul2Data((byte*)&pBox->length,outlen,bigEndian); } // Jp2Image::encodeJp2Header
592
True
1
CVE-2021-29463
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/Exiv2/exiv2/commit/783b3a6ff15ed6f82a8f8e6c8a6f3b84a9b04d4b', 'name': 'https://github.com/Exiv2/exiv2/commit/783b3a6ff15ed6f82a8f8e6c8a6f3b84a9b04d4b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Exiv2/exiv2/security/advisories/GHSA-5p8g-9xf3-gfrr', 'name': 'https://github.com/Exiv2/exiv2/security/advisories/GHSA-5p8g-9xf3-gfrr', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/K3HKXR6JOVKMBE4HY4FDXNVZGNCQG6T3/', 'name': 'FEDORA-2021-dde4d7d47e', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NDMZTVQAZSMLPTDVDYLBHAAF7I5QXVYQ/', 'name': 'FEDORA-2021-0b27f220bd', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:exiv2:exiv2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.27.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Exiv2 is a command-line utility and C++ library for reading, writing, deleting, and modifying the metadata of image files. An out-of-bounds read was found in Exiv2 versions v0.27.3 and earlier. The out-of-bounds read is triggered when Exiv2 is used to write metadata into a crafted image file. An attacker could potentially exploit the vulnerability to cause a denial of service by crashing Exiv2, if they can trick the victim into running Exiv2 on a crafted image file. Note that this bug is only triggered when writing the metadata, which is a less frequently used Exiv2 operation than reading the metadata. For example, to trigger the bug in the Exiv2 command-line application, you need to add an extra command-line argument such as `insert`. The bug is fixed in version v0.27.4.'}]
2022-04-05T18:02Z
2021-04-30T19:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Kevin Backhouse
2021-04-19 18:06:00+01:00
Improve bound checking in WebPImage::doWriteMetadata()
783b3a6ff15ed6f82a8f8e6c8a6f3b84a9b04d4b
False
Exiv2/exiv2
Image metadata library and tools
2017-04-27 17:25:13
2022-08-27 20:28:30
http://www.exiv2.org/
Exiv2
646.0
241.0
Exiv2::WebPImage::doWriteMetadata
Exiv2::WebPImage::doWriteMetadata( BasicIo & outIo)
['outIo']
void WebPImage::doWriteMetadata(BasicIo& outIo) { if (!io_->isopen()) throw Error(kerInputDataReadFailed); if (!outIo.isopen()) throw Error(kerImageWriteFailed); #ifdef EXIV2_DEBUG_MESSAGES std::cout << "Writing metadata" << std::endl; #endif byte data [WEBP_TAG_SIZE*3]; DataBuf chunkId(WEBP_TAG_SIZE+1); chunkId.pData_ [WEBP_TAG_SIZE] = '\0'; io_->read(data, WEBP_TAG_SIZE * 3); uint64_t filesize = Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian); /* Set up header */ if (outIo.write(data, WEBP_TAG_SIZE * 3) != WEBP_TAG_SIZE * 3) throw Error(kerImageWriteFailed); /* Parse Chunks */ bool has_size = false; bool has_xmp = false; bool has_exif = false; bool has_vp8x = false; bool has_alpha = false; bool has_icc = iccProfileDefined(); int width = 0; int height = 0; byte size_buff[WEBP_TAG_SIZE]; Blob blob; if (exifData_.count() > 0) { ExifParser::encode(blob, littleEndian, exifData_); if (blob.size() > 0) { has_exif = true; } } if (xmpData_.count() > 0 && !writeXmpFromPacket()) { XmpParser::encode(xmpPacket_, xmpData_, XmpParser::useCompactFormat | XmpParser::omitAllFormatting); } has_xmp = xmpPacket_.size() > 0; std::string xmp(xmpPacket_); /* Verify for a VP8X Chunk First before writing in case we have any exif or xmp data, also check for any chunks with alpha frame/layer set */ while ( !io_->eof() && (uint64_t) io_->tell() < filesize) { io_->read(chunkId.pData_, WEBP_TAG_SIZE); io_->read(size_buff, WEBP_TAG_SIZE); long size = Exiv2::getULong(size_buff, littleEndian); DataBuf payload(size); io_->read(payload.pData_, payload.size_); byte c; if ( payload.size_ % 2 ) io_->read(&c,1); /* Chunk with information about features used in the file. */ if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_vp8x) { has_vp8x = true; } if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X) && !has_size) { has_size = true; byte size_buf[WEBP_TAG_SIZE]; // Fetch width - stored in 24bits memcpy(&size_buf, &payload.pData_[4], 3); size_buf[3] = 0; width = Exiv2::getULong(size_buf, littleEndian) + 1; // Fetch height - stored in 24bits memcpy(&size_buf, &payload.pData_[7], 3); size_buf[3] = 0; height = Exiv2::getULong(size_buf, littleEndian) + 1; } /* Chunk with with animation control data. */ #ifdef __CHECK_FOR_ALPHA__ // Maybe in the future if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANIM) && !has_alpha) { has_alpha = true; } #endif /* Chunk with with lossy image data. */ #ifdef __CHECK_FOR_ALPHA__ // Maybe in the future if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_alpha) { has_alpha = true; } #endif if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8) && !has_size) { has_size = true; byte size_buf[2]; /* Refer to this https://tools.ietf.org/html/rfc6386 for height and width reference for VP8 chunks */ // Fetch width - stored in 16bits memcpy(&size_buf, &payload.pData_[6], 2); width = Exiv2::getUShort(size_buf, littleEndian) & 0x3fff; // Fetch height - stored in 16bits memcpy(&size_buf, &payload.pData_[8], 2); height = Exiv2::getUShort(size_buf, littleEndian) & 0x3fff; } /* Chunk with with lossless image data. */ if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_alpha) { if ((payload.pData_[4] & WEBP_VP8X_ALPHA_BIT) == WEBP_VP8X_ALPHA_BIT) { has_alpha = true; } } if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8L) && !has_size) { has_size = true; byte size_buf_w[2]; byte size_buf_h[3]; /* For VP8L chunks width & height are stored in 28 bits of a 32 bit field requires bitshifting to get actual sizes. Width and height are split even into 14 bits each. Refer to this https://goo.gl/bpgMJf */ // Fetch width - 14 bits wide memcpy(&size_buf_w, &payload.pData_[1], 2); size_buf_w[1] &= 0x3F; width = Exiv2::getUShort(size_buf_w, littleEndian) + 1; // Fetch height - 14 bits wide memcpy(&size_buf_h, &payload.pData_[2], 3); size_buf_h[0] = ((size_buf_h[0] >> 6) & 0x3) | ((size_buf_h[1] & 0x3F) << 0x2); size_buf_h[1] = ((size_buf_h[1] >> 6) & 0x3) | ((size_buf_h[2] & 0xF) << 0x2); height = Exiv2::getUShort(size_buf_h, littleEndian) + 1; } /* Chunk with animation frame. */ if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_alpha) { if ((payload.pData_[5] & 0x2) == 0x2) { has_alpha = true; } } if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ANMF) && !has_size) { has_size = true; byte size_buf[WEBP_TAG_SIZE]; // Fetch width - stored in 24bits memcpy(&size_buf, &payload.pData_[6], 3); size_buf[3] = 0; width = Exiv2::getULong(size_buf, littleEndian) + 1; // Fetch height - stored in 24bits memcpy(&size_buf, &payload.pData_[9], 3); size_buf[3] = 0; height = Exiv2::getULong(size_buf, littleEndian) + 1; } /* Chunk with alpha data. */ if (equalsWebPTag(chunkId, "ALPH") && !has_alpha) { has_alpha = true; } } /* Inject a VP8X chunk if one isn't available. */ if (!has_vp8x) { inject_VP8X(outIo, has_xmp, has_exif, has_alpha, has_icc, width, height); } io_->seek(12, BasicIo::beg); while ( !io_->eof() && (uint64_t) io_->tell() < filesize) { io_->read(chunkId.pData_, 4); io_->read(size_buff, 4); long size = Exiv2::getULong(size_buff, littleEndian); DataBuf payload(size); io_->read(payload.pData_, size); if ( io_->tell() % 2 ) io_->seek(+1,BasicIo::cur); // skip pad if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_VP8X)) { if (has_icc){ payload.pData_[0] |= WEBP_VP8X_ICC_BIT; } else { payload.pData_[0] &= ~WEBP_VP8X_ICC_BIT; } if (has_xmp){ payload.pData_[0] |= WEBP_VP8X_XMP_BIT; } else { payload.pData_[0] &= ~WEBP_VP8X_XMP_BIT; } if (has_exif) { payload.pData_[0] |= WEBP_VP8X_EXIF_BIT; } else { payload.pData_[0] &= ~WEBP_VP8X_EXIF_BIT; } if (outIo.write(chunkId.pData_, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write(size_buff, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write(payload.pData_, payload.size_) != payload.size_) throw Error(kerImageWriteFailed); if (outIo.tell() % 2) { if (outIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(kerImageWriteFailed); } if (has_icc) { if (outIo.write((const byte*)WEBP_CHUNK_HEADER_ICCP, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); ul2Data(data, (uint32_t) iccProfile_.size_, littleEndian); if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write(iccProfile_.pData_, iccProfile_.size_) != iccProfile_.size_) { throw Error(kerImageWriteFailed); } has_icc = false; } } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) { // Skip it altogether handle it prior to here :) } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) { // Skip and add new data afterwards } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP)) { // Skip and add new data afterwards } else { if (outIo.write(chunkId.pData_, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write(size_buff, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write(payload.pData_, payload.size_) != payload.size_) throw Error(kerImageWriteFailed); } // Encoder required to pad odd sized data with a null byte if (outIo.tell() % 2) { if (outIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(kerImageWriteFailed); } } if (has_exif) { if (outIo.write((const byte*)WEBP_CHUNK_HEADER_EXIF, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); us2Data(data, (uint16_t) blob.size()+8, bigEndian); ul2Data(data, (uint32_t) blob.size(), littleEndian); if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write((const byte*)&blob[0], static_cast<long>(blob.size())) != (long)blob.size()) { throw Error(kerImageWriteFailed); } if (outIo.tell() % 2) { if (outIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(kerImageWriteFailed); } } if (has_xmp) { if (outIo.write((const byte*)WEBP_CHUNK_HEADER_XMP, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); ul2Data(data, (uint32_t) xmpPacket().size(), littleEndian); if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); if (outIo.write((const byte*)xmp.data(), static_cast<long>(xmp.size())) != (long)xmp.size()) { throw Error(kerImageWriteFailed); } if (outIo.tell() % 2) { if (outIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(kerImageWriteFailed); } } // Fix File Size Payload Data outIo.seek(0, BasicIo::beg); filesize = outIo.size() - 8; outIo.seek(4, BasicIo::beg); ul2Data(data, (uint32_t) filesize, littleEndian); if (outIo.write(data, WEBP_TAG_SIZE) != WEBP_TAG_SIZE) throw Error(kerImageWriteFailed); } // WebPImage::writeMetadata
1856
True
1
CVE-2019-20791
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19386', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19386', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/openthread/openthread/commit/b8c3161281f8e15873f8decabd8eac461717aefe', 'name': 'https://github.com/openthread/openthread/commit/b8c3161281f8e15873f8decabd8eac461717aefe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openthread/openthread/commit/c3a3a0c424322009fec3ab735fb20ce8f6e19e70', 'name': 'https://github.com/openthread/openthread/commit/c3a3a0c424322009fec3ab735fb20ce8f6e19e70', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:google:openthread:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019-12-13', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'OpenThread before 2019-12-13 has a stack-based buffer overflow in MeshCoP::Commissioner::GeneratePskc.'}]
2020-05-01T20:22Z
2020-04-28T18:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Jonathan Hui
2019-12-12 11:25:53-08:00
[commissioner] add network name length check in GeneratePskc() (#4404)
b8c3161281f8e15873f8decabd8eac461717aefe
False
openthread/openthread
OpenThread released by Google is an open-source implementation of the Thread networking protocol
2016-04-08 20:47:41
2022-08-27 01:29:58
https://openthread.io
openthread
2886.0
935.0
ot::MeshCoP::Commissioner::GeneratePskc
ot::MeshCoP::Commissioner::GeneratePskc( const char * aPassPhrase , const char * aNetworkName , const Mac :: ExtendedPanId & aExtPanId , Pskc & aPskc)
['aPassPhrase', 'aNetworkName', 'aExtPanId', 'aPskc']
otError Commissioner::GeneratePskc(const char * aPassPhrase, const char * aNetworkName, const Mac::ExtendedPanId &aExtPanId, Pskc & aPskc) { otError error = OT_ERROR_NONE; const char *saltPrefix = "Thread"; uint8_t salt[OT_PBKDF2_SALT_MAX_LEN]; uint16_t saltLen = 0; VerifyOrExit((strlen(aPassPhrase) >= OT_COMMISSIONING_PASSPHRASE_MIN_SIZE) && (strlen(aPassPhrase) <= OT_COMMISSIONING_PASSPHRASE_MAX_SIZE), error = OT_ERROR_INVALID_ARGS); memset(salt, 0, sizeof(salt)); memcpy(salt, saltPrefix, strlen(saltPrefix)); saltLen += static_cast<uint16_t>(strlen(saltPrefix)); memcpy(salt + saltLen, aExtPanId.m8, sizeof(aExtPanId)); saltLen += OT_EXT_PAN_ID_SIZE; memcpy(salt + saltLen, aNetworkName, strlen(aNetworkName)); saltLen += static_cast<uint16_t>(strlen(aNetworkName)); otPbkdf2Cmac(reinterpret_cast<const uint8_t *>(aPassPhrase), static_cast<uint16_t>(strlen(aPassPhrase)), reinterpret_cast<const uint8_t *>(salt), saltLen, 16384, OT_PSKC_MAX_SIZE, aPskc.m8); exit: return error; }
208
True
1
CVE-2019-20791
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19386', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19386', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/openthread/openthread/commit/b8c3161281f8e15873f8decabd8eac461717aefe', 'name': 'https://github.com/openthread/openthread/commit/b8c3161281f8e15873f8decabd8eac461717aefe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openthread/openthread/commit/c3a3a0c424322009fec3ab735fb20ce8f6e19e70', 'name': 'https://github.com/openthread/openthread/commit/c3a3a0c424322009fec3ab735fb20ce8f6e19e70', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:google:openthread:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019-12-13', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'OpenThread before 2019-12-13 has a stack-based buffer overflow in MeshCoP::Commissioner::GeneratePskc.'}]
2020-05-01T20:22Z
2020-04-28T18:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Jonathan Hui
2019-12-13 14:01:30-08:00
[commissioner] use strnlen instead of strlen (#4404)
c3a3a0c424322009fec3ab735fb20ce8f6e19e70
False
openthread/openthread
OpenThread released by Google is an open-source implementation of the Thread networking protocol
2016-04-08 20:47:41
2022-08-27 01:29:58
https://openthread.io
openthread
2886.0
935.0
ot::MeshCoP::Commissioner::AddJoiner
ot::MeshCoP::Commissioner::AddJoiner( const Mac :: ExtAddress * aEui64 , const char * aPskd , uint32_t aTimeout)
['aEui64', 'aPskd', 'aTimeout']
otError Commissioner::AddJoiner(const Mac::ExtAddress *aEui64, const char *aPskd, uint32_t aTimeout) { otError error = OT_ERROR_NO_BUFS; VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, error = OT_ERROR_INVALID_STATE); VerifyOrExit(strlen(aPskd) <= Dtls::kPskMaxLength, error = OT_ERROR_INVALID_ARGS); RemoveJoiner(aEui64, 0); // remove immediately for (Joiner *joiner = &mJoiners[0]; joiner < OT_ARRAY_END(mJoiners); joiner++) { if (joiner->mValid) { continue; } if (aEui64 != NULL) { joiner->mEui64 = *aEui64; joiner->mAny = false; } else { joiner->mAny = true; } (void)strlcpy(joiner->mPsk, aPskd, sizeof(joiner->mPsk)); joiner->mValid = true; joiner->mExpirationTime = TimerMilli::GetNow() + Time::SecToMsec(aTimeout); UpdateJoinerExpirationTimer(); SendCommissionerSet(); otLogInfoMeshCoP("Added Joiner (%s, %s)", (aEui64 != NULL) ? aEui64->ToString().AsCString() : "*", aPskd); ExitNow(error = OT_ERROR_NONE); } exit: return error; }
211
True
1
CVE-2019-20791
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19386', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19386', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/openthread/openthread/commit/b8c3161281f8e15873f8decabd8eac461717aefe', 'name': 'https://github.com/openthread/openthread/commit/b8c3161281f8e15873f8decabd8eac461717aefe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openthread/openthread/commit/c3a3a0c424322009fec3ab735fb20ce8f6e19e70', 'name': 'https://github.com/openthread/openthread/commit/c3a3a0c424322009fec3ab735fb20ce8f6e19e70', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:google:openthread:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019-12-13', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'OpenThread before 2019-12-13 has a stack-based buffer overflow in MeshCoP::Commissioner::GeneratePskc.'}]
2020-05-01T20:22Z
2020-04-28T18:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Jonathan Hui
2019-12-13 14:01:30-08:00
[commissioner] use strnlen instead of strlen (#4404)
c3a3a0c424322009fec3ab735fb20ce8f6e19e70
False
openthread/openthread
OpenThread released by Google is an open-source implementation of the Thread networking protocol
2016-04-08 20:47:41
2022-08-27 01:29:58
https://openthread.io
openthread
2886.0
935.0
ot::MeshCoP::Commissioner::GeneratePskc
ot::MeshCoP::Commissioner::GeneratePskc( const char * aPassPhrase , const char * aNetworkName , const Mac :: ExtendedPanId & aExtPanId , Pskc & aPskc)
['aPassPhrase', 'aNetworkName', 'aExtPanId', 'aPskc']
otError Commissioner::GeneratePskc(const char * aPassPhrase, const char * aNetworkName, const Mac::ExtendedPanId &aExtPanId, Pskc & aPskc) { otError error = OT_ERROR_NONE; const char *saltPrefix = "Thread"; uint8_t salt[OT_PBKDF2_SALT_MAX_LEN]; uint16_t saltLen = 0; VerifyOrExit((strlen(aPassPhrase) >= OT_COMMISSIONING_PASSPHRASE_MIN_SIZE) && (strlen(aPassPhrase) <= OT_COMMISSIONING_PASSPHRASE_MAX_SIZE) && (strlen(aNetworkName) <= OT_NETWORK_NAME_MAX_SIZE), error = OT_ERROR_INVALID_ARGS); memset(salt, 0, sizeof(salt)); memcpy(salt, saltPrefix, strlen(saltPrefix)); saltLen += static_cast<uint16_t>(strlen(saltPrefix)); memcpy(salt + saltLen, aExtPanId.m8, sizeof(aExtPanId)); saltLen += OT_EXT_PAN_ID_SIZE; memcpy(salt + saltLen, aNetworkName, strlen(aNetworkName)); saltLen += static_cast<uint16_t>(strlen(aNetworkName)); otPbkdf2Cmac(reinterpret_cast<const uint8_t *>(aPassPhrase), static_cast<uint16_t>(strlen(aPassPhrase)), reinterpret_cast<const uint8_t *>(salt), saltLen, 16384, OT_PSKC_MAX_SIZE, aPskc.m8); exit: return error; }
217
True
1
CVE-2019-20805
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'name': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/317', 'name': 'https://github.com/upx/upx/issues/317', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'p_lx_elf.cpp in UPX before 3.96 has an integer overflow during unpacking via crafted values in a PT_DYNAMIC segment.'}]
2020-06-02T17:03Z
2020-06-01T14:15Z
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
https://cwe.mitre.org/data/definitions/190.html
0
John Reiser
2019-11-23 20:06:14-08:00
Avoid bogus values in PT_DYNAMIC segment. Detect duplicate DT_*. Detect out-of-bounds hashtab and gashtab. Detect missing DT_REL, DT_RELA. Detect out-of-bounds d_val. https://github.com/upx/upx/issues/317 modified: p_lx_elf.cpp
8be9da8280dfa69d5df4417d4d81bda1cab78010
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf32::calls_crt1
PackLinuxElf32::calls_crt1( Elf32_Rel const * rel , int sz)
['rel', 'sz']
bool PackLinuxElf32::calls_crt1(Elf32_Rel const *rel, int sz) { if (!dynsym || !dynstr) { return false; } for (unsigned relnum= 0; 0 < sz; (sz -= sizeof(Elf32_Rel)), ++rel, ++relnum) { unsigned const symnum = get_te32(&rel->r_info) >> 8; char const *const symnam = get_dynsym_name(symnum, relnum); if (0==strcmp(symnam, "__libc_start_main") // glibc || 0==strcmp(symnam, "__libc_init") // Android || 0==strcmp(symnam, "__uClibc_main") || 0==strcmp(symnam, "__uClibc_start_main")) return true; } return false; }
127
True
1
CVE-2019-20805
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'name': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/317', 'name': 'https://github.com/upx/upx/issues/317', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'p_lx_elf.cpp in UPX before 3.96 has an integer overflow during unpacking via crafted values in a PT_DYNAMIC segment.'}]
2020-06-02T17:03Z
2020-06-01T14:15Z
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
https://cwe.mitre.org/data/definitions/190.html
0
John Reiser
2019-11-23 20:06:14-08:00
Avoid bogus values in PT_DYNAMIC segment. Detect duplicate DT_*. Detect out-of-bounds hashtab and gashtab. Detect missing DT_REL, DT_RELA. Detect out-of-bounds d_val. https://github.com/upx/upx/issues/317 modified: p_lx_elf.cpp
8be9da8280dfa69d5df4417d4d81bda1cab78010
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf32::elf_find_dynamic
PackLinuxElf32::elf_find_dynamic( unsigned int key) const
['key']
PackLinuxElf32::elf_find_dynamic(unsigned int key) const { Elf32_Dyn const *dynp= dynseg; if (dynp) for (; (unsigned)((char const *)dynp - (char const *)dynseg) < sz_dynseg && Elf32_Dyn::DT_NULL!=dynp->d_tag; ++dynp) if (get_te32(&dynp->d_tag)==key) { unsigned const t= elf_get_offset_from_address(get_te32(&dynp->d_val)); if (t) { return t + file_image; } break; } return 0; }
102
True
1
CVE-2019-20805
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'name': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/317', 'name': 'https://github.com/upx/upx/issues/317', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'p_lx_elf.cpp in UPX before 3.96 has an integer overflow during unpacking via crafted values in a PT_DYNAMIC segment.'}]
2020-06-02T17:03Z
2020-06-01T14:15Z
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
https://cwe.mitre.org/data/definitions/190.html
0
John Reiser
2019-11-23 20:06:14-08:00
Avoid bogus values in PT_DYNAMIC segment. Detect duplicate DT_*. Detect out-of-bounds hashtab and gashtab. Detect missing DT_REL, DT_RELA. Detect out-of-bounds d_val. https://github.com/upx/upx/issues/317 modified: p_lx_elf.cpp
8be9da8280dfa69d5df4417d4d81bda1cab78010
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf32::invert_pt_dynamic
PackLinuxElf32::invert_pt_dynamic( Elf32_Dyn const * dynp)
['dynp']
PackLinuxElf32::invert_pt_dynamic(Elf32_Dyn const *dynp) { if (dt_table[Elf32_Dyn::DT_NULL]) { return; // not 1st time; do not change upx_dt_init } Elf32_Dyn const *const dynp0 = dynp; unsigned ndx = 1+ 0; if (dynp) for (; ; ++ndx, ++dynp) { unsigned const d_tag = get_te32(&dynp->d_tag); if (d_tag < DT_NUM) { dt_table[d_tag] = ndx; } if (Elf32_Dyn::DT_NULL == d_tag) { break; // check here so that dt_table[DT_NULL] is set } } upx_dt_init = 0; if (dt_table[Elf32_Dyn::DT_INIT]) upx_dt_init = Elf32_Dyn::DT_INIT; else if (dt_table[Elf32_Dyn::DT_PREINIT_ARRAY]) upx_dt_init = Elf32_Dyn::DT_PREINIT_ARRAY; else if (dt_table[Elf32_Dyn::DT_INIT_ARRAY]) upx_dt_init = Elf32_Dyn::DT_INIT_ARRAY; unsigned const z_str = dt_table[Elf32_Dyn::DT_STRSZ]; if (z_str) { strtab_end = get_te32(&dynp0[-1+ z_str].d_val); if ((u32_t)file_size <= strtab_end) { // FIXME: weak char msg[50]; snprintf(msg, sizeof(msg), "bad DT_STRSZ %#x", strtab_end); throwCantPack(msg); } } unsigned const x_sym = dt_table[Elf32_Dyn::DT_SYMTAB]; unsigned const x_str = dt_table[Elf32_Dyn::DT_STRTAB]; if (x_sym && x_str) { upx_uint32_t const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); upx_uint32_t const v_str = get_te32(&dynp0[-1+ x_str].d_val); unsigned const z_sym = dt_table[Elf32_Dyn::DT_SYMENT]; unsigned const sz_sym = !z_sym ? sizeof(Elf32_Sym) : get_te32(&dynp0[-1+ z_sym].d_val); if (v_sym < v_str) { symnum_end = (v_str - v_sym) / sz_sym; } } // DT_HASH often ends at DT_SYMTAB unsigned const v_hsh = elf_unsigned_dynamic(Elf64_Dyn::DT_HASH); if (v_hsh && file_image) { hashtab = (unsigned const *)elf_find_dynamic(Elf64_Dyn::DT_HASH); unsigned const nbucket = get_te32(&hashtab[0]); unsigned const *const buckets = &hashtab[2]; unsigned const *const chains = &buckets[nbucket]; (void)chains; unsigned const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); if (!nbucket || (nbucket>>31) || (file_size/sizeof(unsigned)) <= (2*nbucket) // FIXME: weak || ((v_hsh < v_sym) && (v_sym - v_hsh) < (sizeof(unsigned)*2 // headers + sizeof(*buckets)*nbucket // buckets + sizeof(*chains) *nbucket // chains )) ) { char msg[90]; snprintf(msg, sizeof(msg), "bad DT_HASH nbucket=%#x len=%#x", nbucket, (v_sym - v_hsh)); throwCantPack(msg); } } // DT_GNU_HASH often ends at DT_SYMTAB; FIXME: not for Android? unsigned const v_gsh = elf_unsigned_dynamic(Elf32_Dyn::DT_GNU_HASH); if (v_gsh && file_image) { gashtab = (unsigned const *)elf_find_dynamic(Elf32_Dyn::DT_GNU_HASH); unsigned const n_bucket = get_te32(&gashtab[0]); unsigned const n_bitmask = get_te32(&gashtab[2]); unsigned const gnu_shift = get_te32(&gashtab[3]); unsigned const *const bitmask = (unsigned const *)(void const *)&gashtab[4]; unsigned const *const buckets = (unsigned const *)&bitmask[n_bitmask]; unsigned const *const hasharr = &buckets[n_bucket]; (void)hasharr; //unsigned const *const gashend = &hasharr[n_bucket]; // minimum unsigned const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); if (!n_bucket || !n_bitmask || (-1+ n_bitmask) & n_bitmask // not a power of 2 || 8*sizeof(unsigned) <= gnu_shift // shifted result always == 0 || (n_bucket>>30) // fie on fuzzers || (n_bitmask>>30) || (file_size / sizeof(unsigned)) <= (n_bitmask + 2*n_bucket) // FIXME: weak // FIXME: next test does work for Android? || ((v_gsh < v_sym) && (v_sym - v_gsh) < (sizeof(unsigned)*4 // headers + sizeof(*bitmask)*n_bitmask // bitmask + sizeof(*buckets)*n_bucket // buckets + sizeof(*hasharr)*n_bucket // hasharr )) ) { char msg[90]; snprintf(msg, sizeof(msg), "bad DT_GNU_HASH n_bucket=%#x n_bitmask=%#x len=%#x", n_bucket, n_bitmask, v_sym - v_gsh); throwCantPack(msg); } } unsigned const e_shstrndx = get_te16(&ehdri.e_shstrndx); if (e_shnum <= e_shstrndx && !(0==e_shnum && 0==e_shstrndx) ) { char msg[40]; snprintf(msg, sizeof(msg), "bad .e_shstrndx %d >= .e_shnum %d", e_shstrndx, e_shnum); throwCantPack(msg); } }
868
True
1
CVE-2019-20805
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'name': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/317', 'name': 'https://github.com/upx/upx/issues/317', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'p_lx_elf.cpp in UPX before 3.96 has an integer overflow during unpacking via crafted values in a PT_DYNAMIC segment.'}]
2020-06-02T17:03Z
2020-06-01T14:15Z
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
https://cwe.mitre.org/data/definitions/190.html
0
John Reiser
2019-11-23 20:06:14-08:00
Avoid bogus values in PT_DYNAMIC segment. Detect duplicate DT_*. Detect out-of-bounds hashtab and gashtab. Detect missing DT_REL, DT_RELA. Detect out-of-bounds d_val. https://github.com/upx/upx/issues/317 modified: p_lx_elf.cpp
8be9da8280dfa69d5df4417d4d81bda1cab78010
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf64::calls_crt1
PackLinuxElf64::calls_crt1( Elf64_Rela const * rela , int sz)
['rela', 'sz']
bool PackLinuxElf64::calls_crt1(Elf64_Rela const *rela, int sz) { if (!dynsym || !dynstr) { return false; } for (unsigned relnum= 0; 0 < sz; (sz -= sizeof(Elf64_Rela)), ++rela, ++relnum) { unsigned const symnum = get_te64(&rela->r_info) >> 32; char const *const symnam = get_dynsym_name(symnum, relnum); if (0==strcmp(symnam, "__libc_start_main") // glibc || 0==strcmp(symnam, "__libc_init") // Android || 0==strcmp(symnam, "__uClibc_main") || 0==strcmp(symnam, "__uClibc_start_main")) return true; } return false; }
127
True
1
CVE-2019-20805
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'name': 'https://github.com/upx/upx/commit/8be9da8280dfa69d5df4417d4d81bda1cab78010', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/317', 'name': 'https://github.com/upx/upx/issues/317', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'p_lx_elf.cpp in UPX before 3.96 has an integer overflow during unpacking via crafted values in a PT_DYNAMIC segment.'}]
2020-06-02T17:03Z
2020-06-01T14:15Z
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
https://cwe.mitre.org/data/definitions/190.html
0
John Reiser
2019-11-23 20:06:14-08:00
Avoid bogus values in PT_DYNAMIC segment. Detect duplicate DT_*. Detect out-of-bounds hashtab and gashtab. Detect missing DT_REL, DT_RELA. Detect out-of-bounds d_val. https://github.com/upx/upx/issues/317 modified: p_lx_elf.cpp
8be9da8280dfa69d5df4417d4d81bda1cab78010
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf64::elf_find_dynamic
PackLinuxElf64::elf_find_dynamic( unsigned int key) const
['key']
PackLinuxElf64::elf_find_dynamic(unsigned int key) const { Elf64_Dyn const *dynp= dynseg; if (dynp) for (; (unsigned)((char const *)dynp - (char const *)dynseg) < sz_dynseg && Elf64_Dyn::DT_NULL!=dynp->d_tag; ++dynp) if (get_te64(&dynp->d_tag)==key) { upx_uint64_t const t= elf_get_offset_from_address(get_te64(&dynp->d_val)); if (t) { return &((unsigned char const *)file_image)[(size_t)t]; } break; } return 0; }
115
True
1
CVE-2020-27788
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/upx/upx/commit/1bb93d4fce9f1d764ba57bf5ac154af515b3fc83', 'name': 'https://github.com/upx/upx/commit/1bb93d4fce9f1d764ba57bf5ac154af515b3fc83', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/332', 'name': 'https://github.com/upx/upx/issues/332', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An out-of-bounds read access vulnerability was discovered in UPX in PackLinuxElf64::canPack() function of p_lx_elf.cpp file. An attacker with a crafted input file could trigger this issue that could cause a crash leading to a denial of service.'}]
2022-08-22T19:23Z
2022-08-18T20:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
John Reiser
2020-01-13 17:26:31-08:00
Detect bad e_shstrtab better. https://github.com/upx/upx/issues/332 modified: p_lx_elf.cpp
1bb93d4fce9f1d764ba57bf5ac154af515b3fc83
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf32::canPack
PackLinuxElf32::canPack()
[]
bool PackLinuxElf32::canPack() { union { unsigned char buf[sizeof(Elf32_Ehdr) + 14*sizeof(Elf32_Phdr)]; //struct { Elf32_Ehdr ehdr; Elf32_Phdr phdr; } e; } u; COMPILE_TIME_ASSERT(sizeof(u.buf) <= 512) fi->seek(0, SEEK_SET); fi->readx(u.buf, sizeof(u.buf)); fi->seek(0, SEEK_SET); Elf32_Ehdr const *const ehdr = (Elf32_Ehdr *) u.buf; // now check the ELF header if (checkEhdr(ehdr) != 0) return false; // additional requirements for linux/elf386 if (get_te16(&ehdr->e_ehsize) != sizeof(*ehdr)) { throwCantPack("invalid Ehdr e_ehsize; try '--force-execve'"); return false; } if (e_phoff != sizeof(*ehdr)) {// Phdrs not contiguous with Ehdr throwCantPack("non-contiguous Ehdr/Phdr; try '--force-execve'"); return false; } unsigned char osabi0 = u.buf[Elf32_Ehdr::EI_OSABI]; // The first PT_LOAD32 must cover the beginning of the file (0==p_offset). Elf32_Phdr const *phdr = phdri; note_size = 0; for (unsigned j=0; j < e_phnum; ++phdr, ++j) { if (j >= 14) { throwCantPack("too many ElfXX_Phdr; try '--force-execve'"); return false; } unsigned const p_type = get_te32(&phdr->p_type); unsigned const p_offset = get_te32(&phdr->p_offset); if (1!=exetype && PT_LOAD32 == p_type) { // 1st PT_LOAD exetype = 1; load_va = get_te32(&phdr->p_vaddr); // class data member // Cast on next line is to avoid a compiler bug (incorrect complaint) in // Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 // error C4319: '~': zero extending 'unsigned int' to 'upx_uint64_t' of greater size unsigned const off = ~page_mask & (unsigned)load_va; if (off && off == p_offset) { // specific hint throwCantPack("Go-language PT_LOAD: try hemfix.c, or try '--force-execve'"); // Fixing it inside upx fails because packExtent() reads original file. return false; } if (0 != p_offset) { // 1st PT_LOAD must cover Ehdr and Phdr throwCantPack("first PT_LOAD.p_offset != 0; try '--force-execve'"); return false; } hatch_off = ~3u & (3+ get_te32(&phdr->p_memsz)); } if (PT_NOTE32 == p_type) { unsigned const x = get_te32(&phdr->p_memsz); if ( sizeof(elfout.notes) < x // beware overflow of note_size || (sizeof(elfout.notes) < (note_size += x)) ) { throwCantPack("PT_NOTEs too big; try '--force-execve'"); return false; } if (osabi_note && Elf32_Ehdr::ELFOSABI_NONE==osabi0) { // Still seems to be generic. struct { struct Elf32_Nhdr nhdr; char name[8]; unsigned body; } note; memset(&note, 0, sizeof(note)); fi->seek(p_offset, SEEK_SET); fi->readx(&note, sizeof(note)); fi->seek(0, SEEK_SET); if (4==get_te32(&note.nhdr.descsz) && 1==get_te32(&note.nhdr.type) // && 0==note.end && (1+ strlen(osabi_note))==get_te32(&note.nhdr.namesz) && 0==strcmp(osabi_note, (char const *)&note.name[0]) ) { osabi0 = ei_osabi; // Specified by PT_NOTE. } } } } if (Elf32_Ehdr::ELFOSABI_NONE ==osabi0 || Elf32_Ehdr::ELFOSABI_LINUX==osabi0) { // No EI_OSBAI, no PT_NOTE. unsigned const arm_eabi = 0xff000000u & get_te32(&ehdr->e_flags); if (Elf32_Ehdr::EM_ARM==e_machine && (EF_ARM_EABI_VER5==arm_eabi || EF_ARM_EABI_VER4==arm_eabi ) ) { // armel-eabi armeb-eabi ARM Linux EABI version 4 is a mess. ei_osabi = osabi0 = Elf32_Ehdr::ELFOSABI_LINUX; } else { osabi0 = opt->o_unix.osabi0; // Possibly specified by command-line. } } if (osabi0!=ei_osabi) { return false; } // We want to compress position-independent executable (gcc -pie) // main programs, but compressing a shared library must be avoided // because the result is no longer usable. In theory, there is no way // to tell them apart: both are just ET_DYN. Also in theory, // neither the presence nor the absence of any particular symbol name // can be used to tell them apart; there are counterexamples. // However, we will use the following heuristic suggested by // Peter S. Mazinger <[email protected]> September 2005: // If a ET_DYN has __libc_start_main as a global undefined symbol, // then the file is a position-independent executable main program // (that depends on libc.so.6) and is eligible to be compressed. // Otherwise (no __libc_start_main as global undefined): skip it. // Also allow __uClibc_main and __uClibc_start_main . if (Elf32_Ehdr::ET_DYN==get_te16(&ehdr->e_type)) { // The DT_SYMTAB has no designated length. Read the whole file. alloc_file_image(file_image, file_size); fi->seek(0, SEEK_SET); fi->readx(file_image, file_size); memcpy(&ehdri, ehdr, sizeof(Elf32_Ehdr)); phdri= (Elf32_Phdr *)((size_t)e_phoff + file_image); // do not free() !! shdri= (Elf32_Shdr *)((size_t)e_shoff + file_image); // do not free() !! sec_strndx = NULL; shstrtab = NULL; if (e_shnum) { unsigned const e_shstrndx = get_te16(&ehdr->e_shstrndx); if (e_shstrndx) { if (e_shnum <= e_shstrndx) { char msg[40]; snprintf(msg, sizeof(msg), "bad e_shstrndx %#x >= e_shnum %d", e_shstrndx, e_shnum); throwCantPack(msg); } sec_strndx = &shdri[e_shstrndx]; unsigned const sh_offset = get_te32(&sec_strndx->sh_offset); if ((u32_t)file_size <= sh_offset) { char msg[50]; snprintf(msg, sizeof(msg), "bad .e_shstrndx->sh_offset %#x", sh_offset); throwCantPack(msg); } shstrtab = (char const *)(sh_offset + file_image); } sec_dynsym = elf_find_section_type(Elf32_Shdr::SHT_DYNSYM); if (sec_dynsym) { unsigned const sh_link = get_te32(&sec_dynsym->sh_link); if (e_shnum <= sh_link) { char msg[50]; snprintf(msg, sizeof(msg), "bad SHT_DYNSYM.sh_link %#x", sh_link); } sec_dynstr = &shdri[sh_link]; } if (sec_strndx) { unsigned const sh_name = get_te32(&sec_strndx->sh_name); if (Elf32_Shdr::SHT_STRTAB != get_te32(&sec_strndx->sh_type) || (u32_t)file_size <= sh_name // FIXME: weak || (sh_name && 0!=strcmp((char const *)".shstrtab", &shstrtab[sh_name])) ) { throwCantPack("bad e_shstrndx"); } } } Elf32_Phdr const *pload_x0(0); // first eXecutable PT_LOAD phdr= phdri; for (int j= e_phnum; --j>=0; ++phdr) if (Elf32_Phdr::PT_DYNAMIC==get_te32(&phdr->p_type)) { dynseg= (Elf32_Dyn const *)(check_pt_dynamic(phdr) + file_image); invert_pt_dynamic(dynseg); } else if (PT_LOAD32==get_te32(&phdr->p_type)) { if (!pload_x0 && Elf32_Phdr::PF_X & get_te32(&phdr->p_flags) ) { pload_x0 = phdr; } check_pt_load(phdr); } // elf_find_dynamic() returns 0 if 0==dynseg. dynstr= (char const *)elf_find_dynamic(Elf32_Dyn::DT_STRTAB); dynsym= (Elf32_Sym const *)elf_find_dynamic(Elf32_Dyn::DT_SYMTAB); if (opt->o_unix.force_pie || Elf32_Dyn::DF_1_PIE & elf_unsigned_dynamic(Elf32_Dyn::DT_FLAGS_1) || calls_crt1((Elf32_Rel const *)elf_find_dynamic(Elf32_Dyn::DT_REL), (int)elf_unsigned_dynamic(Elf32_Dyn::DT_RELSZ)) || calls_crt1((Elf32_Rel const *)elf_find_dynamic(Elf32_Dyn::DT_JMPREL), (int)elf_unsigned_dynamic(Elf32_Dyn::DT_PLTRELSZ))) { is_pie = true; goto proceed; // calls C library init for main program } // Heuristic HACK for shared libraries (compare Darwin (MacOS) Dylib.) // If there is an existing DT_INIT, and if everything that the dynamic // linker ld-linux needs to perform relocations before calling DT_INIT // resides below the first SHT_EXECINSTR Section in one PT_LOAD, then // compress from the first executable Section to the end of that PT_LOAD. // We must not alter anything that ld-linux might touch before it calls // the DT_INIT function. // // Obviously this hack requires that the linker script put pieces // into good positions when building the original shared library, // and also requires ld-linux to behave. // Apparently glibc-2.13.90 insists on 0==e_ident[EI_PAD..15], // so compressing shared libraries may be doomed anyway. // 2011-06-01: stub.shlib-init.S works around by installing hatch // at end of .text. if (/*jni_onload_sym ||*/ elf_find_dynamic(upx_dt_init)) { if (this->e_machine!=Elf32_Ehdr::EM_386 && this->e_machine!=Elf32_Ehdr::EM_MIPS && this->e_machine!=Elf32_Ehdr::EM_ARM) goto abandon; // need stub: EM_PPC if (elf_has_dynamic(Elf32_Dyn::DT_TEXTREL)) { throwCantPack("DT_TEXTREL found; re-compile with -fPIC"); goto abandon; } if (!(Elf32_Dyn::DF_1_PIE & elf_unsigned_dynamic(Elf32_Dyn::DT_FLAGS_1))) { // not explicitly PIE main program if (Elf32_Ehdr::EM_ARM == e_machine // Android is common && !opt->o_unix.android_shlib // but not explicit ) { opt->info_mode++; info("note: use --android-shlib if appropriate"); opt->info_mode--; } } Elf32_Shdr const *shdr = shdri; xct_va = ~0u; if (e_shnum) { for (int j= e_shnum; --j>=0; ++shdr) { unsigned const sh_type = get_te32(&shdr->sh_type); if (Elf32_Shdr::SHF_EXECINSTR & get_te32(&shdr->sh_flags)) { xct_va = umin(xct_va, get_te32(&shdr->sh_addr)); } // Hook the first slot of DT_PREINIT_ARRAY or DT_INIT_ARRAY. if (( Elf32_Dyn::DT_PREINIT_ARRAY==upx_dt_init && Elf32_Shdr::SHT_PREINIT_ARRAY==sh_type) || ( Elf32_Dyn::DT_INIT_ARRAY ==upx_dt_init && Elf32_Shdr::SHT_INIT_ARRAY ==sh_type) ) { unsigned user_init_ava = get_te32(&shdr->sh_addr); user_init_off = get_te32(&shdr->sh_offset); if ((u32_t)file_size <= user_init_off) { char msg[70]; snprintf(msg, sizeof(msg), "bad Elf32_Shdr[%d].sh_offset %#x", -1+ e_shnum - j, user_init_off); throwCantPack(msg); } // Check that &file_image[user_init_off] has // *_RELATIVE relocation, and fetch user_init_va. // If Elf32_Rela then the actual value is in Rela.r_addend. int z_rel = dt_table[Elf32_Dyn::DT_REL]; int z_rsz = dt_table[Elf32_Dyn::DT_RELSZ]; if (z_rel && z_rsz) { unsigned rel_off = get_te32(&dynseg[-1+ z_rel].d_val); Elf32_Rel *rp = (Elf32_Rel *)&file_image[rel_off]; unsigned relsz = get_te32(&dynseg[-1+ z_rsz].d_val); Elf32_Rel *last = (Elf32_Rel *)(relsz + (char *)rp); for (; rp < last; ++rp) { unsigned r_va = get_te32(&rp->r_offset); if (r_va == user_init_ava) { // found the Elf32_Rel unsigned r_info = get_te32(&rp->r_info); unsigned r_type = ELF32_R_TYPE(r_info); if (Elf32_Ehdr::EM_ARM == e_machine && R_ARM_RELATIVE == r_type) { user_init_va = get_te32(&file_image[user_init_off]); } else { char msg[50]; snprintf(msg, sizeof(msg), "bad relocation %#x DT_INIT_ARRAY[0]", r_info); throwCantPack(msg); } break; } } } unsigned const p_filesz = get_te32(&pload_x0->p_filesz); if (!((user_init_va - xct_va) < p_filesz)) { // Not in executable portion of first executable PT_LOAD. if (0==user_init_va && opt->o_unix.android_shlib) { // Android allows (0 ==> skip) ? upx_dt_init = 0; // force steal of 'extra' DT_NULL // XXX: FIXME: depends on SHT_DYNAMIC coming later } else { char msg[70]; snprintf(msg, sizeof(msg), "bad init address %#x in Elf32_Shdr[%d].%#x\n", (unsigned)user_init_va, -1+ e_shnum - j, user_init_off); throwCantPack(msg); } } } // By default /usr/bin/ld leaves 4 extra DT_NULL to support pre-linking. // Take one as a last resort. if ((Elf32_Dyn::DT_INIT==upx_dt_init || !upx_dt_init) && Elf32_Shdr::SHT_DYNAMIC == sh_type) { unsigned const n = get_te32(&shdr->sh_size) / sizeof(Elf32_Dyn); Elf32_Dyn *dynp = (Elf32_Dyn *)&file_image[get_te32(&shdr->sh_offset)]; for (; Elf32_Dyn::DT_NULL != dynp->d_tag; ++dynp) { if (upx_dt_init == get_te32(&dynp->d_tag)) { break; // re-found DT_INIT } } if ((1+ dynp) < (n+ dynseg)) { // not the terminator, so take it user_init_va = get_te32(&dynp->d_val); // 0 if (0==upx_dt_init) set_te32(&dynp->d_tag, upx_dt_init = Elf32_Dyn::DT_INIT); user_init_off = (char const *)&dynp->d_val - (char const *)&file_image[0]; } } } } else { // no Sections; use heuristics unsigned const strsz = elf_unsigned_dynamic(Elf32_Dyn::DT_STRSZ); unsigned const strtab = elf_unsigned_dynamic(Elf32_Dyn::DT_STRTAB); unsigned const relsz = elf_unsigned_dynamic(Elf32_Dyn::DT_RELSZ); unsigned const rel = elf_unsigned_dynamic(Elf32_Dyn::DT_REL); unsigned const init = elf_unsigned_dynamic(upx_dt_init); if ((init == (relsz + rel ) && rel == (strsz + strtab)) || (init == (strsz + strtab) && strtab == (relsz + rel )) ) { xct_va = init; user_init_va = init; user_init_off = elf_get_offset_from_address(init); } } // Rely on 0==elf_unsigned_dynamic(tag) if no such tag. unsigned const va_gash = elf_unsigned_dynamic(Elf32_Dyn::DT_GNU_HASH); unsigned const va_hash = elf_unsigned_dynamic(Elf32_Dyn::DT_HASH); unsigned y = 0; if ((y=1, xct_va < va_gash) || (y=2, (0==va_gash && xct_va < va_hash)) || (y=3, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_STRTAB)) || (y=4, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_SYMTAB)) || (y=5, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_REL)) || (y=6, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_RELA)) || (y=7, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_JMPREL)) || (y=8, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERDEF)) || (y=9, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERSYM)) || (y=10, xct_va < elf_unsigned_dynamic(Elf32_Dyn::DT_VERNEEDED)) ) { static char const *which[] = { "unknown", "DT_GNU_HASH", "DT_HASH", "DT_STRTAB", "DT_SYMTAB", "DT_REL", "DT_RELA", "DT_JMPREL", "DT_VERDEF", "DT_VERSYM", "DT_VERNEEDED", }; char buf[30]; snprintf(buf, sizeof(buf), "%s above stub", which[y]); throwCantPack(buf); goto abandon; } if (!opt->o_unix.android_shlib) { phdr = phdri; for (unsigned j= 0; j < e_phnum; ++phdr, ++j) { unsigned const vaddr = get_te32(&phdr->p_vaddr); if (PT_NOTE32 == get_te32(&phdr->p_type) && xct_va < vaddr) { char buf[40]; snprintf(buf, sizeof(buf), "PT_NOTE %#x above stub", vaddr); throwCantPack(buf); goto abandon; } } } xct_off = elf_get_offset_from_address(xct_va); if (opt->debug.debug_level) { fprintf(stderr, "shlib canPack: xct_va=%#lx xct_off=%#lx\n", (long)xct_va, (long)xct_off); } goto proceed; // But proper packing depends on checking xct_va. } else throwCantPack("need DT_INIT; try \"void _init(void){}\""); abandon: return false; proceed: ; } // XXX Theoretically the following test should be first, // but PackUnix::canPack() wants 0!=exetype ? if (!super::canPack()) return false; assert(exetype == 1); exetype = 0; // set options opt->o_unix.blocksize = blocksize = file_size; return true; }
2409
True
1
CVE-2020-27788
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/upx/upx/commit/1bb93d4fce9f1d764ba57bf5ac154af515b3fc83', 'name': 'https://github.com/upx/upx/commit/1bb93d4fce9f1d764ba57bf5ac154af515b3fc83', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/332', 'name': 'https://github.com/upx/upx/issues/332', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An out-of-bounds read access vulnerability was discovered in UPX in PackLinuxElf64::canPack() function of p_lx_elf.cpp file. An attacker with a crafted input file could trigger this issue that could cause a crash leading to a denial of service.'}]
2022-08-22T19:23Z
2022-08-18T20:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
John Reiser
2020-01-13 17:26:31-08:00
Detect bad e_shstrtab better. https://github.com/upx/upx/issues/332 modified: p_lx_elf.cpp
1bb93d4fce9f1d764ba57bf5ac154af515b3fc83
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf64::canPack
PackLinuxElf64::canPack()
[]
PackLinuxElf64::canPack() { union { unsigned char buf[sizeof(Elf64_Ehdr) + 14*sizeof(Elf64_Phdr)]; //struct { Elf64_Ehdr ehdr; Elf64_Phdr phdr; } e; } u; COMPILE_TIME_ASSERT(sizeof(u) <= 1024) fi->readx(u.buf, sizeof(u.buf)); fi->seek(0, SEEK_SET); Elf64_Ehdr const *const ehdr = (Elf64_Ehdr *) u.buf; // now check the ELF header if (checkEhdr(ehdr) != 0) return false; // additional requirements for linux/elf386 if (get_te16(&ehdr->e_ehsize) != sizeof(*ehdr)) { throwCantPack("invalid Ehdr e_ehsize; try '--force-execve'"); return false; } if (e_phoff != sizeof(*ehdr)) {// Phdrs not contiguous with Ehdr throwCantPack("non-contiguous Ehdr/Phdr; try '--force-execve'"); return false; } // The first PT_LOAD64 must cover the beginning of the file (0==p_offset). Elf64_Phdr const *phdr = phdri; for (unsigned j=0; j < e_phnum; ++phdr, ++j) { if (j >= 14) { throwCantPack("too many ElfXX_Phdr; try '--force-execve'"); return false; } unsigned const p_type = get_te32(&phdr->p_type); if (1!=exetype && PT_LOAD64 == p_type) { // 1st PT_LOAD exetype = 1; load_va = get_te64(&phdr->p_vaddr); // class data member upx_uint64_t const p_offset = get_te64(&phdr->p_offset); upx_uint64_t const off = ~page_mask & load_va; if (off && off == p_offset) { // specific hint throwCantPack("Go-language PT_LOAD: try hemfix.c, or try '--force-execve'"); // Fixing it inside upx fails because packExtent() reads original file. return false; } if (0 != p_offset) { // 1st PT_LOAD must cover Ehdr and Phdr throwCantPack("first PT_LOAD.p_offset != 0; try '--force-execve'"); return false; } hatch_off = ~3ul & (3+ get_te64(&phdr->p_memsz)); break; } } // We want to compress position-independent executable (gcc -pie) // main programs, but compressing a shared library must be avoided // because the result is no longer usable. In theory, there is no way // to tell them apart: both are just ET_DYN. Also in theory, // neither the presence nor the absence of any particular symbol name // can be used to tell them apart; there are counterexamples. // However, we will use the following heuristic suggested by // Peter S. Mazinger <[email protected]> September 2005: // If a ET_DYN has __libc_start_main as a global undefined symbol, // then the file is a position-independent executable main program // (that depends on libc.so.6) and is eligible to be compressed. // Otherwise (no __libc_start_main as global undefined): skip it. // Also allow __uClibc_main and __uClibc_start_main . if (Elf64_Ehdr::ET_DYN==get_te16(&ehdr->e_type)) { // The DT_SYMTAB has no designated length. Read the whole file. alloc_file_image(file_image, file_size); fi->seek(0, SEEK_SET); fi->readx(file_image, file_size); memcpy(&ehdri, ehdr, sizeof(Elf64_Ehdr)); phdri= (Elf64_Phdr *)((size_t)e_phoff + file_image); // do not free() !! shdri= (Elf64_Shdr *)((size_t)e_shoff + file_image); // do not free() !! sec_strndx = NULL; shstrtab = NULL; if (e_shnum) { unsigned const e_shstrndx = get_te16(&ehdr->e_shstrndx); if (e_shstrndx) { if (e_shnum <= e_shstrndx) { char msg[40]; snprintf(msg, sizeof(msg), "bad e_shstrndx %#x >= e_shnum %d", e_shstrndx, e_shnum); throwCantPack(msg); } sec_strndx = &shdri[e_shstrndx]; upx_uint64_t sh_offset = get_te64(&sec_strndx->sh_offset); if ((u64_t)file_size <= sh_offset) { char msg[50]; snprintf(msg, sizeof(msg), "bad .e_shstrndx->sh_offset %#lx", (long unsigned)sh_offset); throwCantPack(msg); } shstrtab = (char const *)(sh_offset + file_image); } sec_dynsym = elf_find_section_type(Elf64_Shdr::SHT_DYNSYM); if (sec_dynsym) { upx_uint64_t const sh_link = get_te64(&sec_dynsym->sh_link); if (e_shnum <= sh_link) { char msg[50]; snprintf(msg, sizeof(msg), "bad SHT_DYNSYM.sh_link %#lx", (long unsigned)sh_link); } sec_dynstr = &shdri[sh_link]; } if (sec_strndx) { unsigned const sh_name = get_te32(&sec_strndx->sh_name); if (Elf64_Shdr::SHT_STRTAB != get_te32(&sec_strndx->sh_type) || (u32_t)file_size <= sh_name // FIXME: weak || (sh_name && 0!=strcmp((char const *)".shstrtab", &shstrtab[sh_name])) ) { throwCantPack("bad e_shstrndx"); } } } Elf64_Phdr const *pload_x0(0); // first eXecutable PT_LOAD phdr= phdri; for (int j= e_phnum; --j>=0; ++phdr) if (Elf64_Phdr::PT_DYNAMIC==get_te32(&phdr->p_type)) { dynseg= (Elf64_Dyn const *)(check_pt_dynamic(phdr) + file_image); invert_pt_dynamic(dynseg); } else if (PT_LOAD64==get_te32(&phdr->p_type)) { if (!pload_x0 && Elf32_Phdr::PF_X & get_te32(&phdr->p_flags) ) { pload_x0 = phdr; } check_pt_load(phdr); } // elf_find_dynamic() returns 0 if 0==dynseg. dynstr= (char const *)elf_find_dynamic(Elf64_Dyn::DT_STRTAB); dynsym= (Elf64_Sym const *)elf_find_dynamic(Elf64_Dyn::DT_SYMTAB); if (opt->o_unix.force_pie || Elf64_Dyn::DF_1_PIE & elf_unsigned_dynamic(Elf64_Dyn::DT_FLAGS_1) || calls_crt1((Elf64_Rela const *)elf_find_dynamic(Elf64_Dyn::DT_RELA), (int)elf_unsigned_dynamic(Elf64_Dyn::DT_RELASZ)) || calls_crt1((Elf64_Rela const *)elf_find_dynamic(Elf64_Dyn::DT_JMPREL), (int)elf_unsigned_dynamic(Elf64_Dyn::DT_PLTRELSZ))) { is_pie = true; goto proceed; // calls C library init for main program } // Heuristic HACK for shared libraries (compare Darwin (MacOS) Dylib.) // If there is an existing DT_INIT, and if everything that the dynamic // linker ld-linux needs to perform relocations before calling DT_INIT // resides below the first SHT_EXECINSTR Section in one PT_LOAD, then // compress from the first executable Section to the end of that PT_LOAD. // We must not alter anything that ld-linux might touch before it calls // the DT_INIT function. // // Obviously this hack requires that the linker script put pieces // into good positions when building the original shared library, // and also requires ld-linux to behave. if (elf_find_dynamic(upx_dt_init)) { if (elf_has_dynamic(Elf64_Dyn::DT_TEXTREL)) { throwCantPack("DT_TEXTREL found; re-compile with -fPIC"); goto abandon; } if (!(Elf64_Dyn::DF_1_PIE & elf_unsigned_dynamic(Elf64_Dyn::DT_FLAGS_1))) { // not explicitly PIE main program if (Elf64_Ehdr::EM_AARCH64 == e_machine // Android is common && !opt->o_unix.android_shlib // but not explicit ) { opt->info_mode++; info("note: use --android-shlib if appropriate"); opt->info_mode--; } } Elf64_Shdr const *shdr = shdri; xct_va = ~0ull; if (e_shnum) { for (int j= e_shnum; --j>=0; ++shdr) { unsigned const sh_type = get_te32(&shdr->sh_type); if (Elf64_Shdr::SHF_EXECINSTR & get_te64(&shdr->sh_flags)) { xct_va = umin(xct_va, get_te64(&shdr->sh_addr)); } // Hook the first slot of DT_PREINIT_ARRAY or DT_INIT_ARRAY. if (( Elf64_Dyn::DT_PREINIT_ARRAY==upx_dt_init && Elf64_Shdr::SHT_PREINIT_ARRAY==sh_type) || ( Elf64_Dyn::DT_INIT_ARRAY ==upx_dt_init && Elf64_Shdr::SHT_INIT_ARRAY ==sh_type) ) { unsigned user_init_ava = get_te32(&shdr->sh_addr); user_init_off = get_te64(&shdr->sh_offset); if ((u64_t)file_size <= user_init_off) { char msg[70]; snprintf(msg, sizeof(msg), "bad Elf64_Shdr[%d].sh_offset %#x", -1+ e_shnum - j, user_init_off); throwCantPack(msg); } // Check that &file_image[user_init_off] has // *_RELATIVE relocation, and fetch user_init_va. // If Elf64_Rela then the actual value is in Rela.r_addend. int z_rel = dt_table[Elf64_Dyn::DT_RELA]; int z_rsz = dt_table[Elf64_Dyn::DT_RELASZ]; if (z_rel && z_rsz) { unsigned rel_off = get_te64(&dynseg[-1+ z_rel].d_val); Elf64_Rela *rp = (Elf64_Rela *)&file_image[rel_off]; unsigned relsz = get_te64(&dynseg[-1+ z_rsz].d_val); Elf64_Rela *last = (Elf64_Rela *)(relsz + (char *)rp); for (; rp < last; ++rp) { unsigned r_va = get_te64(&rp->r_offset); if (r_va == user_init_ava) { // found the Elf64_Rela unsigned r_info = get_te64(&rp->r_info); unsigned r_type = ELF64_R_TYPE(r_info); if (Elf64_Ehdr::EM_AARCH64 == e_machine && R_AARCH64_RELATIVE == r_type) { user_init_va = get_te64(&rp->r_addend); } else if (Elf64_Ehdr::EM_AARCH64 == e_machine && R_AARCH64_ABS64 == r_type) { user_init_va = get_te64(&file_image[user_init_off]); } else { char msg[50]; snprintf(msg, sizeof(msg), "bad relocation %#x DT_INIT_ARRAY[0]", r_info); throwCantPack(msg); } break; } } } unsigned const p_filesz = get_te64(&pload_x0->p_filesz); if (!((user_init_va - xct_va) < p_filesz)) { // Not in executable portion of first executable PT_LOAD. if (0==user_init_va && opt->o_unix.android_shlib) { // Android allows (0 ==> skip) ? upx_dt_init = 0; // force steal of 'extra' DT_NULL // XXX: FIXME: depends on SHT_DYNAMIC coming later } else { char msg[70]; snprintf(msg, sizeof(msg), "bad init address %#x in Elf64_Shdr[%d].%#x\n", (unsigned)user_init_va, -1+ e_shnum - j, user_init_off); throwCantPack(msg); } } } // By default /usr/bin/ld leaves 4 extra DT_NULL to support pre-linking. // Take one as a last resort. if ((Elf64_Dyn::DT_INIT==upx_dt_init || !upx_dt_init) && Elf64_Shdr::SHT_DYNAMIC == sh_type) { unsigned const n = get_te64(&shdr->sh_size) / sizeof(Elf64_Dyn); Elf64_Dyn *dynp = (Elf64_Dyn *)&file_image[get_te64(&shdr->sh_offset)]; for (; Elf64_Dyn::DT_NULL != dynp->d_tag; ++dynp) { if (upx_dt_init == get_te64(&dynp->d_tag)) { break; // re-found DT_INIT } } if ((1+ dynp) < (n+ dynseg)) { // not the terminator, so take it user_init_va = get_te64(&dynp->d_val); // 0 if (0==upx_dt_init) set_te64(&dynp->d_tag, upx_dt_init = Elf64_Dyn::DT_INIT); user_init_off = (char const *)&dynp->d_val - (char const *)&file_image[0]; } } } } else { // no Sections; use heuristics upx_uint64_t const strsz = elf_unsigned_dynamic(Elf64_Dyn::DT_STRSZ); upx_uint64_t const strtab = elf_unsigned_dynamic(Elf64_Dyn::DT_STRTAB); upx_uint64_t const relsz = elf_unsigned_dynamic(Elf64_Dyn::DT_RELSZ); upx_uint64_t const rel = elf_unsigned_dynamic(Elf64_Dyn::DT_REL); upx_uint64_t const init = elf_unsigned_dynamic(upx_dt_init); if ((init == (relsz + rel ) && rel == (strsz + strtab)) || (init == (strsz + strtab) && strtab == (relsz + rel )) ) { xct_va = init; user_init_va = init; user_init_off = elf_get_offset_from_address(init); } } // Rely on 0==elf_unsigned_dynamic(tag) if no such tag. upx_uint64_t const va_gash = elf_unsigned_dynamic(Elf64_Dyn::DT_GNU_HASH); upx_uint64_t const va_hash = elf_unsigned_dynamic(Elf64_Dyn::DT_HASH); unsigned y = 0; if ((y=1, xct_va < va_gash) || (y=2, (0==va_gash && xct_va < va_hash)) || (y=3, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_STRTAB)) || (y=4, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_SYMTAB)) || (y=5, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_REL)) || (y=6, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_RELA)) || (y=7, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_JMPREL)) || (y=8, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERDEF)) || (y=9, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERSYM)) || (y=10, xct_va < elf_unsigned_dynamic(Elf64_Dyn::DT_VERNEEDED)) ) { static char const *which[] = { "unknown", "DT_GNU_HASH", "DT_HASH", "DT_STRTAB", "DT_SYMTAB", "DT_REL", "DT_RELA", "DT_JMPREL", "DT_VERDEF", "DT_VERSYM", "DT_VERNEEDED", }; char buf[30]; snprintf(buf, sizeof(buf), "%s above stub", which[y]); throwCantPack(buf); goto abandon; } if (!opt->o_unix.android_shlib) { phdr = phdri; for (unsigned j= 0; j < e_phnum; ++phdr, ++j) { upx_uint64_t const vaddr = get_te64(&phdr->p_vaddr); if (PT_NOTE64 == get_te32(&phdr->p_type) && xct_va < vaddr) { char buf[40]; snprintf(buf, sizeof(buf), "PT_NOTE %#lx above stub", (unsigned long)vaddr); throwCantPack(buf); goto abandon; } } } xct_off = elf_get_offset_from_address(xct_va); if (opt->debug.debug_level) { fprintf(stderr, "shlib canPack: xct_va=%#lx xct_off=%#lx\n", (long)xct_va, (long)xct_off); } goto proceed; // But proper packing depends on checking xct_va. } else throwCantPack("need DT_INIT; try \"void _init(void){}\""); abandon: return false; proceed: ; } // XXX Theoretically the following test should be first, // but PackUnix::canPack() wants 0!=exetype ? if (!super::canPack()) return false; assert(exetype == 1); exetype = 0; // set options opt->o_unix.blocksize = blocksize = file_size; return true; }
2106
True
1
CVE-2020-27787
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/upx/upx/commit/e2f60adc95334f47e286838dac33160819c5d74d', 'name': 'https://github.com/upx/upx/commit/e2f60adc95334f47e286838dac33160819c5d74d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/333', 'name': 'https://github.com/upx/upx/issues/333', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A Segmentaation fault was found in UPX in invert_pt_dynamic() function in p_lx_elf.cpp. An attacker with a crafted input file allows invalid memory address access that could lead to a denial of service.'}]
2022-08-22T19:13Z
2022-08-18T19:15Z
Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Insufficient Information
https://nvd.nist.gov/vuln/categories
0
John Reiser
2020-01-14 18:45:52-08:00
Detect 0==DT_SYMTAB in invert_pt_dynamic() https://github.com/upx/upx/issues/333 modified: p_lx_elf.cpp
e2f60adc95334f47e286838dac33160819c5d74d
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf32::invert_pt_dynamic
PackLinuxElf32::invert_pt_dynamic( Elf32_Dyn const * dynp)
['dynp']
PackLinuxElf32::invert_pt_dynamic(Elf32_Dyn const *dynp) { if (dt_table[Elf32_Dyn::DT_NULL]) { return; // not 1st time; do not change upx_dt_init } Elf32_Dyn const *const dynp0 = dynp; unsigned ndx = 1+ 0; if (dynp) for (; ; ++ndx, ++dynp) { unsigned const d_tag = get_te32(&dynp->d_tag); if (d_tag < DT_NUM) { if (Elf32_Dyn::DT_NEEDED != d_tag && dt_table[d_tag] && get_te32(&dynp->d_val) != get_te32(&dynp0[-1+ dt_table[d_tag]].d_val)) { char msg[50]; snprintf(msg, sizeof(msg), "duplicate DT_%#x: [%#x] [%#x]", d_tag, -1+ dt_table[d_tag], -1+ ndx); throwCantPack(msg); } dt_table[d_tag] = ndx; } if (Elf32_Dyn::DT_NULL == d_tag) { break; // check here so that dt_table[DT_NULL] is set } } upx_dt_init = 0; if (dt_table[Elf32_Dyn::DT_INIT]) upx_dt_init = Elf32_Dyn::DT_INIT; else if (dt_table[Elf32_Dyn::DT_PREINIT_ARRAY]) upx_dt_init = Elf32_Dyn::DT_PREINIT_ARRAY; else if (dt_table[Elf32_Dyn::DT_INIT_ARRAY]) upx_dt_init = Elf32_Dyn::DT_INIT_ARRAY; unsigned const z_str = dt_table[Elf32_Dyn::DT_STRSZ]; if (z_str) { strtab_end = get_te32(&dynp0[-1+ z_str].d_val); if ((u32_t)file_size <= strtab_end) { // FIXME: weak char msg[50]; snprintf(msg, sizeof(msg), "bad DT_STRSZ %#x", strtab_end); throwCantPack(msg); } } unsigned const x_sym = dt_table[Elf32_Dyn::DT_SYMTAB]; unsigned const x_str = dt_table[Elf32_Dyn::DT_STRTAB]; if (x_sym && x_str) { upx_uint32_t const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); upx_uint32_t const v_str = get_te32(&dynp0[-1+ x_str].d_val); unsigned const z_sym = dt_table[Elf32_Dyn::DT_SYMENT]; unsigned const sz_sym = !z_sym ? sizeof(Elf32_Sym) : get_te32(&dynp0[-1+ z_sym].d_val); if (sz_sym < sizeof(Elf32_Sym)) { char msg[50]; snprintf(msg, sizeof(msg), "bad DT_SYMENT %x", sz_sym); throwCantPack(msg); } if (v_sym < v_str) { symnum_end = (v_str - v_sym) / sz_sym; } if (symnum_end < 1) { throwCantPack("bad DT_SYMTAB"); } } // DT_HASH often ends at DT_SYMTAB unsigned const v_hsh = elf_unsigned_dynamic(Elf32_Dyn::DT_HASH); if (v_hsh && file_image) { hashtab = (unsigned const *)elf_find_dynamic(Elf32_Dyn::DT_HASH); if (!hashtab) { char msg[40]; snprintf(msg, sizeof(msg), "bad DT_HASH %#x", v_hsh); throwCantPack(msg); } unsigned const nbucket = get_te32(&hashtab[0]); unsigned const *const buckets = &hashtab[2]; unsigned const *const chains = &buckets[nbucket]; (void)chains; unsigned const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); if (!nbucket || (nbucket>>31) || (file_size/sizeof(unsigned)) <= (2*nbucket) // FIXME: weak || ((v_hsh < v_sym) && (v_sym - v_hsh) < (sizeof(unsigned)*2 // headers + sizeof(*buckets)*nbucket // buckets + sizeof(*chains) *nbucket // chains )) ) { char msg[90]; snprintf(msg, sizeof(msg), "bad DT_HASH nbucket=%#x len=%#x", nbucket, (v_sym - v_hsh)); throwCantPack(msg); } } // DT_GNU_HASH often ends at DT_SYMTAB; FIXME: not for Android? unsigned const v_gsh = elf_unsigned_dynamic(Elf32_Dyn::DT_GNU_HASH); if (v_gsh && file_image) { gashtab = (unsigned const *)elf_find_dynamic(Elf32_Dyn::DT_GNU_HASH); if (!gashtab) { char msg[40]; snprintf(msg, sizeof(msg), "bad DT_GNU_HASH %#x", v_gsh); throwCantPack(msg); } unsigned const n_bucket = get_te32(&gashtab[0]); unsigned const n_bitmask = get_te32(&gashtab[2]); unsigned const gnu_shift = get_te32(&gashtab[3]); unsigned const *const bitmask = (unsigned const *)(void const *)&gashtab[4]; unsigned const *const buckets = (unsigned const *)&bitmask[n_bitmask]; unsigned const *const hasharr = &buckets[n_bucket]; (void)hasharr; //unsigned const *const gashend = &hasharr[n_bucket]; // minimum unsigned const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); if (!n_bucket || !n_bitmask || (-1+ n_bitmask) & n_bitmask // not a power of 2 || 8*sizeof(unsigned) <= gnu_shift // shifted result always == 0 || (n_bucket>>30) // fie on fuzzers || (n_bitmask>>30) || (file_size / sizeof(unsigned)) <= (n_bitmask + 2*n_bucket) // FIXME: weak // FIXME: next test does work for Android? || ((v_gsh < v_sym) && (v_sym - v_gsh) < (sizeof(unsigned)*4 // headers + sizeof(*bitmask)*n_bitmask // bitmask + sizeof(*buckets)*n_bucket // buckets + sizeof(*hasharr)*n_bucket // hasharr )) ) { char msg[90]; snprintf(msg, sizeof(msg), "bad DT_GNU_HASH n_bucket=%#x n_bitmask=%#x len=%#x", n_bucket, n_bitmask, v_sym - v_gsh); throwCantPack(msg); } } unsigned const e_shstrndx = get_te16(&ehdri.e_shstrndx); if (e_shnum <= e_shstrndx && !(0==e_shnum && 0==e_shstrndx) ) { char msg[40]; snprintf(msg, sizeof(msg), "bad .e_shstrndx %d >= .e_shnum %d", e_shstrndx, e_shnum); throwCantPack(msg); } }
1059
True
1
CVE-2020-27787
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/upx/upx/commit/e2f60adc95334f47e286838dac33160819c5d74d', 'name': 'https://github.com/upx/upx/commit/e2f60adc95334f47e286838dac33160819c5d74d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/issues/333', 'name': 'https://github.com/upx/upx/issues/333', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A Segmentaation fault was found in UPX in invert_pt_dynamic() function in p_lx_elf.cpp. An attacker with a crafted input file allows invalid memory address access that could lead to a denial of service.'}]
2022-08-22T19:13Z
2022-08-18T19:15Z
Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Insufficient Information
https://nvd.nist.gov/vuln/categories
0
John Reiser
2020-01-14 18:45:52-08:00
Detect 0==DT_SYMTAB in invert_pt_dynamic() https://github.com/upx/upx/issues/333 modified: p_lx_elf.cpp
e2f60adc95334f47e286838dac33160819c5d74d
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf64::invert_pt_dynamic
PackLinuxElf64::invert_pt_dynamic( Elf64_Dyn const * dynp)
['dynp']
PackLinuxElf64::invert_pt_dynamic(Elf64_Dyn const *dynp) { if (dt_table[Elf64_Dyn::DT_NULL]) { return; // not 1st time; do not change upx_dt_init } Elf64_Dyn const *const dynp0 = dynp; unsigned ndx = 1+ 0; if (dynp) for (; ; ++ndx, ++dynp) { upx_uint64_t const d_tag = get_te64(&dynp->d_tag); if (d_tag>>32) { // outrageous char msg[50]; snprintf(msg, sizeof(msg), "bad Elf64_Dyn[%d].d_tag %#lx", -1+ ndx, (long unsigned)d_tag); throwCantPack(msg); } if (d_tag < DT_NUM) { if (Elf64_Dyn::DT_NEEDED != d_tag && dt_table[d_tag] && get_te64(&dynp->d_val) != get_te64(&dynp0[-1+ dt_table[d_tag]].d_val)) { char msg[50]; snprintf(msg, sizeof(msg), "duplicate DT_%#x: [%#x] [%#x]", (unsigned)d_tag, -1+ dt_table[d_tag], -1+ ndx); throwCantPack(msg); } dt_table[d_tag] = ndx; } if (Elf64_Dyn::DT_NULL == d_tag) { break; // check here so that dt_table[DT_NULL] is set } } upx_dt_init = 0; if (dt_table[Elf64_Dyn::DT_INIT]) upx_dt_init = Elf64_Dyn::DT_INIT; else if (dt_table[Elf64_Dyn::DT_PREINIT_ARRAY]) upx_dt_init = Elf64_Dyn::DT_PREINIT_ARRAY; else if (dt_table[Elf64_Dyn::DT_INIT_ARRAY]) upx_dt_init = Elf64_Dyn::DT_INIT_ARRAY; unsigned const z_str = dt_table[Elf64_Dyn::DT_STRSZ]; if (z_str) { strtab_end = get_te64(&dynp0[-1+ z_str].d_val); if ((u64_t)file_size <= strtab_end) { // FIXME: weak char msg[50]; snprintf(msg, sizeof(msg), "bad DT_STRSZ %#x", strtab_end); throwCantPack(msg); } } // DT_SYMTAB has no designated length. // End it when next area else starts; often DT_STRTAB. (FIXME) unsigned const x_sym = dt_table[Elf64_Dyn::DT_SYMTAB]; unsigned const x_str = dt_table[Elf64_Dyn::DT_STRTAB]; if (x_sym && x_str) { upx_uint64_t const v_sym = get_te64(&dynp0[-1+ x_sym].d_val); upx_uint64_t const v_str = get_te64(&dynp0[-1+ x_str].d_val); unsigned const z_sym = dt_table[Elf64_Dyn::DT_SYMENT]; unsigned const sz_sym = !z_sym ? sizeof(Elf64_Sym) : get_te64(&dynp0[-1+ z_sym].d_val); if (sz_sym < sizeof(Elf64_Sym)) { char msg[50]; snprintf(msg, sizeof(msg), "bad DT_SYMENT %x", sz_sym); throwCantPack(msg); } if (v_sym < v_str) { symnum_end = (v_str - v_sym) / sz_sym; } if (symnum_end < 1) { throwCantPack("bad DT_SYMTAB"); } } // DT_HASH often ends at DT_SYMTAB unsigned const v_hsh = elf_unsigned_dynamic(Elf64_Dyn::DT_HASH); if (v_hsh && file_image) { hashtab = (unsigned const *)elf_find_dynamic(Elf64_Dyn::DT_HASH); if (!hashtab) { char msg[40]; snprintf(msg, sizeof(msg), "bad DT_HASH %#x", v_hsh); throwCantPack(msg); } unsigned const nbucket = get_te32(&hashtab[0]); unsigned const *const buckets = &hashtab[2]; unsigned const *const chains = &buckets[nbucket]; (void)chains; unsigned const v_sym = get_te32(&dynp0[-1+ x_sym].d_val); if (!nbucket || (nbucket>>31) || (file_size/sizeof(unsigned)) <= (2*nbucket) // FIXME: weak || ((v_hsh < v_sym) && (v_sym - v_hsh) < (sizeof(unsigned)*2 // headers + sizeof(*buckets)*nbucket // buckets + sizeof(*chains) *nbucket // chains )) ) { char msg[90]; snprintf(msg, sizeof(msg), "bad DT_HASH nbucket=%#x len=%#x", nbucket, (v_sym - v_hsh)); throwCantPack(msg); } } // DT_GNU_HASH often ends at DT_SYMTAB; FIXME: not for Android? unsigned const v_gsh = elf_unsigned_dynamic(Elf64_Dyn::DT_GNU_HASH); if (v_gsh && file_image) { gashtab = (unsigned const *)elf_find_dynamic(Elf64_Dyn::DT_GNU_HASH); if (!gashtab) { char msg[40]; snprintf(msg, sizeof(msg), "bad DT_GNU_HASH %#x", v_gsh); throwCantPack(msg); } unsigned const n_bucket = get_te32(&gashtab[0]); unsigned const n_bitmask = get_te32(&gashtab[2]); unsigned const gnu_shift = get_te32(&gashtab[3]); upx_uint64_t const *const bitmask = (upx_uint64_t const *)(void const *)&gashtab[4]; unsigned const *const buckets = (unsigned const *)&bitmask[n_bitmask]; unsigned const *const hasharr = &buckets[n_bucket]; (void)hasharr; //unsigned const *const gashend = &hasharr[n_bucket]; // minimum upx_uint64_t const v_sym = get_te64(&dynp0[-1+ x_sym].d_val); if (!n_bucket || !n_bitmask || (-1+ n_bitmask) & n_bitmask // not a power of 2 || 8*sizeof(upx_uint64_t) <= gnu_shift // shifted result always == 0 || (n_bucket>>30) // fie on fuzzers || (n_bitmask>>30) || (file_size/sizeof(unsigned)) <= ((sizeof(*bitmask)/sizeof(unsigned))*n_bitmask + 2*n_bucket) // FIXME: weak // FIXME: next test does work for Android? || ((v_gsh < v_sym) && (v_sym - v_gsh) < (sizeof(unsigned)*4 // headers + sizeof(*bitmask)*n_bitmask // bitmask + sizeof(*buckets)*n_bucket // buckets + sizeof(*hasharr)*n_bucket // hasharr )) ) { char msg[90]; snprintf(msg, sizeof(msg), "bad DT_GNU_HASH n_bucket=%#x n_bitmask=%#x len=%#lx", n_bucket, n_bitmask, (long unsigned)(v_sym - v_gsh)); throwCantPack(msg); } } unsigned const e_shstrndx = get_te16(&ehdri.e_shstrndx); if (e_shnum <= e_shstrndx && !(0==e_shnum && 0==e_shstrndx) ) { char msg[40]; snprintf(msg, sizeof(msg), "bad .e_shstrndx %d >= .e_shnum %d", e_shstrndx, e_shnum); throwCantPack(msg); } }
1124
True
1
CVE-2021-30500
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/upx/upx/issues/485', 'name': 'https://github.com/upx/upx/issues/485', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/commit/90279abdfcd235172eab99651043051188938dcc', 'name': 'https://github.com/upx/upx/commit/90279abdfcd235172eab99651043051188938dcc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1948692', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1948692', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:4.0.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Null pointer dereference was found in upx PackLinuxElf::canUnpack() in p_lx_elf.cpp,in version UPX 4.0.0. That allow attackers to execute arbitrary code and cause a denial of service via a crafted file.'}]
2021-06-08T02:05Z
2021-05-27T00:15Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
John Reiser
2021-04-10 10:11:48-07:00
PackLinuxElf::canUnpack must checkEhdr() for ELF input https://github.com/upx/upx/issues/485 modified: p_lx_elf.cpp
90279abdfcd235172eab99651043051188938dcc
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf32::canUnpack
PackLinuxElf32::canUnpack()
[]
int PackLinuxElf32::canUnpack() { if (super::canUnpack()) { return true; } if (Elf32_Ehdr::ET_DYN==get_te16(&ehdri.e_type)) { PackLinuxElf32help1(fi); } return false; }
44
True
1
CVE-2021-30500
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/upx/upx/issues/485', 'name': 'https://github.com/upx/upx/issues/485', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/upx/upx/commit/90279abdfcd235172eab99651043051188938dcc', 'name': 'https://github.com/upx/upx/commit/90279abdfcd235172eab99651043051188938dcc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1948692', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1948692', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:upx_project:upx:4.0.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Null pointer dereference was found in upx PackLinuxElf::canUnpack() in p_lx_elf.cpp,in version UPX 4.0.0. That allow attackers to execute arbitrary code and cause a denial of service via a crafted file.'}]
2021-06-08T02:05Z
2021-05-27T00:15Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
John Reiser
2021-04-10 10:11:48-07:00
PackLinuxElf::canUnpack must checkEhdr() for ELF input https://github.com/upx/upx/issues/485 modified: p_lx_elf.cpp
90279abdfcd235172eab99651043051188938dcc
False
upx/upx
UPX - the Ultimate Packer for eXecutables
2016-08-31 11:23:13
2022-08-27 20:20:15
null
upx
9801.0
1041.0
PackLinuxElf64::canUnpack
PackLinuxElf64::canUnpack()
[]
int PackLinuxElf64::canUnpack() { if (super::canUnpack()) { return true; } if (Elf64_Ehdr::ET_DYN==get_te16(&ehdri.e_type)) { PackLinuxElf64help1(fi); Elf64_Phdr const *phdr = phdri, *last_LOAD = nullptr; for (unsigned j = 0; j < e_phnum; ++phdr, ++j) if (Elf64_Phdr::PT_LOAD==get_te32(&phdr->p_type)) { last_LOAD = phdr; } if (!last_LOAD) return false; off_t offset = get_te64(&last_LOAD->p_offset); unsigned filesz = get_te64(&last_LOAD->p_filesz); fi->seek(filesz+offset, SEEK_SET); MemBuffer buf(32 + sizeof(overlay_offset)); fi->readx(buf, buf.getSize()); return PackUnix::find_overlay_offset(buf); } return false; }
166
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
_mibindex_add
_mibindex_add( const char * dirname , int i)
['dirname', 'i']
_mibindex_add( const char *dirname, int i ) { const int old_mibindex_max = _mibindex_max; DEBUGMSGTL(("mibindex", "add: %s (%d)\n", dirname, i )); if ( i == -1 ) i = _mibindex++; if ( i >= _mibindex_max ) { /* * If the index array is full (or non-existent) * then expand (or create) it */ _mibindex_max = i + 10; _mibindexes = realloc(_mibindexes, _mibindex_max * sizeof(_mibindexes[0])); netsnmp_assert(_mibindexes); memset(_mibindexes + old_mibindex_max, 0, (_mibindex_max - old_mibindex_max) * sizeof(_mibindexes[0])); } _mibindexes[ i ] = strdup( dirname ); if ( i >= _mibindex ) _mibindex = i+1; DEBUGMSGTL(("mibindex", "add: %d/%d/%d\n", i, _mibindex, _mibindex_max )); return i; }
142
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
netsnmp_init_mib
netsnmp_init_mib( void)
['void']
netsnmp_init_mib(void) { const char *prefix; char *env_var, *entry; PrefixListPtr pp = &mib_prefixes[0]; char *st = NULL; if (Mib) return; netsnmp_init_mib_internals(); /* * Initialise the MIB directory/ies */ netsnmp_fixup_mib_directory(); env_var = strdup(netsnmp_get_mib_directory()); if (!env_var) return; netsnmp_mibindex_load(); DEBUGMSGTL(("init_mib", "Seen MIBDIRS: Looking in '%s' for mib dirs ...\n", env_var)); entry = strtok_r(env_var, ENV_SEPARATOR, &st); while (entry) { add_mibdir(entry); entry = strtok_r(NULL, ENV_SEPARATOR, &st); } SNMP_FREE(env_var); env_var = netsnmp_getenv("MIBFILES"); if (env_var != NULL) { if (*env_var == '+') entry = strtok_r(env_var+1, ENV_SEPARATOR, &st); else entry = strtok_r(env_var, ENV_SEPARATOR, &st); while (entry) { add_mibfile(entry, NULL, NULL); entry = strtok_r(NULL, ENV_SEPARATOR, &st); } } netsnmp_init_mib_internals(); /* * Read in any modules or mibs requested */ env_var = netsnmp_getenv("MIBS"); if (env_var == NULL) { if (confmibs != NULL) env_var = strdup(confmibs); else env_var = strdup(NETSNMP_DEFAULT_MIBS); } else { env_var = strdup(env_var); } if (env_var && ((*env_var == '+') || (*env_var == '-'))) { entry = (char *) malloc(strlen(NETSNMP_DEFAULT_MIBS) + strlen(env_var) + 2); if (!entry) { DEBUGMSGTL(("init_mib", "env mibs malloc failed")); SNMP_FREE(env_var); return; } else { if (*env_var == '+') sprintf(entry, "%s%c%s", NETSNMP_DEFAULT_MIBS, ENV_SEPARATOR_CHAR, env_var+1); else sprintf(entry, "%s%c%s", env_var+1, ENV_SEPARATOR_CHAR, NETSNMP_DEFAULT_MIBS ); } SNMP_FREE(env_var); env_var = entry; } DEBUGMSGTL(("init_mib", "Seen MIBS: Looking in '%s' for mib files ...\n", env_var)); entry = strtok_r(env_var, ENV_SEPARATOR, &st); while (entry) { if (strcasecmp(entry, DEBUG_ALWAYS_TOKEN) == 0) { read_all_mibs(); } else if (strstr(entry, "/") != NULL) { read_mib(entry); } else { netsnmp_read_module(entry); } entry = strtok_r(NULL, ENV_SEPARATOR, &st); } adopt_orphans(); SNMP_FREE(env_var); env_var = netsnmp_getenv("MIBFILES"); if (env_var != NULL) { if ((*env_var == '+') || (*env_var == '-')) { #ifdef NETSNMP_DEFAULT_MIBFILES entry = (char *) malloc(strlen(NETSNMP_DEFAULT_MIBFILES) + strlen(env_var) + 2); if (!entry) { DEBUGMSGTL(("init_mib", "env mibfiles malloc failed")); } else { if (*env_var++ == '+') sprintf(entry, "%s%c%s", NETSNMP_DEFAULT_MIBFILES, ENV_SEPARATOR_CHAR, env_var ); else sprintf(entry, "%s%c%s", env_var, ENV_SEPARATOR_CHAR, NETSNMP_DEFAULT_MIBFILES ); } SNMP_FREE(env_var); env_var = entry; #else env_var = strdup(env_var + 1); #endif } else { env_var = strdup(env_var); } } else { #ifdef NETSNMP_DEFAULT_MIBFILES env_var = strdup(NETSNMP_DEFAULT_MIBFILES); #endif } if (env_var != NULL) { DEBUGMSGTL(("init_mib", "Seen MIBFILES: Looking in '%s' for mib files ...\n", env_var)); entry = strtok_r(env_var, ENV_SEPARATOR, &st); while (entry) { read_mib(entry); entry = strtok_r(NULL, ENV_SEPARATOR, &st); } SNMP_FREE(env_var); } prefix = netsnmp_getenv("PREFIX"); if (!prefix) prefix = Standard_Prefix; Prefix = (char *) malloc(strlen(prefix) + 2); if (!Prefix) DEBUGMSGTL(("init_mib", "Prefix malloc failed")); else strcpy(Prefix, prefix); DEBUGMSGTL(("init_mib", "Seen PREFIX: Looking in '%s' for prefix ...\n", Prefix)); /* * remove trailing dot */ if (Prefix) { env_var = &Prefix[strlen(Prefix) - 1]; if (*env_var == '.') *env_var = '\0'; } pp->str = Prefix; /* fixup first mib_prefix entry */ /* * now that the list of prefixes is built, save each string length. */ while (pp->str) { pp->len = strlen(pp->str); pp++; } Mib = tree_head; /* Backwards compatibility */ tree_top = (struct tree *) calloc(1, sizeof(struct tree)); /* * XX error check ? */ if (tree_top) { tree_top->label = strdup("(top)"); tree_top->child_list = tree_head; } }
826
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
netsnmp_mibindex_load
netsnmp_mibindex_load( void)
['void']
netsnmp_mibindex_load( void ) { DIR *dir; struct dirent *file; FILE *fp; char tmpbuf[ 300]; char tmpbuf2[300]; int i; char *cp; /* * Open the MIB index directory, or create it (empty) */ snprintf( tmpbuf, sizeof(tmpbuf), "%s/mib_indexes", get_persistent_directory()); tmpbuf[sizeof(tmpbuf)-1] = 0; dir = opendir( tmpbuf ); if ( dir == NULL ) { DEBUGMSGTL(("mibindex", "load: (new)\n")); mkdirhier( tmpbuf, NETSNMP_AGENT_DIRECTORY_MODE, 0); return; } /* * Create a list of which directory each file refers to */ while ((file = readdir( dir ))) { if ( !isdigit((unsigned char)(file->d_name[0]))) continue; i = atoi( file->d_name ); snprintf( tmpbuf, sizeof(tmpbuf), "%s/mib_indexes/%d", get_persistent_directory(), i ); tmpbuf[sizeof(tmpbuf)-1] = 0; fp = fopen( tmpbuf, "r" ); if (!fp) continue; cp = fgets( tmpbuf2, sizeof(tmpbuf2), fp ); fclose( fp ); if ( !cp ) { DEBUGMSGTL(("mibindex", "Empty MIB index (%d)\n", i)); continue; } if ( strncmp( tmpbuf2, "DIR ", 4 ) != 0 ) { DEBUGMSGTL(("mibindex", "Malformed MIB index (%d)\n", i)); continue; } tmpbuf2[strlen(tmpbuf2)-1] = 0; DEBUGMSGTL(("mibindex", "load: (%d) %s\n", i, tmpbuf2)); (void)_mibindex_add( tmpbuf2+4, i ); /* Skip 'DIR ' */ } closedir( dir ); }
299
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
netsnmp_mibindex_lookup
netsnmp_mibindex_lookup( const char * dirname)
['dirname']
netsnmp_mibindex_lookup( const char *dirname ) { int i; static char tmpbuf[300]; for (i=0; i<_mibindex; i++) { if ( _mibindexes[i] && strcmp( _mibindexes[i], dirname ) == 0) { snprintf(tmpbuf, sizeof(tmpbuf), "%s/mib_indexes/%d", get_persistent_directory(), i); tmpbuf[sizeof(tmpbuf)-1] = 0; DEBUGMSGTL(("mibindex", "lookup: %s (%d) %s\n", dirname, i, tmpbuf )); return tmpbuf; } } DEBUGMSGTL(("mibindex", "lookup: (none)\n")); return NULL; }
115
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
netsnmp_mibindex_new
netsnmp_mibindex_new( const char * dirname)
['dirname']
netsnmp_mibindex_new( const char *dirname ) { FILE *fp; char tmpbuf[300]; char *cp; int i; cp = netsnmp_mibindex_lookup( dirname ); if (!cp) { i = _mibindex_add( dirname, -1 ); snprintf( tmpbuf, sizeof(tmpbuf), "%s/mib_indexes/%d", get_persistent_directory(), i ); tmpbuf[sizeof(tmpbuf)-1] = 0; cp = tmpbuf; } DEBUGMSGTL(("mibindex", "new: %s (%s)\n", dirname, cp )); fp = fopen( cp, "w" ); if (fp) fprintf( fp, "DIR %s\n", dirname ); return fp; }
122
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
shutdown_mib
shutdown_mib( void)
['void']
shutdown_mib(void) { unload_all_mibs(); if (tree_top) { if (tree_top->label) SNMP_FREE(tree_top->label); SNMP_FREE(tree_top); } tree_head = NULL; Mib = NULL; if (_mibindexes) { int i; for (i = 0; i < _mibindex; ++i) SNMP_FREE(_mibindexes[i]); free(_mibindexes); _mibindex = 0; _mibindex_max = 0; _mibindexes = NULL; } if (Prefix != NULL && Prefix != &Standard_Prefix[0]) SNMP_FREE(Prefix); if (Prefix) Prefix = NULL; SNMP_FREE(confmibs); SNMP_FREE(confmibdir); }
126
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
add_mibdir
add_mibdir( const char * dirname)
['dirname']
add_mibdir(const char *dirname) { FILE *ip; const char *oldFile = File; char **filenames; int count = 0; int filename_count, i; #if !(defined(WIN32) || defined(cygwin)) char *token; char space; char newline; struct stat dir_stat, idx_stat; char tmpstr[300]; char tmpstr1[300]; #endif DEBUGMSGTL(("parse-mibs", "Scanning directory %s\n", dirname)); #if !(defined(WIN32) || defined(cygwin)) token = netsnmp_mibindex_lookup( dirname ); if (token && stat(token, &idx_stat) == 0 && stat(dirname, &dir_stat) == 0) { if (dir_stat.st_mtime < idx_stat.st_mtime) { DEBUGMSGTL(("parse-mibs", "The index is good\n")); if ((ip = fopen(token, "r")) != NULL) { fgets(tmpstr, sizeof(tmpstr), ip); /* Skip dir line */ while (fscanf(ip, "%127s%c%299[^\n]%c", token, &space, tmpstr, &newline) == 4) { /* * If an overflow of the token or tmpstr buffers has been * found log a message and break out of the while loop, * thus the rest of the file tokens will be ignored. */ if (space != ' ' || newline != '\n') { snmp_log(LOG_ERR, "add_mibdir: strings scanned in from %s/%s " \ "are too large. count = %d\n ", dirname, ".index", count); break; } snprintf(tmpstr1, sizeof(tmpstr1), "%s/%s", dirname, tmpstr); tmpstr1[ sizeof(tmpstr1)-1 ] = 0; new_module(token, tmpstr1); count++; } fclose(ip); return count; } else DEBUGMSGTL(("parse-mibs", "Can't read index\n")); } else DEBUGMSGTL(("parse-mibs", "Index outdated\n")); } else DEBUGMSGTL(("parse-mibs", "No index\n")); #endif filename_count = scan_directory(&filenames, dirname); if (filename_count >= 0) { ip = netsnmp_mibindex_new(dirname); for (i = 0; i < filename_count; i++) { if (add_mibfile(filenames[i], strrchr(filenames[i], '/'), ip) == 0) count++; free(filenames[i]); } File = oldFile; if (ip) fclose(ip); free(filenames); return (count); } else DEBUGMSGTL(("parse-mibs","cannot open MIB directory %s\n", dirname)); return (-1); }
400
True
1
CVE-2020-15861
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://github.com/net-snmp/net-snmp/issues/145', 'name': 'https://github.com/net-snmp/net-snmp/issues/145', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966599', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'name': 'https://github.com/net-snmp/net-snmp/commit/4fd9a450444a434a993bc72f7c3486ccce41f602', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-59'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 allows Escalation of Privileges because of UNIX symbolic link (symlink) following.'}]
2020-09-04T11:15Z
2020-08-20T01:17Z
Improper Link Resolution Before File Access ('Link Following')
The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
https://cwe.mitre.org/data/definitions/59.html
0
Bart Van Assche
2019-05-22 09:56:21+02:00
CHANGES: snmpd: Stop reading and writing the mib_indexes/* files Caching directory contents is something the operating system should do and is not something Net-SNMP should do. Instead of storing a copy of the directory contents in ${tmp_dir}/mib_indexes/${n}, always scan a MIB directory.
4fd9a450444a434a993bc72f7c3486ccce41f602
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
add_mibfile
add_mibfile( const char * tmpstr , const char * d_name , FILE * ip)
['tmpstr', 'd_name', 'ip']
add_mibfile(const char* tmpstr, const char* d_name, FILE *ip ) { FILE *fp; char token[MAXTOKEN], token2[MAXTOKEN]; /* * which module is this */ if ((fp = fopen(tmpstr, "r")) == NULL) { snmp_log_perror(tmpstr); return 1; } DEBUGMSGTL(("parse-mibs", "Checking file: %s...\n", tmpstr)); mibLine = 1; File = tmpstr; if (get_token(fp, token, MAXTOKEN) != LABEL) { fclose(fp); return 1; } /* * simple test for this being a MIB */ if (get_token(fp, token2, MAXTOKEN) == DEFINITIONS) { new_module(token, tmpstr); if (ip) fprintf(ip, "%s %s\n", token, d_name); fclose(fp); return 0; } else { fclose(fp); return 1; } }
156
True
1
CVE-2019-20892
False
False
False
False
AV:N/AC:L/Au:S/C:N/I:N/A:P
NETWORK
LOW
SINGLE
NONE
NONE
PARTIAL
4.0
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'https://sourceforge.net/p/net-snmp/bugs/2923/', 'name': 'https://sourceforge.net/p/net-snmp/bugs/2923/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1663027', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1663027', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1877027', 'name': 'https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1877027', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/5f881d3bf24599b90d67a45cae7a3eb099cd71c9', 'name': 'https://github.com/net-snmp/net-snmp/commit/5f881d3bf24599b90d67a45cae7a3eb099cd71c9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/06/25/4', 'name': '[oss-security] 20200625 [[email protected]: Re: [scr916814] net-snmp - Perhaps only unreleased development versions; fix appears to be in v5.8.1.pre1]', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4410-1/', 'name': 'USN-4410-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://www.oracle.com/security-alerts/cpujan2021.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2021.html', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-415'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.8', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'net-snmp before 5.8.1.pre1 has a double free in usm_free_usmStateReference in snmplib/snmpusm.c via an SNMPv3 GetBulk request. NOTE: this affects net-snmp packages shipped to end users by multiple Linux distributions, but might not affect an upstream release.'}]
2021-01-20T15:15Z
2020-06-25T10:15Z
Double Free
The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.
When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
https://cwe.mitre.org/data/definitions/415.html
0
Bart Van Assche
2019-07-27 19:34:09-07:00
libsnmp, USM: Introduce a reference count in struct usmStateReference This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/.
5f881d3bf24599b90d67a45cae7a3eb099cd71c9
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
_clone_pdu_header
_clone_pdu_header( netsnmp_pdu * pdu)
['pdu']
_clone_pdu_header(netsnmp_pdu *pdu) { netsnmp_pdu *newpdu; struct snmp_secmod_def *sptr; int ret; if (!pdu) return NULL; newpdu = (netsnmp_pdu *) malloc(sizeof(netsnmp_pdu)); if (!newpdu) return NULL; memmove(newpdu, pdu, sizeof(netsnmp_pdu)); /* * reset copied pointers if copy fails */ newpdu->variables = NULL; newpdu->enterprise = NULL; newpdu->community = NULL; newpdu->securityEngineID = NULL; newpdu->securityName = NULL; newpdu->contextEngineID = NULL; newpdu->contextName = NULL; newpdu->transport_data = NULL; /* * copy buffers individually. If any copy fails, all are freed. */ if (snmp_clone_mem((void **) &newpdu->enterprise, pdu->enterprise, sizeof(oid) * pdu->enterprise_length) || snmp_clone_mem((void **) &newpdu->community, pdu->community, pdu->community_len) || snmp_clone_mem((void **) &newpdu->contextEngineID, pdu->contextEngineID, pdu->contextEngineIDLen) || snmp_clone_mem((void **) &newpdu->securityEngineID, pdu->securityEngineID, pdu->securityEngineIDLen) || snmp_clone_mem((void **) &newpdu->contextName, pdu->contextName, pdu->contextNameLen) || snmp_clone_mem((void **) &newpdu->securityName, pdu->securityName, pdu->securityNameLen) || snmp_clone_mem((void **) &newpdu->transport_data, pdu->transport_data, pdu->transport_data_length)) { snmp_free_pdu(newpdu); return NULL; } if (pdu->securityStateRef && pdu->command == SNMP_MSG_TRAP2) { netsnmp_assert(pdu->securityModel == SNMP_DEFAULT_SECMODEL); ret = usm_clone_usmStateReference((struct usmStateReference *) pdu->securityStateRef, (struct usmStateReference **) &newpdu->securityStateRef ); if (ret) { snmp_free_pdu(newpdu); return NULL; } } if ((sptr = find_sec_mod(newpdu->securityModel)) != NULL && sptr->pdu_clone != NULL) { /* * call security model if it needs to know about this */ (*sptr->pdu_clone) (pdu, newpdu); } return newpdu; }
366
True
1
CVE-2019-20892
False
False
False
False
AV:N/AC:L/Au:S/C:N/I:N/A:P
NETWORK
LOW
SINGLE
NONE
NONE
PARTIAL
4.0
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'https://sourceforge.net/p/net-snmp/bugs/2923/', 'name': 'https://sourceforge.net/p/net-snmp/bugs/2923/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1663027', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1663027', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1877027', 'name': 'https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1877027', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/5f881d3bf24599b90d67a45cae7a3eb099cd71c9', 'name': 'https://github.com/net-snmp/net-snmp/commit/5f881d3bf24599b90d67a45cae7a3eb099cd71c9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/06/25/4', 'name': '[oss-security] 20200625 [[email protected]: Re: [scr916814] net-snmp - Perhaps only unreleased development versions; fix appears to be in v5.8.1.pre1]', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4410-1/', 'name': 'USN-4410-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://www.oracle.com/security-alerts/cpujan2021.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2021.html', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-415'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.8', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'net-snmp before 5.8.1.pre1 has a double free in usm_free_usmStateReference in snmplib/snmpusm.c via an SNMPv3 GetBulk request. NOTE: this affects net-snmp packages shipped to end users by multiple Linux distributions, but might not affect an upstream release.'}]
2021-01-20T15:15Z
2020-06-25T10:15Z
Double Free
The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.
When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
https://cwe.mitre.org/data/definitions/415.html
0
Bart Van Assche
2019-07-27 19:34:09-07:00
libsnmp, USM: Introduce a reference count in struct usmStateReference This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/.
5f881d3bf24599b90d67a45cae7a3eb099cd71c9
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
usm_free_usmStateReference
usm_free_usmStateReference( void * old)
['old']
usm_free_usmStateReference(void *old) { struct usmStateReference *old_ref = (struct usmStateReference *) old; if (old_ref) { if (old_ref->usr_name_length) SNMP_FREE(old_ref->usr_name); if (old_ref->usr_engine_id_length) SNMP_FREE(old_ref->usr_engine_id); if (old_ref->usr_auth_protocol_length) SNMP_FREE(old_ref->usr_auth_protocol); if (old_ref->usr_priv_protocol_length) SNMP_FREE(old_ref->usr_priv_protocol); if (old_ref->usr_auth_key_length && old_ref->usr_auth_key) { SNMP_ZERO(old_ref->usr_auth_key, old_ref->usr_auth_key_length); SNMP_FREE(old_ref->usr_auth_key); } if (old_ref->usr_priv_key_length && old_ref->usr_priv_key) { SNMP_ZERO(old_ref->usr_priv_key, old_ref->usr_priv_key_length); SNMP_FREE(old_ref->usr_priv_key); } SNMP_ZERO(old_ref, sizeof(*old_ref)); SNMP_FREE(old_ref); } } /* end usm_free_usmStateReference() */
154
True
1
CVE-2019-20892
False
False
False
False
AV:N/AC:L/Au:S/C:N/I:N/A:P
NETWORK
LOW
SINGLE
NONE
NONE
PARTIAL
4.0
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'https://sourceforge.net/p/net-snmp/bugs/2923/', 'name': 'https://sourceforge.net/p/net-snmp/bugs/2923/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1663027', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1663027', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1877027', 'name': 'https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1877027', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/5f881d3bf24599b90d67a45cae7a3eb099cd71c9', 'name': 'https://github.com/net-snmp/net-snmp/commit/5f881d3bf24599b90d67a45cae7a3eb099cd71c9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/06/25/4', 'name': '[oss-security] 20200625 [[email protected]: Re: [scr916814] net-snmp - Perhaps only unreleased development versions; fix appears to be in v5.8.1.pre1]', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4410-1/', 'name': 'USN-4410-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://www.oracle.com/security-alerts/cpujan2021.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2021.html', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-415'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.8', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'net-snmp before 5.8.1.pre1 has a double free in usm_free_usmStateReference in snmplib/snmpusm.c via an SNMPv3 GetBulk request. NOTE: this affects net-snmp packages shipped to end users by multiple Linux distributions, but might not affect an upstream release.'}]
2021-01-20T15:15Z
2020-06-25T10:15Z
Double Free
The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.
When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
https://cwe.mitre.org/data/definitions/415.html
0
Bart Van Assche
2019-07-27 19:34:09-07:00
libsnmp, USM: Introduce a reference count in struct usmStateReference This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/.
5f881d3bf24599b90d67a45cae7a3eb099cd71c9
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
usm_malloc_usmStateReference
usm_malloc_usmStateReference( void)
['void']
usm_malloc_usmStateReference(void) { struct usmStateReference *retval = (struct usmStateReference *) calloc(1, sizeof(struct usmStateReference)); return retval; } /* end usm_malloc_usmStateReference() */
30
True
1
CVE-2020-15862
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=965166', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=965166', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://salsa.debian.org/debian/net-snmp/-/commit/fad8725402752746daf0a751dcff19eb6aeab52e', 'name': 'https://salsa.debian.org/debian/net-snmp/-/commit/fad8725402752746daf0a751dcff19eb6aeab52e', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/77f6c60f57dba0aaea5d8ef1dd94bcd0c8e6d205', 'name': 'https://github.com/net-snmp/net-snmp/commit/77f6c60f57dba0aaea5d8ef1dd94bcd0c8e6d205', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2020-15862', 'name': 'https://security-tracker.debian.org/tracker/CVE-2020-15862', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-269'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:12.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 has Improper Privilege Management because SNMP WRITE access to the EXTEND MIB provides the ability to run arbitrary commands as root.'}]
2020-09-04T14:58Z
2020-08-20T01:17Z
Improper Privilege Management
The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.
https://cwe.mitre.org/data/definitions/269.html
0
Wes Hardaker
2020-07-23 16:17:27-07:00
make the extend mib read-only by default
77f6c60f57dba0aaea5d8ef1dd94bcd0c8e6d205
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
fixExec2Error
fixExec2Error( int action , u_char * var_val , u_char var_val_type , size_t var_val_len , u_char * statP , oid * name , size_t name_len)
['action', 'var_val', 'var_val_type', 'var_val_len', 'statP', 'name', 'name_len']
fixExec2Error(int action, u_char * var_val, u_char var_val_type, size_t var_val_len, u_char * statP, oid * name, size_t name_len) { netsnmp_old_extend *exten = NULL; unsigned int idx; idx = name[name_len-1] -1; exten = &compatability_entries[ idx ]; #ifndef NETSNMP_NO_WRITE_SUPPORT switch (action) { case MODE_SET_RESERVE1: if (var_val_type != ASN_INTEGER) { snmp_log(LOG_ERR, "Wrong type != int\n"); return SNMP_ERR_WRONGTYPE; } idx = *((long *) var_val); if (idx != 1) { snmp_log(LOG_ERR, "Wrong value != 1\n"); return SNMP_ERR_WRONGVALUE; } if (!exten || !exten->efix_entry) { snmp_log(LOG_ERR, "No command to run\n"); return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; case MODE_SET_COMMIT: netsnmp_cache_check_and_reload( exten->efix_entry->cache ); } #endif /* !NETSNMP_NO_WRITE_SUPPORT */ return SNMP_ERR_NOERROR; }
153
True
1
CVE-2020-15862
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=965166', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=965166', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://salsa.debian.org/debian/net-snmp/-/commit/fad8725402752746daf0a751dcff19eb6aeab52e', 'name': 'https://salsa.debian.org/debian/net-snmp/-/commit/fad8725402752746daf0a751dcff19eb6aeab52e', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/net-snmp/net-snmp/commit/77f6c60f57dba0aaea5d8ef1dd94bcd0c8e6d205', 'name': 'https://github.com/net-snmp/net-snmp/commit/77f6c60f57dba0aaea5d8ef1dd94bcd0c8e6d205', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2020-15862', 'name': 'https://security-tracker.debian.org/tracker/CVE-2020-15862', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202008-12', 'name': 'GLSA-202008-12', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4471-1/', 'name': 'USN-4471-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200904-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-269'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:net-snmp:net-snmp:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:12.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Net-SNMP through 5.7.3 has Improper Privilege Management because SNMP WRITE access to the EXTEND MIB provides the ability to run arbitrary commands as root.'}]
2020-09-04T14:58Z
2020-08-20T01:17Z
Improper Privilege Management
The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.
https://cwe.mitre.org/data/definitions/269.html
0
Wes Hardaker
2020-07-23 16:17:27-07:00
make the extend mib read-only by default
77f6c60f57dba0aaea5d8ef1dd94bcd0c8e6d205
False
net-snmp/net-snmp
A SNMP application library, tools and daemon
2018-04-09 19:19:27
2022-08-26 13:26:52
null
net-snmp
170.0
135.0
handle_nsExtendConfigTable
handle_nsExtendConfigTable( netsnmp_mib_handler * handler , netsnmp_handler_registration * reginfo , netsnmp_agent_request_info * reqinfo , netsnmp_request_info * requests)
['handler', 'reginfo', 'reqinfo', 'requests']
handle_nsExtendConfigTable(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { netsnmp_request_info *request; netsnmp_table_request_info *table_info; netsnmp_extend *extension; extend_registration_block *eptr; int i; int need_to_validate = 0; for ( request=requests; request; request=request->next ) { if (request->processed) continue; table_info = netsnmp_extract_table_info( request ); extension = (netsnmp_extend*)netsnmp_extract_table_row_data( request ); DEBUGMSGTL(( "nsExtendTable:config", "varbind: ")); DEBUGMSGOID(("nsExtendTable:config", request->requestvb->name, request->requestvb->name_length)); DEBUGMSG(( "nsExtendTable:config", " (%s)\n", se_find_label_in_slist("agent_mode", reqinfo->mode))); switch (reqinfo->mode) { case MODE_GET: switch (table_info->colnum) { case COLUMN_EXTCFG_COMMAND: snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR, extension->command, (extension->command)?strlen(extension->command):0); break; case COLUMN_EXTCFG_ARGS: snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR, extension->args, (extension->args)?strlen(extension->args):0); break; case COLUMN_EXTCFG_INPUT: snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR, extension->input, (extension->input)?strlen(extension->input):0); break; case COLUMN_EXTCFG_CACHETIME: snmp_set_var_typed_value( request->requestvb, ASN_INTEGER, (u_char*)&extension->cache->timeout, sizeof(int)); break; case COLUMN_EXTCFG_EXECTYPE: i = ((extension->flags & NS_EXTEND_FLAGS_SHELL) ? NS_EXTEND_ETYPE_SHELL : NS_EXTEND_ETYPE_EXEC); snmp_set_var_typed_value( request->requestvb, ASN_INTEGER, (u_char*)&i, sizeof(i)); break; case COLUMN_EXTCFG_RUNTYPE: i = ((extension->flags & NS_EXTEND_FLAGS_WRITEABLE) ? NS_EXTEND_RTYPE_RWRITE : NS_EXTEND_RTYPE_RONLY); snmp_set_var_typed_value( request->requestvb, ASN_INTEGER, (u_char*)&i, sizeof(i)); break; case COLUMN_EXTCFG_STORAGE: i = ((extension->flags & NS_EXTEND_FLAGS_CONFIG) ? ST_PERMANENT : ST_VOLATILE); snmp_set_var_typed_value( request->requestvb, ASN_INTEGER, (u_char*)&i, sizeof(i)); break; case COLUMN_EXTCFG_STATUS: i = ((extension->flags & NS_EXTEND_FLAGS_ACTIVE) ? RS_ACTIVE : RS_NOTINSERVICE); snmp_set_var_typed_value( request->requestvb, ASN_INTEGER, (u_char*)&i, sizeof(i)); break; default: netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT); continue; } break; /********** * * Start of SET handling * * All config objects are potentially writable except * nsExtendStorage which is fixed as either 'permanent' * (if read from a config file) or 'volatile' (if set via SNMP) * The string-based settings of a 'permanent' entry cannot * be changed - neither can the execution or run type. * Such entries can be (temporarily) marked as inactive, * and the cache timeout adjusted, but these changes are * not persistent. * **********/ #ifndef NETSNMP_NO_WRITE_SUPPORT case MODE_SET_RESERVE1: /* * Validate the new assignments */ switch (table_info->colnum) { case COLUMN_EXTCFG_COMMAND: if (request->requestvb->type != ASN_OCTET_STR) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE); return SNMP_ERR_WRONGTYPE; } /* * Must have a full path to the command * XXX - Assumes Unix-style paths */ if (request->requestvb->val_len == 0 || request->requestvb->val.string[0] != '/') { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE); return SNMP_ERR_WRONGVALUE; } /* * XXX - need to check this file exists * (and is executable) */ if (extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) { /* * config entries are "permanent" so can't be changed */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOTWRITABLE); return SNMP_ERR_NOTWRITABLE; } break; case COLUMN_EXTCFG_ARGS: case COLUMN_EXTCFG_INPUT: if (request->requestvb->type != ASN_OCTET_STR) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE); return SNMP_ERR_WRONGTYPE; } if (extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) { /* * config entries are "permanent" so can't be changed */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOTWRITABLE); return SNMP_ERR_NOTWRITABLE; } break; case COLUMN_EXTCFG_CACHETIME: if (request->requestvb->type != ASN_INTEGER) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE); return SNMP_ERR_WRONGTYPE; } i = *request->requestvb->val.integer; /* * -1 is a special value indicating "don't cache" * [[ XXX - should this be 0 ?? ]] * Otherwise, cache times must be non-negative */ if (i < -1 ) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE); return SNMP_ERR_WRONGVALUE; } break; case COLUMN_EXTCFG_EXECTYPE: if (request->requestvb->type != ASN_INTEGER) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE); return SNMP_ERR_WRONGTYPE; } i = *request->requestvb->val.integer; if (i<1 || i>2) { /* 'exec(1)' or 'shell(2)' only */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE); return SNMP_ERR_WRONGVALUE; } if (extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) { /* * config entries are "permanent" so can't be changed */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOTWRITABLE); return SNMP_ERR_NOTWRITABLE; } break; case COLUMN_EXTCFG_RUNTYPE: if (request->requestvb->type != ASN_INTEGER) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE); return SNMP_ERR_WRONGTYPE; } /* * 'run-on-read(1)', 'run-on-set(2)' * or 'run-command(3)' only */ i = *request->requestvb->val.integer; if (i<1 || i>3) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE); return SNMP_ERR_WRONGVALUE; } /* * 'run-command(3)' can only be used with * a pre-existing 'run-on-set(2)' entry. */ if (i==3 && !(extension && (extension->flags & NS_EXTEND_FLAGS_WRITEABLE))) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_INCONSISTENTVALUE); return SNMP_ERR_INCONSISTENTVALUE; } /* * 'run-command(3)' is the only valid assignment * for permanent (i.e. config) entries */ if ((extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) && i!=3 ) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_INCONSISTENTVALUE); return SNMP_ERR_INCONSISTENTVALUE; } break; case COLUMN_EXTCFG_STATUS: if (request->requestvb->type != ASN_INTEGER) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE); return SNMP_ERR_WRONGTYPE; } i = *request->requestvb->val.integer; switch (i) { case RS_ACTIVE: case RS_NOTINSERVICE: if (!extension) { /* Must be used with existing rows */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_INCONSISTENTVALUE); return SNMP_ERR_INCONSISTENTVALUE; } break; /* OK */ case RS_CREATEANDGO: case RS_CREATEANDWAIT: if (extension) { /* Can only be used to create new rows */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_INCONSISTENTVALUE); return SNMP_ERR_INCONSISTENTVALUE; } break; case RS_DESTROY: break; default: netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE); return SNMP_ERR_WRONGVALUE; } break; default: netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOTWRITABLE); return SNMP_ERR_NOTWRITABLE; } break; case MODE_SET_RESERVE2: switch (table_info->colnum) { case COLUMN_EXTCFG_STATUS: i = *request->requestvb->val.integer; switch (i) { case RS_CREATEANDGO: case RS_CREATEANDWAIT: eptr = _find_extension_block( request->requestvb->name, request->requestvb->name_length ); extension = _new_extension( (char *) table_info->indexes->val.string, 0, eptr ); if (!extension) { /* failed */ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_RESOURCEUNAVAILABLE); return SNMP_ERR_RESOURCEUNAVAILABLE; } netsnmp_insert_table_row( request, extension->row ); } } break; case MODE_SET_FREE: switch (table_info->colnum) { case COLUMN_EXTCFG_STATUS: i = *request->requestvb->val.integer; switch (i) { case RS_CREATEANDGO: case RS_CREATEANDWAIT: eptr = _find_extension_block( request->requestvb->name, request->requestvb->name_length ); _free_extension( extension, eptr ); } } break; case MODE_SET_ACTION: switch (table_info->colnum) { case COLUMN_EXTCFG_COMMAND: extension->old_command = extension->command; extension->command = netsnmp_strdup_and_null( request->requestvb->val.string, request->requestvb->val_len); break; case COLUMN_EXTCFG_ARGS: extension->old_args = extension->args; extension->args = netsnmp_strdup_and_null( request->requestvb->val.string, request->requestvb->val_len); break; case COLUMN_EXTCFG_INPUT: extension->old_input = extension->input; extension->input = netsnmp_strdup_and_null( request->requestvb->val.string, request->requestvb->val_len); break; case COLUMN_EXTCFG_STATUS: i = *request->requestvb->val.integer; switch (i) { case RS_ACTIVE: case RS_CREATEANDGO: need_to_validate = 1; } break; } break; case MODE_SET_UNDO: switch (table_info->colnum) { case COLUMN_EXTCFG_COMMAND: if ( extension && extension->old_command ) { SNMP_FREE(extension->command); extension->command = extension->old_command; extension->old_command = NULL; } break; case COLUMN_EXTCFG_ARGS: if ( extension && extension->old_args ) { SNMP_FREE(extension->args); extension->args = extension->old_args; extension->old_args = NULL; } break; case COLUMN_EXTCFG_INPUT: if ( extension && extension->old_input ) { SNMP_FREE(extension->input); extension->input = extension->old_input; extension->old_input = NULL; } break; case COLUMN_EXTCFG_STATUS: i = *request->requestvb->val.integer; switch (i) { case RS_CREATEANDGO: case RS_CREATEANDWAIT: eptr = _find_extension_block( request->requestvb->name, request->requestvb->name_length ); _free_extension( extension, eptr ); } break; } break; case MODE_SET_COMMIT: switch (table_info->colnum) { case COLUMN_EXTCFG_CACHETIME: i = *request->requestvb->val.integer; extension->cache->timeout = i; break; case COLUMN_EXTCFG_RUNTYPE: i = *request->requestvb->val.integer; switch (i) { case 1: extension->flags &= ~NS_EXTEND_FLAGS_WRITEABLE; break; case 2: extension->flags |= NS_EXTEND_FLAGS_WRITEABLE; break; case 3: (void)netsnmp_cache_check_and_reload( extension->cache ); break; } break; case COLUMN_EXTCFG_EXECTYPE: i = *request->requestvb->val.integer; if ( i == NS_EXTEND_ETYPE_SHELL ) extension->flags |= NS_EXTEND_FLAGS_SHELL; else extension->flags &= ~NS_EXTEND_FLAGS_SHELL; break; case COLUMN_EXTCFG_STATUS: i = *request->requestvb->val.integer; switch (i) { case RS_ACTIVE: case RS_CREATEANDGO: extension->flags |= NS_EXTEND_FLAGS_ACTIVE; break; case RS_NOTINSERVICE: case RS_CREATEANDWAIT: extension->flags &= ~NS_EXTEND_FLAGS_ACTIVE; break; case RS_DESTROY: eptr = _find_extension_block( request->requestvb->name, request->requestvb->name_length ); _free_extension( extension, eptr ); break; } } break; #endif /* !NETSNMP_NO_WRITE_SUPPORT */ default: netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR); return SNMP_ERR_GENERR; } } #ifndef NETSNMP_NO_WRITE_SUPPORT /* * If we're marking a given row as active, * then we need to check that it's ready. */ if (need_to_validate) { for ( request=requests; request; request=request->next ) { if (request->processed) continue; table_info = netsnmp_extract_table_info( request ); extension = (netsnmp_extend*)netsnmp_extract_table_row_data( request ); switch (table_info->colnum) { case COLUMN_EXTCFG_STATUS: i = *request->requestvb->val.integer; if (( i == RS_ACTIVE || i == RS_CREATEANDGO ) && !(extension && extension->command && extension->command[0] == '/' /* && is_executable(extension->command) */)) { netsnmp_set_request_error(reqinfo, request, SNMP_ERR_INCONSISTENTVALUE); return SNMP_ERR_INCONSISTENTVALUE; } } } } #endif /* !NETSNMP_NO_WRITE_SUPPORT */ return SNMP_ERR_NOERROR; }
1857
True
1
CVE-2019-20915
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:N/A:P
NETWORK
MEDIUM
NONE
PARTIAL
NONE
PARTIAL
5.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
NONE
HIGH
8.1
HIGH
2.8
5.2
False
[{'url': 'https://github.com/LibreDWG/libredwg/commit/95cc9300430d35feb05b06a9badf678419463dbe', 'name': 'https://github.com/LibreDWG/libredwg/commit/95cc9300430d35feb05b06a9badf678419463dbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibreDWG/libredwg/issues/178', 'name': 'https://github.com/LibreDWG/libredwg/issues/178', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:libredwg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in GNU LibreDWG through 0.9.3. Crafted input will lead to a heap-based buffer over-read in bit_write_TF in bits.c.'}]
2020-07-22T18:19Z
2020-07-16T18:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Reini Urban
2019-12-31 08:49:07+01:00
encode: protect from stack under-flow From GH #178 fuzzing
95cc9300430d35feb05b06a9badf678419463dbe
False
LibreDWG/libredwg
Official mirror of libredwg. With CI hooks and nightly releases. PR's ok
2018-05-06 13:01:25
2022-08-15 11:59:34
https://savannah.gnu.org/projects/libredwg/
LibreDWG
508.0
150.0
bit_write_MC
bit_write_MC( Bit_Chain * dat , BITCODE_MC val)
['dat', 'val']
bit_write_MC (Bit_Chain *dat, BITCODE_MC val) { int i, j; int negative = 0; unsigned char byte[5]; BITCODE_UMC mask = 0x0000007f; BITCODE_UMC value = (BITCODE_UMC)val; if (val < 0) { negative = 1; value = (BITCODE_UMC)-val; } for (i = 4, j = 0; i >= 0; i--, j += 7) { byte[i] = (unsigned char)((value & mask) >> j); byte[i] |= 0x80; mask = mask << 7; } for (i = 0; i < 4; i++) if (byte[i] & 0x7f) break; if (byte[i] & 0x40) i--; byte[i] &= 0x7f; if (negative) byte[i] |= 0x40; for (j = 4; j >= i; j--) bit_write_RC (dat, byte[j]); }
195
True
1
CVE-2019-20915
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:N/A:P
NETWORK
MEDIUM
NONE
PARTIAL
NONE
PARTIAL
5.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
NONE
HIGH
8.1
HIGH
2.8
5.2
False
[{'url': 'https://github.com/LibreDWG/libredwg/commit/95cc9300430d35feb05b06a9badf678419463dbe', 'name': 'https://github.com/LibreDWG/libredwg/commit/95cc9300430d35feb05b06a9badf678419463dbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibreDWG/libredwg/issues/178', 'name': 'https://github.com/LibreDWG/libredwg/issues/178', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:libredwg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in GNU LibreDWG through 0.9.3. Crafted input will lead to a heap-based buffer over-read in bit_write_TF in bits.c.'}]
2020-07-22T18:19Z
2020-07-16T18:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Reini Urban
2019-12-31 08:49:07+01:00
encode: protect from stack under-flow From GH #178 fuzzing
95cc9300430d35feb05b06a9badf678419463dbe
False
LibreDWG/libredwg
Official mirror of libredwg. With CI hooks and nightly releases. PR's ok
2018-05-06 13:01:25
2022-08-15 11:59:34
https://savannah.gnu.org/projects/libredwg/
LibreDWG
508.0
150.0
bit_write_UMC
bit_write_UMC( Bit_Chain * dat , BITCODE_UMC val)
['dat', 'val']
bit_write_UMC (Bit_Chain *dat, BITCODE_UMC val) { int i, j; int negative; unsigned char byte[5]; BITCODE_UMC mask; BITCODE_UMC value; value = val; mask = 0x0000007f; for (i = 4, j = 0; i >= 0; i--, j += 7) { byte[i] = (unsigned char)((value & mask) >> j); byte[i] |= 0x80; mask = mask << 7; } for (i = 0; i < 4; i++) if (byte[i] & 0x7f) break; if (byte[i] & 0x40) i--; byte[i] &= 0x7f; for (j = 4; j >= i; j--) bit_write_RC (dat, byte[j]); }
163
True
1