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-15694
False
False
False
False
AV:N/AC:L/Au:S/C:P/I:P/A:P
NETWORK
LOW
SINGLE
PARTIAL
PARTIAL
PARTIAL
6.5
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.2
HIGH
1.2
5.9
False
[{'url': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'name': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2019/12/20/2', 'name': '[oss-security] 20191220 VNC vulnerabilities. TigerVNC security update', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'name': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00039.html', 'name': 'openSUSE-SU-2020:0087', 'refsource': 'SUSE', '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:tigervnc:tigervnc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.10.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'TigerVNC version prior to 1.10.1 is vulnerable to heap buffer overflow, which could be triggered from DecodeManager::decodeRect. Vulnerability occurs due to the signdness error in processing MemOutStream. Exploitation of this vulnerability could potentially result into remote code execution. This attack appear to be exploitable via network connectivity.'}]
2020-10-16T20:00Z
2019-12-26T15: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
Pierre Ossman
2019-09-23 11:00:17+02:00
Use size_t for lengths in stream objects Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
0943c006c7d900dfc0281639e992791d6c567438
False
CendioOssman/tigervnc
null
2014-07-03 12:14:02
2022-08-25 12:52:23
null
CendioOssman
8.0
1.0
DummyOutStream::length
DummyOutStream::length()
[]
int DummyOutStream::length() { flush(); return offset; }
14
True
1
CVE-2019-15694
False
False
False
False
AV:N/AC:L/Au:S/C:P/I:P/A:P
NETWORK
LOW
SINGLE
PARTIAL
PARTIAL
PARTIAL
6.5
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.2
HIGH
1.2
5.9
False
[{'url': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'name': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2019/12/20/2', 'name': '[oss-security] 20191220 VNC vulnerabilities. TigerVNC security update', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'name': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00039.html', 'name': 'openSUSE-SU-2020:0087', 'refsource': 'SUSE', '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:tigervnc:tigervnc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.10.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'TigerVNC version prior to 1.10.1 is vulnerable to heap buffer overflow, which could be triggered from DecodeManager::decodeRect. Vulnerability occurs due to the signdness error in processing MemOutStream. Exploitation of this vulnerability could potentially result into remote code execution. This attack appear to be exploitable via network connectivity.'}]
2020-10-16T20:00Z
2019-12-26T15: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
Pierre Ossman
2019-09-23 11:00:17+02:00
Use size_t for lengths in stream objects Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
0943c006c7d900dfc0281639e992791d6c567438
False
CendioOssman/tigervnc
null
2014-07-03 12:14:02
2022-08-25 12:52:23
null
CendioOssman
8.0
1.0
DummyOutStream::overrun
DummyOutStream::overrun( int itemSize , int nItems)
['itemSize', 'nItems']
int DummyOutStream::overrun(int itemSize, int nItems) { flush(); if (itemSize * nItems > end - ptr) nItems = (end - ptr) / itemSize; return nItems; }
39
True
1
CVE-2019-15694
False
False
False
False
AV:N/AC:L/Au:S/C:P/I:P/A:P
NETWORK
LOW
SINGLE
PARTIAL
PARTIAL
PARTIAL
6.5
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.2
HIGH
1.2
5.9
False
[{'url': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'name': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2019/12/20/2', 'name': '[oss-security] 20191220 VNC vulnerabilities. TigerVNC security update', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'name': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00039.html', 'name': 'openSUSE-SU-2020:0087', 'refsource': 'SUSE', '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:tigervnc:tigervnc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.10.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'TigerVNC version prior to 1.10.1 is vulnerable to heap buffer overflow, which could be triggered from DecodeManager::decodeRect. Vulnerability occurs due to the signdness error in processing MemOutStream. Exploitation of this vulnerability could potentially result into remote code execution. This attack appear to be exploitable via network connectivity.'}]
2020-10-16T20:00Z
2019-12-26T15: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
Pierre Ossman
2019-09-23 11:00:17+02:00
Use size_t for lengths in stream objects Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
0943c006c7d900dfc0281639e992791d6c567438
False
CendioOssman/tigervnc
null
2014-07-03 12:14:02
2022-08-25 12:52:23
null
CendioOssman
8.0
1.0
RegKey::getBinary
RegKey::getBinary( const TCHAR * valname , void ** data , int * length , void * def , int deflen) const
['valname', 'data', 'length', 'def', 'deflen']
void RegKey::getBinary(const TCHAR* valname, void** data, int* length, void* def, int deflen) const { try { getBinary(valname, data, length); } catch(rdr::Exception&) { if (deflen) { *data = new char[deflen]; memcpy(*data, def, deflen); } else *data = 0; *length = deflen; } }
84
True
1
CVE-2019-15694
False
False
False
False
AV:N/AC:L/Au:S/C:P/I:P/A:P
NETWORK
LOW
SINGLE
PARTIAL
PARTIAL
PARTIAL
6.5
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.2
HIGH
1.2
5.9
False
[{'url': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'name': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2019/12/20/2', 'name': '[oss-security] 20191220 VNC vulnerabilities. TigerVNC security update', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'name': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00039.html', 'name': 'openSUSE-SU-2020:0087', 'refsource': 'SUSE', '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:tigervnc:tigervnc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.10.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'TigerVNC version prior to 1.10.1 is vulnerable to heap buffer overflow, which could be triggered from DecodeManager::decodeRect. Vulnerability occurs due to the signdness error in processing MemOutStream. Exploitation of this vulnerability could potentially result into remote code execution. This attack appear to be exploitable via network connectivity.'}]
2020-10-16T20:00Z
2019-12-26T15: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
Pierre Ossman
2019-09-23 11:00:17+02:00
Use size_t for lengths in stream objects Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
0943c006c7d900dfc0281639e992791d6c567438
False
CendioOssman/tigervnc
null
2014-07-03 12:14:02
2022-08-25 12:52:23
null
CendioOssman
8.0
1.0
RegKey::getBinary
RegKey::getBinary( const TCHAR * valname , void ** data , int * length) const
['valname', 'data', 'length']
void RegKey::getBinary(const TCHAR* valname, void** data, int* length) const { TCharArray hex(getRepresentation(valname)); if (!rdr::HexInStream::hexStrToBin(CStr(hex.buf), (char**)data, length)) throw rdr::Exception("getBinary failed"); }
62
True
1
CVE-2019-15694
False
False
False
False
AV:N/AC:L/Au:S/C:P/I:P/A:P
NETWORK
LOW
SINGLE
PARTIAL
PARTIAL
PARTIAL
6.5
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.2
HIGH
1.2
5.9
False
[{'url': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'name': 'https://github.com/TigerVNC/tigervnc/releases/tag/v1.10.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2019/12/20/2', 'name': '[oss-security] 20191220 VNC vulnerabilities. TigerVNC security update', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'name': 'https://github.com/CendioOssman/tigervnc/commit/0943c006c7d900dfc0281639e992791d6c567438', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00039.html', 'name': 'openSUSE-SU-2020:0087', 'refsource': 'SUSE', '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:tigervnc:tigervnc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.10.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'TigerVNC version prior to 1.10.1 is vulnerable to heap buffer overflow, which could be triggered from DecodeManager::decodeRect. Vulnerability occurs due to the signdness error in processing MemOutStream. Exploitation of this vulnerability could potentially result into remote code execution. This attack appear to be exploitable via network connectivity.'}]
2020-10-16T20:00Z
2019-12-26T15: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
Pierre Ossman
2019-09-23 11:00:17+02:00
Use size_t for lengths in stream objects Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
0943c006c7d900dfc0281639e992791d6c567438
False
CendioOssman/tigervnc
null
2014-07-03 12:14:02
2022-08-25 12:52:23
null
CendioOssman
8.0
1.0
RegKey::setBinary
RegKey::setBinary( const TCHAR * valname , const void * value , int length) const
['valname', 'value', 'length']
void RegKey::setBinary(const TCHAR* valname, const void* value, int length) const { LONG result = RegSetValueEx(key, valname, 0, REG_BINARY, (const BYTE*)value, length); if (result != ERROR_SUCCESS) throw rdr::SystemException("setBinary", result); }
59
True
1
CVE-2019-15901
False
False
False
False
AV:N/AC:L/Au:S/C:C/I:C/A:C
NETWORK
LOW
SINGLE
COMPLETE
COMPLETE
COMPLETE
9.0
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://github.com/slicer69/doas/pull/23', 'name': 'https://github.com/slicer69/doas/pull/23', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/6cf0236184ff6304bf5e267ccf7ef02874069697', 'name': 'https://github.com/slicer69/doas/commit/6cf0236184ff6304bf5e267ccf7ef02874069697', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-269'}]}]
HIGH
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. A setusercontext(3) call with flags to change the UID, primary GID, and secondary GIDs was replaced (on certain platforms: Linux and possibly NetBSD) with a single setuid(2) call. This resulted in neither changing the group id nor initializing secondary group ids.'}]
2020-08-24T17:37Z
2019-10-18T16: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
Duncan Overbruck
2019-09-03 00:41:14+02:00
fix the setusercontext(3) workaround Seeing this being used on even more system like Illumos with this ugly and security critical bug open makes me cringe every time I check if it was finally fixed. I reported it directly to the maintainer in 2017. I reported it to [email protected] without a response.
6cf0236184ff6304bf5e267ccf7ef02874069697
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
main
main( int argc , char ** argv)
['argc', 'argv']
main(int argc, char **argv) { const char *safepath = SAFE_PATH; const char *confpath = NULL; char *shargv[] = { NULL, NULL }; char *sh; const char *cmd; char cmdline[LINE_MAX]; char myname[_PW_NAME_LEN + 1]; struct passwd *original_pw, *target_pw; struct rule *rule; uid_t uid; uid_t target = 0; gid_t groups[NGROUPS_MAX + 1]; int ngroups; int i, ch; int sflag = 0; int nflag = 0; char cwdpath[PATH_MAX]; const char *cwd; char *login_style = NULL; char **envp; #ifndef linux setprogname("doas"); #endif #ifndef linux closefrom(STDERR_FILENO + 1); #endif uid = getuid(); while ((ch = getopt(argc, argv, "a:C:nsu:")) != -1) { /* while ((ch = getopt(argc, argv, "a:C:Lnsu:")) != -1) { */ switch (ch) { case 'a': login_style = optarg; break; case 'C': confpath = optarg; break; /* case 'L': i = open("/dev/tty", O_RDWR); if (i != -1) ioctl(i, TIOCCLRVERAUTH); exit(i != -1); */ case 'u': if (parseuid(optarg, &target) != 0) errx(1, "unknown user"); break; case 'n': nflag = 1; break; case 's': sflag = 1; break; default: usage(); break; } } argv += optind; argc -= optind; if (confpath) { if (sflag) usage(); } else if ((!sflag && !argc) || (sflag && argc)) usage(); original_pw = getpwuid(uid); if (! original_pw) err(1, "getpwuid failed"); if (strlcpy(myname, original_pw->pw_name, sizeof(myname)) >= sizeof(myname)) errx(1, "pw_name too long"); ngroups = getgroups(NGROUPS_MAX, groups); if (ngroups == -1) err(1, "can't get groups"); groups[ngroups++] = getgid(); if (sflag) { sh = getenv("SHELL"); if (sh == NULL || *sh == '\0') { shargv[0] = strdup(original_pw->pw_shell); if (shargv[0] == NULL) err(1, NULL); } else shargv[0] = sh; argv = shargv; argc = 1; } if (confpath) { checkconfig(confpath, argc, argv, uid, groups, ngroups, target); exit(1); /* fail safe */ } if (geteuid()) errx(1, "not installed setuid"); parseconfig(DOAS_CONF, 1); /* cmdline is used only for logging, no need to abort on truncate */ (void)strlcpy(cmdline, argv[0], sizeof(cmdline)); for (i = 1; i < argc; i++) { if (strlcat(cmdline, " ", sizeof(cmdline)) >= sizeof(cmdline)) break; if (strlcat(cmdline, argv[i], sizeof(cmdline)) >= sizeof(cmdline)) break; } cmd = argv[0]; if (!permit(uid, groups, ngroups, &rule, target, cmd, (const char **)argv + 1)) { syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed command for %s: %s", myname, cmdline); errc(1, EPERM, NULL); } if (!(rule->options & NOPASS)) { if (nflag) errx(1, "Authorization required"); #if defined(USE_BSD_AUTH) authuser(myname, login_style, rule->options & PERSIST); #elif defined(USE_PAM) #define PAM_END(msg) do { \ syslog(LOG_ERR, "%s: %s", msg, pam_strerror(pamh, pam_err)); \ warnx("%s: %s", msg, pam_strerror(pamh, pam_err)); \ pam_end(pamh, pam_err); \ exit(EXIT_FAILURE); \ } while (/*CONSTCOND*/0) pam_handle_t *pamh = NULL; int pam_err; /* #ifndef linux */ int temp_stdin; /* openpam_ttyconv checks if stdin is a terminal and * if it is then does not bother to open /dev/tty. * The result is that PAM writes the password prompt * directly to stdout. In scenarios where stdin is a * terminal, but stdout is redirected to a file * e.g. by running doas ls &> ls.out interactively, * the password prompt gets written to ls.out as well. * By closing stdin first we forces PAM to read/write * to/from the terminal directly. We restore stdin * after authenticating. */ temp_stdin = dup(STDIN_FILENO); if (temp_stdin == -1) err(1, "dup"); close(STDIN_FILENO); /* #else */ /* force password prompt to display on stderr, not stdout */ int temp_stdout = dup(1); if (temp_stdout == -1) err(1, "dup"); close(1); if (dup2(2, 1) == -1) err(1, "dup2"); /* #endif */ pam_err = pam_start("doas", myname, &pamc, &pamh); if (pam_err != PAM_SUCCESS) { if (pamh != NULL) PAM_END("pam_start"); syslog(LOG_ERR, "pam_start failed: %s", pam_strerror(pamh, pam_err)); errx(EXIT_FAILURE, "pam_start failed"); } switch (pam_err = pam_authenticate(pamh, PAM_SILENT)) { case PAM_SUCCESS: switch (pam_err = pam_acct_mgmt(pamh, PAM_SILENT)) { case PAM_SUCCESS: break; case PAM_NEW_AUTHTOK_REQD: pam_err = pam_chauthtok(pamh, PAM_SILENT|PAM_CHANGE_EXPIRED_AUTHTOK); if (pam_err != PAM_SUCCESS) PAM_END("pam_chauthtok"); break; case PAM_AUTH_ERR: case PAM_USER_UNKNOWN: case PAM_MAXTRIES: syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname); errx(EXIT_FAILURE, "second authentication failed"); break; default: PAM_END("pam_acct_mgmt"); break; } break; case PAM_AUTH_ERR: case PAM_USER_UNKNOWN: case PAM_MAXTRIES: syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname); errx(EXIT_FAILURE, "authentication failed"); break; default: PAM_END("pam_authenticate"); break; } pam_end(pamh, pam_err); #ifndef linux /* Re-establish stdin */ if (dup2(temp_stdin, STDIN_FILENO) == -1) err(1, "dup2"); close(temp_stdin); #else /* Re-establish stdout */ close(1); if (dup2(temp_stdout, 1) == -1) err(1, "dup2"); #endif #else #error No auth module! #endif } /* if (pledge("stdio rpath getpw exec id", NULL) == -1) err(1, "pledge"); */ target_pw = getpwuid(target); if (! target_pw) errx(1, "no passwd entry for target"); #if defined(HAVE_LOGIN_CAP_H) if (setusercontext(NULL, target_pw, target, LOGIN_SETGROUP | LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK | LOGIN_SETUSER) != 0) errx(1, "failed to set user context for target"); #endif /* if (pledge("stdio rpath exec", NULL) == -1) err(1, "pledge"); */ if (getcwd(cwdpath, sizeof(cwdpath)) == NULL) cwd = "(failed)"; else cwd = cwdpath; /* if (pledge("stdio exec", NULL) == -1) err(1, "pledge"); */ #ifndef HAVE_LOGIN_CAP_H /* If we effectively are root, set the UID to actually be root to avoid permission errors. */ if (target != 0) setuid(target); if ( geteuid() == ROOT_UID ) setuid(ROOT_UID); #endif syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s", myname, cmdline, target_pw->pw_name, cwd); envp = prepenv(rule, original_pw, target_pw); if (rule->cmd) { if (setenv("PATH", safepath, 1) == -1) err(1, "failed to set PATH '%s'", safepath); } execvpe(cmd, argv, envp); if (errno == ENOENT) errx(1, "%s: command not found", cmd); err(1, "%s", cmd); }
1178
True
1
CVE-2019-15900
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'name': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}, {'lang': 'en', 'value': 'CWE-863'}, {'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), sscanf was used without checking for error cases. Instead, the uninitialized variable errstr was checked and in some cases returned success even if sscanf failed. The result was that, instead of reporting that the supplied username or group name did not exist, it would execute the command as root.'}]
2021-07-21T11:39Z
2019-10-18T16:15Z
Improper Check for Unusual or Exceptional Conditions
The software does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.
The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability. Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.
https://cwe.mitre.org/data/definitions/754.html
0
Jesse Smith
2019-09-03 11:42:27-03:00
Added optimization to Makefile (can be set/overruled using OPT). Added flag to display all warnings during compiling. Added status checks when parsing user/group IDs for Linux. Make sure Linux drops original user's groups when running as another user.
2f83222829448e5bc4c9391d607ec265a1e06531
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
parsegid
parsegid( const char * s , gid_t * gid)
['s', 'gid']
parsegid(const char *s, gid_t *gid) { struct group *gr; const char *errstr; if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *gid = strtonum(s, 0, GID_MAX, &errstr); #else sscanf(s, "%d", gid); #endif if (errstr) return -1; return 0; }
83
True
1
CVE-2019-15900
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'name': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}, {'lang': 'en', 'value': 'CWE-863'}, {'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), sscanf was used without checking for error cases. Instead, the uninitialized variable errstr was checked and in some cases returned success even if sscanf failed. The result was that, instead of reporting that the supplied username or group name did not exist, it would execute the command as root.'}]
2021-07-21T11:39Z
2019-10-18T16:15Z
Incorrect Authorization
The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource. When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.
https://cwe.mitre.org/data/definitions/863.html
0
Jesse Smith
2019-09-03 11:42:27-03:00
Added optimization to Makefile (can be set/overruled using OPT). Added flag to display all warnings during compiling. Added status checks when parsing user/group IDs for Linux. Make sure Linux drops original user's groups when running as another user.
2f83222829448e5bc4c9391d607ec265a1e06531
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
parsegid
parsegid( const char * s , gid_t * gid)
['s', 'gid']
parsegid(const char *s, gid_t *gid) { struct group *gr; const char *errstr; if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *gid = strtonum(s, 0, GID_MAX, &errstr); #else sscanf(s, "%d", gid); #endif if (errstr) return -1; return 0; }
83
True
1
CVE-2019-15900
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'name': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}, {'lang': 'en', 'value': 'CWE-863'}, {'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), sscanf was used without checking for error cases. Instead, the uninitialized variable errstr was checked and in some cases returned success even if sscanf failed. The result was that, instead of reporting that the supplied username or group name did not exist, it would execute the command as root.'}]
2021-07-21T11:39Z
2019-10-18T16:15Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Jesse Smith
2019-09-03 11:42:27-03:00
Added optimization to Makefile (can be set/overruled using OPT). Added flag to display all warnings during compiling. Added status checks when parsing user/group IDs for Linux. Make sure Linux drops original user's groups when running as another user.
2f83222829448e5bc4c9391d607ec265a1e06531
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
parsegid
parsegid( const char * s , gid_t * gid)
['s', 'gid']
parsegid(const char *s, gid_t *gid) { struct group *gr; const char *errstr; if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *gid = strtonum(s, 0, GID_MAX, &errstr); #else sscanf(s, "%d", gid); #endif if (errstr) return -1; return 0; }
83
True
1
CVE-2019-15900
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'name': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}, {'lang': 'en', 'value': 'CWE-863'}, {'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), sscanf was used without checking for error cases. Instead, the uninitialized variable errstr was checked and in some cases returned success even if sscanf failed. The result was that, instead of reporting that the supplied username or group name did not exist, it would execute the command as root.'}]
2021-07-21T11:39Z
2019-10-18T16:15Z
Improper Check for Unusual or Exceptional Conditions
The software does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.
The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability. Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.
https://cwe.mitre.org/data/definitions/754.html
0
Jesse Smith
2019-09-03 11:42:27-03:00
Added optimization to Makefile (can be set/overruled using OPT). Added flag to display all warnings during compiling. Added status checks when parsing user/group IDs for Linux. Make sure Linux drops original user's groups when running as another user.
2f83222829448e5bc4c9391d607ec265a1e06531
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
parseuid
parseuid( const char * s , uid_t * uid)
['s', 'uid']
parseuid(const char *s, uid_t *uid) { struct passwd *pw; const char *errstr; if ((pw = getpwnam(s)) != NULL) { *uid = pw->pw_uid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *uid = strtonum(s, 0, UID_MAX, &errstr); #else sscanf(s, "%d", uid); #endif if (errstr) return -1; return 0; }
83
True
1
CVE-2019-15900
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'name': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}, {'lang': 'en', 'value': 'CWE-863'}, {'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), sscanf was used without checking for error cases. Instead, the uninitialized variable errstr was checked and in some cases returned success even if sscanf failed. The result was that, instead of reporting that the supplied username or group name did not exist, it would execute the command as root.'}]
2021-07-21T11:39Z
2019-10-18T16:15Z
Incorrect Authorization
The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource. When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.
https://cwe.mitre.org/data/definitions/863.html
0
Jesse Smith
2019-09-03 11:42:27-03:00
Added optimization to Makefile (can be set/overruled using OPT). Added flag to display all warnings during compiling. Added status checks when parsing user/group IDs for Linux. Make sure Linux drops original user's groups when running as another user.
2f83222829448e5bc4c9391d607ec265a1e06531
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
parseuid
parseuid( const char * s , uid_t * uid)
['s', 'uid']
parseuid(const char *s, uid_t *uid) { struct passwd *pw; const char *errstr; if ((pw = getpwnam(s)) != NULL) { *uid = pw->pw_uid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *uid = strtonum(s, 0, UID_MAX, &errstr); #else sscanf(s, "%d", uid); #endif if (errstr) return -1; return 0; }
83
True
1
CVE-2019-15900
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/slicer69/doas/compare/6.1p1...6.2', 'name': 'https://github.com/slicer69/doas/compare/6.1p1...6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'name': 'https://github.com/slicer69/doas/commit/2f83222829448e5bc4c9391d607ec265a1e06531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}, {'lang': 'en', 'value': 'CWE-863'}, {'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:doas_project:doas:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. On platforms without strtonum(3), sscanf was used without checking for error cases. Instead, the uninitialized variable errstr was checked and in some cases returned success even if sscanf failed. The result was that, instead of reporting that the supplied username or group name did not exist, it would execute the command as root.'}]
2021-07-21T11:39Z
2019-10-18T16:15Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Jesse Smith
2019-09-03 11:42:27-03:00
Added optimization to Makefile (can be set/overruled using OPT). Added flag to display all warnings during compiling. Added status checks when parsing user/group IDs for Linux. Make sure Linux drops original user's groups when running as another user.
2f83222829448e5bc4c9391d607ec265a1e06531
False
slicer69/doas
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
2016-06-22 15:16:18
2022-06-07 01:50:43
slicer69
642.0
45.0
parseuid
parseuid( const char * s , uid_t * uid)
['s', 'uid']
parseuid(const char *s, uid_t *uid) { struct passwd *pw; const char *errstr; if ((pw = getpwnam(s)) != NULL) { *uid = pw->pw_uid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *uid = strtonum(s, 0, UID_MAX, &errstr); #else sscanf(s, "%d", uid); #endif if (errstr) return -1; return 0; }
83
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06: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
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
doProlog
doProlog( XML_Parser parser , const ENCODING * enc , const char * s , const char * end , int tok , const char * next , const char ** nextPtr , XML_Bool haveMore)
['parser', 'enc', 's', 'end', 'tok', 'next', 'nextPtr', 'haveMore']
doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr, XML_Bool haveMore) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = {ASCII_HASH, '\0'}; #endif /* XML_DTD */ static const XML_Char atypeCDATA[] = {ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0'}; static const XML_Char atypeID[] = {ASCII_I, ASCII_D, '\0'}; static const XML_Char atypeIDREF[] = {ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0'}; static const XML_Char atypeIDREFS[] = {ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0'}; static const XML_Char atypeENTITY[] = {ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0'}; static const XML_Char atypeENTITIES[] = {ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, '\0'}; static const XML_Char atypeNMTOKEN[] = {ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0'}; static const XML_Char atypeNMTOKENS[] = {ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, '\0'}; static const XML_Char notationPrefix[] = {ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, ASCII_LPAREN, '\0'}; static const XML_Char enumValueSep[] = {ASCII_PIPE, '\0'}; static const XML_Char enumValueStart[] = {ASCII_LPAREN, '\0'}; /* save one level of indirection */ DTD *const dtd = parser->m_dtd; const char **eventPP; const char **eventEndPP; enum XML_Content_Quant quant; if (enc == parser->m_encoding) { eventPP = &parser->m_eventPtr; eventEndPP = &parser->m_eventEndPtr; } else { eventPP = &(parser->m_openInternalEntities->internalEventPtr); eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); } for (;;) { int role; XML_Bool handleDefault = XML_TRUE; *eventPP = s; *eventEndPP = next; if (tok <= 0) { if (haveMore && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case -XML_TOK_PROLOG_S: tok = -tok; break; case XML_TOK_NONE: #ifdef XML_DTD /* for internal PE NOT referenced between declarations */ if (enc != parser->m_encoding && ! parser->m_openInternalEntities->betweenDecl) { *nextPtr = s; return XML_ERROR_NONE; } /* WFC: PE Between Declarations - must check that PE contains complete markup, not only for external PEs, but also for internal PEs if the reference occurs between declarations. */ if (parser->m_isParamEntity || enc != parser->m_encoding) { if (XmlTokenRole(&parser->m_prologState, XML_TOK_NONE, end, end, enc) == XML_ROLE_ERROR) return XML_ERROR_INCOMPLETE_PE; *nextPtr = s; return XML_ERROR_NONE; } #endif /* XML_DTD */ return XML_ERROR_NO_ELEMENTS; default: tok = -tok; next = end; break; } } role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc); switch (role) { case XML_ROLE_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 0, s, next); if (result != XML_ERROR_NONE) return result; enc = parser->m_encoding; handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_NAME: if (parser->m_startDoctypeDeclHandler) { parser->m_doctypeName = poolStoreString(&parser->m_tempPool, enc, s, next); if (! parser->m_doctypeName) return XML_ERROR_NO_MEMORY; poolFinish(&parser->m_tempPool); parser->m_doctypePubid = NULL; handleDefault = XML_FALSE; } parser->m_doctypeSysid = NULL; /* always initialize to NULL */ break; case XML_ROLE_DOCTYPE_INTERNAL_SUBSET: if (parser->m_startDoctypeDeclHandler) { parser->m_startDoctypeDeclHandler( parser->m_handlerArg, parser->m_doctypeName, parser->m_doctypeSysid, parser->m_doctypePubid, 1); parser->m_doctypeName = NULL; poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } break; #ifdef XML_DTD case XML_ROLE_TEXT_DECL: { enum XML_Error result = processXmlDecl(parser, 1, s, next); if (result != XML_ERROR_NONE) return result; enc = parser->m_encoding; handleDefault = XML_FALSE; } break; #endif /* XML_DTD */ case XML_ROLE_DOCTYPE_PUBLIC_ID: #ifdef XML_DTD parser->m_useForeignDTD = XML_FALSE; parser->m_declEntity = (ENTITY *)lookup( parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_startDoctypeDeclHandler) { XML_Char *pubId; if (! XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; pubId = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! pubId) return XML_ERROR_NO_MEMORY; normalizePublicId(pubId); poolFinish(&parser->m_tempPool); parser->m_doctypePubid = pubId; handleDefault = XML_FALSE; goto alreadyChecked; } /* fall through */ case XML_ROLE_ENTITY_PUBLIC_ID: if (! XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; alreadyChecked: if (dtd->keepProcessing && parser->m_declEntity) { XML_Char *tem = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); parser->m_declEntity->publicId = tem; poolFinish(&dtd->pool); /* Don't suppress the default handler if we fell through from * the XML_ROLE_DOCTYPE_PUBLIC_ID case. */ if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_PUBLIC_ID) handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_CLOSE: if (parser->m_doctypeName) { parser->m_startDoctypeDeclHandler( parser->m_handlerArg, parser->m_doctypeName, parser->m_doctypeSysid, parser->m_doctypePubid, 0); poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } /* parser->m_doctypeSysid will be non-NULL in the case of a previous XML_ROLE_DOCTYPE_SYSTEM_ID, even if parser->m_startDoctypeDeclHandler was not set, indicating an external subset */ #ifdef XML_DTD if (parser->m_doctypeSysid || parser->m_useForeignDTD) { XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! entity) { /* The external subset name "#" will have already been * inserted into the hash table at the start of the * external entity parsing, so no allocation will happen * and lookup() cannot fail. */ return XML_ERROR_NO_MEMORY; /* LCOV_EXCL_LINE */ } if (parser->m_useForeignDTD) entity->base = parser->m_curBase; dtd->paramEntityRead = XML_FALSE; if (! parser->m_externalEntityRefHandler( parser->m_externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { if (! dtd->standalone && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; } /* if we didn't read the foreign DTD then this means that there is no external subset and we must reset dtd->hasParamEntityRefs */ else if (! parser->m_doctypeSysid) dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } parser->m_useForeignDTD = XML_FALSE; } #endif /* XML_DTD */ if (parser->m_endDoctypeDeclHandler) { parser->m_endDoctypeDeclHandler(parser->m_handlerArg); handleDefault = XML_FALSE; } break; case XML_ROLE_INSTANCE_START: #ifdef XML_DTD /* if there is no DOCTYPE declaration then now is the last chance to read the foreign DTD */ if (parser->m_useForeignDTD) { XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! entity) return XML_ERROR_NO_MEMORY; entity->base = parser->m_curBase; dtd->paramEntityRead = XML_FALSE; if (! parser->m_externalEntityRefHandler( parser->m_externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { if (! dtd->standalone && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; } /* if we didn't read the foreign DTD then this means that there is no external subset and we must reset dtd->hasParamEntityRefs */ else dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } } #endif /* XML_DTD */ parser->m_processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); case XML_ROLE_ATTLIST_ELEMENT_NAME: parser->m_declElementType = getElementType(parser, enc, s, next); if (! parser->m_declElementType) return XML_ERROR_NO_MEMORY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_NAME: parser->m_declAttributeId = getAttributeId(parser, enc, s, next); if (! parser->m_declAttributeId) return XML_ERROR_NO_MEMORY; parser->m_declAttributeIsCdata = XML_FALSE; parser->m_declAttributeType = NULL; parser->m_declAttributeIsId = XML_FALSE; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_CDATA: parser->m_declAttributeIsCdata = XML_TRUE; parser->m_declAttributeType = atypeCDATA; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ID: parser->m_declAttributeIsId = XML_TRUE; parser->m_declAttributeType = atypeID; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREF: parser->m_declAttributeType = atypeIDREF; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: parser->m_declAttributeType = atypeIDREFS; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: parser->m_declAttributeType = atypeENTITY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: parser->m_declAttributeType = atypeENTITIES; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: parser->m_declAttributeType = atypeNMTOKEN; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: parser->m_declAttributeType = atypeNMTOKENS; checkAttListDeclHandler: if (dtd->keepProcessing && parser->m_attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTRIBUTE_ENUM_VALUE: case XML_ROLE_ATTRIBUTE_NOTATION_VALUE: if (dtd->keepProcessing && parser->m_attlistDeclHandler) { const XML_Char *prefix; if (parser->m_declAttributeType) { prefix = enumValueSep; } else { prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE ? notationPrefix : enumValueStart); } if (! poolAppendString(&parser->m_tempPool, prefix)) return XML_ERROR_NO_MEMORY; if (! poolAppend(&parser->m_tempPool, enc, s, next)) return XML_ERROR_NO_MEMORY; parser->m_declAttributeType = parser->m_tempPool.start; handleDefault = XML_FALSE; } break; case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { if (! defineAttribute(parser->m_declElementType, parser->m_declAttributeId, parser->m_declAttributeIsCdata, parser->m_declAttributeIsId, 0, parser)) return XML_ERROR_NO_MEMORY; if (parser->m_attlistDeclHandler && parser->m_declAttributeType) { if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN) || (*parser->m_declAttributeType == XML_T(ASCII_N) && parser->m_declAttributeType[1] == XML_T(ASCII_O))) { /* Enumerated or Notation type */ if (! poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN)) || ! poolAppendChar(&parser->m_tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; parser->m_declAttributeType = parser->m_tempPool.start; poolFinish(&parser->m_tempPool); } *eventEndPP = s; parser->m_attlistDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, parser->m_declAttributeId->name, parser->m_declAttributeType, 0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE); poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: case XML_ROLE_FIXED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { const XML_Char *attVal; enum XML_Error result = storeAttributeValue( parser, enc, parser->m_declAttributeIsCdata, s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool); if (result) return result; attVal = poolStart(&dtd->pool); poolFinish(&dtd->pool); /* ID attributes aren't allowed to have a default */ if (! defineAttribute( parser->m_declElementType, parser->m_declAttributeId, parser->m_declAttributeIsCdata, XML_FALSE, attVal, parser)) return XML_ERROR_NO_MEMORY; if (parser->m_attlistDeclHandler && parser->m_declAttributeType) { if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN) || (*parser->m_declAttributeType == XML_T(ASCII_N) && parser->m_declAttributeType[1] == XML_T(ASCII_O))) { /* Enumerated or Notation type */ if (! poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN)) || ! poolAppendChar(&parser->m_tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; parser->m_declAttributeType = parser->m_tempPool.start; poolFinish(&parser->m_tempPool); } *eventEndPP = s; parser->m_attlistDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, parser->m_declAttributeId->name, parser->m_declAttributeType, attVal, role == XML_ROLE_FIXED_ATTRIBUTE_VALUE); poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_ENTITY_VALUE: if (dtd->keepProcessing) { enum XML_Error result = storeEntityValue( parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (parser->m_declEntity) { parser->m_declEntity->textPtr = poolStart(&dtd->entityValuePool); parser->m_declEntity->textLen = (int)(poolLength(&dtd->entityValuePool)); poolFinish(&dtd->entityValuePool); if (parser->m_entityDeclHandler) { *eventEndPP = s; parser->m_entityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, parser->m_declEntity->is_param, parser->m_declEntity->textPtr, parser->m_declEntity->textLen, parser->m_curBase, 0, 0, 0); handleDefault = XML_FALSE; } } else poolDiscard(&dtd->entityValuePool); if (result != XML_ERROR_NONE) return result; } break; case XML_ROLE_DOCTYPE_SYSTEM_ID: #ifdef XML_DTD parser->m_useForeignDTD = XML_FALSE; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_startDoctypeDeclHandler) { parser->m_doctypeSysid = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (parser->m_doctypeSysid == NULL) return XML_ERROR_NO_MEMORY; poolFinish(&parser->m_tempPool); handleDefault = XML_FALSE; } #ifdef XML_DTD else /* use externalSubsetName to make parser->m_doctypeSysid non-NULL for the case where no parser->m_startDoctypeDeclHandler is set */ parser->m_doctypeSysid = externalSubsetName; #endif /* XML_DTD */ if (! dtd->standalone #ifdef XML_DTD && ! parser->m_paramEntityParsing #endif /* XML_DTD */ && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; #ifndef XML_DTD break; #else /* XML_DTD */ if (! parser->m_declEntity) { parser->m_declEntity = (ENTITY *)lookup( parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; parser->m_declEntity->publicId = NULL; } #endif /* XML_DTD */ /* fall through */ case XML_ROLE_ENTITY_SYSTEM_ID: if (dtd->keepProcessing && parser->m_declEntity) { parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! parser->m_declEntity->systemId) return XML_ERROR_NO_MEMORY; parser->m_declEntity->base = parser->m_curBase; poolFinish(&dtd->pool); /* Don't suppress the default handler if we fell through from * the XML_ROLE_DOCTYPE_SYSTEM_ID case. */ if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_SYSTEM_ID) handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_COMPLETE: if (dtd->keepProcessing && parser->m_declEntity && parser->m_entityDeclHandler) { *eventEndPP = s; parser->m_entityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, parser->m_declEntity->is_param, 0, 0, parser->m_declEntity->base, parser->m_declEntity->systemId, parser->m_declEntity->publicId, 0); handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_NOTATION_NAME: if (dtd->keepProcessing && parser->m_declEntity) { parser->m_declEntity->notation = poolStoreString(&dtd->pool, enc, s, next); if (! parser->m_declEntity->notation) return XML_ERROR_NO_MEMORY; poolFinish(&dtd->pool); if (parser->m_unparsedEntityDeclHandler) { *eventEndPP = s; parser->m_unparsedEntityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, parser->m_declEntity->base, parser->m_declEntity->systemId, parser->m_declEntity->publicId, parser->m_declEntity->notation); handleDefault = XML_FALSE; } else if (parser->m_entityDeclHandler) { *eventEndPP = s; parser->m_entityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, 0, 0, 0, parser->m_declEntity->base, parser->m_declEntity->systemId, parser->m_declEntity->publicId, parser->m_declEntity->notation); handleDefault = XML_FALSE; } } break; case XML_ROLE_GENERAL_ENTITY_NAME: { if (XmlPredefinedEntityName(enc, s, next)) { parser->m_declEntity = NULL; break; } if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (! name) return XML_ERROR_NO_MEMORY; parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; if (parser->m_declEntity->name != name) { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } else { poolFinish(&dtd->pool); parser->m_declEntity->publicId = NULL; parser->m_declEntity->is_param = XML_FALSE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ parser->m_declEntity->is_internal = ! (parser->m_parentParser || parser->m_openInternalEntities); if (parser->m_entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } } break; case XML_ROLE_PARAM_ENTITY_NAME: #ifdef XML_DTD if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (! name) return XML_ERROR_NO_MEMORY; parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; if (parser->m_declEntity->name != name) { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } else { poolFinish(&dtd->pool); parser->m_declEntity->publicId = NULL; parser->m_declEntity->is_param = XML_TRUE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ parser->m_declEntity->is_internal = ! (parser->m_parentParser || parser->m_openInternalEntities); if (parser->m_entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } #else /* not XML_DTD */ parser->m_declEntity = NULL; #endif /* XML_DTD */ break; case XML_ROLE_NOTATION_NAME: parser->m_declNotationPublicId = NULL; parser->m_declNotationName = NULL; if (parser->m_notationDeclHandler) { parser->m_declNotationName = poolStoreString(&parser->m_tempPool, enc, s, next); if (! parser->m_declNotationName) return XML_ERROR_NO_MEMORY; poolFinish(&parser->m_tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_PUBLIC_ID: if (! XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; if (parser ->m_declNotationName) { /* means m_notationDeclHandler != NULL */ XML_Char *tem = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); parser->m_declNotationPublicId = tem; poolFinish(&parser->m_tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_SYSTEM_ID: if (parser->m_declNotationName && parser->m_notationDeclHandler) { const XML_Char *systemId = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! systemId) return XML_ERROR_NO_MEMORY; *eventEndPP = s; parser->m_notationDeclHandler( parser->m_handlerArg, parser->m_declNotationName, parser->m_curBase, systemId, parser->m_declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&parser->m_tempPool); break; case XML_ROLE_NOTATION_NO_SYSTEM_ID: if (parser->m_declNotationPublicId && parser->m_notationDeclHandler) { *eventEndPP = s; parser->m_notationDeclHandler( parser->m_handlerArg, parser->m_declNotationName, parser->m_curBase, 0, parser->m_declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&parser->m_tempPool); break; case XML_ROLE_ERROR: switch (tok) { case XML_TOK_PARAM_ENTITY_REF: /* PE references in internal subset are not allowed within declarations. */ return XML_ERROR_PARAM_ENTITY_REF; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; default: return XML_ERROR_SYNTAX; } #ifdef XML_DTD case XML_ROLE_IGNORE_SECT: { enum XML_Error result; if (parser->m_defaultHandler) reportDefault(parser, enc, s, next); handleDefault = XML_FALSE; result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore); if (result != XML_ERROR_NONE) return result; else if (! next) { parser->m_processor = ignoreSectionProcessor; return result; } } break; #endif /* XML_DTD */ case XML_ROLE_GROUP_OPEN: if (parser->m_prologState.level >= parser->m_groupSize) { if (parser->m_groupSize) { { char *const new_connector = (char *)REALLOC( parser, parser->m_groupConnector, parser->m_groupSize *= 2); if (new_connector == NULL) { parser->m_groupSize /= 2; return XML_ERROR_NO_MEMORY; } parser->m_groupConnector = new_connector; } if (dtd->scaffIndex) { int *const new_scaff_index = (int *)REALLOC( parser, dtd->scaffIndex, parser->m_groupSize * sizeof(int)); if (new_scaff_index == NULL) return XML_ERROR_NO_MEMORY; dtd->scaffIndex = new_scaff_index; } } else { parser->m_groupConnector = (char *)MALLOC(parser, parser->m_groupSize = 32); if (! parser->m_groupConnector) { parser->m_groupSize = 0; return XML_ERROR_NO_MEMORY; } } } parser->m_groupConnector[parser->m_prologState.level] = 0; if (dtd->in_eldecl) { int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; assert(dtd->scaffIndex != NULL); dtd->scaffIndex[dtd->scaffLevel] = myindex; dtd->scaffLevel++; dtd->scaffold[myindex].type = XML_CTYPE_SEQ; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_SEQUENCE: if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_PIPE) return XML_ERROR_SYNTAX; parser->m_groupConnector[parser->m_prologState.level] = ASCII_COMMA; if (dtd->in_eldecl && parser->m_elementDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_GROUP_CHOICE: if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_COMMA) return XML_ERROR_SYNTAX; if (dtd->in_eldecl && ! parser->m_groupConnector[parser->m_prologState.level] && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type != XML_CTYPE_MIXED)) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_CHOICE; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } parser->m_groupConnector[parser->m_prologState.level] = ASCII_PIPE; break; case XML_ROLE_PARAM_ENTITY_REF: #ifdef XML_DTD case XML_ROLE_INNER_PARAM_ENTITY_REF: dtd->hasParamEntityRefs = XML_TRUE; if (! parser->m_paramEntityParsing) dtd->keepProcessing = dtd->standalone; else { const XML_Char *name; ENTITY *entity; name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0); poolDiscard(&dtd->pool); /* first, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the skipped entity handler */ if (parser->m_prologState.documentEntity && (dtd->standalone ? ! parser->m_openInternalEntities : ! dtd->hasParamEntityRefs)) { if (! entity) return XML_ERROR_UNDEFINED_ENTITY; else if (! entity->is_internal) { /* It's hard to exhaustively search the code to be sure, * but there doesn't seem to be a way of executing the * following line. There are two cases: * * If 'standalone' is false, the DTD must have no * parameter entities or we wouldn't have passed the outer * 'if' statement. That measn the only entity in the hash * table is the external subset name "#" which cannot be * given as a parameter entity name in XML syntax, so the * lookup must have returned NULL and we don't even reach * the test for an internal entity. * * If 'standalone' is true, it does not seem to be * possible to create entities taking this code path that * are not internal entities, so fail the test above. * * Because this analysis is very uncertain, the code is * being left in place and merely removed from the * coverage test statistics. */ return XML_ERROR_ENTITY_DECLARED_IN_PE; /* LCOV_EXCL_LINE */ } } else if (! entity) { dtd->keepProcessing = dtd->standalone; /* cannot report skipped entities in declarations */ if ((role == XML_ROLE_PARAM_ENTITY_REF) && parser->m_skippedEntityHandler) { parser->m_skippedEntityHandler(parser->m_handlerArg, name, 1); handleDefault = XML_FALSE; } break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; XML_Bool betweenDecl = (role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE); result = processInternalEntity(parser, entity, betweenDecl); if (result != XML_ERROR_NONE) return result; handleDefault = XML_FALSE; break; } if (parser->m_externalEntityRefHandler) { dtd->paramEntityRead = XML_FALSE; entity->open = XML_TRUE; if (! parser->m_externalEntityRefHandler( parser->m_externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) { entity->open = XML_FALSE; return XML_ERROR_EXTERNAL_ENTITY_HANDLING; } entity->open = XML_FALSE; handleDefault = XML_FALSE; if (! dtd->paramEntityRead) { dtd->keepProcessing = dtd->standalone; break; } } else { dtd->keepProcessing = dtd->standalone; break; } } #endif /* XML_DTD */ if (! dtd->standalone && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; break; /* Element declaration stuff */ case XML_ROLE_ELEMENT_NAME: if (parser->m_elementDeclHandler) { parser->m_declElementType = getElementType(parser, enc, s, next); if (! parser->m_declElementType) return XML_ERROR_NO_MEMORY; dtd->scaffLevel = 0; dtd->scaffCount = 0; dtd->in_eldecl = XML_TRUE; handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ANY: case XML_ROLE_CONTENT_EMPTY: if (dtd->in_eldecl) { if (parser->m_elementDeclHandler) { XML_Content *content = (XML_Content *)MALLOC(parser, sizeof(XML_Content)); if (! content) return XML_ERROR_NO_MEMORY; content->quant = XML_CQUANT_NONE; content->name = NULL; content->numchildren = 0; content->children = NULL; content->type = ((role == XML_ROLE_CONTENT_ANY) ? XML_CTYPE_ANY : XML_CTYPE_EMPTY); *eventEndPP = s; parser->m_elementDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, content); handleDefault = XML_FALSE; } dtd->in_eldecl = XML_FALSE; } break; case XML_ROLE_CONTENT_PCDATA: if (dtd->in_eldecl) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_MIXED; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ELEMENT: quant = XML_CQUANT_NONE; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_OPT: quant = XML_CQUANT_OPT; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_REP: quant = XML_CQUANT_REP; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_PLUS: quant = XML_CQUANT_PLUS; elementContent: if (dtd->in_eldecl) { ELEMENT_TYPE *el; const XML_Char *name; int nameLen; const char *nxt = (quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar); int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; dtd->scaffold[myindex].type = XML_CTYPE_NAME; dtd->scaffold[myindex].quant = quant; el = getElementType(parser, enc, s, nxt); if (! el) return XML_ERROR_NO_MEMORY; name = el->name; dtd->scaffold[myindex].name = name; nameLen = 0; for (; name[nameLen++];) ; dtd->contentStringLen += nameLen; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_CLOSE: quant = XML_CQUANT_NONE; goto closeGroup; case XML_ROLE_GROUP_CLOSE_OPT: quant = XML_CQUANT_OPT; goto closeGroup; case XML_ROLE_GROUP_CLOSE_REP: quant = XML_CQUANT_REP; goto closeGroup; case XML_ROLE_GROUP_CLOSE_PLUS: quant = XML_CQUANT_PLUS; closeGroup: if (dtd->in_eldecl) { if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; dtd->scaffLevel--; dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant; if (dtd->scaffLevel == 0) { if (! handleDefault) { XML_Content *model = build_model(parser); if (! model) return XML_ERROR_NO_MEMORY; *eventEndPP = s; parser->m_elementDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, model); } dtd->in_eldecl = XML_FALSE; dtd->contentStringLen = 0; } } break; /* End element declaration stuff */ case XML_ROLE_PI: if (! reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_COMMENT: if (! reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_NONE: switch (tok) { case XML_TOK_BOM: handleDefault = XML_FALSE; break; } break; case XML_ROLE_DOCTYPE_NONE: if (parser->m_startDoctypeDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ENTITY_NONE: if (dtd->keepProcessing && parser->m_entityDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_NOTATION_NONE: if (parser->m_notationDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTLIST_NONE: if (dtd->keepProcessing && parser->m_attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ELEMENT_NONE: if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; break; } /* end of big switch */ if (handleDefault && parser->m_defaultHandler) reportDefault(parser, enc, s, next); switch (parser->m_parsingStatus.parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: s = next; tok = XmlPrologTok(enc, s, end, &next); } } /* not reached */ }
5186
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06:15Z
Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.
If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.
https://cwe.mitre.org/data/definitions/776.html
0
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
doProlog
doProlog( XML_Parser parser , const ENCODING * enc , const char * s , const char * end , int tok , const char * next , const char ** nextPtr , XML_Bool haveMore)
['parser', 'enc', 's', 'end', 'tok', 'next', 'nextPtr', 'haveMore']
doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr, XML_Bool haveMore) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = {ASCII_HASH, '\0'}; #endif /* XML_DTD */ static const XML_Char atypeCDATA[] = {ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0'}; static const XML_Char atypeID[] = {ASCII_I, ASCII_D, '\0'}; static const XML_Char atypeIDREF[] = {ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0'}; static const XML_Char atypeIDREFS[] = {ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0'}; static const XML_Char atypeENTITY[] = {ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0'}; static const XML_Char atypeENTITIES[] = {ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, '\0'}; static const XML_Char atypeNMTOKEN[] = {ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0'}; static const XML_Char atypeNMTOKENS[] = {ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, '\0'}; static const XML_Char notationPrefix[] = {ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, ASCII_LPAREN, '\0'}; static const XML_Char enumValueSep[] = {ASCII_PIPE, '\0'}; static const XML_Char enumValueStart[] = {ASCII_LPAREN, '\0'}; /* save one level of indirection */ DTD *const dtd = parser->m_dtd; const char **eventPP; const char **eventEndPP; enum XML_Content_Quant quant; if (enc == parser->m_encoding) { eventPP = &parser->m_eventPtr; eventEndPP = &parser->m_eventEndPtr; } else { eventPP = &(parser->m_openInternalEntities->internalEventPtr); eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); } for (;;) { int role; XML_Bool handleDefault = XML_TRUE; *eventPP = s; *eventEndPP = next; if (tok <= 0) { if (haveMore && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case -XML_TOK_PROLOG_S: tok = -tok; break; case XML_TOK_NONE: #ifdef XML_DTD /* for internal PE NOT referenced between declarations */ if (enc != parser->m_encoding && ! parser->m_openInternalEntities->betweenDecl) { *nextPtr = s; return XML_ERROR_NONE; } /* WFC: PE Between Declarations - must check that PE contains complete markup, not only for external PEs, but also for internal PEs if the reference occurs between declarations. */ if (parser->m_isParamEntity || enc != parser->m_encoding) { if (XmlTokenRole(&parser->m_prologState, XML_TOK_NONE, end, end, enc) == XML_ROLE_ERROR) return XML_ERROR_INCOMPLETE_PE; *nextPtr = s; return XML_ERROR_NONE; } #endif /* XML_DTD */ return XML_ERROR_NO_ELEMENTS; default: tok = -tok; next = end; break; } } role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc); switch (role) { case XML_ROLE_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 0, s, next); if (result != XML_ERROR_NONE) return result; enc = parser->m_encoding; handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_NAME: if (parser->m_startDoctypeDeclHandler) { parser->m_doctypeName = poolStoreString(&parser->m_tempPool, enc, s, next); if (! parser->m_doctypeName) return XML_ERROR_NO_MEMORY; poolFinish(&parser->m_tempPool); parser->m_doctypePubid = NULL; handleDefault = XML_FALSE; } parser->m_doctypeSysid = NULL; /* always initialize to NULL */ break; case XML_ROLE_DOCTYPE_INTERNAL_SUBSET: if (parser->m_startDoctypeDeclHandler) { parser->m_startDoctypeDeclHandler( parser->m_handlerArg, parser->m_doctypeName, parser->m_doctypeSysid, parser->m_doctypePubid, 1); parser->m_doctypeName = NULL; poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } break; #ifdef XML_DTD case XML_ROLE_TEXT_DECL: { enum XML_Error result = processXmlDecl(parser, 1, s, next); if (result != XML_ERROR_NONE) return result; enc = parser->m_encoding; handleDefault = XML_FALSE; } break; #endif /* XML_DTD */ case XML_ROLE_DOCTYPE_PUBLIC_ID: #ifdef XML_DTD parser->m_useForeignDTD = XML_FALSE; parser->m_declEntity = (ENTITY *)lookup( parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_startDoctypeDeclHandler) { XML_Char *pubId; if (! XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; pubId = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! pubId) return XML_ERROR_NO_MEMORY; normalizePublicId(pubId); poolFinish(&parser->m_tempPool); parser->m_doctypePubid = pubId; handleDefault = XML_FALSE; goto alreadyChecked; } /* fall through */ case XML_ROLE_ENTITY_PUBLIC_ID: if (! XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; alreadyChecked: if (dtd->keepProcessing && parser->m_declEntity) { XML_Char *tem = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); parser->m_declEntity->publicId = tem; poolFinish(&dtd->pool); /* Don't suppress the default handler if we fell through from * the XML_ROLE_DOCTYPE_PUBLIC_ID case. */ if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_PUBLIC_ID) handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_CLOSE: if (parser->m_doctypeName) { parser->m_startDoctypeDeclHandler( parser->m_handlerArg, parser->m_doctypeName, parser->m_doctypeSysid, parser->m_doctypePubid, 0); poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } /* parser->m_doctypeSysid will be non-NULL in the case of a previous XML_ROLE_DOCTYPE_SYSTEM_ID, even if parser->m_startDoctypeDeclHandler was not set, indicating an external subset */ #ifdef XML_DTD if (parser->m_doctypeSysid || parser->m_useForeignDTD) { XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! entity) { /* The external subset name "#" will have already been * inserted into the hash table at the start of the * external entity parsing, so no allocation will happen * and lookup() cannot fail. */ return XML_ERROR_NO_MEMORY; /* LCOV_EXCL_LINE */ } if (parser->m_useForeignDTD) entity->base = parser->m_curBase; dtd->paramEntityRead = XML_FALSE; if (! parser->m_externalEntityRefHandler( parser->m_externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { if (! dtd->standalone && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; } /* if we didn't read the foreign DTD then this means that there is no external subset and we must reset dtd->hasParamEntityRefs */ else if (! parser->m_doctypeSysid) dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } parser->m_useForeignDTD = XML_FALSE; } #endif /* XML_DTD */ if (parser->m_endDoctypeDeclHandler) { parser->m_endDoctypeDeclHandler(parser->m_handlerArg); handleDefault = XML_FALSE; } break; case XML_ROLE_INSTANCE_START: #ifdef XML_DTD /* if there is no DOCTYPE declaration then now is the last chance to read the foreign DTD */ if (parser->m_useForeignDTD) { XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs; dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! entity) return XML_ERROR_NO_MEMORY; entity->base = parser->m_curBase; dtd->paramEntityRead = XML_FALSE; if (! parser->m_externalEntityRefHandler( parser->m_externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { if (! dtd->standalone && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; } /* if we didn't read the foreign DTD then this means that there is no external subset and we must reset dtd->hasParamEntityRefs */ else dtd->hasParamEntityRefs = hadParamEntityRefs; /* end of DTD - no need to update dtd->keepProcessing */ } } #endif /* XML_DTD */ parser->m_processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); case XML_ROLE_ATTLIST_ELEMENT_NAME: parser->m_declElementType = getElementType(parser, enc, s, next); if (! parser->m_declElementType) return XML_ERROR_NO_MEMORY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_NAME: parser->m_declAttributeId = getAttributeId(parser, enc, s, next); if (! parser->m_declAttributeId) return XML_ERROR_NO_MEMORY; parser->m_declAttributeIsCdata = XML_FALSE; parser->m_declAttributeType = NULL; parser->m_declAttributeIsId = XML_FALSE; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_CDATA: parser->m_declAttributeIsCdata = XML_TRUE; parser->m_declAttributeType = atypeCDATA; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ID: parser->m_declAttributeIsId = XML_TRUE; parser->m_declAttributeType = atypeID; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREF: parser->m_declAttributeType = atypeIDREF; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: parser->m_declAttributeType = atypeIDREFS; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: parser->m_declAttributeType = atypeENTITY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: parser->m_declAttributeType = atypeENTITIES; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: parser->m_declAttributeType = atypeNMTOKEN; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: parser->m_declAttributeType = atypeNMTOKENS; checkAttListDeclHandler: if (dtd->keepProcessing && parser->m_attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTRIBUTE_ENUM_VALUE: case XML_ROLE_ATTRIBUTE_NOTATION_VALUE: if (dtd->keepProcessing && parser->m_attlistDeclHandler) { const XML_Char *prefix; if (parser->m_declAttributeType) { prefix = enumValueSep; } else { prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE ? notationPrefix : enumValueStart); } if (! poolAppendString(&parser->m_tempPool, prefix)) return XML_ERROR_NO_MEMORY; if (! poolAppend(&parser->m_tempPool, enc, s, next)) return XML_ERROR_NO_MEMORY; parser->m_declAttributeType = parser->m_tempPool.start; handleDefault = XML_FALSE; } break; case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { if (! defineAttribute(parser->m_declElementType, parser->m_declAttributeId, parser->m_declAttributeIsCdata, parser->m_declAttributeIsId, 0, parser)) return XML_ERROR_NO_MEMORY; if (parser->m_attlistDeclHandler && parser->m_declAttributeType) { if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN) || (*parser->m_declAttributeType == XML_T(ASCII_N) && parser->m_declAttributeType[1] == XML_T(ASCII_O))) { /* Enumerated or Notation type */ if (! poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN)) || ! poolAppendChar(&parser->m_tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; parser->m_declAttributeType = parser->m_tempPool.start; poolFinish(&parser->m_tempPool); } *eventEndPP = s; parser->m_attlistDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, parser->m_declAttributeId->name, parser->m_declAttributeType, 0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE); poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: case XML_ROLE_FIXED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { const XML_Char *attVal; enum XML_Error result = storeAttributeValue( parser, enc, parser->m_declAttributeIsCdata, s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool); if (result) return result; attVal = poolStart(&dtd->pool); poolFinish(&dtd->pool); /* ID attributes aren't allowed to have a default */ if (! defineAttribute( parser->m_declElementType, parser->m_declAttributeId, parser->m_declAttributeIsCdata, XML_FALSE, attVal, parser)) return XML_ERROR_NO_MEMORY; if (parser->m_attlistDeclHandler && parser->m_declAttributeType) { if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN) || (*parser->m_declAttributeType == XML_T(ASCII_N) && parser->m_declAttributeType[1] == XML_T(ASCII_O))) { /* Enumerated or Notation type */ if (! poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN)) || ! poolAppendChar(&parser->m_tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; parser->m_declAttributeType = parser->m_tempPool.start; poolFinish(&parser->m_tempPool); } *eventEndPP = s; parser->m_attlistDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, parser->m_declAttributeId->name, parser->m_declAttributeType, attVal, role == XML_ROLE_FIXED_ATTRIBUTE_VALUE); poolClear(&parser->m_tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_ENTITY_VALUE: if (dtd->keepProcessing) { enum XML_Error result = storeEntityValue( parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (parser->m_declEntity) { parser->m_declEntity->textPtr = poolStart(&dtd->entityValuePool); parser->m_declEntity->textLen = (int)(poolLength(&dtd->entityValuePool)); poolFinish(&dtd->entityValuePool); if (parser->m_entityDeclHandler) { *eventEndPP = s; parser->m_entityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, parser->m_declEntity->is_param, parser->m_declEntity->textPtr, parser->m_declEntity->textLen, parser->m_curBase, 0, 0, 0); handleDefault = XML_FALSE; } } else poolDiscard(&dtd->entityValuePool); if (result != XML_ERROR_NONE) return result; } break; case XML_ROLE_DOCTYPE_SYSTEM_ID: #ifdef XML_DTD parser->m_useForeignDTD = XML_FALSE; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (parser->m_startDoctypeDeclHandler) { parser->m_doctypeSysid = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (parser->m_doctypeSysid == NULL) return XML_ERROR_NO_MEMORY; poolFinish(&parser->m_tempPool); handleDefault = XML_FALSE; } #ifdef XML_DTD else /* use externalSubsetName to make parser->m_doctypeSysid non-NULL for the case where no parser->m_startDoctypeDeclHandler is set */ parser->m_doctypeSysid = externalSubsetName; #endif /* XML_DTD */ if (! dtd->standalone #ifdef XML_DTD && ! parser->m_paramEntityParsing #endif /* XML_DTD */ && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; #ifndef XML_DTD break; #else /* XML_DTD */ if (! parser->m_declEntity) { parser->m_declEntity = (ENTITY *)lookup( parser, &dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; parser->m_declEntity->publicId = NULL; } #endif /* XML_DTD */ /* fall through */ case XML_ROLE_ENTITY_SYSTEM_ID: if (dtd->keepProcessing && parser->m_declEntity) { parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! parser->m_declEntity->systemId) return XML_ERROR_NO_MEMORY; parser->m_declEntity->base = parser->m_curBase; poolFinish(&dtd->pool); /* Don't suppress the default handler if we fell through from * the XML_ROLE_DOCTYPE_SYSTEM_ID case. */ if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_SYSTEM_ID) handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_COMPLETE: if (dtd->keepProcessing && parser->m_declEntity && parser->m_entityDeclHandler) { *eventEndPP = s; parser->m_entityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, parser->m_declEntity->is_param, 0, 0, parser->m_declEntity->base, parser->m_declEntity->systemId, parser->m_declEntity->publicId, 0); handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_NOTATION_NAME: if (dtd->keepProcessing && parser->m_declEntity) { parser->m_declEntity->notation = poolStoreString(&dtd->pool, enc, s, next); if (! parser->m_declEntity->notation) return XML_ERROR_NO_MEMORY; poolFinish(&dtd->pool); if (parser->m_unparsedEntityDeclHandler) { *eventEndPP = s; parser->m_unparsedEntityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, parser->m_declEntity->base, parser->m_declEntity->systemId, parser->m_declEntity->publicId, parser->m_declEntity->notation); handleDefault = XML_FALSE; } else if (parser->m_entityDeclHandler) { *eventEndPP = s; parser->m_entityDeclHandler( parser->m_handlerArg, parser->m_declEntity->name, 0, 0, 0, parser->m_declEntity->base, parser->m_declEntity->systemId, parser->m_declEntity->publicId, parser->m_declEntity->notation); handleDefault = XML_FALSE; } } break; case XML_ROLE_GENERAL_ENTITY_NAME: { if (XmlPredefinedEntityName(enc, s, next)) { parser->m_declEntity = NULL; break; } if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (! name) return XML_ERROR_NO_MEMORY; parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; if (parser->m_declEntity->name != name) { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } else { poolFinish(&dtd->pool); parser->m_declEntity->publicId = NULL; parser->m_declEntity->is_param = XML_FALSE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ parser->m_declEntity->is_internal = ! (parser->m_parentParser || parser->m_openInternalEntities); if (parser->m_entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } } break; case XML_ROLE_PARAM_ENTITY_NAME: #ifdef XML_DTD if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (! name) return XML_ERROR_NO_MEMORY; parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, sizeof(ENTITY)); if (! parser->m_declEntity) return XML_ERROR_NO_MEMORY; if (parser->m_declEntity->name != name) { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } else { poolFinish(&dtd->pool); parser->m_declEntity->publicId = NULL; parser->m_declEntity->is_param = XML_TRUE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ parser->m_declEntity->is_internal = ! (parser->m_parentParser || parser->m_openInternalEntities); if (parser->m_entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); parser->m_declEntity = NULL; } #else /* not XML_DTD */ parser->m_declEntity = NULL; #endif /* XML_DTD */ break; case XML_ROLE_NOTATION_NAME: parser->m_declNotationPublicId = NULL; parser->m_declNotationName = NULL; if (parser->m_notationDeclHandler) { parser->m_declNotationName = poolStoreString(&parser->m_tempPool, enc, s, next); if (! parser->m_declNotationName) return XML_ERROR_NO_MEMORY; poolFinish(&parser->m_tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_PUBLIC_ID: if (! XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_PUBLICID; if (parser ->m_declNotationName) { /* means m_notationDeclHandler != NULL */ XML_Char *tem = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); parser->m_declNotationPublicId = tem; poolFinish(&parser->m_tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_SYSTEM_ID: if (parser->m_declNotationName && parser->m_notationDeclHandler) { const XML_Char *systemId = poolStoreString(&parser->m_tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! systemId) return XML_ERROR_NO_MEMORY; *eventEndPP = s; parser->m_notationDeclHandler( parser->m_handlerArg, parser->m_declNotationName, parser->m_curBase, systemId, parser->m_declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&parser->m_tempPool); break; case XML_ROLE_NOTATION_NO_SYSTEM_ID: if (parser->m_declNotationPublicId && parser->m_notationDeclHandler) { *eventEndPP = s; parser->m_notationDeclHandler( parser->m_handlerArg, parser->m_declNotationName, parser->m_curBase, 0, parser->m_declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&parser->m_tempPool); break; case XML_ROLE_ERROR: switch (tok) { case XML_TOK_PARAM_ENTITY_REF: /* PE references in internal subset are not allowed within declarations. */ return XML_ERROR_PARAM_ENTITY_REF; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; default: return XML_ERROR_SYNTAX; } #ifdef XML_DTD case XML_ROLE_IGNORE_SECT: { enum XML_Error result; if (parser->m_defaultHandler) reportDefault(parser, enc, s, next); handleDefault = XML_FALSE; result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore); if (result != XML_ERROR_NONE) return result; else if (! next) { parser->m_processor = ignoreSectionProcessor; return result; } } break; #endif /* XML_DTD */ case XML_ROLE_GROUP_OPEN: if (parser->m_prologState.level >= parser->m_groupSize) { if (parser->m_groupSize) { { char *const new_connector = (char *)REALLOC( parser, parser->m_groupConnector, parser->m_groupSize *= 2); if (new_connector == NULL) { parser->m_groupSize /= 2; return XML_ERROR_NO_MEMORY; } parser->m_groupConnector = new_connector; } if (dtd->scaffIndex) { int *const new_scaff_index = (int *)REALLOC( parser, dtd->scaffIndex, parser->m_groupSize * sizeof(int)); if (new_scaff_index == NULL) return XML_ERROR_NO_MEMORY; dtd->scaffIndex = new_scaff_index; } } else { parser->m_groupConnector = (char *)MALLOC(parser, parser->m_groupSize = 32); if (! parser->m_groupConnector) { parser->m_groupSize = 0; return XML_ERROR_NO_MEMORY; } } } parser->m_groupConnector[parser->m_prologState.level] = 0; if (dtd->in_eldecl) { int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; assert(dtd->scaffIndex != NULL); dtd->scaffIndex[dtd->scaffLevel] = myindex; dtd->scaffLevel++; dtd->scaffold[myindex].type = XML_CTYPE_SEQ; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_SEQUENCE: if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_PIPE) return XML_ERROR_SYNTAX; parser->m_groupConnector[parser->m_prologState.level] = ASCII_COMMA; if (dtd->in_eldecl && parser->m_elementDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_GROUP_CHOICE: if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_COMMA) return XML_ERROR_SYNTAX; if (dtd->in_eldecl && ! parser->m_groupConnector[parser->m_prologState.level] && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type != XML_CTYPE_MIXED)) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_CHOICE; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } parser->m_groupConnector[parser->m_prologState.level] = ASCII_PIPE; break; case XML_ROLE_PARAM_ENTITY_REF: #ifdef XML_DTD case XML_ROLE_INNER_PARAM_ENTITY_REF: dtd->hasParamEntityRefs = XML_TRUE; if (! parser->m_paramEntityParsing) dtd->keepProcessing = dtd->standalone; else { const XML_Char *name; ENTITY *entity; name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (! name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0); poolDiscard(&dtd->pool); /* first, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the skipped entity handler */ if (parser->m_prologState.documentEntity && (dtd->standalone ? ! parser->m_openInternalEntities : ! dtd->hasParamEntityRefs)) { if (! entity) return XML_ERROR_UNDEFINED_ENTITY; else if (! entity->is_internal) { /* It's hard to exhaustively search the code to be sure, * but there doesn't seem to be a way of executing the * following line. There are two cases: * * If 'standalone' is false, the DTD must have no * parameter entities or we wouldn't have passed the outer * 'if' statement. That measn the only entity in the hash * table is the external subset name "#" which cannot be * given as a parameter entity name in XML syntax, so the * lookup must have returned NULL and we don't even reach * the test for an internal entity. * * If 'standalone' is true, it does not seem to be * possible to create entities taking this code path that * are not internal entities, so fail the test above. * * Because this analysis is very uncertain, the code is * being left in place and merely removed from the * coverage test statistics. */ return XML_ERROR_ENTITY_DECLARED_IN_PE; /* LCOV_EXCL_LINE */ } } else if (! entity) { dtd->keepProcessing = dtd->standalone; /* cannot report skipped entities in declarations */ if ((role == XML_ROLE_PARAM_ENTITY_REF) && parser->m_skippedEntityHandler) { parser->m_skippedEntityHandler(parser->m_handlerArg, name, 1); handleDefault = XML_FALSE; } break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; XML_Bool betweenDecl = (role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE); result = processInternalEntity(parser, entity, betweenDecl); if (result != XML_ERROR_NONE) return result; handleDefault = XML_FALSE; break; } if (parser->m_externalEntityRefHandler) { dtd->paramEntityRead = XML_FALSE; entity->open = XML_TRUE; if (! parser->m_externalEntityRefHandler( parser->m_externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) { entity->open = XML_FALSE; return XML_ERROR_EXTERNAL_ENTITY_HANDLING; } entity->open = XML_FALSE; handleDefault = XML_FALSE; if (! dtd->paramEntityRead) { dtd->keepProcessing = dtd->standalone; break; } } else { dtd->keepProcessing = dtd->standalone; break; } } #endif /* XML_DTD */ if (! dtd->standalone && parser->m_notStandaloneHandler && ! parser->m_notStandaloneHandler(parser->m_handlerArg)) return XML_ERROR_NOT_STANDALONE; break; /* Element declaration stuff */ case XML_ROLE_ELEMENT_NAME: if (parser->m_elementDeclHandler) { parser->m_declElementType = getElementType(parser, enc, s, next); if (! parser->m_declElementType) return XML_ERROR_NO_MEMORY; dtd->scaffLevel = 0; dtd->scaffCount = 0; dtd->in_eldecl = XML_TRUE; handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ANY: case XML_ROLE_CONTENT_EMPTY: if (dtd->in_eldecl) { if (parser->m_elementDeclHandler) { XML_Content *content = (XML_Content *)MALLOC(parser, sizeof(XML_Content)); if (! content) return XML_ERROR_NO_MEMORY; content->quant = XML_CQUANT_NONE; content->name = NULL; content->numchildren = 0; content->children = NULL; content->type = ((role == XML_ROLE_CONTENT_ANY) ? XML_CTYPE_ANY : XML_CTYPE_EMPTY); *eventEndPP = s; parser->m_elementDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, content); handleDefault = XML_FALSE; } dtd->in_eldecl = XML_FALSE; } break; case XML_ROLE_CONTENT_PCDATA: if (dtd->in_eldecl) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_MIXED; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ELEMENT: quant = XML_CQUANT_NONE; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_OPT: quant = XML_CQUANT_OPT; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_REP: quant = XML_CQUANT_REP; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_PLUS: quant = XML_CQUANT_PLUS; elementContent: if (dtd->in_eldecl) { ELEMENT_TYPE *el; const XML_Char *name; int nameLen; const char *nxt = (quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar); int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; dtd->scaffold[myindex].type = XML_CTYPE_NAME; dtd->scaffold[myindex].quant = quant; el = getElementType(parser, enc, s, nxt); if (! el) return XML_ERROR_NO_MEMORY; name = el->name; dtd->scaffold[myindex].name = name; nameLen = 0; for (; name[nameLen++];) ; dtd->contentStringLen += nameLen; if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_CLOSE: quant = XML_CQUANT_NONE; goto closeGroup; case XML_ROLE_GROUP_CLOSE_OPT: quant = XML_CQUANT_OPT; goto closeGroup; case XML_ROLE_GROUP_CLOSE_REP: quant = XML_CQUANT_REP; goto closeGroup; case XML_ROLE_GROUP_CLOSE_PLUS: quant = XML_CQUANT_PLUS; closeGroup: if (dtd->in_eldecl) { if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; dtd->scaffLevel--; dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant; if (dtd->scaffLevel == 0) { if (! handleDefault) { XML_Content *model = build_model(parser); if (! model) return XML_ERROR_NO_MEMORY; *eventEndPP = s; parser->m_elementDeclHandler( parser->m_handlerArg, parser->m_declElementType->name, model); } dtd->in_eldecl = XML_FALSE; dtd->contentStringLen = 0; } } break; /* End element declaration stuff */ case XML_ROLE_PI: if (! reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_COMMENT: if (! reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_NONE: switch (tok) { case XML_TOK_BOM: handleDefault = XML_FALSE; break; } break; case XML_ROLE_DOCTYPE_NONE: if (parser->m_startDoctypeDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ENTITY_NONE: if (dtd->keepProcessing && parser->m_entityDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_NOTATION_NONE: if (parser->m_notationDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTLIST_NONE: if (dtd->keepProcessing && parser->m_attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ELEMENT_NONE: if (parser->m_elementDeclHandler) handleDefault = XML_FALSE; break; } /* end of big switch */ if (handleDefault && parser->m_defaultHandler) reportDefault(parser, enc, s, next); switch (parser->m_parsingStatus.parsing) { case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; default: s = next; tok = XmlPrologTok(enc, s, end, &next); } } /* not reached */ }
5186
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06: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
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
externalParEntProcessor
externalParEntProcessor( XML_Parser parser , const char * s , const char * end , const char ** nextPtr)
['parser', 's', 'end', 'nextPtr']
externalParEntProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok; tok = XmlPrologTok(parser->m_encoding, s, end, &next); if (tok <= 0) { if (! parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } } /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM. However, when parsing an external subset, doProlog will not accept a BOM as valid, and report a syntax error, so we have to skip the BOM */ else if (tok == XML_TOK_BOM) { s = next; tok = XmlPrologTok(parser->m_encoding, s, end, &next); } parser->m_processor = prologProcessor; return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); }
175
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06:15Z
Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.
If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.
https://cwe.mitre.org/data/definitions/776.html
0
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
externalParEntProcessor
externalParEntProcessor( XML_Parser parser , const char * s , const char * end , const char ** nextPtr)
['parser', 's', 'end', 'nextPtr']
externalParEntProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok; tok = XmlPrologTok(parser->m_encoding, s, end, &next); if (tok <= 0) { if (! parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } } /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM. However, when parsing an external subset, doProlog will not accept a BOM as valid, and report a syntax error, so we have to skip the BOM */ else if (tok == XML_TOK_BOM) { s = next; tok = XmlPrologTok(parser->m_encoding, s, end, &next); } parser->m_processor = prologProcessor; return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); }
175
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06: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
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
internalEntityProcessor
internalEntityProcessor( XML_Parser parser , const char * s , const char * end , const char ** nextPtr)
['parser', 's', 'end', 'nextPtr']
internalEntityProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { ENTITY *entity; const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity = parser->m_openInternalEntities; if (! openEntity) return XML_ERROR_UNEXPECTED_STATE; entity = openEntity->entity; textStart = ((char *)entity->textPtr) + entity->processed; textEnd = (char *)(entity->textPtr + entity->textLen); /* Set a safe default value in case 'next' does not get set */ next = textStart; #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next); result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ result = doContent(parser, openEntity->startTagLevel, parser->m_internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result != XML_ERROR_NONE) return result; else if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) { entity->processed = (int)(next - (char *)entity->textPtr); return result; } else { entity->open = XML_FALSE; parser->m_openInternalEntities = openEntity->next; /* put openEntity back in list of free instances */ openEntity->next = parser->m_freeInternalEntities; parser->m_freeInternalEntities = openEntity; } #ifdef XML_DTD if (entity->is_param) { int tok; parser->m_processor = prologProcessor; tok = XmlPrologTok(parser->m_encoding, s, end, &next); return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); } else #endif /* XML_DTD */ { parser->m_processor = contentProcessor; /* see externalEntityContentProcessor vs contentProcessor */ return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, s, end, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); } }
360
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06:15Z
Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.
If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.
https://cwe.mitre.org/data/definitions/776.html
0
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
internalEntityProcessor
internalEntityProcessor( XML_Parser parser , const char * s , const char * end , const char ** nextPtr)
['parser', 's', 'end', 'nextPtr']
internalEntityProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { ENTITY *entity; const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity = parser->m_openInternalEntities; if (! openEntity) return XML_ERROR_UNEXPECTED_STATE; entity = openEntity->entity; textStart = ((char *)entity->textPtr) + entity->processed; textEnd = (char *)(entity->textPtr + entity->textLen); /* Set a safe default value in case 'next' does not get set */ next = textStart; #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next); result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ result = doContent(parser, openEntity->startTagLevel, parser->m_internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result != XML_ERROR_NONE) return result; else if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) { entity->processed = (int)(next - (char *)entity->textPtr); return result; } else { entity->open = XML_FALSE; parser->m_openInternalEntities = openEntity->next; /* put openEntity back in list of free instances */ openEntity->next = parser->m_freeInternalEntities; parser->m_freeInternalEntities = openEntity; } #ifdef XML_DTD if (entity->is_param) { int tok; parser->m_processor = prologProcessor; tok = XmlPrologTok(parser->m_encoding, s, end, &next); return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); } else #endif /* XML_DTD */ { parser->m_processor = contentProcessor; /* see externalEntityContentProcessor vs contentProcessor */ return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, s, end, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); } }
360
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06: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
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
processInternalEntity
processInternalEntity( XML_Parser parser , ENTITY * entity , XML_Bool betweenDecl)
['parser', 'entity', 'betweenDecl']
processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) { const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity; if (parser->m_freeInternalEntities) { openEntity = parser->m_freeInternalEntities; parser->m_freeInternalEntities = openEntity->next; } else { openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(parser, sizeof(OPEN_INTERNAL_ENTITY)); if (! openEntity) return XML_ERROR_NO_MEMORY; } entity->open = XML_TRUE; entity->processed = 0; openEntity->next = parser->m_openInternalEntities; parser->m_openInternalEntities = openEntity; openEntity->entity = entity; openEntity->startTagLevel = parser->m_tagLevel; openEntity->betweenDecl = betweenDecl; openEntity->internalEventPtr = NULL; openEntity->internalEventEndPtr = NULL; textStart = (char *)entity->textPtr; textEnd = (char *)(entity->textPtr + entity->textLen); /* Set a safe default value in case 'next' does not get set */ next = textStart; #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next); result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ result = doContent(parser, parser->m_tagLevel, parser->m_internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result == XML_ERROR_NONE) { if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) { entity->processed = (int)(next - textStart); parser->m_processor = internalEntityProcessor; } else { entity->open = XML_FALSE; parser->m_openInternalEntities = openEntity->next; /* put openEntity back in list of free instances */ openEntity->next = parser->m_freeInternalEntities; parser->m_freeInternalEntities = openEntity; } } return result; }
323
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06:15Z
Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.
If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.
https://cwe.mitre.org/data/definitions/776.html
0
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
processInternalEntity
processInternalEntity( XML_Parser parser , ENTITY * entity , XML_Bool betweenDecl)
['parser', 'entity', 'betweenDecl']
processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) { const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity; if (parser->m_freeInternalEntities) { openEntity = parser->m_freeInternalEntities; parser->m_freeInternalEntities = openEntity->next; } else { openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(parser, sizeof(OPEN_INTERNAL_ENTITY)); if (! openEntity) return XML_ERROR_NO_MEMORY; } entity->open = XML_TRUE; entity->processed = 0; openEntity->next = parser->m_openInternalEntities; parser->m_openInternalEntities = openEntity; openEntity->entity = entity; openEntity->startTagLevel = parser->m_tagLevel; openEntity->betweenDecl = betweenDecl; openEntity->internalEventPtr = NULL; openEntity->internalEventEndPtr = NULL; textStart = (char *)entity->textPtr; textEnd = (char *)(entity->textPtr + entity->textLen); /* Set a safe default value in case 'next' does not get set */ next = textStart; #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next); result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ result = doContent(parser, parser->m_tagLevel, parser->m_internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result == XML_ERROR_NONE) { if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) { entity->processed = (int)(next - textStart); parser->m_processor = internalEntityProcessor; } else { entity->open = XML_FALSE; parser->m_openInternalEntities = openEntity->next; /* put openEntity back in list of free instances */ openEntity->next = parser->m_freeInternalEntities; parser->m_freeInternalEntities = openEntity; } } return result; }
323
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06: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
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
prologProcessor
prologProcessor( XML_Parser parser , const char * s , const char * end , const char ** nextPtr)
['parser', 's', 'end', 'nextPtr']
prologProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok = XmlPrologTok(parser->m_encoding, s, end, &next); return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); }
76
True
1
CVE-2019-15903
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/libexpat/libexpat/pull/318', 'name': 'https://github.com/libexpat/libexpat/pull/318', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'name': 'https://github.com/libexpat/libexpat/commit/c20b758c332d9a13afbbb276d30db1d183a85d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/317', 'name': 'https://github.com/libexpat/libexpat/issues/317', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4132-1/', 'name': 'USN-4132-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libexpat/libexpat/issues/342', 'name': 'https://github.com/libexpat/libexpat/issues/342', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/30', 'name': '20190917 [slackware-security] expat (SSA:2019-259-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'name': 'http://packetstormsecurity.com/files/154503/Slackware-Security-Advisory-expat-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4132-2/', 'name': 'USN-4132-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/BDUTI5TVQWIGGQXPEVI4T2ENHFSBMIBP/', 'name': 'FEDORA-2019-613edfe68b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4530', 'name': 'DSA-4530', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Sep/37', 'name': '20190923 [SECURITY] [DSA 4530-1] expat security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A4TZKPJFTURRLXIGLB34WVKQ5HGY6JJA/', 'name': 'FEDORA-2019-9505c6b555', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20190926-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00081.html', 'name': 'openSUSE-SU-2019:2205', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-09/msg00080.html', 'name': 'openSUSE-SU-2019:2204', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S26LGXXQ7YF2BP3RGOWELBFKM6BHF6UG/', 'name': 'FEDORA-2019-672ae0f060', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Oct/29', 'name': '20191021 [slackware-security] python (SSA:2019-293-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'name': 'http://packetstormsecurity.com/files/154927/Slackware-Security-Advisory-python-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'name': 'http://packetstormsecurity.com/files/154947/Slackware-Security-Advisory-mozilla-firefox-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/4165-1/', 'name': 'USN-4165-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4549', 'name': 'DSA-4549', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3237', 'name': 'RHSA-2019:3237', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3210', 'name': 'RHSA-2019:3210', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/1', 'name': '20191101 [SECURITY] [DSA 4549-1] firefox-esr security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00000.html', 'name': 'openSUSE-SU-2019:2420', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00002.html', 'name': 'openSUSE-SU-2019:2424', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00003.html', 'name': 'openSUSE-SU-2019:2425', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3756', 'name': 'RHSA-2019:3756', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00013.html', 'name': 'openSUSE-SU-2019:2447', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00017.html', 'name': 'openSUSE-SU-2019:2459', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00019.html', 'name': 'openSUSE-SU-2019:2464', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00016.html', 'name': 'openSUSE-SU-2019:2451', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00018.html', 'name': 'openSUSE-SU-2019:2452', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00006.html', 'name': '[debian-lts-announce] 20191110 [SECURITY] [DLA 1987-1] firefox-esr security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/24', 'name': '20191118 [SECURITY] [DSA 4571-1] thunderbird security update', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2019/dsa-4571', 'name': 'DSA-4571', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00017.html', 'name': '[debian-lts-announce] 20191118 [SECURITY] [DLA 1997-1] thunderbird security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201911-08', 'name': 'GLSA-201911-08', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4202-1/', 'name': 'USN-4202-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210788', 'name': 'https://support.apple.com/kb/HT210788', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210785', 'name': 'https://support.apple.com/kb/HT210785', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210790', 'name': 'https://support.apple.com/kb/HT210790', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210789', 'name': 'https://support.apple.com/kb/HT210789', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/21', 'name': '20191211 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/23', 'name': '20191211 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Dec/17', 'name': '20191211 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210793', 'name': 'https://support.apple.com/kb/HT210793', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210795', 'name': 'https://support.apple.com/kb/HT210795', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT210794', 'name': 'https://support.apple.com/kb/HT210794', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/23', 'name': '20191213 APPLE-SA-2019-12-10-1 iOS 13.3 and iPadOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/26', 'name': '20191213 APPLE-SA-2019-12-10-3 macOS Catalina 10.15.2, Security Update 2019-002 Mojave, Security Update 2019-007 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/27', 'name': '20191213 APPLE-SA-2019-12-10-5 tvOS 13.3', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2019/Dec/30', 'name': '20191213 APPLE-SA-2019-12-10-8 watchOS 6.1.1', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00008.html', 'name': 'openSUSE-SU-2020:0010', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00040.html', 'name': 'openSUSE-SU-2020:0086', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4335-1/', 'name': 'USN-4335-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-11', 'name': 'https://www.tenable.com/security/tns-2021-11', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-776'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.5.0', 'versionEndExcluding': '3.5.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.7.0', 'versionEndExcluding': '2.7.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.6.0', 'versionEndExcluding': '3.6.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too early; a consecutive call to XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber) then resulted in a heap-based buffer over-read.'}]
2022-07-28T11:23Z
2019-09-04T06:15Z
Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.
If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.
https://cwe.mitre.org/data/definitions/776.html
0
Sebastian Pipping
2019-08-28 00:24:59+02:00
xmlparse.c: Deny internal entities closing the doctype
c20b758c332d9a13afbbb276d30db1d183a85d43
False
libexpat/libexpat
:herb: Expat library: Fast streaming XML parser written in C99; migrated from SourceForge to GitHub
2017-01-28 22:11:05
2022-08-27 23:39:41
https://libexpat.github.io/
libexpat
781.0
376.0
prologProcessor
prologProcessor( XML_Parser parser , const char * s , const char * end , const char ** nextPtr)
['parser', 's', 'end', 'nextPtr']
prologProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok = XmlPrologTok(parser->m_encoding, s, end, &next); return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer); }
76
True
1
CVE-2019-16058
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.0/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/OpenSC/pam_p11/commit/d150b60e1e14c261b113f55681419ad1dfa8a76c', 'name': 'https://github.com/OpenSC/pam_p11/commit/d150b60e1e14c261b113f55681419ad1dfa8a76c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/09/12/1', 'name': '[oss-security] 20190911 pam_p11 0.3.1 released', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opensc_project:opensc:0.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opensc_project:opensc:0.2.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in the pam_p11 component 0.2.0 and 0.3.0 for OpenSC. If a smart card creates a signature with a length longer than 256 bytes, this triggers a buffer overflow. This may be the case for RSA keys with 4096 bits depending on the signature scheme.'}]
2019-09-12T15:15Z
2019-09-06T18: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
Peter Popovec
2019-08-26 13:54:09+02:00
Use EVP_PKEY_size() to allocate correct size of signature buffer. (#18) Do not use fixed buffer size for signature, EVP_SignFinal() requires buffer for signature at least EVP_PKEY_size(pkey) bytes in size. Fixes crash when using 4K RSA signatures (https://github.com/OpenSC/pam_p11/issues/16, https://github.com/OpenSC/pam_p11/issues/15)
d150b60e1e14c261b113f55681419ad1dfa8a76c
False
OpenSC/pam_p11
Authentication with PKCS#11 modules
2012-11-24 11:14:27
2022-04-20 07:45:41
OpenSC
15.0
15.0
key_verify
key_verify( pam_handle_t * pamh , int flags , PKCS11_KEY * authkey)
['pamh', 'flags', 'authkey']
static int key_verify(pam_handle_t *pamh, int flags, PKCS11_KEY *authkey) { int ok = 0; unsigned char challenge[30]; unsigned char signature[256]; unsigned int siglen = sizeof signature; const EVP_MD *md = EVP_sha1(); EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); EVP_PKEY *privkey = PKCS11_get_private_key(authkey); EVP_PKEY *pubkey = PKCS11_get_public_key(authkey); /* Verify a SHA-1 hash of random data, signed by the key. * * Note that this will not work keys that aren't eligible for signing. * Unfortunately, libp11 currently has no way of checking * C_GetAttributeValue(CKA_SIGN), see * https://github.com/OpenSC/libp11/issues/219. Since we don't want to * implement try and error, we live with this limitation */ if (1 != randomize(pamh, challenge, sizeof challenge)) { goto err; } if (NULL == pubkey || NULL == privkey || NULL == md_ctx || NULL == md || !EVP_SignInit(md_ctx, md) || !EVP_SignUpdate(md_ctx, challenge, sizeof challenge) || !EVP_SignFinal(md_ctx, signature, &siglen, privkey) || !EVP_MD_CTX_reset(md_ctx) || !EVP_VerifyInit(md_ctx, md) || !EVP_VerifyUpdate(md_ctx, challenge, sizeof challenge) || 1 != EVP_VerifyFinal(md_ctx, signature, siglen, pubkey)) { pam_syslog(pamh, LOG_DEBUG, "Error verifying key: %s\n", ERR_reason_error_string(ERR_get_error())); prompt(flags, pamh, PAM_ERROR_MSG, NULL, _("Error verifying key")); goto err; } ok = 1; err: if (NULL != pubkey) EVP_PKEY_free(pubkey); if (NULL != privkey) EVP_PKEY_free(privkey); if (NULL != md_ctx) { EVP_MD_CTX_free(md_ctx); } return ok; }
264
True
1
CVE-2019-16930
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:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/zcash/zcash/commit/c1fbf8ab5d73cff5e1f45236995857c75ba4128d', 'name': 'https://github.com/zcash/zcash/commit/c1fbf8ab5d73cff5e1f45236995857c75ba4128d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://z.cash/support/security/announcements/security-announcement-2019-09-24/', 'name': 'https://z.cash/support/security/announcements/security-announcement-2019-09-24/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/zcash/zcash/releases/tag/v2.0.7-3', 'name': 'https://github.com/zcash/zcash/releases/tag/v2.0.7-3', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://duke.leto.net/2019/10/01/zcash-metadata-leakage-cve-2019-16930.html', 'name': 'http://duke.leto.net/2019/10/01/zcash-metadata-leakage-cve-2019-16930.html', 'refsource': 'MISC', 'tags': ['Mitigation', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-755'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:z.cash:zcash:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.7-3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Zcashd in Zcash before 2.0.7-3 allows discovery of the IP address of a full node that owns a shielded address, related to mishandling of exceptions during deserialization of note plaintexts. This affects anyone who has disclosed their zaddr to a third party.'}]
2019-10-04T15:58Z
2019-09-28T22:15Z
Improper Handling of Exceptional Conditions
The software does not handle or incorrectly handles an exceptional condition.
https://cwe.mitre.org/data/definitions/755.html
0
Jack Grigg
2019-09-19 18:25:09+01:00
Ignore exceptions when deserializing note plaintexts
c1fbf8ab5d73cff5e1f45236995857c75ba4128d
False
zcash/zcash
Zcash - Internet Money
2014-11-22 03:13:10
2022-08-26 04:07:28
https://z.cash/
zcash
4654.0
1962.0
SaplingNotePlaintext::decrypt
SaplingNotePlaintext::decrypt( const SaplingEncCiphertext & ciphertext , const uint256 & epk , const uint256 & esk , const uint256 & pk_d , const uint256 & cmu)
['ciphertext', 'epk', 'esk', 'pk_d', 'cmu']
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt( const SaplingEncCiphertext &ciphertext, const uint256 &epk, const uint256 &esk, const uint256 &pk_d, const uint256 &cmu ) { auto pt = AttemptSaplingEncDecryption(ciphertext, epk, esk, pk_d); if (!pt) { return boost::none; } // Deserialize from the plaintext CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss << pt.get(); SaplingNotePlaintext ret; ss >> ret; uint256 cmu_expected; if (!librustzcash_sapling_compute_cm( ret.d.data(), pk_d.begin(), ret.value(), ret.rcm.begin(), cmu_expected.begin() )) { return boost::none; } if (cmu_expected != cmu) { return boost::none; } assert(ss.size() == 0); return ret; }
159
True
1
CVE-2019-16930
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:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/zcash/zcash/commit/c1fbf8ab5d73cff5e1f45236995857c75ba4128d', 'name': 'https://github.com/zcash/zcash/commit/c1fbf8ab5d73cff5e1f45236995857c75ba4128d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://z.cash/support/security/announcements/security-announcement-2019-09-24/', 'name': 'https://z.cash/support/security/announcements/security-announcement-2019-09-24/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/zcash/zcash/releases/tag/v2.0.7-3', 'name': 'https://github.com/zcash/zcash/releases/tag/v2.0.7-3', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://duke.leto.net/2019/10/01/zcash-metadata-leakage-cve-2019-16930.html', 'name': 'http://duke.leto.net/2019/10/01/zcash-metadata-leakage-cve-2019-16930.html', 'refsource': 'MISC', 'tags': ['Mitigation', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-755'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:z.cash:zcash:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.7-3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Zcashd in Zcash before 2.0.7-3 allows discovery of the IP address of a full node that owns a shielded address, related to mishandling of exceptions during deserialization of note plaintexts. This affects anyone who has disclosed their zaddr to a third party.'}]
2019-10-04T15:58Z
2019-09-28T22:15Z
Improper Handling of Exceptional Conditions
The software does not handle or incorrectly handles an exceptional condition.
https://cwe.mitre.org/data/definitions/755.html
0
Jack Grigg
2019-09-19 18:25:09+01:00
Ignore exceptions when deserializing note plaintexts
c1fbf8ab5d73cff5e1f45236995857c75ba4128d
False
zcash/zcash
Zcash - Internet Money
2014-11-22 03:13:10
2022-08-26 04:07:28
https://z.cash/
zcash
4654.0
1962.0
SaplingNotePlaintext::decrypt
SaplingNotePlaintext::decrypt( const SaplingEncCiphertext & ciphertext , const uint256 & ivk , const uint256 & epk , const uint256 & cmu)
['ciphertext', 'ivk', 'epk', 'cmu']
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt( const SaplingEncCiphertext &ciphertext, const uint256 &ivk, const uint256 &epk, const uint256 &cmu ) { auto pt = AttemptSaplingEncDecryption(ciphertext, ivk, epk); if (!pt) { return boost::none; } // Deserialize from the plaintext CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss << pt.get(); SaplingNotePlaintext ret; ss >> ret; assert(ss.size() == 0); uint256 pk_d; if (!librustzcash_ivk_to_pkd(ivk.begin(), ret.d.data(), pk_d.begin())) { return boost::none; } uint256 cmu_expected; if (!librustzcash_sapling_compute_cm( ret.d.data(), pk_d.begin(), ret.value(), ret.rcm.begin(), cmu_expected.begin() )) { return boost::none; } if (cmu_expected != cmu) { return boost::none; } return ret; }
188
True
1
CVE-2019-16930
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:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/zcash/zcash/commit/c1fbf8ab5d73cff5e1f45236995857c75ba4128d', 'name': 'https://github.com/zcash/zcash/commit/c1fbf8ab5d73cff5e1f45236995857c75ba4128d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://z.cash/support/security/announcements/security-announcement-2019-09-24/', 'name': 'https://z.cash/support/security/announcements/security-announcement-2019-09-24/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/zcash/zcash/releases/tag/v2.0.7-3', 'name': 'https://github.com/zcash/zcash/releases/tag/v2.0.7-3', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://duke.leto.net/2019/10/01/zcash-metadata-leakage-cve-2019-16930.html', 'name': 'http://duke.leto.net/2019/10/01/zcash-metadata-leakage-cve-2019-16930.html', 'refsource': 'MISC', 'tags': ['Mitigation', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-755'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:z.cash:zcash:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.7-3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Zcashd in Zcash before 2.0.7-3 allows discovery of the IP address of a full node that owns a shielded address, related to mishandling of exceptions during deserialization of note plaintexts. This affects anyone who has disclosed their zaddr to a third party.'}]
2019-10-04T15:58Z
2019-09-28T22:15Z
Improper Handling of Exceptional Conditions
The software does not handle or incorrectly handles an exceptional condition.
https://cwe.mitre.org/data/definitions/755.html
0
Jack Grigg
2019-09-19 18:25:09+01:00
Ignore exceptions when deserializing note plaintexts
c1fbf8ab5d73cff5e1f45236995857c75ba4128d
False
zcash/zcash
Zcash - Internet Money
2014-11-22 03:13:10
2022-08-26 04:07:28
https://z.cash/
zcash
4654.0
1962.0
SaplingOutgoingPlaintext::decrypt
SaplingOutgoingPlaintext::decrypt( const SaplingOutCiphertext & ciphertext , const uint256 & ovk , const uint256 & cv , const uint256 & cm , const uint256 & epk)
['ciphertext', 'ovk', 'cv', 'cm', 'epk']
boost::optional<SaplingOutgoingPlaintext> SaplingOutgoingPlaintext::decrypt( const SaplingOutCiphertext &ciphertext, const uint256& ovk, const uint256& cv, const uint256& cm, const uint256& epk ) { auto pt = AttemptSaplingOutDecryption(ciphertext, ovk, cv, cm, epk); if (!pt) { return boost::none; } // Deserialize from the plaintext CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss << pt.get(); SaplingOutgoingPlaintext ret; ss >> ret; assert(ss.size() == 0); return ret; }
98
True
1
CVE-2019-17498
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/kevinbackhouse/SecurityExploits/tree/8cbdbbe6363510f7d9ceec685373da12e6fc752d/libssh2/out_of_bounds_read_disconnect_CVE-2019-17498', 'name': 'https://github.com/kevinbackhouse/SecurityExploits/tree/8cbdbbe6363510f7d9ceec685373da12e6fc752d/libssh2/out_of_bounds_read_disconnect_CVE-2019-17498', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libssh2/libssh2/blob/42d37aa63129a1b2644bf6495198923534322d64/src/packet.c#L480', 'name': 'https://github.com/libssh2/libssh2/blob/42d37aa63129a1b2644bf6495198923534322d64/src/packet.c#L480', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://blog.semmle.com/libssh2-integer-overflow-CVE-2019-17498/', 'name': 'https://blog.semmle.com/libssh2-integer-overflow-CVE-2019-17498/', 'refsource': 'MISC', 'tags': ['Broken Link']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TY7EEE34RFKCTXTMBQQWWSLXZWSCXNDB/', 'name': 'FEDORA-2019-91529f19e4', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00026.html', 'name': 'openSUSE-SU-2019:2483', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00010.html', 'name': '[debian-lts-announce] 20191113 [SECURITY] [DLA 1991-1] libssh2 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/22H4Q5XMGS3QNSA7OCL3U7UQZ4NXMR5O/', 'name': 'FEDORA-2019-ec04c34768', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/libssh2/libssh2/commit/dedcbd106f8e52d5586b0205bc7677e4c9868f9c', 'name': 'https://github.com/libssh2/libssh2/commit/dedcbd106f8e52d5586b0205bc7677e4c9868f9c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/12/msg00013.html', 'name': '[debian-lts-announce] 20211217 [SECURITY] [DLA 2848-1] libssh2 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libssh2:libssh2:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libssh2 v1.9.0 and earlier versions, the SSH_MSG_DISCONNECT logic in packet.c has an integer overflow in a bounds check, enabling an attacker to specify an arbitrary (out-of-bounds) offset for a subsequent memory read. A crafted SSH server may be able to disclose sensitive information or cause a denial of service condition on the client system when a user connects to the server.'}]
2022-03-09T21:55Z
2019-10-21T22: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
Will Cosgrove
2019-08-30 09:57:38-07:00
packet.c: improve message parsing (#402) * packet.c: improve parsing of packets file: packet.c notes: Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST.
dedcbd106f8e52d5586b0205bc7677e4c9868f9c
False
libssh2/libssh2
the SSH library
2015-03-05 07:38:30
2022-08-24 15:06:03
https://www.libssh2.org/
libssh2
981.0
466.0
_libssh2_packet_add
_libssh2_packet_add( LIBSSH2_SESSION * session , unsigned char * data , size_t datalen , int macstate)
['session', 'data', 'datalen', 'macstate']
_libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, size_t datalen, int macstate) { int rc = 0; char *message = NULL; char *language = NULL; size_t message_len = 0; size_t language_len = 0; LIBSSH2_CHANNEL *channelp = NULL; size_t data_head = 0; unsigned char msg = data[0]; switch(session->packAdd_state) { case libssh2_NB_state_idle: _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Packet type %d received, length=%d", (int) msg, (int) datalen); if((macstate == LIBSSH2_MAC_INVALID) && (!session->macerror || LIBSSH2_MACERROR(session, (char *) data, datalen))) { /* Bad MAC input, but no callback set or non-zero return from the callback */ LIBSSH2_FREE(session, data); return _libssh2_error(session, LIBSSH2_ERROR_INVALID_MAC, "Invalid MAC received"); } session->packAdd_state = libssh2_NB_state_allocated; break; case libssh2_NB_state_jump1: goto libssh2_packet_add_jump_point1; case libssh2_NB_state_jump2: goto libssh2_packet_add_jump_point2; case libssh2_NB_state_jump3: goto libssh2_packet_add_jump_point3; case libssh2_NB_state_jump4: goto libssh2_packet_add_jump_point4; case libssh2_NB_state_jump5: goto libssh2_packet_add_jump_point5; default: /* nothing to do */ break; } if(session->packAdd_state == libssh2_NB_state_allocated) { /* A couple exceptions to the packet adding rule: */ switch(msg) { /* byte SSH_MSG_DISCONNECT uint32 reason code string description in ISO-10646 UTF-8 encoding [RFC3629] string language tag [RFC3066] */ case SSH_MSG_DISCONNECT: if(datalen >= 5) { size_t reason = _libssh2_ntohu32(data + 1); if(datalen >= 9) { message_len = _libssh2_ntohu32(data + 5); if(message_len < datalen-13) { /* 9 = packet_type(1) + reason(4) + message_len(4) */ message = (char *) data + 9; language_len = _libssh2_ntohu32(data + 9 + message_len); language = (char *) data + 9 + message_len + 4; if(language_len > (datalen-13-message_len)) { /* bad input, clear info */ language = message = NULL; language_len = message_len = 0; } } else /* bad size, clear it */ message_len = 0; } if(session->ssh_msg_disconnect) { LIBSSH2_DISCONNECT(session, reason, message, message_len, language, language_len); } _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Disconnect(%d): %s(%s)", reason, message, language); } LIBSSH2_FREE(session, data); session->socket_state = LIBSSH2_SOCKET_DISCONNECTED; session->packAdd_state = libssh2_NB_state_idle; return _libssh2_error(session, LIBSSH2_ERROR_SOCKET_DISCONNECT, "socket disconnect"); /* byte SSH_MSG_IGNORE string data */ case SSH_MSG_IGNORE: if(datalen >= 2) { if(session->ssh_msg_ignore) { LIBSSH2_IGNORE(session, (char *) data + 1, datalen - 1); } } else if(session->ssh_msg_ignore) { LIBSSH2_IGNORE(session, "", 0); } LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; /* byte SSH_MSG_DEBUG boolean always_display string message in ISO-10646 UTF-8 encoding [RFC3629] string language tag [RFC3066] */ case SSH_MSG_DEBUG: if(datalen >= 2) { int always_display = data[1]; if(datalen >= 6) { message_len = _libssh2_ntohu32(data + 2); if(message_len <= (datalen - 10)) { /* 6 = packet_type(1) + display(1) + message_len(4) */ message = (char *) data + 6; language_len = _libssh2_ntohu32(data + 6 + message_len); if(language_len <= (datalen - 10 - message_len)) language = (char *) data + 10 + message_len; } } if(session->ssh_msg_debug) { LIBSSH2_DEBUG(session, always_display, message, message_len, language, language_len); } } /* * _libssh2_debug will actually truncate this for us so * that it's not an inordinate about of data */ _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Debug Packet: %s", message); LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; /* byte SSH_MSG_GLOBAL_REQUEST string request name in US-ASCII only boolean want reply .... request-specific data follows */ case SSH_MSG_GLOBAL_REQUEST: if(datalen >= 5) { uint32_t len = 0; unsigned char want_reply = 0; len = _libssh2_ntohu32(data + 1); if(datalen >= (6 + len)) { want_reply = data[5 + len]; _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Received global request type %.*s (wr %X)", len, data + 5, want_reply); } if(want_reply) { static const unsigned char packet = SSH_MSG_REQUEST_FAILURE; libssh2_packet_add_jump_point5: session->packAdd_state = libssh2_NB_state_jump5; rc = _libssh2_transport_send(session, &packet, 1, NULL, 0); if(rc == LIBSSH2_ERROR_EAGAIN) return rc; } } LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; /* byte SSH_MSG_CHANNEL_EXTENDED_DATA uint32 recipient channel uint32 data_type_code string data */ case SSH_MSG_CHANNEL_EXTENDED_DATA: /* streamid(4) */ data_head += 4; /* fall-through */ /* byte SSH_MSG_CHANNEL_DATA uint32 recipient channel string data */ case SSH_MSG_CHANNEL_DATA: /* packet_type(1) + channelno(4) + datalen(4) */ data_head += 9; if(datalen >= data_head) channelp = _libssh2_channel_locate(session, _libssh2_ntohu32(data + 1)); if(!channelp) { _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_UNKNOWN, "Packet received for unknown channel"); LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; } #ifdef LIBSSH2DEBUG { uint32_t stream_id = 0; if(msg == SSH_MSG_CHANNEL_EXTENDED_DATA) stream_id = _libssh2_ntohu32(data + 5); _libssh2_debug(session, LIBSSH2_TRACE_CONN, "%d bytes packet_add() for %lu/%lu/%lu", (int) (datalen - data_head), channelp->local.id, channelp->remote.id, stream_id); } #endif if((channelp->remote.extended_data_ignore_mode == LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE) && (msg == SSH_MSG_CHANNEL_EXTENDED_DATA)) { /* Pretend we didn't receive this */ LIBSSH2_FREE(session, data); _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Ignoring extended data and refunding %d bytes", (int) (datalen - 13)); if(channelp->read_avail + datalen - data_head >= channelp->remote.window_size) datalen = channelp->remote.window_size - channelp->read_avail + data_head; channelp->remote.window_size -= datalen - data_head; _libssh2_debug(session, LIBSSH2_TRACE_CONN, "shrinking window size by %lu bytes to %lu, " "read_avail %lu", datalen - data_head, channelp->remote.window_size, channelp->read_avail); session->packAdd_channelp = channelp; /* Adjust the window based on the block we just freed */ libssh2_packet_add_jump_point1: session->packAdd_state = libssh2_NB_state_jump1; rc = _libssh2_channel_receive_window_adjust(session-> packAdd_channelp, datalen - 13, 1, NULL); if(rc == LIBSSH2_ERROR_EAGAIN) return rc; session->packAdd_state = libssh2_NB_state_idle; return 0; } /* * REMEMBER! remote means remote as source of data, * NOT remote window! */ if(channelp->remote.packet_size < (datalen - data_head)) { /* * Spec says we MAY ignore bytes sent beyond * packet_size */ _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED, "Packet contains more data than we offered" " to receive, truncating"); datalen = channelp->remote.packet_size + data_head; } if(channelp->remote.window_size <= channelp->read_avail) { /* * Spec says we MAY ignore bytes sent beyond * window_size */ _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED, "The current receive window is full," " data ignored"); LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; } /* Reset EOF status */ channelp->remote.eof = 0; if(channelp->read_avail + datalen - data_head > channelp->remote.window_size) { _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED, "Remote sent more data than current " "window allows, truncating"); datalen = channelp->remote.window_size - channelp->read_avail + data_head; } /* Update the read_avail counter. The window size will be * updated once the data is actually read from the queue * from an upper layer */ channelp->read_avail += datalen - data_head; _libssh2_debug(session, LIBSSH2_TRACE_CONN, "increasing read_avail by %lu bytes to %lu/%lu", (long)(datalen - data_head), (long)channelp->read_avail, (long)channelp->remote.window_size); break; /* byte SSH_MSG_CHANNEL_EOF uint32 recipient channel */ case SSH_MSG_CHANNEL_EOF: if(datalen >= 5) channelp = _libssh2_channel_locate(session, _libssh2_ntohu32(data + 1)); if(!channelp) /* We may have freed already, just quietly ignore this... */ ; else { _libssh2_debug(session, LIBSSH2_TRACE_CONN, "EOF received for channel %lu/%lu", channelp->local.id, channelp->remote.id); channelp->remote.eof = 1; } LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; /* byte SSH_MSG_CHANNEL_REQUEST uint32 recipient channel string request type in US-ASCII characters only boolean want reply .... type-specific data follows */ case SSH_MSG_CHANNEL_REQUEST: if(datalen >= 9) { uint32_t channel = _libssh2_ntohu32(data + 1); uint32_t len = _libssh2_ntohu32(data + 5); unsigned char want_reply = 1; if((len + 9) < datalen) want_reply = data[len + 9]; _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Channel %d received request type %.*s (wr %X)", channel, len, data + 9, want_reply); if(len == sizeof("exit-status") - 1 && (sizeof("exit-status") - 1 + 9) <= datalen && !memcmp("exit-status", data + 9, sizeof("exit-status") - 1)) { /* we've got "exit-status" packet. Set the session value */ if(datalen >= 20) channelp = _libssh2_channel_locate(session, channel); if(channelp && (sizeof("exit-status") + 13) <= datalen) { channelp->exit_status = _libssh2_ntohu32(data + 9 + sizeof("exit-status")); _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Exit status %lu received for " "channel %lu/%lu", channelp->exit_status, channelp->local.id, channelp->remote.id); } } else if(len == sizeof("exit-signal") - 1 && (sizeof("exit-signal") - 1 + 9) <= datalen && !memcmp("exit-signal", data + 9, sizeof("exit-signal") - 1)) { /* command terminated due to signal */ if(datalen >= 20) channelp = _libssh2_channel_locate(session, channel); if(channelp && (sizeof("exit-signal") + 13) <= datalen) { /* set signal name (without SIG prefix) */ uint32_t namelen = _libssh2_ntohu32(data + 9 + sizeof("exit-signal")); if(namelen <= UINT_MAX - 1) { channelp->exit_signal = LIBSSH2_ALLOC(session, namelen + 1); } else { channelp->exit_signal = NULL; } if(!channelp->exit_signal) rc = _libssh2_error(session, LIBSSH2_ERROR_ALLOC, "memory for signal name"); else if((sizeof("exit-signal") + 13 + namelen <= datalen)) { memcpy(channelp->exit_signal, data + 13 + sizeof("exit-signal"), namelen); channelp->exit_signal[namelen] = '\0'; /* TODO: save error message and language tag */ _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Exit signal %s received for " "channel %lu/%lu", channelp->exit_signal, channelp->local.id, channelp->remote.id); } } } if(want_reply) { unsigned char packet[5]; libssh2_packet_add_jump_point4: session->packAdd_state = libssh2_NB_state_jump4; packet[0] = SSH_MSG_CHANNEL_FAILURE; memcpy(&packet[1], data + 1, 4); rc = _libssh2_transport_send(session, packet, 5, NULL, 0); if(rc == LIBSSH2_ERROR_EAGAIN) return rc; } } LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return rc; /* byte SSH_MSG_CHANNEL_CLOSE uint32 recipient channel */ case SSH_MSG_CHANNEL_CLOSE: if(datalen >= 5) channelp = _libssh2_channel_locate(session, _libssh2_ntohu32(data + 1)); if(!channelp) { /* We may have freed already, just quietly ignore this... */ LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; } _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Close received for channel %lu/%lu", channelp->local.id, channelp->remote.id); channelp->remote.close = 1; channelp->remote.eof = 1; LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; /* byte SSH_MSG_CHANNEL_OPEN string "session" uint32 sender channel uint32 initial window size uint32 maximum packet size */ case SSH_MSG_CHANNEL_OPEN: if(datalen < 17) ; else if((datalen >= (sizeof("forwarded-tcpip") + 4)) && ((sizeof("forwarded-tcpip") - 1) == _libssh2_ntohu32(data + 1)) && (memcmp(data + 5, "forwarded-tcpip", sizeof("forwarded-tcpip") - 1) == 0)) { /* init the state struct */ memset(&session->packAdd_Qlstn_state, 0, sizeof(session->packAdd_Qlstn_state)); libssh2_packet_add_jump_point2: session->packAdd_state = libssh2_NB_state_jump2; rc = packet_queue_listener(session, data, datalen, &session->packAdd_Qlstn_state); } else if((datalen >= (sizeof("x11") + 4)) && ((sizeof("x11") - 1) == _libssh2_ntohu32(data + 1)) && (memcmp(data + 5, "x11", sizeof("x11") - 1) == 0)) { /* init the state struct */ memset(&session->packAdd_x11open_state, 0, sizeof(session->packAdd_x11open_state)); libssh2_packet_add_jump_point3: session->packAdd_state = libssh2_NB_state_jump3; rc = packet_x11_open(session, data, datalen, &session->packAdd_x11open_state); } if(rc == LIBSSH2_ERROR_EAGAIN) return rc; LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return rc; /* byte SSH_MSG_CHANNEL_WINDOW_ADJUST uint32 recipient channel uint32 bytes to add */ case SSH_MSG_CHANNEL_WINDOW_ADJUST: if(datalen < 9) ; else { uint32_t bytestoadd = _libssh2_ntohu32(data + 5); channelp = _libssh2_channel_locate(session, _libssh2_ntohu32(data + 1)); if(channelp) { channelp->local.window_size += bytestoadd; _libssh2_debug(session, LIBSSH2_TRACE_CONN, "Window adjust for channel %lu/%lu, " "adding %lu bytes, new window_size=%lu", channelp->local.id, channelp->remote.id, bytestoadd, channelp->local.window_size); } } LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; default: break; } session->packAdd_state = libssh2_NB_state_sent; } if(session->packAdd_state == libssh2_NB_state_sent) { LIBSSH2_PACKET *packetp = LIBSSH2_ALLOC(session, sizeof(LIBSSH2_PACKET)); if(!packetp) { _libssh2_debug(session, LIBSSH2_ERROR_ALLOC, "memory for packet"); LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return LIBSSH2_ERROR_ALLOC; } packetp->data = data; packetp->data_len = datalen; packetp->data_head = data_head; _libssh2_list_add(&session->packets, &packetp->node); session->packAdd_state = libssh2_NB_state_sent1; } if((msg == SSH_MSG_KEXINIT && !(session->state & LIBSSH2_STATE_EXCHANGING_KEYS)) || (session->packAdd_state == libssh2_NB_state_sent2)) { if(session->packAdd_state == libssh2_NB_state_sent1) { /* * Remote wants new keys * Well, it's already in the brigade, * let's just call back into ourselves */ _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Renegotiating Keys"); session->packAdd_state = libssh2_NB_state_sent2; } /* * The KEXINIT message has been added to the queue. The packAdd and * readPack states need to be reset because _libssh2_kex_exchange * (eventually) calls upon _libssh2_transport_read to read the rest of * the key exchange conversation. */ session->readPack_state = libssh2_NB_state_idle; session->packet.total_num = 0; session->packAdd_state = libssh2_NB_state_idle; session->fullpacket_state = libssh2_NB_state_idle; memset(&session->startup_key_state, 0, sizeof(key_exchange_state_t)); /* * If there was a key reexchange failure, let's just hope we didn't * send NEWKEYS yet, otherwise remote will drop us like a rock */ rc = _libssh2_kex_exchange(session, 1, &session->startup_key_state); if(rc == LIBSSH2_ERROR_EAGAIN) return rc; } session->packAdd_state = libssh2_NB_state_idle; return 0; }
2392
True
1
CVE-2020-19497
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://github.com/tbeu/matio/commit/5fa49ef9fc4368fe3d19b5fdaa36d8fa5e7f4606', 'name': 'https://github.com/tbeu/matio/commit/5fa49ef9fc4368fe3d19b5fdaa36d8fa5e7f4606', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tbeu/matio/issues/121', 'name': 'https://github.com/tbeu/matio/issues/121', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:matio_project:matio:1.5.17:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Integer overflow vulnerability in Mat_VarReadNextInfo5 in mat5.c in tbeu matio (aka MAT File I/O Library) 1.5.17, allows attackers to cause a Denial of Service or possibly other unspecified impacts.'}]
2021-07-30T15:52Z
2021-07-21T18: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
tbeu
2019-07-29 14:25:56+02:00
Fix integer addition overflow As reported by https://github.com/tbeu/matio/issues/121
5fa49ef9fc4368fe3d19b5fdaa36d8fa5e7f4606
False
tbeu/matio
MATLAB MAT File I/O Library
2015-12-22 21:59:57
2022-05-01 04:03:35
https://matio.sourceforge.io
tbeu
258.0
85.0
ReadNextCell
ReadNextCell( mat_t * mat , matvar_t * matvar)
['mat', 'matvar']
ReadNextCell( mat_t *mat, matvar_t *matvar ) { size_t bytesread = 0, i; int err; matvar_t **cells = NULL; size_t nelems = 1; err = SafeMulDims(matvar, &nelems); if ( err ) { Mat_Critical("Integer multiplication overflow"); return bytesread; } matvar->data_size = sizeof(matvar_t *); err = SafeMul(&matvar->nbytes, nelems, matvar->data_size); if ( err ) { Mat_Critical("Integer multiplication overflow"); return bytesread; } matvar->data = calloc(nelems, matvar->data_size); if ( NULL == matvar->data ) { if ( NULL != matvar->name ) Mat_Critical("Couldn't allocate memory for %s->data", matvar->name); return bytesread; } cells = (matvar_t **)matvar->data; if ( matvar->compression == MAT_COMPRESSION_ZLIB ) { #if defined(HAVE_ZLIB) mat_uint32_t uncomp_buf[16] = {0,}; int nbytes; mat_uint32_t array_flags; for ( i = 0; i < nelems; i++ ) { cells[i] = Mat_VarCalloc(); if ( NULL == cells[i] ) { Mat_Critical("Couldn't allocate memory for cell %" SIZE_T_FMTSTR, i); continue; } /* Read variable tag for cell */ uncomp_buf[0] = 0; uncomp_buf[1] = 0; bytesread += InflateVarTag(mat,matvar,uncomp_buf); if ( mat->byteswap ) { (void)Mat_uint32Swap(uncomp_buf); (void)Mat_uint32Swap(uncomp_buf+1); } nbytes = uncomp_buf[1]; if ( 0 == nbytes ) { /* Empty cell: Memory optimization */ free(cells[i]->internal); cells[i]->internal = NULL; continue; } else if ( uncomp_buf[0] != MAT_T_MATRIX ) { Mat_VarFree(cells[i]); cells[i] = NULL; Mat_Critical("cells[%" SIZE_T_FMTSTR "], Uncompressed type not MAT_T_MATRIX", i); break; } cells[i]->compression = MAT_COMPRESSION_ZLIB; bytesread += InflateArrayFlags(mat,matvar,uncomp_buf); nbytes -= 16; if ( mat->byteswap ) { (void)Mat_uint32Swap(uncomp_buf); (void)Mat_uint32Swap(uncomp_buf+1); (void)Mat_uint32Swap(uncomp_buf+2); (void)Mat_uint32Swap(uncomp_buf+3); } /* Array Flags */ if ( uncomp_buf[0] == MAT_T_UINT32 ) { array_flags = uncomp_buf[2]; cells[i]->class_type = CLASS_FROM_ARRAY_FLAGS(array_flags); cells[i]->isComplex = (array_flags & MAT_F_COMPLEX); cells[i]->isGlobal = (array_flags & MAT_F_GLOBAL); cells[i]->isLogical = (array_flags & MAT_F_LOGICAL); if ( cells[i]->class_type == MAT_C_SPARSE ) { /* Need to find a more appropriate place to store nzmax */ cells[i]->nbytes = uncomp_buf[3]; } } else { Mat_Critical("Expected MAT_T_UINT32 for array tags, got %d", uncomp_buf[0]); bytesread+=InflateSkip(mat,matvar->internal->z,nbytes); } if ( cells[i]->class_type != MAT_C_OPAQUE ) { mat_uint32_t* dims = NULL; int do_clean = 0; bytesread += InflateRankDims(mat,matvar,uncomp_buf,sizeof(uncomp_buf),&dims); if ( NULL == dims ) dims = uncomp_buf + 2; else do_clean = 1; nbytes -= 8; if ( mat->byteswap ) { (void)Mat_uint32Swap(uncomp_buf); (void)Mat_uint32Swap(uncomp_buf+1); } /* Rank and Dimension */ if ( uncomp_buf[0] == MAT_T_INT32 ) { int j; cells[i]->rank = uncomp_buf[1]; nbytes -= cells[i]->rank; cells[i]->rank /= 4; cells[i]->dims = (size_t*)malloc(cells[i]->rank*sizeof(*cells[i]->dims)); if ( mat->byteswap ) { for ( j = 0; j < cells[i]->rank; j++ ) cells[i]->dims[j] = Mat_uint32Swap(dims + j); } else { for ( j = 0; j < cells[i]->rank; j++ ) cells[i]->dims[j] = dims[j]; } if ( cells[i]->rank % 2 != 0 ) nbytes -= 4; } if ( do_clean ) free(dims); /* Variable name tag */ bytesread += InflateVarTag(mat,matvar,uncomp_buf); nbytes -= 8; if ( mat->byteswap ) { (void)Mat_uint32Swap(uncomp_buf); (void)Mat_uint32Swap(uncomp_buf+1); } /* Handle cell elements written with a variable name */ if ( uncomp_buf[1] > 0 ) { /* Name of variable */ if ( uncomp_buf[0] == MAT_T_INT8 ) { /* Name not in tag */ mat_uint32_t len = uncomp_buf[1]; if ( len % 8 > 0 ) len = len+(8-(len % 8)); cells[i]->name = (char*)malloc(len+1); nbytes -= len; if ( NULL != cells[i]->name ) { /* Variable name */ bytesread += InflateVarName(mat,matvar,cells[i]->name,len); cells[i]->name[len] = '\0'; } } else { mat_uint32_t len = (uncomp_buf[0] & 0xffff0000) >> 16; if ( ((uncomp_buf[0] & 0x0000ffff) == MAT_T_INT8) && len > 0 && len <= 4 ) { /* Name packed in tag */ cells[i]->name = (char*)malloc(len+1); if ( NULL != cells[i]->name ) { memcpy(cells[i]->name,uncomp_buf+1,len); cells[i]->name[len] = '\0'; } } } } cells[i]->internal->z = (z_streamp)calloc(1,sizeof(z_stream)); if ( cells[i]->internal->z != NULL ) { err = inflateCopy(cells[i]->internal->z,matvar->internal->z); if ( err == Z_OK ) { cells[i]->internal->datapos = ftell((FILE*)mat->fp); if ( cells[i]->internal->datapos != -1L ) { cells[i]->internal->datapos -= matvar->internal->z->avail_in; if ( cells[i]->class_type == MAT_C_STRUCT ) bytesread+=ReadNextStructField(mat,cells[i]); else if ( cells[i]->class_type == MAT_C_CELL ) bytesread+=ReadNextCell(mat,cells[i]); else if ( nbytes <= (1 << MAX_WBITS) ) { /* Memory optimization: Read data if less in size than the zlib inflate state (approximately) */ Mat_VarRead5(mat,cells[i]); cells[i]->internal->data = cells[i]->data; cells[i]->data = NULL; } (void)fseek((FILE*)mat->fp,cells[i]->internal->datapos,SEEK_SET); } else { Mat_Critical("Couldn't determine file position"); } if ( cells[i]->internal->data != NULL || cells[i]->class_type == MAT_C_STRUCT || cells[i]->class_type == MAT_C_CELL ) { /* Memory optimization: Free inflate state */ inflateEnd(cells[i]->internal->z); free(cells[i]->internal->z); cells[i]->internal->z = NULL; } } else { Mat_Critical("inflateCopy returned error %s",zError(err)); } } else { Mat_Critical("Couldn't allocate memory"); } } bytesread+=InflateSkip(mat,matvar->internal->z,nbytes); } #else Mat_Critical("Not compiled with zlib support"); #endif } else { mat_uint32_t buf[6]; int nBytes; mat_uint32_t array_flags; for ( i = 0; i < nelems; i++ ) { int cell_bytes_read,name_len; cells[i] = Mat_VarCalloc(); if ( !cells[i] ) { Mat_Critical("Couldn't allocate memory for cell %" SIZE_T_FMTSTR, i); continue; } /* Read variable tag for cell */ cell_bytes_read = fread(buf,4,2,(FILE*)mat->fp); /* Empty cells at the end of a file may cause an EOF */ if ( !cell_bytes_read ) continue; bytesread += cell_bytes_read; if ( mat->byteswap ) { (void)Mat_uint32Swap(buf); (void)Mat_uint32Swap(buf+1); } nBytes = buf[1]; if ( 0 == nBytes ) { /* Empty cell: Memory optimization */ free(cells[i]->internal); cells[i]->internal = NULL; continue; } else if ( buf[0] != MAT_T_MATRIX ) { Mat_VarFree(cells[i]); cells[i] = NULL; Mat_Critical("cells[%" SIZE_T_FMTSTR "] not MAT_T_MATRIX, fpos = %ld", i, ftell((FILE*)mat->fp)); break; } /* Read array flags and the dimensions tag */ bytesread += fread(buf,4,6,(FILE*)mat->fp); if ( mat->byteswap ) { (void)Mat_uint32Swap(buf); (void)Mat_uint32Swap(buf+1); (void)Mat_uint32Swap(buf+2); (void)Mat_uint32Swap(buf+3); (void)Mat_uint32Swap(buf+4); (void)Mat_uint32Swap(buf+5); } nBytes-=24; /* Array flags */ if ( buf[0] == MAT_T_UINT32 ) { array_flags = buf[2]; cells[i]->class_type = CLASS_FROM_ARRAY_FLAGS(array_flags); cells[i]->isComplex = (array_flags & MAT_F_COMPLEX); cells[i]->isGlobal = (array_flags & MAT_F_GLOBAL); cells[i]->isLogical = (array_flags & MAT_F_LOGICAL); if ( cells[i]->class_type == MAT_C_SPARSE ) { /* Need to find a more appropriate place to store nzmax */ cells[i]->nbytes = buf[3]; } } /* Rank and dimension */ { size_t nbytes = ReadRankDims(mat, cells[i], (enum matio_types)buf[4], buf[5]); bytesread += nbytes; nBytes -= nbytes; } /* Variable name tag */ bytesread+=fread(buf,1,8,(FILE*)mat->fp); nBytes-=8; if ( mat->byteswap ) { (void)Mat_uint32Swap(buf); (void)Mat_uint32Swap(buf+1); } name_len = 0; if ( buf[1] > 0 ) { /* Name of variable */ if ( buf[0] == MAT_T_INT8 ) { /* Name not in tag */ name_len = buf[1]; if ( name_len % 8 > 0 ) name_len = name_len+(8-(name_len % 8)); nBytes -= name_len; (void)fseek((FILE*)mat->fp,name_len,SEEK_CUR); } } cells[i]->internal->datapos = ftell((FILE*)mat->fp); if ( cells[i]->internal->datapos != -1L ) { if ( cells[i]->class_type == MAT_C_STRUCT ) bytesread+=ReadNextStructField(mat,cells[i]); if ( cells[i]->class_type == MAT_C_CELL ) bytesread+=ReadNextCell(mat,cells[i]); (void)fseek((FILE*)mat->fp,cells[i]->internal->datapos+nBytes,SEEK_SET); } else { Mat_Critical("Couldn't determine file position"); } } } return bytesread; }
2098
True
1
CVE-2019-6976
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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/libvips/libvips/releases/tag/v8.7.4', 'name': 'https://github.com/libvips/libvips/releases/tag/v8.7.4', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libvips/libvips/commit/00622428bda8d7521db8d74260b519fa41d69d0a', 'name': 'https://github.com/libvips/libvips/commit/00622428bda8d7521db8d74260b519fa41d69d0a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.silentsignal.eu/2019/04/18/drop-by-drop-bleeding-through-libvips/', 'name': 'https://blog.silentsignal.eu/2019/04/18/drop-by-drop-bleeding-through-libvips/', 'refsource': 'MISC', 'tags': ['Technical Description', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvips_project:libvips:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.7.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libvips before 8.7.4 generates output images from uninitialized memory locations when processing corrupted input image data because iofuncs/memory.c does not zero out allocated memory. This can result in leaking raw process memory contents through the output image.'}]
2020-08-24T17:37Z
2019-01-26T23:29Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
John Cupitt
2019-01-18 10:10:43+00:00
zero memory on malloc to prevent write of uninit memory under some error conditions thanks Balint
00622428bda8d7521db8d74260b519fa41d69d0a
False
libvips/libvips
A fast image processing library with low memory needs.
2011-01-25 13:15:00
2022-08-27 13:15:24
https://libvips.github.io/libvips/
libvips
7072.0
541.0
vips_malloc
vips_malloc( VipsObject * object , size_t size)
['object', 'size']
vips_malloc( VipsObject *object, size_t size ) { void *buf; buf = g_malloc( size ); if( object ) { g_signal_connect( object, "postclose", G_CALLBACK( vips_malloc_cb ), buf ); object->local_memory += size; } return( buf ); }
53
True
1
CVE-2019-6976
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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/libvips/libvips/releases/tag/v8.7.4', 'name': 'https://github.com/libvips/libvips/releases/tag/v8.7.4', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libvips/libvips/commit/00622428bda8d7521db8d74260b519fa41d69d0a', 'name': 'https://github.com/libvips/libvips/commit/00622428bda8d7521db8d74260b519fa41d69d0a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.silentsignal.eu/2019/04/18/drop-by-drop-bleeding-through-libvips/', 'name': 'https://blog.silentsignal.eu/2019/04/18/drop-by-drop-bleeding-through-libvips/', 'refsource': 'MISC', 'tags': ['Technical Description', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvips_project:libvips:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.7.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libvips before 8.7.4 generates output images from uninitialized memory locations when processing corrupted input image data because iofuncs/memory.c does not zero out allocated memory. This can result in leaking raw process memory contents through the output image.'}]
2020-08-24T17:37Z
2019-01-26T23:29Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
John Cupitt
2019-01-18 10:10:43+00:00
zero memory on malloc to prevent write of uninit memory under some error conditions thanks Balint
00622428bda8d7521db8d74260b519fa41d69d0a
False
libvips/libvips
A fast image processing library with low memory needs.
2011-01-25 13:15:00
2022-08-27 13:15:24
https://libvips.github.io/libvips/
libvips
7072.0
541.0
vips_tracked_malloc
vips_tracked_malloc( size_t size)
['size']
vips_tracked_malloc( size_t size ) { void *buf; vips_tracked_init(); /* Need an extra sizeof(size_t) bytes to track * size of this block. Ask for an extra 16 to make sure we don't break * alignment rules. */ size += 16; if( !(buf = g_try_malloc( size )) ) { #ifdef DEBUG g_assert_not_reached(); #endif /*DEBUG*/ vips_error( "vips_tracked", _( "out of memory --- size == %dMB" ), (int) (size / (1024.0 * 1024.0)) ); g_warning( _( "out of memory --- size == %dMB" ), (int) (size / (1024.0 * 1024.0)) ); return( NULL ); } g_mutex_lock( vips_tracked_mutex ); *((size_t *)buf) = size; buf = (void *) ((char *)buf + 16); vips_tracked_mem += size; if( vips_tracked_mem > vips_tracked_mem_highwater ) vips_tracked_mem_highwater = vips_tracked_mem; vips_tracked_allocs += 1; #ifdef DEBUG_VERBOSE printf( "vips_tracked_malloc: %p, %zd bytes\n", buf, size ); #endif /*DEBUG_VERBOSE*/ g_mutex_unlock( vips_tracked_mutex ); VIPS_GATE_MALLOC( size ); return( buf ); }
168
True
1
CVE-2019-17534
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16796', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16796', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/libvips/libvips/commit/ce684dd008532ea0bf9d4a1d89bacb35f4a83f4d', 'name': 'https://github.com/libvips/libvips/commit/ce684dd008532ea0bf9d4a1d89bacb35f4a83f4d', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'https://github.com/libvips/libvips/compare/v8.8.1...v8.8.2', 'name': 'https://github.com/libvips/libvips/compare/v8.8.1...v8.8.2', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvips_project:libvips:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.8.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'vips_foreign_load_gif_scan_image in foreign/gifload.c in libvips before 8.8.2 tries to access a color map before a DGifGetImageDesc call, leading to a use-after-free.'}]
2019-10-17T16:10Z
2019-10-13T02:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process. If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.
https://cwe.mitre.org/data/definitions/416.html
0
John Cupitt
2019-08-27 12:50:52+01:00
fetch map after DGifGetImageDesc() Earlier refactoring broke GIF map fetch.
ce684dd008532ea0bf9d4a1d89bacb35f4a83f4d
False
libvips/libvips
A fast image processing library with low memory needs.
2011-01-25 13:15:00
2022-08-27 13:15:24
https://libvips.github.io/libvips/
libvips
7072.0
541.0
vips_foreign_load_gif_scan_image
vips_foreign_load_gif_scan_image( VipsForeignLoadGif * gif)
['gif']
vips_foreign_load_gif_scan_image( VipsForeignLoadGif *gif ) { VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( gif ); GifFileType *file = gif->file; ColorMapObject *map = file->Image.ColorMap ? file->Image.ColorMap : file->SColorMap; GifByteType *extension; if( DGifGetImageDesc( gif->file ) == GIF_ERROR ) { vips_foreign_load_gif_error( gif ); return( -1 ); } /* Check that the frame looks sane. Perhaps giflib checks * this for us. */ if( file->Image.Left < 0 || file->Image.Width < 1 || file->Image.Width > 10000 || file->Image.Left + file->Image.Width > file->SWidth || file->Image.Top < 0 || file->Image.Height < 1 || file->Image.Height > 10000 || file->Image.Top + file->Image.Height > file->SHeight ) { vips_error( class->nickname, "%s", _( "bad frame size" ) ); return( -1 ); } /* Test for a non-greyscale colourmap for this frame. */ if( !gif->has_colour && map ) { int i; for( i = 0; i < map->ColorCount; i++ ) if( map->Colors[i].Red != map->Colors[i].Green || map->Colors[i].Green != map->Colors[i].Blue ) { gif->has_colour = TRUE; break; } } /* Step over compressed image data. */ do { if( vips_foreign_load_gif_code_next( gif, &extension ) ) return( -1 ); } while( extension != NULL ); return( 0 ); }
285
True
1
CVE-2019-17544
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/GNUAspell/aspell/commit/80fa26c74279fced8d778351cff19d1d8f44fe4e', 'name': 'https://github.com/GNUAspell/aspell/commit/80fa26c74279fced8d778351cff19d1d8f44fe4e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/GNUAspell/aspell/compare/rel-0.60.7...rel-0.60.8', 'name': 'https://github.com/GNUAspell/aspell/compare/rel-0.60.7...rel-0.60.8', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16109', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16109', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4155-1/', 'name': 'USN-4155-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00027.html', 'name': '[debian-lts-announce] 20191019 [SECURITY] [DLA 1966-1] aspell security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/4155-2/', 'name': 'USN-4155-2', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/07/msg00021.html', 'name': '[debian-lts-announce] 20210725 [SECURITY] [DLA 2720-1] aspell security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2021/dsa-4948', 'name': 'DSA-4948', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:aspell:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.60.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:12.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'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:14.04:*:*:*:lts:*:*:*', '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:19.04:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libaspell.a in GNU Aspell before 0.60.8 has a stack-based buffer over-read in acommon::unescape in common/getdata.cpp via an isolated \\ character.'}]
2021-08-02T00:15Z
2019-10-14T02: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 Atkinson
2019-08-04 04:20:29-04:00
Fix various bugs found by OSS-Fuze.
80fa26c74279fced8d778351cff19d1d8f44fe4e
False
GNUAspell/aspell
null
2016-12-11 04:01:31
2022-06-15 21:12:03
http://aspell.net
GNUAspell
193.0
48.0
acommon::combine_list
acommon::combine_list( String & res , const StringList & in)
['res', 'in']
void combine_list(String & res, const StringList & in) { res.clear(); StringListEnumeration els = in.elements_obj(); const char * s = 0; while ( (s = els.next()) != 0) { for (; *s; ++s) { if (*s == ':') res.append('\\'); res.append(*s); } res.append(':'); } if (res.back() == ':') res.pop_back(); }
107
True
1
CVE-2019-17544
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/GNUAspell/aspell/commit/80fa26c74279fced8d778351cff19d1d8f44fe4e', 'name': 'https://github.com/GNUAspell/aspell/commit/80fa26c74279fced8d778351cff19d1d8f44fe4e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/GNUAspell/aspell/compare/rel-0.60.7...rel-0.60.8', 'name': 'https://github.com/GNUAspell/aspell/compare/rel-0.60.7...rel-0.60.8', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16109', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16109', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4155-1/', 'name': 'USN-4155-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00027.html', 'name': '[debian-lts-announce] 20191019 [SECURITY] [DLA 1966-1] aspell security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/4155-2/', 'name': 'USN-4155-2', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/07/msg00021.html', 'name': '[debian-lts-announce] 20210725 [SECURITY] [DLA 2720-1] aspell security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2021/dsa-4948', 'name': 'DSA-4948', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:aspell:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.60.8', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:12.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'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:14.04:*:*:*:lts:*:*:*', '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:19.04:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libaspell.a in GNU Aspell before 0.60.8 has a stack-based buffer over-read in acommon::unescape in common/getdata.cpp via an isolated \\ character.'}]
2021-08-02T00:15Z
2019-10-14T02: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 Atkinson
2019-08-04 04:20:29-04:00
Fix various bugs found by OSS-Fuze.
80fa26c74279fced8d778351cff19d1d8f44fe4e
False
GNUAspell/aspell
null
2016-12-11 04:01:31
2022-06-15 21:12:03
http://aspell.net
GNUAspell
193.0
48.0
acommon::unescape
acommon::unescape( char * dest , const char * src)
['dest', 'src']
char * unescape(char * dest, const char * src) { while (*src) { if (*src == '\\') { ++src; switch (*src) { case 'n': *dest = '\n'; break; case 'r': *dest = '\r'; break; case 't': *dest = '\t'; break; case 'f': *dest = '\f'; break; case 'v': *dest = '\v'; break; default: *dest = *src; } } else { *dest = *src; } ++src; ++dest; } *dest = '\0'; return dest; }
120
True
1
CVE-2019-25050
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/OSGeo/gdal/commit/767e3a56144f676ca738ef8f700e0e56035bd05a', 'name': 'https://github.com/OSGeo/gdal/commit/767e3a56144f676ca738ef8f700e0e56035bd05a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/gdal/OSV-2020-420.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/gdal/OSV-2020-420.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15143', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15143', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OSGeo/gdal/commit/27b9bf644bcf1208f7d6594bdd104cc8a8bb0646', 'name': 'https://github.com/OSGeo/gdal/commit/27b9bf644bcf1208f7d6594bdd104cc8a8bb0646', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15156', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15156', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/gdal/OSV-2020-392.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/gdal/OSV-2020-392.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:osgeo:gdal:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.4.2', 'versionEndIncluding': '3.0.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'netCDF in GDAL 2.4.2 through 3.0.4 has a stack-based buffer overflow in nc4_get_att (called from nc4_get_att_tc and nc_get_att_text) and in uffd_cleanup (called from netCDFDataset::~netCDFDataset and netCDFDataset::~netCDFDataset).'}]
2021-07-29T18:27Z
2021-07-20T07: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
Even Rouault
2019-06-06 21:56:17+02:00
netCDF: avoid buffer overflow. master only. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15143. Credit to OSS Fuzz
767e3a56144f676ca738ef8f700e0e56035bd05a
False
OSGeo/gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
2012-10-09 21:39:58
2022-08-27 17:35:41
https://gdal.org
OSGeo
3298.0
1845.0
nccfdriver::attrf
nccfdriver::attrf( int ncid , int varId , const char * attrName , std :: string & alloc)
['ncid', 'varId', 'attrName', 'alloc']
std::string& attrf(int ncid, int varId, const char * attrName, std::string& alloc) { alloc = ""; size_t len = 0; nc_inq_attlen(ncid, varId, attrName, &len); if(len < 1) { return alloc; } char attr_vals[NC_MAX_NAME + 1]; memset(attr_vals, 0, NC_MAX_NAME + 1); // Now look through this variable for the attribute if(nc_get_att_text(ncid, varId, attrName, attr_vals) != NC_NOERR) { return alloc; } alloc = std::string(attr_vals); return alloc; }
104
True
1
CVE-2019-17545
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/OSGeo/gdal/commit/148115fcc40f1651a5d15fa34c9a8c528e7147bb', 'name': 'https://github.com/OSGeo/gdal/commit/148115fcc40f1651a5d15fa34c9a8c528e7147bb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16178', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16178', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00005.html', 'name': '[debian-lts-announce] 20191109 [SECURITY] [DLA 1984-1] gdal security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00022.html', 'name': 'openSUSE-SU-2019:2466', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XVRC3EBQBFBVQC26XJE3AI3KQXC2NGTP/', 'name': 'FEDORA-2019-a6960910d8', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/CB7RRPCQP253XA5MYUOLHLRPKNGKVZNT/', 'name': 'FEDORA-2019-f511b38b1f', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/01/msg00004.html', 'name': '[debian-lts-announce] 20220112 [SECURITY] [DLA 2877-1] gdal security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-415'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:osgeo:gdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.0.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:spatial_and_graph:19c:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:spatial_and_graph:12.2.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opensuse:backports_sle:15.0:sp1:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'GDAL through 3.0.1 has a poolDestroy double free in OGRExpatRealloc in ogr/ogr_expat.cpp when the 10MB threshold is exceeded.'}]
2022-03-30T14:58Z
2019-10-14T02: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
Even Rouault
2019-08-04 21:00:33+02:00
OGRExpatRealloc(): fix double-free when size to allocate is above the default 10MB threshold. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16178. Credit to OSS Fuzz
148115fcc40f1651a5d15fa34c9a8c528e7147bb
False
OSGeo/gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
2012-10-09 21:39:58
2022-08-27 17:35:41
https://gdal.org
OSGeo
3298.0
1845.0
OGRExpatRealloc
OGRExpatRealloc( void * ptr , size_t size)
['ptr', 'size']
static void* OGRExpatRealloc( void *ptr, size_t size ) { if( CanAlloc(size) ) return realloc(ptr, size); free(ptr); return nullptr; }
34
True
1
CVE-2019-17546
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'name': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'name': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00027.html', 'name': '[debian-lts-announce] 20191126 [SECURITY] [DLA 2009-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2020/Jan/32', 'name': '20200121 [SECURITY] [DSA 4608-1] tiff security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4608', 'name': 'DSA-4608', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LM5ZW7E3IEW7LT2BPJP7D3RN6OUOE3MX/', 'name': 'FEDORA-2020-2e9bd06377', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M3S4WNIMZ7XSLY2LD5FPRPZMGNUBVKOG/', 'name': 'FEDORA-2020-6f1209bb45', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-25', 'name': 'GLSA-202003-25', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00020.html', 'name': '[debian-lts-announce] 20200318 [SECURITY] [DLA 2147-1] gdal security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4670', 'name': 'DSA-4670', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:osgeo:gdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'tif_getimage.c in LibTIFF through 4.0.10, as used in GDAL through 3.0.1 and other products, has an integer overflow that potentially causes a heap-based buffer overflow via a crafted RGBA image, related to a "Negative-size-param" condition.'}]
2020-08-24T17:37Z
2019-10-14T02: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
Even Rouault
2019-08-15 15:04:58+02:00
Internal libtiff: fix integer overflow potentially causing write heap buffer overflow, especially on 32 bit builds. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443. Credit to OSS Fuzz
21674033ee246f698887604c7af7ba1962a40ddf
False
OSGeo/gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
2012-10-09 21:39:58
2022-08-27 17:35:41
https://gdal.org
OSGeo
3298.0
1845.0
gtStripContig
gtStripContig( TIFFRGBAImage * img , uint32 * raster , uint32 w , uint32 h)
['img', 'raster', 'w', 'h']
gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { TIFF* tif = img->tif; tileContigRoutine put = img->put.contig; uint32 row, y, nrow, nrowsub, rowstoread; tmsize_t pos; unsigned char* buf = NULL; uint32 rowsperstrip; uint16 subsamplinghor,subsamplingver; uint32 imagewidth = img->width; tmsize_t scanline; int32 fromskew, toskew; int ret = 1, flip; tmsize_t maxstripsize; TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver); if( subsamplingver == 0 ) { TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Invalid vertical YCbCr subsampling"); return (0); } maxstripsize = TIFFStripSize(tif); flip = setorientation(img); if (flip & FLIP_VERTICALLY) { y = h - 1; toskew = -(int32)(w + w); } else { y = 0; toskew = -(int32)(w - w); } TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); scanline = TIFFScanlineSize(tif); fromskew = (w < imagewidth ? imagewidth - w : 0); for (row = 0; row < h; row += nrow) { rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); nrowsub = nrow; if ((nrowsub%subsamplingver)!=0) nrowsub+=subsamplingver-nrowsub%subsamplingver; if (_TIFFReadEncodedStripAndAllocBuffer(tif, TIFFComputeStrip(tif,row+img->row_offset, 0), (void**)(&buf), maxstripsize, ((row + img->row_offset)%rowsperstrip + nrowsub) * scanline)==(tmsize_t)(-1) && (buf == NULL || img->stoponerr)) { ret = 0; break; } pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ ((tmsize_t) img->col_offset * img->samplesperpixel); (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos); y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow); } if (flip & FLIP_HORIZONTALLY) { uint32 line; for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; while ( left < right ) { uint32 temp = *left; *left = *right; *right = temp; left++; right--; } } } _TIFFfree(buf); return (ret); }
530
True
1
CVE-2019-17546
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'name': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'name': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00027.html', 'name': '[debian-lts-announce] 20191126 [SECURITY] [DLA 2009-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2020/Jan/32', 'name': '20200121 [SECURITY] [DSA 4608-1] tiff security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4608', 'name': 'DSA-4608', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LM5ZW7E3IEW7LT2BPJP7D3RN6OUOE3MX/', 'name': 'FEDORA-2020-2e9bd06377', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M3S4WNIMZ7XSLY2LD5FPRPZMGNUBVKOG/', 'name': 'FEDORA-2020-6f1209bb45', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-25', 'name': 'GLSA-202003-25', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00020.html', 'name': '[debian-lts-announce] 20200318 [SECURITY] [DLA 2147-1] gdal security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4670', 'name': 'DSA-4670', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:osgeo:gdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'tif_getimage.c in LibTIFF through 4.0.10, as used in GDAL through 3.0.1 and other products, has an integer overflow that potentially causes a heap-based buffer overflow via a crafted RGBA image, related to a "Negative-size-param" condition.'}]
2020-08-24T17:37Z
2019-10-14T02: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
Even Rouault
2019-08-15 15:04:58+02:00
Internal libtiff: fix integer overflow potentially causing write heap buffer overflow, especially on 32 bit builds. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443. Credit to OSS Fuzz
21674033ee246f698887604c7af7ba1962a40ddf
False
OSGeo/gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
2012-10-09 21:39:58
2022-08-27 17:35:41
https://gdal.org
OSGeo
3298.0
1845.0
gtStripContig
gtStripContig( TIFFRGBAImage * img , uint32 * raster , uint32 w , uint32 h)
['img', 'raster', 'w', 'h']
gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { TIFF* tif = img->tif; tileContigRoutine put = img->put.contig; uint32 row, y, nrow, nrowsub, rowstoread; tmsize_t pos; unsigned char* buf = NULL; uint32 rowsperstrip; uint16 subsamplinghor,subsamplingver; uint32 imagewidth = img->width; tmsize_t scanline; int32 fromskew, toskew; int ret = 1, flip; tmsize_t maxstripsize; TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver); if( subsamplingver == 0 ) { TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Invalid vertical YCbCr subsampling"); return (0); } maxstripsize = TIFFStripSize(tif); flip = setorientation(img); if (flip & FLIP_VERTICALLY) { y = h - 1; toskew = -(int32)(w + w); } else { y = 0; toskew = -(int32)(w - w); } TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); scanline = TIFFScanlineSize(tif); fromskew = (w < imagewidth ? imagewidth - w : 0); for (row = 0; row < h; row += nrow) { rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); nrowsub = nrow; if ((nrowsub%subsamplingver)!=0) nrowsub+=subsamplingver-nrowsub%subsamplingver; if (_TIFFReadEncodedStripAndAllocBuffer(tif, TIFFComputeStrip(tif,row+img->row_offset, 0), (void**)(&buf), maxstripsize, ((row + img->row_offset)%rowsperstrip + nrowsub) * scanline)==(tmsize_t)(-1) && (buf == NULL || img->stoponerr)) { ret = 0; break; } pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ ((tmsize_t) img->col_offset * img->samplesperpixel); (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos); y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow); } if (flip & FLIP_HORIZONTALLY) { uint32 line; for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; while ( left < right ) { uint32 temp = *left; *left = *right; *right = temp; left++; right--; } } } _TIFFfree(buf); return (ret); }
530
True
1
CVE-2019-17546
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'name': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'name': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00027.html', 'name': '[debian-lts-announce] 20191126 [SECURITY] [DLA 2009-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2020/Jan/32', 'name': '20200121 [SECURITY] [DSA 4608-1] tiff security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4608', 'name': 'DSA-4608', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LM5ZW7E3IEW7LT2BPJP7D3RN6OUOE3MX/', 'name': 'FEDORA-2020-2e9bd06377', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M3S4WNIMZ7XSLY2LD5FPRPZMGNUBVKOG/', 'name': 'FEDORA-2020-6f1209bb45', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-25', 'name': 'GLSA-202003-25', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00020.html', 'name': '[debian-lts-announce] 20200318 [SECURITY] [DLA 2147-1] gdal security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4670', 'name': 'DSA-4670', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:osgeo:gdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'tif_getimage.c in LibTIFF through 4.0.10, as used in GDAL through 3.0.1 and other products, has an integer overflow that potentially causes a heap-based buffer overflow via a crafted RGBA image, related to a "Negative-size-param" condition.'}]
2020-08-24T17:37Z
2019-10-14T02: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
Even Rouault
2019-08-15 15:04:58+02:00
Internal libtiff: fix integer overflow potentially causing write heap buffer overflow, especially on 32 bit builds. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443. Credit to OSS Fuzz
21674033ee246f698887604c7af7ba1962a40ddf
False
OSGeo/gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
2012-10-09 21:39:58
2022-08-27 17:35:41
https://gdal.org
OSGeo
3298.0
1845.0
gtStripSeparate
gtStripSeparate( TIFFRGBAImage * img , uint32 * raster , uint32 w , uint32 h)
['img', 'raster', 'w', 'h']
gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { TIFF* tif = img->tif; tileSeparateRoutine put = img->put.separate; unsigned char *buf = NULL; unsigned char *p0 = NULL, *p1 = NULL, *p2 = NULL, *pa = NULL; uint32 row, y, nrow, rowstoread; tmsize_t pos; tmsize_t scanline; uint32 rowsperstrip, offset_row; uint32 imagewidth = img->width; tmsize_t stripsize; tmsize_t bufsize; int32 fromskew, toskew; int alpha = img->alpha; int ret = 1, flip; uint16 colorchannels; stripsize = TIFFStripSize(tif); bufsize = _TIFFMultiplySSize(tif,alpha?4:3,stripsize, "gtStripSeparate"); if (bufsize == 0) { return (0); } flip = setorientation(img); if (flip & FLIP_VERTICALLY) { y = h - 1; toskew = -(int32)(w + w); } else { y = 0; toskew = -(int32)(w - w); } switch( img->photometric ) { case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: case PHOTOMETRIC_PALETTE: colorchannels = 1; break; default: colorchannels = 3; break; } TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); scanline = TIFFScanlineSize(tif); fromskew = (w < imagewidth ? imagewidth - w : 0); for (row = 0; row < h; row += nrow) { rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); offset_row = row + img->row_offset; if( buf == NULL ) { if (_TIFFReadEncodedStripAndAllocBuffer( tif, TIFFComputeStrip(tif, offset_row, 0), (void**) &buf, bufsize, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) && (buf == NULL || img->stoponerr)) { ret = 0; break; } p0 = buf; if( colorchannels == 1 ) { p2 = p1 = p0; pa = (alpha?(p0+3*stripsize):NULL); } else { p1 = p0 + stripsize; p2 = p1 + stripsize; pa = (alpha?(p2+stripsize):NULL); } } else if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), p0, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } if (colorchannels > 1 && TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), p1, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } if (colorchannels > 1 && TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), p2, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } if (alpha) { if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, colorchannels), pa, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } } pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ ((tmsize_t) img->col_offset * img->samplesperpixel); (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow); } if (flip & FLIP_HORIZONTALLY) { uint32 line; for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; while ( left < right ) { uint32 temp = *left; *left = *right; *right = temp; left++; right--; } } } _TIFFfree(buf); return (ret); }
883
True
1
CVE-2019-17546
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'name': 'https://gitlab.com/libtiff/libtiff/commit/4bb584a35f87af42d6cf09d15e9ce8909a839145', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'name': 'https://github.com/OSGeo/gdal/commit/21674033ee246f698887604c7af7ba1962a40ddf', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/11/msg00027.html', 'name': '[debian-lts-announce] 20191126 [SECURITY] [DLA 2009-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2020/Jan/32', 'name': '20200121 [SECURITY] [DSA 4608-1] tiff security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4608', 'name': 'DSA-4608', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LM5ZW7E3IEW7LT2BPJP7D3RN6OUOE3MX/', 'name': 'FEDORA-2020-2e9bd06377', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M3S4WNIMZ7XSLY2LD5FPRPZMGNUBVKOG/', 'name': 'FEDORA-2020-6f1209bb45', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-25', 'name': 'GLSA-202003-25', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00020.html', 'name': '[debian-lts-announce] 20200318 [SECURITY] [DLA 2147-1] gdal security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4670', 'name': 'DSA-4670', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:osgeo:gdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'tif_getimage.c in LibTIFF through 4.0.10, as used in GDAL through 3.0.1 and other products, has an integer overflow that potentially causes a heap-based buffer overflow via a crafted RGBA image, related to a "Negative-size-param" condition.'}]
2020-08-24T17:37Z
2019-10-14T02: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
Even Rouault
2019-08-15 15:04:58+02:00
Internal libtiff: fix integer overflow potentially causing write heap buffer overflow, especially on 32 bit builds. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16443. Credit to OSS Fuzz
21674033ee246f698887604c7af7ba1962a40ddf
False
OSGeo/gdal
GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats.
2012-10-09 21:39:58
2022-08-27 17:35:41
https://gdal.org
OSGeo
3298.0
1845.0
gtStripSeparate
gtStripSeparate( TIFFRGBAImage * img , uint32 * raster , uint32 w , uint32 h)
['img', 'raster', 'w', 'h']
gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { TIFF* tif = img->tif; tileSeparateRoutine put = img->put.separate; unsigned char *buf = NULL; unsigned char *p0 = NULL, *p1 = NULL, *p2 = NULL, *pa = NULL; uint32 row, y, nrow, rowstoread; tmsize_t pos; tmsize_t scanline; uint32 rowsperstrip, offset_row; uint32 imagewidth = img->width; tmsize_t stripsize; tmsize_t bufsize; int32 fromskew, toskew; int alpha = img->alpha; int ret = 1, flip; uint16 colorchannels; stripsize = TIFFStripSize(tif); bufsize = _TIFFMultiplySSize(tif,alpha?4:3,stripsize, "gtStripSeparate"); if (bufsize == 0) { return (0); } flip = setorientation(img); if (flip & FLIP_VERTICALLY) { y = h - 1; toskew = -(int32)(w + w); } else { y = 0; toskew = -(int32)(w - w); } switch( img->photometric ) { case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: case PHOTOMETRIC_PALETTE: colorchannels = 1; break; default: colorchannels = 3; break; } TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); scanline = TIFFScanlineSize(tif); fromskew = (w < imagewidth ? imagewidth - w : 0); for (row = 0; row < h; row += nrow) { rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); offset_row = row + img->row_offset; if( buf == NULL ) { if (_TIFFReadEncodedStripAndAllocBuffer( tif, TIFFComputeStrip(tif, offset_row, 0), (void**) &buf, bufsize, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) && (buf == NULL || img->stoponerr)) { ret = 0; break; } p0 = buf; if( colorchannels == 1 ) { p2 = p1 = p0; pa = (alpha?(p0+3*stripsize):NULL); } else { p1 = p0 + stripsize; p2 = p1 + stripsize; pa = (alpha?(p2+stripsize):NULL); } } else if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), p0, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } if (colorchannels > 1 && TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), p1, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } if (colorchannels > 1 && TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), p2, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } if (alpha) { if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, colorchannels), pa, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) && img->stoponerr) { ret = 0; break; } } pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ ((tmsize_t) img->col_offset * img->samplesperpixel); (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow); } if (flip & FLIP_HORIZONTALLY) { uint32 line; for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; while ( left < right ) { uint32 temp = *left; *left = *right; *right = temp; left++; right--; } } } _TIFFfree(buf); return (ret); }
883
True
1
CVE-2019-18224
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/libidn/libidn2/compare/libidn2-2.1.0...libidn2-2.1.1', 'name': 'https://github.com/libidn/libidn2/compare/libidn2-2.1.0...libidn2-2.1.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c', 'name': 'https://github.com/libidn/libidn2/commit/e4d1558aa2c1c04a05066ee8600f37603890ba8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12420', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12420', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4168-1/', 'name': 'USN-4168-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JDQVQ2XPV5BTZUFINT7AFJSKNNBVURNJ/', 'name': 'FEDORA-2019-a8d35fcf7c', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MINU5RKDFE6TKAFY5DRFN3WSFDS4DYVS/', 'name': 'FEDORA-2019-d3221d69e0', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00009.html', 'name': 'openSUSE-SU-2019:2611', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00008.html', 'name': 'openSUSE-SU-2019:2613', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4613', 'name': 'DSA-4613', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://seclists.org/bugtraq/2020/Feb/4', 'name': '20200203 [SECURITY] [DSA 4613-1] libidn2 security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-63', 'name': 'GLSA-202003-63', 'refsource': 'GENTOO', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:libidn2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'idn2_to_ascii_4i in lib/lookup.c in GNU libidn2 before 2.1.1 has a heap-based buffer overflow via a long domain string.'}]
2019-10-29T19:15Z
2019-10-21T17: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
Tim Rühsen
2019-01-09 14:36:16+01:00
idn2_to_ascii_4i(): Restrict output length to 63
e4d1558aa2c1c04a05066ee8600f37603890ba8c
False
libidn/libidn2
Mirror of libidn2 repository
2017-04-06 02:38:35
2021-07-24 11:30:48
https://gitlab.com/libidn/libidn2
libidn
13.0
5.0
idn2_to_ascii_4i
idn2_to_ascii_4i( const uint32_t * input , size_t inlen , char * output , int flags)
['input', 'inlen', 'output', 'flags']
idn2_to_ascii_4i (const uint32_t * input, size_t inlen, char * output, int flags) { uint32_t *input_u32; uint8_t *input_u8, *output_u8; size_t length; int rc; if (!input) { if (output) *output = 0; return IDN2_OK; } input_u32 = (uint32_t *) malloc ((inlen + 1) * sizeof(uint32_t)); if (!input_u32) return IDN2_MALLOC; u32_cpy (input_u32, input, inlen); input_u32[inlen] = 0; input_u8 = u32_to_u8 (input_u32, inlen + 1, NULL, &length); free (input_u32); if (!input_u8) { if (errno == ENOMEM) return IDN2_MALLOC; return IDN2_ENCODING_ERROR; } rc = idn2_lookup_u8 (input_u8, &output_u8, flags); free (input_u8); if (rc == IDN2_OK) { /* wow, this is ugly, but libidn manpage states: * char * out output zero terminated string that must have room for at * least 63 characters plus the terminating zero. */ if (output) strcpy (output, (const char *) output_u8); free(output_u8); } return rc; }
188
True
1
CVE-2019-18276
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://www.youtube.com/watch?v=-wGtxJ8opa8', 'name': 'https://www.youtube.com/watch?v=-wGtxJ8opa8', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff', 'name': 'https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html', 'name': 'http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0003/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-34', 'name': 'GLSA-202105-34', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-273'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch9:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch10:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch11:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:beta1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:beta2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_unified_manager:*:*:*:*:*:vmware_vsphere:*:*', 'versionStartIncluding': '9.5', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_policy:1.14.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.'}]
2022-06-07T18:41Z
2019-11-28T01:15Z
Improper Check for Dropped Privileges
The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.
If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.
https://cwe.mitre.org/data/definitions/273.html
0
Chet Ramey
2019-07-01 09:03:53-04:00
commit bash-20190628 snapshot
951bdaad7a18cc0dc1036bba86b18b90874d39ff
False
bminor/bash
Unofficial mirror of bash repository. Updated daily.
2013-05-15 14:14:34
2022-08-27 00:01:09
http://git.savannah.gnu.org/cgit/bash.git/
bminor
387.0
114.0
completion_glob_pattern
completion_glob_pattern( string)
['string']
completion_glob_pattern (string) char *string; { register int c; char *send; int open; DECLARE_MBSTATE; open = 0; send = string + strlen (string); while (c = *string++) { switch (c) { case '?': case '*': return (1); case '[': open++; continue; case ']': if (open) return (1); continue; case '+': case '@': case '!': if (*string == '(') /*)*/ return (1); continue; case '\\': if (*string++ == 0) return (0); } /* Advance one fewer byte than an entire multibyte character to account for the auto-increment in the loop above. */ #ifdef HANDLE_MULTIBYTE string--; ADVANCE_CHAR_P (string, send - string); string++; #else ADVANCE_CHAR_P (string, send - string); #endif } return (0); }
153
True
1
CVE-2019-18276
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://www.youtube.com/watch?v=-wGtxJ8opa8', 'name': 'https://www.youtube.com/watch?v=-wGtxJ8opa8', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff', 'name': 'https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html', 'name': 'http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0003/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-34', 'name': 'GLSA-202105-34', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-273'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch9:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch10:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch11:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:beta1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:beta2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_unified_manager:*:*:*:*:*:vmware_vsphere:*:*', 'versionStartIncluding': '9.5', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_policy:1.14.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.'}]
2022-06-07T18:41Z
2019-11-28T01:15Z
Improper Check for Dropped Privileges
The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.
If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.
https://cwe.mitre.org/data/definitions/273.html
0
Chet Ramey
2019-07-01 09:03:53-04:00
commit bash-20190628 snapshot
951bdaad7a18cc0dc1036bba86b18b90874d39ff
False
bminor/bash
Unofficial mirror of bash repository. Updated daily.
2013-05-15 14:14:34
2022-08-27 00:01:09
http://git.savannah.gnu.org/cgit/bash.git/
bminor
387.0
114.0
glob_vector
glob_vector( pat , dir , flags)
['pat', 'dir', 'flags']
glob_vector (pat, dir, flags) char *pat; char *dir; int flags; { DIR *d; register struct dirent *dp; struct globval *lastlink, *e, *dirlist; register struct globval *nextlink; register char *nextname, *npat, *subdir; unsigned int count; int lose, skip, ndirs, isdir, sdlen, add_current, patlen; register char **name_vector; register unsigned int i; int mflags; /* Flags passed to strmatch (). */ int pflags; /* flags passed to sh_makepath () */ int nalloca; struct globval *firstmalloc, *tmplink; char *convfn; lastlink = 0; count = lose = skip = add_current = 0; firstmalloc = 0; nalloca = 0; name_vector = NULL; /*itrace("glob_vector: pat = `%s' dir = `%s' flags = 0x%x", pat, dir, flags);*/ /* If PAT is empty, skip the loop, but return one (empty) filename. */ if (pat == 0 || *pat == '\0') { if (glob_testdir (dir, 0) < 0) return ((char **) &glob_error_return); nextlink = (struct globval *)alloca (sizeof (struct globval)); if (nextlink == NULL) return ((char **) NULL); nextlink->next = (struct globval *)0; nextname = (char *) malloc (1); if (nextname == 0) lose = 1; else { lastlink = nextlink; nextlink->name = nextname; nextname[0] = '\0'; count = 1; } skip = 1; } patlen = (pat && *pat) ? strlen (pat) : 0; /* If the filename pattern (PAT) does not contain any globbing characters, we can dispense with reading the directory, and just see if there is a filename `DIR/PAT'. If there is, and we can access it, just make the vector to return and bail immediately. */ if (skip == 0 && glob_pattern_p (pat) == 0) { int dirlen; struct stat finfo; if (glob_testdir (dir, 0) < 0) return ((char **) &glob_error_return); dirlen = strlen (dir); nextname = (char *)malloc (dirlen + patlen + 2); npat = (char *)malloc (patlen + 1); if (nextname == 0 || npat == 0) { FREE (nextname); FREE (npat); lose = 1; } else { strcpy (npat, pat); dequote_pathname (npat); strcpy (nextname, dir); nextname[dirlen++] = '/'; strcpy (nextname + dirlen, npat); if (GLOB_TESTNAME (nextname) >= 0) { free (nextname); nextlink = (struct globval *)alloca (sizeof (struct globval)); if (nextlink) { nextlink->next = (struct globval *)0; lastlink = nextlink; nextlink->name = npat; count = 1; } else { free (npat); lose = 1; } } else { free (nextname); free (npat); } } skip = 1; } if (skip == 0) { /* Open the directory, punting immediately if we cannot. If opendir is not robust (i.e., it opens non-directories successfully), test that DIR is a directory and punt if it's not. */ #if defined (OPENDIR_NOT_ROBUST) if (glob_testdir (dir, 0) < 0) return ((char **) &glob_error_return); #endif d = opendir (dir); if (d == NULL) return ((char **) &glob_error_return); /* Compute the flags that will be passed to strmatch(). We don't need to do this every time through the loop. */ mflags = (noglob_dot_filenames ? FNM_PERIOD : 0) | FNM_PATHNAME; #ifdef FNM_CASEFOLD if (glob_ignore_case) mflags |= FNM_CASEFOLD; #endif if (extended_glob) mflags |= FNM_EXTMATCH; add_current = ((flags & (GX_ALLDIRS|GX_ADDCURDIR)) == (GX_ALLDIRS|GX_ADDCURDIR)); /* Scan the directory, finding all names that match. For each name that matches, allocate a struct globval on the stack and store the name in it. Chain those structs together; lastlink is the front of the chain. */ while (1) { /* Make globbing interruptible in the shell. */ if (interrupt_state || terminating_signal) { lose = 1; break; } else if (signal_is_pending (SIGINT)) /* XXX - make SIGINT traps responsive */ { lose = 1; break; } dp = readdir (d); if (dp == NULL) break; /* If this directory entry is not to be used, try again. */ if (REAL_DIR_ENTRY (dp) == 0) continue; #if 0 if (dp->d_name == 0 || *dp->d_name == 0) continue; #endif #if HANDLE_MULTIBYTE if (MB_CUR_MAX > 1 && mbskipname (pat, dp->d_name, flags)) continue; else #endif if (skipname (pat, dp->d_name, flags)) continue; /* If we're only interested in directories, don't bother with files */ if (flags & (GX_MATCHDIRS|GX_ALLDIRS)) { pflags = (flags & GX_ALLDIRS) ? MP_RMDOT : 0; if (flags & GX_NULLDIR) pflags |= MP_IGNDOT; subdir = sh_makepath (dir, dp->d_name, pflags); isdir = glob_testdir (subdir, flags); if (isdir < 0 && (flags & GX_MATCHDIRS)) { free (subdir); continue; } } if (flags & GX_ALLDIRS) { if (isdir == 0) { dirlist = finddirs (pat, subdir, (flags & ~GX_ADDCURDIR), &e, &ndirs); if (dirlist == &finddirs_error_return) { free (subdir); lose = 1; break; } if (ndirs) /* add recursive directories to list */ { if (firstmalloc == 0) firstmalloc = e; e->next = lastlink; lastlink = dirlist; count += ndirs; } } /* XXX - should we even add this if it's not a directory? */ nextlink = (struct globval *) malloc (sizeof (struct globval)); if (firstmalloc == 0) firstmalloc = nextlink; sdlen = strlen (subdir); nextname = (char *) malloc (sdlen + 1); if (nextlink == 0 || nextname == 0) { FREE (nextlink); FREE (nextname); free (subdir); lose = 1; break; } nextlink->next = lastlink; lastlink = nextlink; nextlink->name = nextname; bcopy (subdir, nextname, sdlen + 1); free (subdir); ++count; continue; } else if (flags & GX_MATCHDIRS) free (subdir); convfn = fnx_fromfs (dp->d_name, D_NAMLEN (dp)); if (strmatch (pat, convfn, mflags) != FNM_NOMATCH) { if (nalloca < ALLOCA_MAX) { nextlink = (struct globval *) alloca (sizeof (struct globval)); nalloca += sizeof (struct globval); } else { nextlink = (struct globval *) malloc (sizeof (struct globval)); if (firstmalloc == 0) firstmalloc = nextlink; } nextname = (char *) malloc (D_NAMLEN (dp) + 1); if (nextlink == 0 || nextname == 0) { FREE (nextlink); FREE (nextname); lose = 1; break; } nextlink->next = lastlink; lastlink = nextlink; nextlink->name = nextname; bcopy (dp->d_name, nextname, D_NAMLEN (dp) + 1); ++count; } } (void) closedir (d); } /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty directory name as a placeholder if GX_NULLDIR (in which case the passed directory name is "."). */ if (add_current) { sdlen = strlen (dir); nextname = (char *)malloc (sdlen + 1); nextlink = (struct globval *) malloc (sizeof (struct globval)); if (nextlink == 0 || nextname == 0) { FREE (nextlink); FREE (nextname); lose = 1; } else { nextlink->name = nextname; nextlink->next = lastlink; lastlink = nextlink; if (flags & GX_NULLDIR) nextname[0] = '\0'; else bcopy (dir, nextname, sdlen + 1); ++count; } } if (lose == 0) { name_vector = (char **) malloc ((count + 1) * sizeof (char *)); lose |= name_vector == NULL; } /* Have we run out of memory? */ if (lose) { tmplink = 0; /* Here free the strings we have got. */ while (lastlink) { /* Since we build the list in reverse order, the first N entries will be allocated with malloc, if firstmalloc is set, from lastlink to firstmalloc. */ if (firstmalloc) { if (lastlink == firstmalloc) firstmalloc = 0; tmplink = lastlink; } else tmplink = 0; free (lastlink->name); lastlink = lastlink->next; FREE (tmplink); } /* Don't call QUIT; here; let higher layers deal with it. */ return ((char **)NULL); } /* Copy the name pointers from the linked list into the vector. */ for (tmplink = lastlink, i = 0; i < count; ++i) { name_vector[i] = tmplink->name; tmplink = tmplink->next; } name_vector[count] = NULL; /* If we allocated some of the struct globvals, free them now. */ if (firstmalloc) { tmplink = 0; while (lastlink) { tmplink = lastlink; if (lastlink == firstmalloc) lastlink = firstmalloc = 0; else lastlink = lastlink->next; free (tmplink); } } return (name_vector); }
1502
True
1
CVE-2019-18276
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://www.youtube.com/watch?v=-wGtxJ8opa8', 'name': 'https://www.youtube.com/watch?v=-wGtxJ8opa8', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff', 'name': 'https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html', 'name': 'http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0003/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-34', 'name': 'GLSA-202105-34', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-273'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch9:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch10:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:patch11:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:beta1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:beta2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:bash:5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_unified_manager:*:*:*:*:*:vmware_vsphere:*:*', 'versionStartIncluding': '9.5', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_policy:1.14.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.'}]
2022-06-07T18:41Z
2019-11-28T01:15Z
Improper Check for Dropped Privileges
The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.
If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.
https://cwe.mitre.org/data/definitions/273.html
0
Chet Ramey
2019-07-01 09:03:53-04:00
commit bash-20190628 snapshot
951bdaad7a18cc0dc1036bba86b18b90874d39ff
False
bminor/bash
Unofficial mirror of bash repository. Updated daily.
2013-05-15 14:14:34
2022-08-27 00:01:09
http://git.savannah.gnu.org/cgit/bash.git/
bminor
387.0
114.0
unquoted_glob_pattern_p
unquoted_glob_pattern_p( string)
['string']
unquoted_glob_pattern_p (string) register char *string; { register int c; char *send; int open, bsquote; DECLARE_MBSTATE; open = bsquote = 0; send = string + strlen (string); while (c = *string++) { switch (c) { case '?': case '*': return (1); case '[': open++; continue; case ']': if (open) return (1); continue; case '+': case '@': case '!': if (*string == '(') /*)*/ return (1); continue; /* A pattern can't end with a backslash, but a backslash in the pattern can be removed by the matching engine, so we have to run it through globbing. */ case '\\': if (*string != '\0' && *string != '/') { bsquote = 1; string++; continue; } else if (*string == 0) return (0); case CTLESC: if (*string++ == '\0') return (0); } /* Advance one fewer byte than an entire multibyte character to account for the auto-increment in the loop above. */ #ifdef HANDLE_MULTIBYTE string--; ADVANCE_CHAR_P (string, send - string); string++; #else ADVANCE_CHAR_P (string, send - string); #endif } return ((bsquote && posix_glob_backslash) ? 2 : 0); }
205
True
1
CVE-2019-18397
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/fribidi/fribidi/commit/034c6e9a1d296286305f4cfd1e0072b879f52568', 'name': 'https://github.com/fribidi/fribidi/commit/034c6e9a1d296286305f4cfd1e0072b879f52568', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2019-18397', 'name': 'https://security-tracker.debian.org/tracker/CVE-2019-18397', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944327', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944327', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://marc.info/?l=oss-security&m=157322128105807&w=2', 'name': 'https://marc.info/?l=oss-security&m=157322128105807&w=2', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/W5UJRTG32FDNI7T637Q6PZYL3UCRR5HR/', 'name': 'FEDORA-2019-7075bc4ff8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:4326', 'name': 'RHSA-2019:4326', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TFS3N6KKXPI6ATDNEUFRSLX7R6BOBNIP/', 'name': 'FEDORA-2019-533a72fec5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:4361', 'name': 'RHSA-2019:4361', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2020:0291', 'name': 'RHSA-2020:0291', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-41', 'name': 'GLSA-202003-41', 'refsource': 'GENTOO', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:fribidi:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.0.0', 'versionEndIncluding': '1.0.7', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A buffer overflow in the fribidi_get_par_embedding_levels_ex() function in lib/fribidi-bidi.c of GNU FriBidi through 1.0.7 allows an attacker to cause a denial of service or possibly execute arbitrary code by delivering crafted text content to a user, when this content is then rendered by an application that uses FriBidi for text layout calculations. Examples include any GNOME or GTK+ based application that uses Pango for text layout, as this internally uses FriBidi for bidirectional text layout. For example, the attacker can construct a crafted text file to be opened in GEdit, or a crafted IRC message to be viewed in HexChat.'}]
2020-08-18T15:05Z
2019-11-13T14: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
Dov Grobgeld
2019-10-24 09:37:29+03:00
Truncate isolate_level to FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL
034c6e9a1d296286305f4cfd1e0072b879f52568
False
fribidi/fribidi
GNU FriBidi
2012-08-27 18:18:30
2022-04-19 19:49:39
null
fribidi
258.0
86.0
fribidi_get_par_embedding_levels_ex
fribidi_get_par_embedding_levels_ex( const FriBidiCharType * bidi_types , const FriBidiBracketType * bracket_types , const FriBidiStrIndex len , FriBidiParType * pbase_dir , FriBidiLevel * embedding_levels)
['bidi_types', 'bracket_types', 'len', 'pbase_dir', 'embedding_levels']
fribidi_get_par_embedding_levels_ex ( /* input */ const FriBidiCharType *bidi_types, const FriBidiBracketType *bracket_types, const FriBidiStrIndex len, /* input and output */ FriBidiParType *pbase_dir, /* output */ FriBidiLevel *embedding_levels ) { FriBidiLevel base_level_per_iso_level[FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL]; FriBidiLevel base_level, max_level = 0; FriBidiParType base_dir; FriBidiRun *main_run_list = NULL, *explicits_list = NULL, *pp; fribidi_boolean status = false; int max_iso_level = 0; if UNLIKELY (!len) { status = true; goto out; } DBG ("in fribidi_get_par_embedding_levels"); fribidi_assert (bidi_types); fribidi_assert (pbase_dir); fribidi_assert (embedding_levels); /* Determinate character types */ { /* Get run-length encoded character types */ main_run_list = run_list_encode_bidi_types (bidi_types, bracket_types, len); if UNLIKELY (!main_run_list) goto out; } /* Find base level */ /* If no strong base_dir was found, resort to the weak direction that was passed on input. */ base_level = FRIBIDI_DIR_TO_LEVEL (*pbase_dir); if (!FRIBIDI_IS_STRONG (*pbase_dir)) /* P2. P3. Search for first strong character and use its direction as base direction */ { int valid_isolate_count = 0; for_run_list (pp, main_run_list) { if (RL_TYPE(pp) == FRIBIDI_TYPE_PDI) { /* Ignore if there is no matching isolate */ if (valid_isolate_count>0) valid_isolate_count--; } else if (FRIBIDI_IS_ISOLATE(RL_TYPE(pp))) valid_isolate_count++; else if (valid_isolate_count==0 && FRIBIDI_IS_LETTER (RL_TYPE (pp))) { base_level = FRIBIDI_DIR_TO_LEVEL (RL_TYPE (pp)); *pbase_dir = FRIBIDI_LEVEL_TO_DIR (base_level); break; } } } base_dir = FRIBIDI_LEVEL_TO_DIR (base_level); DBG2 (" base level : %c", fribidi_char_from_level (base_level)); DBG2 (" base dir : %s", fribidi_get_bidi_type_name (base_dir)); base_level_per_iso_level[0] = base_level; # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_types_re (main_run_list); } # endif /* DEBUG */ /* Explicit Levels and Directions */ DBG ("explicit levels and directions"); { FriBidiLevel level, new_level = 0; int isolate_level = 0; FriBidiCharType override, new_override; FriBidiStrIndex i; int stack_size, over_pushed, first_interval; int valid_isolate_count = 0; int isolate_overflow = 0; int isolate = 0; /* The isolate status flag */ struct { FriBidiCharType override; /* only LTR, RTL and ON are valid */ FriBidiLevel level; int isolate; int isolate_level; } status_stack[FRIBIDI_BIDI_MAX_RESOLVED_LEVELS]; FriBidiRun temp_link; FriBidiRun *run_per_isolate_level[FRIBIDI_BIDI_MAX_RESOLVED_LEVELS]; memset(run_per_isolate_level, 0, sizeof(run_per_isolate_level[0]) * FRIBIDI_BIDI_MAX_RESOLVED_LEVELS); /* explicits_list is a list like main_run_list, that holds the explicit codes that are removed from main_run_list, to reinsert them later by calling the shadow_run_list. */ explicits_list = new_run_list (); if UNLIKELY (!explicits_list) goto out; /* X1. Begin by setting the current embedding level to the paragraph embedding level. Set the directional override status to neutral, and directional isolate status to false. Process each character iteratively, applying rules X2 through X8. Only embedding levels from 0 to 123 are valid in this phase. */ level = base_level; override = FRIBIDI_TYPE_ON; /* stack */ stack_size = 0; over_pushed = 0; first_interval = 0; valid_isolate_count = 0; isolate_overflow = 0; for_run_list (pp, main_run_list) { FriBidiCharType this_type = RL_TYPE (pp); RL_ISOLATE_LEVEL (pp) = isolate_level; if (FRIBIDI_IS_EXPLICIT_OR_BN (this_type)) { if (FRIBIDI_IS_STRONG (this_type)) { /* LRE, RLE, LRO, RLO */ /* 1. Explicit Embeddings */ /* X2. With each RLE, compute the least greater odd embedding level. */ /* X3. With each LRE, compute the least greater even embedding level. */ /* 2. Explicit Overrides */ /* X4. With each RLO, compute the least greater odd embedding level. */ /* X5. With each LRO, compute the least greater even embedding level. */ new_override = FRIBIDI_EXPLICIT_TO_OVERRIDE_DIR (this_type); for (i = RL_LEN (pp); i; i--) { new_level = ((level + FRIBIDI_DIR_TO_LEVEL (this_type) + 2) & ~1) - FRIBIDI_DIR_TO_LEVEL (this_type); isolate = 0; PUSH_STATUS; } } else if (this_type == FRIBIDI_TYPE_PDF) { /* 3. Terminating Embeddings and overrides */ /* X7. With each PDF, determine the matching embedding or override code. */ for (i = RL_LEN (pp); i; i--) { if (stack_size && status_stack[stack_size-1].isolate != 0) break; POP_STATUS; } } /* X9. Remove all RLE, LRE, RLO, LRO, PDF, and BN codes. */ /* Remove element and add it to explicits_list */ RL_LEVEL (pp) = FRIBIDI_SENTINEL; temp_link.next = pp->next; move_node_before (pp, explicits_list); pp = &temp_link; } else if (this_type == FRIBIDI_TYPE_PDI) /* X6a. pop the direction of the stack */ { for (i = RL_LEN (pp); i; i--) { if (isolate_overflow > 0) { isolate_overflow--; RL_LEVEL (pp) = level; } else if (valid_isolate_count > 0) { /* Pop away all LRE,RLE,LRO, RLO levels from the stack, as these are implicitly terminated by the PDI */ while (stack_size && !status_stack[stack_size-1].isolate) POP_STATUS; over_pushed = 0; /* The PDI resets the overpushed! */ POP_STATUS; isolate_level-- ; valid_isolate_count--; RL_LEVEL (pp) = level; RL_ISOLATE_LEVEL (pp) = isolate_level; } else { /* Ignore isolated PDI's by turning them into ON's */ RL_TYPE (pp) = FRIBIDI_TYPE_ON; RL_LEVEL (pp) = level; } } } else if (FRIBIDI_IS_ISOLATE(this_type)) { /* TBD support RL_LEN > 1 */ new_override = FRIBIDI_TYPE_ON; isolate = 1; if (this_type == FRIBIDI_TYPE_LRI) new_level = level + 2 - (level%2); else if (this_type == FRIBIDI_TYPE_RLI) new_level = level + 1 + (level%2); else if (this_type == FRIBIDI_TYPE_FSI) { /* Search for a local strong character until we meet the corresponding PDI or the end of the paragraph */ FriBidiRun *fsi_pp; int isolate_count = 0; int fsi_base_level = 0; for_run_list (fsi_pp, pp) { if (RL_TYPE(fsi_pp) == FRIBIDI_TYPE_PDI) { isolate_count--; if (valid_isolate_count < 0) break; } else if (FRIBIDI_IS_ISOLATE(RL_TYPE(fsi_pp))) isolate_count++; else if (isolate_count==0 && FRIBIDI_IS_LETTER (RL_TYPE (fsi_pp))) { fsi_base_level = FRIBIDI_DIR_TO_LEVEL (RL_TYPE (fsi_pp)); break; } } /* Same behavior like RLI and LRI above */ if (FRIBIDI_LEVEL_IS_RTL (fsi_base_level)) new_level = level + 1 + (level%2); else new_level = level + 2 - (level%2); } RL_LEVEL (pp) = level; RL_ISOLATE_LEVEL (pp) = isolate_level++; base_level_per_iso_level[isolate_level] = new_level; if (!FRIBIDI_IS_NEUTRAL (override)) RL_TYPE (pp) = override; if (new_level <= FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL) { valid_isolate_count++; PUSH_STATUS; level = new_level; } else isolate_overflow += 1; } else if (this_type == FRIBIDI_TYPE_BS) { /* X8. All explicit directional embeddings and overrides are completely terminated at the end of each paragraph. Paragraph separators are not included in the embedding. */ break; } else { /* X6. For all types besides RLE, LRE, RLO, LRO, and PDF: a. Set the level of the current character to the current embedding level. b. Whenever the directional override status is not neutral, reset the current character type to the directional override status. */ RL_LEVEL (pp) = level; if (!FRIBIDI_IS_NEUTRAL (override)) RL_TYPE (pp) = override; } } /* Build the isolate_level connections */ for_run_list (pp, main_run_list) { int isolate_level = RL_ISOLATE_LEVEL (pp); if (run_per_isolate_level[isolate_level]) { run_per_isolate_level[isolate_level]->next_isolate = pp; pp->prev_isolate = run_per_isolate_level[isolate_level]; } run_per_isolate_level[isolate_level] = pp; } /* Implementing X8. It has no effect on a single paragraph! */ level = base_level; override = FRIBIDI_TYPE_ON; stack_size = 0; over_pushed = 0; } /* X10. The remaining rules are applied to each run of characters at the same level. For each run, determine the start-of-level-run (sor) and end-of-level-run (eor) type, either L or R. This depends on the higher of the two levels on either side of the boundary (at the start or end of the paragraph, the level of the 'other' run is the base embedding level). If the higher level is odd, the type is R, otherwise it is L. */ /* Resolving Implicit Levels can be done out of X10 loop, so only change of Resolving Weak Types and Resolving Neutral Types is needed. */ compact_list (main_run_list); # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_types_re (main_run_list); print_bidi_string (bidi_types, len); print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ /* 4. Resolving weak types. Also calculate the maximum isolate level */ max_iso_level = 0; DBG ("resolving weak types"); { int last_strong_stack[FRIBIDI_BIDI_MAX_RESOLVED_LEVELS]; FriBidiCharType prev_type_orig; fribidi_boolean w4; last_strong_stack[0] = base_dir; for_run_list (pp, main_run_list) { register FriBidiCharType prev_type, this_type, next_type; FriBidiRun *ppp_prev, *ppp_next; int iso_level; ppp_prev = get_adjacent_run(pp, false, false); ppp_next = get_adjacent_run(pp, true, false); this_type = RL_TYPE (pp); iso_level = RL_ISOLATE_LEVEL(pp); if (iso_level > max_iso_level) max_iso_level = iso_level; if (RL_LEVEL(ppp_prev) == RL_LEVEL(pp)) prev_type = RL_TYPE(ppp_prev); else prev_type = FRIBIDI_LEVEL_TO_DIR(MAX(RL_LEVEL(ppp_prev), RL_LEVEL(pp))); if (RL_LEVEL(ppp_next) == RL_LEVEL(pp)) next_type = RL_TYPE(ppp_next); else next_type = FRIBIDI_LEVEL_TO_DIR(MAX(RL_LEVEL(ppp_next), RL_LEVEL(pp))); if (FRIBIDI_IS_STRONG (prev_type)) last_strong_stack[iso_level] = prev_type; /* W1. NSM Examine each non-spacing mark (NSM) in the level run, and change the type of the NSM to the type of the previous character. If the NSM is at the start of the level run, it will get the type of sor. */ /* Implementation note: it is important that if the previous character is not sor, then we should merge this run with the previous, because of rules like W5, that we assume all of a sequence of adjacent ETs are in one FriBidiRun. */ if (this_type == FRIBIDI_TYPE_NSM) { /* New rule in Unicode 6.3 */ if (FRIBIDI_IS_ISOLATE (RL_TYPE (pp->prev))) RL_TYPE(pp) = FRIBIDI_TYPE_ON; if (RL_LEVEL (ppp_prev) == RL_LEVEL (pp)) { if (ppp_prev == pp->prev) pp = merge_with_prev (pp); } else RL_TYPE (pp) = prev_type; if (prev_type == next_type && RL_LEVEL (pp) == RL_LEVEL (pp->next)) { if (ppp_next == pp->next) pp = merge_with_prev (pp->next); } continue; /* As we know the next condition cannot be true. */ } /* W2: European numbers. */ if (this_type == FRIBIDI_TYPE_EN && last_strong_stack[iso_level] == FRIBIDI_TYPE_AL) { RL_TYPE (pp) = FRIBIDI_TYPE_AN; /* Resolving dependency of loops for rules W1 and W2, so we can merge them in one loop. */ if (next_type == FRIBIDI_TYPE_NSM) RL_TYPE (ppp_next) = FRIBIDI_TYPE_AN; } } last_strong_stack[0] = base_dir; /* Resolving dependency of loops for rules W4 and W5, W5 may want to prevent W4 to take effect in the next turn, do this through "w4". */ w4 = true; /* Resolving dependency of loops for rules W4 and W5 with W7, W7 may change an EN to L but it sets the prev_type_orig if needed, so W4 and W5 in next turn can still do their works. */ prev_type_orig = FRIBIDI_TYPE_ON; /* Each isolate level has its own memory of the last strong character */ for_run_list (pp, main_run_list) { register FriBidiCharType prev_type, this_type, next_type; int iso_level; FriBidiRun *ppp_prev, *ppp_next; this_type = RL_TYPE (pp); iso_level = RL_ISOLATE_LEVEL(pp); ppp_prev = get_adjacent_run(pp, false, false); ppp_next = get_adjacent_run(pp, true, false); if (RL_LEVEL(ppp_prev) == RL_LEVEL(pp)) prev_type = RL_TYPE(ppp_prev); else prev_type = FRIBIDI_LEVEL_TO_DIR(MAX(RL_LEVEL(ppp_prev), RL_LEVEL(pp))); if (RL_LEVEL(ppp_next) == RL_LEVEL(pp)) next_type = RL_TYPE(ppp_next); else next_type = FRIBIDI_LEVEL_TO_DIR(MAX(RL_LEVEL(ppp_next), RL_LEVEL(pp))); if (FRIBIDI_IS_STRONG (prev_type)) last_strong_stack[iso_level] = prev_type; /* W2 ??? */ /* W3: Change ALs to R. */ if (this_type == FRIBIDI_TYPE_AL) { RL_TYPE (pp) = FRIBIDI_TYPE_RTL; w4 = true; prev_type_orig = FRIBIDI_TYPE_ON; continue; } /* W4. A single european separator changes to a european number. A single common separator between two numbers of the same type changes to that type. */ if (w4 && RL_LEN (pp) == 1 && FRIBIDI_IS_ES_OR_CS (this_type) && FRIBIDI_IS_NUMBER (prev_type_orig) && prev_type_orig == next_type && (prev_type_orig == FRIBIDI_TYPE_EN || this_type == FRIBIDI_TYPE_CS)) { RL_TYPE (pp) = prev_type; this_type = RL_TYPE (pp); } w4 = true; /* W5. A sequence of European terminators adjacent to European numbers changes to All European numbers. */ if (this_type == FRIBIDI_TYPE_ET && (prev_type_orig == FRIBIDI_TYPE_EN || next_type == FRIBIDI_TYPE_EN)) { RL_TYPE (pp) = FRIBIDI_TYPE_EN; w4 = false; this_type = RL_TYPE (pp); } /* W6. Otherwise change separators and terminators to other neutral. */ if (FRIBIDI_IS_NUMBER_SEPARATOR_OR_TERMINATOR (this_type)) RL_TYPE (pp) = FRIBIDI_TYPE_ON; /* W7. Change european numbers to L. */ if (this_type == FRIBIDI_TYPE_EN && last_strong_stack[iso_level] == FRIBIDI_TYPE_LTR) { RL_TYPE (pp) = FRIBIDI_TYPE_LTR; prev_type_orig = (RL_LEVEL (pp) == RL_LEVEL (pp->next) ? FRIBIDI_TYPE_EN : FRIBIDI_TYPE_ON); } else prev_type_orig = PREV_TYPE_OR_SOR (pp->next); } } compact_neutrals (main_run_list); # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ /* 5. Resolving Neutral Types */ DBG ("resolving neutral types - N0"); { /* BD16 - Build list of all pairs*/ int num_iso_levels = max_iso_level + 1; FriBidiPairingNode *pairing_nodes = NULL; FriBidiRun *local_bracket_stack[FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL][LOCAL_BRACKET_SIZE]; FriBidiRun **bracket_stack[FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL]; int bracket_stack_size[FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL]; int last_level = RL_LEVEL(main_run_list); int last_iso_level = 0; memset(bracket_stack, 0, sizeof(bracket_stack[0])*num_iso_levels); memset(bracket_stack_size, 0, sizeof(bracket_stack_size[0])*num_iso_levels); /* populate the bracket_size. The first LOCAL_BRACKET_SIZE entries of the stack are one the stack. Allocate the rest of the entries. */ { int iso_level; for (iso_level=0; iso_level < LOCAL_BRACKET_SIZE; iso_level++) bracket_stack[iso_level] = local_bracket_stack[iso_level]; for (iso_level=LOCAL_BRACKET_SIZE; iso_level < num_iso_levels; iso_level++) bracket_stack[iso_level] = fribidi_malloc (sizeof (bracket_stack[0]) * FRIBIDI_BIDI_MAX_NESTED_BRACKET_PAIRS); } /* Build the bd16 pair stack. */ for_run_list (pp, main_run_list) { int level = RL_LEVEL(pp); int iso_level = RL_ISOLATE_LEVEL(pp); FriBidiBracketType brack_prop = RL_BRACKET_TYPE(pp); /* Interpret the isolating run sequence as such that they end at a change in the level, unless the iso_level has been raised. */ if (level != last_level && last_iso_level == iso_level) bracket_stack_size[last_iso_level] = 0; if (brack_prop!= FRIBIDI_NO_BRACKET && RL_TYPE(pp)==FRIBIDI_TYPE_ON) { if (FRIBIDI_IS_BRACKET_OPEN(brack_prop)) { if (bracket_stack_size[iso_level]==FRIBIDI_BIDI_MAX_NESTED_BRACKET_PAIRS) break; /* push onto the pair stack */ bracket_stack[iso_level][bracket_stack_size[iso_level]++] = pp; } else { int stack_idx = bracket_stack_size[iso_level] - 1; while (stack_idx >= 0) { FriBidiBracketType se_brack_prop = RL_BRACKET_TYPE(bracket_stack[iso_level][stack_idx]); if (FRIBIDI_BRACKET_ID(se_brack_prop) == FRIBIDI_BRACKET_ID(brack_prop)) { bracket_stack_size[iso_level] = stack_idx; pairing_nodes = pairing_nodes_push(pairing_nodes, bracket_stack[iso_level][stack_idx], pp); break; } stack_idx--; } } } last_level = level; last_iso_level = iso_level; } /* The list must now be sorted for the next algo to work! */ sort_pairing_nodes(&pairing_nodes); # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_pairing_nodes (pairing_nodes); } # endif /* DEBUG */ /* Start the N0 */ { FriBidiPairingNode *ppairs = pairing_nodes; while (ppairs) { int iso_level = ppairs->open->isolate_level; int embedding_level = base_level_per_iso_level[iso_level]; /* Find matching strong. */ fribidi_boolean found = false; FriBidiRun *ppn; for (ppn = ppairs->open; ppn!= ppairs->close; ppn = ppn->next) { FriBidiCharType this_type = RL_TYPE_AN_EN_AS_RTL(ppn); /* Calculate level like in resolve implicit levels below to prevent embedded levels not to match the base_level */ int this_level = RL_LEVEL (ppn) + (FRIBIDI_LEVEL_IS_RTL (RL_LEVEL(ppn)) ^ FRIBIDI_DIR_TO_LEVEL (this_type)); /* N0b */ if (FRIBIDI_IS_STRONG (this_type) && this_level == embedding_level) { RL_TYPE(ppairs->open) = RL_TYPE(ppairs->close) = this_level%2 ? FRIBIDI_TYPE_RTL : FRIBIDI_TYPE_LTR; found = true; break; } } /* N0c */ /* Search for any strong type preceding and within the bracket pair */ if (!found) { /* Search for a preceding strong */ int prec_strong_level = embedding_level; /* TBDov! Extract from Isolate level in effect */ int iso_level = RL_ISOLATE_LEVEL(ppairs->open); for (ppn = ppairs->open->prev; ppn->type != FRIBIDI_TYPE_SENTINEL; ppn=ppn->prev) { FriBidiCharType this_type = RL_TYPE_AN_EN_AS_RTL(ppn); if (FRIBIDI_IS_STRONG (this_type) && RL_ISOLATE_LEVEL(ppn) == iso_level) { prec_strong_level = RL_LEVEL (ppn) + (FRIBIDI_LEVEL_IS_RTL (RL_LEVEL(ppn)) ^ FRIBIDI_DIR_TO_LEVEL (this_type)); break; } } for (ppn = ppairs->open; ppn!= ppairs->close; ppn = ppn->next) { FriBidiCharType this_type = RL_TYPE_AN_EN_AS_RTL(ppn); if (FRIBIDI_IS_STRONG (this_type) && RL_ISOLATE_LEVEL(ppn) == iso_level) { /* By constraint this is opposite the embedding direction, since we did not match the N0b rule. We must now compare with the preceding strong to establish whether to apply N0c1 (opposite) or N0c2 embedding */ RL_TYPE(ppairs->open) = RL_TYPE(ppairs->close) = prec_strong_level % 2 ? FRIBIDI_TYPE_RTL : FRIBIDI_TYPE_LTR; RL_LEVEL(ppairs->open) = RL_LEVEL(ppairs->close) = prec_strong_level; found = true; break; } } } ppairs = ppairs->next; } free_pairing_nodes(pairing_nodes); if (num_iso_levels >= LOCAL_BRACKET_SIZE) { int i; /* Only need to free the non static members */ for (i=LOCAL_BRACKET_SIZE; i<num_iso_levels; i++) fribidi_free(bracket_stack[i]); } /* Remove the bracket property and re-compact */ { const FriBidiBracketType NoBracket = FRIBIDI_NO_BRACKET; for_run_list (pp, main_run_list) pp->bracket_type = NoBracket; compact_neutrals (main_run_list); } } # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ } DBG ("resolving neutral types - N1+N2"); { for_run_list (pp, main_run_list) { FriBidiCharType prev_type, this_type, next_type; FriBidiRun *ppp_prev, *ppp_next; ppp_prev = get_adjacent_run(pp, false, false); ppp_next = get_adjacent_run(pp, true, false); /* "European and Arabic numbers are treated as though they were R" FRIBIDI_CHANGE_NUMBER_TO_RTL does this. */ this_type = FRIBIDI_CHANGE_NUMBER_TO_RTL (RL_TYPE (pp)); if (RL_LEVEL(ppp_prev) == RL_LEVEL(pp)) prev_type = FRIBIDI_CHANGE_NUMBER_TO_RTL (RL_TYPE(ppp_prev)); else prev_type = FRIBIDI_LEVEL_TO_DIR(MAX(RL_LEVEL(ppp_prev), RL_LEVEL(pp))); if (RL_LEVEL(ppp_next) == RL_LEVEL(pp)) next_type = FRIBIDI_CHANGE_NUMBER_TO_RTL (RL_TYPE(ppp_next)); else next_type = FRIBIDI_LEVEL_TO_DIR(MAX(RL_LEVEL(ppp_next), RL_LEVEL(pp))); if (FRIBIDI_IS_NEUTRAL (this_type)) RL_TYPE (pp) = (prev_type == next_type) ? /* N1. */ prev_type : /* N2. */ FRIBIDI_EMBEDDING_DIRECTION (pp); } } compact_list (main_run_list); # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ /* 6. Resolving implicit levels */ DBG ("resolving implicit levels"); { max_level = base_level; for_run_list (pp, main_run_list) { FriBidiCharType this_type; int level; this_type = RL_TYPE (pp); level = RL_LEVEL (pp); /* I1. Even */ /* I2. Odd */ if (FRIBIDI_IS_NUMBER (this_type)) RL_LEVEL (pp) = (level + 2) & ~1; else RL_LEVEL (pp) = level + (FRIBIDI_LEVEL_IS_RTL (level) ^ FRIBIDI_DIR_TO_LEVEL (this_type)); if (RL_LEVEL (pp) > max_level) max_level = RL_LEVEL (pp); } } compact_list (main_run_list); # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_bidi_string (bidi_types, len); print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ /* Reinsert the explicit codes & BN's that are already removed, from the explicits_list to main_run_list. */ DBG ("reinserting explicit codes"); if UNLIKELY (explicits_list->next != explicits_list) { register FriBidiRun *p; register fribidi_boolean stat = shadow_run_list (main_run_list, explicits_list, true); explicits_list = NULL; if UNLIKELY (!stat) goto out; /* Set level of inserted explicit chars to that of their previous * char, such that they do not affect reordering. */ p = main_run_list->next; if (p != main_run_list && p->level == FRIBIDI_SENTINEL) p->level = base_level; for_run_list (p, main_run_list) if (p->level == FRIBIDI_SENTINEL) p->level = p->prev->level; } # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_types_re (main_run_list); print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ DBG ("reset the embedding levels, 1, 2, 3."); { register int j, state, pos; register FriBidiCharType char_type; register FriBidiRun *p, *q, *list; /* L1. Reset the embedding levels of some chars: 1. segment separators, 2. paragraph separators, 3. any sequence of whitespace characters preceding a segment separator or paragraph separator, and 4. any sequence of whitespace characters and/or isolate formatting characters at the end of the line. ... (to be continued in fribidi_reorder_line()). */ list = new_run_list (); if UNLIKELY (!list) goto out; q = list; state = 1; pos = len - 1; for (j = len - 1; j >= -1; j--) { /* close up the open link at the end */ if (j >= 0) char_type = bidi_types[j]; else char_type = FRIBIDI_TYPE_ON; if (!state && FRIBIDI_IS_SEPARATOR (char_type)) { state = 1; pos = j; } else if (state && !(FRIBIDI_IS_EXPLICIT_OR_SEPARATOR_OR_BN_OR_WS(char_type) || FRIBIDI_IS_ISOLATE(char_type))) { state = 0; p = new_run (); if UNLIKELY (!p) { free_run_list (list); goto out; } p->pos = j + 1; p->len = pos - j; p->type = base_dir; p->level = base_level; move_node_before (p, q); q = p; } } if UNLIKELY (!shadow_run_list (main_run_list, list, false)) goto out; } # if DEBUG if UNLIKELY (fribidi_debug_status ()) { print_types_re (main_run_list); print_resolved_levels (main_run_list); print_resolved_types (main_run_list); } # endif /* DEBUG */ { FriBidiStrIndex pos = 0; for_run_list (pp, main_run_list) { register FriBidiStrIndex l; register FriBidiLevel level = pp->level; for (l = pp->len; l; l--) embedding_levels[pos++] = level; } } status = true; out: DBG ("leaving fribidi_get_par_embedding_levels"); if (main_run_list) free_run_list (main_run_list); if UNLIKELY (explicits_list) free_run_list (explicits_list); return status ? max_level + 1 : 0; }
3292
True
1
CVE-2019-18609
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/alanxz/rabbitmq-c/commit/fc85be7123050b91b054e45b91c78d3241a5047a', 'name': 'https://github.com/alanxz/rabbitmq-c/commit/fc85be7123050b91b054e45b91c78d3241a5047a', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/alanxz/rabbitmq-c/blob/master/ChangeLog.md', 'name': 'https://github.com/alanxz/rabbitmq-c/blob/master/ChangeLog.md', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://news.ycombinator.com/item?id=21681976', 'name': 'https://news.ycombinator.com/item?id=21681976', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4214-1/', 'name': 'USN-4214-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/12/msg00004.html', 'name': '[debian-lts-announce] 20191206 [SECURITY] [DLA 2022-1] librabbitmq security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/WA7CPNVYMF6OQNIYNLWUY6U2GTKFOKH3/', 'name': 'FEDORA-2019-dd7c8f5435', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XQER6XTKYMHNQR7QTHW7DJAH645WQROU/', 'name': 'FEDORA-2019-8730b65158', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4214-2/', 'name': 'USN-4214-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202003-07', 'name': 'GLSA-202003-07', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rabbitmq-c_project:rabbitmq-c:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.10.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', '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:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.04:*:*:*:*:*:*:*', '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:19.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in amqp_handle_input in amqp_connection.c in rabbitmq-c 0.9.0. There is an integer overflow that leads to heap memory corruption in the handling of CONNECTION_STATE_HEADER. A rogue server could return a malicious frame header that leads to a smaller target_size value than needed. This condition is then carried on to a memcpy function that copies too much data into a heap buffer.'}]
2022-01-01T20:06Z
2019-12-01T22: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
Alan Antonuk
2019-11-03 23:50:07-08:00
lib: check frame_size is >= INT32_MAX When parsing a frame header, validate that the frame_size is less than or equal to INT32_MAX. Given frame_max is limited between 0 and INT32_MAX in amqp_login and friends, this does not change the API. This prevents a potential buffer overflow when a malicious client sends a frame_size that is close to UINT32_MAX, in which causes an overflow when computing state->target_size resulting in a small value there. A buffer is then allocated with the small amount, then memcopy copies the frame_size writing to memory beyond the end of the buffer.
fc85be7123050b91b054e45b91c78d3241a5047a
False
alanxz/rabbitmq-c
RabbitMQ C client
2011-06-06 16:42:17
2022-08-13 07:31:39
alanxz
1560.0
635.0
amqp_handle_input
amqp_handle_input( amqp_connection_state_t state , amqp_bytes_t received_data , amqp_frame_t * decoded_frame)
['state', 'received_data', 'decoded_frame']
int amqp_handle_input(amqp_connection_state_t state, amqp_bytes_t received_data, amqp_frame_t *decoded_frame) { size_t bytes_consumed; void *raw_frame; /* Returning frame_type of zero indicates either insufficient input, or a complete, ignored frame was read. */ decoded_frame->frame_type = 0; if (received_data.len == 0) { return AMQP_STATUS_OK; } if (state->state == CONNECTION_STATE_IDLE) { state->state = CONNECTION_STATE_HEADER; } bytes_consumed = consume_data(state, &received_data); /* do we have target_size data yet? if not, return with the expectation that more will arrive */ if (state->inbound_offset < state->target_size) { return (int)bytes_consumed; } raw_frame = state->inbound_buffer.bytes; switch (state->state) { case CONNECTION_STATE_INITIAL: /* check for a protocol header from the server */ if (memcmp(raw_frame, "AMQP", 4) == 0) { decoded_frame->frame_type = AMQP_PSEUDOFRAME_PROTOCOL_HEADER; decoded_frame->channel = 0; decoded_frame->payload.protocol_header.transport_high = amqp_d8(amqp_offset(raw_frame, 4)); decoded_frame->payload.protocol_header.transport_low = amqp_d8(amqp_offset(raw_frame, 5)); decoded_frame->payload.protocol_header.protocol_version_major = amqp_d8(amqp_offset(raw_frame, 6)); decoded_frame->payload.protocol_header.protocol_version_minor = amqp_d8(amqp_offset(raw_frame, 7)); return_to_idle(state); return (int)bytes_consumed; } /* it's not a protocol header; fall through to process it as a regular frame header */ case CONNECTION_STATE_HEADER: { amqp_channel_t channel; amqp_pool_t *channel_pool; /* frame length is 3 bytes in */ channel = amqp_d16(amqp_offset(raw_frame, 1)); state->target_size = amqp_d32(amqp_offset(raw_frame, 3)) + HEADER_SIZE + FOOTER_SIZE; if ((size_t)state->frame_max < state->target_size) { return AMQP_STATUS_BAD_AMQP_DATA; } channel_pool = amqp_get_or_create_channel_pool(state, channel); if (NULL == channel_pool) { return AMQP_STATUS_NO_MEMORY; } amqp_pool_alloc_bytes(channel_pool, state->target_size, &state->inbound_buffer); if (NULL == state->inbound_buffer.bytes) { return AMQP_STATUS_NO_MEMORY; } memcpy(state->inbound_buffer.bytes, state->header_buffer, HEADER_SIZE); raw_frame = state->inbound_buffer.bytes; state->state = CONNECTION_STATE_BODY; bytes_consumed += consume_data(state, &received_data); /* do we have target_size data yet? if not, return with the expectation that more will arrive */ if (state->inbound_offset < state->target_size) { return (int)bytes_consumed; } } /* fall through to process body */ case CONNECTION_STATE_BODY: { amqp_bytes_t encoded; int res; amqp_pool_t *channel_pool; /* Check frame end marker (footer) */ if (amqp_d8(amqp_offset(raw_frame, state->target_size - 1)) != AMQP_FRAME_END) { return AMQP_STATUS_BAD_AMQP_DATA; } decoded_frame->frame_type = amqp_d8(amqp_offset(raw_frame, 0)); decoded_frame->channel = amqp_d16(amqp_offset(raw_frame, 1)); channel_pool = amqp_get_or_create_channel_pool(state, decoded_frame->channel); if (NULL == channel_pool) { return AMQP_STATUS_NO_MEMORY; } switch (decoded_frame->frame_type) { case AMQP_FRAME_METHOD: decoded_frame->payload.method.id = amqp_d32(amqp_offset(raw_frame, HEADER_SIZE)); encoded.bytes = amqp_offset(raw_frame, HEADER_SIZE + 4); encoded.len = state->target_size - HEADER_SIZE - 4 - FOOTER_SIZE; res = amqp_decode_method(decoded_frame->payload.method.id, channel_pool, encoded, &decoded_frame->payload.method.decoded); if (res < 0) { return res; } break; case AMQP_FRAME_HEADER: decoded_frame->payload.properties.class_id = amqp_d16(amqp_offset(raw_frame, HEADER_SIZE)); /* unused 2-byte weight field goes here */ decoded_frame->payload.properties.body_size = amqp_d64(amqp_offset(raw_frame, HEADER_SIZE + 4)); encoded.bytes = amqp_offset(raw_frame, HEADER_SIZE + 12); encoded.len = state->target_size - HEADER_SIZE - 12 - FOOTER_SIZE; decoded_frame->payload.properties.raw = encoded; res = amqp_decode_properties( decoded_frame->payload.properties.class_id, channel_pool, encoded, &decoded_frame->payload.properties.decoded); if (res < 0) { return res; } break; case AMQP_FRAME_BODY: decoded_frame->payload.body_fragment.len = state->target_size - HEADER_SIZE - FOOTER_SIZE; decoded_frame->payload.body_fragment.bytes = amqp_offset(raw_frame, HEADER_SIZE); break; case AMQP_FRAME_HEARTBEAT: break; default: /* Ignore the frame */ decoded_frame->frame_type = 0; break; } return_to_idle(state); return (int)bytes_consumed; } default: amqp_abort("Internal error: invalid amqp_connection_state_t->state %d", state->state); } }
752
True
1
CVE-2019-18671
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/keepkey/keepkey-firmware/commit/b222c66cdd7c3203d917c80ba615082d309d80c3', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/b222c66cdd7c3203d917c80ba615082d309d80c3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'name': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'name': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18671/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18671/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:keepkey:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:keepkey:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient checks in the USB packet handling of the ShapeShift KeepKey hardware wallet before firmware 6.2.2 allow out-of-bounds writes in the .bss segment via crafted messages. The vulnerability could allow code execution or other forms of impact. It can be triggered by unauthenticated attackers and the interface is reachable via WebUSB.'}]
2020-02-12T03:15Z
2019-12-06T18: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
keepkeyjon
2019-09-11 13:20:00-06:00
board: factor out tiny_dispatch And add stronger checks on what tiny_msg's are allowed to be decoded.
b222c66cdd7c3203d917c80ba615082d309d80c3
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
handle_debug_usb_rx
handle_debug_usb_rx( const void * msg , size_t len)
['msg', 'len']
void handle_debug_usb_rx(const void *msg, size_t len) { if (msg_tiny_flag) { uint8_t buf[64]; memcpy(buf, msg, sizeof(buf)); uint16_t msgId = buf[4] | ((uint16_t)buf[3]) << 8; uint32_t msgSize = buf[8] | ((uint32_t)buf[7]) << 8 | ((uint32_t)buf[6]) << 16 | ((uint32_t)buf[5]) << 24; if (msgSize > 64 - 9) { (*msg_failure)(FailureType_Failure_UnexpectedMessage, "Malformed tiny packet"); return; } // Determine callback handler and message map type. const MessagesMap_t *entry = message_map_entry(DEBUG_MSG, msgId, IN_MSG); if (!entry) { (*msg_failure)(FailureType_Failure_UnexpectedMessage, "Unknown message"); return; } tiny_dispatch(entry, buf + 9, msgSize); } else { usb_rx_helper(msg, len, DEBUG_MSG); } }
182
True
1
CVE-2019-18671
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/keepkey/keepkey-firmware/commit/b222c66cdd7c3203d917c80ba615082d309d80c3', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/b222c66cdd7c3203d917c80ba615082d309d80c3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'name': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'name': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18671/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18671/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:keepkey:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:keepkey:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient checks in the USB packet handling of the ShapeShift KeepKey hardware wallet before firmware 6.2.2 allow out-of-bounds writes in the .bss segment via crafted messages. The vulnerability could allow code execution or other forms of impact. It can be triggered by unauthenticated attackers and the interface is reachable via WebUSB.'}]
2020-02-12T03:15Z
2019-12-06T18: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
keepkeyjon
2019-09-11 13:20:00-06:00
board: factor out tiny_dispatch And add stronger checks on what tiny_msg's are allowed to be decoded.
b222c66cdd7c3203d917c80ba615082d309d80c3
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
handle_usb_rx
handle_usb_rx( const void * msg , size_t len)
['msg', 'len']
void handle_usb_rx(const void *msg, size_t len) { if (msg_tiny_flag) { uint8_t buf[64]; memcpy(buf, msg, sizeof(buf)); uint16_t msgId = buf[4] | ((uint16_t)buf[3]) << 8; uint32_t msgSize = buf[8] | ((uint32_t)buf[7]) << 8 | ((uint32_t)buf[6]) << 16 | ((uint32_t)buf[5]) << 24; if (msgSize > 64 - 9) { (*msg_failure)(FailureType_Failure_UnexpectedMessage, "Malformed tiny packet"); return; } // Determine callback handler and message map type. const MessagesMap_t *entry = message_map_entry(NORMAL_MSG, msgId, IN_MSG); if (!entry) { (*msg_failure)(FailureType_Failure_UnexpectedMessage, "Unknown message"); return; } tiny_dispatch(entry, buf + 9, msgSize); } else { usb_rx_helper(msg, len, NORMAL_MSG); } }
182
True
1
CVE-2019-18671
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
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/keepkey/keepkey-firmware/commit/b222c66cdd7c3203d917c80ba615082d309d80c3', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/b222c66cdd7c3203d917c80ba615082d309d80c3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'name': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'name': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18671/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18671/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:keepkey:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:keepkey:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient checks in the USB packet handling of the ShapeShift KeepKey hardware wallet before firmware 6.2.2 allow out-of-bounds writes in the .bss segment via crafted messages. The vulnerability could allow code execution or other forms of impact. It can be triggered by unauthenticated attackers and the interface is reachable via WebUSB.'}]
2020-02-12T03:15Z
2019-12-06T18: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
keepkeyjon
2019-09-11 13:20:00-06:00
board: factor out tiny_dispatch And add stronger checks on what tiny_msg's are allowed to be decoded.
b222c66cdd7c3203d917c80ba615082d309d80c3
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
tiny_dispatch
tiny_dispatch( const MessagesMap_t * entry , uint8_t * msg , uint32_t msg_size)
['entry', 'msg', 'msg_size']
static void tiny_dispatch(const MessagesMap_t *entry, uint8_t *msg, uint32_t msg_size) { if (!pb_parse(entry, msg, msg_size, msg_tiny)) { call_msg_failure_handler(FailureType_Failure_UnexpectedMessage, "Could not parse tiny protocol buffer message"); return; } msg_tiny_id = entry->msg_id; }
47
True
1
CVE-2019-18672
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:P/A:N
NETWORK
LOW
NONE
NONE
PARTIAL
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
7.5
HIGH
3.9
3.6
False
[{'url': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'name': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'name': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/commit/769714fcb569e7a4faff9530a2d9ac1f9d6e5680', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/769714fcb569e7a4faff9530a2d9ac1f9d6e5680', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18672/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18672/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-354'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:shapeshift:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:shapeshift:keepkey_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient checks in the finite state machine of the ShapeShift KeepKey hardware wallet before firmware 6.2.2 allow a partial reset of cryptographic secrets to known values via crafted messages. Notably, this breaks the security of U2F for new server registrations and invalidates existing registrations. This vulnerability can be exploited by unauthenticated attackers and the interface is reachable via WebUSB.'}]
2020-03-02T15:15Z
2019-12-06T18:15Z
Improper Validation of Integrity Check Value
The software does not validate or incorrectly validates the integrity check values or "checksums" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.
Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.
https://cwe.mitre.org/data/definitions/354.html
0
keepkeyjon
2019-09-11 13:30:33-06:00
firmware: stronger recovery state machine checks
769714fcb569e7a4faff9530a2d9ac1f9d6e5680
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
recovery_character
recovery_character( const char * character)
['character']
void recovery_character(const char *character) { if (!awaiting_character) { recovery_abort(); fsm_sendFailure(FailureType_Failure_UnexpectedMessage, "Not in Recovery mode"); layoutHome(); return; } if (strlen(mnemonic) + 1 > MNEMONIC_BUF - 1) { recovery_abort(); fsm_sendFailure(FailureType_Failure_UnexpectedMessage, "Too many characters attempted during recovery"); layoutHome(); return; } char *pos = strchr(cipher, character[0]); // If not a space and not a legitmate cipher character, send failure. if (character[0] != ' ' && pos == NULL) { recovery_abort(); fsm_sendFailure(FailureType_Failure_SyntaxError, "Character must be from a to z"); layoutHome(); return; } // Count of words we think the user has entered without using the cipher: static int uncyphered_word_count = 0; static bool definitely_using_cipher = false; static CONFIDENTIAL char coded_word[12]; static CONFIDENTIAL char decoded_word[12]; if (!mnemonic[0]) { uncyphered_word_count = 0; definitely_using_cipher = false; memzero(coded_word, sizeof(coded_word)); memzero(decoded_word, sizeof(decoded_word)); } char decoded_character[2] = " "; if (character[0] != ' ') { // Decode character using cipher if not space decoded_character[0] = english_alphabet[(int)(pos - cipher)]; strlcat(coded_word, character, sizeof(coded_word)); strlcat(decoded_word, decoded_character, sizeof(decoded_word)); if (enforce_wordlist && 4 <= strlen(coded_word)) { // Check & bail if the user is entering their seed without using the // cipher. Note that for each word, this can give false positives about // ~0.4% of the time (2048/26^4). bool maybe_not_using_cipher = attempt_auto_complete(coded_word); bool maybe_using_cipher = attempt_auto_complete(decoded_word); if (!maybe_not_using_cipher && maybe_using_cipher) { // Decrease the overall false positive rate by detecting that a // user has entered a word which is definitely using the // cipher. definitely_using_cipher = true; } else if (maybe_not_using_cipher && !definitely_using_cipher && MAX_UNCYPHERED_WORDS < uncyphered_word_count++) { recovery_abort(); fsm_sendFailure(FailureType_Failure_SyntaxError, "Words were not entered correctly. Make sure you are using the substition cipher."); layoutHome(); return; } } } else { memzero(coded_word, sizeof(coded_word)); memzero(decoded_word, sizeof(decoded_word)); } // concat to mnemonic strlcat(mnemonic, decoded_character, MNEMONIC_BUF); next_character(); }
347
True
1
CVE-2019-18672
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:P/A:N
NETWORK
LOW
NONE
NONE
PARTIAL
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
7.5
HIGH
3.9
3.6
False
[{'url': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'name': 'https://medium.com/shapeshift-stories/shapeshift-security-update-8ec89bb1b4e3', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'name': 'https://medium.com/shapeshift-stories/keepkey-release-notes-v-6f7d2ec78065', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/commit/769714fcb569e7a4faff9530a2d9ac1f9d6e5680', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/769714fcb569e7a4faff9530a2d9ac1f9d6e5680', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18672/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2019-18672/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-354'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:shapeshift:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:shapeshift:keepkey_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient checks in the finite state machine of the ShapeShift KeepKey hardware wallet before firmware 6.2.2 allow a partial reset of cryptographic secrets to known values via crafted messages. Notably, this breaks the security of U2F for new server registrations and invalidates existing registrations. This vulnerability can be exploited by unauthenticated attackers and the interface is reachable via WebUSB.'}]
2020-03-02T15:15Z
2019-12-06T18:15Z
Improper Validation of Integrity Check Value
The software does not validate or incorrectly validates the integrity check values or "checksums" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.
Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.
https://cwe.mitre.org/data/definitions/354.html
0
keepkeyjon
2019-09-11 13:30:33-06:00
firmware: stronger recovery state machine checks
769714fcb569e7a4faff9530a2d9ac1f9d6e5680
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
recovery_cipher_finalize
recovery_cipher_finalize( void)
['void']
void recovery_cipher_finalize(void) { static char CONFIDENTIAL new_mnemonic[MNEMONIC_BUF] = ""; static char CONFIDENTIAL temp_word[CURRENT_WORD_BUF]; volatile bool auto_completed = true; /* Attempt to autocomplete each word */ char *tok = strtok(mnemonic, " "); while(tok) { strlcpy(temp_word, tok, CURRENT_WORD_BUF); auto_completed &= attempt_auto_complete(temp_word); strlcat(new_mnemonic, temp_word, MNEMONIC_BUF); strlcat(new_mnemonic, " ", MNEMONIC_BUF); tok = strtok(NULL, " "); } memzero(temp_word, sizeof(temp_word)); if (!auto_completed && !enforce_wordlist) { if (!dry_run) { storage_reset(); } fsm_sendFailure(FailureType_Failure_SyntaxError, "Words were not entered correctly. Make sure you are using the substition cipher."); awaiting_character = false; layoutHome(); return; } /* Truncate additional space at the end */ new_mnemonic[strlen(new_mnemonic) - 1] = '\0'; if (!dry_run && (!enforce_wordlist || mnemonic_check(new_mnemonic))) { storage_setMnemonic(new_mnemonic); memzero(new_mnemonic, sizeof(new_mnemonic)); if (!enforce_wordlist) { // not enforcing => mark storage as imported storage_setImported(true); } storage_commit(); fsm_sendSuccess("Device recovered"); } else if (dry_run) { bool match = storage_isInitialized() && storage_containsMnemonic(new_mnemonic); if (match) { review(ButtonRequestType_ButtonRequest_Other, "Recovery Dry Run", "The seed is valid and MATCHES the one in the device."); fsm_sendSuccess("The seed is valid and matches the one in the device."); } else if (mnemonic_check(new_mnemonic)) { review(ButtonRequestType_ButtonRequest_Other, "Recovery Dry Run", "The seed is valid, but DOES NOT MATCH the one in the device."); fsm_sendFailure(FailureType_Failure_Other, "The seed is valid, but does not match the one in the device."); } else { review(ButtonRequestType_ButtonRequest_Other, "Recovery Dry Run", "The seed is INVALID, and DOES NOT MATCH the one in the device."); fsm_sendFailure(FailureType_Failure_Other, "The seed is invalid, and does not match the one in the device."); } memzero(new_mnemonic, sizeof(new_mnemonic)); } else { session_clear(true); fsm_sendFailure(FailureType_Failure_SyntaxError, "Invalid mnemonic, are words in correct order?"); recovery_abort(); } memzero(new_mnemonic, sizeof(new_mnemonic)); awaiting_character = false; memzero(mnemonic, sizeof(mnemonic)); memzero(cipher, sizeof(cipher)); layoutHome(); }
354
True
1
CVE-2021-31616
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://github.com/keepkey/keepkey-firmware/commit/e49d45594002d4d3fbc1f03488e6dfc0a0a65836', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/e49d45594002d4d3fbc1f03488e6dfc0a0a65836', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.1.0', 'name': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.1.0', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2021-31616/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2021-31616/', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://shapeshift.com/library/keepkey-important-update-issued-april-4-required', 'name': 'https://shapeshift.com/library/keepkey-important-update-issued-april-4-required', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:shapeshift:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.0.3', 'versionEndExcluding': '7.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:shapeshift:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient length checks in the ShapeShift KeepKey hardware wallet firmware before 7.1.0 allow a stack buffer overflow via crafted messages. The overflow in ethereum_extractThorchainSwapData() in ethereum.c can circumvent stack protections and lead to code execution. The vulnerable interface is reachable remotely over WebUSB.'}]
2022-05-03T16:04Z
2021-05-06T13: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
markrypto
2021-04-14 10:44:43-06:00
710 merge
e49d45594002d4d3fbc1f03488e6dfc0a0a65836
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
ethereum_extractThorchainData
ethereum_extractThorchainData( const EthereumSignTx * msg , char * buffer)
['msg', 'buffer']
uint8_t ethereum_extractThorchainData(const EthereumSignTx *msg, char *buffer) { // Swap data begins 164 chars into data buffer: // offset = deposit function hash + address + address + uint256 uint16_t offset = 4 + (5 * 32); int16_t len = msg->data_length - offset; if (msg->has_data_length && len > 0) { memcpy(buffer, msg->data_initial_chunk.bytes + offset, len); // String length must be < 255 characters return len < 256 ? (uint8_t)len : 0; } return 0; }
75
True
1
CVE-2021-31616
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:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://github.com/keepkey/keepkey-firmware/commit/e49d45594002d4d3fbc1f03488e6dfc0a0a65836', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/e49d45594002d4d3fbc1f03488e6dfc0a0a65836', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.1.0', 'name': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.1.0', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2021-31616/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2021-31616/', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://shapeshift.com/library/keepkey-important-update-issued-april-4-required', 'name': 'https://shapeshift.com/library/keepkey-important-update-issued-april-4-required', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:shapeshift:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.0.3', 'versionEndExcluding': '7.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:shapeshift:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'Insufficient length checks in the ShapeShift KeepKey hardware wallet firmware before 7.1.0 allow a stack buffer overflow via crafted messages. The overflow in ethereum_extractThorchainSwapData() in ethereum.c can circumvent stack protections and lead to code execution. The vulnerable interface is reachable remotely over WebUSB.'}]
2022-05-03T16:04Z
2021-05-06T13: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
markrypto
2021-04-14 10:44:43-06:00
710 merge
e49d45594002d4d3fbc1f03488e6dfc0a0a65836
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
zx_confirmZxLiquidTx
zx_confirmZxLiquidTx( uint32_t data_total , const EthereumSignTx * msg)
['data_total', 'msg']
bool zx_confirmZxLiquidTx(uint32_t data_total, const EthereumSignTx *msg) { (void)data_total; const TokenType *token; char constr1[40], constr2[40], *arStr = ""; uint8_t *tokenAddress, *deadlineBytes; bignum256 tokenAmount, tokenMinAmount, ethMinAmount; uint64_t deadline; if (isAddLiquidityEthCall(msg)) { arStr = "uniswap add liquidity"; } else if (isRemoveLiquidityEthCall(msg)) { arStr = "uniswap remove liquidity"; } else { return false; } tokenAddress = (uint8_t *)(msg->data_initial_chunk.bytes + 4 + 32 - 20); token = tokenByChainAddress(msg->chain_id, tokenAddress); bn_from_bytes(msg->data_initial_chunk.bytes + 4 + 32, 32, &tokenAmount); bn_from_bytes(msg->data_initial_chunk.bytes + 4 + 2*32, 32, &tokenMinAmount); bn_from_bytes(msg->data_initial_chunk.bytes + 4 + 3*32, 32, &ethMinAmount); deadlineBytes = (uint8_t *)(msg->data_initial_chunk.bytes + 4 + 6*32 - 8); deadline = ((uint64_t)deadlineBytes[0] << 8*7) | ((uint64_t)deadlineBytes[1] << 8*6) | ((uint64_t)deadlineBytes[2] << 8*5) | ((uint64_t)deadlineBytes[3] << 8*4) | ((uint64_t)deadlineBytes[4] << 8*3) | ((uint64_t)deadlineBytes[5] << 8*2) | ((uint64_t)deadlineBytes[6] << 8*1) | ((uint64_t)deadlineBytes[7]); char tokbuf[32]; ethereumFormatAmount(&tokenAmount, token, msg->chain_id, tokbuf, sizeof(tokbuf)); snprintf(constr1, 32, "%s", tokbuf); ethereumFormatAmount(&tokenMinAmount, token, msg->chain_id, tokbuf, sizeof(tokbuf)); snprintf(constr2, 32, "%s", tokbuf); confirm(ButtonRequestType_ButtonRequest_ConfirmOutput, arStr, "%s\nMinimum %s", constr1, constr2); if (!confirmFromAccountMatch(msg, arStr)) { return false; } ethereumFormatAmount(&ethMinAmount, NULL, msg->chain_id, tokbuf, sizeof(tokbuf)); snprintf(constr1, 32, "%s", tokbuf); confirm(ButtonRequestType_ButtonRequest_ConfirmOutput, arStr, "Minimum %s", constr1); snprintf(constr1, 32, "%lld", deadline); confirm(ButtonRequestType_ButtonRequest_ConfirmOutput, arStr, "Deadline %s", ctime((const time_t *)&deadline)); return true; }
485
True
1
CVE-2022-30330
False
False
False
True
AV:L/AC:M/Au:N/C:C/I:C/A:C
LOCAL
MEDIUM
NONE
COMPLETE
COMPLETE
COMPLETE
6.9
CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
PHYSICAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
6.6
MEDIUM
0.7
5.9
False
[{'url': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.3.2', 'name': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.3.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/commit/447c1f038a31378ab9589965c098467d9ea6cccc', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/447c1f038a31378ab9589965c098467d9ea6cccc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2022-30330/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2022-30330/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-668'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:keepkey:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.3.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:keepkey:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'In the KeepKey firmware before 7.3.2,Flaws in the supervisor interface can be exploited to bypass important security restrictions on firmware operations. Using these flaws, malicious firmware code can elevate privileges, permanently make the device inoperable or overwrite the trusted bootloader code to compromise the hardware wallet across reboots or storage wipes.'}]
2022-07-05T12:15Z
2022-05-07T04:15Z
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files. A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system. In either case, the end result is that a resource has been exposed to the wrong party.
https://cwe.mitre.org/data/definitions/668.html
0
MrNerdHair
2022-04-12 15:44:55-04:00
fix: more robust address range checks in svhandler_flash_*
447c1f038a31378ab9589965c098467d9ea6cccc
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
svhandler_flash_erase_sector
svhandler_flash_erase_sector( void)
['void']
void svhandler_flash_erase_sector(void) { uint32_t sector = _param_1; // Do not allow firmware to erase bootstrap or bootloader sectors. if ((sector == FLASH_BOOTSTRAP_SECTOR) || (sector >= FLASH_BOOT_SECTOR_FIRST && sector <= FLASH_BOOT_SECTOR_LAST)) { return; } // Unlock flash. flash_clear_status_flags(); flash_unlock(); // Erase the sector. flash_erase_sector(sector, FLASH_CR_PROGRAM_X32); // Return flash status. _param_1 = !!flash_chk_status(); _param_2 = 0; _param_3 = 0; // Wait for any write operation to complete. flash_wait_for_last_operation(); // Disable writes to flash. FLASH_CR &= ~FLASH_CR_PG; // lock flash register FLASH_CR |= FLASH_CR_LOCK; }
76
True
1
CVE-2022-30330
False
False
False
True
AV:L/AC:M/Au:N/C:C/I:C/A:C
LOCAL
MEDIUM
NONE
COMPLETE
COMPLETE
COMPLETE
6.9
CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
PHYSICAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
6.6
MEDIUM
0.7
5.9
False
[{'url': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.3.2', 'name': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.3.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/commit/447c1f038a31378ab9589965c098467d9ea6cccc', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/447c1f038a31378ab9589965c098467d9ea6cccc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2022-30330/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2022-30330/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-668'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:keepkey:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.3.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:keepkey:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'In the KeepKey firmware before 7.3.2,Flaws in the supervisor interface can be exploited to bypass important security restrictions on firmware operations. Using these flaws, malicious firmware code can elevate privileges, permanently make the device inoperable or overwrite the trusted bootloader code to compromise the hardware wallet across reboots or storage wipes.'}]
2022-07-05T12:15Z
2022-05-07T04:15Z
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files. A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system. In either case, the end result is that a resource has been exposed to the wrong party.
https://cwe.mitre.org/data/definitions/668.html
0
MrNerdHair
2022-04-12 15:44:55-04:00
fix: more robust address range checks in svhandler_flash_*
447c1f038a31378ab9589965c098467d9ea6cccc
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
svhandler_flash_pgm_blk
svhandler_flash_pgm_blk( void)
['void']
void svhandler_flash_pgm_blk(void) { uint32_t beginAddr = _param_1; uint32_t data = _param_2; uint32_t length = _param_3; // Protect from overflow. if (beginAddr + length < beginAddr) return; // Do not allow firmware to erase bootstrap or bootloader sectors. if (((beginAddr >= BSTRP_FLASH_SECT_START) && (beginAddr <= (BSTRP_FLASH_SECT_START + BSTRP_FLASH_SECT_LEN - 1))) || (((beginAddr + length) >= BSTRP_FLASH_SECT_START) && ((beginAddr + length) <= (BSTRP_FLASH_SECT_START + BSTRP_FLASH_SECT_LEN - 1)))) { return; } if (((beginAddr >= BLDR_FLASH_SECT_START) && (beginAddr <= (BLDR_FLASH_SECT_START + 2 * BLDR_FLASH_SECT_LEN - 1))) || (((beginAddr + length) >= BLDR_FLASH_SECT_START) && ((beginAddr + length) <= (BLDR_FLASH_SECT_START + 2 * BLDR_FLASH_SECT_LEN - 1)))) { return; } // Unlock flash. flash_clear_status_flags(); flash_unlock(); // Flash write. flash_program(beginAddr, (uint8_t *)data, length); // Return flash status. _param_1 = !!flash_chk_status(); _param_2 = 0; _param_3 = 0; // Wait for any write operation to complete. flash_wait_for_last_operation(); // Disable writes to flash. FLASH_CR &= ~FLASH_CR_PG; // Lock flash register FLASH_CR |= FLASH_CR_LOCK; }
192
True
1
CVE-2022-30330
False
False
False
True
AV:L/AC:M/Au:N/C:C/I:C/A:C
LOCAL
MEDIUM
NONE
COMPLETE
COMPLETE
COMPLETE
6.9
CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
PHYSICAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
6.6
MEDIUM
0.7
5.9
False
[{'url': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.3.2', 'name': 'https://github.com/keepkey/keepkey-firmware/releases/tag/v7.3.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/keepkey/keepkey-firmware/commit/447c1f038a31378ab9589965c098467d9ea6cccc', 'name': 'https://github.com/keepkey/keepkey-firmware/commit/447c1f038a31378ab9589965c098467d9ea6cccc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.inhq.net/posts/keepkey-CVE-2022-30330/', 'name': 'https://blog.inhq.net/posts/keepkey-CVE-2022-30330/', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-668'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:keepkey:keepkey_firmware:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.3.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:keepkey:keepkey:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'In the KeepKey firmware before 7.3.2,Flaws in the supervisor interface can be exploited to bypass important security restrictions on firmware operations. Using these flaws, malicious firmware code can elevate privileges, permanently make the device inoperable or overwrite the trusted bootloader code to compromise the hardware wallet across reboots or storage wipes.'}]
2022-07-05T12:15Z
2022-05-07T04:15Z
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files. A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system. In either case, the end result is that a resource has been exposed to the wrong party.
https://cwe.mitre.org/data/definitions/668.html
0
MrNerdHair
2022-04-12 15:44:55-04:00
fix: more robust address range checks in svhandler_flash_*
447c1f038a31378ab9589965c098467d9ea6cccc
False
keepkey/keepkey-firmware
KeepKey Device Firmware
2015-07-21 16:37:45
2022-08-18 21:01:08
null
keepkey
139.0
157.0
svhandler_flash_pgm_word
svhandler_flash_pgm_word( void)
['void']
void svhandler_flash_pgm_word(void) { uint32_t dst = _param_1; uint32_t src = _param_2; // Do not allow firmware to erase bootstrap or bootloader sectors. if ((dst >= BSTRP_FLASH_SECT_START) && (dst <= (BSTRP_FLASH_SECT_START + BSTRP_FLASH_SECT_LEN))) { return; } if ((dst >= BLDR_FLASH_SECT_START) && (dst <= (BLDR_FLASH_SECT_START + 2 * BLDR_FLASH_SECT_LEN))) { return; } // Unlock flash. flash_clear_status_flags(); flash_unlock(); // Flash write. flash_program_word(dst, src); _param_1 = !!flash_chk_status(); _param_2 = 0; _param_3 = 0; // Wait for any write operation to complete. flash_wait_for_last_operation(); // Disable writes to flash. FLASH_CR &= ~FLASH_CR_PG; // Lock flash register FLASH_CR |= FLASH_CR_LOCK; }
105
True
1
CVE-2021-36148
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/projectacrn/acrn-hypervisor/commit/25c0e3817eb332660dd63d1d4522e63dcc94e79a', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/25c0e3817eb332660dd63d1d4522e63dcc94e79a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in ACRN before 2.5. dmar_free_irte in hypervisor/arch/x86/vtd.c allows an irte_alloc_bitmap buffer overflow.'}]
2021-07-08T18:11Z
2021-07-02T22: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
Yonghua Huang
2021-06-02 15:19:15+08:00
hv: validate input for dmar_free_irte function Malicious input 'index' may trigger buffer overflow on array 'irte_alloc_bitmap[]'. This patch validate that 'index' shall be less than 'CONFIG_MAX_IR_ENTRIES' and also remove unnecessary check on 'index' in 'ptirq_free_irte()' function with this fix. Tracked-On: #6132 Signed-off-by: Yonghua Huang <[email protected]>
25c0e3817eb332660dd63d1d4522e63dcc94e79a
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
ptirq_free_irte
ptirq_free_irte( const struct ptirq_remapping_info * entry)
['entry']
static void ptirq_free_irte(const struct ptirq_remapping_info *entry) { struct intr_source intr_src; if (entry->irte_idx < CONFIG_MAX_IR_ENTRIES) { if (entry->intr_type == PTDEV_INTR_MSI) { intr_src.is_msi = true; intr_src.src.msi.value = entry->phys_sid.msi_id.bdf; } else { intr_src.is_msi = false; intr_src.src.ioapic_id = ioapic_irq_to_ioapic_id(entry->allocated_pirq); } dmar_free_irte(&intr_src, entry->irte_idx); } }
88
True
1
CVE-2021-36148
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/projectacrn/acrn-hypervisor/commit/25c0e3817eb332660dd63d1d4522e63dcc94e79a', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/25c0e3817eb332660dd63d1d4522e63dcc94e79a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in ACRN before 2.5. dmar_free_irte in hypervisor/arch/x86/vtd.c allows an irte_alloc_bitmap buffer overflow.'}]
2021-07-08T18:11Z
2021-07-02T22: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
Yonghua Huang
2021-06-02 15:19:15+08:00
hv: validate input for dmar_free_irte function Malicious input 'index' may trigger buffer overflow on array 'irte_alloc_bitmap[]'. This patch validate that 'index' shall be less than 'CONFIG_MAX_IR_ENTRIES' and also remove unnecessary check on 'index' in 'ptirq_free_irte()' function with this fix. Tracked-On: #6132 Signed-off-by: Yonghua Huang <[email protected]>
25c0e3817eb332660dd63d1d4522e63dcc94e79a
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
dmar_free_irte
dmar_free_irte( const struct intr_source * intr_src , uint16_t index)
['intr_src', 'index']
void dmar_free_irte(const struct intr_source *intr_src, uint16_t index) { struct dmar_drhd_rt *dmar_unit; union dmar_ir_entry *ir_table, *ir_entry; union pci_bdf sid; if (intr_src->is_msi) { dmar_unit = device_to_dmaru((uint8_t)intr_src->src.msi.bits.b, intr_src->src.msi.fields.devfun); } else { dmar_unit = ioapic_to_dmaru(intr_src->src.ioapic_id, &sid); } if (is_dmar_unit_valid(dmar_unit, sid)) { ir_table = (union dmar_ir_entry *)hpa2hva(dmar_unit->ir_table_addr); ir_entry = ir_table + index; ir_entry->bits.remap.present = 0x0UL; iommu_flush_cache(ir_entry, sizeof(union dmar_ir_entry)); dmar_invalid_iec(dmar_unit, index, 0U, false); if (!is_irte_reserved(dmar_unit, index)) { spinlock_obtain(&dmar_unit->lock); bitmap_clear_nolock(index & 0x3FU, &dmar_unit->irte_alloc_bitmap[index >> 6U]); spinlock_release(&dmar_unit->lock); } } }
192
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
deinit_pci
deinit_pci( struct vmctx * ctx)
['ctx']
deinit_pci(struct vmctx *ctx) { struct pci_vdev_ops *ops; struct businfo *bi; struct slotinfo *si; struct funcinfo *fi; int bus, slot, func; size_t lowmem; struct mem_range mr; /* Release PCI extended config space */ bzero(&mr, sizeof(struct mem_range)); mr.name = "PCI ECFG"; mr.base = PCI_EMUL_ECFG_BASE; mr.size = PCI_EMUL_ECFG_SIZE; unregister_mem(&mr); /* Release PCI hole space */ lowmem = vm_get_lowmem_size(ctx); bzero(&mr, sizeof(struct mem_range)); mr.name = "PCI hole (32-bit)"; mr.base = lowmem; mr.size = (4ULL * 1024 * 1024 * 1024) - lowmem; unregister_mem_fallback(&mr); /* ditto for the 64-bit PCI host aperture */ bzero(&mr, sizeof(struct mem_range)); mr.name = "PCI hole (64-bit)"; mr.base = PCI_EMUL_MEMBASE64; mr.size = PCI_EMUL_MEMLIMIT64 - PCI_EMUL_MEMBASE64; unregister_mem_fallback(&mr); for (bus = 0; bus < MAXBUSES; bus++) { bi = pci_businfo[bus]; if (bi == NULL) continue; for (slot = 0; slot < MAXSLOTS; slot++) { si = &bi->slotinfo[slot]; for (func = 0; func < MAXFUNCS; func++) { fi = &si->si_funcs[func]; if (fi->fi_name == NULL) continue; ops = pci_emul_finddev(fi->fi_name); assert(ops != NULL); pr_notice("pci deinit %s\n", fi->fi_name); pci_emul_deinit(ctx, ops, bus, slot, func, fi); } } } }
300
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
init_pci
init_pci( struct vmctx * ctx)
['ctx']
init_pci(struct vmctx *ctx) { struct mem_range mr; struct pci_vdev_ops *ops; struct businfo *bi; struct slotinfo *si; struct funcinfo *fi; size_t lowmem; int bus, slot, func; int success_cnt = 0; int error; pci_emul_iobase = PCI_EMUL_IOBASE; pci_emul_membase32 = vm_get_lowmem_limit(ctx); pci_emul_membase64 = PCI_EMUL_MEMBASE64; create_gsi_sharing_groups(); for (bus = 0; bus < MAXBUSES; bus++) { bi = pci_businfo[bus]; if (bi == NULL) continue; /* * Keep track of the i/o and memory resources allocated to * this bus. */ bi->iobase = pci_emul_iobase; bi->membase32 = pci_emul_membase32; bi->membase64 = pci_emul_membase64; for (slot = 0; slot < MAXSLOTS; slot++) { si = &bi->slotinfo[slot]; for (func = 0; func < MAXFUNCS; func++) { fi = &si->si_funcs[func]; if (fi->fi_name == NULL) continue; ops = pci_emul_finddev(fi->fi_name); assert(ops != NULL); pr_notice("pci init %s\r\n", fi->fi_name); error = pci_emul_init(ctx, ops, bus, slot, func, fi); if (error) { pr_err("pci %s init failed\n", fi->fi_name); goto pci_emul_init_fail; } success_cnt++; } } /* * Add some slop to the I/O and memory resources decoded by * this bus to give a guest some flexibility if it wants to * reprogram the BARs. */ pci_emul_iobase += BUSIO_ROUNDUP; pci_emul_iobase = roundup2(pci_emul_iobase, BUSIO_ROUNDUP); bi->iolimit = pci_emul_iobase; pci_emul_membase32 += BUSMEM_ROUNDUP; pci_emul_membase32 = roundup2(pci_emul_membase32, BUSMEM_ROUNDUP); bi->memlimit32 = pci_emul_membase32; pci_emul_membase64 += BUSMEM_ROUNDUP; pci_emul_membase64 = roundup2(pci_emul_membase64, BUSMEM_ROUNDUP); bi->memlimit64 = pci_emul_membase64; } error = check_gsi_sharing_violation(); if (error < 0) goto pci_emul_init_fail; /* * PCI backends are initialized before routing INTx interrupts * so that LPC devices are able to reserve ISA IRQs before * routing PIRQ pins. */ for (bus = 0; bus < MAXBUSES; bus++) { bi = pci_businfo[bus]; if (bi == NULL) continue; for (slot = 0; slot < MAXSLOTS; slot++) { si = &bi->slotinfo[slot]; for (func = 0; func < MAXFUNCS; func++) { fi = &si->si_funcs[func]; if (fi->fi_devi == NULL) continue; pci_lintr_route(fi->fi_devi); ops = fi->fi_devi->dev_ops; if (ops && ops->vdev_phys_access) ops->vdev_phys_access(ctx, fi->fi_devi); } } } lpc_pirq_routed(); /* * The guest physical memory map looks like the following: * [0, lowmem) guest system memory * [lowmem, lowmem_limit) memory hole (may be absent) * [lowmem_limit, 0xE0000000) PCI hole (32-bit BAR allocation) * [0xE0000000, 0xF0000000) PCI extended config window * [0xF0000000, 4GB) LAPIC, IOAPIC, HPET, firmware * [4GB, 5GB) PCI hole (64-bit BAR allocation) * [5GB, 5GB + highmem) guest system memory */ /* * Accesses to memory addresses that are not allocated to system * memory or PCI devices return 0xff's. */ lowmem = vm_get_lowmem_size(ctx); bzero(&mr, sizeof(struct mem_range)); mr.name = "PCI hole (32-bit)"; mr.flags = MEM_F_RW; mr.base = lowmem; mr.size = (4ULL * 1024 * 1024 * 1024) - lowmem; mr.handler = pci_emul_fallback_handler; error = register_mem_fallback(&mr); assert(error == 0); /* ditto for the 64-bit PCI host aperture */ bzero(&mr, sizeof(struct mem_range)); mr.name = "PCI hole (64-bit)"; mr.flags = MEM_F_RW; mr.base = PCI_EMUL_MEMBASE64; mr.size = PCI_EMUL_MEMLIMIT64 - PCI_EMUL_MEMBASE64; mr.handler = pci_emul_fallback_handler; error = register_mem_fallback(&mr); assert(error == 0); /* PCI extended config space */ bzero(&mr, sizeof(struct mem_range)); mr.name = "PCI ECFG"; mr.flags = MEM_F_RW; mr.base = PCI_EMUL_ECFG_BASE; mr.size = PCI_EMUL_ECFG_SIZE; mr.handler = pci_emul_ecfg_handler; error = register_mem(&mr); assert(error == 0); return 0; pci_emul_init_fail: for (bus = 0; bus < MAXBUSES && success_cnt > 0; bus++) { bi = pci_businfo[bus]; if (bi == NULL) continue; for (slot = 0; slot < MAXSLOTS && success_cnt > 0; slot++) { si = &bi->slotinfo[slot]; for (func = 0; func < MAXFUNCS; func++) { fi = &si->si_funcs[func]; if (fi->fi_name == NULL) continue; if (success_cnt-- <= 0) break; ops = pci_emul_finddev(fi->fi_name); assert(ops != NULL); pci_emul_deinit(ctx, ops, bus, slot, func, fi); } } } return error; }
777
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
modify_bar_registration
modify_bar_registration( struct pci_vdev * dev , int idx , int registration)
['dev', 'idx', 'registration']
modify_bar_registration(struct pci_vdev *dev, int idx, int registration) { int error; struct inout_port iop; struct mem_range mr; if (is_pci_gvt(dev)) { /* GVT device is the only one who traps the pci bar access and * intercepts the corresponding contents in kernel. It needs * register pci resource only, but no need to register the * region. * * FIXME: This is a short term solution. This patch will be * obsoleted with the migration of using OVMF to do bar * addressing and generate ACPI PCI resource from using * acrn-dm. */ printf("modify_bar_registration: bypass for pci-gvt\n"); return; } switch (dev->bar[idx].type) { case PCIBAR_IO: bzero(&iop, sizeof(struct inout_port)); iop.name = dev->name; iop.port = dev->bar[idx].addr; iop.size = dev->bar[idx].size; if (registration) { iop.flags = IOPORT_F_INOUT; iop.handler = pci_emul_io_handler; iop.arg = dev; error = register_inout(&iop); } else error = unregister_inout(&iop); break; case PCIBAR_MEM32: case PCIBAR_MEM64: bzero(&mr, sizeof(struct mem_range)); mr.name = dev->name; mr.base = dev->bar[idx].addr; mr.size = dev->bar[idx].size; if (registration) { mr.flags = MEM_F_RW; mr.handler = pci_emul_mem_handler; mr.arg1 = dev; mr.arg2 = idx; error = register_mem(&mr); } else error = unregister_mem(&mr); break; default: error = EINVAL; break; } assert(error == 0); }
263
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_bus_configured
pci_bus_configured( int bus)
['bus']
pci_bus_configured(int bus) { assert(bus >= 0 && bus < MAXBUSES); return (pci_businfo[bus] != NULL); }
28
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_bus_write_dsdt
pci_bus_write_dsdt( int bus)
['bus']
pci_bus_write_dsdt(int bus) { struct businfo *bi; struct slotinfo *si; struct pci_vdev *dev; int count, func, slot; /* * If there are no devices on this 'bus' then just return. */ bi = pci_businfo[bus]; if (bi == NULL) { /* * Bus 0 is special because it decodes the I/O ports used * for PCI config space access even if there are no devices * on it. */ if (bus != 0) return; } dsdt_line(" Device (PCI%01X)", bus); dsdt_line(" {"); dsdt_line(" Name (_HID, EisaId (\"PNP0A03\"))"); dsdt_line(" Name (_ADR, Zero)"); dsdt_line(" Method (_BBN, 0, NotSerialized)"); dsdt_line(" {"); dsdt_line(" Return (0x%08X)", bus); dsdt_line(" }"); dsdt_line(" Name (_CRS, ResourceTemplate ()"); dsdt_line(" {"); dsdt_line(" WordBusNumber (ResourceProducer, MinFixed, " "MaxFixed, PosDecode,"); dsdt_line(" 0x0000, // Granularity"); dsdt_line(" 0x%04X, // Range Minimum", bus); dsdt_line(" 0x%04X, // Range Maximum", bus); dsdt_line(" 0x0000, // Translation Offset"); dsdt_line(" 0x0001, // Length"); dsdt_line(" ,, )"); if (bus == 0) { dsdt_indent(3); dsdt_fixed_ioport(0xCF8, 8); dsdt_unindent(3); dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " "PosDecode, EntireRange,"); dsdt_line(" 0x0000, // Granularity"); dsdt_line(" 0x0000, // Range Minimum"); dsdt_line(" 0x0CF7, // Range Maximum"); dsdt_line(" 0x0000, // Translation Offset"); dsdt_line(" 0x0CF8, // Length"); dsdt_line(" ,, , TypeStatic)"); dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " "PosDecode, EntireRange,"); dsdt_line(" 0x0000, // Granularity"); dsdt_line(" 0x0D00, // Range Minimum"); dsdt_line(" 0x%04X, // Range Maximum", PCI_EMUL_IOBASE - 1); dsdt_line(" 0x0000, // Translation Offset"); dsdt_line(" 0x%04X, // Length", PCI_EMUL_IOBASE - 0x0D00); dsdt_line(" ,, , TypeStatic)"); if (bi == NULL) { dsdt_line(" })"); goto done; } } assert(bi != NULL); /* i/o window */ dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " "PosDecode, EntireRange,"); dsdt_line(" 0x0000, // Granularity"); dsdt_line(" 0x%04X, // Range Minimum", bi->iobase); dsdt_line(" 0x%04X, // Range Maximum", bi->iolimit - 1); dsdt_line(" 0x0000, // Translation Offset"); dsdt_line(" 0x%04X, // Length", bi->iolimit - bi->iobase); dsdt_line(" ,, , TypeStatic)"); /* mmio window (32-bit) */ dsdt_line(" DWordMemory (ResourceProducer, PosDecode, " "MinFixed, MaxFixed, NonCacheable, ReadWrite,"); dsdt_line(" 0x00000000, // Granularity"); dsdt_line(" 0x%08X, // Range Minimum\n", bi->membase32); dsdt_line(" 0x%08X, // Range Maximum\n", bi->memlimit32 - 1); dsdt_line(" 0x00000000, // Translation Offset"); dsdt_line(" 0x%08X, // Length\n", bi->memlimit32 - bi->membase32); dsdt_line(" ,, , AddressRangeMemory, TypeStatic)"); /* mmio window (64-bit) */ dsdt_line(" QWordMemory (ResourceProducer, PosDecode, " "MinFixed, MaxFixed, NonCacheable, ReadWrite,"); dsdt_line(" 0x0000000000000000, // Granularity"); dsdt_line(" 0x%016lX, // Range Minimum\n", bi->membase64); dsdt_line(" 0x%016lX, // Range Maximum\n", bi->memlimit64 - 1); dsdt_line(" 0x0000000000000000, // Translation Offset"); dsdt_line(" 0x%016lX, // Length\n", bi->memlimit64 - bi->membase64); dsdt_line(" ,, , AddressRangeMemory, TypeStatic)"); dsdt_line(" })"); if (!is_rtvm) { count = pci_count_lintr(bus); if (count != 0) { dsdt_indent(2); dsdt_line("Name (PPRT, Package ()"); dsdt_line("{"); pci_walk_lintr(bus, pci_pirq_prt_entry, NULL); dsdt_line("})"); dsdt_line("Name (APRT, Package ()"); dsdt_line("{"); pci_walk_lintr(bus, pci_apic_prt_entry, NULL); dsdt_line("})"); dsdt_line("Method (_PRT, 0, NotSerialized)"); dsdt_line("{"); dsdt_line(" If (PICM)"); dsdt_line(" {"); dsdt_line(" Return (APRT)"); dsdt_line(" }"); dsdt_line(" Else"); dsdt_line(" {"); dsdt_line(" Return (PPRT)"); dsdt_line(" }"); dsdt_line("}"); dsdt_unindent(2); } } dsdt_indent(2); for (slot = 0; slot < MAXSLOTS; slot++) { si = &bi->slotinfo[slot]; for (func = 0; func < MAXFUNCS; func++) { dev = si->si_funcs[func].fi_devi; if (dev != NULL && dev->dev_ops->vdev_write_dsdt != NULL) dev->dev_ops->vdev_write_dsdt(dev); } } dsdt_unindent(2); done: dsdt_line(" }"); }
667
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_cfgrw
pci_cfgrw( struct vmctx * ctx , int vcpu , int in , int bus , int slot , int func , int coff , int bytes , uint32_t * eax)
['ctx', 'vcpu', 'in', 'bus', 'slot', 'func', 'coff', 'bytes', 'eax']
pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func, int coff, int bytes, uint32_t *eax) { struct businfo *bi; struct slotinfo *si; struct pci_vdev *dev; struct pci_vdev_ops *ops; int idx, needcfg; uint64_t addr, bar, mask; bool decode, ignore_reg_unreg = false; bi = pci_businfo[bus]; if (bi != NULL) { si = &bi->slotinfo[slot]; dev = si->si_funcs[func].fi_devi; } else dev = NULL; /* * Just return if there is no device at this slot:func or if the * the guest is doing an un-aligned access. */ if (dev == NULL || (bytes != 1 && bytes != 2 && bytes != 4) || (coff & (bytes - 1)) != 0) { if (in) *eax = 0xffffffff; return; } ops = dev->dev_ops; /* * For non-passthru device, extended config space is NOT supported. * Ignore all writes beyond the standard config space and return all * ones on reads. * * For passthru device, extended config space is supported. * Access to extended config space is implemented via libpciaccess. */ if (strcmp("passthru", ops->class_name)) { if (coff >= PCI_REGMAX + 1) { if (in) { *eax = 0xffffffff; /* * Extended capabilities begin at offset 256 in * config space. * Absence of extended capabilities is signaled * with all 0s in the extended capability header * at offset 256. */ if (coff <= PCI_REGMAX + 4) *eax = 0x00000000; } return; } } /* * Config read */ if (in) { /* Let the device emulation override the default handler */ if (ops->vdev_cfgread != NULL) { needcfg = ops->vdev_cfgread(ctx, vcpu, dev, coff, bytes, eax); } else { needcfg = 1; } if (needcfg) *eax = CFGREAD(dev, coff, bytes); pci_emul_hdrtype_fixup(bus, slot, coff, bytes, eax); } else { /* Let the device emulation override the default handler */ if (ops->vdev_cfgwrite != NULL && (*ops->vdev_cfgwrite)(ctx, vcpu, dev, coff, bytes, *eax) == 0) return; /* * Special handling for write to BAR registers */ if (coff >= PCIR_BAR(0) && coff < PCIR_BAR(PCI_BARMAX + 1)) { /* * Ignore writes to BAR registers that are not * 4-byte aligned. */ if (bytes != 4 || (coff & 0x3) != 0) return; idx = (coff - PCIR_BAR(0)) / 4; mask = ~(dev->bar[idx].size - 1); if (dev->bar[idx].type == PCIBAR_IO) decode = porten(dev); else decode = memen(dev); /* Some driver does not disable the decode of BAR * register via the command register before sizing a * BAR. This will lead to a overlay of the BAR * addresses when trying to register the intermediate * BAR address via register_bar. A stateful variable * sizing is used to keep track of such kind of BAR * address changes and workaroud this violation. */ if (decode) { if (!dev->bar[idx].sizing && (*eax == ~0U)) { dev->bar[idx].sizing = true; ignore_reg_unreg = true; } else if (dev->bar[idx].sizing && (*eax != ~0U)) { dev->bar[idx].sizing = false; ignore_reg_unreg = true; } } switch (dev->bar[idx].type) { case PCIBAR_NONE: dev->bar[idx].addr = bar = 0; break; case PCIBAR_IO: addr = *eax & mask; addr &= 0xffff; bar = addr | PCIM_BAR_IO_SPACE; /* * Register the new BAR value for interception */ if (addr != dev->bar[idx].addr) { update_bar_address(ctx, dev, addr, idx, PCIBAR_IO, ignore_reg_unreg); } break; case PCIBAR_MEM32: addr = bar = *eax & mask; bar |= PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_32; if (addr != dev->bar[idx].addr) { update_bar_address(ctx, dev, addr, idx, PCIBAR_MEM32, ignore_reg_unreg); } break; case PCIBAR_MEM64: addr = bar = *eax & mask; bar |= PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | PCIM_BAR_MEM_PREFETCH; if (addr != (uint32_t)dev->bar[idx].addr) { update_bar_address(ctx, dev, addr, idx, PCIBAR_MEM64, ignore_reg_unreg); } break; case PCIBAR_MEMHI64: assert(idx >= 1); mask = ~(dev->bar[idx - 1].size - 1); addr = ((uint64_t)*eax << 32) & mask; bar = addr >> 32; if (bar != dev->bar[idx - 1].addr >> 32) { update_bar_address(ctx, dev, addr, idx - 1, PCIBAR_MEMHI64, ignore_reg_unreg); } break; default: assert(0); } pci_set_cfgdata32(dev, coff, bar); } else if (coff == PCIR_BIOS) { /* ignore ROM BAR length request */ } else if (pci_emul_iscap(dev, coff)) { pci_emul_capwrite(dev, coff, bytes, *eax); } else if (coff >= PCIR_COMMAND && coff < PCIR_REVID) { pci_emul_cmdsts_write(dev, coff, *eax, bytes); } else { CFGWRITE(dev, coff, *eax, bytes); } } }
856
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_add_capability
pci_emul_add_capability( struct pci_vdev * dev , u_char * capdata , int caplen)
['dev', 'capdata', 'caplen']
pci_emul_add_capability(struct pci_vdev *dev, u_char *capdata, int caplen) { int i, capoff, reallen; uint16_t sts; assert(caplen > 0); reallen = roundup2(caplen, 4); /* dword aligned */ sts = pci_get_cfgdata16(dev, PCIR_STATUS); if ((sts & PCIM_STATUS_CAPPRESENT) == 0) capoff = CAP_START_OFFSET; else capoff = dev->capend + 1; /* Check if we have enough space */ if (capoff + reallen > PCI_REGMAX + 1) return -1; /* Set the previous capability pointer */ if ((sts & PCIM_STATUS_CAPPRESENT) == 0) { pci_set_cfgdata8(dev, PCIR_CAP_PTR, capoff); pci_set_cfgdata16(dev, PCIR_STATUS, sts|PCIM_STATUS_CAPPRESENT); } else pci_set_cfgdata8(dev, dev->prevcap + 1, capoff); /* Copy the capability */ for (i = 0; i < caplen; i++) pci_set_cfgdata8(dev, capoff + i, capdata[i]); /* Set the next capability pointer */ pci_set_cfgdata8(dev, capoff + 1, 0); dev->prevcap = capoff; dev->capend = capoff + reallen - 1; return 0; }
191
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_add_msicap
pci_emul_add_msicap( struct pci_vdev * dev , int msgnum)
['dev', 'msgnum']
pci_emul_add_msicap(struct pci_vdev *dev, int msgnum) { struct msicap msicap; pci_populate_msicap(&msicap, msgnum, 0); return pci_emul_add_capability(dev, (u_char *)&msicap, sizeof(msicap)); }
44
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_add_msixcap
pci_emul_add_msixcap( struct pci_vdev * dev , int msgnum , int barnum)
['dev', 'msgnum', 'barnum']
pci_emul_add_msixcap(struct pci_vdev *dev, int msgnum, int barnum) { uint32_t tab_size; struct msixcap msixcap; assert(msgnum >= 1 && msgnum <= MAX_MSIX_TABLE_ENTRIES); assert(barnum >= 0 && barnum <= PCIR_MAX_BAR_0); tab_size = msgnum * MSIX_TABLE_ENTRY_SIZE; /* Align table size to nearest 4K */ tab_size = roundup2(tab_size, 4096); dev->msix.table_bar = barnum; dev->msix.pba_bar = barnum; dev->msix.table_offset = 0; dev->msix.table_count = msgnum; dev->msix.pba_offset = tab_size; dev->msix.pba_size = PBA_SIZE(msgnum); pci_msix_table_init(dev, msgnum); pci_populate_msixcap(&msixcap, msgnum, barnum, tab_size); /* allocate memory for MSI-X Table and PBA */ pci_emul_alloc_bar(dev, barnum, PCIBAR_MEM32, tab_size + dev->msix.pba_size); return (pci_emul_add_capability(dev, (u_char *)&msixcap, sizeof(msixcap))); }
166
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_alloc_pbar
pci_emul_alloc_pbar( struct pci_vdev * pdi , int idx , uint64_t hostbase , enum pcibar_type type , uint64_t size)
['pdi', 'idx', 'hostbase', 'type', 'size']
pci_emul_alloc_pbar(struct pci_vdev *pdi, int idx, uint64_t hostbase, enum pcibar_type type, uint64_t size) { int error; uint64_t *baseptr, limit, addr, mask, lobits, bar; assert(idx >= 0 && idx <= PCI_BARMAX); if ((size & (size - 1)) != 0) size = 1UL << flsl(size); /* round up to a power of 2 */ /* Enforce minimum BAR sizes required by the PCI standard */ if (type == PCIBAR_IO) { if (size < 4) size = 4; } else { if (size < 16) size = 16; } switch (type) { case PCIBAR_NONE: baseptr = NULL; addr = mask = lobits = 0; break; case PCIBAR_IO: baseptr = &pci_emul_iobase; limit = PCI_EMUL_IOLIMIT; mask = PCIM_BAR_IO_BASE; lobits = PCIM_BAR_IO_SPACE; break; case PCIBAR_MEM64: /* * FIXME * Some drivers do not work well if the 64-bit BAR is allocated * above 4GB. Allow for this by allocating small requests under * 4GB unless then allocation size is larger than some arbitrary * number (32MB currently). If guest booted by ovmf, then skip the * workaround. */ if (!skip_pci_mem64bar_workaround && (size <= 32 * 1024 * 1024)) { baseptr = &pci_emul_membase32; limit = PCI_EMUL_MEMLIMIT32; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64; break; } /* * XXX special case for device requiring peer-peer DMA */ if (size == 0x100000000UL) baseptr = &hostbase; else baseptr = &pci_emul_membase64; limit = PCI_EMUL_MEMLIMIT64; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_64 | PCIM_BAR_MEM_PREFETCH; break; case PCIBAR_MEM32: baseptr = &pci_emul_membase32; limit = PCI_EMUL_MEMLIMIT32; mask = PCIM_BAR_MEM_BASE; lobits = PCIM_BAR_MEM_SPACE | PCIM_BAR_MEM_32; break; default: printf("%s: invalid bar type %d\n", __func__, type); assert(0); } if (baseptr != NULL) { error = pci_emul_alloc_resource(baseptr, limit, size, &addr); if (error != 0) return error; } pdi->bar[idx].type = type; pdi->bar[idx].addr = addr; pdi->bar[idx].size = size; /* Initialize the BAR register in config space */ bar = (addr & mask) | lobits; pci_set_cfgdata32(pdi, PCIR_BAR(idx), bar); if (type == PCIBAR_MEM64) { assert(idx + 1 <= PCI_BARMAX); pdi->bar[idx + 1].type = PCIBAR_MEMHI64; pci_set_cfgdata32(pdi, PCIR_BAR(idx + 1), bar >> 32); } register_bar(pdi, idx); return 0; }
409
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_alloc_resource
pci_emul_alloc_resource( uint64_t * baseptr , uint64_t limit , uint64_t size , uint64_t * addr)
['baseptr', 'limit', 'size', 'addr']
pci_emul_alloc_resource(uint64_t *baseptr, uint64_t limit, uint64_t size, uint64_t *addr) { uint64_t base; assert((size & (size - 1)) == 0); /* must be a power of 2 */ base = roundup2(*baseptr, size); if (base + size <= limit) { *addr = base; *baseptr = base + size; return 0; } else return -1; }
76
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_capwrite
pci_emul_capwrite( struct pci_vdev * dev , int offset , int bytes , uint32_t val)
['dev', 'offset', 'bytes', 'val']
pci_emul_capwrite(struct pci_vdev *dev, int offset, int bytes, uint32_t val) { int capid; uint8_t capoff, nextoff; /* Do not allow un-aligned writes */ if ((offset & (bytes - 1)) != 0) return; /* Find the capability that we want to update */ capoff = CAP_START_OFFSET; while (1) { nextoff = pci_get_cfgdata8(dev, capoff + 1); if (nextoff == 0) break; if (offset >= capoff && offset < nextoff) break; capoff = nextoff; } assert(offset >= capoff); /* * Capability ID and Next Capability Pointer are readonly. * However, some o/s's do 4-byte writes that include these. * For this case, trim the write back to 2 bytes and adjust * the data. */ if (offset == capoff || offset == capoff + 1) { if (offset == capoff && bytes == 4) { bytes = 2; offset += 2; val >>= 16; } else return; } capid = pci_get_cfgdata8(dev, capoff); switch (capid) { case PCIY_MSI: msicap_cfgwrite(dev, capoff, offset, bytes, val); break; case PCIY_MSIX: msixcap_cfgwrite(dev, capoff, offset, bytes, val); break; case PCIY_EXPRESS: pciecap_cfgwrite(dev, capoff, offset, bytes, val); break; default: CFGWRITE(dev, offset, val, bytes); break; } }
219
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_cmdsts_write
pci_emul_cmdsts_write( struct pci_vdev * dev , int coff , uint32_t new , int bytes)
['dev', 'coff', 'new', 'bytes']
pci_emul_cmdsts_write(struct pci_vdev *dev, int coff, uint32_t new, int bytes) { int i, rshift; uint32_t cmd, cmd2, changed, old, readonly; cmd = pci_get_cfgdata16(dev, PCIR_COMMAND); /* stash old value */ /* * From PCI Local Bus Specification 3.0 sections 6.2.2 and 6.2.3. * * XXX Bits 8, 11, 12, 13, 14 and 15 in the status register are * 'write 1 to clear'. However these bits are not set to '1' by * any device emulation so it is simpler to treat them as readonly. */ rshift = (coff & 0x3) * 8; readonly = 0xFFFFF880 >> rshift; old = CFGREAD(dev, coff, bytes); new &= ~readonly; new |= (old & readonly); CFGWRITE(dev, coff, new, bytes); /* update config */ cmd2 = pci_get_cfgdata16(dev, PCIR_COMMAND); /* get updated value */ changed = cmd ^ cmd2; /* * If the MMIO or I/O address space decoding has changed then * register/unregister all BARs that decode that address space. */ for (i = 0; i <= PCI_BARMAX; i++) { switch (dev->bar[i].type) { case PCIBAR_NONE: case PCIBAR_MEMHI64: break; case PCIBAR_IO: /* I/O address space decoding changed? */ if (changed & PCIM_CMD_PORTEN) { if (porten(dev)) register_bar(dev, i); else unregister_bar(dev, i); } break; case PCIBAR_MEM32: case PCIBAR_MEM64: /* MMIO address space decoding changed? */ if (changed & PCIM_CMD_MEMEN) { if (memen(dev)) register_bar(dev, i); else unregister_bar(dev, i); } break; default: assert(0); } } /* * If INTx has been unmasked and is pending, assert the * interrupt. */ pci_lintr_update(dev); }
230
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_dinit
pci_emul_dinit( struct vmctx * ctx , struct pci_vdev * dev , char * opts)
['ctx', 'dev', 'opts']
pci_emul_dinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts) { int error; struct pci_emul_dummy *dummy; dummy = calloc(1, sizeof(struct pci_emul_dummy)); dev->arg = dummy; pci_set_cfgdata16(dev, PCIR_DEVICE, 0x0001); pci_set_cfgdata16(dev, PCIR_VENDOR, 0x10DD); pci_set_cfgdata8(dev, PCIR_CLASS, 0x02); error = pci_emul_add_msicap(dev, PCI_EMUL_MSI_MSGS); assert(error == 0); error = pci_emul_alloc_bar(dev, 0, PCIBAR_IO, DIOSZ); assert(error == 0); error = pci_emul_alloc_bar(dev, 1, PCIBAR_MEM32, DMEMSZ); assert(error == 0); error = pci_emul_alloc_bar(dev, 2, PCIBAR_MEM32, DMEMSZ); assert(error == 0); return 0; }
151
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_emul_mem_handler
pci_emul_mem_handler( struct vmctx * ctx , int vcpu , int dir , uint64_t addr , int size , uint64_t * val , void * arg1 , long arg2)
['ctx', 'vcpu', 'dir', 'addr', 'size', 'val', 'arg1', 'arg2']
pci_emul_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, int size, uint64_t *val, void *arg1, long arg2) { struct pci_vdev *pdi = arg1; struct pci_vdev_ops *ops = pdi->dev_ops; uint64_t offset; int bidx = (int) arg2; assert(bidx <= PCI_BARMAX); assert(pdi->bar[bidx].type == PCIBAR_MEM32 || pdi->bar[bidx].type == PCIBAR_MEM64); assert(addr >= pdi->bar[bidx].addr && addr + size <= pdi->bar[bidx].addr + pdi->bar[bidx].size); offset = addr - pdi->bar[bidx].addr; if (dir == MEM_F_WRITE) { if (size == 8) { (*ops->vdev_barwrite)(ctx, vcpu, pdi, bidx, offset, 4, *val & 0xffffffff); (*ops->vdev_barwrite)(ctx, vcpu, pdi, bidx, offset + 4, 4, *val >> 32); } else { (*ops->vdev_barwrite)(ctx, vcpu, pdi, bidx, offset, size, bar_value(size, *val)); } } else { if (size == 8) { uint64_t val_lo, val_hi; val_lo = (*ops->vdev_barread)(ctx, vcpu, pdi, bidx, offset, 4); val_lo = bar_value(4, val_lo); val_hi = (*ops->vdev_barread)(ctx, vcpu, pdi, bidx, offset + 4, 4); *val = val_lo | (val_hi << 32); } else { *val = (*ops->vdev_barread)(ctx, vcpu, pdi, bidx, offset, size); *val = bar_value(size, *val); } } return 0; }
363
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_get_vdev_info
pci_get_vdev_info( int slot)
['slot']
pci_get_vdev_info(int slot) { struct businfo *bi; struct slotinfo *si; struct pci_vdev *dev = NULL; bi = pci_businfo[0]; assert(bi != NULL); si = &bi->slotinfo[slot]; if (si != NULL) dev = si->si_funcs[0].fi_devi; else fprintf(stderr, "slot=%d is empty!\n", slot); return dev; }
78
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_lintr_assert
pci_lintr_assert( struct pci_vdev * dev)
['dev']
pci_lintr_assert(struct pci_vdev *dev) { assert(dev->lintr.pin > 0); pthread_mutex_lock(&dev->lintr.lock); if (dev->lintr.state == IDLE) { if (pci_lintr_permitted(dev)) { dev->lintr.state = ASSERTED; pci_irq_assert(dev); } else dev->lintr.state = PENDING; } pthread_mutex_unlock(&dev->lintr.lock); }
83
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_lintr_deassert
pci_lintr_deassert( struct pci_vdev * dev)
['dev']
pci_lintr_deassert(struct pci_vdev *dev) { assert(dev->lintr.pin > 0); pthread_mutex_lock(&dev->lintr.lock); if (dev->lintr.state == ASSERTED) { dev->lintr.state = IDLE; pci_irq_deassert(dev); } else if (dev->lintr.state == PENDING) dev->lintr.state = IDLE; pthread_mutex_unlock(&dev->lintr.lock); }
84
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_lintr_release
pci_lintr_release( struct pci_vdev * dev)
['dev']
pci_lintr_release(struct pci_vdev *dev) { struct businfo *bi; struct slotinfo *si; int pin; bi = pci_businfo[dev->bus]; assert(bi != NULL); si = &bi->slotinfo[dev->slot]; for (pin = 1; pin < 4; pin++) { si->si_intpins[pin].ii_count = 0; si->si_intpins[pin].ii_pirq_pin = 0; si->si_intpins[pin].ii_ioapic_irq = 0; } }
98
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_lintr_request
pci_lintr_request( struct pci_vdev * dev)
['dev']
pci_lintr_request(struct pci_vdev *dev) { struct businfo *bi; struct slotinfo *si; int bestpin, bestcount, pin; bi = pci_businfo[dev->bus]; assert(bi != NULL); /* * Just allocate a pin from our slot. The pin will be * assigned IRQs later when interrupts are routed. */ si = &bi->slotinfo[dev->slot]; bestpin = 0; bestcount = si->si_intpins[0].ii_count; for (pin = 1; pin < 4; pin++) { if (si->si_intpins[pin].ii_count < bestcount) { bestpin = pin; bestcount = si->si_intpins[pin].ii_count; } } si->si_intpins[bestpin].ii_count++; dev->lintr.pin = bestpin + 1; pci_set_cfgdata8(dev, PCIR_INTPIN, bestpin + 1); }
145
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_lintr_route
pci_lintr_route( struct pci_vdev * dev)
['dev']
pci_lintr_route(struct pci_vdev *dev) { struct businfo *bi; struct intxinfo *ii; if (dev->lintr.pin == 0) return; bi = pci_businfo[dev->bus]; assert(bi != NULL); ii = &bi->slotinfo[dev->slot].si_intpins[dev->lintr.pin - 1]; /* * Attempt to allocate an I/O APIC pin for this intpin if one * is not yet assigned. */ if (ii->ii_ioapic_irq == 0) ii->ii_ioapic_irq = ioapic_pci_alloc_irq(dev); assert(ii->ii_ioapic_irq > 0); /* * Attempt to allocate a PIRQ pin for this intpin if one is * not yet assigned. */ if (ii->ii_pirq_pin == 0) ii->ii_pirq_pin = pirq_alloc_pin(dev); assert(ii->ii_pirq_pin > 0); dev->lintr.ioapic_irq = ii->ii_ioapic_irq; dev->lintr.pirq_pin = ii->ii_pirq_pin; pci_set_cfgdata8(dev, PCIR_INTLINE, pirq_irq(ii->ii_pirq_pin)); }
156
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_msix_table_init
pci_msix_table_init( struct pci_vdev * dev , int table_entries)
['dev', 'table_entries']
pci_msix_table_init(struct pci_vdev *dev, int table_entries) { int i, table_size; assert(table_entries > 0); assert(table_entries <= MAX_MSIX_TABLE_ENTRIES); table_size = table_entries * MSIX_TABLE_ENTRY_SIZE; dev->msix.table = calloc(1, table_size); assert(dev->msix.table != NULL); /* set mask bit of vector control register */ for (i = 0; i < table_entries; i++) dev->msix.table[i].vector_control |= PCIM_MSIX_VCTRL_MASK; }
87
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_populate_msicap
pci_populate_msicap( struct msicap * msicap , int msgnum , int nextptr)
['msicap', 'msgnum', 'nextptr']
pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr) { int mmc; /* Number of msi messages must be a power of 2 between 1 and 32 */ assert((msgnum & (msgnum - 1)) == 0 && msgnum >= 1 && msgnum <= 32); mmc = ffs(msgnum) - 1; bzero(msicap, sizeof(struct msicap)); msicap->capid = PCIY_MSI; msicap->nextptr = nextptr; msicap->msgctrl = PCIM_MSICTRL_64BIT | (mmc << 1); }
86
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_populate_msixcap
pci_populate_msixcap( struct msixcap * msixcap , int msgnum , int barnum , uint32_t msix_tab_size)
['msixcap', 'msgnum', 'barnum', 'msix_tab_size']
pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum, uint32_t msix_tab_size) { assert(msix_tab_size % 4096 == 0); bzero(msixcap, sizeof(struct msixcap)); msixcap->capid = PCIY_MSIX; /* * Message Control Register, all fields set to * zero except for the Table Size. * Note: Table size N is encoded as N-1 */ msixcap->msgctrl = msgnum - 1; /* * MSI-X BAR setup: * - MSI-X table start at offset 0 * - PBA table starts at a 4K aligned offset after the MSI-X table */ msixcap->table_info = barnum & PCIM_MSIX_BIR_MASK; msixcap->pba_info = msix_tab_size | (barnum & PCIM_MSIX_BIR_MASK); }
72
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
update_bar_address
update_bar_address( struct vmctx * ctx , struct pci_vdev * dev , uint64_t addr , int idx , int type , bool ignore_reg_unreg)
['ctx', 'dev', 'addr', 'idx', 'type', 'ignore_reg_unreg']
update_bar_address(struct vmctx *ctx, struct pci_vdev *dev, uint64_t addr, int idx, int type, bool ignore_reg_unreg) { bool decode = false; uint64_t orig_addr = dev->bar[idx].addr; if (!ignore_reg_unreg) { if (dev->bar[idx].type == PCIBAR_IO) decode = porten(dev); else decode = memen(dev); } if (decode) unregister_bar(dev, idx); switch (type) { case PCIBAR_IO: case PCIBAR_MEM32: dev->bar[idx].addr = addr; break; case PCIBAR_MEM64: dev->bar[idx].addr &= ~0xffffffffUL; dev->bar[idx].addr |= addr; break; case PCIBAR_MEMHI64: dev->bar[idx].addr &= 0xffffffff; dev->bar[idx].addr |= addr; break; default: assert(0); } if (decode) register_bar(dev, idx); /* update bar mapping */ if (dev->dev_ops->vdev_update_bar_map && decode) dev->dev_ops->vdev_update_bar_map(ctx, dev, idx, orig_addr); }
211
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_get_cfgdata16
pci_get_cfgdata16( struct pci_vdev * dev , int offset)
['dev', 'offset']
pci_get_cfgdata16(struct pci_vdev *dev, int offset) { assert(offset <= (PCI_REGMAX - 1) && (offset & 1) == 0); return (*(uint16_t *)(dev->cfgdata + offset)); }
47
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_get_cfgdata32
pci_get_cfgdata32( struct pci_vdev * dev , int offset)
['dev', 'offset']
pci_get_cfgdata32(struct pci_vdev *dev, int offset) { assert(offset <= (PCI_REGMAX - 3) && (offset & 3) == 0); return (*(uint32_t *)(dev->cfgdata + offset)); }
47
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_get_cfgdata8
pci_get_cfgdata8( struct pci_vdev * dev , int offset)
['dev', 'offset']
pci_get_cfgdata8(struct pci_vdev *dev, int offset) { assert(offset <= PCI_REGMAX); return (*(uint8_t *)(dev->cfgdata + offset)); }
35
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_set_cfgdata16
pci_set_cfgdata16( struct pci_vdev * dev , int offset , uint16_t val)
['dev', 'offset', 'val']
pci_set_cfgdata16(struct pci_vdev *dev, int offset, uint16_t val) { assert(offset <= (PCI_REGMAX - 1) && (offset & 1) == 0); *(uint16_t *)(dev->cfgdata + offset) = val; }
49
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_set_cfgdata32
pci_set_cfgdata32( struct pci_vdev * dev , int offset , uint32_t val)
['dev', 'offset', 'val']
pci_set_cfgdata32(struct pci_vdev *dev, int offset, uint32_t val) { assert(offset <= (PCI_REGMAX - 3) && (offset & 3) == 0); *(uint32_t *)(dev->cfgdata + offset) = val; }
49
True
1
CVE-2019-18844
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/projectacrn/acrn-hypervisor/issues/3252', 'name': 'https://github.com/projectacrn/acrn-hypervisor/issues/3252', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/6199e653418eda58cd698d8769820904453e2535', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'name': 'https://github.com/shuox/acrn-hypervisor/commit/97b153237c256c586e528eac7fc2f51aedb2b2fc', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'name': 'https://github.com/projectacrn/acrn-hypervisor/commit/2b3dedfb9ba13f15887f22b935d373f36c9a59fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'name': 'https://github.com/projectacrn/acrn-hypervisor/compare/acrn-2019w25.4-140000p...acrn-2019w25.5-140000p', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:acrn:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019w25.5-140000p', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The Device Model in ACRN before 2019w25.5-140000p relies on assert calls in devicemodel/hw/pci/core.c and devicemodel/include/pci_core.h (instead of other mechanisms for propagating error information or diagnostic information), which might allow attackers to cause a denial of service (assertion failure) within pci core. This is fixed in 1.2. 6199e653418e is a mitigation for pre-1.1 versions, whereas 2b3dedfb9ba1 is a mitigation for 1.1.'}]
2020-11-09T21:46Z
2019-11-13T20:15Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
Shuo A Liu
2019-06-18 13:59:21+08:00
dm: pci: clean up assert() in pci core Tracked-On: #3252 Signed-off-by: Shuo A Liu <[email protected]> Reviewed-by: Yonghua Huang <[email protected]>
2b3dedfb9ba13f15887f22b935d373f36c9a59fa
False
projectacrn/acrn-hypervisor
Project ACRN hypervisor
2018-03-05 21:52:25
2022-08-26 21:22:37
projectacrn
860.0
432.0
pci_set_cfgdata8
pci_set_cfgdata8( struct pci_vdev * dev , int offset , uint8_t val)
['dev', 'offset', 'val']
pci_set_cfgdata8(struct pci_vdev *dev, int offset, uint8_t val) { assert(offset <= PCI_REGMAX); *(uint8_t *)(dev->cfgdata + offset) = val; }
37
True
1
CVE-2019-19603
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/sqlite/sqlite/commit/527cbd4a104cb93bf3994b3dd3619a6299a78b13', 'name': 'https://github.com/sqlite/sqlite/commit/527cbd4a104cb93bf3994b3dd3619a6299a78b13', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.sqlite.org/', 'name': 'https://www.sqlite.org/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4394-1/', 'name': 'USN-4394-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rc713534b10f9daeee2e0990239fa407e2118e4aa9e88a7041177497c@%3Cissues.guacamole.apache.org%3E', 'name': '[guacamole-issues] 20210618 [jira] [Created] (GUACAMOLE-1368) Latest docker image fails security scans.', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:1.0.1.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apache:guacamole:1.3.0:-:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SQLite 3.30.1 mishandles certain SELECT statements with a nonexistent VIEW, leading to an application crash.'}]
2022-04-15T16:15Z
2019-12-09T19: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
drh
2019-11-16 14:15:19+00:00
Do not allow CREATE TABLE or CREATE VIEW of an object with a name that looks like a shadow table name. FossilOrigin-Name: 6aef58b629d89955f85f65191ba2be67b2adfac4f0327fe9a7141cb2705dbc00
527cbd4a104cb93bf3994b3dd3619a6299a78b13
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
isShadowTableName
isShadowTableName( sqlite3 * db , char * zName)
['db', 'zName']
static int isShadowTableName(sqlite3 *db, char *zName){ char *zTail; /* Pointer to the last "_" in zName */ Table *pTab; /* Table that zName is a shadow of */ Module *pMod; /* Module for the virtual table */ zTail = strrchr(zName, '_'); if( zTail==0 ) return 0; *zTail = 0; pTab = sqlite3FindTable(db, zName, 0); *zTail = '_'; if( pTab==0 ) return 0; if( !IsVirtual(pTab) ) return 0; pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]); if( pMod==0 ) return 0; if( pMod->pModule->iVersion<3 ) return 0; if( pMod->pModule->xShadowName==0 ) return 0; return pMod->pModule->xShadowName(zTail+1); }
151
True
1
CVE-2019-19603
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/sqlite/sqlite/commit/527cbd4a104cb93bf3994b3dd3619a6299a78b13', 'name': 'https://github.com/sqlite/sqlite/commit/527cbd4a104cb93bf3994b3dd3619a6299a78b13', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.sqlite.org/', 'name': 'https://www.sqlite.org/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4394-1/', 'name': 'USN-4394-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rc713534b10f9daeee2e0990239fa407e2118e4aa9e88a7041177497c@%3Cissues.guacamole.apache.org%3E', 'name': '[guacamole-issues] 20210618 [jira] [Created] (GUACAMOLE-1368) Latest docker image fails security scans.', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:1.0.1.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apache:guacamole:1.3.0:-:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SQLite 3.30.1 mishandles certain SELECT statements with a nonexistent VIEW, leading to an application crash.'}]
2022-04-15T16:15Z
2019-12-09T19: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
drh
2019-11-16 14:15:19+00:00
Do not allow CREATE TABLE or CREATE VIEW of an object with a name that looks like a shadow table name. FossilOrigin-Name: 6aef58b629d89955f85f65191ba2be67b2adfac4f0327fe9a7141cb2705dbc00
527cbd4a104cb93bf3994b3dd3619a6299a78b13
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
sqlite3CheckObjectName
sqlite3CheckObjectName( Parse * pParse , const char * zName , const char * zType , const char * zTblName)
['pParse', 'zName', 'zType', 'zTblName']
int sqlite3CheckObjectName( Parse *pParse, /* Parsing context */ const char *zName, /* Name of the object to check */ const char *zType, /* Type of this object */ const char *zTblName /* Parent table name for triggers and indexes */ ){ sqlite3 *db = pParse->db; if( sqlite3WritableSchema(db) || db->init.imposterTable ){ /* Skip these error checks for writable_schema=ON */ return SQLITE_OK; } if( db->init.busy ){ if( sqlite3_stricmp(zType, db->init.azInit[0]) || sqlite3_stricmp(zName, db->init.azInit[1]) || sqlite3_stricmp(zTblName, db->init.azInit[2]) ){ if( sqlite3Config.bExtraSchemaChecks ){ sqlite3ErrorMsg(pParse, ""); /* corruptSchema() will supply the error */ return SQLITE_ERROR; } } }else{ if( pParse->nested==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName); return SQLITE_ERROR; } } return SQLITE_OK; }
162
True
1
CVE-2019-19603
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/sqlite/sqlite/commit/527cbd4a104cb93bf3994b3dd3619a6299a78b13', 'name': 'https://github.com/sqlite/sqlite/commit/527cbd4a104cb93bf3994b3dd3619a6299a78b13', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.sqlite.org/', 'name': 'https://www.sqlite.org/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4394-1/', 'name': 'USN-4394-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rc713534b10f9daeee2e0990239fa407e2118e4aa9e88a7041177497c@%3Cissues.guacamole.apache.org%3E', 'name': '[guacamole-issues] 20210618 [jira] [Created] (GUACAMOLE-1368) Latest docker image fails security scans.', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:1.0.1.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apache:guacamole:1.3.0:-:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SQLite 3.30.1 mishandles certain SELECT statements with a nonexistent VIEW, leading to an application crash.'}]
2022-04-15T16:15Z
2019-12-09T19: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
drh
2019-11-16 14:15:19+00:00
Do not allow CREATE TABLE or CREATE VIEW of an object with a name that looks like a shadow table name. FossilOrigin-Name: 6aef58b629d89955f85f65191ba2be67b2adfac4f0327fe9a7141cb2705dbc00
527cbd4a104cb93bf3994b3dd3619a6299a78b13
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
sqlite3EndTable
sqlite3EndTable( Parse * pParse , Token * pCons , Token * pEnd , u8 tabOpts , Select * pSelect)
['pParse', 'pCons', 'pEnd', 'tabOpts', 'pSelect']
void sqlite3EndTable( Parse *pParse, /* Parse context */ Token *pCons, /* The ',' token after the last column defn. */ Token *pEnd, /* The ')' before options in the CREATE TABLE */ u8 tabOpts, /* Extra table options. Usually 0. */ Select *pSelect /* Select from a "CREATE ... AS SELECT" */ ){ Table *p; /* The new table */ sqlite3 *db = pParse->db; /* The database connection */ int iDb; /* Database in which the table lives */ Index *pIdx; /* An implied index of the table */ if( pEnd==0 && pSelect==0 ){ return; } assert( !db->mallocFailed ); p = pParse->pNewTable; if( p==0 ) return; if( pSelect==0 && isShadowTableName(db, p->zName) ){ p->tabFlags |= TF_Shadow; } /* If the db->init.busy is 1 it means we are reading the SQL off the ** "sqlite_master" or "sqlite_temp_master" table on the disk. ** So do not write to the disk again. Extract the root page number ** for the table from the db->init.newTnum field. (The page number ** should have been put there by the sqliteOpenCb routine.) ** ** If the root page number is 1, that means this is the sqlite_master ** table itself. So mark it read-only. */ if( db->init.busy ){ if( pSelect ){ sqlite3ErrorMsg(pParse, ""); return; } p->tnum = db->init.newTnum; if( p->tnum==1 ) p->tabFlags |= TF_Readonly; } assert( (p->tabFlags & TF_HasPrimaryKey)==0 || p->iPKey>=0 || sqlite3PrimaryKeyIndex(p)!=0 ); assert( (p->tabFlags & TF_HasPrimaryKey)!=0 || (p->iPKey<0 && sqlite3PrimaryKeyIndex(p)==0) ); /* Special processing for WITHOUT ROWID Tables */ if( tabOpts & TF_WithoutRowid ){ if( (p->tabFlags & TF_Autoincrement) ){ sqlite3ErrorMsg(pParse, "AUTOINCREMENT not allowed on WITHOUT ROWID tables"); return; } if( (p->tabFlags & TF_HasPrimaryKey)==0 ){ sqlite3ErrorMsg(pParse, "PRIMARY KEY missing on table %s", p->zName); return; } p->tabFlags |= TF_WithoutRowid | TF_NoVisibleRowid; convertToWithoutRowidTable(pParse, p); } iDb = sqlite3SchemaToIndex(db, p->pSchema); #ifndef SQLITE_OMIT_CHECK /* Resolve names in all CHECK constraint expressions. */ if( p->pCheck ){ sqlite3ResolveSelfReference(pParse, p, NC_IsCheck, 0, p->pCheck); } #endif /* !defined(SQLITE_OMIT_CHECK) */ #ifndef SQLITE_OMIT_GENERATED_COLUMNS if( p->tabFlags & TF_HasGenerated ){ int ii, nNG = 0; testcase( p->tabFlags & TF_HasVirtual ); testcase( p->tabFlags & TF_HasStored ); for(ii=0; ii<p->nCol; ii++){ u32 colFlags = p->aCol[ii].colFlags; if( (colFlags & COLFLAG_GENERATED)!=0 ){ testcase( colFlags & COLFLAG_VIRTUAL ); testcase( colFlags & COLFLAG_STORED ); sqlite3ResolveSelfReference(pParse, p, NC_GenCol, p->aCol[ii].pDflt, 0); }else{ nNG++; } } if( nNG==0 ){ sqlite3ErrorMsg(pParse, "must have at least one non-generated column"); return; } } #endif /* Estimate the average row size for the table and for all implied indices */ estimateTableWidth(p); for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ estimateIndexWidth(pIdx); } /* If not initializing, then create a record for the new table ** in the SQLITE_MASTER table of the database. ** ** If this is a TEMPORARY table, write the entry into the auxiliary ** file instead of into the main database file. */ if( !db->init.busy ){ int n; Vdbe *v; char *zType; /* "view" or "table" */ char *zType2; /* "VIEW" or "TABLE" */ char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */ v = sqlite3GetVdbe(pParse); if( NEVER(v==0) ) return; sqlite3VdbeAddOp1(v, OP_Close, 0); /* ** Initialize zType for the new view or table. */ if( p->pSelect==0 ){ /* A regular table */ zType = "table"; zType2 = "TABLE"; #ifndef SQLITE_OMIT_VIEW }else{ /* A view */ zType = "view"; zType2 = "VIEW"; #endif } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the ** new table is in register pParse->regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used ** by the new table. ** ** A shared-cache write-lock is not required to write to the new table, ** as a schema-lock must have already been obtained to create it. Since ** a schema-lock excludes all other database users, the write-lock would ** be redundant. */ if( pSelect ){ SelectDest dest; /* Where the SELECT should store results */ int regYield; /* Register holding co-routine entry-point */ int addrTop; /* Top of the co-routine */ int regRec; /* A record to be insert into the new table */ int regRowid; /* Rowid of the next row to insert */ int addrInsLoop; /* Top of the loop for inserting rows */ Table *pSelTab; /* A table that describes the SELECT results */ regYield = ++pParse->nMem; regRec = ++pParse->nMem; regRowid = ++pParse->nMem; assert(pParse->nTab==1); sqlite3MayAbort(pParse); sqlite3VdbeAddOp3(v, OP_OpenWrite, 1, pParse->regRoot, iDb); sqlite3VdbeChangeP5(v, OPFLAG_P2ISREG); pParse->nTab = 2; addrTop = sqlite3VdbeCurrentAddr(v) + 1; sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, addrTop); if( pParse->nErr ) return; pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect, SQLITE_AFF_BLOB); if( pSelTab==0 ) return; assert( p->aCol==0 ); p->nCol = p->nNVCol = pSelTab->nCol; p->aCol = pSelTab->aCol; pSelTab->nCol = 0; pSelTab->aCol = 0; sqlite3DeleteTable(db, pSelTab); sqlite3SelectDestInit(&dest, SRT_Coroutine, regYield); sqlite3Select(pParse, pSelect, &dest); if( pParse->nErr ) return; sqlite3VdbeEndCoroutine(v, regYield); sqlite3VdbeJumpHere(v, addrTop - 1); addrInsLoop = sqlite3VdbeAddOp1(v, OP_Yield, dest.iSDParm); VdbeCoverage(v); sqlite3VdbeAddOp3(v, OP_MakeRecord, dest.iSdst, dest.nSdst, regRec); sqlite3TableAffinity(v, p, 0); sqlite3VdbeAddOp2(v, OP_NewRowid, 1, regRowid); sqlite3VdbeAddOp3(v, OP_Insert, 1, regRec, regRowid); sqlite3VdbeGoto(v, addrInsLoop); sqlite3VdbeJumpHere(v, addrInsLoop); sqlite3VdbeAddOp1(v, OP_Close, 1); } /* Compute the complete text of the CREATE statement */ if( pSelect ){ zStmt = createTableStmt(db, p); }else{ Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd; n = (int)(pEnd2->z - pParse->sNameToken.z); if( pEnd2->z[0]!=';' ) n += pEnd2->n; zStmt = sqlite3MPrintf(db, "CREATE %s %.*s", zType2, n, pParse->sNameToken.z ); } /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all ** the information we've collected. */ sqlite3NestedParse(pParse, "UPDATE %Q.%s " "SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q " "WHERE rowid=#%d", db->aDb[iDb].zDbSName, MASTER_NAME, zType, p->zName, p->zName, pParse->regRoot, zStmt, pParse->regRowid ); sqlite3DbFree(db, zStmt); sqlite3ChangeCookie(pParse, iDb); #ifndef SQLITE_OMIT_AUTOINCREMENT /* Check to see if we need to create an sqlite_sequence table for ** keeping track of autoincrement keys. */ if( (p->tabFlags & TF_Autoincrement)!=0 ){ Db *pDb = &db->aDb[iDb]; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( pDb->pSchema->pSeqTab==0 ){ sqlite3NestedParse(pParse, "CREATE TABLE %Q.sqlite_sequence(name,seq)", pDb->zDbSName ); } } #endif /* Reparse everything to update our internal data structures */ sqlite3VdbeAddParseSchemaOp(v, iDb, sqlite3MPrintf(db, "tbl_name='%q' AND type!='trigger'", p->zName)); } /* Add the table to the in-memory representation of the database. */ if( db->init.busy ){ Table *pOld; Schema *pSchema = p->pSchema; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, p); if( pOld ){ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ sqlite3OomFault(db); return; } pParse->pNewTable = 0; db->mDbFlags |= DBFLAG_SchemaChange; #ifndef SQLITE_OMIT_ALTERTABLE if( !p->pSelect ){ const char *zName = (const char *)pParse->sNameToken.z; int nName; assert( !pSelect && pCons && pEnd ); if( pCons->z==0 ){ pCons = pEnd; } nName = (int)((const char *)pCons->z - zName); p->addColOffset = 13 + sqlite3Utf8CharLen(zName, nName); } #endif } }
1261
True
1
CVE-2019-19242
False
False
False
False
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
HIGH
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
5.9
MEDIUM
2.2
3.6
False
[{'url': 'https://github.com/sqlite/sqlite/commit/57f7ece78410a8aae86aa4625fb7556897db384c', 'name': 'https://github.com/sqlite/sqlite/commit/57f7ece78410a8aae86aa4625fb7556897db384c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4205-1/', 'name': 'USN-4205-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', '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:19.04:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SQLite 3.30.1 mishandles pExpr->y.pTab, as demonstrated by the TK_COLUMN case in sqlite3ExprCodeTarget in expr.c.'}]
2022-04-19T15:36Z
2019-11-27T17: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
drh
2019-11-21 18:28:44+00:00
Fix a problem that comes up when using generated columns that evaluate to a constant in an index and then making use of that index in a join. FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af
57f7ece78410a8aae86aa4625fb7556897db384c
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
sqlite3ExprCodeTarget
sqlite3ExprCodeTarget( Parse * pParse , Expr * pExpr , int target)
['pParse', 'pExpr', 'target']
int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ Vdbe *v = pParse->pVdbe; /* The VM under construction */ int op; /* The opcode being coded */ int inReg = target; /* Results stored in register inReg */ int regFree1 = 0; /* If non-zero free this temporary register */ int regFree2 = 0; /* If non-zero free this temporary register */ int r1, r2; /* Various register numbers */ Expr tempX; /* Temporary expression node */ int p5 = 0; assert( target>0 && target<=pParse->nMem ); if( v==0 ){ assert( pParse->db->mallocFailed ); return 0; } expr_code_doover: if( pExpr==0 ){ op = TK_NULL; }else{ op = pExpr->op; } switch( op ){ case TK_AGG_COLUMN: { AggInfo *pAggInfo = pExpr->pAggInfo; struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg]; if( !pAggInfo->directMode ){ assert( pCol->iMem>0 ); return pCol->iMem; }else if( pAggInfo->useSortingIdx ){ sqlite3VdbeAddOp3(v, OP_Column, pAggInfo->sortingIdxPTab, pCol->iSorterColumn, target); return target; } /* Otherwise, fall thru into the TK_COLUMN case */ } case TK_COLUMN: { int iTab = pExpr->iTable; if( ExprHasProperty(pExpr, EP_FixedCol) ){ /* This COLUMN expression is really a constant due to WHERE clause ** constraints, and that constant is coded by the pExpr->pLeft ** expresssion. However, make sure the constant has the correct ** datatype by applying the Affinity of the table column to the ** constant. */ int iReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft,target); int aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn); if( aff>SQLITE_AFF_BLOB ){ static const char zAff[] = "B\000C\000D\000E"; assert( SQLITE_AFF_BLOB=='A' ); assert( SQLITE_AFF_TEXT=='B' ); if( iReg!=target ){ sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target); iReg = target; } sqlite3VdbeAddOp4(v, OP_Affinity, iReg, 1, 0, &zAff[(aff-'B')*2], P4_STATIC); } return iReg; } if( iTab<0 ){ if( pParse->iSelfTab<0 ){ /* Other columns in the same row for CHECK constraints or ** generated columns or for inserting into partial index. ** The row is unpacked into registers beginning at ** 0-(pParse->iSelfTab). The rowid (if any) is in a register ** immediately prior to the first column. */ Column *pCol; Table *pTab = pExpr->y.pTab; int iSrc; int iCol = pExpr->iColumn; assert( pTab!=0 ); assert( iCol>=XN_ROWID ); assert( iCol<pExpr->y.pTab->nCol ); if( iCol<0 ){ return -1-pParse->iSelfTab; } pCol = pTab->aCol + iCol; testcase( iCol!=sqlite3TableColumnToStorage(pTab,iCol) ); iSrc = sqlite3TableColumnToStorage(pTab, iCol) - pParse->iSelfTab; #ifndef SQLITE_OMIT_GENERATED_COLUMNS if( pCol->colFlags & COLFLAG_GENERATED ){ if( pCol->colFlags & COLFLAG_BUSY ){ sqlite3ErrorMsg(pParse, "generated column loop on \"%s\"", pCol->zName); return 0; } pCol->colFlags |= COLFLAG_BUSY; if( pCol->colFlags & COLFLAG_NOTAVAIL ){ sqlite3ExprCodeGeneratedColumn(pParse, pCol, iSrc); } pCol->colFlags &= ~(COLFLAG_BUSY|COLFLAG_NOTAVAIL); return iSrc; }else #endif /* SQLITE_OMIT_GENERATED_COLUMNS */ if( pCol->affinity==SQLITE_AFF_REAL ){ sqlite3VdbeAddOp2(v, OP_SCopy, iSrc, target); sqlite3VdbeAddOp1(v, OP_RealAffinity, target); return target; }else{ return iSrc; } }else{ /* Coding an expression that is part of an index where column names ** in the index refer to the table to which the index belongs */ iTab = pParse->iSelfTab - 1; } } return sqlite3ExprCodeGetColumn(pParse, pExpr->y.pTab, pExpr->iColumn, iTab, target, pExpr->op2); } case TK_INTEGER: { codeInteger(pParse, pExpr, 0, target); return target; } case TK_TRUEFALSE: { sqlite3VdbeAddOp2(v, OP_Integer, sqlite3ExprTruthValue(pExpr), target); return target; } #ifndef SQLITE_OMIT_FLOATING_POINT case TK_FLOAT: { assert( !ExprHasProperty(pExpr, EP_IntValue) ); codeReal(v, pExpr->u.zToken, 0, target); return target; } #endif case TK_STRING: { assert( !ExprHasProperty(pExpr, EP_IntValue) ); sqlite3VdbeLoadString(v, target, pExpr->u.zToken); return target; } case TK_NULL: { sqlite3VdbeAddOp2(v, OP_Null, 0, target); return target; } #ifndef SQLITE_OMIT_BLOB_LITERAL case TK_BLOB: { int n; const char *z; char *zBlob; assert( !ExprHasProperty(pExpr, EP_IntValue) ); assert( pExpr->u.zToken[0]=='x' || pExpr->u.zToken[0]=='X' ); assert( pExpr->u.zToken[1]=='\'' ); z = &pExpr->u.zToken[2]; n = sqlite3Strlen30(z) - 1; assert( z[n]=='\'' ); zBlob = sqlite3HexToBlob(sqlite3VdbeDb(v), z, n); sqlite3VdbeAddOp4(v, OP_Blob, n/2, target, 0, zBlob, P4_DYNAMIC); return target; } #endif case TK_VARIABLE: { assert( !ExprHasProperty(pExpr, EP_IntValue) ); assert( pExpr->u.zToken!=0 ); assert( pExpr->u.zToken[0]!=0 ); sqlite3VdbeAddOp2(v, OP_Variable, pExpr->iColumn, target); if( pExpr->u.zToken[1]!=0 ){ const char *z = sqlite3VListNumToName(pParse->pVList, pExpr->iColumn); assert( pExpr->u.zToken[0]=='?' || strcmp(pExpr->u.zToken, z)==0 ); pParse->pVList[0] = 0; /* Indicate VList may no longer be enlarged */ sqlite3VdbeAppendP4(v, (char*)z, P4_STATIC); } return target; } case TK_REGISTER: { return pExpr->iTable; } #ifndef SQLITE_OMIT_CAST case TK_CAST: { /* Expressions of the form: CAST(pLeft AS token) */ inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); if( inReg!=target ){ sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); inReg = target; } sqlite3VdbeAddOp2(v, OP_Cast, target, sqlite3AffinityType(pExpr->u.zToken, 0)); return inReg; } #endif /* SQLITE_OMIT_CAST */ case TK_IS: case TK_ISNOT: op = (op==TK_IS) ? TK_EQ : TK_NE; p5 = SQLITE_NULLEQ; /* fall-through */ case TK_LT: case TK_LE: case TK_GT: case TK_GE: case TK_NE: case TK_EQ: { Expr *pLeft = pExpr->pLeft; if( sqlite3ExprIsVector(pLeft) ){ codeVectorCompare(pParse, pExpr, target, op, p5); }else{ r1 = sqlite3ExprCodeTemp(pParse, pLeft, &regFree1); r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, &regFree2); codeCompare(pParse, pLeft, pExpr->pRight, op, r1, r2, inReg, SQLITE_STOREP2 | p5, ExprHasProperty(pExpr,EP_Commuted)); assert(TK_LT==OP_Lt); testcase(op==OP_Lt); VdbeCoverageIf(v,op==OP_Lt); assert(TK_LE==OP_Le); testcase(op==OP_Le); VdbeCoverageIf(v,op==OP_Le); assert(TK_GT==OP_Gt); testcase(op==OP_Gt); VdbeCoverageIf(v,op==OP_Gt); assert(TK_GE==OP_Ge); testcase(op==OP_Ge); VdbeCoverageIf(v,op==OP_Ge); assert(TK_EQ==OP_Eq); testcase(op==OP_Eq); VdbeCoverageIf(v,op==OP_Eq); assert(TK_NE==OP_Ne); testcase(op==OP_Ne); VdbeCoverageIf(v,op==OP_Ne); testcase( regFree1==0 ); testcase( regFree2==0 ); } break; } case TK_AND: case TK_OR: case TK_PLUS: case TK_STAR: case TK_MINUS: case TK_REM: case TK_BITAND: case TK_BITOR: case TK_SLASH: case TK_LSHIFT: case TK_RSHIFT: case TK_CONCAT: { assert( TK_AND==OP_And ); testcase( op==TK_AND ); assert( TK_OR==OP_Or ); testcase( op==TK_OR ); assert( TK_PLUS==OP_Add ); testcase( op==TK_PLUS ); assert( TK_MINUS==OP_Subtract ); testcase( op==TK_MINUS ); assert( TK_REM==OP_Remainder ); testcase( op==TK_REM ); assert( TK_BITAND==OP_BitAnd ); testcase( op==TK_BITAND ); assert( TK_BITOR==OP_BitOr ); testcase( op==TK_BITOR ); assert( TK_SLASH==OP_Divide ); testcase( op==TK_SLASH ); assert( TK_LSHIFT==OP_ShiftLeft ); testcase( op==TK_LSHIFT ); assert( TK_RSHIFT==OP_ShiftRight ); testcase( op==TK_RSHIFT ); assert( TK_CONCAT==OP_Concat ); testcase( op==TK_CONCAT ); r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1); r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, &regFree2); sqlite3VdbeAddOp3(v, op, r2, r1, target); testcase( regFree1==0 ); testcase( regFree2==0 ); break; } case TK_UMINUS: { Expr *pLeft = pExpr->pLeft; assert( pLeft ); if( pLeft->op==TK_INTEGER ){ codeInteger(pParse, pLeft, 1, target); return target; #ifndef SQLITE_OMIT_FLOATING_POINT }else if( pLeft->op==TK_FLOAT ){ assert( !ExprHasProperty(pExpr, EP_IntValue) ); codeReal(v, pLeft->u.zToken, 1, target); return target; #endif }else{ tempX.op = TK_INTEGER; tempX.flags = EP_IntValue|EP_TokenOnly; tempX.u.iValue = 0; r1 = sqlite3ExprCodeTemp(pParse, &tempX, &regFree1); r2 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree2); sqlite3VdbeAddOp3(v, OP_Subtract, r2, r1, target); testcase( regFree2==0 ); } break; } case TK_BITNOT: case TK_NOT: { assert( TK_BITNOT==OP_BitNot ); testcase( op==TK_BITNOT ); assert( TK_NOT==OP_Not ); testcase( op==TK_NOT ); r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1); testcase( regFree1==0 ); sqlite3VdbeAddOp2(v, op, r1, inReg); break; } case TK_TRUTH: { int isTrue; /* IS TRUE or IS NOT TRUE */ int bNormal; /* IS TRUE or IS FALSE */ r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1); testcase( regFree1==0 ); isTrue = sqlite3ExprTruthValue(pExpr->pRight); bNormal = pExpr->op2==TK_IS; testcase( isTrue && bNormal); testcase( !isTrue && bNormal); sqlite3VdbeAddOp4Int(v, OP_IsTrue, r1, inReg, !isTrue, isTrue ^ bNormal); break; } case TK_ISNULL: case TK_NOTNULL: { int addr; assert( TK_ISNULL==OP_IsNull ); testcase( op==TK_ISNULL ); assert( TK_NOTNULL==OP_NotNull ); testcase( op==TK_NOTNULL ); sqlite3VdbeAddOp2(v, OP_Integer, 1, target); r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1); testcase( regFree1==0 ); addr = sqlite3VdbeAddOp1(v, op, r1); VdbeCoverageIf(v, op==TK_ISNULL); VdbeCoverageIf(v, op==TK_NOTNULL); sqlite3VdbeAddOp2(v, OP_Integer, 0, target); sqlite3VdbeJumpHere(v, addr); break; } case TK_AGG_FUNCTION: { AggInfo *pInfo = pExpr->pAggInfo; if( pInfo==0 ){ assert( !ExprHasProperty(pExpr, EP_IntValue) ); sqlite3ErrorMsg(pParse, "misuse of aggregate: %s()", pExpr->u.zToken); }else{ return pInfo->aFunc[pExpr->iAgg].iMem; } break; } case TK_FUNCTION: { ExprList *pFarg; /* List of function arguments */ int nFarg; /* Number of function arguments */ FuncDef *pDef; /* The function definition object */ const char *zId; /* The function name */ u32 constMask = 0; /* Mask of function arguments that are constant */ int i; /* Loop counter */ sqlite3 *db = pParse->db; /* The database connection */ u8 enc = ENC(db); /* The text encoding used by this database */ CollSeq *pColl = 0; /* A collating sequence */ #ifndef SQLITE_OMIT_WINDOWFUNC if( ExprHasProperty(pExpr, EP_WinFunc) ){ return pExpr->y.pWin->regResult; } #endif if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ /* SQL functions can be expensive. So try to move constant functions ** out of the inner loop, even if that means an extra OP_Copy. */ return sqlite3ExprCodeAtInit(pParse, pExpr, -1); } assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); if( ExprHasProperty(pExpr, EP_TokenOnly) ){ pFarg = 0; }else{ pFarg = pExpr->x.pList; } nFarg = pFarg ? pFarg->nExpr : 0; assert( !ExprHasProperty(pExpr, EP_IntValue) ); zId = pExpr->u.zToken; pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0); #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION if( pDef==0 && pParse->explain ){ pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0); } #endif if( pDef==0 || pDef->xFinalize!=0 ){ sqlite3ErrorMsg(pParse, "unknown function: %s()", zId); break; } /* Attempt a direct implementation of the built-in COALESCE() and ** IFNULL() functions. This avoids unnecessary evaluation of ** arguments past the first non-NULL argument. */ if( pDef->funcFlags & SQLITE_FUNC_COALESCE ){ int endCoalesce = sqlite3VdbeMakeLabel(pParse); assert( nFarg>=2 ); sqlite3ExprCode(pParse, pFarg->a[0].pExpr, target); for(i=1; i<nFarg; i++){ sqlite3VdbeAddOp2(v, OP_NotNull, target, endCoalesce); VdbeCoverage(v); sqlite3ExprCode(pParse, pFarg->a[i].pExpr, target); } sqlite3VdbeResolveLabel(v, endCoalesce); break; } /* The UNLIKELY() function is a no-op. The result is the value ** of the first argument. */ if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){ assert( nFarg>=1 ); return sqlite3ExprCodeTarget(pParse, pFarg->a[0].pExpr, target); } #ifdef SQLITE_DEBUG /* The AFFINITY() function evaluates to a string that describes ** the type affinity of the argument. This is used for testing of ** the SQLite type logic. */ if( pDef->funcFlags & SQLITE_FUNC_AFFINITY ){ const char *azAff[] = { "blob", "text", "numeric", "integer", "real" }; char aff; assert( nFarg==1 ); aff = sqlite3ExprAffinity(pFarg->a[0].pExpr); sqlite3VdbeLoadString(v, target, (aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]); return target; } #endif for(i=0; i<nFarg; i++){ if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){ testcase( i==31 ); constMask |= MASKBIT32(i); } if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){ pColl = sqlite3ExprCollSeq(pParse, pFarg->a[i].pExpr); } } if( pFarg ){ if( constMask ){ r1 = pParse->nMem+1; pParse->nMem += nFarg; }else{ r1 = sqlite3GetTempRange(pParse, nFarg); } /* For length() and typeof() functions with a column argument, ** set the P5 parameter to the OP_Column opcode to OPFLAG_LENGTHARG ** or OPFLAG_TYPEOFARG respectively, to avoid unnecessary data ** loading. */ if( (pDef->funcFlags & (SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF))!=0 ){ u8 exprOp; assert( nFarg==1 ); assert( pFarg->a[0].pExpr!=0 ); exprOp = pFarg->a[0].pExpr->op; if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){ assert( SQLITE_FUNC_LENGTH==OPFLAG_LENGTHARG ); assert( SQLITE_FUNC_TYPEOF==OPFLAG_TYPEOFARG ); testcase( pDef->funcFlags & OPFLAG_LENGTHARG ); pFarg->a[0].pExpr->op2 = pDef->funcFlags & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG); } } sqlite3ExprCodeExprList(pParse, pFarg, r1, 0, SQLITE_ECEL_DUP|SQLITE_ECEL_FACTOR); }else{ r1 = 0; } #ifndef SQLITE_OMIT_VIRTUALTABLE /* Possibly overload the function if the first argument is ** a virtual table column. ** ** For infix functions (LIKE, GLOB, REGEXP, and MATCH) use the ** second argument, not the first, as the argument to test to ** see if it is a column in a virtual table. This is done because ** the left operand of infix functions (the operand we want to ** control overloading) ends up as the second argument to the ** function. The expression "A glob B" is equivalent to ** "glob(B,A). We want to use the A in "A glob B" to test ** for function overloading. But we use the B term in "glob(B,A)". */ if( nFarg>=2 && ExprHasProperty(pExpr, EP_InfixFunc) ){ pDef = sqlite3VtabOverloadFunction(db, pDef, nFarg, pFarg->a[1].pExpr); }else if( nFarg>0 ){ pDef = sqlite3VtabOverloadFunction(db, pDef, nFarg, pFarg->a[0].pExpr); } #endif if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){ if( !pColl ) pColl = db->pDfltColl; sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } #ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC if( pDef->funcFlags & SQLITE_FUNC_OFFSET ){ Expr *pArg = pFarg->a[0].pExpr; if( pArg->op==TK_COLUMN ){ sqlite3VdbeAddOp3(v, OP_Offset, pArg->iTable, pArg->iColumn, target); }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, target); } }else #endif { sqlite3VdbeAddFunctionCall(pParse, constMask, r1, target, nFarg, pDef, pExpr->op2); } if( nFarg && constMask==0 ){ sqlite3ReleaseTempRange(pParse, r1, nFarg); } return target; } #ifndef SQLITE_OMIT_SUBQUERY case TK_EXISTS: case TK_SELECT: { int nCol; testcase( op==TK_EXISTS ); testcase( op==TK_SELECT ); if( op==TK_SELECT && (nCol = pExpr->x.pSelect->pEList->nExpr)!=1 ){ sqlite3SubselectError(pParse, nCol, 1); }else{ return sqlite3CodeSubselect(pParse, pExpr); } break; } case TK_SELECT_COLUMN: { int n; if( pExpr->pLeft->iTable==0 ){ pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft); } assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT ); if( pExpr->iTable!=0 && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) ){ sqlite3ErrorMsg(pParse, "%d columns assigned %d values", pExpr->iTable, n); } return pExpr->pLeft->iTable + pExpr->iColumn; } case TK_IN: { int destIfFalse = sqlite3VdbeMakeLabel(pParse); int destIfNull = sqlite3VdbeMakeLabel(pParse); sqlite3VdbeAddOp2(v, OP_Null, 0, target); sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull); sqlite3VdbeAddOp2(v, OP_Integer, 1, target); sqlite3VdbeResolveLabel(v, destIfFalse); sqlite3VdbeAddOp2(v, OP_AddImm, target, 0); sqlite3VdbeResolveLabel(v, destIfNull); return target; } #endif /* SQLITE_OMIT_SUBQUERY */ /* ** x BETWEEN y AND z ** ** This is equivalent to ** ** x>=y AND x<=z ** ** X is stored in pExpr->pLeft. ** Y is stored in pExpr->pList->a[0].pExpr. ** Z is stored in pExpr->pList->a[1].pExpr. */ case TK_BETWEEN: { exprCodeBetween(pParse, pExpr, target, 0, 0); return target; } case TK_SPAN: case TK_COLLATE: case TK_UPLUS: { pExpr = pExpr->pLeft; goto expr_code_doover; /* 2018-04-28: Prevent deep recursion. OSSFuzz. */ } case TK_TRIGGER: { /* If the opcode is TK_TRIGGER, then the expression is a reference ** to a column in the new.* or old.* pseudo-tables available to ** trigger programs. In this case Expr.iTable is set to 1 for the ** new.* pseudo-table, or 0 for the old.* pseudo-table. Expr.iColumn ** is set to the column of the pseudo-table to read, or to -1 to ** read the rowid field. ** ** The expression is implemented using an OP_Param opcode. The p1 ** parameter is set to 0 for an old.rowid reference, or to (i+1) ** to reference another column of the old.* pseudo-table, where ** i is the index of the column. For a new.rowid reference, p1 is ** set to (n+1), where n is the number of columns in each pseudo-table. ** For a reference to any other column in the new.* pseudo-table, p1 ** is set to (n+2+i), where n and i are as defined previously. For ** example, if the table on which triggers are being fired is ** declared as: ** ** CREATE TABLE t1(a, b); ** ** Then p1 is interpreted as follows: ** ** p1==0 -> old.rowid p1==3 -> new.rowid ** p1==1 -> old.a p1==4 -> new.a ** p1==2 -> old.b p1==5 -> new.b */ Table *pTab = pExpr->y.pTab; int iCol = pExpr->iColumn; int p1 = pExpr->iTable * (pTab->nCol+1) + 1 + (iCol>=0 ? sqlite3TableColumnToStorage(pTab, iCol) : -1); assert( pExpr->iTable==0 || pExpr->iTable==1 ); assert( iCol>=-1 && iCol<pTab->nCol ); assert( pTab->iPKey<0 || iCol!=pTab->iPKey ); assert( p1>=0 && p1<(pTab->nCol*2+2) ); sqlite3VdbeAddOp2(v, OP_Param, p1, target); VdbeComment((v, "r[%d]=%s.%s", target, (pExpr->iTable ? "new" : "old"), (pExpr->iColumn<0 ? "rowid" : pExpr->y.pTab->aCol[iCol].zName) )); #ifndef SQLITE_OMIT_FLOATING_POINT /* If the column has REAL affinity, it may currently be stored as an ** integer. Use OP_RealAffinity to make sure it is really real. ** ** EVIDENCE-OF: R-60985-57662 SQLite will convert the value back to ** floating point when extracting it from the record. */ if( iCol>=0 && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){ sqlite3VdbeAddOp1(v, OP_RealAffinity, target); } #endif break; } case TK_VECTOR: { sqlite3ErrorMsg(pParse, "row value misused"); break; } /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The ** Expr.iTable value is the table number for the right-hand table. ** The expression is only evaluated if that table is not currently ** on a LEFT JOIN NULL row. */ case TK_IF_NULL_ROW: { int addrINR; u8 okConstFactor = pParse->okConstFactor; addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable); /* Temporarily disable factoring of constant expressions, since ** even though expressions may appear to be constant, they are not ** really constant because they originate from the right-hand side ** of a LEFT JOIN. */ pParse->okConstFactor = 0; inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); pParse->okConstFactor = okConstFactor; sqlite3VdbeJumpHere(v, addrINR); sqlite3VdbeChangeP3(v, addrINR, inReg); break; } /* ** Form A: ** CASE x WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END ** ** Form B: ** CASE WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END ** ** Form A is can be transformed into the equivalent form B as follows: ** CASE WHEN x=e1 THEN r1 WHEN x=e2 THEN r2 ... ** WHEN x=eN THEN rN ELSE y END ** ** X (if it exists) is in pExpr->pLeft. ** Y is in the last element of pExpr->x.pList if pExpr->x.pList->nExpr is ** odd. The Y is also optional. If the number of elements in x.pList ** is even, then Y is omitted and the "otherwise" result is NULL. ** Ei is in pExpr->pList->a[i*2] and Ri is pExpr->pList->a[i*2+1]. ** ** The result of the expression is the Ri for the first matching Ei, ** or if there is no matching Ei, the ELSE term Y, or if there is ** no ELSE term, NULL. */ default: assert( op==TK_CASE ); { int endLabel; /* GOTO label for end of CASE stmt */ int nextCase; /* GOTO label for next WHEN clause */ int nExpr; /* 2x number of WHEN terms */ int i; /* Loop counter */ ExprList *pEList; /* List of WHEN terms */ struct ExprList_item *aListelem; /* Array of WHEN terms */ Expr opCompare; /* The X==Ei expression */ Expr *pX; /* The X expression */ Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */ Expr *pDel = 0; sqlite3 *db = pParse->db; assert( !ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList ); assert(pExpr->x.pList->nExpr > 0); pEList = pExpr->x.pList; aListelem = pEList->a; nExpr = pEList->nExpr; endLabel = sqlite3VdbeMakeLabel(pParse); if( (pX = pExpr->pLeft)!=0 ){ pDel = sqlite3ExprDup(db, pX, 0); if( db->mallocFailed ){ sqlite3ExprDelete(db, pDel); break; } testcase( pX->op==TK_COLUMN ); exprToRegister(pDel, exprCodeVector(pParse, pDel, &regFree1)); testcase( regFree1==0 ); memset(&opCompare, 0, sizeof(opCompare)); opCompare.op = TK_EQ; opCompare.pLeft = pDel; pTest = &opCompare; /* Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001: ** The value in regFree1 might get SCopy-ed into the file result. ** So make sure that the regFree1 register is not reused for other ** purposes and possibly overwritten. */ regFree1 = 0; } for(i=0; i<nExpr-1; i=i+2){ if( pX ){ assert( pTest!=0 ); opCompare.pRight = aListelem[i].pExpr; }else{ pTest = aListelem[i].pExpr; } nextCase = sqlite3VdbeMakeLabel(pParse); testcase( pTest->op==TK_COLUMN ); sqlite3ExprIfFalse(pParse, pTest, nextCase, SQLITE_JUMPIFNULL); testcase( aListelem[i+1].pExpr->op==TK_COLUMN ); sqlite3ExprCode(pParse, aListelem[i+1].pExpr, target); sqlite3VdbeGoto(v, endLabel); sqlite3VdbeResolveLabel(v, nextCase); } if( (nExpr&1)!=0 ){ sqlite3ExprCode(pParse, pEList->a[nExpr-1].pExpr, target); }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, target); } sqlite3ExprDelete(db, pDel); sqlite3VdbeResolveLabel(v, endLabel); break; } #ifndef SQLITE_OMIT_TRIGGER case TK_RAISE: { assert( pExpr->affExpr==OE_Rollback || pExpr->affExpr==OE_Abort || pExpr->affExpr==OE_Fail || pExpr->affExpr==OE_Ignore ); if( !pParse->pTriggerTab ){ sqlite3ErrorMsg(pParse, "RAISE() may only be used within a trigger-program"); return 0; } if( pExpr->affExpr==OE_Abort ){ sqlite3MayAbort(pParse); } assert( !ExprHasProperty(pExpr, EP_IntValue) ); if( pExpr->affExpr==OE_Ignore ){ sqlite3VdbeAddOp4( v, OP_Halt, SQLITE_OK, OE_Ignore, 0, pExpr->u.zToken,0); VdbeCoverage(v); }else{ sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_TRIGGER, pExpr->affExpr, pExpr->u.zToken, 0, 0); } break; } #endif } sqlite3ReleaseTempReg(pParse, regFree1); sqlite3ReleaseTempReg(pParse, regFree2); return inReg; }
4151
True
1
CVE-2019-19317
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/sqlite/sqlite/commit/522ebfa7cee96fb325a22ea3a2464a63485886a8', 'name': 'https://github.com/sqlite/sqlite/commit/522ebfa7cee96fb325a22ea3a2464a63485886a8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sqlite/sqlite/commit/73bacb7f93eab9f4bd5a65cbc4ae242acf63c9e3', 'name': 'https://github.com/sqlite/sqlite/commit/73bacb7f93eab9f4bd5a65cbc4ae242acf63c9e3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-681'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'lookupName in resolve.c in SQLite 3.30.1 omits bits from the colUsed bitmask in the case of a generated column, which allows attackers to cause a denial of service or possibly have unspecified other impact.'}]
2022-04-15T16:14Z
2019-12-05T14:15Z
Incorrect Conversion between Numeric Types
When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.
https://cwe.mitre.org/data/definitions/681.html
0
drh
2019-11-21 19:37:00+00:00
Whenever a generated column is used, assume that all columns are used. FossilOrigin-Name: 6601da58032d18ae00b466c0f2077fb2b1ecd84225b56e1787724bea478eedc9
522ebfa7cee96fb325a22ea3a2464a63485886a8
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
lookupName
lookupName( Parse * pParse , const char * zDb , const char * zTab , const char * zCol , NameContext * pNC , Expr * pExpr)
['pParse', 'zDb', 'zTab', 'zCol', 'pNC', 'pExpr']
static int lookupName( Parse *pParse, /* The parsing context */ const char *zDb, /* Name of the database containing table, or NULL */ const char *zTab, /* Name of table containing column, or NULL */ const char *zCol, /* Name of the column. */ NameContext *pNC, /* The name context used to resolve the name */ Expr *pExpr /* Make this EXPR node point to the selected column */ ){ int i, j; /* Loop counters */ int cnt = 0; /* Number of matching column names */ int cntTab = 0; /* Number of matching table names */ int nSubquery = 0; /* How many levels of subquery */ sqlite3 *db = pParse->db; /* The database connection */ struct SrcList_item *pItem; /* Use for looping over pSrcList items */ struct SrcList_item *pMatch = 0; /* The matching pSrcList item */ NameContext *pTopNC = pNC; /* First namecontext in the list */ Schema *pSchema = 0; /* Schema of the expression */ int eNewExprOp = TK_COLUMN; /* New value for pExpr->op on success */ Table *pTab = 0; /* Table hold the row */ Column *pCol; /* A column of pTab */ assert( pNC ); /* the name context cannot be NULL. */ assert( zCol ); /* The Z in X.Y.Z cannot be NULL */ assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); /* Initialize the node to no-match */ pExpr->iTable = -1; ExprSetVVAProperty(pExpr, EP_NoReduce); /* Translate the schema name in zDb into a pointer to the corresponding ** schema. If not found, pSchema will remain NULL and nothing will match ** resulting in an appropriate error message toward the end of this routine */ if( zDb ){ testcase( pNC->ncFlags & NC_PartIdx ); testcase( pNC->ncFlags & NC_IsCheck ); if( (pNC->ncFlags & (NC_PartIdx|NC_IsCheck))!=0 ){ /* Silently ignore database qualifiers inside CHECK constraints and ** partial indices. Do not raise errors because that might break ** legacy and because it does not hurt anything to just ignore the ** database name. */ zDb = 0; }else{ for(i=0; i<db->nDb; i++){ assert( db->aDb[i].zDbSName ); if( sqlite3StrICmp(db->aDb[i].zDbSName,zDb)==0 ){ pSchema = db->aDb[i].pSchema; break; } } } } /* Start at the inner-most context and move outward until a match is found */ assert( pNC && cnt==0 ); do{ ExprList *pEList; SrcList *pSrcList = pNC->pSrcList; if( pSrcList ){ for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){ pTab = pItem->pTab; assert( pTab!=0 && pTab->zName!=0 ); assert( pTab->nCol>0 ); if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){ int hit = 0; pEList = pItem->pSelect->pEList; for(j=0; j<pEList->nExpr; j++){ if( sqlite3MatchSpanName(pEList->a[j].zSpan, zCol, zTab, zDb) ){ cnt++; cntTab = 2; pMatch = pItem; pExpr->iColumn = j; hit = 1; } } if( hit || zTab==0 ) continue; } if( zDb && pTab->pSchema!=pSchema ){ continue; } if( zTab ){ const char *zTabName = pItem->zAlias ? pItem->zAlias : pTab->zName; assert( zTabName!=0 ); if( sqlite3StrICmp(zTabName, zTab)!=0 ){ continue; } if( IN_RENAME_OBJECT && pItem->zAlias ){ sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab); } } if( 0==(cntTab++) ){ pMatch = pItem; } for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ /* If there has been exactly one prior match and this match ** is for the right-hand table of a NATURAL JOIN or is in a ** USING clause, then skip this match. */ if( cnt==1 ){ if( pItem->fg.jointype & JT_NATURAL ) continue; if( nameInUsingClause(pItem->pUsing, zCol) ) continue; } cnt++; pMatch = pItem; /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j; break; } } } if( pMatch ){ pExpr->iTable = pMatch->iCursor; pExpr->y.pTab = pMatch->pTab; /* RIGHT JOIN not (yet) supported */ assert( (pMatch->fg.jointype & JT_RIGHT)==0 ); if( (pMatch->fg.jointype & JT_LEFT)!=0 ){ ExprSetProperty(pExpr, EP_CanBeNull); } pSchema = pExpr->y.pTab->pSchema; } } /* if( pSrcList ) */ #if !defined(SQLITE_OMIT_TRIGGER) || !defined(SQLITE_OMIT_UPSERT) /* If we have not already resolved the name, then maybe ** it is a new.* or old.* trigger argument reference. Or ** maybe it is an excluded.* from an upsert. */ if( zDb==0 && zTab!=0 && cntTab==0 ){ pTab = 0; #ifndef SQLITE_OMIT_TRIGGER if( pParse->pTriggerTab!=0 ){ int op = pParse->eTriggerOp; assert( op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT ); if( op!=TK_DELETE && sqlite3StrICmp("new",zTab) == 0 ){ pExpr->iTable = 1; pTab = pParse->pTriggerTab; }else if( op!=TK_INSERT && sqlite3StrICmp("old",zTab)==0 ){ pExpr->iTable = 0; pTab = pParse->pTriggerTab; } } #endif /* SQLITE_OMIT_TRIGGER */ #ifndef SQLITE_OMIT_UPSERT if( (pNC->ncFlags & NC_UUpsert)!=0 ){ Upsert *pUpsert = pNC->uNC.pUpsert; if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){ pTab = pUpsert->pUpsertSrc->a[0].pTab; pExpr->iTable = 2; } } #endif /* SQLITE_OMIT_UPSERT */ if( pTab ){ int iCol; pSchema = pTab->pSchema; cntTab++; for(iCol=0, pCol=pTab->aCol; iCol<pTab->nCol; iCol++, pCol++){ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ if( iCol==pTab->iPKey ){ iCol = -1; } break; } } if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){ /* IMP: R-51414-32910 */ iCol = -1; } if( iCol<pTab->nCol ){ cnt++; #ifndef SQLITE_OMIT_UPSERT if( pExpr->iTable==2 ){ testcase( iCol==(-1) ); if( IN_RENAME_OBJECT ){ pExpr->iColumn = iCol; pExpr->y.pTab = pTab; eNewExprOp = TK_COLUMN; }else{ pExpr->iTable = pNC->uNC.pUpsert->regData + iCol; eNewExprOp = TK_REGISTER; ExprSetProperty(pExpr, EP_Alias); } }else #endif /* SQLITE_OMIT_UPSERT */ { #ifndef SQLITE_OMIT_TRIGGER if( iCol<0 ){ pExpr->affExpr = SQLITE_AFF_INTEGER; }else if( pExpr->iTable==0 ){ testcase( iCol==31 ); testcase( iCol==32 ); pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol)); }else{ testcase( iCol==31 ); testcase( iCol==32 ); pParse->newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol)); } pExpr->y.pTab = pTab; pExpr->iColumn = (i16)iCol; eNewExprOp = TK_TRIGGER; #endif /* SQLITE_OMIT_TRIGGER */ } } } } #endif /* !defined(SQLITE_OMIT_TRIGGER) || !defined(SQLITE_OMIT_UPSERT) */ /* ** Perhaps the name is a reference to the ROWID */ if( cnt==0 && cntTab==1 && pMatch && (pNC->ncFlags & (NC_IdxExpr|NC_GenCol))==0 && sqlite3IsRowid(zCol) && VisibleRowid(pMatch->pTab) ){ cnt = 1; pExpr->iColumn = -1; pExpr->affExpr = SQLITE_AFF_INTEGER; } /* ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z ** might refer to an result-set alias. This happens, for example, when ** we are resolving names in the WHERE clause of the following command: ** ** SELECT a+b AS x FROM table WHERE x<10; ** ** In cases like this, replace pExpr with a copy of the expression that ** forms the result set entry ("a+b" in the example) and return immediately. ** Note that the expression in the result set should have already been ** resolved by the time the WHERE clause is resolved. ** ** The ability to use an output result-set column in the WHERE, GROUP BY, ** or HAVING clauses, or as part of a larger expression in the ORDER BY ** clause is not standard SQL. This is a (goofy) SQLite extension, that ** is supported for backwards compatibility only. Hence, we issue a warning ** on sqlite3_log() whenever the capability is used. */ if( (pNC->ncFlags & NC_UEList)!=0 && cnt==0 && zTab==0 ){ pEList = pNC->uNC.pEList; assert( pEList!=0 ); for(j=0; j<pEList->nExpr; j++){ char *zAs = pEList->a[j].zName; if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ Expr *pOrig; assert( pExpr->pLeft==0 && pExpr->pRight==0 ); assert( pExpr->x.pList==0 ); assert( pExpr->x.pSelect==0 ); pOrig = pEList->a[j].pExpr; if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){ sqlite3ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs); return WRC_Abort; } if( (pNC->ncFlags&NC_AllowWin)==0 && ExprHasProperty(pOrig, EP_Win) ){ sqlite3ErrorMsg(pParse, "misuse of aliased window function %s",zAs); return WRC_Abort; } if( sqlite3ExprVectorSize(pOrig)!=1 ){ sqlite3ErrorMsg(pParse, "row value misused"); return WRC_Abort; } resolveAlias(pParse, pEList, j, pExpr, "", nSubquery); cnt = 1; pMatch = 0; assert( zTab==0 && zDb==0 ); if( IN_RENAME_OBJECT ){ sqlite3RenameTokenRemap(pParse, 0, (void*)pExpr); } goto lookupname_end; } } } /* Advance to the next name context. The loop will exit when either ** we have a match (cnt>0) or when we run out of name contexts. */ if( cnt ) break; pNC = pNC->pNext; nSubquery++; }while( pNC ); /* ** If X and Y are NULL (in other words if only the column name Z is ** supplied) and the value of Z is enclosed in double-quotes, then ** Z is a string literal if it doesn't match any column names. In that ** case, we need to return right away and not make any changes to ** pExpr. ** ** Because no reference was made to outer contexts, the pNC->nRef ** fields are not changed in any context. */ if( cnt==0 && zTab==0 ){ assert( pExpr->op==TK_ID ); if( ExprHasProperty(pExpr,EP_DblQuoted) && areDoubleQuotedStringsEnabled(db, pTopNC) ){ /* If a double-quoted identifier does not match any known column name, ** then treat it as a string. ** ** This hack was added in the early days of SQLite in a misguided attempt ** to be compatible with MySQL 3.x, which used double-quotes for strings. ** I now sorely regret putting in this hack. The effect of this hack is ** that misspelled identifier names are silently converted into strings ** rather than causing an error, to the frustration of countless ** programmers. To all those frustrated programmers, my apologies. ** ** Someday, I hope to get rid of this hack. Unfortunately there is ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ sqlite3_log(SQLITE_WARNING, "double-quoted string literal: \"%w\"", zCol); #ifdef SQLITE_ENABLE_NORMALIZE sqlite3VdbeAddDblquoteStr(db, pParse->pVdbe, zCol); #endif pExpr->op = TK_STRING; pExpr->y.pTab = 0; return WRC_Prune; } if( sqlite3ExprIdToTrueFalse(pExpr) ){ return WRC_Prune; } } /* ** cnt==0 means there was not match. cnt>1 means there were two or ** more matches. Either way, we have an error. */ if( cnt!=1 ){ const char *zErr; zErr = cnt==0 ? "no such column" : "ambiguous column name"; if( zDb ){ sqlite3ErrorMsg(pParse, "%s: %s.%s.%s", zErr, zDb, zTab, zCol); }else if( zTab ){ sqlite3ErrorMsg(pParse, "%s: %s.%s", zErr, zTab, zCol); }else{ sqlite3ErrorMsg(pParse, "%s: %s", zErr, zCol); } pParse->checkSchema = 1; pTopNC->nErr++; } /* If a column from a table in pSrcList is referenced, then record ** this fact in the pSrcList.a[].colUsed bitmask. Column 0 causes ** bit 0 to be set. Column 1 sets bit 1. And so forth. If the ** column number is greater than the number of bits in the bitmask ** then set the high-order bit of the bitmask. */ if( pExpr->iColumn>=0 && pMatch!=0 ){ int n = pExpr->iColumn; testcase( n==BMS-1 ); if( n>=BMS ){ n = BMS-1; } assert( pMatch->iCursor==pExpr->iTable ); pMatch->colUsed |= ((Bitmask)1)<<n; } /* Clean up and return */ sqlite3ExprDelete(db, pExpr->pLeft); pExpr->pLeft = 0; sqlite3ExprDelete(db, pExpr->pRight); pExpr->pRight = 0; pExpr->op = eNewExprOp; ExprSetProperty(pExpr, EP_Leaf); lookupname_end: if( cnt==1 ){ assert( pNC!=0 ); if( !ExprHasProperty(pExpr, EP_Alias) ){ sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList); } /* Increment the nRef value on all name contexts from TopNC up to ** the point where the name matched. */ for(;;){ assert( pTopNC!=0 ); pTopNC->nRef++; if( pTopNC==pNC ) break; pTopNC = pTopNC->pNext; } return WRC_Prune; } else { return WRC_Abort; } }
1920
True
1
CVE-2019-19645
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/sqlite/sqlite/commit/38096961c7cd109110ac21d3ed7dad7e0cb0ae06', 'name': 'https://github.com/sqlite/sqlite/commit/38096961c7cd109110ac21d3ed7dad7e0cb0ae06', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4394-1/', 'name': 'USN-4394-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-14', 'name': 'https://www.tenable.com/security/tns-2021-14', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-674'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.30.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tenable:tenable.sc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.19.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'alter.c in SQLite through 3.30.1 allows attackers to trigger infinite recursion via certain types of self-referential views in conjunction with ALTER TABLE statements.'}]
2022-04-15T16:14Z
2019-12-09T16:15Z
Uncontrolled Recursion
The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack.
https://cwe.mitre.org/data/definitions/674.html
0
dan
2019-12-09 08:13:43+00:00
Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself. FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5
38096961c7cd109110ac21d3ed7dad7e0cb0ae06
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
renameColumnFunc
renameColumnFunc( sqlite3_context * context , int NotUsed , sqlite3_value ** argv)
['context', 'NotUsed', 'argv']
static void renameColumnFunc( sqlite3_context *context, int NotUsed, sqlite3_value **argv ){ sqlite3 *db = sqlite3_context_db_handle(context); RenameCtx sCtx; const char *zSql = (const char*)sqlite3_value_text(argv[0]); const char *zDb = (const char*)sqlite3_value_text(argv[3]); const char *zTable = (const char*)sqlite3_value_text(argv[4]); int iCol = sqlite3_value_int(argv[5]); const char *zNew = (const char*)sqlite3_value_text(argv[6]); int bQuote = sqlite3_value_int(argv[7]); int bTemp = sqlite3_value_int(argv[8]); const char *zOld; int rc; Parse sParse; Walker sWalker; Index *pIdx; int i; Table *pTab; #ifndef SQLITE_OMIT_AUTHORIZATION sqlite3_xauth xAuth = db->xAuth; #endif UNUSED_PARAMETER(NotUsed); if( zSql==0 ) return; if( zTable==0 ) return; if( zNew==0 ) return; if( iCol<0 ) return; sqlite3BtreeEnterAll(db); pTab = sqlite3FindTable(db, zTable, zDb); if( pTab==0 || iCol>=pTab->nCol ){ sqlite3BtreeLeaveAll(db); return; } zOld = pTab->aCol[iCol].zName; memset(&sCtx, 0, sizeof(sCtx)); sCtx.iCol = ((iCol==pTab->iPKey) ? -1 : iCol); #ifndef SQLITE_OMIT_AUTHORIZATION db->xAuth = 0; #endif rc = renameParseSql(&sParse, zDb, 0, db, zSql, bTemp); /* Find tokens that need to be replaced. */ memset(&sWalker, 0, sizeof(Walker)); sWalker.pParse = &sParse; sWalker.xExprCallback = renameColumnExprCb; sWalker.xSelectCallback = renameColumnSelectCb; sWalker.u.pRename = &sCtx; sCtx.pTab = pTab; if( rc!=SQLITE_OK ) goto renameColumnFunc_done; if( sParse.pNewTable ){ Select *pSelect = sParse.pNewTable->pSelect; if( pSelect ){ sParse.rc = SQLITE_OK; sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, 0); rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc); if( rc==SQLITE_OK ){ sqlite3WalkSelect(&sWalker, pSelect); } if( rc!=SQLITE_OK ) goto renameColumnFunc_done; }else{ /* A regular table */ int bFKOnly = sqlite3_stricmp(zTable, sParse.pNewTable->zName); FKey *pFKey; assert( sParse.pNewTable->pSelect==0 ); sCtx.pTab = sParse.pNewTable; if( bFKOnly==0 ){ renameTokenFind( &sParse, &sCtx, (void*)sParse.pNewTable->aCol[iCol].zName ); if( sCtx.iCol<0 ){ renameTokenFind(&sParse, &sCtx, (void*)&sParse.pNewTable->iPKey); } sqlite3WalkExprList(&sWalker, sParse.pNewTable->pCheck); for(pIdx=sParse.pNewTable->pIndex; pIdx; pIdx=pIdx->pNext){ sqlite3WalkExprList(&sWalker, pIdx->aColExpr); } for(pIdx=sParse.pNewIndex; pIdx; pIdx=pIdx->pNext){ sqlite3WalkExprList(&sWalker, pIdx->aColExpr); } } #ifndef SQLITE_OMIT_GENERATED_COLUMNS for(i=0; i<sParse.pNewTable->nCol; i++){ sqlite3WalkExpr(&sWalker, sParse.pNewTable->aCol[i].pDflt); } #endif for(pFKey=sParse.pNewTable->pFKey; pFKey; pFKey=pFKey->pNextFrom){ for(i=0; i<pFKey->nCol; i++){ if( bFKOnly==0 && pFKey->aCol[i].iFrom==iCol ){ renameTokenFind(&sParse, &sCtx, (void*)&pFKey->aCol[i]); } if( 0==sqlite3_stricmp(pFKey->zTo, zTable) && 0==sqlite3_stricmp(pFKey->aCol[i].zCol, zOld) ){ renameTokenFind(&sParse, &sCtx, (void*)pFKey->aCol[i].zCol); } } } } }else if( sParse.pNewIndex ){ sqlite3WalkExprList(&sWalker, sParse.pNewIndex->aColExpr); sqlite3WalkExpr(&sWalker, sParse.pNewIndex->pPartIdxWhere); }else{ /* A trigger */ TriggerStep *pStep; rc = renameResolveTrigger(&sParse, (bTemp ? 0 : zDb)); if( rc!=SQLITE_OK ) goto renameColumnFunc_done; for(pStep=sParse.pNewTrigger->step_list; pStep; pStep=pStep->pNext){ if( pStep->zTarget ){ Table *pTarget = sqlite3LocateTable(&sParse, 0, pStep->zTarget, zDb); if( pTarget==pTab ){ if( pStep->pUpsert ){ ExprList *pUpsertSet = pStep->pUpsert->pUpsertSet; renameColumnElistNames(&sParse, &sCtx, pUpsertSet, zOld); } renameColumnIdlistNames(&sParse, &sCtx, pStep->pIdList, zOld); renameColumnElistNames(&sParse, &sCtx, pStep->pExprList, zOld); } } } /* Find tokens to edit in UPDATE OF clause */ if( sParse.pTriggerTab==pTab ){ renameColumnIdlistNames(&sParse, &sCtx,sParse.pNewTrigger->pColumns,zOld); } /* Find tokens to edit in various expressions and selects */ renameWalkTrigger(&sWalker, sParse.pNewTrigger); } assert( rc==SQLITE_OK ); rc = renameEditSql(context, &sCtx, zSql, zNew, bQuote); renameColumnFunc_done: if( rc!=SQLITE_OK ){ if( sParse.zErrMsg ){ renameColumnParseError(context, 0, argv[1], argv[2], &sParse); }else{ sqlite3_result_error_code(context, rc); } } renameParseCleanup(&sParse); renameTokenFree(db, sCtx.pList); #ifndef SQLITE_OMIT_AUTHORIZATION db->xAuth = xAuth; #endif sqlite3BtreeLeaveAll(db); }
1096
True
1
CVE-2019-19646
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/sqlite/sqlite/commit/ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd', 'name': 'https://github.com/sqlite/sqlite/commit/ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sqlite/sqlite/commit/926f796e8feec15f3836aa0a060ed906f8ae04d3', 'name': 'https://github.com/sqlite/sqlite/commit/926f796e8feec15f3836aa0a060ed906f8ae04d3', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.sqlite.org/', 'name': 'https://www.sqlite.org/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-14', 'name': 'https://www.tenable.com/security/tns-2021-14', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.30.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tenable:tenable.sc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.19.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'pragma.c in SQLite through 3.30.1 mishandles NOT NULL in an integrity_check PRAGMA command in certain cases of generated columns.'}]
2022-04-15T16:15Z
2019-12-09T19:15Z
Improper Check for Unusual or Exceptional Conditions
The software does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.
The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability. Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.
https://cwe.mitre.org/data/definitions/754.html
0
drh
2019-12-09 15:52:07+00:00
Fix the NOT NULL verification logic in PRAGMA integrity_check so that it works for generated columns whose value is the result of a comparison operator. Ticket [bd8c280671ba44a7] FossilOrigin-Name: f3b39c71b88cb6721f443de56cdce4c08252453a5e340b00a2bd88dc10c42400
ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
sqlite3Pragma
sqlite3Pragma( Parse * pParse , Token * pId1 , Token * pId2 , Token * pValue , int minusFlag)
['pParse', 'pId1', 'pId2', 'pValue', 'minusFlag']
void sqlite3Pragma( Parse *pParse, Token *pId1, /* First part of [schema.]id field */ Token *pId2, /* Second part of [schema.]id field, or NULL */ Token *pValue, /* Token for <value>, or NULL */ int minusFlag /* True if a '-' sign preceded <value> */ ){ char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */ char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */ const char *zDb = 0; /* The database name */ Token *pId; /* Pointer to <id> token */ char *aFcntl[4]; /* Argument to SQLITE_FCNTL_PRAGMA */ int iDb; /* Database index for <database> */ int rc; /* return value form SQLITE_FCNTL_PRAGMA */ sqlite3 *db = pParse->db; /* The database connection */ Db *pDb; /* The specific database being pragmaed */ Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */ const PragmaName *pPragma; /* The pragma */ if( v==0 ) return; sqlite3VdbeRunOnlyOnce(v); pParse->nMem = 2; /* Interpret the [schema.] part of the pragma statement. iDb is the ** index of the database this pragma is being applied to in db.aDb[]. */ iDb = sqlite3TwoPartName(pParse, pId1, pId2, &pId); if( iDb<0 ) return; pDb = &db->aDb[iDb]; /* If the temp database has been explicitly named as part of the ** pragma, make sure it is open. */ if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ return; } zLeft = sqlite3NameFromToken(db, pId); if( !zLeft ) return; if( minusFlag ){ zRight = sqlite3MPrintf(db, "-%T", pValue); }else{ zRight = sqlite3NameFromToken(db, pValue); } assert( pId2 ); zDb = pId2->n>0 ? pDb->zDbSName : 0; if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ goto pragma_out; } /* Send an SQLITE_FCNTL_PRAGMA file-control to the underlying VFS ** connection. If it returns SQLITE_OK, then assume that the VFS ** handled the pragma and generate a no-op prepared statement. ** ** IMPLEMENTATION-OF: R-12238-55120 Whenever a PRAGMA statement is parsed, ** an SQLITE_FCNTL_PRAGMA file control is sent to the open sqlite3_file ** object corresponding to the database file to which the pragma ** statement refers. ** ** IMPLEMENTATION-OF: R-29875-31678 The argument to the SQLITE_FCNTL_PRAGMA ** file control is an array of pointers to strings (char**) in which the ** second element of the array is the name of the pragma and the third ** element is the argument to the pragma or NULL if the pragma has no ** argument. */ aFcntl[0] = 0; aFcntl[1] = zLeft; aFcntl[2] = zRight; aFcntl[3] = 0; db->busyHandler.nBusy = 0; rc = sqlite3_file_control(db, zDb, SQLITE_FCNTL_PRAGMA, (void*)aFcntl); if( rc==SQLITE_OK ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, COLNAME_NAME, aFcntl[0], SQLITE_TRANSIENT); returnSingleText(v, aFcntl[0]); sqlite3_free(aFcntl[0]); goto pragma_out; } if( rc!=SQLITE_NOTFOUND ){ if( aFcntl[0] ){ sqlite3ErrorMsg(pParse, "%s", aFcntl[0]); sqlite3_free(aFcntl[0]); } pParse->nErr++; pParse->rc = rc; goto pragma_out; } /* Locate the pragma in the lookup table */ pPragma = pragmaLocate(zLeft); if( pPragma==0 ) goto pragma_out; /* Make sure the database schema is loaded if the pragma requires that */ if( (pPragma->mPragFlg & PragFlg_NeedSchema)!=0 ){ if( sqlite3ReadSchema(pParse) ) goto pragma_out; } /* Register the result column names for pragmas that return results */ if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 && ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) ){ setPragmaResultColumnNames(v, pPragma); } /* Jump to the appropriate pragma handler */ switch( pPragma->ePragTyp ){ #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) /* ** PRAGMA [schema.]default_cache_size ** PRAGMA [schema.]default_cache_size=N ** ** The first form reports the current persistent setting for the ** page cache size. The value returned is the maximum number of ** pages in the page cache. The second form sets both the current ** page cache size value and the persistent page cache size value ** stored in the database file. ** ** Older versions of SQLite would set the default cache size to a ** negative number to indicate synchronous=OFF. These days, synchronous ** is always on by default regardless of the sign of the default cache ** size. But continue to take the absolute value of the default cache ** size of historical compatibility. */ case PragTyp_DEFAULT_CACHE_SIZE: { static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList getCacheSize[] = { { OP_Transaction, 0, 0, 0}, /* 0 */ { OP_ReadCookie, 0, 1, BTREE_DEFAULT_CACHE_SIZE}, /* 1 */ { OP_IfPos, 1, 8, 0}, { OP_Integer, 0, 2, 0}, { OP_Subtract, 1, 2, 1}, { OP_IfPos, 1, 8, 0}, { OP_Integer, 0, 1, 0}, /* 6 */ { OP_Noop, 0, 0, 0}, { OP_ResultRow, 1, 1, 0}, }; VdbeOp *aOp; sqlite3VdbeUsesBtree(v, iDb); if( !zRight ){ pParse->nMem += 2; sqlite3VdbeVerifyNoMallocRequired(v, ArraySize(getCacheSize)); aOp = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize, iLn); if( ONLY_IF_REALLOC_STRESS(aOp==0) ) break; aOp[0].p1 = iDb; aOp[1].p1 = iDb; aOp[6].p1 = SQLITE_DEFAULT_CACHE_SIZE; }else{ int size = sqlite3AbsInt32(sqlite3Atoi(zRight)); sqlite3BeginWriteOperation(pParse, 0, iDb); sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_DEFAULT_CACHE_SIZE, size); assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pDb->pSchema->cache_size = size; sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size); } break; } #endif /* !SQLITE_OMIT_PAGER_PRAGMAS && !SQLITE_OMIT_DEPRECATED */ #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) /* ** PRAGMA [schema.]page_size ** PRAGMA [schema.]page_size=N ** ** The first form reports the current setting for the ** database page size in bytes. The second form sets the ** database page size value. The value can only be set if ** the database has not yet been created. */ case PragTyp_PAGE_SIZE: { Btree *pBt = pDb->pBt; assert( pBt!=0 ); if( !zRight ){ int size = ALWAYS(pBt) ? sqlite3BtreeGetPageSize(pBt) : 0; returnSingleInt(v, size); }else{ /* Malloc may fail when setting the page-size, as there is an internal ** buffer that the pager module resizes using sqlite3_realloc(). */ db->nextPagesize = sqlite3Atoi(zRight); if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize,-1,0) ){ sqlite3OomFault(db); } } break; } /* ** PRAGMA [schema.]secure_delete ** PRAGMA [schema.]secure_delete=ON/OFF/FAST ** ** The first form reports the current setting for the ** secure_delete flag. The second form changes the secure_delete ** flag setting and reports the new value. */ case PragTyp_SECURE_DELETE: { Btree *pBt = pDb->pBt; int b = -1; assert( pBt!=0 ); if( zRight ){ if( sqlite3_stricmp(zRight, "fast")==0 ){ b = 2; }else{ b = sqlite3GetBoolean(zRight, 0); } } if( pId2->n==0 && b>=0 ){ int ii; for(ii=0; ii<db->nDb; ii++){ sqlite3BtreeSecureDelete(db->aDb[ii].pBt, b); } } b = sqlite3BtreeSecureDelete(pBt, b); returnSingleInt(v, b); break; } /* ** PRAGMA [schema.]max_page_count ** PRAGMA [schema.]max_page_count=N ** ** The first form reports the current setting for the ** maximum number of pages in the database file. The ** second form attempts to change this setting. Both ** forms return the current setting. ** ** The absolute value of N is used. This is undocumented and might ** change. The only purpose is to provide an easy way to test ** the sqlite3AbsInt32() function. ** ** PRAGMA [schema.]page_count ** ** Return the number of pages in the specified database. */ case PragTyp_PAGE_COUNT: { int iReg; sqlite3CodeVerifySchema(pParse, iDb); iReg = ++pParse->nMem; if( sqlite3Tolower(zLeft[0])=='p' ){ sqlite3VdbeAddOp2(v, OP_Pagecount, iDb, iReg); }else{ sqlite3VdbeAddOp3(v, OP_MaxPgcnt, iDb, iReg, sqlite3AbsInt32(sqlite3Atoi(zRight))); } sqlite3VdbeAddOp2(v, OP_ResultRow, iReg, 1); break; } /* ** PRAGMA [schema.]locking_mode ** PRAGMA [schema.]locking_mode = (normal|exclusive) */ case PragTyp_LOCKING_MODE: { const char *zRet = "normal"; int eMode = getLockingMode(zRight); if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){ /* Simple "PRAGMA locking_mode;" statement. This is a query for ** the current default locking mode (which may be different to ** the locking-mode of the main database). */ eMode = db->dfltLockMode; }else{ Pager *pPager; if( pId2->n==0 ){ /* This indicates that no database name was specified as part ** of the PRAGMA command. In this case the locking-mode must be ** set on all attached databases, as well as the main db file. ** ** Also, the sqlite3.dfltLockMode variable is set so that ** any subsequently attached databases also use the specified ** locking mode. */ int ii; assert(pDb==&db->aDb[0]); for(ii=2; ii<db->nDb; ii++){ pPager = sqlite3BtreePager(db->aDb[ii].pBt); sqlite3PagerLockingMode(pPager, eMode); } db->dfltLockMode = (u8)eMode; } pPager = sqlite3BtreePager(pDb->pBt); eMode = sqlite3PagerLockingMode(pPager, eMode); } assert( eMode==PAGER_LOCKINGMODE_NORMAL || eMode==PAGER_LOCKINGMODE_EXCLUSIVE ); if( eMode==PAGER_LOCKINGMODE_EXCLUSIVE ){ zRet = "exclusive"; } returnSingleText(v, zRet); break; } /* ** PRAGMA [schema.]journal_mode ** PRAGMA [schema.]journal_mode = ** (delete|persist|off|truncate|memory|wal|off) */ case PragTyp_JOURNAL_MODE: { int eMode; /* One of the PAGER_JOURNALMODE_XXX symbols */ int ii; /* Loop counter */ if( zRight==0 ){ /* If there is no "=MODE" part of the pragma, do a query for the ** current mode */ eMode = PAGER_JOURNALMODE_QUERY; }else{ const char *zMode; int n = sqlite3Strlen30(zRight); for(eMode=0; (zMode = sqlite3JournalModename(eMode))!=0; eMode++){ if( sqlite3StrNICmp(zRight, zMode, n)==0 ) break; } if( !zMode ){ /* If the "=MODE" part does not match any known journal mode, ** then do a query */ eMode = PAGER_JOURNALMODE_QUERY; } if( eMode==PAGER_JOURNALMODE_OFF && (db->flags & SQLITE_Defensive)!=0 ){ /* Do not allow journal-mode "OFF" in defensive since the database ** can become corrupted using ordinary SQL when the journal is off */ eMode = PAGER_JOURNALMODE_QUERY; } } if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){ /* Convert "PRAGMA journal_mode" into "PRAGMA main.journal_mode" */ iDb = 0; pId2->n = 1; } for(ii=db->nDb-1; ii>=0; ii--){ if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ sqlite3VdbeUsesBtree(v, ii); sqlite3VdbeAddOp3(v, OP_JournalMode, ii, 1, eMode); } } sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); break; } /* ** PRAGMA [schema.]journal_size_limit ** PRAGMA [schema.]journal_size_limit=N ** ** Get or set the size limit on rollback journal files. */ case PragTyp_JOURNAL_SIZE_LIMIT: { Pager *pPager = sqlite3BtreePager(pDb->pBt); i64 iLimit = -2; if( zRight ){ sqlite3DecOrHexToI64(zRight, &iLimit); if( iLimit<-1 ) iLimit = -1; } iLimit = sqlite3PagerJournalSizeLimit(pPager, iLimit); returnSingleInt(v, iLimit); break; } #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ /* ** PRAGMA [schema.]auto_vacuum ** PRAGMA [schema.]auto_vacuum=N ** ** Get or set the value of the database 'auto-vacuum' parameter. ** The value is one of: 0 NONE 1 FULL 2 INCREMENTAL */ #ifndef SQLITE_OMIT_AUTOVACUUM case PragTyp_AUTO_VACUUM: { Btree *pBt = pDb->pBt; assert( pBt!=0 ); if( !zRight ){ returnSingleInt(v, sqlite3BtreeGetAutoVacuum(pBt)); }else{ int eAuto = getAutoVacuum(zRight); assert( eAuto>=0 && eAuto<=2 ); db->nextAutovac = (u8)eAuto; /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created ** as an auto-vacuum capable db. */ rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto); if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ /* When setting the auto_vacuum mode to either "full" or ** "incremental", write the value of meta[6] in the database ** file. Before writing to meta[6], check that meta[3] indicates ** that this really is an auto-vacuum capable database. */ static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList setMeta6[] = { { OP_Transaction, 0, 1, 0}, /* 0 */ { OP_ReadCookie, 0, 1, BTREE_LARGEST_ROOT_PAGE}, { OP_If, 1, 0, 0}, /* 2 */ { OP_Halt, SQLITE_OK, OE_Abort, 0}, /* 3 */ { OP_SetCookie, 0, BTREE_INCR_VACUUM, 0}, /* 4 */ }; VdbeOp *aOp; int iAddr = sqlite3VdbeCurrentAddr(v); sqlite3VdbeVerifyNoMallocRequired(v, ArraySize(setMeta6)); aOp = sqlite3VdbeAddOpList(v, ArraySize(setMeta6), setMeta6, iLn); if( ONLY_IF_REALLOC_STRESS(aOp==0) ) break; aOp[0].p1 = iDb; aOp[1].p1 = iDb; aOp[2].p2 = iAddr+4; aOp[4].p1 = iDb; aOp[4].p3 = eAuto - 1; sqlite3VdbeUsesBtree(v, iDb); } } break; } #endif /* ** PRAGMA [schema.]incremental_vacuum(N) ** ** Do N steps of incremental vacuuming on a database. */ #ifndef SQLITE_OMIT_AUTOVACUUM case PragTyp_INCREMENTAL_VACUUM: { int iLimit, addr; if( zRight==0 || !sqlite3GetInt32(zRight, &iLimit) || iLimit<=0 ){ iLimit = 0x7fffffff; } sqlite3BeginWriteOperation(pParse, 0, iDb); sqlite3VdbeAddOp2(v, OP_Integer, iLimit, 1); addr = sqlite3VdbeAddOp1(v, OP_IncrVacuum, iDb); VdbeCoverage(v); sqlite3VdbeAddOp1(v, OP_ResultRow, 1); sqlite3VdbeAddOp2(v, OP_AddImm, 1, -1); sqlite3VdbeAddOp2(v, OP_IfPos, 1, addr); VdbeCoverage(v); sqlite3VdbeJumpHere(v, addr); break; } #endif #ifndef SQLITE_OMIT_PAGER_PRAGMAS /* ** PRAGMA [schema.]cache_size ** PRAGMA [schema.]cache_size=N ** ** The first form reports the current local setting for the ** page cache size. The second form sets the local ** page cache size value. If N is positive then that is the ** number of pages in the cache. If N is negative, then the ** number of pages is adjusted so that the cache uses -N kibibytes ** of memory. */ case PragTyp_CACHE_SIZE: { assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( !zRight ){ returnSingleInt(v, pDb->pSchema->cache_size); }else{ int size = sqlite3Atoi(zRight); pDb->pSchema->cache_size = size; sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size); } break; } /* ** PRAGMA [schema.]cache_spill ** PRAGMA cache_spill=BOOLEAN ** PRAGMA [schema.]cache_spill=N ** ** The first form reports the current local setting for the ** page cache spill size. The second form turns cache spill on ** or off. When turnning cache spill on, the size is set to the ** current cache_size. The third form sets a spill size that ** may be different form the cache size. ** If N is positive then that is the ** number of pages in the cache. If N is negative, then the ** number of pages is adjusted so that the cache uses -N kibibytes ** of memory. ** ** If the number of cache_spill pages is less then the number of ** cache_size pages, no spilling occurs until the page count exceeds ** the number of cache_size pages. ** ** The cache_spill=BOOLEAN setting applies to all attached schemas, ** not just the schema specified. */ case PragTyp_CACHE_SPILL: { assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( !zRight ){ returnSingleInt(v, (db->flags & SQLITE_CacheSpill)==0 ? 0 : sqlite3BtreeSetSpillSize(pDb->pBt,0)); }else{ int size = 1; if( sqlite3GetInt32(zRight, &size) ){ sqlite3BtreeSetSpillSize(pDb->pBt, size); } if( sqlite3GetBoolean(zRight, size!=0) ){ db->flags |= SQLITE_CacheSpill; }else{ db->flags &= ~(u64)SQLITE_CacheSpill; } setAllPagerFlags(db); } break; } /* ** PRAGMA [schema.]mmap_size(N) ** ** Used to set mapping size limit. The mapping size limit is ** used to limit the aggregate size of all memory mapped regions of the ** database file. If this parameter is set to zero, then memory mapping ** is not used at all. If N is negative, then the default memory map ** limit determined by sqlite3_config(SQLITE_CONFIG_MMAP_SIZE) is set. ** The parameter N is measured in bytes. ** ** This value is advisory. The underlying VFS is free to memory map ** as little or as much as it wants. Except, if N is set to 0 then the ** upper layers will never invoke the xFetch interfaces to the VFS. */ case PragTyp_MMAP_SIZE: { sqlite3_int64 sz; #if SQLITE_MAX_MMAP_SIZE>0 assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( zRight ){ int ii; sqlite3DecOrHexToI64(zRight, &sz); if( sz<0 ) sz = sqlite3GlobalConfig.szMmap; if( pId2->n==0 ) db->szMmap = sz; for(ii=db->nDb-1; ii>=0; ii--){ if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ sqlite3BtreeSetMmapLimit(db->aDb[ii].pBt, sz); } } } sz = -1; rc = sqlite3_file_control(db, zDb, SQLITE_FCNTL_MMAP_SIZE, &sz); #else sz = 0; rc = SQLITE_OK; #endif if( rc==SQLITE_OK ){ returnSingleInt(v, sz); }else if( rc!=SQLITE_NOTFOUND ){ pParse->nErr++; pParse->rc = rc; } break; } /* ** PRAGMA temp_store ** PRAGMA temp_store = "default"|"memory"|"file" ** ** Return or set the local value of the temp_store flag. Changing ** the local value does not make changes to the disk file and the default ** value will be restored the next time the database is opened. ** ** Note that it is possible for the library compile-time options to ** override this setting */ case PragTyp_TEMP_STORE: { if( !zRight ){ returnSingleInt(v, db->temp_store); }else{ changeTempStorage(pParse, zRight); } break; } /* ** PRAGMA temp_store_directory ** PRAGMA temp_store_directory = ""|"directory_name" ** ** Return or set the local value of the temp_store_directory flag. Changing ** the value sets a specific directory to be used for temporary files. ** Setting to a null string reverts to the default temporary directory search. ** If temporary directory is changed, then invalidateTempStorage. ** */ case PragTyp_TEMP_STORE_DIRECTORY: { if( !zRight ){ returnSingleText(v, sqlite3_temp_directory); }else{ #ifndef SQLITE_OMIT_WSD if( zRight[0] ){ int res; rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); goto pragma_out; } } if( SQLITE_TEMP_STORE==0 || (SQLITE_TEMP_STORE==1 && db->temp_store<=1) || (SQLITE_TEMP_STORE==2 && db->temp_store==1) ){ invalidateTempStorage(pParse); } sqlite3_free(sqlite3_temp_directory); if( zRight[0] ){ sqlite3_temp_directory = sqlite3_mprintf("%s", zRight); }else{ sqlite3_temp_directory = 0; } #endif /* SQLITE_OMIT_WSD */ } break; } #if SQLITE_OS_WIN /* ** PRAGMA data_store_directory ** PRAGMA data_store_directory = ""|"directory_name" ** ** Return or set the local value of the data_store_directory flag. Changing ** the value sets a specific directory to be used for database files that ** were specified with a relative pathname. Setting to a null string reverts ** to the default database directory, which for database files specified with ** a relative path will probably be based on the current directory for the ** process. Database file specified with an absolute path are not impacted ** by this setting, regardless of its value. ** */ case PragTyp_DATA_STORE_DIRECTORY: { if( !zRight ){ returnSingleText(v, sqlite3_data_directory); }else{ #ifndef SQLITE_OMIT_WSD if( zRight[0] ){ int res; rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); goto pragma_out; } } sqlite3_free(sqlite3_data_directory); if( zRight[0] ){ sqlite3_data_directory = sqlite3_mprintf("%s", zRight); }else{ sqlite3_data_directory = 0; } #endif /* SQLITE_OMIT_WSD */ } break; } #endif #if SQLITE_ENABLE_LOCKING_STYLE /* ** PRAGMA [schema.]lock_proxy_file ** PRAGMA [schema.]lock_proxy_file = ":auto:"|"lock_file_path" ** ** Return or set the value of the lock_proxy_file flag. Changing ** the value sets a specific file to be used for database access locks. ** */ case PragTyp_LOCK_PROXY_FILE: { if( !zRight ){ Pager *pPager = sqlite3BtreePager(pDb->pBt); char *proxy_file_path = NULL; sqlite3_file *pFile = sqlite3PagerFile(pPager); sqlite3OsFileControlHint(pFile, SQLITE_GET_LOCKPROXYFILE, &proxy_file_path); returnSingleText(v, proxy_file_path); }else{ Pager *pPager = sqlite3BtreePager(pDb->pBt); sqlite3_file *pFile = sqlite3PagerFile(pPager); int res; if( zRight[0] ){ res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, zRight); } else { res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, NULL); } if( res!=SQLITE_OK ){ sqlite3ErrorMsg(pParse, "failed to set lock proxy file"); goto pragma_out; } } break; } #endif /* SQLITE_ENABLE_LOCKING_STYLE */ /* ** PRAGMA [schema.]synchronous ** PRAGMA [schema.]synchronous=OFF|ON|NORMAL|FULL|EXTRA ** ** Return or set the local value of the synchronous flag. Changing ** the local value does not make changes to the disk file and the ** default value will be restored the next time the database is ** opened. */ case PragTyp_SYNCHRONOUS: { if( !zRight ){ returnSingleInt(v, pDb->safety_level-1); }else{ if( !db->autoCommit ){ sqlite3ErrorMsg(pParse, "Safety level may not be changed inside a transaction"); }else if( iDb!=1 ){ int iLevel = (getSafetyLevel(zRight,0,1)+1) & PAGER_SYNCHRONOUS_MASK; if( iLevel==0 ) iLevel = 1; pDb->safety_level = iLevel; pDb->bSyncSet = 1; setAllPagerFlags(db); } } break; } #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ #ifndef SQLITE_OMIT_FLAG_PRAGMAS case PragTyp_FLAG: { if( zRight==0 ){ setPragmaResultColumnNames(v, pPragma); returnSingleInt(v, (db->flags & pPragma->iArg)!=0 ); }else{ u64 mask = pPragma->iArg; /* Mask of bits to set or clear. */ if( db->autoCommit==0 ){ /* Foreign key support may not be enabled or disabled while not ** in auto-commit mode. */ mask &= ~(SQLITE_ForeignKeys); } #if SQLITE_USER_AUTHENTICATION if( db->auth.authLevel==UAUTH_User ){ /* Do not allow non-admin users to modify the schema arbitrarily */ mask &= ~(SQLITE_WriteSchema); } #endif if( sqlite3GetBoolean(zRight, 0) ){ db->flags |= mask; }else{ db->flags &= ~mask; if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0; } /* Many of the flag-pragmas modify the code generated by the SQL ** compiler (eg. count_changes). So add an opcode to expire all ** compiled SQL statements after modifying a pragma value. */ sqlite3VdbeAddOp0(v, OP_Expire); setAllPagerFlags(db); } break; } #endif /* SQLITE_OMIT_FLAG_PRAGMAS */ #ifndef SQLITE_OMIT_SCHEMA_PRAGMAS /* ** PRAGMA table_info(<table>) ** ** Return a single row for each column of the named table. The columns of ** the returned data set are: ** ** cid: Column id (numbered from left to right, starting at 0) ** name: Column name ** type: Column declaration type. ** notnull: True if 'NOT NULL' is part of column declaration ** dflt_value: The default value for the column, if any. ** pk: Non-zero for PK fields. */ case PragTyp_TABLE_INFO: if( zRight ){ Table *pTab; pTab = sqlite3LocateTable(pParse, LOCATE_NOERR, zRight, zDb); if( pTab ){ int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema); int i, k; int nHidden = 0; Column *pCol; Index *pPk = sqlite3PrimaryKeyIndex(pTab); pParse->nMem = 7; sqlite3CodeVerifySchema(pParse, iTabDb); sqlite3ViewGetColumnNames(pParse, pTab); for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){ int isHidden = 0; if( pCol->colFlags & COLFLAG_NOINSERT ){ if( pPragma->iArg==0 ){ nHidden++; continue; } if( pCol->colFlags & COLFLAG_VIRTUAL ){ isHidden = 2; /* GENERATED ALWAYS AS ... VIRTUAL */ }else if( pCol->colFlags & COLFLAG_STORED ){ isHidden = 3; /* GENERATED ALWAYS AS ... STORED */ }else{ assert( pCol->colFlags & COLFLAG_HIDDEN ); isHidden = 1; /* HIDDEN */ } } if( (pCol->colFlags & COLFLAG_PRIMKEY)==0 ){ k = 0; }else if( pPk==0 ){ k = 1; }else{ for(k=1; k<=pTab->nCol && pPk->aiColumn[k-1]!=i; k++){} } assert( pCol->pDflt==0 || pCol->pDflt->op==TK_SPAN || isHidden>=2 ); sqlite3VdbeMultiLoad(v, 1, pPragma->iArg ? "issisii" : "issisi", i-nHidden, pCol->zName, sqlite3ColumnType(pCol,""), pCol->notNull ? 1 : 0, pCol->pDflt && isHidden<2 ? pCol->pDflt->u.zToken : 0, k, isHidden); } } } break; #ifdef SQLITE_DEBUG case PragTyp_STATS: { Index *pIdx; HashElem *i; pParse->nMem = 5; sqlite3CodeVerifySchema(pParse, iDb); for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){ Table *pTab = sqliteHashData(i); sqlite3VdbeMultiLoad(v, 1, "ssiii", pTab->zName, 0, pTab->szTabRow, pTab->nRowLogEst, pTab->tabFlags); for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ sqlite3VdbeMultiLoad(v, 2, "siiiX", pIdx->zName, pIdx->szIdxRow, pIdx->aiRowLogEst[0], pIdx->hasStat1); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 5); } } } break; #endif case PragTyp_INDEX_INFO: if( zRight ){ Index *pIdx; Table *pTab; pIdx = sqlite3FindIndex(db, zRight, zDb); if( pIdx==0 ){ /* If there is no index named zRight, check to see if there is a ** WITHOUT ROWID table named zRight, and if there is, show the ** structure of the PRIMARY KEY index for that table. */ pTab = sqlite3LocateTable(pParse, LOCATE_NOERR, zRight, zDb); if( pTab && !HasRowid(pTab) ){ pIdx = sqlite3PrimaryKeyIndex(pTab); } } if( pIdx ){ int iIdxDb = sqlite3SchemaToIndex(db, pIdx->pSchema); int i; int mx; if( pPragma->iArg ){ /* PRAGMA index_xinfo (newer version with more rows and columns) */ mx = pIdx->nColumn; pParse->nMem = 6; }else{ /* PRAGMA index_info (legacy version) */ mx = pIdx->nKeyCol; pParse->nMem = 3; } pTab = pIdx->pTable; sqlite3CodeVerifySchema(pParse, iIdxDb); assert( pParse->nMem<=pPragma->nPragCName ); for(i=0; i<mx; i++){ i16 cnum = pIdx->aiColumn[i]; sqlite3VdbeMultiLoad(v, 1, "iisX", i, cnum, cnum<0 ? 0 : pTab->aCol[cnum].zName); if( pPragma->iArg ){ sqlite3VdbeMultiLoad(v, 4, "isiX", pIdx->aSortOrder[i], pIdx->azColl[i], i<pIdx->nKeyCol); } sqlite3VdbeAddOp2(v, OP_ResultRow, 1, pParse->nMem); } } } break; case PragTyp_INDEX_LIST: if( zRight ){ Index *pIdx; Table *pTab; int i; pTab = sqlite3FindTable(db, zRight, zDb); if( pTab ){ int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema); pParse->nMem = 5; sqlite3CodeVerifySchema(pParse, iTabDb); for(pIdx=pTab->pIndex, i=0; pIdx; pIdx=pIdx->pNext, i++){ const char *azOrigin[] = { "c", "u", "pk" }; sqlite3VdbeMultiLoad(v, 1, "isisi", i, pIdx->zName, IsUniqueIndex(pIdx), azOrigin[pIdx->idxType], pIdx->pPartIdxWhere!=0); } } } break; case PragTyp_DATABASE_LIST: { int i; pParse->nMem = 3; for(i=0; i<db->nDb; i++){ if( db->aDb[i].pBt==0 ) continue; assert( db->aDb[i].zDbSName!=0 ); sqlite3VdbeMultiLoad(v, 1, "iss", i, db->aDb[i].zDbSName, sqlite3BtreeGetFilename(db->aDb[i].pBt)); } } break; case PragTyp_COLLATION_LIST: { int i = 0; HashElem *p; pParse->nMem = 2; for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){ CollSeq *pColl = (CollSeq *)sqliteHashData(p); sqlite3VdbeMultiLoad(v, 1, "is", i++, pColl->zName); } } break; #ifndef SQLITE_OMIT_INTROSPECTION_PRAGMAS case PragTyp_FUNCTION_LIST: { int i; HashElem *j; FuncDef *p; pParse->nMem = 2; for(i=0; i<SQLITE_FUNC_HASH_SZ; i++){ for(p=sqlite3BuiltinFunctions.a[i]; p; p=p->u.pHash ){ if( p->funcFlags & SQLITE_FUNC_INTERNAL ) continue; sqlite3VdbeMultiLoad(v, 1, "si", p->zName, 1); } } for(j=sqliteHashFirst(&db->aFunc); j; j=sqliteHashNext(j)){ p = (FuncDef*)sqliteHashData(j); sqlite3VdbeMultiLoad(v, 1, "si", p->zName, 0); } } break; #ifndef SQLITE_OMIT_VIRTUALTABLE case PragTyp_MODULE_LIST: { HashElem *j; pParse->nMem = 1; for(j=sqliteHashFirst(&db->aModule); j; j=sqliteHashNext(j)){ Module *pMod = (Module*)sqliteHashData(j); sqlite3VdbeMultiLoad(v, 1, "s", pMod->zName); } } break; #endif /* SQLITE_OMIT_VIRTUALTABLE */ case PragTyp_PRAGMA_LIST: { int i; for(i=0; i<ArraySize(aPragmaName); i++){ sqlite3VdbeMultiLoad(v, 1, "s", aPragmaName[i].zName); } } break; #endif /* SQLITE_INTROSPECTION_PRAGMAS */ #endif /* SQLITE_OMIT_SCHEMA_PRAGMAS */ #ifndef SQLITE_OMIT_FOREIGN_KEY case PragTyp_FOREIGN_KEY_LIST: if( zRight ){ FKey *pFK; Table *pTab; pTab = sqlite3FindTable(db, zRight, zDb); if( pTab ){ pFK = pTab->pFKey; if( pFK ){ int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema); int i = 0; pParse->nMem = 8; sqlite3CodeVerifySchema(pParse, iTabDb); while(pFK){ int j; for(j=0; j<pFK->nCol; j++){ sqlite3VdbeMultiLoad(v, 1, "iissssss", i, j, pFK->zTo, pTab->aCol[pFK->aCol[j].iFrom].zName, pFK->aCol[j].zCol, actionName(pFK->aAction[1]), /* ON UPDATE */ actionName(pFK->aAction[0]), /* ON DELETE */ "NONE"); } ++i; pFK = pFK->pNextFrom; } } } } break; #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ #ifndef SQLITE_OMIT_FOREIGN_KEY #ifndef SQLITE_OMIT_TRIGGER case PragTyp_FOREIGN_KEY_CHECK: { FKey *pFK; /* A foreign key constraint */ Table *pTab; /* Child table contain "REFERENCES" keyword */ Table *pParent; /* Parent table that child points to */ Index *pIdx; /* Index in the parent table */ int i; /* Loop counter: Foreign key number for pTab */ int j; /* Loop counter: Field of the foreign key */ HashElem *k; /* Loop counter: Next table in schema */ int x; /* result variable */ int regResult; /* 3 registers to hold a result row */ int regKey; /* Register to hold key for checking the FK */ int regRow; /* Registers to hold a row from pTab */ int addrTop; /* Top of a loop checking foreign keys */ int addrOk; /* Jump here if the key is OK */ int *aiCols; /* child to parent column mapping */ regResult = pParse->nMem+1; pParse->nMem += 4; regKey = ++pParse->nMem; regRow = ++pParse->nMem; k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash); while( k ){ int iTabDb; if( zRight ){ pTab = sqlite3LocateTable(pParse, 0, zRight, zDb); k = 0; }else{ pTab = (Table*)sqliteHashData(k); k = sqliteHashNext(k); } if( pTab==0 || pTab->pFKey==0 ) continue; iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema); sqlite3CodeVerifySchema(pParse, iTabDb); sqlite3TableLock(pParse, iTabDb, pTab->tnum, 0, pTab->zName); if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; sqlite3OpenTable(pParse, 0, iTabDb, pTab, OP_OpenRead); sqlite3VdbeLoadString(v, regResult, pTab->zName); for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ pParent = sqlite3FindTable(db, pFK->zTo, zDb); if( pParent==0 ) continue; pIdx = 0; sqlite3TableLock(pParse, iTabDb, pParent->tnum, 0, pParent->zName); x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, 0); if( x==0 ){ if( pIdx==0 ){ sqlite3OpenTable(pParse, i, iTabDb, pParent, OP_OpenRead); }else{ sqlite3VdbeAddOp3(v, OP_OpenRead, i, pIdx->tnum, iTabDb); sqlite3VdbeSetP4KeyInfo(pParse, pIdx); } }else{ k = 0; break; } } assert( pParse->nErr>0 || pFK==0 ); if( pFK ) break; if( pParse->nTab<i ) pParse->nTab = i; addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, 0); VdbeCoverage(v); for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ pParent = sqlite3FindTable(db, pFK->zTo, zDb); pIdx = 0; aiCols = 0; if( pParent ){ x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols); assert( x==0 ); } addrOk = sqlite3VdbeMakeLabel(pParse); /* Generate code to read the child key values into registers ** regRow..regRow+n. If any of the child key values are NULL, this ** row cannot cause an FK violation. Jump directly to addrOk in ** this case. */ for(j=0; j<pFK->nCol; j++){ int iCol = aiCols ? aiCols[j] : pFK->aCol[j].iFrom; sqlite3ExprCodeGetColumnOfTable(v, pTab, 0, iCol, regRow+j); sqlite3VdbeAddOp2(v, OP_IsNull, regRow+j, addrOk); VdbeCoverage(v); } /* Generate code to query the parent index for a matching parent ** key. If a match is found, jump to addrOk. */ if( pIdx ){ sqlite3VdbeAddOp4(v, OP_MakeRecord, regRow, pFK->nCol, regKey, sqlite3IndexAffinityStr(db,pIdx), pFK->nCol); sqlite3VdbeAddOp4Int(v, OP_Found, i, addrOk, regKey, 0); VdbeCoverage(v); }else if( pParent ){ int jmp = sqlite3VdbeCurrentAddr(v)+2; sqlite3VdbeAddOp3(v, OP_SeekRowid, i, jmp, regRow); VdbeCoverage(v); sqlite3VdbeGoto(v, addrOk); assert( pFK->nCol==1 ); } /* Generate code to report an FK violation to the caller. */ if( HasRowid(pTab) ){ sqlite3VdbeAddOp2(v, OP_Rowid, 0, regResult+1); }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, regResult+1); } sqlite3VdbeMultiLoad(v, regResult+2, "siX", pFK->zTo, i-1); sqlite3VdbeAddOp2(v, OP_ResultRow, regResult, 4); sqlite3VdbeResolveLabel(v, addrOk); sqlite3DbFree(db, aiCols); } sqlite3VdbeAddOp2(v, OP_Next, 0, addrTop+1); VdbeCoverage(v); sqlite3VdbeJumpHere(v, addrTop); } } break; #endif /* !defined(SQLITE_OMIT_TRIGGER) */ #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ #ifndef SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA /* Reinstall the LIKE and GLOB functions. The variant of LIKE ** used will be case sensitive or not depending on the RHS. */ case PragTyp_CASE_SENSITIVE_LIKE: { if( zRight ){ sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight, 0)); } } break; #endif /* SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA */ #ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX # define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100 #endif #ifndef SQLITE_OMIT_INTEGRITY_CHECK /* PRAGMA integrity_check ** PRAGMA integrity_check(N) ** PRAGMA quick_check ** PRAGMA quick_check(N) ** ** Verify the integrity of the database. ** ** The "quick_check" is reduced version of ** integrity_check designed to detect most database corruption ** without the overhead of cross-checking indexes. Quick_check ** is linear time wherease integrity_check is O(NlogN). */ case PragTyp_INTEGRITY_CHECK: { int i, j, addr, mxErr; int isQuick = (sqlite3Tolower(zLeft[0])=='q'); /* If the PRAGMA command was of the form "PRAGMA <db>.integrity_check", ** then iDb is set to the index of the database identified by <db>. ** In this case, the integrity of database iDb only is verified by ** the VDBE created below. ** ** Otherwise, if the command was simply "PRAGMA integrity_check" (or ** "PRAGMA quick_check"), then iDb is set to 0. In this case, set iDb ** to -1 here, to indicate that the VDBE should verify the integrity ** of all attached databases. */ assert( iDb>=0 ); assert( iDb==0 || pId2->z ); if( pId2->z==0 ) iDb = -1; /* Initialize the VDBE program */ pParse->nMem = 6; /* Set the maximum error count */ mxErr = SQLITE_INTEGRITY_CHECK_ERROR_MAX; if( zRight ){ sqlite3GetInt32(zRight, &mxErr); if( mxErr<=0 ){ mxErr = SQLITE_INTEGRITY_CHECK_ERROR_MAX; } } sqlite3VdbeAddOp2(v, OP_Integer, mxErr-1, 1); /* reg[1] holds errors left */ /* Do an integrity check on each database file */ for(i=0; i<db->nDb; i++){ HashElem *x; /* For looping over tables in the schema */ Hash *pTbls; /* Set of all tables in the schema */ int *aRoot; /* Array of root page numbers of all btrees */ int cnt = 0; /* Number of entries in aRoot[] */ int mxIdx = 0; /* Maximum number of indexes for any table */ if( OMIT_TEMPDB && i==1 ) continue; if( iDb>=0 && i!=iDb ) continue; sqlite3CodeVerifySchema(pParse, i); /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers ** for all tables and indices in the database. */ assert( sqlite3SchemaMutexHeld(db, i, 0) ); pTbls = &db->aDb[i].pSchema->tblHash; for(cnt=0, x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ Table *pTab = sqliteHashData(x); /* Current table */ Index *pIdx; /* An index on pTab */ int nIdx; /* Number of indexes on pTab */ if( HasRowid(pTab) ) cnt++; for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; } if( nIdx>mxIdx ) mxIdx = nIdx; } aRoot = sqlite3DbMallocRawNN(db, sizeof(int)*(cnt+1)); if( aRoot==0 ) break; for(cnt=0, x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ Table *pTab = sqliteHashData(x); Index *pIdx; if( HasRowid(pTab) ) aRoot[++cnt] = pTab->tnum; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ aRoot[++cnt] = pIdx->tnum; } } aRoot[0] = cnt; /* Make sure sufficient number of registers have been allocated */ pParse->nMem = MAX( pParse->nMem, 8+mxIdx ); sqlite3ClearTempRegCache(pParse); /* Do the b-tree integrity checks */ sqlite3VdbeAddOp4(v, OP_IntegrityCk, 2, cnt, 1, (char*)aRoot,P4_INTARRAY); sqlite3VdbeChangeP5(v, (u8)i); addr = sqlite3VdbeAddOp1(v, OP_IsNull, 2); VdbeCoverage(v); sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zDbSName), P4_DYNAMIC); sqlite3VdbeAddOp3(v, OP_Concat, 2, 3, 3); integrityCheckResultRow(v); sqlite3VdbeJumpHere(v, addr); /* Make sure all the indices are constructed correctly. */ for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ Table *pTab = sqliteHashData(x); Index *pIdx, *pPk; Index *pPrior = 0; int loopTop; int iDataCur, iIdxCur; int r1 = -1; if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */ pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenRead, 0, 1, 0, &iDataCur, &iIdxCur); /* reg[7] counts the number of entries in the table. ** reg[8+i] counts the number of entries in the i-th index */ sqlite3VdbeAddOp2(v, OP_Integer, 0, 7); for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ sqlite3VdbeAddOp2(v, OP_Integer, 0, 8+j); /* index entries counter */ } assert( pParse->nMem>=8+j ); assert( sqlite3NoTempsInRange(pParse,1,7+j) ); sqlite3VdbeAddOp2(v, OP_Rewind, iDataCur, 0); VdbeCoverage(v); loopTop = sqlite3VdbeAddOp2(v, OP_AddImm, 7, 1); if( !isQuick ){ /* Sanity check on record header decoding */ sqlite3VdbeAddOp3(v, OP_Column, iDataCur, pTab->nNVCol-1,3); sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG); } /* Verify that all NOT NULL columns really are NOT NULL */ for(j=0; j<pTab->nCol; j++){ char *zErr; int jmp2; if( j==pTab->iPKey ) continue; if( pTab->aCol[j].notNull==0 ) continue; sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3); sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG); jmp2 = sqlite3VdbeAddOp1(v, OP_NotNull, 3); VdbeCoverage(v); zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName, pTab->aCol[j].zName); sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC); integrityCheckResultRow(v); sqlite3VdbeJumpHere(v, jmp2); } /* Verify CHECK constraints */ if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ ExprList *pCheck = sqlite3ExprListDup(db, pTab->pCheck, 0); if( db->mallocFailed==0 ){ int addrCkFault = sqlite3VdbeMakeLabel(pParse); int addrCkOk = sqlite3VdbeMakeLabel(pParse); char *zErr; int k; pParse->iSelfTab = iDataCur + 1; for(k=pCheck->nExpr-1; k>0; k--){ sqlite3ExprIfFalse(pParse, pCheck->a[k].pExpr, addrCkFault, 0); } sqlite3ExprIfTrue(pParse, pCheck->a[0].pExpr, addrCkOk, SQLITE_JUMPIFNULL); sqlite3VdbeResolveLabel(v, addrCkFault); pParse->iSelfTab = 0; zErr = sqlite3MPrintf(db, "CHECK constraint failed in %s", pTab->zName); sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC); integrityCheckResultRow(v); sqlite3VdbeResolveLabel(v, addrCkOk); } sqlite3ExprListDelete(db, pCheck); } if( !isQuick ){ /* Omit the remaining tests for quick_check */ /* Validate index entries for the current row */ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ int jmp2, jmp3, jmp4, jmp5; int ckUniq = sqlite3VdbeMakeLabel(pParse); if( pPk==pIdx ) continue; r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3, pPrior, r1); pPrior = pIdx; sqlite3VdbeAddOp2(v, OP_AddImm, 8+j, 1);/* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, iIdxCur+j, ckUniq, r1, pIdx->nColumn); VdbeCoverage(v); sqlite3VdbeLoadString(v, 3, "row "); sqlite3VdbeAddOp3(v, OP_Concat, 7, 3, 3); sqlite3VdbeLoadString(v, 4, " missing from index "); sqlite3VdbeAddOp3(v, OP_Concat, 4, 3, 3); jmp5 = sqlite3VdbeLoadString(v, 4, pIdx->zName); sqlite3VdbeAddOp3(v, OP_Concat, 4, 3, 3); jmp4 = integrityCheckResultRow(v); sqlite3VdbeJumpHere(v, jmp2); /* For UNIQUE indexes, verify that only one entry exists with the ** current key. The entry is unique if (1) any column is NULL ** or (2) the next entry has a different key */ if( IsUniqueIndex(pIdx) ){ int uniqOk = sqlite3VdbeMakeLabel(pParse); int jmp6; int kk; for(kk=0; kk<pIdx->nKeyCol; kk++){ int iCol = pIdx->aiColumn[kk]; assert( iCol!=XN_ROWID && iCol<pTab->nCol ); if( iCol>=0 && pTab->aCol[iCol].notNull ) continue; sqlite3VdbeAddOp2(v, OP_IsNull, r1+kk, uniqOk); VdbeCoverage(v); } jmp6 = sqlite3VdbeAddOp1(v, OP_Next, iIdxCur+j); VdbeCoverage(v); sqlite3VdbeGoto(v, uniqOk); sqlite3VdbeJumpHere(v, jmp6); sqlite3VdbeAddOp4Int(v, OP_IdxGT, iIdxCur+j, uniqOk, r1, pIdx->nKeyCol); VdbeCoverage(v); sqlite3VdbeLoadString(v, 3, "non-unique entry in index "); sqlite3VdbeGoto(v, jmp5); sqlite3VdbeResolveLabel(v, uniqOk); } sqlite3VdbeJumpHere(v, jmp4); sqlite3ResolvePartIdxLabel(pParse, jmp3); } } sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v); sqlite3VdbeJumpHere(v, loopTop-1); #ifndef SQLITE_OMIT_BTREECOUNT if( !isQuick ){ sqlite3VdbeLoadString(v, 2, "wrong # of entries in index "); for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ if( pPk==pIdx ) continue; sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3); addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+j, 0, 3); VdbeCoverage(v); sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); sqlite3VdbeLoadString(v, 4, pIdx->zName); sqlite3VdbeAddOp3(v, OP_Concat, 4, 2, 3); integrityCheckResultRow(v); sqlite3VdbeJumpHere(v, addr); } } #endif /* SQLITE_OMIT_BTREECOUNT */ } } { static const int iLn = VDBE_OFFSET_LINENO(2); static const VdbeOpList endCode[] = { { OP_AddImm, 1, 0, 0}, /* 0 */ { OP_IfNotZero, 1, 4, 0}, /* 1 */ { OP_String8, 0, 3, 0}, /* 2 */ { OP_ResultRow, 3, 1, 0}, /* 3 */ { OP_Halt, 0, 0, 0}, /* 4 */ { OP_String8, 0, 3, 0}, /* 5 */ { OP_Goto, 0, 3, 0}, /* 6 */ }; VdbeOp *aOp; aOp = sqlite3VdbeAddOpList(v, ArraySize(endCode), endCode, iLn); if( aOp ){ aOp[0].p2 = 1-mxErr; aOp[2].p4type = P4_STATIC; aOp[2].p4.z = "ok"; aOp[5].p4type = P4_STATIC; aOp[5].p4.z = (char*)sqlite3ErrStr(SQLITE_CORRUPT); } sqlite3VdbeChangeP3(v, 0, sqlite3VdbeCurrentAddr(v)-2); } } break; #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ #ifndef SQLITE_OMIT_UTF16 /* ** PRAGMA encoding ** PRAGMA encoding = "utf-8"|"utf-16"|"utf-16le"|"utf-16be" ** ** In its first form, this pragma returns the encoding of the main ** database. If the database is not initialized, it is initialized now. ** ** The second form of this pragma is a no-op if the main database file ** has not already been initialized. In this case it sets the default ** encoding that will be used for the main database file if a new file ** is created. If an existing main database file is opened, then the ** default text encoding for the existing database is used. ** ** In all cases new databases created using the ATTACH command are ** created to use the same default text encoding as the main database. If ** the main database has not been initialized and/or created when ATTACH ** is executed, this is done before the ATTACH operation. ** ** In the second form this pragma sets the text encoding to be used in ** new database files created using this database handle. It is only ** useful if invoked immediately after the main database i */ case PragTyp_ENCODING: { static const struct EncName { char *zName; u8 enc; } encnames[] = { { "UTF8", SQLITE_UTF8 }, { "UTF-8", SQLITE_UTF8 }, /* Must be element [1] */ { "UTF-16le", SQLITE_UTF16LE }, /* Must be element [2] */ { "UTF-16be", SQLITE_UTF16BE }, /* Must be element [3] */ { "UTF16le", SQLITE_UTF16LE }, { "UTF16be", SQLITE_UTF16BE }, { "UTF-16", 0 }, /* SQLITE_UTF16NATIVE */ { "UTF16", 0 }, /* SQLITE_UTF16NATIVE */ { 0, 0 } }; const struct EncName *pEnc; if( !zRight ){ /* "PRAGMA encoding" */ if( sqlite3ReadSchema(pParse) ) goto pragma_out; assert( encnames[SQLITE_UTF8].enc==SQLITE_UTF8 ); assert( encnames[SQLITE_UTF16LE].enc==SQLITE_UTF16LE ); assert( encnames[SQLITE_UTF16BE].enc==SQLITE_UTF16BE ); returnSingleText(v, encnames[ENC(pParse->db)].zName); }else{ /* "PRAGMA encoding = XXX" */ /* Only change the value of sqlite.enc if the database handle is not ** initialized. If the main database exists, the new sqlite.enc value ** will be overwritten when the schema is next loaded. If it does not ** already exists, it will be created to use the new encoding value. */ if( !(DbHasProperty(db, 0, DB_SchemaLoaded)) || DbHasProperty(db, 0, DB_Empty) ){ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ SCHEMA_ENC(db) = ENC(db) = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE; break; } } if( !pEnc->zName ){ sqlite3ErrorMsg(pParse, "unsupported encoding: %s", zRight); } } } } break; #endif /* SQLITE_OMIT_UTF16 */ #ifndef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS /* ** PRAGMA [schema.]schema_version ** PRAGMA [schema.]schema_version = <integer> ** ** PRAGMA [schema.]user_version ** PRAGMA [schema.]user_version = <integer> ** ** PRAGMA [schema.]freelist_count ** ** PRAGMA [schema.]data_version ** ** PRAGMA [schema.]application_id ** PRAGMA [schema.]application_id = <integer> ** ** The pragma's schema_version and user_version are used to set or get ** the value of the schema-version and user-version, respectively. Both ** the schema-version and the user-version are 32-bit signed integers ** stored in the database header. ** ** The schema-cookie is usually only manipulated internally by SQLite. It ** is incremented by SQLite whenever the database schema is modified (by ** creating or dropping a table or index). The schema version is used by ** SQLite each time a query is executed to ensure that the internal cache ** of the schema used when compiling the SQL query matches the schema of ** the database against which the compiled query is actually executed. ** Subverting this mechanism by using "PRAGMA schema_version" to modify ** the schema-version is potentially dangerous and may lead to program ** crashes or database corruption. Use with caution! ** ** The user-version is not used internally by SQLite. It may be used by ** applications for any purpose. */ case PragTyp_HEADER_VALUE: { int iCookie = pPragma->iArg; /* Which cookie to read or write */ sqlite3VdbeUsesBtree(v, iDb); if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){ /* Write the specified cookie value */ static const VdbeOpList setCookie[] = { { OP_Transaction, 0, 1, 0}, /* 0 */ { OP_SetCookie, 0, 0, 0}, /* 1 */ }; VdbeOp *aOp; sqlite3VdbeVerifyNoMallocRequired(v, ArraySize(setCookie)); aOp = sqlite3VdbeAddOpList(v, ArraySize(setCookie), setCookie, 0); if( ONLY_IF_REALLOC_STRESS(aOp==0) ) break; aOp[0].p1 = iDb; aOp[1].p1 = iDb; aOp[1].p2 = iCookie; aOp[1].p3 = sqlite3Atoi(zRight); }else{ /* Read the specified cookie value */ static const VdbeOpList readCookie[] = { { OP_Transaction, 0, 0, 0}, /* 0 */ { OP_ReadCookie, 0, 1, 0}, /* 1 */ { OP_ResultRow, 1, 1, 0} }; VdbeOp *aOp; sqlite3VdbeVerifyNoMallocRequired(v, ArraySize(readCookie)); aOp = sqlite3VdbeAddOpList(v, ArraySize(readCookie),readCookie,0); if( ONLY_IF_REALLOC_STRESS(aOp==0) ) break; aOp[0].p1 = iDb; aOp[1].p1 = iDb; aOp[1].p3 = iCookie; sqlite3VdbeReusable(v); } } break; #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS /* ** PRAGMA compile_options ** ** Return the names of all compile-time options used in this build, ** one option per row. */ case PragTyp_COMPILE_OPTIONS: { int i = 0; const char *zOpt; pParse->nMem = 1; while( (zOpt = sqlite3_compileoption_get(i++))!=0 ){ sqlite3VdbeLoadString(v, 1, zOpt); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); } sqlite3VdbeReusable(v); } break; #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ #ifndef SQLITE_OMIT_WAL /* ** PRAGMA [schema.]wal_checkpoint = passive|full|restart|truncate ** ** Checkpoint the database. */ case PragTyp_WAL_CHECKPOINT: { int iBt = (pId2->z?iDb:SQLITE_MAX_ATTACHED); int eMode = SQLITE_CHECKPOINT_PASSIVE; if( zRight ){ if( sqlite3StrICmp(zRight, "full")==0 ){ eMode = SQLITE_CHECKPOINT_FULL; }else if( sqlite3StrICmp(zRight, "restart")==0 ){ eMode = SQLITE_CHECKPOINT_RESTART; }else if( sqlite3StrICmp(zRight, "truncate")==0 ){ eMode = SQLITE_CHECKPOINT_TRUNCATE; } } pParse->nMem = 3; sqlite3VdbeAddOp3(v, OP_Checkpoint, iBt, eMode, 1); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 3); } break; /* ** PRAGMA wal_autocheckpoint ** PRAGMA wal_autocheckpoint = N ** ** Configure a database connection to automatically checkpoint a database ** after accumulating N frames in the log. Or query for the current value ** of N. */ case PragTyp_WAL_AUTOCHECKPOINT: { if( zRight ){ sqlite3_wal_autocheckpoint(db, sqlite3Atoi(zRight)); } returnSingleInt(v, db->xWalCallback==sqlite3WalDefaultHook ? SQLITE_PTR_TO_INT(db->pWalArg) : 0); } break; #endif /* ** PRAGMA shrink_memory ** ** IMPLEMENTATION-OF: R-23445-46109 This pragma causes the database ** connection on which it is invoked to free up as much memory as it ** can, by calling sqlite3_db_release_memory(). */ case PragTyp_SHRINK_MEMORY: { sqlite3_db_release_memory(db); break; } /* ** PRAGMA optimize ** PRAGMA optimize(MASK) ** PRAGMA schema.optimize ** PRAGMA schema.optimize(MASK) ** ** Attempt to optimize the database. All schemas are optimized in the first ** two forms, and only the specified schema is optimized in the latter two. ** ** The details of optimizations performed by this pragma are expected ** to change and improve over time. Applications should anticipate that ** this pragma will perform new optimizations in future releases. ** ** The optional argument is a bitmask of optimizations to perform: ** ** 0x0001 Debugging mode. Do not actually perform any optimizations ** but instead return one line of text for each optimization ** that would have been done. Off by default. ** ** 0x0002 Run ANALYZE on tables that might benefit. On by default. ** See below for additional information. ** ** 0x0004 (Not yet implemented) Record usage and performance ** information from the current session in the ** database file so that it will be available to "optimize" ** pragmas run by future database connections. ** ** 0x0008 (Not yet implemented) Create indexes that might have ** been helpful to recent queries ** ** The default MASK is and always shall be 0xfffe. 0xfffe means perform all ** of the optimizations listed above except Debug Mode, including new ** optimizations that have not yet been invented. If new optimizations are ** ever added that should be off by default, those off-by-default ** optimizations will have bitmasks of 0x10000 or larger. ** ** DETERMINATION OF WHEN TO RUN ANALYZE ** ** In the current implementation, a table is analyzed if only if all of ** the following are true: ** ** (1) MASK bit 0x02 is set. ** ** (2) The query planner used sqlite_stat1-style statistics for one or ** more indexes of the table at some point during the lifetime of ** the current connection. ** ** (3) One or more indexes of the table are currently unanalyzed OR ** the number of rows in the table has increased by 25 times or more ** since the last time ANALYZE was run. ** ** The rules for when tables are analyzed are likely to change in ** future releases. */ case PragTyp_OPTIMIZE: { int iDbLast; /* Loop termination point for the schema loop */ int iTabCur; /* Cursor for a table whose size needs checking */ HashElem *k; /* Loop over tables of a schema */ Schema *pSchema; /* The current schema */ Table *pTab; /* A table in the schema */ Index *pIdx; /* An index of the table */ LogEst szThreshold; /* Size threshold above which reanalysis is needd */ char *zSubSql; /* SQL statement for the OP_SqlExec opcode */ u32 opMask; /* Mask of operations to perform */ if( zRight ){ opMask = (u32)sqlite3Atoi(zRight); if( (opMask & 0x02)==0 ) break; }else{ opMask = 0xfffe; } iTabCur = pParse->nTab++; for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){ if( iDb==1 ) continue; sqlite3CodeVerifySchema(pParse, iDb); pSchema = db->aDb[iDb].pSchema; for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ pTab = (Table*)sqliteHashData(k); /* If table pTab has not been used in a way that would benefit from ** having analysis statistics during the current session, then skip it. ** This also has the effect of skipping virtual tables and views */ if( (pTab->tabFlags & TF_StatsUsed)==0 ) continue; /* Reanalyze if the table is 25 times larger than the last analysis */ szThreshold = pTab->nRowLogEst + 46; assert( sqlite3LogEst(25)==46 ); for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ if( !pIdx->hasStat1 ){ szThreshold = 0; /* Always analyze if any index lacks statistics */ break; } } if( szThreshold ){ sqlite3OpenTable(pParse, iTabCur, iDb, pTab, OP_OpenRead); sqlite3VdbeAddOp3(v, OP_IfSmaller, iTabCur, sqlite3VdbeCurrentAddr(v)+2+(opMask&1), szThreshold); VdbeCoverage(v); } zSubSql = sqlite3MPrintf(db, "ANALYZE \"%w\".\"%w\"", db->aDb[iDb].zDbSName, pTab->zName); if( opMask & 0x01 ){ int r1 = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp4(v, OP_String8, 0, r1, 0, zSubSql, P4_DYNAMIC); sqlite3VdbeAddOp2(v, OP_ResultRow, r1, 1); }else{ sqlite3VdbeAddOp4(v, OP_SqlExec, 0, 0, 0, zSubSql, P4_DYNAMIC); } } } sqlite3VdbeAddOp0(v, OP_Expire); break; } /* ** PRAGMA busy_timeout ** PRAGMA busy_timeout = N ** ** Call sqlite3_busy_timeout(db, N). Return the current timeout value ** if one is set. If no busy handler or a different busy handler is set ** then 0 is returned. Setting the busy_timeout to 0 or negative ** disables the timeout. */ /*case PragTyp_BUSY_TIMEOUT*/ default: { assert( pPragma->ePragTyp==PragTyp_BUSY_TIMEOUT ); if( zRight ){ sqlite3_busy_timeout(db, sqlite3Atoi(zRight)); } returnSingleInt(v, db->busyTimeout); break; } /* ** PRAGMA soft_heap_limit ** PRAGMA soft_heap_limit = N ** ** IMPLEMENTATION-OF: R-26343-45930 This pragma invokes the ** sqlite3_soft_heap_limit64() interface with the argument N, if N is ** specified and is a non-negative integer. ** IMPLEMENTATION-OF: R-64451-07163 The soft_heap_limit pragma always ** returns the same integer that would be returned by the ** sqlite3_soft_heap_limit64(-1) C-language function. */ case PragTyp_SOFT_HEAP_LIMIT: { sqlite3_int64 N; if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ sqlite3_soft_heap_limit64(N); } returnSingleInt(v, sqlite3_soft_heap_limit64(-1)); break; } /* ** PRAGMA hard_heap_limit ** PRAGMA hard_heap_limit = N ** ** Invoke sqlite3_hard_heap_limit64() to query or set the hard heap ** limit. The hard heap limit can be activated or lowered by this ** pragma, but not raised or deactivated. Only the ** sqlite3_hard_heap_limit64() C-language API can raise or deactivate ** the hard heap limit. This allows an application to set a heap limit ** constraint that cannot be relaxed by an untrusted SQL script. */ case PragTyp_HARD_HEAP_LIMIT: { sqlite3_int64 N; if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ sqlite3_int64 iPrior = sqlite3_hard_heap_limit64(-1); if( N>0 && (iPrior==0 || iPrior>N) ) sqlite3_hard_heap_limit64(N); } returnSingleInt(v, sqlite3_hard_heap_limit64(-1)); break; } /* ** PRAGMA threads ** PRAGMA threads = N ** ** Configure the maximum number of worker threads. Return the new ** maximum, which might be less than requested. */ case PragTyp_THREADS: { sqlite3_int64 N; if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK && N>=0 ){ sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, (int)(N&0x7fffffff)); } returnSingleInt(v, sqlite3_limit(db, SQLITE_LIMIT_WORKER_THREADS, -1)); break; } #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) /* ** Report the current state of file logs for all databases */ case PragTyp_LOCK_STATUS: { static const char *const azLockName[] = { "unlocked", "shared", "reserved", "pending", "exclusive" }; int i; pParse->nMem = 2; for(i=0; i<db->nDb; i++){ Btree *pBt; const char *zState = "unknown"; int j; if( db->aDb[i].zDbSName==0 ) continue; pBt = db->aDb[i].pBt; if( pBt==0 || sqlite3BtreePager(pBt)==0 ){ zState = "closed"; }else if( sqlite3_file_control(db, i ? db->aDb[i].zDbSName : 0, SQLITE_FCNTL_LOCKSTATE, &j)==SQLITE_OK ){ zState = azLockName[j]; } sqlite3VdbeMultiLoad(v, 1, "ss", db->aDb[i].zDbSName, zState); } break; } #endif #ifdef SQLITE_HAS_CODEC /* Pragma iArg ** ---------- ------ ** key 0 ** rekey 1 ** hexkey 2 ** hexrekey 3 ** textkey 4 ** textrekey 5 */ case PragTyp_KEY: { if( zRight ){ char zBuf[40]; const char *zKey = zRight; int n; if( pPragma->iArg==2 || pPragma->iArg==3 ){ u8 iByte; int i; for(i=0, iByte=0; i<sizeof(zBuf)*2 && sqlite3Isxdigit(zRight[i]); i++){ iByte = (iByte<<4) + sqlite3HexToInt(zRight[i]); if( (i&1)!=0 ) zBuf[i/2] = iByte; } zKey = zBuf; n = i/2; }else{ n = pPragma->iArg<4 ? sqlite3Strlen30(zRight) : -1; } if( (pPragma->iArg & 1)==0 ){ rc = sqlite3_key_v2(db, zDb, zKey, n); }else{ rc = sqlite3_rekey_v2(db, zDb, zKey, n); } if( rc==SQLITE_OK && n!=0 ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "ok", SQLITE_STATIC); returnSingleText(v, "ok"); } } break; } #endif #if defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD) case PragTyp_ACTIVATE_EXTENSIONS: if( zRight ){ #ifdef SQLITE_HAS_CODEC if( sqlite3StrNICmp(zRight, "see-", 4)==0 ){ sqlite3_activate_see(&zRight[4]); } #endif #ifdef SQLITE_ENABLE_CEROD if( sqlite3StrNICmp(zRight, "cerod-", 6)==0 ){ sqlite3_activate_cerod(&zRight[6]); } #endif } break; #endif } /* End of the PRAGMA switch */ /* The following block is a no-op unless SQLITE_DEBUG is defined. Its only ** purpose is to execute assert() statements to verify that if the ** PragFlg_NoColumns1 flag is set and the caller specified an argument ** to the PRAGMA, the implementation has not added any OP_ResultRow ** instructions to the VM. */ if( (pPragma->mPragFlg & PragFlg_NoColumns1) && zRight ){ sqlite3VdbeVerifyNoResultRow(v); } pragma_out: sqlite3DbFree(db, zLeft); sqlite3DbFree(db, zRight); }
8849
True
1
CVE-2019-19646
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/sqlite/sqlite/commit/ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd', 'name': 'https://github.com/sqlite/sqlite/commit/ebd70eedd5d6e6a890a670b5ee874a5eae86b4dd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sqlite/sqlite/commit/926f796e8feec15f3836aa0a060ed906f8ae04d3', 'name': 'https://github.com/sqlite/sqlite/commit/926f796e8feec15f3836aa0a060ed906f8ae04d3', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.sqlite.org/', 'name': 'https://www.sqlite.org/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20191223-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.tenable.com/security/tns-2021-14', 'name': 'https://www.tenable.com/security/tns-2021-14', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-754'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.30.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tenable:tenable.sc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.19.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'pragma.c in SQLite through 3.30.1 mishandles NOT NULL in an integrity_check PRAGMA command in certain cases of generated columns.'}]
2022-04-15T16:15Z
2019-12-09T19:15Z
Improper Check for Unusual or Exceptional Conditions
The software does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.
The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability. Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.
https://cwe.mitre.org/data/definitions/754.html
0
drh
2019-12-09 17:14:48+00:00
Ensure that the SrcList_item.colUsed field is set correctly (set to have a 1 for all columns of the table) when a generated column appears in the USING clause of a join. FossilOrigin-Name: 1923efb283e8840fa7436eb20b9d2174ef7cace1690d3b97b572a0db2048b8e3
926f796e8feec15f3836aa0a060ed906f8ae04d3
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
sqlite3CreateColumnExpr
sqlite3CreateColumnExpr( sqlite3 * db , SrcList * pSrc , int iSrc , int iCol)
['db', 'pSrc', 'iSrc', 'iCol']
Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){ Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0); if( p ){ struct SrcList_item *pItem = &pSrc->a[iSrc]; p->y.pTab = pItem->pTab; p->iTable = pItem->iCursor; if( p->y.pTab->iPKey==iCol ){ p->iColumn = -1; }else{ p->iColumn = (ynVar)iCol; testcase( iCol==BMS ); testcase( iCol==BMS-1 ); pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol); } } return p; }
146
True
1
CVE-2019-19923
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/sqlite/sqlite/commit/396afe6f6aa90a31303c183e11b2b2d4b7956b35', 'name': 'https://github.com/sqlite/sqlite/commit/396afe6f6aa90a31303c183e11b2b2d4b7956b35', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'https://security.netapp.com/advisory/ntap-20200114-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200114-0003/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00010.html', 'name': 'openSUSE-SU-2020:0189', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00015.html', 'name': 'openSUSE-SU-2020:0210', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2020:0514', 'name': 'RHSA-2020:0514', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00025.html', 'name': 'openSUSE-SU-2020:0233', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4638', 'name': 'DSA-4638', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': ['Broken Link']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:6.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:suse:package_hub:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:suse:linux_enterprise:12.0:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opensuse:backports_sle:15.0:sp1:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'flattenSubquery in select.c in SQLite 3.30.1 mishandles certain uses of SELECT DISTINCT involving a LEFT JOIN in which the right-hand side is a view. This can cause a NULL pointer dereference (or incorrect results).'}]
2022-04-15T16:18Z
2019-12-24T16: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
drh
2019-12-18 20:51:58+00:00
Continue to back away from the LEFT JOIN optimization of check-in [41c27bc0ff1d3135] by disallowing query flattening if the outer query is DISTINCT. Without this fix, if an index scan is run on the table within the view on the right-hand side of the LEFT JOIN, stale result registers might be accessed yielding incorrect results, and/or an OP_IfNullRow opcode might be invoked on the un-opened table, resulting in a NULL-pointer dereference. This problem was found by the Yongheng and Rui fuzzer. FossilOrigin-Name: 862974312edf00e9d1068115d1a39b7235b7db68b6d86b81d38a12f025a4748e
396afe6f6aa90a31303c183e11b2b2d4b7956b35
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
flattenSubquery
flattenSubquery( Parse * pParse , Select * p , int iFrom , int isAgg)
['pParse', 'p', 'iFrom', 'isAgg']
static int flattenSubquery( Parse *pParse, /* Parsing context */ Select *p, /* The parent or outer SELECT statement */ int iFrom, /* Index in p->pSrc->a[] of the inner subquery */ int isAgg /* True if outer SELECT uses aggregate functions */ ){ const char *zSavedAuthContext = pParse->zAuthContext; Select *pParent; /* Current UNION ALL term of the other query */ Select *pSub; /* The inner query or "subquery" */ Select *pSub1; /* Pointer to the rightmost select in sub-query */ SrcList *pSrc; /* The FROM clause of the outer query */ SrcList *pSubSrc; /* The FROM clause of the subquery */ int iParent; /* VDBE cursor number of the pSub result set temp table */ int iNewParent = -1;/* Replacement table for iParent */ int isLeftJoin = 0; /* True if pSub is the right side of a LEFT JOIN */ int i; /* Loop counter */ Expr *pWhere; /* The WHERE clause */ struct SrcList_item *pSubitem; /* The subquery */ sqlite3 *db = pParse->db; /* Check to see if flattening is permitted. Return 0 if not. */ assert( p!=0 ); assert( p->pPrior==0 ); if( OptimizationDisabled(db, SQLITE_QueryFlattener) ) return 0; pSrc = p->pSrc; assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc ); pSubitem = &pSrc->a[iFrom]; iParent = pSubitem->iCursor; pSub = pSubitem->pSelect; assert( pSub!=0 ); #ifndef SQLITE_OMIT_WINDOWFUNC if( p->pWin || pSub->pWin ) return 0; /* Restriction (25) */ #endif pSubSrc = pSub->pSrc; assert( pSubSrc ); /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET ** because they could be computed at compile-time. But when LIMIT and OFFSET ** became arbitrary expressions, we were forced to add restrictions (13) ** and (14). */ if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */ if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){ return 0; /* Restriction (15) */ } if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */ if( pSub->selFlags & SF_Distinct ) return 0; /* Restriction (4) */ if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){ return 0; /* Restrictions (8)(9) */ } if( p->pOrderBy && pSub->pOrderBy ){ return 0; /* Restriction (11) */ } if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */ if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */ if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){ return 0; /* Restriction (21) */ } if( pSub->selFlags & (SF_Recursive) ){ return 0; /* Restrictions (22) */ } /* ** If the subquery is the right operand of a LEFT JOIN, then the ** subquery may not be a join itself (3a). Example of why this is not ** allowed: ** ** t1 LEFT OUTER JOIN (t2 JOIN t3) ** ** If we flatten the above, we would get ** ** (t1 LEFT OUTER JOIN t2) JOIN t3 ** ** which is not at all the same thing. ** ** If the subquery is the right operand of a LEFT JOIN, then the outer ** query cannot be an aggregate. (3c) This is an artifact of the way ** aggregates are processed - there is no mechanism to determine if ** the LEFT JOIN table should be all-NULL. ** ** See also tickets #306, #350, and #3300. */ if( (pSubitem->fg.jointype & JT_OUTER)!=0 ){ isLeftJoin = 1; if( pSubSrc->nSrc>1 || isAgg || IsVirtual(pSubSrc->a[0].pTab) ){ /* (3a) (3c) (3b) */ return 0; } } #ifdef SQLITE_EXTRA_IFNULLROW else if( iFrom>0 && !isAgg ){ /* Setting isLeftJoin to -1 causes OP_IfNullRow opcodes to be generated for ** every reference to any result column from subquery in a join, even ** though they are not necessary. This will stress-test the OP_IfNullRow ** opcode. */ isLeftJoin = -1; } #endif /* Restriction (17): If the sub-query is a compound SELECT, then it must ** use only the UNION ALL operator. And none of the simple select queries ** that make up the compound SELECT are allowed to be aggregate or distinct ** queries. */ if( pSub->pPrior ){ if( pSub->pOrderBy ){ return 0; /* Restriction (20) */ } if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){ return 0; /* (17d1), (17d2), or (17d3) */ } for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){ testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct ); testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Aggregate ); assert( pSub->pSrc!=0 ); assert( pSub->pEList->nExpr==pSub1->pEList->nExpr ); if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 /* (17b) */ || (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */ || pSub1->pSrc->nSrc<1 /* (17c) */ ){ return 0; } testcase( pSub1->pSrc->nSrc>1 ); } /* Restriction (18). */ if( p->pOrderBy ){ int ii; for(ii=0; ii<p->pOrderBy->nExpr; ii++){ if( p->pOrderBy->a[ii].u.x.iOrderByCol==0 ) return 0; } } } /* Ex-restriction (23): ** The only way that the recursive part of a CTE can contain a compound ** subquery is for the subquery to be one term of a join. But if the ** subquery is a join, then the flattening has already been stopped by ** restriction (17d3) */ assert( (p->selFlags & SF_Recursive)==0 || pSub->pPrior==0 ); /***** If we reach this point, flattening is permitted. *****/ SELECTTRACE(1,pParse,p,("flatten %u.%p from term %d\n", pSub->selId, pSub, iFrom)); /* Authorize the subquery */ pParse->zAuthContext = pSubitem->zName; TESTONLY(i =) sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0); testcase( i==SQLITE_DENY ); pParse->zAuthContext = zSavedAuthContext; /* If the sub-query is a compound SELECT statement, then (by restrictions ** 17 and 18 above) it must be a UNION ALL and the parent query must ** be of the form: ** ** SELECT <expr-list> FROM (<sub-query>) <where-clause> ** ** followed by any ORDER BY, LIMIT and/or OFFSET clauses. This block ** creates N-1 copies of the parent query without any ORDER BY, LIMIT or ** OFFSET clauses and joins them to the left-hand-side of the original ** using UNION ALL operators. In this case N is the number of simple ** select statements in the compound sub-query. ** ** Example: ** ** SELECT a+1 FROM ( ** SELECT x FROM tab ** UNION ALL ** SELECT y FROM tab ** UNION ALL ** SELECT abs(z*2) FROM tab2 ** ) WHERE a!=5 ORDER BY 1 ** ** Transformed into: ** ** SELECT x+1 FROM tab WHERE x+1!=5 ** UNION ALL ** SELECT y+1 FROM tab WHERE y+1!=5 ** UNION ALL ** SELECT abs(z*2)+1 FROM tab2 WHERE abs(z*2)+1!=5 ** ORDER BY 1 ** ** We call this the "compound-subquery flattening". */ for(pSub=pSub->pPrior; pSub; pSub=pSub->pPrior){ Select *pNew; ExprList *pOrderBy = p->pOrderBy; Expr *pLimit = p->pLimit; Select *pPrior = p->pPrior; p->pOrderBy = 0; p->pSrc = 0; p->pPrior = 0; p->pLimit = 0; pNew = sqlite3SelectDup(db, p, 0); p->pLimit = pLimit; p->pOrderBy = pOrderBy; p->pSrc = pSrc; p->op = TK_ALL; if( pNew==0 ){ p->pPrior = pPrior; }else{ pNew->pPrior = pPrior; if( pPrior ) pPrior->pNext = pNew; pNew->pNext = p; p->pPrior = pNew; SELECTTRACE(2,pParse,p,("compound-subquery flattener" " creates %u as peer\n",pNew->selId)); } if( db->mallocFailed ) return 1; } /* Begin flattening the iFrom-th entry of the FROM clause ** in the outer query. */ pSub = pSub1 = pSubitem->pSelect; /* Delete the transient table structure associated with the ** subquery */ sqlite3DbFree(db, pSubitem->zDatabase); sqlite3DbFree(db, pSubitem->zName); sqlite3DbFree(db, pSubitem->zAlias); pSubitem->zDatabase = 0; pSubitem->zName = 0; pSubitem->zAlias = 0; pSubitem->pSelect = 0; /* Defer deleting the Table object associated with the ** subquery until code generation is ** complete, since there may still exist Expr.pTab entries that ** refer to the subquery even after flattening. Ticket #3346. ** ** pSubitem->pTab is always non-NULL by test restrictions and tests above. */ if( ALWAYS(pSubitem->pTab!=0) ){ Table *pTabToDel = pSubitem->pTab; if( pTabToDel->nTabRef==1 ){ Parse *pToplevel = sqlite3ParseToplevel(pParse); pTabToDel->pNextZombie = pToplevel->pZombieTab; pToplevel->pZombieTab = pTabToDel; }else{ pTabToDel->nTabRef--; } pSubitem->pTab = 0; } /* The following loop runs once for each term in a compound-subquery ** flattening (as described above). If we are doing a different kind ** of flattening - a flattening other than a compound-subquery flattening - ** then this loop only runs once. ** ** This loop moves all of the FROM elements of the subquery into the ** the FROM clause of the outer query. Before doing this, remember ** the cursor number for the original outer query FROM element in ** iParent. The iParent cursor will never be used. Subsequent code ** will scan expressions looking for iParent references and replace ** those references with expressions that resolve to the subquery FROM ** elements we are now copying in. */ for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){ int nSubSrc; u8 jointype = 0; assert( pSub!=0 ); pSubSrc = pSub->pSrc; /* FROM clause of subquery */ nSubSrc = pSubSrc->nSrc; /* Number of terms in subquery FROM clause */ pSrc = pParent->pSrc; /* FROM clause of the outer query */ if( pSrc ){ assert( pParent==p ); /* First time through the loop */ jointype = pSubitem->fg.jointype; }else{ assert( pParent!=p ); /* 2nd and subsequent times through the loop */ pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0); if( pSrc==0 ) break; pParent->pSrc = pSrc; } /* The subquery uses a single slot of the FROM clause of the outer ** query. If the subquery has more than one element in its FROM clause, ** then expand the outer query to make space for it to hold all elements ** of the subquery. ** ** Example: ** ** SELECT * FROM tabA, (SELECT * FROM sub1, sub2), tabB; ** ** The outer query has 3 slots in its FROM clause. One slot of the ** outer query (the middle slot) is used by the subquery. The next ** block of code will expand the outer query FROM clause to 4 slots. ** The middle slot is expanded to two slots in order to make space ** for the two elements in the FROM clause of the subquery. */ if( nSubSrc>1 ){ pSrc = sqlite3SrcListEnlarge(pParse, pSrc, nSubSrc-1,iFrom+1); if( pSrc==0 ) break; pParent->pSrc = pSrc; } /* Transfer the FROM clause terms from the subquery into the ** outer query. */ for(i=0; i<nSubSrc; i++){ sqlite3IdListDelete(db, pSrc->a[i+iFrom].pUsing); assert( pSrc->a[i+iFrom].fg.isTabFunc==0 ); pSrc->a[i+iFrom] = pSubSrc->a[i]; iNewParent = pSubSrc->a[i].iCursor; memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); } pSrc->a[iFrom].fg.jointype = jointype; /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. ** ** Example: ** ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b; ** \ \_____________ subquery __________/ / ** \_____________________ outer query ______________________________/ ** ** We look at every expression in the outer query and every place we see ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". */ if( pSub->pOrderBy ){ /* At this point, any non-zero iOrderByCol values indicate that the ** ORDER BY column expression is identical to the iOrderByCol'th ** expression returned by SELECT statement pSub. Since these values ** do not necessarily correspond to columns in SELECT statement pParent, ** zero them before transfering the ORDER BY clause. ** ** Not doing this may cause an error if a subsequent call to this ** function attempts to flatten a compound sub-query into pParent ** (the only way this can happen is if the compound sub-query is ** currently part of pSub->pSrc). See ticket [d11a6e908f]. */ ExprList *pOrderBy = pSub->pOrderBy; for(i=0; i<pOrderBy->nExpr; i++){ pOrderBy->a[i].u.x.iOrderByCol = 0; } assert( pParent->pOrderBy==0 ); pParent->pOrderBy = pOrderBy; pSub->pOrderBy = 0; } pWhere = pSub->pWhere; pSub->pWhere = 0; if( isLeftJoin>0 ){ sqlite3SetJoinExpr(pWhere, iNewParent); } pParent->pWhere = sqlite3ExprAnd(pParse, pWhere, pParent->pWhere); if( db->mallocFailed==0 ){ SubstContext x; x.pParse = pParse; x.iTable = iParent; x.iNewTable = iNewParent; x.isLeftJoin = isLeftJoin; x.pEList = pSub->pEList; substSelect(&x, pParent, 0); } /* The flattened query is a compound if either the inner or the ** outer query is a compound. */ pParent->selFlags |= pSub->selFlags & SF_Compound; assert( (pSub->selFlags & SF_Distinct)==0 ); /* restriction (17b) */ /* ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; ** ** One is tempted to try to add a and b to combine the limits. But this ** does not work if either limit is negative. */ if( pSub->pLimit ){ pParent->pLimit = pSub->pLimit; pSub->pLimit = 0; } } /* Finially, delete what is left of the subquery and return ** success. */ sqlite3SelectDelete(db, pSub1); #if SELECTTRACE_ENABLED if( sqlite3SelectTrace & 0x100 ){ SELECTTRACE(0x100,pParse,p,("After flattening:\n")); sqlite3TreeViewSelect(0, p, 0); } #endif return 1; }
1534
True
1
CVE-2019-19924
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:P/A:N
NETWORK
LOW
NONE
NONE
PARTIAL
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
LOW
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/sqlite/sqlite/commit/8654186b0236d556aa85528c2573ee0b6ab71be3', 'name': 'https://github.com/sqlite/sqlite/commit/8654186b0236d556aa85528c2573ee0b6ab71be3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200114-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200114-0003/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': ['Broken Link']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E', 'name': '[bookkeeper-issues] 20210628 [GitHub] [bookkeeper] padma81 opened a new issue #2746: Security Vulnerabilities in CentOS 7 image, Upgrade image to CentOS 8', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E', 'name': '[bookkeeper-issues] 20210629 [GitHub] [bookkeeper] padma81 opened a new issue #2746: Security Vulnerabilities in CentOS 7 image, Upgrade image to CentOS 8', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-755'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apache:bookkeeper:4.12.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SQLite 3.30.1 mishandles certain parser-tree rewriting, related to expr.c, vdbeaux.c, and window.c. This is caused by incorrect sqlite3WindowRewrite() error handling.'}]
2022-04-15T16:18Z
2019-12-24T16:15Z
Improper Handling of Exceptional Conditions
The software does not handle or incorrectly handles an exceptional condition.
https://cwe.mitre.org/data/definitions/755.html
0
drh
2019-12-19 20:37:32+00:00
When an error occurs while rewriting the parser tree for window functions in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set, and make sure that this shuts down any subsequent code generation that might depend on the transformations that were implemented. This fixes a problem discovered by the Yongheng and Rui fuzzer. FossilOrigin-Name: e2bddcd4c55ba3cbe0130332679ff4b048630d0ced9a8899982edb5a3569ba7f
8654186b0236d556aa85528c2573ee0b6ab71be3
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
vdbeVComment
vdbeVComment( Vdbe * p , const char * zFormat , va_list ap)
['p', 'zFormat', 'ap']
static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){ assert( p->nOp>0 || p->aOp==0 ); assert( p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed ); if( p->nOp ){ assert( p->aOp ); sqlite3DbFree(p->db, p->aOp[p->nOp-1].zComment); p->aOp[p->nOp-1].zComment = sqlite3VMPrintf(p->db, zFormat, ap); } }
120
True
1
CVE-2019-19924
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:P/A:N
NETWORK
LOW
NONE
NONE
PARTIAL
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
LOW
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://github.com/sqlite/sqlite/commit/8654186b0236d556aa85528c2573ee0b6ab71be3', 'name': 'https://github.com/sqlite/sqlite/commit/8654186b0236d556aa85528c2573ee0b6ab71be3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200114-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200114-0003/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': ['Broken Link']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E', 'name': '[bookkeeper-issues] 20210628 [GitHub] [bookkeeper] padma81 opened a new issue #2746: Security Vulnerabilities in CentOS 7 image, Upgrade image to CentOS 8', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E', 'name': '[bookkeeper-issues] 20210629 [GitHub] [bookkeeper] padma81 opened a new issue #2746: Security Vulnerabilities in CentOS 7 image, Upgrade image to CentOS 8', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-755'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apache:bookkeeper:4.12.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_workbench:*:*:*:*:*:*:*:*', 'versionEndIncluding': '8.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'SQLite 3.30.1 mishandles certain parser-tree rewriting, related to expr.c, vdbeaux.c, and window.c. This is caused by incorrect sqlite3WindowRewrite() error handling.'}]
2022-04-15T16:18Z
2019-12-24T16:15Z
Improper Handling of Exceptional Conditions
The software does not handle or incorrectly handles an exceptional condition.
https://cwe.mitre.org/data/definitions/755.html
0
drh
2019-12-19 20:37:32+00:00
When an error occurs while rewriting the parser tree for window functions in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set, and make sure that this shuts down any subsequent code generation that might depend on the transformations that were implemented. This fixes a problem discovered by the Yongheng and Rui fuzzer. FossilOrigin-Name: e2bddcd4c55ba3cbe0130332679ff4b048630d0ced9a8899982edb5a3569ba7f
8654186b0236d556aa85528c2573ee0b6ab71be3
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
sqlite3WindowRewrite
sqlite3WindowRewrite( Parse * pParse , Select * p)
['pParse', 'p']
int sqlite3WindowRewrite(Parse *pParse, Select *p){ int rc = SQLITE_OK; if( p->pWin && p->pPrior==0 && (p->selFlags & SF_WinRewrite)==0 ){ Vdbe *v = sqlite3GetVdbe(pParse); sqlite3 *db = pParse->db; Select *pSub = 0; /* The subquery */ SrcList *pSrc = p->pSrc; Expr *pWhere = p->pWhere; ExprList *pGroupBy = p->pGroupBy; Expr *pHaving = p->pHaving; ExprList *pSort = 0; ExprList *pSublist = 0; /* Expression list for sub-query */ Window *pMWin = p->pWin; /* Master window object */ Window *pWin; /* Window object iterator */ Table *pTab; pTab = sqlite3DbMallocZero(db, sizeof(Table)); if( pTab==0 ){ return SQLITE_NOMEM; } p->pSrc = 0; p->pWhere = 0; p->pGroupBy = 0; p->pHaving = 0; p->selFlags &= ~SF_Aggregate; p->selFlags |= SF_WinRewrite; /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it ** redundant, remove the ORDER BY from the parent SELECT. */ pSort = sqlite3ExprListDup(db, pMWin->pPartition, 0); pSort = exprListAppendList(pParse, pSort, pMWin->pOrderBy, 1); if( pSort && p->pOrderBy && p->pOrderBy->nExpr<=pSort->nExpr ){ int nSave = pSort->nExpr; pSort->nExpr = p->pOrderBy->nExpr; if( sqlite3ExprListCompare(pSort, p->pOrderBy, -1)==0 ){ sqlite3ExprListDelete(db, p->pOrderBy); p->pOrderBy = 0; } pSort->nExpr = nSave; } /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ pMWin->iEphCsr = pParse->nTab++; pParse->nTab += 3; selectWindowRewriteEList(pParse, pMWin, pSrc, p->pEList, pTab, &pSublist); selectWindowRewriteEList(pParse, pMWin, pSrc, p->pOrderBy, pTab, &pSublist); pMWin->nBufferCol = (pSublist ? pSublist->nExpr : 0); /* Append the PARTITION BY and ORDER BY expressions to the to the ** sub-select expression list. They are required to figure out where ** boundaries for partitions and sets of peer rows lie. */ pSublist = exprListAppendList(pParse, pSublist, pMWin->pPartition, 0); pSublist = exprListAppendList(pParse, pSublist, pMWin->pOrderBy, 0); /* Append the arguments passed to each window function to the ** sub-select expression list. Also allocate two registers for each ** window function - one for the accumulator, another for interim ** results. */ for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ ExprList *pArgs = pWin->pOwner->x.pList; if( pWin->pFunc->funcFlags & SQLITE_FUNC_SUBTYPE ){ selectWindowRewriteEList(pParse, pMWin, pSrc, pArgs, pTab, &pSublist); pWin->iArgCol = (pSublist ? pSublist->nExpr : 0); pWin->bExprArgs = 1; }else{ pWin->iArgCol = (pSublist ? pSublist->nExpr : 0); pSublist = exprListAppendList(pParse, pSublist, pArgs, 0); } if( pWin->pFilter ){ Expr *pFilter = sqlite3ExprDup(db, pWin->pFilter, 0); pSublist = sqlite3ExprListAppend(pParse, pSublist, pFilter); } pWin->regAccum = ++pParse->nMem; pWin->regResult = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regAccum); } /* If there is no ORDER BY or PARTITION BY clause, and the window ** function accepts zero arguments, and there are no other columns ** selected (e.g. "SELECT row_number() OVER () FROM t1"), it is possible ** that pSublist is still NULL here. Add a constant expression here to ** keep everything legal in this case. */ if( pSublist==0 ){ pSublist = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_INTEGER, "0") ); } pSub = sqlite3SelectNew( pParse, pSublist, pSrc, pWhere, pGroupBy, pHaving, pSort, 0, 0 ); p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0); if( p->pSrc ){ Table *pTab2; p->pSrc->a[0].pSelect = pSub; sqlite3SrcListAssignCursors(pParse, p->pSrc); pSub->selFlags |= SF_Expanded; pTab2 = sqlite3ResultSetOfSelect(pParse, pSub, SQLITE_AFF_NONE); if( pTab2==0 ){ rc = SQLITE_NOMEM; }else{ memcpy(pTab, pTab2, sizeof(Table)); pTab->tabFlags |= TF_Ephemeral; p->pSrc->a[0].pTab = pTab; pTab = pTab2; } sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pMWin->iEphCsr, pSublist->nExpr); sqlite3VdbeAddOp2(v, OP_OpenDup, pMWin->iEphCsr+1, pMWin->iEphCsr); sqlite3VdbeAddOp2(v, OP_OpenDup, pMWin->iEphCsr+2, pMWin->iEphCsr); sqlite3VdbeAddOp2(v, OP_OpenDup, pMWin->iEphCsr+3, pMWin->iEphCsr); }else{ sqlite3SelectDelete(db, pSub); } if( db->mallocFailed ) rc = SQLITE_NOMEM; sqlite3DbFree(db, pTab); } return rc; }
814
True
1
CVE-2019-19959
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:P/A:N
NETWORK
LOW
NONE
NONE
PARTIAL
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/sqlite/sqlite/commit/1e490c4ca6b43a9cf8637d695907888349f69bec', 'name': 'https://github.com/sqlite/sqlite/commit/1e490c4ca6b43a9cf8637d695907888349f69bec', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/sqlite/sqlite/commit/d8f2d46cbc9925e034a68aaaf60aad788d9373c1', 'name': 'https://github.com/sqlite/sqlite/commit/d8f2d46cbc9925e034a68aaaf60aad788d9373c1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200204-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200204-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', '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:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "ext/misc/zipfile.c in SQLite 3.30.1 mishandles certain uses of INSERT INTO in situations involving embedded '\\0' characters in filenames, leading to a memory-management error that can be detected by (for example) valgrind."}]
2020-11-09T21:47Z
2020-01-03T22:15Z
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
Insufficient Information
https://nvd.nist.gov/vuln/categories
0
drh
2019-12-23 21:04:33+00:00
Fix the zipfile() function in the zipfile extension so that it is able to deal with goofy filenames that contain embedded zeros. FossilOrigin-Name: cc0fb00a128fd0773db5ff7891f7aa577a3671d570166d2cbb30df922344adcf
d8f2d46cbc9925e034a68aaaf60aad788d9373c1
False
sqlite/sqlite
Official Git mirror of the SQLite source tree
2019-03-18 12:21:01
2022-08-27 16:17:07
sqlite
2821.0
490.0
zipfileStep
zipfileStep( sqlite3_context * pCtx , int nVal , sqlite3_value ** apVal)
['pCtx', 'nVal', 'apVal']
void zipfileStep(sqlite3_context *pCtx, int nVal, sqlite3_value **apVal){ ZipfileCtx *p; /* Aggregate function context */ ZipfileEntry e; /* New entry to add to zip archive */ sqlite3_value *pName = 0; sqlite3_value *pMode = 0; sqlite3_value *pMtime = 0; sqlite3_value *pData = 0; sqlite3_value *pMethod = 0; int bIsDir = 0; u32 mode; int rc = SQLITE_OK; char *zErr = 0; int iMethod = -1; /* Compression method to use (0 or 8) */ const u8 *aData = 0; /* Possibly compressed data for new entry */ int nData = 0; /* Size of aData[] in bytes */ int szUncompressed = 0; /* Size of data before compression */ u8 *aFree = 0; /* Free this before returning */ u32 iCrc32 = 0; /* crc32 of uncompressed data */ char *zName = 0; /* Path (name) of new entry */ int nName = 0; /* Size of zName in bytes */ char *zFree = 0; /* Free this before returning */ int nByte; memset(&e, 0, sizeof(e)); p = (ZipfileCtx*)sqlite3_aggregate_context(pCtx, sizeof(ZipfileCtx)); if( p==0 ) return; /* Martial the arguments into stack variables */ if( nVal!=2 && nVal!=4 && nVal!=5 ){ zErr = sqlite3_mprintf("wrong number of arguments to function zipfile()"); rc = SQLITE_ERROR; goto zipfile_step_out; } pName = apVal[0]; if( nVal==2 ){ pData = apVal[1]; }else{ pMode = apVal[1]; pMtime = apVal[2]; pData = apVal[3]; if( nVal==5 ){ pMethod = apVal[4]; } } /* Check that the 'name' parameter looks ok. */ zName = (char*)sqlite3_value_text(pName); nName = sqlite3_value_bytes(pName); if( zName==0 ){ zErr = sqlite3_mprintf("first argument to zipfile() must be non-NULL"); rc = SQLITE_ERROR; goto zipfile_step_out; } /* Inspect the 'method' parameter. This must be either 0 (store), 8 (use ** deflate compression) or NULL (choose automatically). */ if( pMethod && SQLITE_NULL!=sqlite3_value_type(pMethod) ){ iMethod = (int)sqlite3_value_int64(pMethod); if( iMethod!=0 && iMethod!=8 ){ zErr = sqlite3_mprintf("illegal method value: %d", iMethod); rc = SQLITE_ERROR; goto zipfile_step_out; } } /* Now inspect the data. If this is NULL, then the new entry must be a ** directory. Otherwise, figure out whether or not the data should ** be deflated or simply stored in the zip archive. */ if( sqlite3_value_type(pData)==SQLITE_NULL ){ bIsDir = 1; iMethod = 0; }else{ aData = sqlite3_value_blob(pData); szUncompressed = nData = sqlite3_value_bytes(pData); iCrc32 = crc32(0, aData, nData); if( iMethod<0 || iMethod==8 ){ int nOut = 0; rc = zipfileDeflate(aData, nData, &aFree, &nOut, &zErr); if( rc!=SQLITE_OK ){ goto zipfile_step_out; } if( iMethod==8 || nOut<nData ){ aData = aFree; nData = nOut; iMethod = 8; }else{ iMethod = 0; } } } /* Decode the "mode" argument. */ rc = zipfileGetMode(pMode, bIsDir, &mode, &zErr); if( rc ) goto zipfile_step_out; /* Decode the "mtime" argument. */ e.mUnixTime = zipfileGetTime(pMtime); /* If this is a directory entry, ensure that there is exactly one '/' ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ if( zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ if( zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } } /* Assemble the ZipfileEntry object for the new zip archive entry */ e.cds.iVersionMadeBy = ZIPFILE_NEWENTRY_MADEBY; e.cds.iVersionExtract = ZIPFILE_NEWENTRY_REQUIRED; e.cds.flags = ZIPFILE_NEWENTRY_FLAGS; e.cds.iCompression = (u16)iMethod; zipfileMtimeToDos(&e.cds, (u32)e.mUnixTime); e.cds.crc32 = iCrc32; e.cds.szCompressed = nData; e.cds.szUncompressed = szUncompressed; e.cds.iExternalAttr = (mode<<16); e.cds.iOffset = p->body.n; e.cds.nFile = (u16)nName; e.cds.zFile = zName; /* Append the LFH to the body of the new archive */ nByte = ZIPFILE_LFH_FIXED_SZ + e.cds.nFile + 9; if( (rc = zipfileBufferGrow(&p->body, nByte)) ) goto zipfile_step_out; p->body.n += zipfileSerializeLFH(&e, &p->body.a[p->body.n]); /* Append the data to the body of the new archive */ if( nData>0 ){ if( (rc = zipfileBufferGrow(&p->body, nData)) ) goto zipfile_step_out; memcpy(&p->body.a[p->body.n], aData, nData); p->body.n += nData; } /* Append the CDS record to the directory of the new archive */ nByte = ZIPFILE_CDS_FIXED_SZ + e.cds.nFile + 9; if( (rc = zipfileBufferGrow(&p->cds, nByte)) ) goto zipfile_step_out; p->cds.n += zipfileSerializeCDS(&e, &p->cds.a[p->cds.n]); /* Increment the count of entries in the archive */ p->nEntry++; zipfile_step_out: sqlite3_free(aFree); sqlite3_free(zFree); if( rc ){ if( zErr ){ sqlite3_result_error(pCtx, zErr, -1); }else{ sqlite3_result_error_code(pCtx, rc); } } sqlite3_free(zErr); }
944
True
1