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-2022-23308
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: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://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.9.13/NEWS', 'name': 'https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.9.13/NEWS', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/GNOME/libxml2/commit/652dd12a858989b14eed4e84e453059cd3ba340e', 'name': 'https://github.com/GNOME/libxml2/commit/652dd12a858989b14eed4e84e453059cd3ba340e', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LA3MWWAYZADWJ5F6JOUBX65UZAMQB7RF/', 'name': 'FEDORA-2022-050c712ed7', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220331-0008/', 'name': 'https://security.netapp.com/advisory/ntap-20220331-0008/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00004.html', 'name': '[debian-lts-announce] 20220408 [SECURITY] [DLA 2972-1] libxml2 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213253', 'name': 'https://support.apple.com/kb/HT213253', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213255', 'name': 'https://support.apple.com/kb/HT213255', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213256', 'name': 'https://support.apple.com/kb/HT213256', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213257', 'name': 'https://support.apple.com/kb/HT213257', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213258', 'name': 'https://support.apple.com/kb/HT213258', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213254', 'name': 'https://support.apple.com/kb/HT213254', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/33', 'name': '20220516 APPLE-SA-2022-05-16-4 Security Update 2022-004 Catalina', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/35', 'name': '20220516 APPLE-SA-2022-05-16-3 macOS Big Sur 11.6.6', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/34', 'name': '20220516 APPLE-SA-2022-05-16-1 iOS 15.5 and iPadOS 15.5', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/37', 'name': '20220516 APPLE-SA-2022-05-16-6 tvOS 15.5', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/36', 'name': '20220516 APPLE-SA-2022-05-16-5 watchOS 8.6', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:xmlsoft:libxml2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'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:apple:macos:10.15.7:security_update_2021-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-004:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:ipados:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0', 'versionEndExcluding': '12.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15.0', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.6.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapdrive:-:*:*:*:*:unix:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapmanager:-:*:*:*:*:oracle:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:clustered_data_ontap:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:smi-s_provider:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:clustered_data_ontap_antivirus_connector:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire_\\&_hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vmware_vsphere:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:manageability_software_development_kit:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire\\,_enterprise_sds_\\&_hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:bootstrap_os:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:hci_compute_node:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h300s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h300s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h500s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h500s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h300e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h300e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h500e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h500e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h700e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h410s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h410s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h410c_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h410c:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'valid.c in libxml2 before 2.9.13 has a use-after-free of ID and IDREF attributes.'}]
2022-07-25T18:21Z
2022-02-26T05: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
Nick Wellnhofer
2022-02-08 03:29:24+01:00
[CVE-2022-23308] Use-after-free of ID and IDREF attributes If a document is parsed with XML_PARSE_DTDVALID and without XML_PARSE_NOENT, the value of ID attributes has to be normalized after potentially expanding entities in xmlRemoveID. Otherwise, later calls to xmlGetID can return a pointer to previously freed memory. ID attributes which are empty or contain only whitespace after entity expansion are affected in a similar way. This is fixed by not storing such attributes in the ID table. The test to detect streaming mode when validating against a DTD was broken. In connection with the defects above, this could result in a use-after-free when using the xmlReader interface with validation. Fix detection of streaming mode to avoid similar issues. (This changes the expected result of a test case. But as far as I can tell, using the XML reader with XIncludes referencing the root document never worked properly, anyway.) All of these issues can result in denial of service. Using xmlReader with validation could result in disclosure of memory via the error channel, typically stderr. The security impact of xmlGetID returning a pointer to freed memory depends on the application. The typical use case of calling xmlGetID on an unmodified document is not affected.
652dd12a858989b14eed4e84e453059cd3ba340e
False
GNOME/libxml2
Read-only mirror of https://gitlab.gnome.org/GNOME/libxml2
2012-06-03 12:37:38
2022-08-26 15:36:45
https://gitlab.gnome.org/GNOME/libxml2
GNOME
395.0
295.0
xmlAddRef
xmlAddRef( xmlValidCtxtPtr ctxt , xmlDocPtr doc , const xmlChar * value , xmlAttrPtr attr)
['ctxt', 'doc', 'value', 'attr']
xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlRefPtr ret; xmlRefTablePtr table; xmlListPtr ref_list; if (doc == NULL) { return(NULL); } if (value == NULL) { return(NULL); } if (attr == NULL) { return(NULL); } /* * Create the Ref table if needed. */ table = (xmlRefTablePtr) doc->refs; if (table == NULL) { doc->refs = table = xmlHashCreateDict(0, doc->dict); } if (table == NULL) { xmlVErrMemory(ctxt, "xmlAddRef: Table creation failed!\n"); return(NULL); } ret = (xmlRefPtr) xmlMalloc(sizeof(xmlRef)); if (ret == NULL) { xmlVErrMemory(ctxt, "malloc failed"); return(NULL); } /* * fill the structure. */ ret->value = xmlStrdup(value); if ((ctxt != NULL) && (ctxt->vstateNr != 0)) { /* * Operating in streaming mode, attr is gonna disappear */ ret->name = xmlStrdup(attr->name); ret->attr = NULL; } else { ret->name = NULL; ret->attr = attr; } ret->lineno = xmlGetLineNo(attr->parent); /* To add a reference :- * References are maintained as a list of references, * Lookup the entry, if no entry create new nodelist * Add the owning node to the NodeList * Return the ref */ if (NULL == (ref_list = xmlHashLookup(table, value))) { if (NULL == (ref_list = xmlListCreate(xmlFreeRef, xmlDummyCompare))) { xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "xmlAddRef: Reference list creation failed!\n", NULL); goto failed; } if (xmlHashAddEntry(table, value, ref_list) < 0) { xmlListDelete(ref_list); xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "xmlAddRef: Reference list insertion failed!\n", NULL); goto failed; } } if (xmlListAppend(ref_list, ret) != 0) { xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "xmlAddRef: Reference list insertion failed!\n", NULL); goto failed; } return(ret); failed: if (ret != NULL) { if (ret->value != NULL) xmlFree((char *)ret->value); if (ret->name != NULL) xmlFree((char *)ret->name); xmlFree(ret); } return(NULL); }
393
True
1
CVE-2022-23308
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: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://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.9.13/NEWS', 'name': 'https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.9.13/NEWS', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/GNOME/libxml2/commit/652dd12a858989b14eed4e84e453059cd3ba340e', 'name': 'https://github.com/GNOME/libxml2/commit/652dd12a858989b14eed4e84e453059cd3ba340e', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LA3MWWAYZADWJ5F6JOUBX65UZAMQB7RF/', 'name': 'FEDORA-2022-050c712ed7', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220331-0008/', 'name': 'https://security.netapp.com/advisory/ntap-20220331-0008/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00004.html', 'name': '[debian-lts-announce] 20220408 [SECURITY] [DLA 2972-1] libxml2 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213253', 'name': 'https://support.apple.com/kb/HT213253', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213255', 'name': 'https://support.apple.com/kb/HT213255', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213256', 'name': 'https://support.apple.com/kb/HT213256', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213257', 'name': 'https://support.apple.com/kb/HT213257', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213258', 'name': 'https://support.apple.com/kb/HT213258', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213254', 'name': 'https://support.apple.com/kb/HT213254', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/33', 'name': '20220516 APPLE-SA-2022-05-16-4 Security Update 2022-004 Catalina', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/35', 'name': '20220516 APPLE-SA-2022-05-16-3 macOS Big Sur 11.6.6', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/34', 'name': '20220516 APPLE-SA-2022-05-16-1 iOS 15.5 and iPadOS 15.5', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/37', 'name': '20220516 APPLE-SA-2022-05-16-6 tvOS 15.5', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/36', 'name': '20220516 APPLE-SA-2022-05-16-5 watchOS 8.6', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:xmlsoft:libxml2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'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:apple:macos:10.15.7:security_update_2021-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-004:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:ipados:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0', 'versionEndExcluding': '12.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15.0', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.6.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapdrive:-:*:*:*:*:unix:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapmanager:-:*:*:*:*:oracle:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:clustered_data_ontap:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:smi-s_provider:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:clustered_data_ontap_antivirus_connector:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire_\\&_hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vmware_vsphere:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:manageability_software_development_kit:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire\\,_enterprise_sds_\\&_hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:bootstrap_os:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:hci_compute_node:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h300s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h300s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h500s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h500s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h300e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h300e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h500e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h500e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h700e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h410s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h410s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h410c_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h410c:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'valid.c in libxml2 before 2.9.13 has a use-after-free of ID and IDREF attributes.'}]
2022-07-25T18:21Z
2022-02-26T05: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
Nick Wellnhofer
2022-02-08 03:29:24+01:00
[CVE-2022-23308] Use-after-free of ID and IDREF attributes If a document is parsed with XML_PARSE_DTDVALID and without XML_PARSE_NOENT, the value of ID attributes has to be normalized after potentially expanding entities in xmlRemoveID. Otherwise, later calls to xmlGetID can return a pointer to previously freed memory. ID attributes which are empty or contain only whitespace after entity expansion are affected in a similar way. This is fixed by not storing such attributes in the ID table. The test to detect streaming mode when validating against a DTD was broken. In connection with the defects above, this could result in a use-after-free when using the xmlReader interface with validation. Fix detection of streaming mode to avoid similar issues. (This changes the expected result of a test case. But as far as I can tell, using the XML reader with XIncludes referencing the root document never worked properly, anyway.) All of these issues can result in denial of service. Using xmlReader with validation could result in disclosure of memory via the error channel, typically stderr. The security impact of xmlGetID returning a pointer to freed memory depends on the application. The typical use case of calling xmlGetID on an unmodified document is not affected.
652dd12a858989b14eed4e84e453059cd3ba340e
False
GNOME/libxml2
Read-only mirror of https://gitlab.gnome.org/GNOME/libxml2
2012-06-03 12:37:38
2022-08-26 15:36:45
https://gitlab.gnome.org/GNOME/libxml2
GNOME
395.0
295.0
xmlValidCtxtNormalizeAttributeValue
xmlValidCtxtNormalizeAttributeValue( xmlValidCtxtPtr ctxt , xmlDocPtr doc , xmlNodePtr elem , const xmlChar * name , const xmlChar * value)
['ctxt', 'doc', 'elem', 'name', 'value']
xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { xmlChar *ret, *dst; const xmlChar *src; xmlAttributePtr attrDecl = NULL; int extsubset = 0; if (doc == NULL) return(NULL); if (elem == NULL) return(NULL); if (name == NULL) return(NULL); if (value == NULL) return(NULL); if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(NULL); attrDecl = xmlGetDtdAttrDesc(doc->intSubset, fullname, name); if ((attrDecl == NULL) && (doc->extSubset != NULL)) { attrDecl = xmlGetDtdAttrDesc(doc->extSubset, fullname, name); if (attrDecl != NULL) extsubset = 1; } if ((fullname != fn) && (fullname != elem->name)) xmlFree(fullname); } if ((attrDecl == NULL) && (doc->intSubset != NULL)) attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, name); if ((attrDecl == NULL) && (doc->extSubset != NULL)) { attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name, name); if (attrDecl != NULL) extsubset = 1; } if (attrDecl == NULL) return(NULL); if (attrDecl->atype == XML_ATTRIBUTE_CDATA) return(NULL); ret = xmlStrdup(value); if (ret == NULL) return(NULL); src = value; dst = ret; while (*src == 0x20) src++; while (*src != 0) { if (*src == 0x20) { while (*src == 0x20) src++; if (*src != 0) *dst++ = 0x20; } else { *dst++ = *src++; } } *dst = 0; if ((doc->standalone) && (extsubset == 1) && (!xmlStrEqual(value, ret))) { xmlErrValidNode(ctxt, elem, XML_DTD_NOT_STANDALONE, "standalone: %s on %s value had to be normalized based on external subset declaration\n", name, elem->name, NULL); ctxt->valid = 0; } return(ret); }
473
True
1
CVE-2022-23308
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: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://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.9.13/NEWS', 'name': 'https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.9.13/NEWS', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/GNOME/libxml2/commit/652dd12a858989b14eed4e84e453059cd3ba340e', 'name': 'https://github.com/GNOME/libxml2/commit/652dd12a858989b14eed4e84e453059cd3ba340e', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LA3MWWAYZADWJ5F6JOUBX65UZAMQB7RF/', 'name': 'FEDORA-2022-050c712ed7', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220331-0008/', 'name': 'https://security.netapp.com/advisory/ntap-20220331-0008/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00004.html', 'name': '[debian-lts-announce] 20220408 [SECURITY] [DLA 2972-1] libxml2 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213253', 'name': 'https://support.apple.com/kb/HT213253', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213255', 'name': 'https://support.apple.com/kb/HT213255', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213256', 'name': 'https://support.apple.com/kb/HT213256', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213257', 'name': 'https://support.apple.com/kb/HT213257', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213258', 'name': 'https://support.apple.com/kb/HT213258', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT213254', 'name': 'https://support.apple.com/kb/HT213254', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/33', 'name': '20220516 APPLE-SA-2022-05-16-4 Security Update 2022-004 Catalina', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/35', 'name': '20220516 APPLE-SA-2022-05-16-3 macOS Big Sur 11.6.6', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/34', 'name': '20220516 APPLE-SA-2022-05-16-1 iOS 15.5 and iPadOS 15.5', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/37', 'name': '20220516 APPLE-SA-2022-05-16-6 tvOS 15.5', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/36', 'name': '20220516 APPLE-SA-2022-05-16-5 watchOS 8.6', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2022/May/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:xmlsoft:libxml2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'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:apple:macos:10.15.7:security_update_2021-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-004:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:ipados:*:*:*:*:*:*:*:*', 'versionEndExcluding': '15.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0', 'versionEndExcluding': '12.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15.0', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.6.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapdrive:-:*:*:*:*:unix:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapmanager:-:*:*:*:*:oracle:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:ontap_select_deploy_administration_utility:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:clustered_data_ontap:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:smi-s_provider:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:clustered_data_ontap_antivirus_connector:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire_\\&_hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vmware_vsphere:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:manageability_software_development_kit:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire\\,_enterprise_sds_\\&_hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:bootstrap_os:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:hci_compute_node:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h300s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h300s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h500s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h500s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h300e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h300e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h500e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h500e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h700e_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700e:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h410s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h410s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:h410c_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h410c:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'valid.c in libxml2 before 2.9.13 has a use-after-free of ID and IDREF attributes.'}]
2022-07-25T18:21Z
2022-02-26T05: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
Nick Wellnhofer
2022-02-08 03:29:24+01:00
[CVE-2022-23308] Use-after-free of ID and IDREF attributes If a document is parsed with XML_PARSE_DTDVALID and without XML_PARSE_NOENT, the value of ID attributes has to be normalized after potentially expanding entities in xmlRemoveID. Otherwise, later calls to xmlGetID can return a pointer to previously freed memory. ID attributes which are empty or contain only whitespace after entity expansion are affected in a similar way. This is fixed by not storing such attributes in the ID table. The test to detect streaming mode when validating against a DTD was broken. In connection with the defects above, this could result in a use-after-free when using the xmlReader interface with validation. Fix detection of streaming mode to avoid similar issues. (This changes the expected result of a test case. But as far as I can tell, using the XML reader with XIncludes referencing the root document never worked properly, anyway.) All of these issues can result in denial of service. Using xmlReader with validation could result in disclosure of memory via the error channel, typically stderr. The security impact of xmlGetID returning a pointer to freed memory depends on the application. The typical use case of calling xmlGetID on an unmodified document is not affected.
652dd12a858989b14eed4e84e453059cd3ba340e
False
GNOME/libxml2
Read-only mirror of https://gitlab.gnome.org/GNOME/libxml2
2012-06-03 12:37:38
2022-08-26 15:36:45
https://gitlab.gnome.org/GNOME/libxml2
GNOME
395.0
295.0
xmlValidNormalizeAttributeValue
xmlValidNormalizeAttributeValue( xmlDocPtr doc , xmlNodePtr elem , const xmlChar * name , const xmlChar * value)
['doc', 'elem', 'name', 'value']
xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value) { xmlChar *ret, *dst; const xmlChar *src; xmlAttributePtr attrDecl = NULL; if (doc == NULL) return(NULL); if (elem == NULL) return(NULL); if (name == NULL) return(NULL); if (value == NULL) return(NULL); if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(NULL); if ((fullname != fn) && (fullname != elem->name)) xmlFree(fullname); } attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, name); if ((attrDecl == NULL) && (doc->extSubset != NULL)) attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name, name); if (attrDecl == NULL) return(NULL); if (attrDecl->atype == XML_ATTRIBUTE_CDATA) return(NULL); ret = xmlStrdup(value); if (ret == NULL) return(NULL); src = value; dst = ret; while (*src == 0x20) src++; while (*src != 0) { if (*src == 0x20) { while (*src == 0x20) src++; if (*src != 0) *dst++ = 0x20; } else { *dst++ = *src++; } } *dst = 0; return(ret); }
332
True
1
CVE-2017-6594
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
nan
[{'url': 'https://github.com/heimdal/heimdal/releases/tag/heimdal-7.3.0', 'name': 'https://github.com/heimdal/heimdal/releases/tag/heimdal-7.3.0', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/heimdal/heimdal/commit/b1e699103f08d6a0ca46a122193c9da65f6cf837', 'name': 'https://github.com/heimdal/heimdal/commit/b1e699103f08d6a0ca46a122193c9da65f6cf837', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.h5l.org/advisories.html?show=2017-04-13', 'name': 'http://www.h5l.org/advisories.html?show=2017-04-13', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-08/msg00062.html', 'name': 'openSUSE-SU-2017:2180', 'refsource': 'SUSE', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-295'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:heimdal_project:heimdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '7.2.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The transit path validation code in Heimdal before 7.3 might allow attackers to bypass the capath policy protection mechanism by leveraging failure to add the previous hop realm to the transit path of issued tickets.'}]
2021-08-12T17:50Z
2017-08-28T19:29Z
Improper Certificate Validation
The software does not validate, or incorrectly validates, a certificate.
When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
https://cwe.mitre.org/data/definitions/295.html
0
Viktor Dukhovni
2016-08-10 23:31:14+00:00
Fix transit path validation CVE-2017-6594 Commit f469fc6 (2010-10-02) inadvertently caused the previous hop realm to not be added to the transit path of issued tickets. This may, in some cases, enable bypass of capath policy in Heimdal versions 1.5 through 7.2. Note, this may break sites that rely on the bug. With the bug some incomplete [capaths] worked, that should not have. These may now break authentication in some cross-realm configurations.
b1e699103f08d6a0ca46a122193c9da65f6cf837
False
heimdal/heimdal
Heimdal
2009-09-27 21:15:13
2022-08-25 19:30:33
https://heimdal.software
heimdal
250.0
151.0
fix_transited_encoding
fix_transited_encoding( krb5_context context , krb5_kdc_configuration * config , krb5_boolean check_policy , const TransitedEncoding * tr , EncTicketPart * et , const char * client_realm , const char * server_realm , const char * tgt_realm)
['context', 'config', 'check_policy', 'tr', 'et', 'client_realm', 'server_realm', 'tgt_realm']
fix_transited_encoding(krb5_context context, krb5_kdc_configuration *config, krb5_boolean check_policy, const TransitedEncoding *tr, EncTicketPart *et, const char *client_realm, const char *server_realm, const char *tgt_realm) { krb5_error_code ret = 0; char **realms, **tmp; unsigned int num_realms; size_t i; switch (tr->tr_type) { case DOMAIN_X500_COMPRESS: break; case 0: /* * Allow empty content of type 0 because that is was Microsoft * generates in their TGT. */ if (tr->contents.length == 0) break; kdc_log(context, config, 0, "Transited type 0 with non empty content"); return KRB5KDC_ERR_TRTYPE_NOSUPP; default: kdc_log(context, config, 0, "Unknown transited type: %u", tr->tr_type); return KRB5KDC_ERR_TRTYPE_NOSUPP; } ret = krb5_domain_x500_decode(context, tr->contents, &realms, &num_realms, client_realm, server_realm); if(ret){ krb5_warn(context, ret, "Decoding transited encoding"); return ret; } if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)) { /* not us, so add the previous realm to transited set */ if (num_realms + 1 > UINT_MAX/sizeof(*realms)) { ret = ERANGE; goto free_realms; } tmp = realloc(realms, (num_realms + 1) * sizeof(*realms)); if(tmp == NULL){ ret = ENOMEM; goto free_realms; } realms = tmp; realms[num_realms] = strdup(tgt_realm); if(realms[num_realms] == NULL){ ret = ENOMEM; goto free_realms; } num_realms++; } if(num_realms == 0) { if(strcmp(client_realm, server_realm)) kdc_log(context, config, 0, "cross-realm %s -> %s", client_realm, server_realm); } else { size_t l = 0; char *rs; for(i = 0; i < num_realms; i++) l += strlen(realms[i]) + 2; rs = malloc(l); if(rs != NULL) { *rs = '\0'; for(i = 0; i < num_realms; i++) { if(i > 0) strlcat(rs, ", ", l); strlcat(rs, realms[i], l); } kdc_log(context, config, 0, "cross-realm %s -> %s via [%s]", client_realm, server_realm, rs); free(rs); } } if(check_policy) { ret = krb5_check_transited(context, client_realm, server_realm, realms, num_realms, NULL); if(ret) { krb5_warn(context, ret, "cross-realm %s -> %s", client_realm, server_realm); goto free_realms; } et->flags.transited_policy_checked = 1; } et->transited.tr_type = DOMAIN_X500_COMPRESS; ret = krb5_domain_x500_encode(realms, num_realms, &et->transited.contents); if(ret) krb5_warn(context, ret, "Encoding transited encoding"); free_realms: for(i = 0; i < num_realms; i++) free(realms[i]); free(realms); return ret; }
542
True
1
CVE-2017-6594
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
nan
[{'url': 'https://github.com/heimdal/heimdal/releases/tag/heimdal-7.3.0', 'name': 'https://github.com/heimdal/heimdal/releases/tag/heimdal-7.3.0', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/heimdal/heimdal/commit/b1e699103f08d6a0ca46a122193c9da65f6cf837', 'name': 'https://github.com/heimdal/heimdal/commit/b1e699103f08d6a0ca46a122193c9da65f6cf837', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.h5l.org/advisories.html?show=2017-04-13', 'name': 'http://www.h5l.org/advisories.html?show=2017-04-13', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-08/msg00062.html', 'name': 'openSUSE-SU-2017:2180', 'refsource': 'SUSE', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-295'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:heimdal_project:heimdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '7.2.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The transit path validation code in Heimdal before 7.3 might allow attackers to bypass the capath policy protection mechanism by leveraging failure to add the previous hop realm to the transit path of issued tickets.'}]
2021-08-12T17:50Z
2017-08-28T19:29Z
Improper Certificate Validation
The software does not validate, or incorrectly validates, a certificate.
When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
https://cwe.mitre.org/data/definitions/295.html
0
Viktor Dukhovni
2016-08-10 23:31:14+00:00
Fix transit path validation CVE-2017-6594 Commit f469fc6 (2010-10-02) inadvertently caused the previous hop realm to not be added to the transit path of issued tickets. This may, in some cases, enable bypass of capath policy in Heimdal versions 1.5 through 7.2. Note, this may break sites that rely on the bug. With the bug some incomplete [capaths] worked, that should not have. These may now break authentication in some cross-realm configurations.
b1e699103f08d6a0ca46a122193c9da65f6cf837
False
heimdal/heimdal
Heimdal
2009-09-27 21:15:13
2022-08-25 19:30:33
https://heimdal.software
heimdal
250.0
151.0
tgs_make_reply
tgs_make_reply( krb5_context context , krb5_kdc_configuration * config , KDC_REQ_BODY * b , krb5_const_principal tgt_name , const EncTicketPart * tgt , const krb5_keyblock * replykey , int rk_is_subkey , const EncryptionKey * serverkey , const krb5_keyblock * sessionkey , krb5_kvno kvno , AuthorizationData * auth_data , hdb_entry_ex * server , krb5_principal server_principal , const char * server_name , hdb_entry_ex * client , krb5_principal client_principal , hdb_entry_ex * krbtgt , krb5_enctype krbtgt_etype , krb5_principals spp , const krb5_data * rspac , const METHOD_DATA * enc_pa_data , const char ** e_text , krb5_data * reply)
['context', 'config', 'b', 'tgt_name', 'tgt', 'replykey', 'rk_is_subkey', 'serverkey', 'sessionkey', 'kvno', 'auth_data', 'server', 'server_principal', 'server_name', 'client', 'client_principal', 'krbtgt', 'krbtgt_etype', 'spp', 'rspac', 'enc_pa_data', 'e_text', 'reply']
tgs_make_reply(krb5_context context, krb5_kdc_configuration *config, KDC_REQ_BODY *b, krb5_const_principal tgt_name, const EncTicketPart *tgt, const krb5_keyblock *replykey, int rk_is_subkey, const EncryptionKey *serverkey, const krb5_keyblock *sessionkey, krb5_kvno kvno, AuthorizationData *auth_data, hdb_entry_ex *server, krb5_principal server_principal, const char *server_name, hdb_entry_ex *client, krb5_principal client_principal, hdb_entry_ex *krbtgt, krb5_enctype krbtgt_etype, krb5_principals spp, const krb5_data *rspac, const METHOD_DATA *enc_pa_data, const char **e_text, krb5_data *reply) { KDC_REP rep; EncKDCRepPart ek; EncTicketPart et; KDCOptions f = b->kdc_options; krb5_error_code ret; int is_weak = 0; memset(&rep, 0, sizeof(rep)); memset(&et, 0, sizeof(et)); memset(&ek, 0, sizeof(ek)); rep.pvno = 5; rep.msg_type = krb_tgs_rep; et.authtime = tgt->authtime; _kdc_fix_time(&b->till); et.endtime = min(tgt->endtime, *b->till); ALLOC(et.starttime); *et.starttime = kdc_time; ret = check_tgs_flags(context, config, b, tgt, &et); if(ret) goto out; /* We should check the transited encoding if: 1) the request doesn't ask not to be checked 2) globally enforcing a check 3) principal requires checking 4) we allow non-check per-principal, but principal isn't marked as allowing this 5) we don't globally allow this */ #define GLOBAL_FORCE_TRANSITED_CHECK \ (config->trpolicy == TRPOLICY_ALWAYS_CHECK) #define GLOBAL_ALLOW_PER_PRINCIPAL \ (config->trpolicy == TRPOLICY_ALLOW_PER_PRINCIPAL) #define GLOBAL_ALLOW_DISABLE_TRANSITED_CHECK \ (config->trpolicy == TRPOLICY_ALWAYS_HONOUR_REQUEST) /* these will consult the database in future release */ #define PRINCIPAL_FORCE_TRANSITED_CHECK(P) 0 #define PRINCIPAL_ALLOW_DISABLE_TRANSITED_CHECK(P) 0 ret = fix_transited_encoding(context, config, !f.disable_transited_check || GLOBAL_FORCE_TRANSITED_CHECK || PRINCIPAL_FORCE_TRANSITED_CHECK(server) || !((GLOBAL_ALLOW_PER_PRINCIPAL && PRINCIPAL_ALLOW_DISABLE_TRANSITED_CHECK(server)) || GLOBAL_ALLOW_DISABLE_TRANSITED_CHECK), &tgt->transited, &et, krb5_principal_get_realm(context, client_principal), krb5_principal_get_realm(context, server->entry.principal), krb5_principal_get_realm(context, krbtgt->entry.principal)); if(ret) goto out; copy_Realm(&server_principal->realm, &rep.ticket.realm); _krb5_principal2principalname(&rep.ticket.sname, server_principal); copy_Realm(&tgt_name->realm, &rep.crealm); /* if (f.request_anonymous) _kdc_make_anonymous_principalname (&rep.cname); else */ copy_PrincipalName(&tgt_name->name, &rep.cname); rep.ticket.tkt_vno = 5; ek.caddr = et.caddr; { time_t life; life = et.endtime - *et.starttime; if(client && client->entry.max_life) life = min(life, *client->entry.max_life); if(server->entry.max_life) life = min(life, *server->entry.max_life); et.endtime = *et.starttime + life; } if(f.renewable_ok && tgt->flags.renewable && et.renew_till == NULL && et.endtime < *b->till && tgt->renew_till != NULL) { et.flags.renewable = 1; ALLOC(et.renew_till); *et.renew_till = *b->till; } if(et.renew_till){ time_t renew; renew = *et.renew_till - *et.starttime; if(client && client->entry.max_renew) renew = min(renew, *client->entry.max_renew); if(server->entry.max_renew) renew = min(renew, *server->entry.max_renew); *et.renew_till = *et.starttime + renew; } if(et.renew_till){ *et.renew_till = min(*et.renew_till, *tgt->renew_till); *et.starttime = min(*et.starttime, *et.renew_till); et.endtime = min(et.endtime, *et.renew_till); } *et.starttime = min(*et.starttime, et.endtime); if(*et.starttime == et.endtime){ ret = KRB5KDC_ERR_NEVER_VALID; goto out; } if(et.renew_till && et.endtime == *et.renew_till){ free(et.renew_till); et.renew_till = NULL; et.flags.renewable = 0; } et.flags.pre_authent = tgt->flags.pre_authent; et.flags.hw_authent = tgt->flags.hw_authent; et.flags.anonymous = tgt->flags.anonymous; et.flags.ok_as_delegate = server->entry.flags.ok_as_delegate; if(rspac->length) { /* * No not need to filter out the any PAC from the * auth_data since it's signed by the KDC. */ ret = _kdc_tkt_add_if_relevant_ad(context, &et, KRB5_AUTHDATA_WIN2K_PAC, rspac); if (ret) goto out; } if (auth_data) { unsigned int i = 0; /* XXX check authdata */ if (et.authorization_data == NULL) { et.authorization_data = calloc(1, sizeof(*et.authorization_data)); if (et.authorization_data == NULL) { ret = ENOMEM; krb5_set_error_message(context, ret, "malloc: out of memory"); goto out; } } for(i = 0; i < auth_data->len ; i++) { ret = add_AuthorizationData(et.authorization_data, &auth_data->val[i]); if (ret) { krb5_set_error_message(context, ret, "malloc: out of memory"); goto out; } } /* Filter out type KRB5SignedPath */ ret = find_KRB5SignedPath(context, et.authorization_data, NULL); if (ret == 0) { if (et.authorization_data->len == 1) { free_AuthorizationData(et.authorization_data); free(et.authorization_data); et.authorization_data = NULL; } else { AuthorizationData *ad = et.authorization_data; free_AuthorizationDataElement(&ad->val[ad->len - 1]); ad->len--; } } } ret = krb5_copy_keyblock_contents(context, sessionkey, &et.key); if (ret) goto out; et.crealm = tgt_name->realm; et.cname = tgt_name->name; ek.key = et.key; /* MIT must have at least one last_req */ ek.last_req.val = calloc(1, sizeof(*ek.last_req.val)); if (ek.last_req.val == NULL) { ret = ENOMEM; goto out; } ek.last_req.len = 1; /* set after alloc to avoid null deref on cleanup */ ek.nonce = b->nonce; ek.flags = et.flags; ek.authtime = et.authtime; ek.starttime = et.starttime; ek.endtime = et.endtime; ek.renew_till = et.renew_till; ek.srealm = rep.ticket.realm; ek.sname = rep.ticket.sname; _kdc_log_timestamp(context, config, "TGS-REQ", et.authtime, et.starttime, et.endtime, et.renew_till); /* Don't sign cross realm tickets, they can't be checked anyway */ { char *r = get_krbtgt_realm(&ek.sname); if (r == NULL || strcmp(r, ek.srealm) == 0) { ret = _kdc_add_KRB5SignedPath(context, config, krbtgt, krbtgt_etype, client_principal, NULL, spp, &et); if (ret) goto out; } } if (enc_pa_data->len) { rep.padata = calloc(1, sizeof(*rep.padata)); if (rep.padata == NULL) { ret = ENOMEM; goto out; } ret = copy_METHOD_DATA(enc_pa_data, rep.padata); if (ret) goto out; } if (krb5_enctype_valid(context, serverkey->keytype) != 0 && _kdc_is_weak_exception(server->entry.principal, serverkey->keytype)) { krb5_enctype_enable(context, serverkey->keytype); is_weak = 1; } /* It is somewhat unclear where the etype in the following encryption should come from. What we have is a session key in the passed tgt, and a list of preferred etypes *for the new ticket*. Should we pick the best possible etype, given the keytype in the tgt, or should we look at the etype list here as well? What if the tgt session key is DES3 and we want a ticket with a (say) CAST session key. Should the DES3 etype be added to the etype list, even if we don't want a session key with DES3? */ ret = _kdc_encode_reply(context, config, NULL, 0, &rep, &et, &ek, serverkey->keytype, kvno, serverkey, 0, replykey, rk_is_subkey, e_text, reply); if (is_weak) krb5_enctype_disable(context, serverkey->keytype); out: free_TGS_REP(&rep); free_TransitedEncoding(&et.transited); if(et.starttime) free(et.starttime); if(et.renew_till) free(et.renew_till); if(et.authorization_data) { free_AuthorizationData(et.authorization_data); free(et.authorization_data); } free_LastReq(&ek.last_req); memset(et.key.keyvalue.data, 0, et.key.keyvalue.length); free_EncryptionKey(&et.key); return ret; }
1523
True
1
CVE-2017-17439
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
nan
[{'url': 'https://github.com/heimdal/heimdal/issues/353', 'name': 'https://github.com/heimdal/heimdal/issues/353', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/heimdal/heimdal/commit/1a6a6e462dc2ac6111f9e02c6852ddec4849b887', 'name': 'https://github.com/heimdal/heimdal/commit/1a6a6e462dc2ac6111f9e02c6852ddec4849b887', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878144', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878144', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Mailing List', 'Third Party Advisory']}, {'url': 'http://www.h5l.org/pipermail/heimdal-discuss/2017-August/000259.html', 'name': 'http://www.h5l.org/pipermail/heimdal-discuss/2017-August/000259.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2017/dsa-4055', 'name': 'DSA-4055', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'http://www.h5l.org/pipermail/heimdal-announce/2017-December/000008.html', 'name': 'http://www.h5l.org/pipermail/heimdal-announce/2017-December/000008.html', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://h5l.org/advisories.html?show=2017-12-08', 'name': 'http://h5l.org/advisories.html?show=2017-12-08', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'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:a:heimdal_project:heimdal:*:*:*:*:*:*:*:*', 'versionEndIncluding': '7.4.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In Heimdal through 7.4, remote unauthenticated attackers are able to crash the KDC by sending a crafted UDP packet containing empty data fields for client name or realm. The parser would unconditionally dereference NULL pointers in that case, leading to a segmentation fault. This is related to the _kdc_as_rep function in kdc/kerberos5.c and the der_length_visible_string function in lib/asn1/der_length.c.'}]
2017-12-30T02:29Z
2017-12-06T15:29Z
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
Viktor Dukhovni
2017-12-05 18:49:50-05:00
Security: Avoid NULL structure pointer member dereference This can happen in the error path when processing malformed AS requests with a NULL client name. Bug originally introduced on Fri Feb 13 09:26:01 2015 +0100 in commit: a873e21d7c06f22943a90a41dc733ae76799390d kdc: base _kdc_fast_mk_error() on krb5_mk_error_ext() Original patch by Jeffrey Altman <[email protected]>
1a6a6e462dc2ac6111f9e02c6852ddec4849b887
False
heimdal/heimdal
Heimdal
2009-09-27 21:15:13
2022-08-25 19:30:33
https://heimdal.software
heimdal
250.0
151.0
_kdc_as_rep
_kdc_as_rep( kdc_request_t r , krb5_data * reply , const char * from , struct sockaddr * from_addr , int datagram_reply)
['r', 'reply', 'from', 'from_addr', 'datagram_reply']
_kdc_as_rep(kdc_request_t r, krb5_data *reply, const char *from, struct sockaddr *from_addr, int datagram_reply) { krb5_context context = r->context; krb5_kdc_configuration *config = r->config; KDC_REQ *req = &r->req; KDC_REQ_BODY *b = NULL; AS_REP rep; KDCOptions f; krb5_enctype setype; krb5_error_code ret = 0; Key *skey; int found_pa = 0; int i, flags = HDB_F_FOR_AS_REQ; METHOD_DATA error_method; const PA_DATA *pa; memset(&rep, 0, sizeof(rep)); error_method.len = 0; error_method.val = NULL; /* * Look for FAST armor and unwrap */ ret = _kdc_fast_unwrap_request(r); if (ret) { _kdc_r_log(r, 0, "FAST unwrap request from %s failed: %d", from, ret); goto out; } b = &req->req_body; f = b->kdc_options; if (f.canonicalize) flags |= HDB_F_CANON; if(b->sname == NULL){ ret = KRB5KRB_ERR_GENERIC; _kdc_set_e_text(r, "No server in request"); } else{ ret = _krb5_principalname2krb5_principal (context, &r->server_princ, *(b->sname), b->realm); if (ret == 0) ret = krb5_unparse_name(context, r->server_princ, &r->server_name); } if (ret) { kdc_log(context, config, 0, "AS-REQ malformed server name from %s", from); goto out; } if(b->cname == NULL){ ret = KRB5KRB_ERR_GENERIC; _kdc_set_e_text(r, "No client in request"); } else { ret = _krb5_principalname2krb5_principal (context, &r->client_princ, *(b->cname), b->realm); if (ret) goto out; ret = krb5_unparse_name(context, r->client_princ, &r->client_name); } if (ret) { kdc_log(context, config, 0, "AS-REQ malformed client name from %s", from); goto out; } kdc_log(context, config, 0, "AS-REQ %s from %s for %s", r->client_name, from, r->server_name); /* * */ if (_kdc_is_anonymous(context, r->client_princ)) { if (!_kdc_is_anon_request(b)) { kdc_log(context, config, 0, "Anonymous ticket w/o anonymous flag"); ret = KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN; goto out; } } else if (_kdc_is_anon_request(b)) { kdc_log(context, config, 0, "Request for a anonymous ticket with non " "anonymous client name: %s", r->client_name); ret = KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN; goto out; } /* * */ ret = _kdc_db_fetch(context, config, r->client_princ, HDB_F_GET_CLIENT | flags, NULL, &r->clientdb, &r->client); if(ret == HDB_ERR_NOT_FOUND_HERE) { kdc_log(context, config, 5, "client %s does not have secrets at this KDC, need to proxy", r->client_name); goto out; } else if (ret == HDB_ERR_WRONG_REALM) { char *fixed_client_name = NULL; ret = krb5_unparse_name(context, r->client->entry.principal, &fixed_client_name); if (ret) { goto out; } kdc_log(context, config, 0, "WRONG_REALM - %s -> %s", r->client_name, fixed_client_name); free(fixed_client_name); ret = _kdc_fast_mk_error(context, r, &error_method, r->armor_crypto, &req->req_body, KRB5_KDC_ERR_WRONG_REALM, NULL, r->server_princ, NULL, &r->client->entry.principal->realm, NULL, NULL, reply); goto out; } else if(ret){ const char *msg = krb5_get_error_message(context, ret); kdc_log(context, config, 0, "UNKNOWN -- %s: %s", r->client_name, msg); krb5_free_error_message(context, msg); ret = KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN; goto out; } ret = _kdc_db_fetch(context, config, r->server_princ, HDB_F_GET_SERVER|HDB_F_GET_KRBTGT | flags, NULL, NULL, &r->server); if(ret == HDB_ERR_NOT_FOUND_HERE) { kdc_log(context, config, 5, "target %s does not have secrets at this KDC, need to proxy", r->server_name); goto out; } else if(ret){ const char *msg = krb5_get_error_message(context, ret); kdc_log(context, config, 0, "UNKNOWN -- %s: %s", r->server_name, msg); krb5_free_error_message(context, msg); ret = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN; goto out; } /* * Select a session enctype from the list of the crypto system * supported enctypes that is supported by the client and is one of * the enctype of the enctype of the service (likely krbtgt). * * The latter is used as a hint of what enctypes all KDC support, * to make sure a newer version of KDC won't generate a session * enctype that an older version of a KDC in the same realm can't * decrypt. */ ret = _kdc_find_etype(context, krb5_principal_is_krbtgt(context, r->server_princ) ? config->tgt_use_strongest_session_key : config->svc_use_strongest_session_key, FALSE, r->client, b->etype.val, b->etype.len, &r->sessionetype, NULL); if (ret) { kdc_log(context, config, 0, "Client (%s) from %s has no common enctypes with KDC " "to use for the session key", r->client_name, from); goto out; } /* * Pre-auth processing */ if(req->padata){ unsigned int n; log_patypes(context, config, req->padata); /* Check if preauth matching */ for (n = 0; !found_pa && n < sizeof(pat) / sizeof(pat[0]); n++) { if (pat[n].validate == NULL) continue; if (r->armor_crypto == NULL && (pat[n].flags & PA_REQ_FAST)) continue; kdc_log(context, config, 5, "Looking for %s pa-data -- %s", pat[n].name, r->client_name); i = 0; pa = _kdc_find_padata(req, &i, pat[n].type); if (pa) { ret = pat[n].validate(r, pa); if (ret != 0) { goto out; } kdc_log(context, config, 0, "%s pre-authentication succeeded -- %s", pat[n].name, r->client_name); found_pa = 1; r->et.flags.pre_authent = 1; } } } if (found_pa == 0) { Key *ckey = NULL; size_t n; for (n = 0; n < sizeof(pat) / sizeof(pat[0]); n++) { if ((pat[n].flags & PA_ANNOUNCE) == 0) continue; ret = krb5_padata_add(context, &error_method, pat[n].type, NULL, 0); if (ret) goto out; } /* * If there is a client key, send ETYPE_INFO{,2} */ ret = _kdc_find_etype(context, config->preauth_use_strongest_session_key, TRUE, r->client, b->etype.val, b->etype.len, NULL, &ckey); if (ret == 0) { /* * RFC4120 requires: * - If the client only knows about old enctypes, then send * both info replies (we send 'info' first in the list). * - If the client is 'modern', because it knows about 'new' * enctype types, then only send the 'info2' reply. * * Before we send the full list of etype-info data, we pick * the client key we would have used anyway below, just pick * that instead. */ if (older_enctype(ckey->key.keytype)) { ret = get_pa_etype_info(context, config, &error_method, ckey); if (ret) goto out; } ret = get_pa_etype_info2(context, config, &error_method, ckey); if (ret) goto out; } /* * send requre preauth is its required or anon is requested, * anon is today only allowed via preauth mechanisms. */ if (require_preauth_p(r) || _kdc_is_anon_request(b)) { ret = KRB5KDC_ERR_PREAUTH_REQUIRED; _kdc_set_e_text(r, "Need to use PA-ENC-TIMESTAMP/PA-PK-AS-REQ"); goto out; } if (ckey == NULL) { ret = KRB5KDC_ERR_CLIENT_NOTYET; _kdc_set_e_text(r, "Doesn't have a client key available"); goto out; } krb5_free_keyblock_contents(r->context, &r->reply_key); ret = krb5_copy_keyblock_contents(r->context, &ckey->key, &r->reply_key); if (ret) goto out; } if (r->clientdb->hdb_auth_status) { r->clientdb->hdb_auth_status(context, r->clientdb, r->client, HDB_AUTH_SUCCESS); } /* * Verify flags after the user been required to prove its identity * with in a preauth mech. */ ret = _kdc_check_access(context, config, r->client, r->client_name, r->server, r->server_name, req, &error_method); if(ret) goto out; /* * Select the best encryption type for the KDC with out regard to * the client since the client never needs to read that data. */ ret = _kdc_get_preferred_key(context, config, r->server, r->server_name, &setype, &skey); if(ret) goto out; if(f.renew || f.validate || f.proxy || f.forwarded || f.enc_tkt_in_skey || (_kdc_is_anon_request(b) && !config->allow_anonymous)) { ret = KRB5KDC_ERR_BADOPTION; _kdc_set_e_text(r, "Bad KDC options"); goto out; } /* * Build reply */ rep.pvno = 5; rep.msg_type = krb_as_rep; if (_kdc_is_anonymous(context, r->client_princ)) { Realm anon_realm=KRB5_ANON_REALM; ret = copy_Realm(&anon_realm, &rep.crealm); } else ret = copy_Realm(&r->client->entry.principal->realm, &rep.crealm); if (ret) goto out; ret = _krb5_principal2principalname(&rep.cname, r->client->entry.principal); if (ret) goto out; rep.ticket.tkt_vno = 5; ret = copy_Realm(&r->server->entry.principal->realm, &rep.ticket.realm); if (ret) goto out; _krb5_principal2principalname(&rep.ticket.sname, r->server->entry.principal); /* java 1.6 expects the name to be the same type, lets allow that * uncomplicated name-types. */ #define CNT(sp,t) (((sp)->sname->name_type) == KRB5_NT_##t) if (CNT(b, UNKNOWN) || CNT(b, PRINCIPAL) || CNT(b, SRV_INST) || CNT(b, SRV_HST) || CNT(b, SRV_XHST)) rep.ticket.sname.name_type = b->sname->name_type; #undef CNT r->et.flags.initial = 1; if(r->client->entry.flags.forwardable && r->server->entry.flags.forwardable) r->et.flags.forwardable = f.forwardable; else if (f.forwardable) { _kdc_set_e_text(r, "Ticket may not be forwardable"); ret = KRB5KDC_ERR_POLICY; goto out; } if(r->client->entry.flags.proxiable && r->server->entry.flags.proxiable) r->et.flags.proxiable = f.proxiable; else if (f.proxiable) { _kdc_set_e_text(r, "Ticket may not be proxiable"); ret = KRB5KDC_ERR_POLICY; goto out; } if(r->client->entry.flags.postdate && r->server->entry.flags.postdate) r->et.flags.may_postdate = f.allow_postdate; else if (f.allow_postdate){ _kdc_set_e_text(r, "Ticket may not be postdate"); ret = KRB5KDC_ERR_POLICY; goto out; } /* check for valid set of addresses */ if(!_kdc_check_addresses(context, config, b->addresses, from_addr)) { _kdc_set_e_text(r, "Bad address list in requested"); ret = KRB5KRB_AP_ERR_BADADDR; goto out; } ret = copy_PrincipalName(&rep.cname, &r->et.cname); if (ret) goto out; ret = copy_Realm(&rep.crealm, &r->et.crealm); if (ret) goto out; { time_t start; time_t t; start = r->et.authtime = kdc_time; if(f.postdated && req->req_body.from){ ALLOC(r->et.starttime); start = *r->et.starttime = *req->req_body.from; r->et.flags.invalid = 1; r->et.flags.postdated = 1; /* XXX ??? */ } _kdc_fix_time(&b->till); t = *b->till; /* be careful not overflowing */ if(r->client->entry.max_life) t = start + min(t - start, *r->client->entry.max_life); if(r->server->entry.max_life) t = start + min(t - start, *r->server->entry.max_life); #if 0 t = min(t, start + realm->max_life); #endif r->et.endtime = t; if(f.renewable_ok && r->et.endtime < *b->till){ f.renewable = 1; if(b->rtime == NULL){ ALLOC(b->rtime); *b->rtime = 0; } if(*b->rtime < *b->till) *b->rtime = *b->till; } if(f.renewable && b->rtime){ t = *b->rtime; if(t == 0) t = MAX_TIME; if(r->client->entry.max_renew) t = start + min(t - start, *r->client->entry.max_renew); if(r->server->entry.max_renew) t = start + min(t - start, *r->server->entry.max_renew); #if 0 t = min(t, start + realm->max_renew); #endif ALLOC(r->et.renew_till); *r->et.renew_till = t; r->et.flags.renewable = 1; } } if (_kdc_is_anon_request(b)) r->et.flags.anonymous = 1; if(b->addresses){ ALLOC(r->et.caddr); copy_HostAddresses(b->addresses, r->et.caddr); } r->et.transited.tr_type = DOMAIN_X500_COMPRESS; krb5_data_zero(&r->et.transited.contents); /* The MIT ASN.1 library (obviously) doesn't tell lengths encoded * as 0 and as 0x80 (meaning indefinite length) apart, and is thus * incapable of correctly decoding SEQUENCE OF's of zero length. * * To fix this, always send at least one no-op last_req * * If there's a pw_end or valid_end we will use that, * otherwise just a dummy lr. */ r->ek.last_req.val = malloc(2 * sizeof(*r->ek.last_req.val)); if (r->ek.last_req.val == NULL) { ret = ENOMEM; goto out; } r->ek.last_req.len = 0; if (r->client->entry.pw_end && (config->kdc_warn_pwexpire == 0 || kdc_time + config->kdc_warn_pwexpire >= *r->client->entry.pw_end)) { r->ek.last_req.val[r->ek.last_req.len].lr_type = LR_PW_EXPTIME; r->ek.last_req.val[r->ek.last_req.len].lr_value = *r->client->entry.pw_end; ++r->ek.last_req.len; } if (r->client->entry.valid_end) { r->ek.last_req.val[r->ek.last_req.len].lr_type = LR_ACCT_EXPTIME; r->ek.last_req.val[r->ek.last_req.len].lr_value = *r->client->entry.valid_end; ++r->ek.last_req.len; } if (r->ek.last_req.len == 0) { r->ek.last_req.val[r->ek.last_req.len].lr_type = LR_NONE; r->ek.last_req.val[r->ek.last_req.len].lr_value = 0; ++r->ek.last_req.len; } r->ek.nonce = b->nonce; if (r->client->entry.valid_end || r->client->entry.pw_end) { ALLOC(r->ek.key_expiration); if (r->client->entry.valid_end) { if (r->client->entry.pw_end) *r->ek.key_expiration = min(*r->client->entry.valid_end, *r->client->entry.pw_end); else *r->ek.key_expiration = *r->client->entry.valid_end; } else *r->ek.key_expiration = *r->client->entry.pw_end; } else r->ek.key_expiration = NULL; r->ek.flags = r->et.flags; r->ek.authtime = r->et.authtime; if (r->et.starttime) { ALLOC(r->ek.starttime); *r->ek.starttime = *r->et.starttime; } r->ek.endtime = r->et.endtime; if (r->et.renew_till) { ALLOC(r->ek.renew_till); *r->ek.renew_till = *r->et.renew_till; } ret = copy_Realm(&rep.ticket.realm, &r->ek.srealm); if (ret) goto out; ret = copy_PrincipalName(&rep.ticket.sname, &r->ek.sname); if (ret) goto out; if(r->et.caddr){ ALLOC(r->ek.caddr); copy_HostAddresses(r->et.caddr, r->ek.caddr); } /* * Check and session and reply keys */ if (r->session_key.keytype == ETYPE_NULL) { ret = krb5_generate_random_keyblock(context, r->sessionetype, &r->session_key); if (ret) goto out; } if (r->reply_key.keytype == ETYPE_NULL) { _kdc_set_e_text(r, "Client have no reply key"); ret = KRB5KDC_ERR_CLIENT_NOTYET; goto out; } ret = copy_EncryptionKey(&r->session_key, &r->et.key); if (ret) goto out; ret = copy_EncryptionKey(&r->session_key, &r->ek.key); if (ret) goto out; if (r->outpadata.len) { ALLOC(rep.padata); if (rep.padata == NULL) { ret = ENOMEM; goto out; } ret = copy_METHOD_DATA(&r->outpadata, rep.padata); if (ret) goto out; } /* Add the PAC */ if (send_pac_p(context, req)) { generate_pac(r, skey); } _kdc_log_timestamp(context, config, "AS-REQ", r->et.authtime, r->et.starttime, r->et.endtime, r->et.renew_till); /* do this as the last thing since this signs the EncTicketPart */ ret = _kdc_add_KRB5SignedPath(context, config, r->server, setype, r->client->entry.principal, NULL, NULL, &r->et); if (ret) goto out; log_as_req(context, config, r->reply_key.keytype, setype, b); /* * We always say we support FAST/enc-pa-rep */ r->et.flags.enc_pa_rep = r->ek.flags.enc_pa_rep = 1; /* * Add REQ_ENC_PA_REP if client supports it */ i = 0; pa = _kdc_find_padata(req, &i, KRB5_PADATA_REQ_ENC_PA_REP); if (pa) { ret = add_enc_pa_rep(r); if (ret) { const char *msg = krb5_get_error_message(r->context, ret); _kdc_r_log(r, 0, "add_enc_pa_rep failed: %s: %d", msg, ret); krb5_free_error_message(r->context, msg); goto out; } } /* * */ ret = _kdc_encode_reply(context, config, r->armor_crypto, req->req_body.nonce, &rep, &r->et, &r->ek, setype, r->server->entry.kvno, &skey->key, r->client->entry.kvno, &r->reply_key, 0, &r->e_text, reply); if (ret) goto out; /* * Check if message too large */ if (datagram_reply && reply->length > config->max_datagram_reply_length) { krb5_data_free(reply); ret = KRB5KRB_ERR_RESPONSE_TOO_BIG; _kdc_set_e_text(r, "Reply packet too large"); } out: free_AS_REP(&rep); /* * In case of a non proxy error, build an error message. */ if(ret != 0 && ret != HDB_ERR_NOT_FOUND_HERE && reply->length == 0) { ret = _kdc_fast_mk_error(context, r, &error_method, r->armor_crypto, &req->req_body, ret, r->e_text, r->server_princ, &r->client_princ->name, &r->client_princ->realm, NULL, NULL, reply); if (ret) goto out2; } out2: free_EncTicketPart(&r->et); free_EncKDCRepPart(&r->ek); free_KDCFastState(&r->fast); if (error_method.len) free_METHOD_DATA(&error_method); if (r->outpadata.len) free_METHOD_DATA(&r->outpadata); if (r->client_princ) { krb5_free_principal(context, r->client_princ); r->client_princ = NULL; } if (r->client_name) { free(r->client_name); r->client_name = NULL; } if (r->server_princ){ krb5_free_principal(context, r->server_princ); r->server_princ = NULL; } if (r->server_name) { free(r->server_name); r->server_name = NULL; } if (r->client) _kdc_free_ent(context, r->client); if (r->server) _kdc_free_ent(context, r->server); if (r->armor_crypto) { krb5_crypto_destroy(r->context, r->armor_crypto); r->armor_crypto = NULL; } krb5_free_keyblock_contents(r->context, &r->reply_key); krb5_free_keyblock_contents(r->context, &r->session_key); return ret; }
3751
True
1
CVE-2018-5360
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.0/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://sourceforge.net/p/graphicsmagick/bugs/540/', 'name': 'https://sourceforge.net/p/graphicsmagick/bugs/540/', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/739dcd28a061738b317c1e9f91029d9cbc157159', 'name': 'https://gitlab.com/libtiff/libtiff/commit/739dcd28a061738b317c1e9f91029d9cbc157159', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2500', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2500', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.0.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:graphicsmagick:graphicsmagick:1.3.27:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'LibTIFF before 4.0.6 mishandles the reading of TIFF files, as demonstrated by a heap-based buffer over-read in the ReadTIFFImage function in coders/tiff.c in GraphicsMagick 1.3.27.'}]
2019-04-22T16:25Z
2018-01-14T02:29Z
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
Even Rouault
2016-10-25 21:35:15+00:00
* libtiff/tif_dir.c: discard values of SMinSampleValue and SMaxSampleValue when they have been read and the value of SamplesPerPixel is changed afterwards (like when reading a OJPEG compressed image with a missing SamplesPerPixel tag, and whose photometric is RGB or YCbCr, forcing SamplesPerPixel being 3). Otherwise when rewriting the directory (for example with tiffset, we will expect 3 values whereas the array had been allocated with just one), thus causing a out of bound read access. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500 (CVE-2014-8127, duplicate: CVE-2016-3658) * libtiff/tif_write.c: avoid null pointer dereference on td_stripoffset when writing directory, if FIELD_STRIPOFFSETS was artificially set for a hack case in OJPEG case. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2500 (CVE-2014-8127, duplicate: CVE-2016-3658)
739dcd28a061738b317c1e9f91029d9cbc157159
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
TIFFWriteDirectorySec
TIFFWriteDirectorySec( TIFF * tif , int isimage , int imagedone , uint64 * pdiroff)
['tif', 'isimage', 'imagedone', 'pdiroff']
TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff) { static const char module[] = "TIFFWriteDirectorySec"; uint32 ndir; TIFFDirEntry* dir; uint32 dirsize; void* dirmem; uint32 m; if (tif->tif_mode == O_RDONLY) return (1); _TIFFFillStriles( tif ); /* * Clear write state so that subsequent images with * different characteristics get the right buffers * setup for them. */ if (imagedone) { if (tif->tif_flags & TIFF_POSTENCODE) { tif->tif_flags &= ~TIFF_POSTENCODE; if (!(*tif->tif_postencode)(tif)) { TIFFErrorExt(tif->tif_clientdata,module, "Error post-encoding before directory write"); return (0); } } (*tif->tif_close)(tif); /* shutdown encoder */ /* * Flush any data that might have been written * by the compression close+cleanup routines. But * be careful not to write stuff if we didn't add data * in the previous steps as the "rawcc" data may well be * a previously read tile/strip in mixed read/write mode. */ if (tif->tif_rawcc > 0 && (tif->tif_flags & TIFF_BEENWRITING) != 0 ) { if( !TIFFFlushData1(tif) ) { TIFFErrorExt(tif->tif_clientdata, module, "Error flushing data before directory write"); return (0); } } if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { _TIFFfree(tif->tif_rawdata); tif->tif_rawdata = NULL; tif->tif_rawcc = 0; tif->tif_rawdatasize = 0; tif->tif_rawdataoff = 0; tif->tif_rawdataloaded = 0; } tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP); } dir=NULL; dirmem=NULL; dirsize=0; while (1) { ndir=0; if (isimage) { if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) { if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_IMAGEWIDTH,tif->tif_dir.td_imagewidth)) goto bad; if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_IMAGELENGTH,tif->tif_dir.td_imagelength)) goto bad; } if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) { if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_TILEWIDTH,tif->tif_dir.td_tilewidth)) goto bad; if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_TILELENGTH,tif->tif_dir.td_tilelength)) goto bad; } if (TIFFFieldSet(tif,FIELD_RESOLUTION)) { if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_XRESOLUTION,tif->tif_dir.td_xresolution)) goto bad; if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_YRESOLUTION,tif->tif_dir.td_yresolution)) goto bad; } if (TIFFFieldSet(tif,FIELD_POSITION)) { if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_XPOSITION,tif->tif_dir.td_xposition)) goto bad; if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_YPOSITION,tif->tif_dir.td_yposition)) goto bad; } if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) { if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,TIFFTAG_SUBFILETYPE,tif->tif_dir.td_subfiletype)) goto bad; } if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) { if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_BITSPERSAMPLE,tif->tif_dir.td_bitspersample)) goto bad; } if (TIFFFieldSet(tif,FIELD_COMPRESSION)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_COMPRESSION,tif->tif_dir.td_compression)) goto bad; } if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_PHOTOMETRIC,tif->tif_dir.td_photometric)) goto bad; } if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_THRESHHOLDING,tif->tif_dir.td_threshholding)) goto bad; } if (TIFFFieldSet(tif,FIELD_FILLORDER)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_FILLORDER,tif->tif_dir.td_fillorder)) goto bad; } if (TIFFFieldSet(tif,FIELD_ORIENTATION)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_ORIENTATION,tif->tif_dir.td_orientation)) goto bad; } if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_SAMPLESPERPIXEL,tif->tif_dir.td_samplesperpixel)) goto bad; } if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) { if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_ROWSPERSTRIP,tif->tif_dir.td_rowsperstrip)) goto bad; } if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE)) { if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_MINSAMPLEVALUE,tif->tif_dir.td_minsamplevalue)) goto bad; } if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) { if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_MAXSAMPLEVALUE,tif->tif_dir.td_maxsamplevalue)) goto bad; } if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_PLANARCONFIG,tif->tif_dir.td_planarconfig)) goto bad; } if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_RESOLUTIONUNIT,tif->tif_dir.td_resolutionunit)) goto bad; } if (TIFFFieldSet(tif,FIELD_PAGENUMBER)) { if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_PAGENUMBER,2,&tif->tif_dir.td_pagenumber[0])) goto bad; } if (TIFFFieldSet(tif,FIELD_STRIPBYTECOUNTS)) { if (!isTiled(tif)) { if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount)) goto bad; } else { if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount)) goto bad; } } if (TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) { if (!isTiled(tif)) { if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset)) goto bad; } else { if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset)) goto bad; } } if (TIFFFieldSet(tif,FIELD_COLORMAP)) { if (!TIFFWriteDirectoryTagColormap(tif,&ndir,dir)) goto bad; } if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES)) { if (tif->tif_dir.td_extrasamples) { uint16 na; uint16* nb; TIFFGetFieldDefaulted(tif,TIFFTAG_EXTRASAMPLES,&na,&nb); if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_EXTRASAMPLES,na,nb)) goto bad; } } if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) { if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_SAMPLEFORMAT,tif->tif_dir.td_sampleformat)) goto bad; } if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) { if (!TIFFWriteDirectoryTagSampleformatArray(tif,&ndir,dir,TIFFTAG_SMINSAMPLEVALUE,tif->tif_dir.td_samplesperpixel,tif->tif_dir.td_sminsamplevalue)) goto bad; } if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) { if (!TIFFWriteDirectoryTagSampleformatArray(tif,&ndir,dir,TIFFTAG_SMAXSAMPLEVALUE,tif->tif_dir.td_samplesperpixel,tif->tif_dir.td_smaxsamplevalue)) goto bad; } if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH)) { if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,TIFFTAG_IMAGEDEPTH,tif->tif_dir.td_imagedepth)) goto bad; } if (TIFFFieldSet(tif,FIELD_TILEDEPTH)) { if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,TIFFTAG_TILEDEPTH,tif->tif_dir.td_tiledepth)) goto bad; } if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS)) { if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_HALFTONEHINTS,2,&tif->tif_dir.td_halftonehints[0])) goto bad; } if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING)) { if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_YCBCRSUBSAMPLING,2,&tif->tif_dir.td_ycbcrsubsampling[0])) goto bad; } if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) { if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_YCBCRPOSITIONING,tif->tif_dir.td_ycbcrpositioning)) goto bad; } if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) { if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,TIFFTAG_REFERENCEBLACKWHITE,6,tif->tif_dir.td_refblackwhite)) goto bad; } if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) { if (!TIFFWriteDirectoryTagTransferfunction(tif,&ndir,dir)) goto bad; } if (TIFFFieldSet(tif,FIELD_INKNAMES)) { if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,TIFFTAG_INKNAMES,tif->tif_dir.td_inknameslen,tif->tif_dir.td_inknames)) goto bad; } if (TIFFFieldSet(tif,FIELD_SUBIFD)) { if (!TIFFWriteDirectoryTagSubifd(tif,&ndir,dir)) goto bad; } { uint32 n; for (n=0; n<tif->tif_nfields; n++) { const TIFFField* o; o = tif->tif_fields[n]; if ((o->field_bit>=FIELD_CODEC)&&(TIFFFieldSet(tif,o->field_bit))) { switch (o->get_field_type) { case TIFF_SETGET_ASCII: { uint32 pa; char* pb; assert(o->field_type==TIFF_ASCII); assert(o->field_readcount==TIFF_VARIABLE); assert(o->field_passcount==0); TIFFGetField(tif,o->field_tag,&pb); pa=(uint32)(strlen(pb)); if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,(uint16)o->field_tag,pa,pb)) goto bad; } break; case TIFF_SETGET_UINT16: { uint16 p; assert(o->field_type==TIFF_SHORT); assert(o->field_readcount==1); assert(o->field_passcount==0); TIFFGetField(tif,o->field_tag,&p); if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,(uint16)o->field_tag,p)) goto bad; } break; case TIFF_SETGET_UINT32: { uint32 p; assert(o->field_type==TIFF_LONG); assert(o->field_readcount==1); assert(o->field_passcount==0); TIFFGetField(tif,o->field_tag,&p); if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,(uint16)o->field_tag,p)) goto bad; } break; case TIFF_SETGET_C32_UINT8: { uint32 pa; void* pb; assert(o->field_type==TIFF_UNDEFINED); assert(o->field_readcount==TIFF_VARIABLE2); assert(o->field_passcount==1); TIFFGetField(tif,o->field_tag,&pa,&pb); if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,(uint16)o->field_tag,pa,pb)) goto bad; } break; default: assert(0); /* we should never get here */ break; } } } } } for (m=0; m<(uint32)(tif->tif_dir.td_customValueCount); m++) { uint16 tag = (uint16)tif->tif_dir.td_customValues[m].info->field_tag; uint32 count = tif->tif_dir.td_customValues[m].count; switch (tif->tif_dir.td_customValues[m].info->field_type) { case TIFF_ASCII: if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_UNDEFINED: if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_BYTE: if (!TIFFWriteDirectoryTagByteArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_SBYTE: if (!TIFFWriteDirectoryTagSbyteArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_SHORT: if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_SSHORT: if (!TIFFWriteDirectoryTagSshortArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_LONG: if (!TIFFWriteDirectoryTagLongArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_SLONG: if (!TIFFWriteDirectoryTagSlongArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_LONG8: if (!TIFFWriteDirectoryTagLong8Array(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_SLONG8: if (!TIFFWriteDirectoryTagSlong8Array(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_RATIONAL: if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_SRATIONAL: if (!TIFFWriteDirectoryTagSrationalArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_FLOAT: if (!TIFFWriteDirectoryTagFloatArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_DOUBLE: if (!TIFFWriteDirectoryTagDoubleArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_IFD: if (!TIFFWriteDirectoryTagIfdArray(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; case TIFF_IFD8: if (!TIFFWriteDirectoryTagIfdIfd8Array(tif,&ndir,dir,tag,count,tif->tif_dir.td_customValues[m].value)) goto bad; break; default: assert(0); /* we should never get here */ break; } } if (dir!=NULL) break; dir=_TIFFmalloc(ndir*sizeof(TIFFDirEntry)); if (dir==NULL) { TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); goto bad; } if (isimage) { if ((tif->tif_diroff==0)&&(!TIFFLinkDirectory(tif))) goto bad; } else tif->tif_diroff=(TIFFSeekFile(tif,0,SEEK_END)+1)&(~((toff_t)1)); if (pdiroff!=NULL) *pdiroff=tif->tif_diroff; if (!(tif->tif_flags&TIFF_BIGTIFF)) dirsize=2+ndir*12+4; else dirsize=8+ndir*20+8; tif->tif_dataoff=tif->tif_diroff+dirsize; if (!(tif->tif_flags&TIFF_BIGTIFF)) tif->tif_dataoff=(uint32)tif->tif_dataoff; if ((tif->tif_dataoff<tif->tif_diroff)||(tif->tif_dataoff<(uint64)dirsize)) { TIFFErrorExt(tif->tif_clientdata,module,"Maximum TIFF file size exceeded"); goto bad; } if (tif->tif_dataoff&1) tif->tif_dataoff++; if (isimage) tif->tif_curdir++; } if (isimage) { if (TIFFFieldSet(tif,FIELD_SUBIFD)&&(tif->tif_subifdoff==0)) { uint32 na; TIFFDirEntry* nb; for (na=0, nb=dir; ; na++, nb++) { assert(na<ndir); if (nb->tdir_tag==TIFFTAG_SUBIFD) break; } if (!(tif->tif_flags&TIFF_BIGTIFF)) tif->tif_subifdoff=tif->tif_diroff+2+na*12+8; else tif->tif_subifdoff=tif->tif_diroff+8+na*20+12; } } dirmem=_TIFFmalloc(dirsize); if (dirmem==NULL) { TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); goto bad; } if (!(tif->tif_flags&TIFF_BIGTIFF)) { uint8* n; uint32 nTmp; TIFFDirEntry* o; n=dirmem; *(uint16*)n=(uint16)ndir; if (tif->tif_flags&TIFF_SWAB) TIFFSwabShort((uint16*)n); n+=2; o=dir; for (m=0; m<ndir; m++) { *(uint16*)n=o->tdir_tag; if (tif->tif_flags&TIFF_SWAB) TIFFSwabShort((uint16*)n); n+=2; *(uint16*)n=o->tdir_type; if (tif->tif_flags&TIFF_SWAB) TIFFSwabShort((uint16*)n); n+=2; nTmp = (uint32)o->tdir_count; _TIFFmemcpy(n,&nTmp,4); if (tif->tif_flags&TIFF_SWAB) TIFFSwabLong((uint32*)n); n+=4; /* This is correct. The data has been */ /* swabbed previously in TIFFWriteDirectoryTagData */ _TIFFmemcpy(n,&o->tdir_offset,4); n+=4; o++; } nTmp = (uint32)tif->tif_nextdiroff; if (tif->tif_flags&TIFF_SWAB) TIFFSwabLong(&nTmp); _TIFFmemcpy(n,&nTmp,4); } else { uint8* n; TIFFDirEntry* o; n=dirmem; *(uint64*)n=ndir; if (tif->tif_flags&TIFF_SWAB) TIFFSwabLong8((uint64*)n); n+=8; o=dir; for (m=0; m<ndir; m++) { *(uint16*)n=o->tdir_tag; if (tif->tif_flags&TIFF_SWAB) TIFFSwabShort((uint16*)n); n+=2; *(uint16*)n=o->tdir_type; if (tif->tif_flags&TIFF_SWAB) TIFFSwabShort((uint16*)n); n+=2; _TIFFmemcpy(n,&o->tdir_count,8); if (tif->tif_flags&TIFF_SWAB) TIFFSwabLong8((uint64*)n); n+=8; _TIFFmemcpy(n,&o->tdir_offset,8); n+=8; o++; } _TIFFmemcpy(n,&tif->tif_nextdiroff,8); if (tif->tif_flags&TIFF_SWAB) TIFFSwabLong8((uint64*)n); } _TIFFfree(dir); dir=NULL; if (!SeekOK(tif,tif->tif_diroff)) { TIFFErrorExt(tif->tif_clientdata,module,"IO error writing directory"); goto bad; } if (!WriteOK(tif,dirmem,(tmsize_t)dirsize)) { TIFFErrorExt(tif->tif_clientdata,module,"IO error writing directory"); goto bad; } _TIFFfree(dirmem); if (imagedone) { TIFFFreeDirectory(tif); tif->tif_flags &= ~TIFF_DIRTYDIRECT; tif->tif_flags &= ~TIFF_DIRTYSTRIP; (*tif->tif_cleanup)(tif); /* * Reset directory-related state for subsequent * directories. */ TIFFCreateDirectory(tif); } return(1); bad: if (dir!=NULL) _TIFFfree(dir); if (dirmem!=NULL) _TIFFfree(dirmem); return(0); }
3711
True
1
CVE-2017-18013
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://gitlab.com/libtiff/libtiff/commit/c6f41df7b581402dfba3c19a1e3df4454c551a01', 'name': 'https://gitlab.com/libtiff/libtiff/commit/c6f41df7b581402dfba3c19a1e3df4454c551a01', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2770', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2770', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/102345', 'name': '102345', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.debian.org/security/2018/dsa-4100', 'name': 'DSA-4100', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/01/msg00034.html', 'name': '[debian-lts-announce] 20180127 [SECURITY] [DLA 1260-1] tiff3 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/01/msg00033.html', 'name': '[debian-lts-announce] 20180127 [SECURITY] [DLA 1259-1] tiff security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/3602-1/', 'name': 'USN-3602-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/3606-1/', 'name': 'USN-3606-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In LibTIFF 4.0.9, there is a Null-Pointer Dereference in the tif_print.c TIFFPrintDirectory function, as demonstrated by a tiffinfo crash.'}]
2018-03-28T01:29Z
2018-01-01T08:29Z
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
Even Rouault
2017-12-31 15:09:41+01:00
libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770
c6f41df7b581402dfba3c19a1e3df4454c551a01
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
TIFFPrintDirectory
TIFFPrintDirectory( TIFF * tif , FILE * fd , long flags)
['tif', 'fd', 'flags']
TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) { TIFFDirectory *td = &tif->tif_dir; char *sep; long l, n; #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, "TIFF Directory at offset 0x%I64x (%I64u)\n", (unsigned __int64) tif->tif_diroff, (unsigned __int64) tif->tif_diroff); #else fprintf(fd, "TIFF Directory at offset 0x%llx (%llu)\n", (unsigned long long) tif->tif_diroff, (unsigned long long) tif->tif_diroff); #endif if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) { fprintf(fd, " Subfile Type:"); sep = " "; if (td->td_subfiletype & FILETYPE_REDUCEDIMAGE) { fprintf(fd, "%sreduced-resolution image", sep); sep = "/"; } if (td->td_subfiletype & FILETYPE_PAGE) { fprintf(fd, "%smulti-page document", sep); sep = "/"; } if (td->td_subfiletype & FILETYPE_MASK) fprintf(fd, "%stransparency mask", sep); fprintf(fd, " (%lu = 0x%lx)\n", (unsigned long) td->td_subfiletype, (long) td->td_subfiletype); } if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) { fprintf(fd, " Image Width: %lu Image Length: %lu", (unsigned long) td->td_imagewidth, (unsigned long) td->td_imagelength); if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH)) fprintf(fd, " Image Depth: %lu", (unsigned long) td->td_imagedepth); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) { fprintf(fd, " Tile Width: %lu Tile Length: %lu", (unsigned long) td->td_tilewidth, (unsigned long) td->td_tilelength); if (TIFFFieldSet(tif,FIELD_TILEDEPTH)) fprintf(fd, " Tile Depth: %lu", (unsigned long) td->td_tiledepth); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_RESOLUTION)) { fprintf(fd, " Resolution: %g, %g", td->td_xresolution, td->td_yresolution); if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) { switch (td->td_resolutionunit) { case RESUNIT_NONE: fprintf(fd, " (unitless)"); break; case RESUNIT_INCH: fprintf(fd, " pixels/inch"); break; case RESUNIT_CENTIMETER: fprintf(fd, " pixels/cm"); break; default: fprintf(fd, " (unit %u = 0x%x)", td->td_resolutionunit, td->td_resolutionunit); break; } } fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_POSITION)) fprintf(fd, " Position: %g, %g\n", td->td_xposition, td->td_yposition); if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) fprintf(fd, " Bits/Sample: %u\n", td->td_bitspersample); if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) { fprintf(fd, " Sample Format: "); switch (td->td_sampleformat) { case SAMPLEFORMAT_VOID: fprintf(fd, "void\n"); break; case SAMPLEFORMAT_INT: fprintf(fd, "signed integer\n"); break; case SAMPLEFORMAT_UINT: fprintf(fd, "unsigned integer\n"); break; case SAMPLEFORMAT_IEEEFP: fprintf(fd, "IEEE floating point\n"); break; case SAMPLEFORMAT_COMPLEXINT: fprintf(fd, "complex signed integer\n"); break; case SAMPLEFORMAT_COMPLEXIEEEFP: fprintf(fd, "complex IEEE floating point\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_sampleformat, td->td_sampleformat); break; } } if (TIFFFieldSet(tif,FIELD_COMPRESSION)) { const TIFFCodec* c = TIFFFindCODEC(td->td_compression); fprintf(fd, " Compression Scheme: "); if (c) fprintf(fd, "%s\n", c->name); else fprintf(fd, "%u (0x%x)\n", td->td_compression, td->td_compression); } if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) { fprintf(fd, " Photometric Interpretation: "); if (td->td_photometric < NPHOTONAMES) fprintf(fd, "%s\n", photoNames[td->td_photometric]); else { switch (td->td_photometric) { case PHOTOMETRIC_LOGL: fprintf(fd, "CIE Log2(L)\n"); break; case PHOTOMETRIC_LOGLUV: fprintf(fd, "CIE Log2(L) (u',v')\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_photometric, td->td_photometric); break; } } } if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) { uint16 i; fprintf(fd, " Extra Samples: %u<", td->td_extrasamples); sep = ""; for (i = 0; i < td->td_extrasamples; i++) { switch (td->td_sampleinfo[i]) { case EXTRASAMPLE_UNSPECIFIED: fprintf(fd, "%sunspecified", sep); break; case EXTRASAMPLE_ASSOCALPHA: fprintf(fd, "%sassoc-alpha", sep); break; case EXTRASAMPLE_UNASSALPHA: fprintf(fd, "%sunassoc-alpha", sep); break; default: fprintf(fd, "%s%u (0x%x)", sep, td->td_sampleinfo[i], td->td_sampleinfo[i]); break; } sep = ", "; } fprintf(fd, ">\n"); } if (TIFFFieldSet(tif,FIELD_INKNAMES)) { char* cp; uint16 i; fprintf(fd, " Ink Names: "); i = td->td_samplesperpixel; sep = ""; for (cp = td->td_inknames; i > 0 && cp < td->td_inknames + td->td_inknameslen; cp = strchr(cp,'\0')+1, i--) { size_t max_chars = td->td_inknameslen - (cp - td->td_inknames); fputs(sep, fd); _TIFFprintAsciiBounded(fd, cp, max_chars); sep = ", "; } fputs("\n", fd); } if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) { fprintf(fd, " Thresholding: "); switch (td->td_threshholding) { case THRESHHOLD_BILEVEL: fprintf(fd, "bilevel art scan\n"); break; case THRESHHOLD_HALFTONE: fprintf(fd, "halftone or dithered scan\n"); break; case THRESHHOLD_ERRORDIFFUSE: fprintf(fd, "error diffused\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_threshholding, td->td_threshholding); break; } } if (TIFFFieldSet(tif,FIELD_FILLORDER)) { fprintf(fd, " FillOrder: "); switch (td->td_fillorder) { case FILLORDER_MSB2LSB: fprintf(fd, "msb-to-lsb\n"); break; case FILLORDER_LSB2MSB: fprintf(fd, "lsb-to-msb\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_fillorder, td->td_fillorder); break; } } if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING)) { fprintf(fd, " YCbCr Subsampling: %u, %u\n", td->td_ycbcrsubsampling[0], td->td_ycbcrsubsampling[1] ); } if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) { fprintf(fd, " YCbCr Positioning: "); switch (td->td_ycbcrpositioning) { case YCBCRPOSITION_CENTERED: fprintf(fd, "centered\n"); break; case YCBCRPOSITION_COSITED: fprintf(fd, "cosited\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_ycbcrpositioning, td->td_ycbcrpositioning); break; } } if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS)) fprintf(fd, " Halftone Hints: light %u dark %u\n", td->td_halftonehints[0], td->td_halftonehints[1]); if (TIFFFieldSet(tif,FIELD_ORIENTATION)) { fprintf(fd, " Orientation: "); if (td->td_orientation < NORIENTNAMES) fprintf(fd, "%s\n", orientNames[td->td_orientation]); else fprintf(fd, "%u (0x%x)\n", td->td_orientation, td->td_orientation); } if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) fprintf(fd, " Samples/Pixel: %u\n", td->td_samplesperpixel); if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) { fprintf(fd, " Rows/Strip: "); if (td->td_rowsperstrip == (uint32) -1) fprintf(fd, "(infinite)\n"); else fprintf(fd, "%lu\n", (unsigned long) td->td_rowsperstrip); } if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE)) fprintf(fd, " Min Sample Value: %u\n", td->td_minsamplevalue); if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue); if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) { int i; int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; fprintf(fd, " SMin Sample Value:"); for (i = 0; i < count; ++i) fprintf(fd, " %g", td->td_sminsamplevalue[i]); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) { int i; int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; fprintf(fd, " SMax Sample Value:"); for (i = 0; i < count; ++i) fprintf(fd, " %g", td->td_smaxsamplevalue[i]); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) { fprintf(fd, " Planar Configuration: "); switch (td->td_planarconfig) { case PLANARCONFIG_CONTIG: fprintf(fd, "single image plane\n"); break; case PLANARCONFIG_SEPARATE: fprintf(fd, "separate image planes\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_planarconfig, td->td_planarconfig); break; } } if (TIFFFieldSet(tif,FIELD_PAGENUMBER)) fprintf(fd, " Page Number: %u-%u\n", td->td_pagenumber[0], td->td_pagenumber[1]); if (TIFFFieldSet(tif,FIELD_COLORMAP)) { fprintf(fd, " Color Map: "); if (flags & TIFFPRINT_COLORMAP) { fprintf(fd, "\n"); n = 1L<<td->td_bitspersample; for (l = 0; l < n; l++) fprintf(fd, " %5ld: %5u %5u %5u\n", l, td->td_colormap[0][l], td->td_colormap[1][l], td->td_colormap[2][l]); } else fprintf(fd, "(present)\n"); } if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) { int i; fprintf(fd, " Reference Black/White:\n"); for (i = 0; i < 3; i++) fprintf(fd, " %2d: %5g %5g\n", i, td->td_refblackwhite[2*i+0], td->td_refblackwhite[2*i+1]); } if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) { fprintf(fd, " Transfer Function: "); if (flags & TIFFPRINT_CURVES) { fprintf(fd, "\n"); n = 1L<<td->td_bitspersample; for (l = 0; l < n; l++) { uint16 i; fprintf(fd, " %2ld: %5u", l, td->td_transferfunction[0][l]); for (i = 1; i < td->td_samplesperpixel; i++) fprintf(fd, " %5u", td->td_transferfunction[i][l]); fputc('\n', fd); } } else fprintf(fd, "(present)\n"); } if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) { uint16 i; fprintf(fd, " SubIFD Offsets:"); for (i = 0; i < td->td_nsubifd; i++) #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, " %5I64u", (unsigned __int64) td->td_subifd[i]); #else fprintf(fd, " %5llu", (unsigned long long) td->td_subifd[i]); #endif fputc('\n', fd); } /* ** Custom tag support. */ { int i; short count; count = (short) TIFFGetTagListCount(tif); for(i = 0; i < count; i++) { uint32 tag = TIFFGetTagListEntry(tif, i); const TIFFField *fip; uint32 value_count; int mem_alloc = 0; void *raw_data; fip = TIFFFieldWithTag(tif, tag); if(fip == NULL) continue; if(fip->field_passcount) { if (fip->field_readcount == TIFF_VARIABLE2 ) { if(TIFFGetField(tif, tag, &value_count, &raw_data) != 1) continue; } else if (fip->field_readcount == TIFF_VARIABLE ) { uint16 small_value_count; if(TIFFGetField(tif, tag, &small_value_count, &raw_data) != 1) continue; value_count = small_value_count; } else { assert (fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2); continue; } } else { if (fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2) value_count = 1; else if (fip->field_readcount == TIFF_SPP) value_count = td->td_samplesperpixel; else value_count = fip->field_readcount; if (fip->field_tag == TIFFTAG_DOTRANGE && strcmp(fip->field_name,"DotRange") == 0) { /* TODO: This is an evil exception and should not have been handled this way ... likely best if we move it into the directory structure with an explicit field in libtiff 4.1 and assign it a FIELD_ value */ static uint16 dotrange[2]; raw_data = dotrange; TIFFGetField(tif, tag, dotrange+0, dotrange+1); } else if (fip->field_type == TIFF_ASCII || fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2 || fip->field_readcount == TIFF_SPP || value_count > 1) { if(TIFFGetField(tif, tag, &raw_data) != 1) continue; } else { raw_data = _TIFFmalloc( _TIFFDataSize(fip->field_type) * value_count); mem_alloc = 1; if(TIFFGetField(tif, tag, raw_data) != 1) { _TIFFfree(raw_data); continue; } } } /* * Catch the tags which needs to be specially handled * and pretty print them. If tag not handled in * _TIFFPrettyPrintField() fall down and print it as * any other tag. */ if (!_TIFFPrettyPrintField(tif, fip, fd, tag, value_count, raw_data)) _TIFFPrintField(fd, fip, value_count, raw_data); if(mem_alloc) _TIFFfree(raw_data); } } if (tif->tif_tagmethods.printdir) (*tif->tif_tagmethods.printdir)(tif, fd, flags); _TIFFFillStriles( tif ); if ((flags & TIFFPRINT_STRIPS) && TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) { uint32 s; fprintf(fd, " %lu %s:\n", (unsigned long) td->td_nstrips, isTiled(tif) ? "Tiles" : "Strips"); for (s = 0; s < td->td_nstrips; s++) #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, " %3lu: [%8I64u, %8I64u]\n", (unsigned long) s, (unsigned __int64) td->td_stripoffset[s], (unsigned __int64) td->td_stripbytecount[s]); #else fprintf(fd, " %3lu: [%8llu, %8llu]\n", (unsigned long) s, (unsigned long long) td->td_stripoffset[s], (unsigned long long) td->td_stripbytecount[s]); #endif } }
2620
True
1
CVE-2018-5784
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2772', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2772', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3602-1/', 'name': 'USN-3602-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3606-1/', 'name': 'USN-3606-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/05/msg00022.html', 'name': '[debian-lts-announce] 20180531 [SECURITY] [DLA 1391-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00002.html', 'name': '[debian-lts-announce] 20180702 [SECURITY] [DLA 1411-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4349', 'name': 'DSA-4349', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/473851d211cf8805a161820337ca74cc9615d6ef', 'name': 'https://gitlab.com/libtiff/libtiff/commit/473851d211cf8805a161820337ca74cc9615d6ef', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-400'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', '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:7.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: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:17.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In LibTIFF 4.0.9, there is an uncontrolled resource consumption in the TIFFSetDirectory function of tif_dir.c. Remote attackers could leverage this vulnerability to cause a denial of service via a crafted tif file. This occurs because the declared number of directory entries is not validated against the actual number of directory entries.'}]
2019-04-22T16:19Z
2018-01-19T08:29Z
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system. There are at least three distinct scenarios which can commonly lead to resource exhaustion: Lack of throttling for the number of allocated resources Losing all references to a resource before reaching the shutdown stage Not closing/returning a resource after processing Resource exhaustion problems are often result due to an incorrect implementation of the following situations: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for releasing the resource.
https://cwe.mitre.org/data/definitions/400.html
0
Nathan Baker
2018-02-06 10:13:57-05:00
Fix for bug 2772 It is possible to craft a TIFF document where the IFD list is circular, leading to an infinite loop while traversing the chain. The libtiff directory reader has a failsafe that will break out of this loop after reading 65535 directory entries, but it will continue processing, consuming time and resources to process what is essentially a bogus TIFF document. This change fixes the above behavior by breaking out of processing when a TIFF document has >= 65535 directories and terminating with an error.
473851d211cf8805a161820337ca74cc9615d6ef
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
TIFF_WriteOverview
TIFF_WriteOverview( TIFF * hTIFF , uint32 nXSize , uint32 nYSize , int nBitsPerPixel , int nPlanarConfig , int nSamples , int nBlockXSize , int nBlockYSize , int bTiled , int nCompressFlag , int nPhotometric , int nSampleFormat , unsigned short * panRed , unsigned short * panGreen , unsigned short * panBlue , int bUseSubIFDs , int nHorSubsampling , int nVerSubsampling)
['hTIFF', 'nXSize', 'nYSize', 'nBitsPerPixel', 'nPlanarConfig', 'nSamples', 'nBlockXSize', 'nBlockYSize', 'bTiled', 'nCompressFlag', 'nPhotometric', 'nSampleFormat', 'panRed', 'panGreen', 'panBlue', 'bUseSubIFDs', 'nHorSubsampling', 'nVerSubsampling']
uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize, int nBitsPerPixel, int nPlanarConfig, int nSamples, int nBlockXSize, int nBlockYSize, int bTiled, int nCompressFlag, int nPhotometric, int nSampleFormat, unsigned short *panRed, unsigned short *panGreen, unsigned short *panBlue, int bUseSubIFDs, int nHorSubsampling, int nVerSubsampling ) { toff_t nBaseDirOffset; toff_t nOffset; (void) bUseSubIFDs; nBaseDirOffset = TIFFCurrentDirOffset( hTIFF ); TIFFCreateDirectory( hTIFF ); /* -------------------------------------------------------------------- */ /* Setup TIFF fields. */ /* -------------------------------------------------------------------- */ TIFFSetField( hTIFF, TIFFTAG_IMAGEWIDTH, nXSize ); TIFFSetField( hTIFF, TIFFTAG_IMAGELENGTH, nYSize ); if( nSamples == 1 ) TIFFSetField( hTIFF, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG ); else TIFFSetField( hTIFF, TIFFTAG_PLANARCONFIG, nPlanarConfig ); TIFFSetField( hTIFF, TIFFTAG_BITSPERSAMPLE, nBitsPerPixel ); TIFFSetField( hTIFF, TIFFTAG_SAMPLESPERPIXEL, nSamples ); TIFFSetField( hTIFF, TIFFTAG_COMPRESSION, nCompressFlag ); TIFFSetField( hTIFF, TIFFTAG_PHOTOMETRIC, nPhotometric ); TIFFSetField( hTIFF, TIFFTAG_SAMPLEFORMAT, nSampleFormat ); if( bTiled ) { TIFFSetField( hTIFF, TIFFTAG_TILEWIDTH, nBlockXSize ); TIFFSetField( hTIFF, TIFFTAG_TILELENGTH, nBlockYSize ); } else TIFFSetField( hTIFF, TIFFTAG_ROWSPERSTRIP, nBlockYSize ); TIFFSetField( hTIFF, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE ); if( nPhotometric == PHOTOMETRIC_YCBCR || nPhotometric == PHOTOMETRIC_ITULAB ) { TIFFSetField( hTIFF, TIFFTAG_YCBCRSUBSAMPLING, nHorSubsampling, nVerSubsampling); /* TODO: also write YCbCrPositioning and YCbCrCoefficients tag identical to source IFD */ } /* TODO: add command-line parameter for selecting jpeg compression quality * that gets ignored when compression isn't jpeg */ /* -------------------------------------------------------------------- */ /* Write color table if one is present. */ /* -------------------------------------------------------------------- */ if( panRed != NULL ) { TIFFSetField( hTIFF, TIFFTAG_COLORMAP, panRed, panGreen, panBlue ); } /* -------------------------------------------------------------------- */ /* Write directory, and return byte offset. */ /* -------------------------------------------------------------------- */ if( TIFFWriteCheck( hTIFF, bTiled, "TIFFBuildOverviews" ) == 0 ) return 0; TIFFWriteDirectory( hTIFF ); TIFFSetDirectory( hTIFF, (tdir_t) (TIFFNumberOfDirectories(hTIFF)-1) ); nOffset = TIFFCurrentDirOffset( hTIFF ); TIFFSetSubDirectory( hTIFF, nBaseDirOffset ); return nOffset; }
318
True
1
CVE-2018-5784
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2772', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2772', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3602-1/', 'name': 'USN-3602-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3606-1/', 'name': 'USN-3606-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/05/msg00022.html', 'name': '[debian-lts-announce] 20180531 [SECURITY] [DLA 1391-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00002.html', 'name': '[debian-lts-announce] 20180702 [SECURITY] [DLA 1411-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4349', 'name': 'DSA-4349', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/473851d211cf8805a161820337ca74cc9615d6ef', 'name': 'https://gitlab.com/libtiff/libtiff/commit/473851d211cf8805a161820337ca74cc9615d6ef', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-400'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', '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:7.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: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:17.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In LibTIFF 4.0.9, there is an uncontrolled resource consumption in the TIFFSetDirectory function of tif_dir.c. Remote attackers could leverage this vulnerability to cause a denial of service via a crafted tif file. This occurs because the declared number of directory entries is not validated against the actual number of directory entries.'}]
2019-04-22T16:19Z
2018-01-19T08:29Z
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system. There are at least three distinct scenarios which can commonly lead to resource exhaustion: Lack of throttling for the number of allocated resources Losing all references to a resource before reaching the shutdown stage Not closing/returning a resource after processing Resource exhaustion problems are often result due to an incorrect implementation of the following situations: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for releasing the resource.
https://cwe.mitre.org/data/definitions/400.html
0
Nathan Baker
2018-02-06 10:13:57-05:00
Fix for bug 2772 It is possible to craft a TIFF document where the IFD list is circular, leading to an infinite loop while traversing the chain. The libtiff directory reader has a failsafe that will break out of this loop after reading 65535 directory entries, but it will continue processing, consuming time and resources to process what is essentially a bogus TIFF document. This change fixes the above behavior by breaking out of processing when a TIFF document has >= 65535 directories and terminating with an error.
473851d211cf8805a161820337ca74cc9615d6ef
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
main
main( int argc , char * argv [ ])
['argc']
main(int argc, char* argv[]) { #if !HAVE_DECL_OPTARG extern int optind; #endif uint16 defconfig = (uint16) -1; uint16 deffillorder = 0; uint32 deftilewidth = (uint32) 0; uint32 deftilelength = (uint32) 0; uint32 defrowsperstrip = (uint32) 0; uint32 dirnum = 0; TIFF *in = NULL; TIFF *out = NULL; char mode[10]; char *mp = mode; /** RJN additions **/ struct image_data image; /* Image parameters for one image */ struct crop_mask crop; /* Cropping parameters for all images */ struct pagedef page; /* Page definition for output pages */ struct pageseg sections[MAX_SECTIONS]; /* Sections of one output page */ struct buffinfo seg_buffs[MAX_SECTIONS]; /* Segment buffer sizes and pointers */ struct dump_opts dump; /* Data dump options */ unsigned char *read_buff = NULL; /* Input image data buffer */ unsigned char *crop_buff = NULL; /* Crop area buffer */ unsigned char *sect_buff = NULL; /* Image section buffer */ unsigned char *sect_src = NULL; /* Image section buffer pointer */ unsigned int imagelist[MAX_IMAGES + 1]; /* individually specified images */ unsigned int image_count = 0; unsigned int dump_images = 0; unsigned int next_image = 0; unsigned int next_page = 0; unsigned int total_pages = 0; unsigned int total_images = 0; unsigned int end_of_input = FALSE; int seg; size_t length; char temp_filename[PATH_MAX + 16]; /* Extra space keeps the compiler from complaining */ little_endian = *((unsigned char *)&little_endian) & '1'; initImageData(&image); initCropMasks(&crop); initPageSetup(&page, sections, seg_buffs); initDumpOptions(&dump); process_command_opts (argc, argv, mp, mode, &dirnum, &defconfig, &deffillorder, &deftilewidth, &deftilelength, &defrowsperstrip, &crop, &page, &dump, imagelist, &image_count); if (argc - optind < 2) usage(); if ((argc - optind) == 2) pageNum = -1; else total_images = 0; /* read multiple input files and write to output file(s) */ while (optind < argc - 1) { in = TIFFOpen (argv[optind], "r"); if (in == NULL) return (-3); /* If only one input file is specified, we can use directory count */ total_images = TIFFNumberOfDirectories(in); if (image_count == 0) { dirnum = 0; total_pages = total_images; /* Only valid with single input file */ } else { dirnum = (tdir_t)(imagelist[next_image] - 1); next_image++; /* Total pages only valid for enumerated list of pages not derived * using odd, even, or last keywords. */ if (image_count > total_images) image_count = total_images; total_pages = image_count; } /* MAX_IMAGES is used for special case "last" in selection list */ if (dirnum == (MAX_IMAGES - 1)) dirnum = total_images - 1; if (dirnum > (total_images)) { TIFFError (TIFFFileName(in), "Invalid image number %d, File contains only %d images", (int)dirnum + 1, total_images); if (out != NULL) (void) TIFFClose(out); return (1); } if (dirnum != 0 && !TIFFSetDirectory(in, (tdir_t)dirnum)) { TIFFError(TIFFFileName(in),"Error, setting subdirectory at %d", dirnum); if (out != NULL) (void) TIFFClose(out); return (1); } end_of_input = FALSE; while (end_of_input == FALSE) { config = defconfig; compression = defcompression; predictor = defpredictor; fillorder = deffillorder; rowsperstrip = defrowsperstrip; tilewidth = deftilewidth; tilelength = deftilelength; g3opts = defg3opts; if (dump.format != DUMP_NONE) { /* manage input and/or output dump files here */ dump_images++; length = strlen(dump.infilename); if (length > 0) { if (dump.infile != NULL) fclose (dump.infile); /* dump.infilename is guaranteed to be NUL terminated and have 20 bytes fewer than PATH_MAX */ snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s", dump.infilename, dump_images, (dump.format == DUMP_TEXT) ? "txt" : "raw"); if ((dump.infile = fopen(temp_filename, dump.mode)) == NULL) { TIFFError ("Unable to open dump file for writing", "%s", temp_filename); exit (-1); } dump_info(dump.infile, dump.format, "Reading image","%d from %s", dump_images, TIFFFileName(in)); } length = strlen(dump.outfilename); if (length > 0) { if (dump.outfile != NULL) fclose (dump.outfile); /* dump.outfilename is guaranteed to be NUL terminated and have 20 bytes fewer than PATH_MAX */ snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s", dump.outfilename, dump_images, (dump.format == DUMP_TEXT) ? "txt" : "raw"); if ((dump.outfile = fopen(temp_filename, dump.mode)) == NULL) { TIFFError ("Unable to open dump file for writing", "%s", temp_filename); exit (-1); } dump_info(dump.outfile, dump.format, "Writing image","%d from %s", dump_images, TIFFFileName(in)); } } if (dump.debug) TIFFError("main", "Reading image %4d of %4d total pages.", dirnum + 1, total_pages); if (loadImage(in, &image, &dump, &read_buff)) { TIFFError("main", "Unable to load source image"); exit (-1); } /* Correct the image orientation if it was not ORIENTATION_TOPLEFT. */ if (image.adjustments != 0) { if (correct_orientation(&image, &read_buff)) TIFFError("main", "Unable to correct image orientation"); } if (getCropOffsets(&image, &crop, &dump)) { TIFFError("main", "Unable to define crop regions"); exit (-1); } if (crop.selections > 0) { if (processCropSelections(&image, &crop, &read_buff, seg_buffs)) { TIFFError("main", "Unable to process image selections"); exit (-1); } } else /* Single image segment without zones or regions */ { if (createCroppedImage(&image, &crop, &read_buff, &crop_buff)) { TIFFError("main", "Unable to create output image"); exit (-1); } } if (page.mode == PAGE_MODE_NONE) { /* Whole image or sections not based on output page size */ if (crop.selections > 0) { writeSelections(in, &out, &crop, &image, &dump, seg_buffs, mp, argv[argc - 1], &next_page, total_pages); } else /* One file all images and sections */ { if (update_output_file (&out, mp, crop.exp_mode, argv[argc - 1], &next_page)) exit (1); if (writeCroppedImage(in, out, &image, &dump,crop.combined_width, crop.combined_length, crop_buff, next_page, total_pages)) { TIFFError("main", "Unable to write new image"); exit (-1); } } } else { /* If we used a crop buffer, our data is there, otherwise it is * in the read_buffer */ if (crop_buff != NULL) sect_src = crop_buff; else sect_src = read_buff; /* Break input image into pages or rows and columns */ if (computeOutputPixelOffsets(&crop, &image, &page, sections, &dump)) { TIFFError("main", "Unable to compute output section data"); exit (-1); } /* If there are multiple files on the command line, the final one is assumed * to be the output filename into which the images are written. */ if (update_output_file (&out, mp, crop.exp_mode, argv[argc - 1], &next_page)) exit (1); if (writeImageSections(in, out, &image, &page, sections, &dump, sect_src, &sect_buff)) { TIFFError("main", "Unable to write image sections"); exit (-1); } } /* No image list specified, just read the next image */ if (image_count == 0) dirnum++; else { dirnum = (tdir_t)(imagelist[next_image] - 1); next_image++; } if (dirnum == MAX_IMAGES - 1) dirnum = TIFFNumberOfDirectories(in) - 1; if (!TIFFSetDirectory(in, (tdir_t)dirnum)) end_of_input = TRUE; } TIFFClose(in); optind++; } /* If we did not use the read buffer as the crop buffer */ if (read_buff) _TIFFfree(read_buff); if (crop_buff) _TIFFfree(crop_buff); if (sect_buff) _TIFFfree(sect_buff); /* Clean up any segment buffers used for zones or regions */ for (seg = 0; seg < crop.selections; seg++) _TIFFfree (seg_buffs[seg].buffer); if (dump.format != DUMP_NONE) { if (dump.infile != NULL) fclose (dump.infile); if (dump.outfile != NULL) { dump_info (dump.outfile, dump.format, "", "Completed run for %s", TIFFFileName(out)); fclose (dump.outfile); } } TIFFClose(out); return (0); } /* end main */
1455
True
1
CVE-2018-7456
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'https://github.com/xiaoqx/pocs/tree/master/libtiff', 'name': 'https://github.com/xiaoqx/pocs/tree/master/libtiff', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2778', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2778', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/04/msg00011.html', 'name': '[debian-lts-announce] 20180416 [SECURITY] [DLA 1347-1] tiff3 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/04/msg00010.html', 'name': '[debian-lts-announce] 20180416 [SECURITY] [DLA 1346-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00002.html', 'name': '[debian-lts-announce] 20180702 [SECURITY] [DLA 1411-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4349', 'name': 'DSA-4349', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3864-1/', 'name': 'USN-3864-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/be4c85b16e8801a16eec25e80eb9f3dd6a96731b', 'name': 'https://gitlab.com/libtiff/libtiff/commit/be4c85b16e8801a16eec25e80eb9f3dd6a96731b', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2051', 'name': 'RHSA-2019:2051', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2053', 'name': 'RHSA-2019:2053', 'refsource': 'REDHAT', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', '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:7.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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A NULL Pointer Dereference occurs in the function TIFFPrintDirectory in tif_print.c in LibTIFF 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 4.0.0alpha4, 4.0.0alpha5, 4.0.0alpha6, 4.0.0beta7, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.4beta, 4.0.5, 4.0.6, 4.0.7, 4.0.8 and 4.0.9 when using the tiffinfo tool to print crafted TIFF information, a different vulnerability than CVE-2017-18013. (This affects an earlier part of the TIFFPrintDirectory function that was not addressed by the CVE-2017-18013 patch.)'}]
2021-01-29T20:15Z
2018-02-24T06:29Z
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
Hugo Lefeuvre
2018-04-08 14:07:08-04:00
Fix NULL pointer dereference in TIFFPrintDirectory The TIFFPrintDirectory function relies on the following assumptions, supposed to be guaranteed by the specification: (a) A Transfer Function field is only present if the TIFF file has photometric type < 3. (b) If SamplesPerPixel > Color Channels, then the ExtraSamples field has count SamplesPerPixel - (Color Channels) and contains information about supplementary channels. While respect of (a) and (b) are essential for the well functioning of TIFFPrintDirectory, no checks are realized neither by the callee nor by TIFFPrintDirectory itself. Hence, following scenarios might happen and trigger the NULL pointer dereference: (1) TIFF File of photometric type 4 or more has illegal Transfer Function field. (2) TIFF File has photometric type 3 or less and defines a SamplesPerPixel field such that SamplesPerPixel > Color Channels without defining all extra samples in the ExtraSamples fields. In this patch, we address both issues with respect of the following principles: (A) In the case of (1), the defined transfer table should be printed safely even if it isn't 'legal'. This allows us to avoid expensive checks in TIFFPrintDirectory. Also, it is quite possible that an alternative photometric type would be developed (not part of the standard) and would allow definition of Transfer Table. We want libtiff to be able to handle this scenario out of the box. (B) In the case of (2), the transfer table should be printed at its right size, that is if TIFF file has photometric type Palette then the transfer table should have one row and not three, even if two extra samples are declared. In order to fulfill (A) we simply add a new 'i < 3' end condition to the broken TIFFPrintDirectory loop. This makes sure that in any case where (b) would be respected but not (a), everything stays fine. (B) is fulfilled by the loop condition 'i < td->td_samplesperpixel - td->td_extrasamples'. This is enough as long as (b) is respected. Naturally, we also make sure (b) is respected. This is done in the TIFFReadDirectory function by making sure any non-color channel is counted in ExtraSamples. This commit addresses CVE-2018-7456.
be4c85b16e8801a16eec25e80eb9f3dd6a96731b
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
TIFFPrintDirectory
TIFFPrintDirectory( TIFF * tif , FILE * fd , long flags)
['tif', 'fd', 'flags']
TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) { TIFFDirectory *td = &tif->tif_dir; char *sep; long l, n; #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, "TIFF Directory at offset 0x%I64x (%I64u)\n", (unsigned __int64) tif->tif_diroff, (unsigned __int64) tif->tif_diroff); #else fprintf(fd, "TIFF Directory at offset 0x%llx (%llu)\n", (unsigned long long) tif->tif_diroff, (unsigned long long) tif->tif_diroff); #endif if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) { fprintf(fd, " Subfile Type:"); sep = " "; if (td->td_subfiletype & FILETYPE_REDUCEDIMAGE) { fprintf(fd, "%sreduced-resolution image", sep); sep = "/"; } if (td->td_subfiletype & FILETYPE_PAGE) { fprintf(fd, "%smulti-page document", sep); sep = "/"; } if (td->td_subfiletype & FILETYPE_MASK) fprintf(fd, "%stransparency mask", sep); fprintf(fd, " (%lu = 0x%lx)\n", (unsigned long) td->td_subfiletype, (long) td->td_subfiletype); } if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) { fprintf(fd, " Image Width: %lu Image Length: %lu", (unsigned long) td->td_imagewidth, (unsigned long) td->td_imagelength); if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH)) fprintf(fd, " Image Depth: %lu", (unsigned long) td->td_imagedepth); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) { fprintf(fd, " Tile Width: %lu Tile Length: %lu", (unsigned long) td->td_tilewidth, (unsigned long) td->td_tilelength); if (TIFFFieldSet(tif,FIELD_TILEDEPTH)) fprintf(fd, " Tile Depth: %lu", (unsigned long) td->td_tiledepth); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_RESOLUTION)) { fprintf(fd, " Resolution: %g, %g", td->td_xresolution, td->td_yresolution); if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) { switch (td->td_resolutionunit) { case RESUNIT_NONE: fprintf(fd, " (unitless)"); break; case RESUNIT_INCH: fprintf(fd, " pixels/inch"); break; case RESUNIT_CENTIMETER: fprintf(fd, " pixels/cm"); break; default: fprintf(fd, " (unit %u = 0x%x)", td->td_resolutionunit, td->td_resolutionunit); break; } } fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_POSITION)) fprintf(fd, " Position: %g, %g\n", td->td_xposition, td->td_yposition); if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) fprintf(fd, " Bits/Sample: %u\n", td->td_bitspersample); if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) { fprintf(fd, " Sample Format: "); switch (td->td_sampleformat) { case SAMPLEFORMAT_VOID: fprintf(fd, "void\n"); break; case SAMPLEFORMAT_INT: fprintf(fd, "signed integer\n"); break; case SAMPLEFORMAT_UINT: fprintf(fd, "unsigned integer\n"); break; case SAMPLEFORMAT_IEEEFP: fprintf(fd, "IEEE floating point\n"); break; case SAMPLEFORMAT_COMPLEXINT: fprintf(fd, "complex signed integer\n"); break; case SAMPLEFORMAT_COMPLEXIEEEFP: fprintf(fd, "complex IEEE floating point\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_sampleformat, td->td_sampleformat); break; } } if (TIFFFieldSet(tif,FIELD_COMPRESSION)) { const TIFFCodec* c = TIFFFindCODEC(td->td_compression); fprintf(fd, " Compression Scheme: "); if (c) fprintf(fd, "%s\n", c->name); else fprintf(fd, "%u (0x%x)\n", td->td_compression, td->td_compression); } if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) { fprintf(fd, " Photometric Interpretation: "); if (td->td_photometric < NPHOTONAMES) fprintf(fd, "%s\n", photoNames[td->td_photometric]); else { switch (td->td_photometric) { case PHOTOMETRIC_LOGL: fprintf(fd, "CIE Log2(L)\n"); break; case PHOTOMETRIC_LOGLUV: fprintf(fd, "CIE Log2(L) (u',v')\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_photometric, td->td_photometric); break; } } } if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) { uint16 i; fprintf(fd, " Extra Samples: %u<", td->td_extrasamples); sep = ""; for (i = 0; i < td->td_extrasamples; i++) { switch (td->td_sampleinfo[i]) { case EXTRASAMPLE_UNSPECIFIED: fprintf(fd, "%sunspecified", sep); break; case EXTRASAMPLE_ASSOCALPHA: fprintf(fd, "%sassoc-alpha", sep); break; case EXTRASAMPLE_UNASSALPHA: fprintf(fd, "%sunassoc-alpha", sep); break; default: fprintf(fd, "%s%u (0x%x)", sep, td->td_sampleinfo[i], td->td_sampleinfo[i]); break; } sep = ", "; } fprintf(fd, ">\n"); } if (TIFFFieldSet(tif,FIELD_INKNAMES)) { char* cp; uint16 i; fprintf(fd, " Ink Names: "); i = td->td_samplesperpixel; sep = ""; for (cp = td->td_inknames; i > 0 && cp < td->td_inknames + td->td_inknameslen; cp = strchr(cp,'\0')+1, i--) { size_t max_chars = td->td_inknameslen - (cp - td->td_inknames); fputs(sep, fd); _TIFFprintAsciiBounded(fd, cp, max_chars); sep = ", "; } fputs("\n", fd); } if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) { fprintf(fd, " Thresholding: "); switch (td->td_threshholding) { case THRESHHOLD_BILEVEL: fprintf(fd, "bilevel art scan\n"); break; case THRESHHOLD_HALFTONE: fprintf(fd, "halftone or dithered scan\n"); break; case THRESHHOLD_ERRORDIFFUSE: fprintf(fd, "error diffused\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_threshholding, td->td_threshholding); break; } } if (TIFFFieldSet(tif,FIELD_FILLORDER)) { fprintf(fd, " FillOrder: "); switch (td->td_fillorder) { case FILLORDER_MSB2LSB: fprintf(fd, "msb-to-lsb\n"); break; case FILLORDER_LSB2MSB: fprintf(fd, "lsb-to-msb\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_fillorder, td->td_fillorder); break; } } if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING)) { fprintf(fd, " YCbCr Subsampling: %u, %u\n", td->td_ycbcrsubsampling[0], td->td_ycbcrsubsampling[1] ); } if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) { fprintf(fd, " YCbCr Positioning: "); switch (td->td_ycbcrpositioning) { case YCBCRPOSITION_CENTERED: fprintf(fd, "centered\n"); break; case YCBCRPOSITION_COSITED: fprintf(fd, "cosited\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_ycbcrpositioning, td->td_ycbcrpositioning); break; } } if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS)) fprintf(fd, " Halftone Hints: light %u dark %u\n", td->td_halftonehints[0], td->td_halftonehints[1]); if (TIFFFieldSet(tif,FIELD_ORIENTATION)) { fprintf(fd, " Orientation: "); if (td->td_orientation < NORIENTNAMES) fprintf(fd, "%s\n", orientNames[td->td_orientation]); else fprintf(fd, "%u (0x%x)\n", td->td_orientation, td->td_orientation); } if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) fprintf(fd, " Samples/Pixel: %u\n", td->td_samplesperpixel); if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) { fprintf(fd, " Rows/Strip: "); if (td->td_rowsperstrip == (uint32) -1) fprintf(fd, "(infinite)\n"); else fprintf(fd, "%lu\n", (unsigned long) td->td_rowsperstrip); } if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE)) fprintf(fd, " Min Sample Value: %u\n", td->td_minsamplevalue); if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue); if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) { int i; int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; fprintf(fd, " SMin Sample Value:"); for (i = 0; i < count; ++i) fprintf(fd, " %g", td->td_sminsamplevalue[i]); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) { int i; int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; fprintf(fd, " SMax Sample Value:"); for (i = 0; i < count; ++i) fprintf(fd, " %g", td->td_smaxsamplevalue[i]); fprintf(fd, "\n"); } if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) { fprintf(fd, " Planar Configuration: "); switch (td->td_planarconfig) { case PLANARCONFIG_CONTIG: fprintf(fd, "single image plane\n"); break; case PLANARCONFIG_SEPARATE: fprintf(fd, "separate image planes\n"); break; default: fprintf(fd, "%u (0x%x)\n", td->td_planarconfig, td->td_planarconfig); break; } } if (TIFFFieldSet(tif,FIELD_PAGENUMBER)) fprintf(fd, " Page Number: %u-%u\n", td->td_pagenumber[0], td->td_pagenumber[1]); if (TIFFFieldSet(tif,FIELD_COLORMAP)) { fprintf(fd, " Color Map: "); if (flags & TIFFPRINT_COLORMAP) { fprintf(fd, "\n"); n = 1L<<td->td_bitspersample; for (l = 0; l < n; l++) fprintf(fd, " %5ld: %5u %5u %5u\n", l, td->td_colormap[0][l], td->td_colormap[1][l], td->td_colormap[2][l]); } else fprintf(fd, "(present)\n"); } if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) { int i; fprintf(fd, " Reference Black/White:\n"); for (i = 0; i < 3; i++) fprintf(fd, " %2d: %5g %5g\n", i, td->td_refblackwhite[2*i+0], td->td_refblackwhite[2*i+1]); } if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) { fprintf(fd, " Transfer Function: "); if (flags & TIFFPRINT_CURVES) { fprintf(fd, "\n"); n = 1L<<td->td_bitspersample; for (l = 0; l < n; l++) { uint16 i; fprintf(fd, " %2ld: %5u", l, td->td_transferfunction[0][l]); for (i = 1; i < td->td_samplesperpixel; i++) fprintf(fd, " %5u", td->td_transferfunction[i][l]); fputc('\n', fd); } } else fprintf(fd, "(present)\n"); } if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) { uint16 i; fprintf(fd, " SubIFD Offsets:"); for (i = 0; i < td->td_nsubifd; i++) #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, " %5I64u", (unsigned __int64) td->td_subifd[i]); #else fprintf(fd, " %5llu", (unsigned long long) td->td_subifd[i]); #endif fputc('\n', fd); } /* ** Custom tag support. */ { int i; short count; count = (short) TIFFGetTagListCount(tif); for(i = 0; i < count; i++) { uint32 tag = TIFFGetTagListEntry(tif, i); const TIFFField *fip; uint32 value_count; int mem_alloc = 0; void *raw_data; fip = TIFFFieldWithTag(tif, tag); if(fip == NULL) continue; if(fip->field_passcount) { if (fip->field_readcount == TIFF_VARIABLE2 ) { if(TIFFGetField(tif, tag, &value_count, &raw_data) != 1) continue; } else if (fip->field_readcount == TIFF_VARIABLE ) { uint16 small_value_count; if(TIFFGetField(tif, tag, &small_value_count, &raw_data) != 1) continue; value_count = small_value_count; } else { assert (fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2); continue; } } else { if (fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2) value_count = 1; else if (fip->field_readcount == TIFF_SPP) value_count = td->td_samplesperpixel; else value_count = fip->field_readcount; if (fip->field_tag == TIFFTAG_DOTRANGE && strcmp(fip->field_name,"DotRange") == 0) { /* TODO: This is an evil exception and should not have been handled this way ... likely best if we move it into the directory structure with an explicit field in libtiff 4.1 and assign it a FIELD_ value */ static uint16 dotrange[2]; raw_data = dotrange; TIFFGetField(tif, tag, dotrange+0, dotrange+1); } else if (fip->field_type == TIFF_ASCII || fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2 || fip->field_readcount == TIFF_SPP || value_count > 1) { if(TIFFGetField(tif, tag, &raw_data) != 1) continue; } else { raw_data = _TIFFmalloc( _TIFFDataSize(fip->field_type) * value_count); mem_alloc = 1; if(TIFFGetField(tif, tag, raw_data) != 1) { _TIFFfree(raw_data); continue; } } } /* * Catch the tags which needs to be specially handled * and pretty print them. If tag not handled in * _TIFFPrettyPrintField() fall down and print it as * any other tag. */ if (!_TIFFPrettyPrintField(tif, fip, fd, tag, value_count, raw_data)) _TIFFPrintField(fd, fip, value_count, raw_data); if(mem_alloc) _TIFFfree(raw_data); } } if (tif->tif_tagmethods.printdir) (*tif->tif_tagmethods.printdir)(tif, fd, flags); _TIFFFillStriles( tif ); if ((flags & TIFFPRINT_STRIPS) && TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) { uint32 s; fprintf(fd, " %lu %s:\n", (unsigned long) td->td_nstrips, isTiled(tif) ? "Tiles" : "Strips"); for (s = 0; s < td->td_nstrips; s++) #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) fprintf(fd, " %3lu: [%8I64u, %8I64u]\n", (unsigned long) s, td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0, td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0); #else fprintf(fd, " %3lu: [%8llu, %8llu]\n", (unsigned long) s, td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0, td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0); #endif } }
2644
True
1
CVE-2018-8905
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.0/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/halfbitteam/POCs/tree/master/libtiff-4.08_tiff2ps_heap_overflow', 'name': 'https://github.com/halfbitteam/POCs/tree/master/libtiff-4.08_tiff2ps_heap_overflow', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2780', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2780', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/05/msg00009.html', 'name': '[debian-lts-announce] 20180514 [SECURITY] [DLA 1378-1] tiff3 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/05/msg00008.html', 'name': '[debian-lts-announce] 20180514 [SECURITY] [DLA 1377-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00002.html', 'name': '[debian-lts-announce] 20180702 [SECURITY] [DLA 1411-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4349', 'name': 'DSA-4349', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3864-1/', 'name': 'USN-3864-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/58a898cb4459055bb488ca815c23b880c242a27d', 'name': 'https://gitlab.com/libtiff/libtiff/commit/58a898cb4459055bb488ca815c23b880c242a27d', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2053', 'name': 'RHSA-2019:2053', 'refsource': 'REDHAT', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', '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:7.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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In LibTIFF 4.0.9, a heap-based buffer overflow occurs in the function LZWDecodeCompat in tif_lzw.c via a crafted TIFF file, as demonstrated by tiff2ps.'}]
2020-08-24T17:37Z
2018-03-22T04:29Z
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
2018-05-12 15:32:31+02:00
LZWDecodeCompat(): fix potential index-out-of-bounds write. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2780 / CVE-2018-8905 The fix consists in using the similar code LZWDecode() to validate we don't write outside of the output buffer.
58a898cb4459055bb488ca815c23b880c242a27d
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
LZWDecodeCompat
LZWDecodeCompat( TIFF * tif , uint8 * op0 , tmsize_t occ0 , uint16 s)
['tif', 'op0', 'occ0', 's']
LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) { static const char module[] = "LZWDecodeCompat"; LZWCodecState *sp = DecoderState(tif); char *op = (char*) op0; long occ = (long) occ0; char *tp; unsigned char *bp; int code, nbits; long nextbits, nextdata, nbitsmask; code_t *codep, *free_entp, *maxcodep, *oldcodep; (void) s; assert(sp != NULL); /* Fail if value does not fit in long. */ if ((tmsize_t) occ != occ0) return (0); /* * Restart interrupted output operation. */ if (sp->dec_restart) { long residue; codep = sp->dec_codep; residue = codep->length - sp->dec_restart; if (residue > occ) { /* * Residue from previous decode is sufficient * to satisfy decode request. Skip to the * start of the decoded string, place decoded * values in the output buffer, and return. */ sp->dec_restart += occ; do { codep = codep->next; } while (--residue > occ); tp = op + occ; do { *--tp = codep->value; codep = codep->next; } while (--occ); return (1); } /* * Residue satisfies only part of the decode request. */ op += residue; occ -= residue; tp = op; do { *--tp = codep->value; codep = codep->next; } while (--residue); sp->dec_restart = 0; } bp = (unsigned char *)tif->tif_rawcp; #ifdef LZW_CHECKEOS sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3); #endif nbits = sp->lzw_nbits; nextdata = sp->lzw_nextdata; nextbits = sp->lzw_nextbits; nbitsmask = sp->dec_nbitsmask; oldcodep = sp->dec_oldcodep; free_entp = sp->dec_free_entp; maxcodep = sp->dec_maxcodep; while (occ > 0) { NextCode(tif, sp, bp, code, GetNextCodeCompat); if (code == CODE_EOI) break; if (code == CODE_CLEAR) { do { free_entp = sp->dec_codetab + CODE_FIRST; _TIFFmemset(free_entp, 0, (CSIZE - CODE_FIRST) * sizeof (code_t)); nbits = BITS_MIN; nbitsmask = MAXCODE(BITS_MIN); maxcodep = sp->dec_codetab + nbitsmask; NextCode(tif, sp, bp, code, GetNextCodeCompat); } while (code == CODE_CLEAR); /* consecutive CODE_CLEAR codes */ if (code == CODE_EOI) break; if (code > CODE_CLEAR) { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "LZWDecode: Corrupted LZW table at scanline %d", tif->tif_row); return (0); } *op++ = (char)code; occ--; oldcodep = sp->dec_codetab + code; continue; } codep = sp->dec_codetab + code; /* * Add the new entry to the code table. */ if (free_entp < &sp->dec_codetab[0] || free_entp >= &sp->dec_codetab[CSIZE]) { TIFFErrorExt(tif->tif_clientdata, module, "Corrupted LZW table at scanline %d", tif->tif_row); return (0); } free_entp->next = oldcodep; if (free_entp->next < &sp->dec_codetab[0] || free_entp->next >= &sp->dec_codetab[CSIZE]) { TIFFErrorExt(tif->tif_clientdata, module, "Corrupted LZW table at scanline %d", tif->tif_row); return (0); } free_entp->firstchar = free_entp->next->firstchar; free_entp->length = free_entp->next->length+1; free_entp->value = (codep < free_entp) ? codep->firstchar : free_entp->firstchar; if (++free_entp > maxcodep) { if (++nbits > BITS_MAX) /* should not happen */ nbits = BITS_MAX; nbitsmask = MAXCODE(nbits); maxcodep = sp->dec_codetab + nbitsmask; } oldcodep = codep; if (code >= 256) { /* * Code maps to a string, copy string * value to output (written in reverse). */ if(codep->length == 0) { TIFFErrorExt(tif->tif_clientdata, module, "Wrong length of decoded " "string: data probably corrupted at scanline %d", tif->tif_row); return (0); } if (codep->length > occ) { /* * String is too long for decode buffer, * locate portion that will fit, copy to * the decode buffer, and setup restart * logic for the next decoding call. */ sp->dec_codep = codep; do { codep = codep->next; } while (codep->length > occ); sp->dec_restart = occ; tp = op + occ; do { *--tp = codep->value; codep = codep->next; } while (--occ); break; } assert(occ >= codep->length); op += codep->length; occ -= codep->length; tp = op; do { *--tp = codep->value; } while( (codep = codep->next) != NULL ); } else { *op++ = (char)code; occ--; } } tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp ); tif->tif_rawcp = (uint8*) bp; sp->lzw_nbits = (unsigned short)nbits; sp->lzw_nextdata = nextdata; sp->lzw_nextbits = nextbits; sp->dec_nbitsmask = nbitsmask; sp->dec_oldcodep = oldcodep; sp->dec_free_entp = free_entp; sp->dec_maxcodep = maxcodep; if (occ > 0) { #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) TIFFErrorExt(tif->tif_clientdata, module, "Not enough data at scanline %d (short %I64d bytes)", tif->tif_row, (unsigned __int64) occ); #else TIFFErrorExt(tif->tif_clientdata, module, "Not enough data at scanline %d (short %llu bytes)", tif->tif_row, (unsigned long long) occ); #endif return (0); } return (1); }
978
True
1
CVE-2018-18557
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.0/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://gitlab.com/libtiff/libtiff/merge_requests/38', 'name': 'https://gitlab.com/libtiff/libtiff/merge_requests/38', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/45694/', 'name': '45694', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'VDB Entry', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/10/msg00019.html', 'name': '[debian-lts-announce] 20181028 [SECURITY] [DLA 1557-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4349', 'name': 'DSA-4349', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3864-1/', 'name': 'USN-3864-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3906-2/', 'name': 'USN-3906-2', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/201904-15', 'name': 'GLSA-201904-15', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/681748ec2f5ce88da5f9fa6831e1653e46af8a66', 'name': 'https://gitlab.com/libtiff/libtiff/commit/681748ec2f5ce88da5f9fa6831e1653e46af8a66', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2053', 'name': 'RHSA-2019:2053', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://github.com/Hack-Me/Pocs_for_Multi_Versions/tree/main/CVE-2018-18557', 'name': 'https://github.com/Hack-Me/Pocs_for_Multi_Versions/tree/main/CVE-2018-18557', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'LibTIFF 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 4.0.0alpha4, 4.0.0alpha5, 4.0.0alpha6, 4.0.0beta7, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.4beta, 4.0.5, 4.0.6, 4.0.7, 4.0.8 and 4.0.9 (with JBIG enabled) decodes arbitrarily-sized JBIG into a buffer, ignoring the buffer size, which leads to a tif_jbig.c JBIGDecode out-of-bounds write.'}]
2021-03-05T18:15Z
2018-10-22T16:29Z
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
2018-10-14 16:38:29+02:00
JBIG: fix potential out-of-bounds write in JBIGDecode() JBIGDecode doesn't check if the user provided buffer is large enough to store the JBIG decoded image, which can potentially cause out-of-bounds write in the buffer. This issue was reported and analyzed by Thomas Dullien. Also fixes a (harmless) potential use of uninitialized memory when tif->tif_rawsize > tif->tif_rawcc And in case libtiff is compiled with CHUNKY_STRIP_READ_SUPPORT, make sure that whole strip data is provided to JBIGDecode()
681748ec2f5ce88da5f9fa6831e1653e46af8a66
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
JBIGDecode
JBIGDecode( TIFF * tif , uint8 * buffer , tmsize_t size , uint16 s)
['tif', 'buffer', 'size', 's']
static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s) { struct jbg_dec_state decoder; int decodeStatus = 0; unsigned char* pImage = NULL; (void) size, (void) s; if (isFillOrder(tif, tif->tif_dir.td_fillorder)) { TIFFReverseBits(tif->tif_rawdata, tif->tif_rawdatasize); } jbg_dec_init(&decoder); #if defined(HAVE_JBG_NEWLEN) jbg_newlen(tif->tif_rawdata, (size_t)tif->tif_rawdatasize); /* * I do not check the return status of jbg_newlen because even if this * function fails it does not necessarily mean that decoding the image * will fail. It is generally only needed for received fax images * that do not contain the actual length of the image in the BIE * header. I do not log when an error occurs because that will cause * problems when converting JBIG encoded TIFF's to * PostScript. As long as the actual image length is contained in the * BIE header jbg_dec_in should succeed. */ #endif /* HAVE_JBG_NEWLEN */ decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawdata, (size_t)tif->tif_rawdatasize, NULL); if (JBG_EOK != decodeStatus) { /* * XXX: JBG_EN constant was defined in pre-2.0 releases of the * JBIG-KIT. Since the 2.0 the error reporting functions were * changed. We will handle both cases here. */ TIFFErrorExt(tif->tif_clientdata, "JBIG", "Error (%d) decoding: %s", decodeStatus, #if defined(JBG_EN) jbg_strerror(decodeStatus, JBG_EN) #else jbg_strerror(decodeStatus) #endif ); jbg_dec_free(&decoder); return 0; } pImage = jbg_dec_getimage(&decoder, 0); _TIFFmemcpy(buffer, pImage, jbg_dec_getsize(&decoder)); jbg_dec_free(&decoder); return 1; }
189
True
1
CVE-2018-18557
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.0/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://gitlab.com/libtiff/libtiff/merge_requests/38', 'name': 'https://gitlab.com/libtiff/libtiff/merge_requests/38', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/45694/', 'name': '45694', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'VDB Entry', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/10/msg00019.html', 'name': '[debian-lts-announce] 20181028 [SECURITY] [DLA 1557-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4349', 'name': 'DSA-4349', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3864-1/', 'name': 'USN-3864-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3906-2/', 'name': 'USN-3906-2', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/201904-15', 'name': 'GLSA-201904-15', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/681748ec2f5ce88da5f9fa6831e1653e46af8a66', 'name': 'https://gitlab.com/libtiff/libtiff/commit/681748ec2f5ce88da5f9fa6831e1653e46af8a66', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2053', 'name': 'RHSA-2019:2053', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://github.com/Hack-Me/Pocs_for_Multi_Versions/tree/main/CVE-2018-18557', 'name': 'https://github.com/Hack-Me/Pocs_for_Multi_Versions/tree/main/CVE-2018-18557', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.9:*:*:*:*:*:*:*', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'LibTIFF 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 4.0.0alpha4, 4.0.0alpha5, 4.0.0alpha6, 4.0.0beta7, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.4beta, 4.0.5, 4.0.6, 4.0.7, 4.0.8 and 4.0.9 (with JBIG enabled) decodes arbitrarily-sized JBIG into a buffer, ignoring the buffer size, which leads to a tif_jbig.c JBIGDecode out-of-bounds write.'}]
2021-03-05T18:15Z
2018-10-22T16:29Z
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
2018-10-14 16:38:29+02:00
JBIG: fix potential out-of-bounds write in JBIGDecode() JBIGDecode doesn't check if the user provided buffer is large enough to store the JBIG decoded image, which can potentially cause out-of-bounds write in the buffer. This issue was reported and analyzed by Thomas Dullien. Also fixes a (harmless) potential use of uninitialized memory when tif->tif_rawsize > tif->tif_rawcc And in case libtiff is compiled with CHUNKY_STRIP_READ_SUPPORT, make sure that whole strip data is provided to JBIGDecode()
681748ec2f5ce88da5f9fa6831e1653e46af8a66
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
TIFFSeek
TIFFSeek( TIFF * tif , uint32 row , uint16 sample)
['tif', 'row', 'sample']
TIFFSeek(TIFF* tif, uint32 row, uint16 sample ) { register TIFFDirectory *td = &tif->tif_dir; uint32 strip; int whole_strip; tmsize_t read_ahead = 0; /* ** Establish what strip we are working from. */ if (row >= td->td_imagelength) { /* out of range */ TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%lu: Row out of range, max %lu", (unsigned long) row, (unsigned long) td->td_imagelength); return (0); } if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { if (sample >= td->td_samplesperpixel) { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%lu: Sample out of range, max %lu", (unsigned long) sample, (unsigned long) td->td_samplesperpixel); return (0); } strip = (uint32)sample*td->td_stripsperimage + row/td->td_rowsperstrip; } else strip = row / td->td_rowsperstrip; /* * Do we want to treat this strip as one whole chunk or * read it a few lines at a time? */ #if defined(CHUNKY_STRIP_READ_SUPPORT) if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) return 0; whole_strip = tif->tif_dir.td_stripbytecount[strip] < 10 || isMapped(tif); if( td->td_compression == COMPRESSION_LERC ) { /* Ideally plugins should have a way to declare they don't support * chunk strip */ whole_strip = 1; } #else whole_strip = 1; #endif if( !whole_strip ) { /* 16 is for YCbCr mode where we may need to read 16 */ /* lines at a time to get a decompressed line, and 5000 */ /* is some constant value, for example for JPEG tables */ if( tif->tif_scanlinesize < TIFF_TMSIZE_T_MAX / 16 && tif->tif_scanlinesize * 16 < TIFF_TMSIZE_T_MAX - 5000 ) { read_ahead = tif->tif_scanlinesize * 16 + 5000; } else { read_ahead = tif->tif_scanlinesize; } } /* * If we haven't loaded this strip, do so now, possibly * only reading the first part. */ if (strip != tif->tif_curstrip) { /* different strip, refill */ if( whole_strip ) { if (!TIFFFillStrip(tif, strip)) return (0); } else { if( !TIFFFillStripPartial(tif,strip,read_ahead,1) ) return 0; } } /* ** If we already have some data loaded, do we need to read some more? */ else if( !whole_strip ) { if( ((tif->tif_rawdata + tif->tif_rawdataloaded) - tif->tif_rawcp) < read_ahead && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < td->td_stripbytecount[strip] ) { if( !TIFFFillStripPartial(tif,strip,read_ahead,0) ) return 0; } } if (row < tif->tif_row) { /* * Moving backwards within the same strip: backup * to the start and then decode forward (below). * * NB: If you're planning on lots of random access within a * strip, it's better to just read and decode the entire * strip, and then access the decoded data in a random fashion. */ if( tif->tif_rawdataoff != 0 ) { if( !TIFFFillStripPartial(tif,strip,read_ahead,1) ) return 0; } else { if (!TIFFStartStrip(tif, strip)) return (0); } } if (row != tif->tif_row) { /* * Seek forward to the desired row. */ /* TODO: Will this really work with partial buffers? */ if (!(*tif->tif_seek)(tif, row - tif->tif_row)) return (0); tif->tif_row = row; } return (1); }
473
True
1
CVE-2019-6128
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.0/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': 'http://bugzilla.maptools.org/show_bug.cgi?id=2836', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2836', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3906-1/', 'name': 'USN-3906-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3906-2/', 'name': 'USN-3906-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00041.html', 'name': 'openSUSE-SU-2019:1161', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/0c74a9f49b8d7a36b17b54a7428b3526d20f88a8', 'name': 'https://gitlab.com/libtiff/libtiff/commit/0c74a9f49b8d7a36b17b54a7428b3526d20f88a8', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Nov/5', 'name': '20191104 [slackware-security] libtiff (SSA:2019-308-01)', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'http://packetstormsecurity.com/files/155095/Slackware-Security-Advisory-libtiff-Updates.html', 'name': 'http://packetstormsecurity.com/files/155095/Slackware-Security-Advisory-libtiff-Updates.html', 'refsource': 'MISC', 'tags': []}, {'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': []}, {'url': 'https://security.gentoo.org/glsa/202003-25', 'name': 'GLSA-202003-25', 'refsource': 'GENTOO', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-401'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.10:*:*:*:*:*:*:*', '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:14.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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The TIFFFdOpen function in tif_unix.c in LibTIFF 4.0.10 has a memory leak, as demonstrated by pal2rgb.'}]
2020-08-24T17:37Z
2019-01-11T05:29Z
Missing Release of Memory after Effective Lifetime
The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.
This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
https://cwe.mitre.org/data/definitions/401.html
0
Scott Gayou
2019-01-23 15:03:53-05:00
Fix for simple memory leak that was assigned CVE-2019-6128. pal2rgb failed to free memory on a few errors. This was reported here: http://bugzilla.maptools.org/show_bug.cgi?id=2836.
0c74a9f49b8d7a36b17b54a7428b3526d20f88a8
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
main
main( int argc , char * argv [ ])
['argc']
main(int argc, char* argv[]) { uint16 bitspersample, shortv; uint32 imagewidth, imagelength; uint16 config = PLANARCONFIG_CONTIG; uint32 rowsperstrip = (uint32) -1; uint16 photometric = PHOTOMETRIC_RGB; uint16 *rmap, *gmap, *bmap; uint32 row; int cmap = -1; TIFF *in, *out; int c; #if !HAVE_DECL_OPTARG extern int optind; extern char* optarg; #endif while ((c = getopt(argc, argv, "C:c:p:r:")) != -1) switch (c) { case 'C': /* force colormap interpretation */ cmap = atoi(optarg); break; case 'c': /* compression scheme */ if (!processCompressOptions(optarg)) usage(); break; case 'p': /* planar configuration */ if (streq(optarg, "separate")) config = PLANARCONFIG_SEPARATE; else if (streq(optarg, "contig")) config = PLANARCONFIG_CONTIG; else usage(); break; case 'r': /* rows/strip */ rowsperstrip = atoi(optarg); break; case '?': usage(); /*NOTREACHED*/ } if (argc - optind != 2) usage(); in = TIFFOpen(argv[optind], "r"); if (in == NULL) return (-1); if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &shortv) || shortv != PHOTOMETRIC_PALETTE) { fprintf(stderr, "%s: Expecting a palette image.\n", argv[optind]); return (-1); } if (!TIFFGetField(in, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) { fprintf(stderr, "%s: No colormap (not a valid palette image).\n", argv[optind]); return (-1); } bitspersample = 0; TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); if (bitspersample != 8) { fprintf(stderr, "%s: Sorry, can only handle 8-bit images.\n", argv[optind]); return (-1); } out = TIFFOpen(argv[optind+1], "w"); if (out == NULL) return (-2); cpTags(in, out); TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &imagewidth); TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imagelength); if (compression != (uint16)-1) TIFFSetField(out, TIFFTAG_COMPRESSION, compression); else TIFFGetField(in, TIFFTAG_COMPRESSION, &compression); switch (compression) { case COMPRESSION_JPEG: if (jpegcolormode == JPEGCOLORMODE_RGB) photometric = PHOTOMETRIC_YCBCR; else photometric = PHOTOMETRIC_RGB; TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); break; case COMPRESSION_LZW: case COMPRESSION_DEFLATE: if (predictor != 0) TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); break; } TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric); TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3); TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip)); (void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv); if (cmap == -1) cmap = checkcmap(1<<bitspersample, rmap, gmap, bmap); if (cmap == 16) { /* * Convert 16-bit colormap to 8-bit. */ int i; for (i = (1<<bitspersample)-1; i >= 0; i--) { #define CVT(x) (((x) * 255) / ((1L<<16)-1)) rmap[i] = CVT(rmap[i]); gmap[i] = CVT(gmap[i]); bmap[i] = CVT(bmap[i]); } } { unsigned char *ibuf, *obuf; register unsigned char* pp; register uint32 x; tmsize_t tss_in = TIFFScanlineSize(in); tmsize_t tss_out = TIFFScanlineSize(out); if (tss_out / tss_in < 3) { /* * BUG 2750: The following code does not know about chroma * subsampling of JPEG data. It assumes that the output buffer is 3x * the length of the input buffer due to exploding the palette into * RGB tuples. If this assumption is incorrect, it could lead to a * buffer overflow. Go ahead and fail now to prevent that. */ fprintf(stderr, "Could not determine correct image size for output. Exiting.\n"); return -1; } ibuf = (unsigned char*)_TIFFmalloc(tss_in); obuf = (unsigned char*)_TIFFmalloc(tss_out); switch (config) { case PLANARCONFIG_CONTIG: for (row = 0; row < imagelength; row++) { if (!TIFFReadScanline(in, ibuf, row, 0)) goto done; pp = obuf; for (x = 0; x < imagewidth; x++) { *pp++ = (unsigned char) rmap[ibuf[x]]; *pp++ = (unsigned char) gmap[ibuf[x]]; *pp++ = (unsigned char) bmap[ibuf[x]]; } if (!TIFFWriteScanline(out, obuf, row, 0)) goto done; } break; case PLANARCONFIG_SEPARATE: for (row = 0; row < imagelength; row++) { if (!TIFFReadScanline(in, ibuf, row, 0)) goto done; for (pp = obuf, x = 0; x < imagewidth; x++) *pp++ = (unsigned char) rmap[ibuf[x]]; if (!TIFFWriteScanline(out, obuf, row, 0)) goto done; for (pp = obuf, x = 0; x < imagewidth; x++) *pp++ = (unsigned char) gmap[ibuf[x]]; if (!TIFFWriteScanline(out, obuf, row, 0)) goto done; for (pp = obuf, x = 0; x < imagewidth; x++) *pp++ = (unsigned char) bmap[ibuf[x]]; if (!TIFFWriteScanline(out, obuf, row, 0)) goto done; } break; } _TIFFfree(ibuf); _TIFFfree(obuf); } done: (void) TIFFClose(in); (void) TIFFClose(out); return (0); }
1070
True
1
CVE-2019-7663
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'http://bugzilla.maptools.org/show_bug.cgi?id=2833', 'name': 'http://bugzilla.maptools.org/show_bug.cgi?id=2833', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory', 'Patch']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/02/msg00026.html', 'name': '[debian-lts-announce] 20190218 [SECURITY] [DLA 1680-1] tiff security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3906-1/', 'name': 'USN-3906-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3906-2/', 'name': 'USN-3906-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00041.html', 'name': 'openSUSE-SU-2019:1161', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://gitlab.com/libtiff/libtiff/commit/802d3cbf3043be5dce5317e140ccb1c17a6a2d39', 'name': 'https://gitlab.com/libtiff/libtiff/commit/802d3cbf3043be5dce5317e140ccb1c17a6a2d39', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202003-25', 'name': 'GLSA-202003-25', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4670', 'name': 'DSA-4670', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libtiff:libtiff:4.0.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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:14.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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An Invalid Address dereference was discovered in TIFFWriteDirectoryTagTransferfunction in libtiff/tif_dirwrite.c in LibTIFF 4.0.10, affecting the cpSeparateBufToContigBuf function in tiffcp.c. Remote attackers could leverage this vulnerability to cause a denial-of-service via a crafted tiff file. This is different from CVE-2018-12900.'}]
2020-08-24T17:37Z
2019-02-09T16:29Z
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
Thomas Bernard
2019-01-29 11:21:47+01:00
TIFFWriteDirectoryTagTransferfunction() : fix NULL dereferencing http://bugzilla.maptools.org/show_bug.cgi?id=2833 we must check the pointer is not NULL before memcmp() the memory
802d3cbf3043be5dce5317e140ccb1c17a6a2d39
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
TIFFWriteDirectoryTagTransferfunction
TIFFWriteDirectoryTagTransferfunction( TIFF * tif , uint32 * ndir , TIFFDirEntry * dir)
['tif', 'ndir', 'dir']
TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir) { static const char module[] = "TIFFWriteDirectoryTagTransferfunction"; uint32 m; uint16 n; uint16* o; int p; if (dir==NULL) { (*ndir)++; return(1); } m=(1<<tif->tif_dir.td_bitspersample); n=tif->tif_dir.td_samplesperpixel-tif->tif_dir.td_extrasamples; /* * Check if the table can be written as a single column, * or if it must be written as 3 columns. Note that we * write a 3-column tag if there are 2 samples/pixel and * a single column of data won't suffice--hmm. */ if (n>3) n=3; if (n==3) { if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16))) n=2; } if (n==2) { if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16))) n=1; } if (n==0) n=1; o=_TIFFmalloc(n*m*sizeof(uint16)); if (o==NULL) { TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); return(0); } _TIFFmemcpy(&o[0],tif->tif_dir.td_transferfunction[0],m*sizeof(uint16)); if (n>1) _TIFFmemcpy(&o[m],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)); if (n>2) _TIFFmemcpy(&o[2*m],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)); p=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,TIFFTAG_TRANSFERFUNCTION,n*m,o); _TIFFfree(o); return(p); }
346
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:05:28+02:00
RGBA interface: 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
4bb584a35f87af42d6cf09d15e9ce8909a839145
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
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:05:28+02:00
RGBA interface: 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
4bb584a35f87af42d6cf09d15e9ce8909a839145
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
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:05:28+02:00
RGBA interface: 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
4bb584a35f87af42d6cf09d15e9ce8909a839145
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
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:05:28+02:00
RGBA interface: 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
4bb584a35f87af42d6cf09d15e9ce8909a839145
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
libtiff
visit repo url
visit repo url
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-2017-18190
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.0/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
True
[{'url': 'https://github.com/apple/cups/commit/afa80cb2b457bf8d64f775bed307588610476c41', 'name': 'https://github.com/apple/cups/commit/afa80cb2b457bf8d64f775bed307588610476c41', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/project-zero/issues/detail?id=1048', 'name': 'https://bugs.chromium.org/p/project-zero/issues/detail?id=1048', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/02/msg00023.html', 'name': '[debian-lts-announce] 20180222 [SECURITY] [DLA 1288-1] cups security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3577-1/', 'name': 'USN-3577-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00003.html', 'name': '[debian-lts-announce] 20180703 [SECURITY] [DLA 1412-1] cups security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-290'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apple:cups:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.2', '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:7.0:*:*:*:*:*:*:*', '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:14.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A localhost.localdomain whitelist entry in valid_host() in scheduler/client.c in CUPS before 2.2.2 allows remote attackers to execute arbitrary IPP commands by sending POST requests to the CUPS daemon in conjunction with DNS rebinding. The localhost.localdomain name is often resolved via a DNS server (neither the OS nor the web browser is responsible for ensuring that localhost.localdomain is 127.0.0.1).'}]
2019-10-03T00:03Z
2018-02-16T17:29Z
Authentication Bypass by Spoofing
This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks.
https://cwe.mitre.org/data/definitions/290.html
0
Michael R Sweet
2017-01-03 13:52:47-05:00
Don't treat "localhost.localdomain" as an allowed replacement for localhost, since it isn't.
afa80cb2b457bf8d64f775bed307588610476c41
False
apple/cups
Apple CUPS Sources
2015-10-12 22:33:18
2022-06-27 16:22:54
https://www.cups.org
apple
1557.0
425.0
valid_host
valid_host( cupsd_client_t * con)
['con']
valid_host(cupsd_client_t *con) /* I - Client connection */ { cupsd_alias_t *a; /* Current alias */ cupsd_netif_t *netif; /* Current network interface */ const char *end; /* End character */ char *ptr; /* Pointer into host value */ /* * Copy the Host: header for later use... */ strlcpy(con->clientname, httpGetField(con->http, HTTP_FIELD_HOST), sizeof(con->clientname)); if ((ptr = strrchr(con->clientname, ':')) != NULL && !strchr(ptr, ']')) { *ptr++ = '\0'; con->clientport = atoi(ptr); } else con->clientport = con->serverport; /* * Then validate... */ if (httpAddrLocalhost(httpGetAddress(con->http))) { /* * Only allow "localhost" or the equivalent IPv4 or IPv6 numerical * addresses when accessing CUPS via the loopback interface... */ return (!_cups_strcasecmp(con->clientname, "localhost") || !_cups_strcasecmp(con->clientname, "localhost.") || #ifdef __linux !_cups_strcasecmp(con->clientname, "localhost.localdomain") || #endif /* __linux */ !strcmp(con->clientname, "127.0.0.1") || !strcmp(con->clientname, "[::1]")); } #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) /* * Check if the hostname is something.local (Bonjour); if so, allow it. */ if ((end = strrchr(con->clientname, '.')) != NULL && end > con->clientname && !end[1]) { /* * "." on end, work back to second-to-last "."... */ for (end --; end > con->clientname && *end != '.'; end --); } if (end && (!_cups_strcasecmp(end, ".local") || !_cups_strcasecmp(end, ".local."))) return (1); #endif /* HAVE_DNSSD || HAVE_AVAHI */ /* * Check if the hostname is an IP address... */ if (isdigit(con->clientname[0] & 255) || con->clientname[0] == '[') { /* * Possible IPv4/IPv6 address... */ http_addrlist_t *addrlist; /* List of addresses */ if ((addrlist = httpAddrGetList(con->clientname, AF_UNSPEC, NULL)) != NULL) { /* * Good IPv4/IPv6 address... */ httpAddrFreeList(addrlist); return (1); } } /* * Check for (alias) name matches... */ for (a = (cupsd_alias_t *)cupsArrayFirst(ServerAlias); a; a = (cupsd_alias_t *)cupsArrayNext(ServerAlias)) { /* * "ServerAlias *" allows all host values through... */ if (!strcmp(a->name, "*")) return (1); if (!_cups_strncasecmp(con->clientname, a->name, a->namelen)) { /* * Prefix matches; check the character at the end - it must be "." or nul. */ end = con->clientname + a->namelen; if (!*end || (*end == '.' && !end[1])) return (1); } } #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) for (a = (cupsd_alias_t *)cupsArrayFirst(DNSSDAlias); a; a = (cupsd_alias_t *)cupsArrayNext(DNSSDAlias)) { /* * "ServerAlias *" allows all host values through... */ if (!strcmp(a->name, "*")) return (1); if (!_cups_strncasecmp(con->clientname, a->name, a->namelen)) { /* * Prefix matches; check the character at the end - it must be "." or nul. */ end = con->clientname + a->namelen; if (!*end || (*end == '.' && !end[1])) return (1); } } #endif /* HAVE_DNSSD || HAVE_AVAHI */ /* * Check for interface hostname matches... */ for (netif = (cupsd_netif_t *)cupsArrayFirst(NetIFList); netif; netif = (cupsd_netif_t *)cupsArrayNext(NetIFList)) { if (!_cups_strncasecmp(con->clientname, netif->hostname, netif->hostlen)) { /* * Prefix matches; check the character at the end - it must be "." or nul. */ end = con->clientname + netif->hostlen; if (!*end || (*end == '.' && !end[1])) return (1); } } return (0); }
589
True
1
CVE-2017-18248
False
False
False
False
AV:N/AC:M/Au:S/C:N/I:N/A:P
NETWORK
MEDIUM
SINGLE
NONE
NONE
PARTIAL
3.5
CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
NETWORK
HIGH
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.3
MEDIUM
1.6
3.6
nan
[{'url': 'https://github.com/apple/cups/releases/tag/v2.2.6', 'name': 'https://github.com/apple/cups/releases/tag/v2.2.6', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/apple/cups/issues/5143', 'name': 'https://github.com/apple/cups/issues/5143', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/apple/cups/commit/49fa4983f25b64ec29d548ffa3b9782426007df3', 'name': 'https://github.com/apple/cups/commit/49fa4983f25b64ec29d548ffa3b9782426007df3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.cucumberlinux.com/security/details.php?id=346', 'name': 'https://security.cucumberlinux.com/security/details.php?id=346', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/05/msg00018.html', 'name': '[debian-lts-announce] 20180526 [SECURITY] [DLA 1387-1] cups security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00003.html', 'name': '[debian-lts-announce] 20180703 [SECURITY] [DLA 1412-1] cups security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/3713-1/', 'name': 'USN-3713-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apple:cups:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.2.6', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The add_job function in scheduler/ipp.c in CUPS before 2.2.6, when D-Bus support is enabled, can be crashed by remote attackers by sending print jobs with an invalid username, related to a D-Bus notification.'}]
2018-07-13T01:29Z
2018-03-26T17:29Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Michael Sweet
2017-10-23 16:23:43-04:00
DBUS notifications could crash the scheduler (Issue #5143) - scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8.
49fa4983f25b64ec29d548ffa3b9782426007df3
False
apple/cups
Apple CUPS Sources
2015-10-12 22:33:18
2022-06-27 16:22:54
https://www.cups.org
apple
1557.0
425.0
add_job
add_job( cupsd_client_t * con , cupsd_printer_t * printer , mime_type_t * filetype)
['con', 'printer', 'filetype']
add_job(cupsd_client_t *con, /* I - Client connection */ cupsd_printer_t *printer, /* I - Destination printer */ mime_type_t *filetype) /* I - First print file type, if any */ { http_status_t status; /* Policy status */ ipp_attribute_t *attr, /* Current attribute */ *auth_info; /* auth-info attribute */ const char *mandatory; /* Current mandatory job attribute */ const char *val; /* Default option value */ int priority; /* Job priority */ cupsd_job_t *job; /* Current job */ char job_uri[HTTP_MAX_URI]; /* Job URI */ int kbytes; /* Size of print file */ int i; /* Looping var */ int lowerpagerange; /* Page range bound */ int exact; /* Did we have an exact match? */ ipp_attribute_t *media_col, /* media-col attribute */ *media_margin; /* media-*-margin attribute */ ipp_t *unsup_col; /* media-col in unsupported response */ static const char * const readonly[] =/* List of read-only attributes */ { "date-time-at-completed", "date-time-at-creation", "date-time-at-processing", "job-detailed-status-messages", "job-document-access-errors", "job-id", "job-impressions-completed", "job-k-octets-completed", "job-media-sheets-completed", "job-pages-completed", "job-printer-up-time", "job-printer-uri", "job-state", "job-state-message", "job-state-reasons", "job-uri", "number-of-documents", "number-of-intervening-jobs", "output-device-assigned", "time-at-completed", "time-at-creation", "time-at-processing" }; cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))", con, con->number, printer, printer->name, filetype, filetype ? filetype->super : "none", filetype ? filetype->type : "none"); /* * Check remote printing to non-shared printer... */ if (!printer->shared && _cups_strcasecmp(con->http->hostname, "localhost") && _cups_strcasecmp(con->http->hostname, ServerName)) { send_ipp_status(con, IPP_NOT_AUTHORIZED, _("The printer or class is not shared.")); return (NULL); } /* * Check policy... */ auth_info = ippFindAttribute(con->request, "auth-info", IPP_TAG_TEXT); if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK) { send_http_error(con, status, printer); return (NULL); } else if (printer->num_auth_info_required == 1 && !strcmp(printer->auth_info_required[0], "negotiate") && !con->username[0]) { send_http_error(con, HTTP_UNAUTHORIZED, printer); return (NULL); } #ifdef HAVE_SSL else if (auth_info && !con->http->tls && !httpAddrLocalhost(con->http->hostaddr)) { /* * Require encryption of auth-info over non-local connections... */ send_http_error(con, HTTP_UPGRADE_REQUIRED, printer); return (NULL); } #endif /* HAVE_SSL */ /* * See if the printer is accepting jobs... */ if (!printer->accepting) { send_ipp_status(con, IPP_NOT_ACCEPTING, _("Destination \"%s\" is not accepting jobs."), printer->name); return (NULL); } /* * Validate job template attributes; for now just document-format, * copies, job-sheets, number-up, page-ranges, mandatory attributes, and * media... */ for (i = 0; i < (int)(sizeof(readonly) / sizeof(readonly[0])); i ++) { if ((attr = ippFindAttribute(con->request, readonly[i], IPP_TAG_ZERO)) != NULL) { ippDeleteAttribute(con->request, attr); if (StrictConformance) { send_ipp_status(con, IPP_BAD_REQUEST, _("The '%s' Job Status attribute cannot be supplied in a job creation request."), readonly[i]); return (NULL); } cupsdLogMessage(CUPSD_LOG_INFO, "Unexpected '%s' Job Status attribute in a job creation request.", readonly[i]); } } if (printer->pc) { for (mandatory = (char *)cupsArrayFirst(printer->pc->mandatory); mandatory; mandatory = (char *)cupsArrayNext(printer->pc->mandatory)) { if (!ippFindAttribute(con->request, mandatory, IPP_TAG_ZERO)) { /* * Missing a required attribute... */ send_ipp_status(con, IPP_CONFLICT, _("The \"%s\" attribute is required for print jobs."), mandatory); return (NULL); } } } if (filetype && printer->filetypes && !cupsArrayFind(printer->filetypes, filetype)) { char mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE + 2]; /* MIME media type string */ snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super, filetype->type); send_ipp_status(con, IPP_DOCUMENT_FORMAT, _("Unsupported format \"%s\"."), mimetype); ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE, "document-format", NULL, mimetype); return (NULL); } if ((attr = ippFindAttribute(con->request, "copies", IPP_TAG_INTEGER)) != NULL) { if (attr->values[0].integer < 1 || attr->values[0].integer > MaxCopies) { send_ipp_status(con, IPP_ATTRIBUTES, _("Bad copies value %d."), attr->values[0].integer); ippAddInteger(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_INTEGER, "copies", attr->values[0].integer); return (NULL); } } if ((attr = ippFindAttribute(con->request, "job-sheets", IPP_TAG_ZERO)) != NULL) { if (attr->value_tag != IPP_TAG_KEYWORD && attr->value_tag != IPP_TAG_NAME) { send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-sheets value type.")); return (NULL); } if (attr->num_values > 2) { send_ipp_status(con, IPP_BAD_REQUEST, _("Too many job-sheets values (%d > 2)."), attr->num_values); return (NULL); } for (i = 0; i < attr->num_values; i ++) if (strcmp(attr->values[i].string.text, "none") && !cupsdFindBanner(attr->values[i].string.text)) { send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-sheets value \"%s\"."), attr->values[i].string.text); return (NULL); } } if ((attr = ippFindAttribute(con->request, "number-up", IPP_TAG_INTEGER)) != NULL) { if (attr->values[0].integer != 1 && attr->values[0].integer != 2 && attr->values[0].integer != 4 && attr->values[0].integer != 6 && attr->values[0].integer != 9 && attr->values[0].integer != 16) { send_ipp_status(con, IPP_ATTRIBUTES, _("Bad number-up value %d."), attr->values[0].integer); ippAddInteger(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_INTEGER, "number-up", attr->values[0].integer); return (NULL); } } if ((attr = ippFindAttribute(con->request, "page-ranges", IPP_TAG_RANGE)) != NULL) { for (i = 0, lowerpagerange = 1; i < attr->num_values; i ++) { if (attr->values[i].range.lower < lowerpagerange || attr->values[i].range.lower > attr->values[i].range.upper) { send_ipp_status(con, IPP_BAD_REQUEST, _("Bad page-ranges values %d-%d."), attr->values[i].range.lower, attr->values[i].range.upper); return (NULL); } lowerpagerange = attr->values[i].range.upper + 1; } } /* * Do media selection as needed... */ if (!ippFindAttribute(con->request, "PageRegion", IPP_TAG_ZERO) && !ippFindAttribute(con->request, "PageSize", IPP_TAG_ZERO) && _ppdCacheGetPageSize(printer->pc, con->request, NULL, &exact)) { if (!exact && (media_col = ippFindAttribute(con->request, "media-col", IPP_TAG_BEGIN_COLLECTION)) != NULL) { send_ipp_status(con, IPP_OK_SUBST, _("Unsupported margins.")); unsup_col = ippNew(); if ((media_margin = ippFindAttribute(media_col->values[0].collection, "media-bottom-margin", IPP_TAG_INTEGER)) != NULL) ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, "media-bottom-margin", media_margin->values[0].integer); if ((media_margin = ippFindAttribute(media_col->values[0].collection, "media-left-margin", IPP_TAG_INTEGER)) != NULL) ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, "media-left-margin", media_margin->values[0].integer); if ((media_margin = ippFindAttribute(media_col->values[0].collection, "media-right-margin", IPP_TAG_INTEGER)) != NULL) ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, "media-right-margin", media_margin->values[0].integer); if ((media_margin = ippFindAttribute(media_col->values[0].collection, "media-top-margin", IPP_TAG_INTEGER)) != NULL) ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, "media-top-margin", media_margin->values[0].integer); ippAddCollection(con->response, IPP_TAG_UNSUPPORTED_GROUP, "media-col", unsup_col); ippDelete(unsup_col); } } /* * Make sure we aren't over our limit... */ if (MaxJobs && cupsArrayCount(Jobs) >= MaxJobs) cupsdCleanJobs(); if (MaxJobs && cupsArrayCount(Jobs) >= MaxJobs) { send_ipp_status(con, IPP_NOT_POSSIBLE, _("Too many active jobs.")); return (NULL); } if ((i = check_quotas(con, printer)) < 0) { send_ipp_status(con, IPP_NOT_POSSIBLE, _("Quota limit reached.")); return (NULL); } else if (i == 0) { send_ipp_status(con, IPP_NOT_AUTHORIZED, _("Not allowed to print.")); return (NULL); } /* * Create the job and set things up... */ if ((attr = ippFindAttribute(con->request, "job-priority", IPP_TAG_INTEGER)) != NULL) priority = attr->values[0].integer; else { if ((val = cupsGetOption("job-priority", printer->num_options, printer->options)) != NULL) priority = atoi(val); else priority = 50; ippAddInteger(con->request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-priority", priority); } if ((attr = ippFindAttribute(con->request, "job-name", IPP_TAG_ZERO)) == NULL) ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled"); else if ((attr->value_tag != IPP_TAG_NAME && attr->value_tag != IPP_TAG_NAMELANG) || attr->num_values != 1) { send_ipp_status(con, IPP_ATTRIBUTES, _("Bad job-name value: Wrong type or count.")); if ((attr = ippCopyAttribute(con->response, attr, 0)) != NULL) attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; return (NULL); } else if (!ippValidateAttribute(attr)) { send_ipp_status(con, IPP_ATTRIBUTES, _("Bad job-name value: %s"), cupsLastErrorString()); if ((attr = ippCopyAttribute(con->response, attr, 0)) != NULL) attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; return (NULL); } if ((job = cupsdAddJob(priority, printer->name)) == NULL) { send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to add job for destination \"%s\"."), printer->name); return (NULL); } job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE); job->attrs = con->request; job->dirty = 1; con->request = ippNewRequest(job->attrs->request.op.operation_id); cupsdMarkDirty(CUPSD_DIRTY_JOBS); add_job_uuid(job); apply_printer_defaults(printer, job); attr = ippFindAttribute(job->attrs, "requesting-user-name", IPP_TAG_NAME); if (con->username[0]) { cupsdSetString(&job->username, con->username); if (attr) ippSetString(job->attrs, &attr, 0, con->username); } else if (attr) { cupsdLogMessage(CUPSD_LOG_DEBUG, "add_job: requesting-user-name=\"%s\"", attr->values[0].string.text); cupsdSetString(&job->username, attr->values[0].string.text); } else cupsdSetString(&job->username, "anonymous"); if (!attr) ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-user-name", NULL, job->username); else { ippSetGroupTag(job->attrs, &attr, IPP_TAG_JOB); ippSetName(job->attrs, &attr, "job-originating-user-name"); } if (con->username[0] || auth_info) { save_auth_info(con, job, auth_info); /* * Remove the auth-info attribute from the attribute data... */ if (auth_info) ippDeleteAttribute(job->attrs, auth_info); } if ((attr = ippFindAttribute(con->request, "job-name", IPP_TAG_NAME)) != NULL) cupsdSetString(&(job->name), attr->values[0].string.text); if ((attr = ippFindAttribute(job->attrs, "job-originating-host-name", IPP_TAG_ZERO)) != NULL) { /* * Request contains a job-originating-host-name attribute; validate it... */ if (attr->value_tag != IPP_TAG_NAME || attr->num_values != 1 || strcmp(con->http->hostname, "localhost")) { /* * Can't override the value if we aren't connected via localhost. * Also, we can only have 1 value and it must be a name value. */ ippDeleteAttribute(job->attrs, attr); ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-host-name", NULL, con->http->hostname); } else ippSetGroupTag(job->attrs, &attr, IPP_TAG_JOB); } else { /* * No job-originating-host-name attribute, so use the hostname from * the connection... */ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-host-name", NULL, con->http->hostname); } ippAddOutOfBand(job->attrs, IPP_TAG_JOB, IPP_TAG_NOVALUE, "date-time-at-completed"); ippAddDate(job->attrs, IPP_TAG_JOB, "date-time-at-creation", ippTimeToDate(time(NULL))); ippAddOutOfBand(job->attrs, IPP_TAG_JOB, IPP_TAG_NOVALUE, "date-time-at-processing"); ippAddOutOfBand(job->attrs, IPP_TAG_JOB, IPP_TAG_NOVALUE, "time-at-completed"); ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "time-at-creation", time(NULL)); ippAddOutOfBand(job->attrs, IPP_TAG_JOB, IPP_TAG_NOVALUE, "time-at-processing"); /* * Add remaining job attributes... */ ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id); job->state = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", IPP_JOB_STOPPED); job->state_value = (ipp_jstate_t)job->state->values[0].integer; job->reasons = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-incoming"); job->impressions = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-impressions-completed", 0); job->sheets = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-media-sheets-completed", 0); ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI, "job-printer-uri", NULL, printer->uri); if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL) attr->values[0].integer = 0; else ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-k-octets", 0); if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); if (!attr) { if ((val = cupsGetOption("job-hold-until", printer->num_options, printer->options)) == NULL) val = "no-hold"; attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-hold-until", NULL, val); } if (printer->holding_new_jobs) { /* * Hold all new jobs on this printer... */ if (attr && strcmp(attr->values[0].string.text, "no-hold")) cupsdSetJobHoldUntil(job, ippGetString(attr, 0, NULL), 0); else cupsdSetJobHoldUntil(job, "indefinite", 0); job->state->values[0].integer = IPP_JOB_HELD; job->state_value = IPP_JOB_HELD; ippSetString(job->attrs, &job->reasons, 0, "job-held-on-create"); } else if (attr && strcmp(attr->values[0].string.text, "no-hold")) { /* * Hold job until specified time... */ cupsdSetJobHoldUntil(job, attr->values[0].string.text, 0); job->state->values[0].integer = IPP_JOB_HELD; job->state_value = IPP_JOB_HELD; ippSetString(job->attrs, &job->reasons, 0, "job-hold-until-specified"); } else if (job->attrs->request.op.operation_id == IPP_CREATE_JOB) { job->hold_until = time(NULL) + MultipleOperationTimeout; job->state->values[0].integer = IPP_JOB_HELD; job->state_value = IPP_JOB_HELD; } else { job->state->values[0].integer = IPP_JOB_PENDING; job->state_value = IPP_JOB_PENDING; ippSetString(job->attrs, &job->reasons, 0, "none"); } if (!(printer->type & CUPS_PRINTER_REMOTE) || Classification) { /* * Add job sheets options... */ if ((attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) == NULL) { cupsdLogMessage(CUPSD_LOG_DEBUG, "Adding default job-sheets values \"%s,%s\"...", printer->job_sheets[0], printer->job_sheets[1]); attr = ippAddStrings(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-sheets", 2, NULL, NULL); ippSetString(job->attrs, &attr, 0, printer->job_sheets[0]); ippSetString(job->attrs, &attr, 1, printer->job_sheets[1]); } job->job_sheets = attr; /* * Enforce classification level if set... */ if (Classification) { cupsdLogMessage(CUPSD_LOG_INFO, "Classification=\"%s\", ClassifyOverride=%d", Classification ? Classification : "(null)", ClassifyOverride); if (ClassifyOverride) { if (!strcmp(attr->values[0].string.text, "none") && (attr->num_values == 1 || !strcmp(attr->values[1].string.text, "none"))) { /* * Force the leading banner to have the classification on it... */ ippSetString(job->attrs, &attr, 0, Classification); cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED " "job-sheets=\"%s,none\", " "job-originating-user-name=\"%s\"", Classification, job->username); } else if (attr->num_values == 2 && strcmp(attr->values[0].string.text, attr->values[1].string.text) && strcmp(attr->values[0].string.text, "none") && strcmp(attr->values[1].string.text, "none")) { /* * Can't put two different security markings on the same document! */ ippSetString(job->attrs, &attr, 1, attr->values[0].string.text); cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED " "job-sheets=\"%s,%s\", " "job-originating-user-name=\"%s\"", attr->values[0].string.text, attr->values[1].string.text, job->username); } else if (strcmp(attr->values[0].string.text, Classification) && strcmp(attr->values[0].string.text, "none") && (attr->num_values == 1 || (strcmp(attr->values[1].string.text, Classification) && strcmp(attr->values[1].string.text, "none")))) { if (attr->num_values == 1) cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION OVERRIDDEN " "job-sheets=\"%s\", " "job-originating-user-name=\"%s\"", attr->values[0].string.text, job->username); else cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION OVERRIDDEN " "job-sheets=\"%s,%s\",fffff " "job-originating-user-name=\"%s\"", attr->values[0].string.text, attr->values[1].string.text, job->username); } } else if (strcmp(attr->values[0].string.text, Classification) && (attr->num_values == 1 || strcmp(attr->values[1].string.text, Classification))) { /* * Force the banner to have the classification on it... */ if (attr->num_values > 1 && !strcmp(attr->values[0].string.text, attr->values[1].string.text)) { ippSetString(job->attrs, &attr, 0, Classification); ippSetString(job->attrs, &attr, 1, Classification); } else { if (attr->num_values == 1 || strcmp(attr->values[0].string.text, "none")) ippSetString(job->attrs, &attr, 0, Classification); if (attr->num_values > 1 && strcmp(attr->values[1].string.text, "none")) ippSetString(job->attrs, &attr, 1, Classification); } if (attr->num_values > 1) cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED " "job-sheets=\"%s,%s\", " "job-originating-user-name=\"%s\"", attr->values[0].string.text, attr->values[1].string.text, job->username); else cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED " "job-sheets=\"%s\", " "job-originating-user-name=\"%s\"", Classification, job->username); } } /* * See if we need to add the starting sheet... */ if (!(printer->type & CUPS_PRINTER_REMOTE)) { cupsdLogJob(job, CUPSD_LOG_INFO, "Adding start banner page \"%s\".", attr->values[0].string.text); if ((kbytes = copy_banner(con, job, attr->values[0].string.text)) < 0) { cupsdSetJobState(job, IPP_JOB_ABORTED, CUPSD_JOB_PURGE, "Aborting job because the start banner could not be " "copied."); return (NULL); } cupsdUpdateQuota(printer, job->username, 0, kbytes); } } else if ((attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) != NULL) job->job_sheets = attr; /* * Fill in the response info... */ httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL, con->clientname, con->clientport, "/jobs/%d", job->id); ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL, job_uri); ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id); ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", job->state_value); ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_TEXT, "job-state-message", NULL, ""); ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, job->reasons->values[0].string.text); con->response->request.status.status_code = IPP_OK; /* * Add any job subscriptions... */ add_job_subscriptions(con, job); /* * Set all but the first two attributes to the job attributes group... */ for (attr = job->attrs->attrs->next->next; attr; attr = attr->next) attr->group_tag = IPP_TAG_JOB; /* * Fire the "job created" event... */ cupsdAddEvent(CUPSD_EVENT_JOB_CREATED, printer, job, "Job created."); /* * Return the new job... */ return (job); }
3917
True
1
CVE-2017-18922
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/LibVNC/libvncserver/commit/aac95a9dcf4bbba87b76c72706c3221a842ca433', 'name': 'https://github.com/LibVNC/libvncserver/commit/aac95a9dcf4bbba87b76c72706c3221a842ca433', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2020/06/30/2', 'name': 'https://www.openwall.com/lists/oss-security/2020/06/30/2', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1852356', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1852356', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/06/30/3', 'name': '[oss-security] 20200630 Re: libvncserver: old websocket decoding patch', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00020.html', 'name': 'openSUSE-SU-2020:0960', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NVP7TJVYJDXDFRHVQ3ENEN3H354QPXEZ/', 'name': 'FEDORA-2020-37112ac660', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4407-1/', 'name': 'USN-4407-1', 'refsource': 'UBUNTU', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4F6FUH4EFK4NAP6GT4TQRTBKWIRCZLIY/', 'name': 'FEDORA-2020-1a4b1c8271', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00028.html', 'name': 'openSUSE-SU-2020:0978', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvncserver_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', '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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', '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:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'It was discovered that websockets.c in LibVNCServer prior to 0.9.12 did not properly decode certain WebSocket frames. A malicious attacker could exploit this by sending specially crafted WebSocket frames to a server, causing a heap-based buffer overflow.'}]
2022-04-01T18:08Z
2020-06-30T11: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
Andreas Weigel
2017-02-15 12:31:05+01:00
fix overflow and refactor websockets decode (Hybi) fix critical heap-based buffer overflow which allowed easy modification of a return address via an overwritten function pointer fix bug causing connections to fail due a "one websocket frame = one ws_read" assumption, which failed with LibVNCServer-0.9.11 refactor websocket Hybi decode to use a simple state machine for decoding of websocket frames
aac95a9dcf4bbba87b76c72706c3221a842ca433
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
webSocketsDecodeHybi
webSocketsDecodeHybi( rfbClientPtr cl , char * dst , int len)
['cl', 'dst', 'len']
webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len) { char *buf, *payload; uint32_t *payload32; int ret = -1, result = -1; int total = 0; ws_mask_t mask; ws_header_t *header; int i; unsigned char opcode; ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; int flength, fhlen; /* int fin; */ /* not used atm */ /* rfbLog(" <== %s[%d]: %d cl: %p, wsctx: %p-%p (%d)\n", __func__, gettid(), len, cl, wsctx, (char *)wsctx + sizeof(ws_ctx_t), sizeof(ws_ctx_t)); */ if (wsctx->readbuflen) { /* simply return what we have */ if (wsctx->readbuflen > len) { memcpy(dst, wsctx->readbuf + wsctx->readbufstart, len); result = len; wsctx->readbuflen -= len; wsctx->readbufstart += len; } else { memcpy(dst, wsctx->readbuf + wsctx->readbufstart, wsctx->readbuflen); result = wsctx->readbuflen; wsctx->readbuflen = 0; wsctx->readbufstart = 0; } goto spor; } buf = wsctx->codeBufDecode; header = (ws_header_t *)wsctx->codeBufDecode; ret = ws_peek(cl, buf, B64LEN(len) + WSHLENMAX); if (ret < 2) { /* save errno because rfbErr() will tamper it */ if (-1 == ret) { int olderrno = errno; rfbErr("%s: peek; %m\n", __func__); errno = olderrno; } else if (0 == ret) { result = 0; } else { errno = EAGAIN; } goto spor; } opcode = header->b0 & 0x0f; /* fin = (header->b0 & 0x80) >> 7; */ /* not used atm */ flength = header->b1 & 0x7f; /* * 4.3. Client-to-Server Masking * * The client MUST mask all frames sent to the server. A server MUST * close the connection upon receiving a frame with the MASK bit set to 0. **/ if (!(header->b1 & 0x80)) { rfbErr("%s: got frame without mask\n", __func__, ret); errno = EIO; goto spor; } if (flength < 126) { fhlen = 2; mask = header->u.m; } else if (flength == 126 && 4 <= ret) { flength = WS_NTOH16(header->u.s16.l16); fhlen = 4; mask = header->u.s16.m16; } else if (flength == 127 && 10 <= ret) { flength = WS_NTOH64(header->u.s64.l64); fhlen = 10; mask = header->u.s64.m64; } else { /* Incomplete frame header */ rfbErr("%s: incomplete frame header\n", __func__, ret); errno = EIO; goto spor; } /* absolute length of frame */ total = fhlen + flength + 4; payload = buf + fhlen + 4; /* header length + mask */ if (-1 == (ret = ws_read(cl, buf, total))) { int olderrno = errno; rfbErr("%s: read; %m", __func__); errno = olderrno; return ret; } else if (ret < total) { /* GT TODO: hmm? */ rfbLog("%s: read; got partial data\n", __func__); } else { buf[ret] = '\0'; } /* process 1 frame (32 bit op) */ payload32 = (uint32_t *)payload; for (i = 0; i < flength / 4; i++) { payload32[i] ^= mask.u; } /* process the remaining bytes (if any) */ for (i*=4; i < flength; i++) { payload[i] ^= mask.c[i % 4]; } switch (opcode) { case WS_OPCODE_CLOSE: rfbLog("got closure, reason %d\n", WS_NTOH16(((uint16_t *)payload)[0])); errno = ECONNRESET; break; case WS_OPCODE_TEXT_FRAME: if (-1 == (flength = b64_pton(payload, (unsigned char *)wsctx->codeBufDecode, sizeof(wsctx->codeBufDecode)))) { rfbErr("%s: Base64 decode error; %m\n", __func__); break; } payload = wsctx->codeBufDecode; /* fall through */ case WS_OPCODE_BINARY_FRAME: if (flength > len) { memcpy(wsctx->readbuf, payload + len, flength - len); wsctx->readbufstart = 0; wsctx->readbuflen = flength - len; flength = len; } memcpy(dst, payload, flength); result = flength; break; default: rfbErr("%s: unhandled opcode %d, b0: %02x, b1: %02x\n", __func__, (int)opcode, header->b0, header->b1); } /* single point of return, if someone has questions :-) */ spor: /* rfbLog("%s: ret: %d/%d\n", __func__, result, len); */ return result; }
729
True
1
CVE-2017-18922
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/LibVNC/libvncserver/commit/aac95a9dcf4bbba87b76c72706c3221a842ca433', 'name': 'https://github.com/LibVNC/libvncserver/commit/aac95a9dcf4bbba87b76c72706c3221a842ca433', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2020/06/30/2', 'name': 'https://www.openwall.com/lists/oss-security/2020/06/30/2', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1852356', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1852356', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/06/30/3', 'name': '[oss-security] 20200630 Re: libvncserver: old websocket decoding patch', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00020.html', 'name': 'openSUSE-SU-2020:0960', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NVP7TJVYJDXDFRHVQ3ENEN3H354QPXEZ/', 'name': 'FEDORA-2020-37112ac660', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4407-1/', 'name': 'USN-4407-1', 'refsource': 'UBUNTU', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4F6FUH4EFK4NAP6GT4TQRTBKWIRCZLIY/', 'name': 'FEDORA-2020-1a4b1c8271', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00028.html', 'name': 'openSUSE-SU-2020:0978', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvncserver_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', '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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', '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:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'It was discovered that websockets.c in LibVNCServer prior to 0.9.12 did not properly decode certain WebSocket frames. A malicious attacker could exploit this by sending specially crafted WebSocket frames to a server, causing a heap-based buffer overflow.'}]
2022-04-01T18:08Z
2020-06-30T11: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
Andreas Weigel
2017-02-15 12:31:05+01:00
fix overflow and refactor websockets decode (Hybi) fix critical heap-based buffer overflow which allowed easy modification of a return address via an overwritten function pointer fix bug causing connections to fail due a "one websocket frame = one ws_read" assumption, which failed with LibVNCServer-0.9.11 refactor websocket Hybi decode to use a simple state machine for decoding of websocket frames
aac95a9dcf4bbba87b76c72706c3221a842ca433
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
webSocketsHasDataInBuffer
webSocketsHasDataInBuffer( rfbClientPtr cl)
['cl']
webSocketsHasDataInBuffer(rfbClientPtr cl) { ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; if (wsctx && wsctx->readbuflen) return TRUE; return (cl->sslctx && rfbssl_pending(cl) > 0); }
44
True
1
CVE-2018-20748
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://www.openwall.com/lists/oss-security/2018/12/10/8', 'name': 'https://www.openwall.com/lists/oss-security/2018/12/10/8', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/issues/273', 'name': 'https://github.com/LibVNC/libvncserver/issues/273', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'name': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'name': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'name': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'name': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3877-1/', 'name': 'USN-3877-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00029.html', 'name': '[debian-lts-announce] 20190131 [SECURITY] [DLA 1652-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00042.html', 'name': '[debian-lts-announce] 20191030 [SECURITY] [DLA 1979-1] italc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4547-1/', 'name': 'USN-4547-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4587-1/', 'name': 'USN-4587-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'LibVNC before 0.9.12 contains multiple heap out-of-bounds write vulnerabilities in libvncclient/rfbproto.c. The fix for CVE-2018-20019 was incomplete.'}]
2022-03-09T21:54Z
2019-01-30T18:29Z
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
Christian Beier
2018-12-29 14:40:53+01:00
LibVNCClient: ignore server-sent reason strings longer than 1MB Fixes #273
e34bcbb759ca5bef85809967a268fdf214c1ad2c
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
ReadReason
ReadReason( rfbClient * client)
['client']
ReadReason(rfbClient* client) { uint32_t reasonLen; char *reason; /* we have an error following */ if (!ReadFromRFBServer(client, (char *)&reasonLen, 4)) return; reasonLen = rfbClientSwap32IfLE(reasonLen); reason = malloc((uint64_t)reasonLen+1); if (!ReadFromRFBServer(client, reason, reasonLen)) { free(reason); return; } reason[reasonLen]=0; rfbClientLog("VNC connection failed: %s\n",reason); free(reason); }
93
True
1
CVE-2018-20748
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://www.openwall.com/lists/oss-security/2018/12/10/8', 'name': 'https://www.openwall.com/lists/oss-security/2018/12/10/8', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/issues/273', 'name': 'https://github.com/LibVNC/libvncserver/issues/273', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'name': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'name': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'name': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'name': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3877-1/', 'name': 'USN-3877-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00029.html', 'name': '[debian-lts-announce] 20190131 [SECURITY] [DLA 1652-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00042.html', 'name': '[debian-lts-announce] 20191030 [SECURITY] [DLA 1979-1] italc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4547-1/', 'name': 'USN-4547-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4587-1/', 'name': 'USN-4587-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'LibVNC before 0.9.12 contains multiple heap out-of-bounds write vulnerabilities in libvncclient/rfbproto.c. The fix for CVE-2018-20019 was incomplete.'}]
2022-03-09T21:54Z
2019-01-30T18:29Z
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
Christian Beier
2018-12-29 14:40:53+01:00
LibVNCClient: ignore server-sent reason strings longer than 1MB Fixes #273
e34bcbb759ca5bef85809967a268fdf214c1ad2c
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
rfbHandleAuthResult
rfbHandleAuthResult( rfbClient * client)
['client']
rfbHandleAuthResult(rfbClient* client) { uint32_t authResult=0, reasonLen=0; char *reason=NULL; if (!ReadFromRFBServer(client, (char *)&authResult, 4)) return FALSE; authResult = rfbClientSwap32IfLE(authResult); switch (authResult) { case rfbVncAuthOK: rfbClientLog("VNC authentication succeeded\n"); return TRUE; break; case rfbVncAuthFailed: if (client->major==3 && client->minor>7) { /* we have an error following */ if (!ReadFromRFBServer(client, (char *)&reasonLen, 4)) return FALSE; reasonLen = rfbClientSwap32IfLE(reasonLen); reason = malloc((uint64_t)reasonLen+1); if (!ReadFromRFBServer(client, reason, reasonLen)) { free(reason); return FALSE; } reason[reasonLen]=0; rfbClientLog("VNC connection failed: %s\n",reason); free(reason); return FALSE; } rfbClientLog("VNC authentication failed\n"); return FALSE; case rfbVncAuthTooMany: rfbClientLog("VNC authentication failed - too many tries\n"); return FALSE; } rfbClientLog("Unknown VNC authentication result: %d\n", (int)authResult); return FALSE; }
203
True
1
CVE-2018-20748
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://www.openwall.com/lists/oss-security/2018/12/10/8', 'name': 'https://www.openwall.com/lists/oss-security/2018/12/10/8', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/issues/273', 'name': 'https://github.com/LibVNC/libvncserver/issues/273', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'name': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'name': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'name': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'name': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3877-1/', 'name': 'USN-3877-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00029.html', 'name': '[debian-lts-announce] 20190131 [SECURITY] [DLA 1652-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00042.html', 'name': '[debian-lts-announce] 20191030 [SECURITY] [DLA 1979-1] italc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4547-1/', 'name': 'USN-4547-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4587-1/', 'name': 'USN-4587-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'LibVNC before 0.9.12 contains multiple heap out-of-bounds write vulnerabilities in libvncclient/rfbproto.c. The fix for CVE-2018-20019 was incomplete.'}]
2022-03-09T21:54Z
2019-01-30T18:29Z
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
Christian Beier
2019-01-06 14:20:37+01:00
LibVNCClient: fail on server-sent desktop name lengths longer than 1MB re #273
c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
InitialiseRFBConnection
InitialiseRFBConnection( rfbClient * client)
['client']
InitialiseRFBConnection(rfbClient* client) { rfbProtocolVersionMsg pv; int major,minor; uint32_t authScheme; uint32_t subAuthScheme; rfbClientInitMsg ci; /* if the connection is immediately closed, don't report anything, so that pmw's monitor can make test connections */ if (client->listenSpecified) errorMessageOnReadFailure = FALSE; if (!ReadFromRFBServer(client, pv, sz_rfbProtocolVersionMsg)) return FALSE; pv[sz_rfbProtocolVersionMsg]=0; errorMessageOnReadFailure = TRUE; pv[sz_rfbProtocolVersionMsg] = 0; if (sscanf(pv,rfbProtocolVersionFormat,&major,&minor) != 2) { rfbClientLog("Not a valid VNC server (%s)\n",pv); return FALSE; } DefaultSupportedMessages(client); client->major = major; client->minor = minor; /* fall back to viewer supported version */ if ((major==rfbProtocolMajorVersion) && (minor>rfbProtocolMinorVersion)) client->minor = rfbProtocolMinorVersion; /* UltraVNC uses minor codes 4 and 6 for the server */ if (major==3 && (minor==4 || minor==6)) { rfbClientLog("UltraVNC server detected, enabling UltraVNC specific messages\n",pv); DefaultSupportedMessagesUltraVNC(client); } /* UltraVNC Single Click uses minor codes 14 and 16 for the server */ if (major==3 && (minor==14 || minor==16)) { minor = minor - 10; client->minor = minor; rfbClientLog("UltraVNC Single Click server detected, enabling UltraVNC specific messages\n",pv); DefaultSupportedMessagesUltraVNC(client); } /* TightVNC uses minor codes 5 for the server */ if (major==3 && minor==5) { rfbClientLog("TightVNC server detected, enabling TightVNC specific messages\n",pv); DefaultSupportedMessagesTightVNC(client); } /* we do not support > RFB3.8 */ if ((major==3 && minor>8) || major>3) { client->major=3; client->minor=8; } rfbClientLog("VNC server supports protocol version %d.%d (viewer %d.%d)\n", major, minor, rfbProtocolMajorVersion, rfbProtocolMinorVersion); sprintf(pv,rfbProtocolVersionFormat,client->major,client->minor); if (!WriteToRFBServer(client, pv, sz_rfbProtocolVersionMsg)) return FALSE; /* 3.7 and onwards sends a # of security types first */ if (client->major==3 && client->minor > 6) { if (!ReadSupportedSecurityType(client, &authScheme, FALSE)) return FALSE; } else { if (!ReadFromRFBServer(client, (char *)&authScheme, 4)) return FALSE; authScheme = rfbClientSwap32IfLE(authScheme); } rfbClientLog("Selected Security Scheme %d\n", authScheme); client->authScheme = authScheme; switch (authScheme) { case rfbConnFailed: ReadReason(client); return FALSE; case rfbNoAuth: rfbClientLog("No authentication needed\n"); /* 3.8 and upwards sends a Security Result for rfbNoAuth */ if ((client->major==3 && client->minor > 7) || client->major>3) if (!rfbHandleAuthResult(client)) return FALSE; break; case rfbVncAuth: if (!HandleVncAuth(client)) return FALSE; break; #ifdef LIBVNCSERVER_HAVE_SASL case rfbSASL: if (!HandleSASLAuth(client)) return FALSE; break; #endif /* LIBVNCSERVER_HAVE_SASL */ case rfbMSLogon: if (!HandleMSLogonAuth(client)) return FALSE; break; case rfbARD: #ifndef LIBVNCSERVER_WITH_CLIENT_GCRYPT rfbClientLog("GCrypt support was not compiled in\n"); return FALSE; #else if (!HandleARDAuth(client)) return FALSE; #endif break; case rfbTLS: if (!HandleAnonTLSAuth(client)) return FALSE; /* After the TLS session is established, sub auth types are expected. * Note that all following reading/writing are through the TLS session from here. */ if (!ReadSupportedSecurityType(client, &subAuthScheme, TRUE)) return FALSE; client->subAuthScheme = subAuthScheme; switch (subAuthScheme) { case rfbConnFailed: ReadReason(client); return FALSE; case rfbNoAuth: rfbClientLog("No sub authentication needed\n"); /* 3.8 and upwards sends a Security Result for rfbNoAuth */ if ((client->major==3 && client->minor > 7) || client->major>3) if (!rfbHandleAuthResult(client)) return FALSE; break; case rfbVncAuth: if (!HandleVncAuth(client)) return FALSE; break; #ifdef LIBVNCSERVER_HAVE_SASL case rfbSASL: if (!HandleSASLAuth(client)) return FALSE; break; #endif /* LIBVNCSERVER_HAVE_SASL */ default: rfbClientLog("Unknown sub authentication scheme from VNC server: %d\n", (int)subAuthScheme); return FALSE; } break; case rfbVeNCrypt: if (!HandleVeNCryptAuth(client)) return FALSE; switch (client->subAuthScheme) { case rfbVeNCryptTLSNone: case rfbVeNCryptX509None: rfbClientLog("No sub authentication needed\n"); if (!rfbHandleAuthResult(client)) return FALSE; break; case rfbVeNCryptTLSVNC: case rfbVeNCryptX509VNC: if (!HandleVncAuth(client)) return FALSE; break; case rfbVeNCryptTLSPlain: case rfbVeNCryptX509Plain: if (!HandlePlainAuth(client)) return FALSE; break; #ifdef LIBVNCSERVER_HAVE_SASL case rfbVeNCryptX509SASL: case rfbVeNCryptTLSSASL: if (!HandleSASLAuth(client)) return FALSE; break; #endif /* LIBVNCSERVER_HAVE_SASL */ default: rfbClientLog("Unknown sub authentication scheme from VNC server: %d\n", client->subAuthScheme); return FALSE; } break; default: { rfbBool authHandled=FALSE; rfbClientProtocolExtension* e; for (e = rfbClientExtensions; e; e = e->next) { uint32_t const* secType; if (!e->handleAuthentication) continue; for (secType = e->securityTypes; secType && *secType; secType++) { if (authScheme==*secType) { if (!e->handleAuthentication(client, authScheme)) return FALSE; if (!rfbHandleAuthResult(client)) return FALSE; authHandled=TRUE; } } } if (authHandled) break; } rfbClientLog("Unknown authentication scheme from VNC server: %d\n", (int)authScheme); return FALSE; } ci.shared = (client->appData.shareDesktop ? 1 : 0); if (!WriteToRFBServer(client, (char *)&ci, sz_rfbClientInitMsg)) return FALSE; if (!ReadFromRFBServer(client, (char *)&client->si, sz_rfbServerInitMsg)) return FALSE; client->si.framebufferWidth = rfbClientSwap16IfLE(client->si.framebufferWidth); client->si.framebufferHeight = rfbClientSwap16IfLE(client->si.framebufferHeight); client->si.format.redMax = rfbClientSwap16IfLE(client->si.format.redMax); client->si.format.greenMax = rfbClientSwap16IfLE(client->si.format.greenMax); client->si.format.blueMax = rfbClientSwap16IfLE(client->si.format.blueMax); client->si.nameLength = rfbClientSwap32IfLE(client->si.nameLength); /* To guard against integer wrap-around, si.nameLength is cast to 64 bit */ client->desktopName = malloc((uint64_t)client->si.nameLength + 1); if (!client->desktopName) { rfbClientLog("Error allocating memory for desktop name, %lu bytes\n", (unsigned long)client->si.nameLength); return FALSE; } if (!ReadFromRFBServer(client, client->desktopName, client->si.nameLength)) return FALSE; client->desktopName[client->si.nameLength] = 0; rfbClientLog("Desktop name \"%s\"\n",client->desktopName); rfbClientLog("Connected to VNC server, using protocol version %d.%d\n", client->major, client->minor); rfbClientLog("VNC server default format:\n"); PrintPixelFormat(&client->si.format); return TRUE; }
1172
True
1
CVE-2018-20748
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://www.openwall.com/lists/oss-security/2018/12/10/8', 'name': 'https://www.openwall.com/lists/oss-security/2018/12/10/8', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/issues/273', 'name': 'https://github.com/LibVNC/libvncserver/issues/273', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'name': 'https://github.com/LibVNC/libvncserver/commit/e34bcbb759ca5bef85809967a268fdf214c1ad2c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'name': 'https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'name': 'https://github.com/LibVNC/libvncserver/commit/c2c4b81e6cb3b485fb1ec7ba9e7defeb889f6ba7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'name': 'https://github.com/LibVNC/libvncserver/commit/a64c3b37af9a6c8f8009d7516874b8d266b42bae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3877-1/', 'name': 'USN-3877-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00029.html', 'name': '[debian-lts-announce] 20190131 [SECURITY] [DLA 1652-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00042.html', 'name': '[debian-lts-announce] 20191030 [SECURITY] [DLA 1979-1] italc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4547-1/', 'name': 'USN-4547-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4587-1/', 'name': 'USN-4587-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'LibVNC before 0.9.12 contains multiple heap out-of-bounds write vulnerabilities in libvncclient/rfbproto.c. The fix for CVE-2018-20019 was incomplete.'}]
2022-03-09T21:54Z
2019-01-30T18:29Z
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
Christian Beier
2019-01-06 14:22:34+01:00
LibVNCClient: remove now-useless cast re #273
a64c3b37af9a6c8f8009d7516874b8d266b42bae
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
HandleRFBServerMessage
HandleRFBServerMessage( rfbClient * client)
['client']
HandleRFBServerMessage(rfbClient* client) { rfbServerToClientMsg msg; if (client->serverPort==-1) client->vncRec->readTimestamp = TRUE; if (!ReadFromRFBServer(client, (char *)&msg, 1)) return FALSE; switch (msg.type) { case rfbSetColourMapEntries: { /* TODO: int i; uint16_t rgb[3]; XColor xc; if (!ReadFromRFBServer(client, ((char *)&msg) + 1, sz_rfbSetColourMapEntriesMsg - 1)) return FALSE; msg.scme.firstColour = rfbClientSwap16IfLE(msg.scme.firstColour); msg.scme.nColours = rfbClientSwap16IfLE(msg.scme.nColours); for (i = 0; i < msg.scme.nColours; i++) { if (!ReadFromRFBServer(client, (char *)rgb, 6)) return FALSE; xc.pixel = msg.scme.firstColour + i; xc.red = rfbClientSwap16IfLE(rgb[0]); xc.green = rfbClientSwap16IfLE(rgb[1]); xc.blue = rfbClientSwap16IfLE(rgb[2]); xc.flags = DoRed|DoGreen|DoBlue; XStoreColor(dpy, cmap, &xc); } */ break; } case rfbFramebufferUpdate: { rfbFramebufferUpdateRectHeader rect; int linesToRead; int bytesPerLine; int i; if (!ReadFromRFBServer(client, ((char *)&msg.fu) + 1, sz_rfbFramebufferUpdateMsg - 1)) return FALSE; msg.fu.nRects = rfbClientSwap16IfLE(msg.fu.nRects); for (i = 0; i < msg.fu.nRects; i++) { if (!ReadFromRFBServer(client, (char *)&rect, sz_rfbFramebufferUpdateRectHeader)) return FALSE; rect.encoding = rfbClientSwap32IfLE(rect.encoding); if (rect.encoding == rfbEncodingLastRect) break; rect.r.x = rfbClientSwap16IfLE(rect.r.x); rect.r.y = rfbClientSwap16IfLE(rect.r.y); rect.r.w = rfbClientSwap16IfLE(rect.r.w); rect.r.h = rfbClientSwap16IfLE(rect.r.h); if (rect.encoding == rfbEncodingXCursor || rect.encoding == rfbEncodingRichCursor) { if (!HandleCursorShape(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h, rect.encoding)) { return FALSE; } continue; } if (rect.encoding == rfbEncodingPointerPos) { if (!client->HandleCursorPos(client,rect.r.x, rect.r.y)) { return FALSE; } continue; } if (rect.encoding == rfbEncodingKeyboardLedState) { /* OK! We have received a keyboard state message!!! */ client->KeyboardLedStateEnabled = 1; if (client->HandleKeyboardLedState!=NULL) client->HandleKeyboardLedState(client, rect.r.x, 0); /* stash it for the future */ client->CurrentKeyboardLedState = rect.r.x; continue; } if (rect.encoding == rfbEncodingNewFBSize) { client->width = rect.r.w; client->height = rect.r.h; client->updateRect.x = client->updateRect.y = 0; client->updateRect.w = client->width; client->updateRect.h = client->height; if (!client->MallocFrameBuffer(client)) return FALSE; SendFramebufferUpdateRequest(client, 0, 0, rect.r.w, rect.r.h, FALSE); rfbClientLog("Got new framebuffer size: %dx%d\n", rect.r.w, rect.r.h); continue; } /* rect.r.w=byte count */ if (rect.encoding == rfbEncodingSupportedMessages) { int loop; if (!ReadFromRFBServer(client, (char *)&client->supportedMessages, sz_rfbSupportedMessages)) return FALSE; /* msgs is two sets of bit flags of supported messages client2server[] and server2client[] */ /* currently ignored by this library */ rfbClientLog("client2server supported messages (bit flags)\n"); for (loop=0;loop<32;loop+=8) rfbClientLog("%02X: %04x %04x %04x %04x - %04x %04x %04x %04x\n", loop, client->supportedMessages.client2server[loop], client->supportedMessages.client2server[loop+1], client->supportedMessages.client2server[loop+2], client->supportedMessages.client2server[loop+3], client->supportedMessages.client2server[loop+4], client->supportedMessages.client2server[loop+5], client->supportedMessages.client2server[loop+6], client->supportedMessages.client2server[loop+7]); rfbClientLog("server2client supported messages (bit flags)\n"); for (loop=0;loop<32;loop+=8) rfbClientLog("%02X: %04x %04x %04x %04x - %04x %04x %04x %04x\n", loop, client->supportedMessages.server2client[loop], client->supportedMessages.server2client[loop+1], client->supportedMessages.server2client[loop+2], client->supportedMessages.server2client[loop+3], client->supportedMessages.server2client[loop+4], client->supportedMessages.server2client[loop+5], client->supportedMessages.server2client[loop+6], client->supportedMessages.server2client[loop+7]); continue; } /* rect.r.w=byte count, rect.r.h=# of encodings */ if (rect.encoding == rfbEncodingSupportedEncodings) { char *buffer; buffer = malloc(rect.r.w); if (!ReadFromRFBServer(client, buffer, rect.r.w)) { free(buffer); return FALSE; } /* buffer now contains rect.r.h # of uint32_t encodings that the server supports */ /* currently ignored by this library */ free(buffer); continue; } /* rect.r.w=byte count */ if (rect.encoding == rfbEncodingServerIdentity) { char *buffer; buffer = malloc(rect.r.w+1); if (!ReadFromRFBServer(client, buffer, rect.r.w)) { free(buffer); return FALSE; } buffer[rect.r.w]=0; /* null terminate, just in case */ rfbClientLog("Connected to Server \"%s\"\n", buffer); free(buffer); continue; } /* rfbEncodingUltraZip is a collection of subrects. x = # of subrects, and h is always 0 */ if (rect.encoding != rfbEncodingUltraZip) { if ((rect.r.x + rect.r.w > client->width) || (rect.r.y + rect.r.h > client->height)) { rfbClientLog("Rect too large: %dx%d at (%d, %d)\n", rect.r.w, rect.r.h, rect.r.x, rect.r.y); return FALSE; } /* UltraVNC with scaling, will send rectangles with a zero W or H * if ((rect.encoding != rfbEncodingTight) && (rect.r.h * rect.r.w == 0)) { rfbClientLog("Zero size rect - ignoring (encoding=%d (0x%08x) %dx, %dy, %dw, %dh)\n", rect.encoding, rect.encoding, rect.r.x, rect.r.y, rect.r.w, rect.r.h); continue; } */ /* If RichCursor encoding is used, we should prevent collisions between framebuffer updates and cursor drawing operations. */ client->SoftCursorLockArea(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h); } switch (rect.encoding) { case rfbEncodingRaw: { int y=rect.r.y, h=rect.r.h; bytesPerLine = rect.r.w * client->format.bitsPerPixel / 8; /* RealVNC 4.x-5.x on OSX can induce bytesPerLine==0, usually during GPU accel. */ /* Regardless of cause, do not divide by zero. */ linesToRead = bytesPerLine ? (RFB_BUFFER_SIZE / bytesPerLine) : 0; while (linesToRead && h > 0) { if (linesToRead > h) linesToRead = h; if (!ReadFromRFBServer(client, client->buffer,bytesPerLine * linesToRead)) return FALSE; client->GotBitmap(client, (uint8_t *)client->buffer, rect.r.x, y, rect.r.w,linesToRead); h -= linesToRead; y += linesToRead; } break; } case rfbEncodingCopyRect: { rfbCopyRect cr; if (!ReadFromRFBServer(client, (char *)&cr, sz_rfbCopyRect)) return FALSE; cr.srcX = rfbClientSwap16IfLE(cr.srcX); cr.srcY = rfbClientSwap16IfLE(cr.srcY); /* If RichCursor encoding is used, we should extend our "cursor lock area" (previously set to destination rectangle) to the source rectangle as well. */ client->SoftCursorLockArea(client, cr.srcX, cr.srcY, rect.r.w, rect.r.h); client->GotCopyRect(client, cr.srcX, cr.srcY, rect.r.w, rect.r.h, rect.r.x, rect.r.y); break; } case rfbEncodingRRE: { switch (client->format.bitsPerPixel) { case 8: if (!HandleRRE8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleRRE16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleRRE32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } case rfbEncodingCoRRE: { switch (client->format.bitsPerPixel) { case 8: if (!HandleCoRRE8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleCoRRE16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleCoRRE32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } case rfbEncodingHextile: { switch (client->format.bitsPerPixel) { case 8: if (!HandleHextile8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleHextile16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleHextile32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } case rfbEncodingUltra: { switch (client->format.bitsPerPixel) { case 8: if (!HandleUltra8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleUltra16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleUltra32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } case rfbEncodingUltraZip: { switch (client->format.bitsPerPixel) { case 8: if (!HandleUltraZip8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleUltraZip16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleUltraZip32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } case rfbEncodingTRLE: { switch (client->format.bitsPerPixel) { case 8: if (!HandleTRLE8(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; break; case 16: if (client->si.format.greenMax > 0x1F) { if (!HandleTRLE16(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; } else { if (!HandleTRLE15(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; } break; case 32: { uint32_t maxColor = (client->format.redMax << client->format.redShift) | (client->format.greenMax << client->format.greenShift) | (client->format.blueMax << client->format.blueShift); if ((client->format.bigEndian && (maxColor & 0xff) == 0) || (!client->format.bigEndian && (maxColor & 0xff000000) == 0)) { if (!HandleTRLE24(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; } else if (!client->format.bigEndian && (maxColor & 0xff) == 0) { if (!HandleTRLE24Up(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; } else if (client->format.bigEndian && (maxColor & 0xff000000) == 0) { if (!HandleTRLE24Down(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; } else if (!HandleTRLE32(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h)) return FALSE; break; } } break; } #ifdef LIBVNCSERVER_HAVE_LIBZ case rfbEncodingZlib: { switch (client->format.bitsPerPixel) { case 8: if (!HandleZlib8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleZlib16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleZlib32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } #ifdef LIBVNCSERVER_HAVE_LIBJPEG case rfbEncodingTight: { switch (client->format.bitsPerPixel) { case 8: if (!HandleTight8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (!HandleTight16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 32: if (!HandleTight32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } break; } #endif case rfbEncodingZRLE: /* Fail safe for ZYWRLE unsupport VNC server. */ client->appData.qualityLevel = 9; /* fall through */ case rfbEncodingZYWRLE: { switch (client->format.bitsPerPixel) { case 8: if (!HandleZRLE8(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; case 16: if (client->si.format.greenMax > 0x1F) { if (!HandleZRLE16(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; } else { if (!HandleZRLE15(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; } break; case 32: { uint32_t maxColor=(client->format.redMax<<client->format.redShift)| (client->format.greenMax<<client->format.greenShift)| (client->format.blueMax<<client->format.blueShift); if ((client->format.bigEndian && (maxColor&0xff)==0) || (!client->format.bigEndian && (maxColor&0xff000000)==0)) { if (!HandleZRLE24(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; } else if (!client->format.bigEndian && (maxColor&0xff)==0) { if (!HandleZRLE24Up(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; } else if (client->format.bigEndian && (maxColor&0xff000000)==0) { if (!HandleZRLE24Down(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; } else if (!HandleZRLE32(client, rect.r.x,rect.r.y,rect.r.w,rect.r.h)) return FALSE; break; } } break; } #endif default: { rfbBool handled = FALSE; rfbClientProtocolExtension* e; for(e = rfbClientExtensions; !handled && e; e = e->next) if(e->handleEncoding && e->handleEncoding(client, &rect)) handled = TRUE; if(!handled) { rfbClientLog("Unknown rect encoding %d\n", (int)rect.encoding); return FALSE; } } } /* Now we may discard "soft cursor locks". */ client->SoftCursorUnlockScreen(client); client->GotFrameBufferUpdate(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h); } if (!SendIncrementalFramebufferUpdateRequest(client)) return FALSE; if (client->FinishedFrameBufferUpdate) client->FinishedFrameBufferUpdate(client); break; } case rfbBell: { client->Bell(client); break; } case rfbServerCutText: { char *buffer; if (!ReadFromRFBServer(client, ((char *)&msg) + 1, sz_rfbServerCutTextMsg - 1)) return FALSE; msg.sct.length = rfbClientSwap32IfLE(msg.sct.length); if (msg.sct.length > 1<<20) { rfbClientErr("Ignoring too big cut text length sent by server: %u B > 1 MB\n", (unsigned int)msg.sct.length); return FALSE; } buffer = malloc((uint64_t)msg.sct.length+1); if (!ReadFromRFBServer(client, buffer, msg.sct.length)) { free(buffer); return FALSE; } buffer[msg.sct.length] = 0; if (client->GotXCutText) client->GotXCutText(client, buffer, msg.sct.length); free(buffer); break; } case rfbTextChat: { char *buffer=NULL; if (!ReadFromRFBServer(client, ((char *)&msg) + 1, sz_rfbTextChatMsg- 1)) return FALSE; msg.tc.length = rfbClientSwap32IfLE(msg.sct.length); switch(msg.tc.length) { case rfbTextChatOpen: rfbClientLog("Received TextChat Open\n"); if (client->HandleTextChat!=NULL) client->HandleTextChat(client, (int)rfbTextChatOpen, NULL); break; case rfbTextChatClose: rfbClientLog("Received TextChat Close\n"); if (client->HandleTextChat!=NULL) client->HandleTextChat(client, (int)rfbTextChatClose, NULL); break; case rfbTextChatFinished: rfbClientLog("Received TextChat Finished\n"); if (client->HandleTextChat!=NULL) client->HandleTextChat(client, (int)rfbTextChatFinished, NULL); break; default: buffer=malloc(msg.tc.length+1); if (!ReadFromRFBServer(client, buffer, msg.tc.length)) { free(buffer); return FALSE; } /* Null Terminate <just in case> */ buffer[msg.tc.length]=0; rfbClientLog("Received TextChat \"%s\"\n", buffer); if (client->HandleTextChat!=NULL) client->HandleTextChat(client, (int)msg.tc.length, buffer); free(buffer); break; } break; } case rfbXvp: { if (!ReadFromRFBServer(client, ((char *)&msg) + 1, sz_rfbXvpMsg -1)) return FALSE; SetClient2Server(client, rfbXvp); /* technically, we only care what we can *send* to the server * but, we set Server2Client Just in case it ever becomes useful */ SetServer2Client(client, rfbXvp); if(client->HandleXvpMsg) client->HandleXvpMsg(client, msg.xvp.version, msg.xvp.code); break; } case rfbResizeFrameBuffer: { if (!ReadFromRFBServer(client, ((char *)&msg) + 1, sz_rfbResizeFrameBufferMsg -1)) return FALSE; client->width = rfbClientSwap16IfLE(msg.rsfb.framebufferWidth); client->height = rfbClientSwap16IfLE(msg.rsfb.framebufferHeigth); client->updateRect.x = client->updateRect.y = 0; client->updateRect.w = client->width; client->updateRect.h = client->height; if (!client->MallocFrameBuffer(client)) return FALSE; SendFramebufferUpdateRequest(client, 0, 0, client->width, client->height, FALSE); rfbClientLog("Got new framebuffer size: %dx%d\n", client->width, client->height); break; } case rfbPalmVNCReSizeFrameBuffer: { if (!ReadFromRFBServer(client, ((char *)&msg) + 1, sz_rfbPalmVNCReSizeFrameBufferMsg -1)) return FALSE; client->width = rfbClientSwap16IfLE(msg.prsfb.buffer_w); client->height = rfbClientSwap16IfLE(msg.prsfb.buffer_h); client->updateRect.x = client->updateRect.y = 0; client->updateRect.w = client->width; client->updateRect.h = client->height; if (!client->MallocFrameBuffer(client)) return FALSE; SendFramebufferUpdateRequest(client, 0, 0, client->width, client->height, FALSE); rfbClientLog("Got new framebuffer size: %dx%d\n", client->width, client->height); break; } default: { rfbBool handled = FALSE; rfbClientProtocolExtension* e; for(e = rfbClientExtensions; !handled && e; e = e->next) if(e->handleMessage && e->handleMessage(client, &msg)) handled = TRUE; if(!handled) { char buffer[256]; rfbClientLog("Unknown message type %d from VNC server\n",msg.type); ReadFromRFBServer(client, buffer, 256); return FALSE; } } } return TRUE; }
4090
True
1
CVE-2018-20749
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://www.openwall.com/lists/oss-security/2018/12/10/8', 'name': 'https://www.openwall.com/lists/oss-security/2018/12/10/8', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/issues/273', 'name': 'https://github.com/LibVNC/libvncserver/issues/273', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/15bb719c03cc70f14c36a843dcb16ed69b405707', 'name': 'https://github.com/LibVNC/libvncserver/commit/15bb719c03cc70f14c36a843dcb16ed69b405707', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3877-1/', 'name': 'USN-3877-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00029.html', 'name': '[debian-lts-announce] 20190131 [SECURITY] [DLA 1652-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/106825', 'name': '106825', 'refsource': 'BID', 'tags': ['Broken Link']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00042.html', 'name': '[debian-lts-announce] 20191030 [SECURITY] [DLA 1979-1] italc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4547-1/', 'name': 'USN-4547-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4587-1/', 'name': 'USN-4587-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'LibVNC before 0.9.12 contains a heap out-of-bounds write vulnerability in libvncserver/rfbserver.c. The fix for CVE-2018-15127 was incomplete.'}]
2022-03-09T21:54Z
2019-01-30T18:29Z
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
Christian Beier
2019-01-06 15:13:56+01:00
Error out in rfbProcessFileTransferReadBuffer if length can not be allocated re #273
15bb719c03cc70f14c36a843dcb16ed69b405707
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
rfbProcessFileTransferReadBuffer
rfbProcessFileTransferReadBuffer( rfbClientPtr cl , uint32_t length)
['cl', 'length']
char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) { char *buffer=NULL; int n=0; FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL); /* rfbLog("rfbProcessFileTransferReadBuffer(%dlen)\n", length); */ if (length>0) { buffer=malloc((uint64_t)length+1); if (buffer!=NULL) { if ((n = rfbReadExact(cl, (char *)buffer, length)) <= 0) { if (n != 0) rfbLogPerror("rfbProcessFileTransferReadBuffer: read"); rfbCloseClient(cl); /* NOTE: don't forget to free(buffer) if you return early! */ if (buffer!=NULL) free(buffer); return NULL; } /* Null Terminate */ buffer[length]=0; } } return buffer; }
121
True
1
CVE-2018-20750
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://www.openwall.com/lists/oss-security/2018/12/10/8', 'name': 'https://www.openwall.com/lists/oss-security/2018/12/10/8', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/issues/273', 'name': 'https://github.com/LibVNC/libvncserver/issues/273', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/09e8fc02f59f16e2583b34fe1a270c238bd9ffec', 'name': 'https://github.com/LibVNC/libvncserver/commit/09e8fc02f59f16e2583b34fe1a270c238bd9ffec', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3877-1/', 'name': 'USN-3877-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00029.html', 'name': '[debian-lts-announce] 20190131 [SECURITY] [DLA 1652-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/106825', 'name': '106825', 'refsource': 'BID', 'tags': ['Broken Link']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00042.html', 'name': '[debian-lts-announce] 20191030 [SECURITY] [DLA 1979-1] italc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4547-1/', 'name': 'USN-4547-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4587-1/', 'name': 'USN-4587-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'LibVNC through 0.9.12 contains a heap out-of-bounds write vulnerability in libvncserver/rfbserver.c. The fix for CVE-2018-15127 was incomplete.'}]
2022-03-09T21:55Z
2019-01-30T18:29Z
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
Petr Písař
2019-01-07 10:40:01+01:00
Limit lenght to INT_MAX bytes in rfbProcessFileTransferReadBuffer() This ammends 15bb719c03cc70f14c36a843dcb16ed69b405707 fix for a heap out-of-bound write access in rfbProcessFileTransferReadBuffer() when reading a transfered file content in a server. The former fix did not work on platforms with a 32-bit int type (expected by rfbReadExact()). CVE-2018-15127 <https://github.com/LibVNC/libvncserver/issues/243> <https://github.com/LibVNC/libvncserver/issues/273>
09e8fc02f59f16e2583b34fe1a270c238bd9ffec
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
rfbProcessFileTransferReadBuffer
rfbProcessFileTransferReadBuffer( rfbClientPtr cl , uint32_t length)
['cl', 'length']
char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) { char *buffer=NULL; int n=0; FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL); /* We later alloc length+1, which might wrap around on 32-bit systems if length equals 0XFFFFFFFF, i.e. SIZE_MAX for 32-bit systems. On 64-bit systems, a length of 0XFFFFFFFF will safely be allocated since this check will never trigger and malloc() can digest length+1 without problems as length is a uint32_t. */ if(length == SIZE_MAX) { rfbErr("rfbProcessFileTransferReadBuffer: too big file transfer length requested: %u", (unsigned int)length); rfbCloseClient(cl); return NULL; } if (length>0) { buffer=malloc((size_t)length+1); if (buffer!=NULL) { if ((n = rfbReadExact(cl, (char *)buffer, length)) <= 0) { if (n != 0) rfbLogPerror("rfbProcessFileTransferReadBuffer: read"); rfbCloseClient(cl); /* NOTE: don't forget to free(buffer) if you return early! */ if (buffer!=NULL) free(buffer); return NULL; } /* Null Terminate */ buffer[length]=0; } } return buffer; }
148
True
1
CVE-2019-20840
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/0cf1400c61850065de590d403f6d49e32882fd76', 'name': 'https://github.com/LibVNC/libvncserver/commit/0cf1400c61850065de590d403f6d49e32882fd76', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4F6FUH4EFK4NAP6GT4TQRTBKWIRCZLIY/', 'name': 'FEDORA-2020-1a4b1c8271', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncserver/ws_decode.c can lead to a crash because of unaligned accesses in hybiReadAndDecode.'}]
2022-03-10T15:23Z
2020-06-17T16: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
Rolf Eike Beer
2019-05-28 18:30:46+02:00
fix crash because of unaligned accesses in hybiReadAndDecode()
0cf1400c61850065de590d403f6d49e32882fd76
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
hybiReadAndDecode
hybiReadAndDecode( ws_ctx_t * wsctx , char * dst , int len , int * sockRet , int nInBuf)
['wsctx', 'dst', 'len', 'sockRet', 'nInBuf']
hybiReadAndDecode(ws_ctx_t *wsctx, char *dst, int len, int *sockRet, int nInBuf) { int n; int i; int toReturn; /* number of data bytes to return */ int toDecode; /* number of bytes to decode starting at wsctx->writePos */ int bufsize; int nextRead; unsigned char *data; uint32_t *data32; /* if data was carried over, copy to start of buffer */ memcpy(wsctx->writePos, wsctx->carryBuf, wsctx->carrylen); wsctx->writePos += wsctx->carrylen; /* -1 accounts for potential '\0' terminator for base64 decoding */ bufsize = wsctx->codeBufDecode + ARRAYSIZE(wsctx->codeBufDecode) - wsctx->writePos - 1; ws_dbg("bufsize=%d\n", bufsize); if (hybiRemaining(wsctx) > bufsize) { nextRead = bufsize; } else { nextRead = hybiRemaining(wsctx); } ws_dbg("calling read with buf=%p and len=%d (decodebuf=%p headerLen=%d)\n", wsctx->writePos, nextRead, wsctx->codeBufDecode, wsctx->header.headerLen); if (nextRead > 0) { /* decode more data */ if (-1 == (n = wsctx->ctxInfo.readFunc(wsctx->ctxInfo.ctxPtr, wsctx->writePos, nextRead))) { int olderrno = errno; rfbErr("%s: read; %s", __func__, strerror(errno)); errno = olderrno; *sockRet = -1; return WS_HYBI_STATE_ERR; } else if (n == 0) { *sockRet = 0; return WS_HYBI_STATE_ERR; } else { ws_dbg("read %d bytes from socket; nRead=%d\n", n, wsctx->nReadPayload); } } else { n = 0; } wsctx->nReadPayload += n; wsctx->writePos += n; if (hybiRemaining(wsctx) == 0) { wsctx->hybiDecodeState = WS_HYBI_STATE_FRAME_COMPLETE; } /* number of not yet unmasked payload bytes: what we read here + what was * carried over + what was read with the header */ toDecode = n + wsctx->carrylen + nInBuf; ws_dbg("toDecode=%d from n=%d carrylen=%d headerLen=%d\n", toDecode, n, wsctx->carrylen, wsctx->header.headerLen); if (toDecode < 0) { rfbErr("%s: internal error; negative number of bytes to decode: %d", __func__, toDecode); errno=EIO; *sockRet = -1; return WS_HYBI_STATE_ERR; } /* for a possible base64 decoding, we decode multiples of 4 bytes until * the whole frame is received and carry over any remaining bytes in the carry buf*/ data = (unsigned char *)(wsctx->writePos - toDecode); data32= (uint32_t *)data; for (i = 0; i < (toDecode >> 2); i++) { data32[i] ^= wsctx->header.mask.u; } ws_dbg("mask decoding; i=%d toDecode=%d\n", i, toDecode); if (wsctx->hybiDecodeState == WS_HYBI_STATE_FRAME_COMPLETE) { /* process the remaining bytes (if any) */ for (i*=4; i < toDecode; i++) { data[i] ^= wsctx->header.mask.c[i % 4]; } /* all data is here, no carrying */ wsctx->carrylen = 0; } else { /* carry over remaining, non-multiple-of-four bytes */ wsctx->carrylen = toDecode - (i * 4); if (wsctx->carrylen < 0 || wsctx->carrylen > ARRAYSIZE(wsctx->carryBuf)) { rfbErr("%s: internal error, invalid carry over size: carrylen=%d, toDecode=%d, i=%d", __func__, wsctx->carrylen, toDecode, i); *sockRet = -1; errno = EIO; return WS_HYBI_STATE_ERR; } ws_dbg("carrying over %d bytes from %p to %p\n", wsctx->carrylen, wsctx->writePos + (i * 4), wsctx->carryBuf); memcpy(wsctx->carryBuf, data + (i * 4), wsctx->carrylen); wsctx->writePos -= wsctx->carrylen; } toReturn = toDecode - wsctx->carrylen; switch (wsctx->header.opcode) { case WS_OPCODE_CLOSE: /* this data is not returned as payload data */ if (hybiWsFrameComplete(wsctx)) { *(wsctx->writePos) = '\0'; ws_dbg("got close cmd %d, reason %d: %s\n", (int)(wsctx->writePos - hybiPayloadStart(wsctx)), WS_NTOH16(((uint16_t *)hybiPayloadStart(wsctx))[0]), &hybiPayloadStart(wsctx)[2]); errno = ECONNRESET; *sockRet = -1; return WS_HYBI_STATE_FRAME_COMPLETE; } else { ws_dbg("got close cmd; waiting for %d more bytes to arrive\n", hybiRemaining(wsctx)); *sockRet = -1; errno = EAGAIN; return WS_HYBI_STATE_CLOSE_REASON_PENDING; } break; case WS_OPCODE_TEXT_FRAME: data[toReturn] = '\0'; ws_dbg("Initiate Base64 decoding in %p with max size %d and '\\0' at %p\n", data, bufsize, data + toReturn); if (-1 == (wsctx->readlen = rfbBase64PtoN((char *)data, data, bufsize))) { rfbErr("%s: Base64 decode error; %s\n", __func__, strerror(errno)); } wsctx->writePos = hybiPayloadStart(wsctx); break; case WS_OPCODE_BINARY_FRAME: wsctx->readlen = toReturn; wsctx->writePos = hybiPayloadStart(wsctx); ws_dbg("set readlen=%d writePos=%p\n", wsctx->readlen, wsctx->writePos); break; default: rfbErr("%s: unhandled opcode %d, b0: %02x, b1: %02x\n", __func__, (int)wsctx->header.opcode, wsctx->header.data->b0, wsctx->header.data->b1); } wsctx->readPos = data; return hybiReturnData(dst, len, wsctx, sockRet); }
849
True
1
CVE-2020-14396
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/33441d90a506d5f3ae9388f2752901227e430553', 'name': 'https://github.com/LibVNC/libvncserver/commit/33441d90a506d5f3ae9388f2752901227e430553', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.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:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncclient/tls_openssl.c has a NULL pointer dereference.'}]
2022-03-10T15:15Z
2020-06-17T16: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
Christian Beier
2020-03-06 17:37:57+01:00
libvncclient/tls_openssl: do not deref a NULL pointer Happens in anonTLS mode where cred is NULL. re #347
33441d90a506d5f3ae9388f2752901227e430553
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
open_ssl_connection
open_ssl_connection( rfbClient * client , int sockfd , rfbBool anonTLS , rfbCredential * cred)
['client', 'sockfd', 'anonTLS', 'cred']
open_ssl_connection (rfbClient *client, int sockfd, rfbBool anonTLS, rfbCredential *cred) { SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; int n, finished = 0; X509_VERIFY_PARAM *param; uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode; if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method()))) { rfbClientLog("Could not create new SSL context.\n"); return NULL; } param = X509_VERIFY_PARAM_new(); /* Setup verification if not anonymous */ if (!anonTLS) { if (cred->x509Credential.x509CACertFile) { if (!SSL_CTX_load_verify_locations(ssl_ctx, cred->x509Credential.x509CACertFile, NULL)) { rfbClientLog("Failed to load CA certificate from %s.\n", cred->x509Credential.x509CACertFile); goto error_free_ctx; } } else { rfbClientLog("Using default paths for certificate verification.\n"); SSL_CTX_set_default_verify_paths (ssl_ctx); } if (cred->x509Credential.x509CACrlFile) { if (!load_crls_from_file(cred->x509Credential.x509CACrlFile, ssl_ctx)) { rfbClientLog("CRLs could not be loaded.\n"); goto error_free_ctx; } if (verify_crls == rfbX509CrlVerifyNone) verify_crls = rfbX509CrlVerifyAll; } if (cred->x509Credential.x509ClientCertFile && cred->x509Credential.x509ClientKeyFile) { if (SSL_CTX_use_certificate_chain_file(ssl_ctx, cred->x509Credential.x509ClientCertFile) != 1) { rfbClientLog("Client certificate could not be loaded.\n"); goto error_free_ctx; } if (SSL_CTX_use_PrivateKey_file(ssl_ctx, cred->x509Credential.x509ClientKeyFile, SSL_FILETYPE_PEM) != 1) { rfbClientLog("Client private key could not be loaded.\n"); goto error_free_ctx; } if (SSL_CTX_check_private_key(ssl_ctx) == 0) { rfbClientLog("Client certificate and private key do not match.\n"); goto error_free_ctx; } } SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, NULL); if (verify_crls == rfbX509CrlVerifyClient) X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK); else if (verify_crls == rfbX509CrlVerifyAll) X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); if(!X509_VERIFY_PARAM_set1_host(param, client->serverHost, strlen(client->serverHost))) { rfbClientLog("Could not set server name for verification.\n"); goto error_free_ctx; } SSL_CTX_set1_param(ssl_ctx, param); } if (!(ssl = SSL_new (ssl_ctx))) { rfbClientLog("Could not create a new SSL session.\n"); goto error_free_ctx; } /* TODO: finetune this list, take into account anonTLS bool */ SSL_set_cipher_list(ssl, "ALL"); SSL_set_fd (ssl, sockfd); SSL_CTX_set_app_data (ssl_ctx, client); do { n = SSL_connect(ssl); if (n != 1) { if (wait_for_data(ssl, n, 1) != 1) { finished = 1; SSL_shutdown(ssl); goto error_free_ssl; } } } while( n != 1 && finished != 1 ); X509_VERIFY_PARAM_free(param); return ssl; error_free_ssl: SSL_free(ssl); error_free_ctx: X509_VERIFY_PARAM_free(param); SSL_CTX_free(ssl_ctx); return NULL; }
476
True
1
CVE-2020-14398
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/LibVNC/libvncserver/commit/57433015f856cc12753378254ce4f1c78f5d9c7b', 'name': 'https://github.com/LibVNC/libvncserver/commit/57433015f856cc12753378254ce4f1c78f5d9c7b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-835'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. An improperly closed TCP connection causes an infinite loop in libvncclient/sockets.c.'}]
2022-03-10T15:13Z
2020-06-17T16:15Z
Loop with Unreachable Exit Condition ('Infinite Loop')
The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.
If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.
https://cwe.mitre.org/data/definitions/835.html
0
Tobias Junghans
2020-04-24 13:41:59+02:00
libvncclient: handle half-open TCP connections When a connection is not reset properly at the TCP level (e.g. sudden power loss or process crash) the TCP connection becomes half-open and read() always returns -1 with errno = EAGAIN while select() always returns 0. This leads to an infinite loop and can be fixed by closing the connection after a certain number of retries (based on a timeout) has been exceeded.
57433015f856cc12753378254ce4f1c78f5d9c7b
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
ReadFromRFBServer
ReadFromRFBServer( rfbClient * client , char * out , unsigned int n)
['client', 'out', 'n']
ReadFromRFBServer(rfbClient* client, char *out, unsigned int n) { #undef DEBUG_READ_EXACT #ifdef DEBUG_READ_EXACT char* oout=out; unsigned int nn=n; rfbClientLog("ReadFromRFBServer %d bytes\n",n); #endif /* Handle attempts to write to NULL out buffer that might occur when an outside malloc() fails. For instance, memcpy() to NULL results in undefined behaviour and probably memory corruption.*/ if(!out) return FALSE; if (client->serverPort==-1) { /* vncrec playing */ rfbVNCRec* rec = client->vncRec; struct timeval tv; if (rec->readTimestamp) { rec->readTimestamp = FALSE; if (!fread(&tv,sizeof(struct timeval),1,rec->file)) return FALSE; tv.tv_sec = rfbClientSwap32IfLE (tv.tv_sec); tv.tv_usec = rfbClientSwap32IfLE (tv.tv_usec); if (rec->tv.tv_sec!=0 && !rec->doNotSleep) { struct timeval diff; diff.tv_sec = tv.tv_sec - rec->tv.tv_sec; diff.tv_usec = tv.tv_usec - rec->tv.tv_usec; if(diff.tv_usec<0) { diff.tv_sec--; diff.tv_usec+=1000000; } #ifndef WIN32 sleep (diff.tv_sec); usleep (diff.tv_usec); #else Sleep (diff.tv_sec * 1000 + diff.tv_usec/1000); #endif } rec->tv=tv; } return (fread(out,1,n,rec->file) != n ? FALSE : TRUE); } if (n <= client->buffered) { memcpy(out, client->bufoutptr, n); client->bufoutptr += n; client->buffered -= n; #ifdef DEBUG_READ_EXACT goto hexdump; #endif return TRUE; } memcpy(out, client->bufoutptr, client->buffered); out += client->buffered; n -= client->buffered; client->bufoutptr = client->buf; client->buffered = 0; if (n <= RFB_BUF_SIZE) { while (client->buffered < n) { int i; if (client->tlsSession) i = ReadFromTLS(client, client->buf + client->buffered, RFB_BUF_SIZE - client->buffered); else #ifdef LIBVNCSERVER_HAVE_SASL if (client->saslconn) i = ReadFromSASL(client, client->buf + client->buffered, RFB_BUF_SIZE - client->buffered); else { #endif /* LIBVNCSERVER_HAVE_SASL */ i = read(client->sock, client->buf + client->buffered, RFB_BUF_SIZE - client->buffered); #ifdef WIN32 if (i < 0) errno=WSAGetLastError(); #endif #ifdef LIBVNCSERVER_HAVE_SASL } #endif if (i <= 0) { if (i < 0) { if (errno == EWOULDBLOCK || errno == EAGAIN) { /* TODO: ProcessXtEvents(); */ WaitForMessage(client, 100000); i = 0; } else { rfbClientErr("read (%d: %s)\n",errno,strerror(errno)); return FALSE; } } else { if (errorMessageOnReadFailure) { rfbClientLog("VNC server closed connection\n"); } return FALSE; } } client->buffered += i; } memcpy(out, client->bufoutptr, n); client->bufoutptr += n; client->buffered -= n; } else { while (n > 0) { int i; if (client->tlsSession) i = ReadFromTLS(client, out, n); else #ifdef LIBVNCSERVER_HAVE_SASL if (client->saslconn) i = ReadFromSASL(client, out, n); else #endif i = read(client->sock, out, n); if (i <= 0) { if (i < 0) { #ifdef WIN32 errno=WSAGetLastError(); #endif if (errno == EWOULDBLOCK || errno == EAGAIN) { /* TODO: ProcessXtEvents(); */ WaitForMessage(client, 100000); i = 0; } else { rfbClientErr("read (%s)\n",strerror(errno)); return FALSE; } } else { if (errorMessageOnReadFailure) { rfbClientLog("VNC server closed connection\n"); } return FALSE; } } out += i; n -= i; } } #ifdef DEBUG_READ_EXACT hexdump: { unsigned int ii; for(ii=0;ii<nn;ii++) fprintf(stderr,"%02x ",(unsigned char)oout[ii]); fprintf(stderr,"\n"); } #endif return TRUE; }
744
True
1
CVE-2020-14397
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'name': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4573-1/', 'name': 'USN-4573-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.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:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncserver/rfbregion.c has a NULL pointer dereference.'}]
2022-03-10T15:14Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 12:16:32+02:00
libvncserver: add missing NULL pointer checks
38e98ee61d74f5f5ab4aa4c77146faad1962d6d0
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
sraSpanInsertAfter
sraSpanInsertAfter( sraSpan * newspan , sraSpan * after)
['newspan', 'after']
sraSpanInsertAfter(sraSpan *newspan, sraSpan *after) { newspan->_next = after->_next; newspan->_prev = after; after->_next->_prev = newspan; after->_next = newspan; }
40
True
1
CVE-2020-14397
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'name': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4573-1/', 'name': 'USN-4573-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.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:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncserver/rfbregion.c has a NULL pointer dereference.'}]
2022-03-10T15:14Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 12:16:32+02:00
libvncserver: add missing NULL pointer checks
38e98ee61d74f5f5ab4aa4c77146faad1962d6d0
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
sraSpanInsertBefore
sraSpanInsertBefore( sraSpan * newspan , sraSpan * before)
['newspan', 'before']
sraSpanInsertBefore(sraSpan *newspan, sraSpan *before) { newspan->_next = before; newspan->_prev = before->_prev; before->_prev->_next = newspan; before->_prev = newspan; }
40
True
1
CVE-2020-14397
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'name': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4573-1/', 'name': 'USN-4573-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.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:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncserver/rfbregion.c has a NULL pointer dereference.'}]
2022-03-10T15:14Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 12:16:32+02:00
libvncserver: add missing NULL pointer checks
38e98ee61d74f5f5ab4aa4c77146faad1962d6d0
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
sraSpanRemove
sraSpanRemove( sraSpan * span)
['span']
sraSpanRemove(sraSpan *span) { span->_prev->_next = span->_next; span->_next->_prev = span->_prev; }
28
True
1
CVE-2020-14397
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'name': 'https://github.com/LibVNC/libvncserver/commit/38e98ee61d74f5f5ab4aa4c77146faad1962d6d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4573-1/', 'name': 'USN-4573-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.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:libvnc_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.12', '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: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:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', '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': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncserver/rfbregion.c has a NULL pointer dereference.'}]
2022-03-10T15:14Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 12:16:32+02:00
libvncserver: add missing NULL pointer checks
38e98ee61d74f5f5ab4aa4c77146faad1962d6d0
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
rfbReleaseClientIterator
rfbReleaseClientIterator( rfbClientIteratorPtr iterator)
['iterator']
rfbReleaseClientIterator(rfbClientIteratorPtr iterator) { if(iterator->next) rfbDecrClientRef(iterator->next); free(iterator); }
25
True
1
CVE-2020-14399
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/23e5cbe6b090d7f22982aee909a6a618174d3c2d', 'name': 'https://github.com/LibVNC/libvncserver/commit/23e5cbe6b090d7f22982aee909a6a618174d3c2d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1860354', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1860354', 'refsource': 'MISC', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvncserver_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': '** DISPUTED ** An issue was discovered in LibVNCServer before 0.9.13. Byte-aligned data is accessed through uint32_t pointers in libvncclient/rfbproto.c. NOTE: there is reportedly "no trust boundary crossed."'}]
2020-08-29T00:15Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 11:47:00+02:00
libvncclient: fix pointer aliasing/alignment issue Accessing byte-aligned data through uint32_t pointers can cause crashes on some platforms or reduce the performance. Therefore ensure a proper stack alignment.
23e5cbe6b090d7f22982aee909a6a618174d3c2d
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
SetFormatAndEncodings
SetFormatAndEncodings( rfbClient * client)
['client']
SetFormatAndEncodings(rfbClient* client) { rfbSetPixelFormatMsg spf; char buf[sz_rfbSetEncodingsMsg + MAX_ENCODINGS * 4]; rfbSetEncodingsMsg *se = (rfbSetEncodingsMsg *)buf; uint32_t *encs = (uint32_t *)(&buf[sz_rfbSetEncodingsMsg]); int len = 0; rfbBool requestCompressLevel = FALSE; rfbBool requestQualityLevel = FALSE; rfbBool requestLastRectEncoding = FALSE; rfbClientProtocolExtension* e; if (!SupportsClient2Server(client, rfbSetPixelFormat)) return TRUE; spf.type = rfbSetPixelFormat; spf.pad1 = 0; spf.pad2 = 0; spf.format = client->format; spf.format.redMax = rfbClientSwap16IfLE(spf.format.redMax); spf.format.greenMax = rfbClientSwap16IfLE(spf.format.greenMax); spf.format.blueMax = rfbClientSwap16IfLE(spf.format.blueMax); if (!WriteToRFBServer(client, (char *)&spf, sz_rfbSetPixelFormatMsg)) return FALSE; if (!SupportsClient2Server(client, rfbSetEncodings)) return TRUE; se->type = rfbSetEncodings; se->pad = 0; se->nEncodings = 0; if (client->appData.encodingsString) { const char *encStr = client->appData.encodingsString; int encStrLen; do { const char *nextEncStr = strchr(encStr, ' '); if (nextEncStr) { encStrLen = nextEncStr - encStr; nextEncStr++; } else { encStrLen = strlen(encStr); } if (strncasecmp(encStr,"raw",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRaw); } else if (strncasecmp(encStr,"copyrect",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCopyRect); #ifdef LIBVNCSERVER_HAVE_LIBZ #ifdef LIBVNCSERVER_HAVE_LIBJPEG } else if (strncasecmp(encStr,"tight",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingTight); requestLastRectEncoding = TRUE; if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9) requestCompressLevel = TRUE; if (client->appData.enableJPEG) requestQualityLevel = TRUE; #endif #endif } else if (strncasecmp(encStr,"hextile",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingHextile); #ifdef LIBVNCSERVER_HAVE_LIBZ } else if (strncasecmp(encStr,"zlib",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZlib); if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9) requestCompressLevel = TRUE; } else if (strncasecmp(encStr,"zlibhex",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZlibHex); if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9) requestCompressLevel = TRUE; } else if (strncasecmp(encStr,"trle",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingTRLE); } else if (strncasecmp(encStr,"zrle",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZRLE); } else if (strncasecmp(encStr,"zywrle",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZYWRLE); requestQualityLevel = TRUE; #endif } else if ((strncasecmp(encStr,"ultra",encStrLen) == 0) || (strncasecmp(encStr,"ultrazip",encStrLen) == 0)) { /* There are 2 encodings used in 'ultra' */ encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltra); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltraZip); } else if (strncasecmp(encStr,"corre",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCoRRE); } else if (strncasecmp(encStr,"rre",encStrLen) == 0) { encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRRE); } else { rfbClientLog("Unknown encoding '%.*s'\n",encStrLen,encStr); } encStr = nextEncStr; } while (encStr && se->nEncodings < MAX_ENCODINGS); if (se->nEncodings < MAX_ENCODINGS && requestCompressLevel) { encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.compressLevel + rfbEncodingCompressLevel0); } if (se->nEncodings < MAX_ENCODINGS && requestQualityLevel) { if (client->appData.qualityLevel < 0 || client->appData.qualityLevel > 9) client->appData.qualityLevel = 5; encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.qualityLevel + rfbEncodingQualityLevel0); } } else { if (SameMachine(client->sock)) { /* TODO: if (!tunnelSpecified) { */ rfbClientLog("Same machine: preferring raw encoding\n"); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRaw); /* } else { rfbClientLog("Tunneling active: preferring tight encoding\n"); } */ } encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCopyRect); #ifdef LIBVNCSERVER_HAVE_LIBZ #ifdef LIBVNCSERVER_HAVE_LIBJPEG encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingTight); requestLastRectEncoding = TRUE; #endif #endif encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingHextile); #ifdef LIBVNCSERVER_HAVE_LIBZ encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZlib); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZRLE); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingZYWRLE); #endif encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltra); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingUltraZip); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCoRRE); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRRE); if (client->appData.compressLevel >= 0 && client->appData.compressLevel <= 9) { encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.compressLevel + rfbEncodingCompressLevel0); } else /* if (!tunnelSpecified) */ { /* If -tunnel option was provided, we assume that server machine is not in the local network so we use default compression level for tight encoding instead of fast compression. Thus we are requesting level 1 compression only if tunneling is not used. */ encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCompressLevel1); } if (client->appData.enableJPEG) { if (client->appData.qualityLevel < 0 || client->appData.qualityLevel > 9) client->appData.qualityLevel = 5; encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.qualityLevel + rfbEncodingQualityLevel0); } } /* Remote Cursor Support (local to viewer) */ if (client->appData.useRemoteCursor) { if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingXCursor); if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRichCursor); if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingPointerPos); } /* Keyboard State Encodings */ if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingKeyboardLedState); /* New Frame Buffer Size */ if (se->nEncodings < MAX_ENCODINGS && client->canHandleNewFBSize) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingNewFBSize); /* Last Rect */ if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingLastRect); /* Server Capabilities */ if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingSupportedMessages); if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingSupportedEncodings); if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingServerIdentity); /* xvp */ if (se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingXvp); /* client extensions */ for(e = rfbClientExtensions; e; e = e->next) if(e->encodings) { int* enc; for(enc = e->encodings; *enc; enc++) if(se->nEncodings < MAX_ENCODINGS) encs[se->nEncodings++] = rfbClientSwap32IfLE(*enc); } len = sz_rfbSetEncodingsMsg + se->nEncodings * 4; se->nEncodings = rfbClientSwap16IfLE(se->nEncodings); if (!WriteToRFBServer(client, buf, len)) return FALSE; return TRUE; }
1449
True
1
CVE-2020-14400
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/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/commit/53073c8d7e232151ea2ecd8a1243124121e10e2d', 'name': 'https://github.com/LibVNC/libvncserver/commit/53073c8d7e232151ea2ecd8a1243124121e10e2d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1860361', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1860361', 'refsource': 'MISC', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvncserver_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', '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:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': '** DISPUTED ** An issue was discovered in LibVNCServer before 0.9.13. Byte-aligned data is accessed through uint16_t pointers in libvncserver/translate.c. NOTE: Third parties do not consider this to be a vulnerability as there is no known path of exploitation or cross of a trust boundary.'}]
2020-08-29T00:15Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 12:22:05+02:00
libvncserver: fix pointer aliasing/alignment issue Accessing byte-aligned data through uint16_t pointers can cause crashes on some platforms or reduce the performance. Therefore ensure a proper stack alignment.
53073c8d7e232151ea2ecd8a1243124121e10e2d
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
rfbSetClientColourMapBGR233
rfbSetClientColourMapBGR233( rfbClientPtr cl)
['cl']
rfbSetClientColourMapBGR233(rfbClientPtr cl) { char buf[sz_rfbSetColourMapEntriesMsg + 256 * 3 * 2]; rfbSetColourMapEntriesMsg *scme = (rfbSetColourMapEntriesMsg *)buf; uint16_t *rgb = (uint16_t *)(&buf[sz_rfbSetColourMapEntriesMsg]); int i, len; int r, g, b; if (cl->format.bitsPerPixel != 8 ) { rfbErr("%s: client not 8 bits per pixel\n", "rfbSetClientColourMapBGR233"); rfbCloseClient(cl); return FALSE; } scme->type = rfbSetColourMapEntries; scme->firstColour = Swap16IfLE(0); scme->nColours = Swap16IfLE(256); len = sz_rfbSetColourMapEntriesMsg; i = 0; for (b = 0; b < 4; b++) { for (g = 0; g < 8; g++) { for (r = 0; r < 8; r++) { rgb[i++] = Swap16IfLE(r * 65535 / 7); rgb[i++] = Swap16IfLE(g * 65535 / 7); rgb[i++] = Swap16IfLE(b * 65535 / 3); } } } len += 256 * 3 * 2; if (rfbWriteExact(cl, buf, len) < 0) { rfbLogPerror("rfbSetClientColourMapBGR233: write"); rfbCloseClient(cl); return FALSE; } return TRUE; }
245
True
1
CVE-2020-14401
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:P/A:P
NETWORK
LOW
NONE
NONE
PARTIAL
PARTIAL
6.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
LOW
LOW
6.5
MEDIUM
3.9
2.5
False
[{'url': 'https://github.com/LibVNC/libvncserver/commit/a6788d1da719ae006605b78d22f5a9f170b423af', 'name': 'https://github.com/LibVNC/libvncserver/commit/a6788d1da719ae006605b78d22f5a9f170b423af', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'name': 'https://github.com/LibVNC/libvncserver/compare/LibVNCServer-0.9.12...LibVNCServer-0.9.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00035.html', 'name': '[debian-lts-announce] 20200630 [SECURITY] [DLA 2264-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00033.html', 'name': 'openSUSE-SU-2020:0988', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00055.html', 'name': 'openSUSE-SU-2020:1025', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-07/msg00066.html', 'name': 'openSUSE-SU-2020:1056', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4434-1/', 'name': 'USN-4434-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00045.html', 'name': '[debian-lts-announce] 20200828 [SECURITY] [DLA 2347-1] libvncserver security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-390195.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libvncserver_project:libvncserver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.13', '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:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1500_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1500_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc1900_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc1900_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:siemens:simatic_itc2200_pro_firmware:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0.0', 'versionEndExcluding': '3.2.1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:siemens:simatic_itc2200_pro:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'An issue was discovered in LibVNCServer before 0.9.13. libvncserver/scale.c has a pixel_value integer overflow.'}]
2022-03-09T22:56Z
2020-06-17T16: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
Tobias Junghans
2020-05-27 12:18:44+02:00
libvncserver: scale: cast to 64 bit before shifting Since pixel_value is 64 bit the data type of the shift operand should be 64 bit too to prevent integer overflows.
a6788d1da719ae006605b78d22f5a9f170b423af
False
LibVNC/libvncserver
LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
2014-03-31 00:55:53
2022-08-23 09:29:14
LibVNC
857.0
408.0
rfbScaledScreenUpdateRect
rfbScaledScreenUpdateRect( rfbScreenInfoPtr screen , rfbScreenInfoPtr ptr , int x0 , int y0 , int w0 , int h0)
['screen', 'ptr', 'x0', 'y0', 'w0', 'h0']
void rfbScaledScreenUpdateRect(rfbScreenInfoPtr screen, rfbScreenInfoPtr ptr, int x0, int y0, int w0, int h0) { int x,y,w,v,z; int x1, y1, w1, h1; int bitsPerPixel, bytesPerPixel, bytesPerLine, areaX, areaY, area2; unsigned char *srcptr, *dstptr; /* Nothing to do!!! */ if (screen==ptr) return; x1 = x0; y1 = y0; w1 = w0; h1 = h0; rfbScaledCorrection(screen, ptr, &x1, &y1, &w1, &h1, "rfbScaledScreenUpdateRect"); x0 = ScaleX(ptr, screen, x1); y0 = ScaleY(ptr, screen, y1); w0 = ScaleX(ptr, screen, w1); h0 = ScaleY(ptr, screen, h1); bitsPerPixel = screen->bitsPerPixel; bytesPerPixel = bitsPerPixel / 8; bytesPerLine = w1 * bytesPerPixel; srcptr = (unsigned char *)(screen->frameBuffer + (y0 * screen->paddedWidthInBytes + x0 * bytesPerPixel)); dstptr = (unsigned char *)(ptr->frameBuffer + ( y1 * ptr->paddedWidthInBytes + x1 * bytesPerPixel)); /* The area of the source framebuffer for each destination pixel */ areaX = ScaleX(ptr,screen,1); areaY = ScaleY(ptr,screen,1); area2 = areaX*areaY; /* Ensure that we do not go out of bounds */ if ((x1+w1) > (ptr->width)) { if (x1==0) w1=ptr->width; else x1 = ptr->width - w1; } if ((y1+h1) > (ptr->height)) { if (y1==0) h1=ptr->height; else y1 = ptr->height - h1; } /* * rfbLog("rfbScaledScreenUpdateRect(%dXx%dY-%dWx%dH -> %dXx%dY-%dWx%dH <%dx%d>) {%dWx%dH -> %dWx%dH} 0x%p\n", * x0, y0, w0, h0, x1, y1, w1, h1, areaX, areaY, * screen->width, screen->height, ptr->width, ptr->height, ptr->frameBuffer); */ if (screen->serverFormat.trueColour) { /* Blend neighbouring pixels together */ unsigned char *srcptr2; unsigned long pixel_value, red, green, blue; unsigned int redShift = screen->serverFormat.redShift; unsigned int greenShift = screen->serverFormat.greenShift; unsigned int blueShift = screen->serverFormat.blueShift; unsigned long redMax = screen->serverFormat.redMax; unsigned long greenMax = screen->serverFormat.greenMax; unsigned long blueMax = screen->serverFormat.blueMax; /* for each *destination* pixel... */ for (y = 0; y < h1; y++) { for (x = 0; x < w1; x++) { red = green = blue = 0; /* Get the totals for rgb from the source grid... */ for (w = 0; w < areaX; w++) { for (v = 0; v < areaY; v++) { srcptr2 = &srcptr[(((x * areaX) + w) * bytesPerPixel) + (v * screen->paddedWidthInBytes)]; pixel_value = 0; switch (bytesPerPixel) { case 4: pixel_value = *((unsigned int *)srcptr2); break; case 2: pixel_value = *((unsigned short *)srcptr2); break; case 1: pixel_value = *((unsigned char *)srcptr2); break; default: /* fixme: endianness problem? */ for (z = 0; z < bytesPerPixel; z++) pixel_value += (srcptr2[z] << (8 * z)); break; } /* srcptr2 += bytesPerPixel; */ red += ((pixel_value >> redShift) & redMax); green += ((pixel_value >> greenShift) & greenMax); blue += ((pixel_value >> blueShift) & blueMax); } } /* We now have a total for all of the colors, find the average! */ red /= area2; green /= area2; blue /= area2; /* Stuff the new value back into memory */ pixel_value = ((red & redMax) << redShift) | ((green & greenMax) << greenShift) | ((blue & blueMax) << blueShift); switch (bytesPerPixel) { case 4: *((unsigned int *)dstptr) = (unsigned int) pixel_value; break; case 2: *((unsigned short *)dstptr) = (unsigned short) pixel_value; break; case 1: *((unsigned char *)dstptr) = (unsigned char) pixel_value; break; default: /* fixme: endianness problem? */ for (z = 0; z < bytesPerPixel; z++) dstptr[z]=(pixel_value >> (8 * z)) & 0xff; break; } dstptr += bytesPerPixel; } srcptr += (screen->paddedWidthInBytes * areaY); dstptr += (ptr->paddedWidthInBytes - bytesPerLine); } } else { /* Not truecolour, so we can't blend. Just use the top-left pixel instead */ for (y = y1; y < (y1+h1); y++) { for (x = x1; x < (x1+w1); x++) memcpy (&ptr->frameBuffer[(y *ptr->paddedWidthInBytes) + (x * bytesPerPixel)], &screen->frameBuffer[(y * areaY * screen->paddedWidthInBytes) + (x *areaX * bytesPerPixel)], bytesPerPixel); } } }
902
True
1
CVE-2017-20005
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/nginx/nginx/commit/b900cc28fcbb4cf5a32ab62f80b59292e1c85b4b', 'name': 'https://github.com/nginx/nginx/commit/b900cc28fcbb4cf5a32ab62f80b59292e1c85b4b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://trac.nginx.org/nginx/ticket/1368', 'name': 'https://trac.nginx.org/nginx/ticket/1368', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/nginx/nginx/commit/0206ebe76f748bb39d9de4dd4b3fce777fdfdccf', 'name': 'https://github.com/nginx/nginx/commit/0206ebe76f748bb39d9de4dd4b3fce777fdfdccf', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://nginx.org/en/CHANGES', 'name': 'http://nginx.org/en/CHANGES', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/06/msg00009.html', 'name': '[debian-lts-announce] 20210607 [SECURITY] [DLA 2680-1] nginx security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210805-0006/', 'name': 'https://security.netapp.com/advisory/ntap-20210805-0006/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:nginx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.13.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'NGINX before 1.13.6 has a buffer overflow for years that exceed four digits, as demonstrated by a file with a modification date in 1969 that causes an integer overflow (or a false modification date far in the future), when encountered by the autoindex module.'}]
2021-12-02T19:43Z
2021-06-06T22: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
Maxim Dounin
2017-09-13 15:52:01+03:00
Fixed ngx_gmtime() on 32-bit platforms with 64-bit time_t. In ngx_gmtime(), instead of casting to ngx_uint_t we now work with time_t directly. This allows using dates after 2038 on 32-bit platforms which use 64-bit time_t, notably NetBSD and OpenBSD. As the code is not able to work with negative time_t values, argument is now set to 0 for negative values. As a positive side effect, this results in Epoch being used for such values instead of a date in distant future.
0206ebe76f748bb39d9de4dd4b3fce777fdfdccf
False
nginx/nginx
An official read-only mirror of http://hg.nginx.org/nginx/ which is updated hourly. Pull requests on GitHub cannot be accepted and will be automatically closed. The proper way to submit changes to nginx is via the nginx development mailing list, see http://nginx.org/en/docs/contributing_changes.html
2015-06-23 10:26:27
2022-07-19 14:26:31
http://nginx.org/
nginx
17063.0
5940.0
ngx_gmtime
ngx_gmtime( time_t t , ngx_tm_t * tp)
['t', 'tp']
ngx_gmtime(time_t t, ngx_tm_t *tp) { ngx_int_t yday; ngx_uint_t n, sec, min, hour, mday, mon, year, wday, days, leap; /* the calculation is valid for positive time_t only */ n = (ngx_uint_t) t; days = n / 86400; /* January 1, 1970 was Thursday */ wday = (4 + days) % 7; n %= 86400; hour = n / 3600; n %= 3600; min = n / 60; sec = n % 60; /* * the algorithm based on Gauss' formula, * see src/core/ngx_parse_time.c */ /* days since March 1, 1 BC */ days = days - (31 + 28) + 719527; /* * The "days" should be adjusted to 1 only, however, some March 1st's go * to previous year, so we adjust them to 2. This causes also shift of the * last February days to next year, but we catch the case when "yday" * becomes negative. */ year = (days + 2) * 400 / (365 * 400 + 100 - 4 + 1); yday = days - (365 * year + year / 4 - year / 100 + year / 400); if (yday < 0) { leap = (year % 4 == 0) && (year % 100 || (year % 400 == 0)); yday = 365 + leap + yday; year--; } /* * The empirical formula that maps "yday" to month. * There are at least 10 variants, some of them are: * mon = (yday + 31) * 15 / 459 * mon = (yday + 31) * 17 / 520 * mon = (yday + 31) * 20 / 612 */ mon = (yday + 31) * 10 / 306; /* the Gauss' formula that evaluates days before the month */ mday = yday - (367 * mon / 12 - 30) + 1; if (yday >= 306) { year++; mon -= 10; /* * there is no "yday" in Win32 SYSTEMTIME * * yday -= 306; */ } else { mon += 2; /* * there is no "yday" in Win32 SYSTEMTIME * * yday += 31 + 28 + leap; */ } tp->ngx_tm_sec = (ngx_tm_sec_t) sec; tp->ngx_tm_min = (ngx_tm_min_t) min; tp->ngx_tm_hour = (ngx_tm_hour_t) hour; tp->ngx_tm_mday = (ngx_tm_mday_t) mday; tp->ngx_tm_mon = (ngx_tm_mon_t) mon; tp->ngx_tm_year = (ngx_tm_year_t) year; tp->ngx_tm_wday = (ngx_tm_wday_t) wday; }
298
True
1
CVE-2021-3618
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:N
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
NONE
5.8
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
NETWORK
HIGH
NONE
NONE
UNCHANGED
HIGH
HIGH
NONE
7.4
HIGH
2.2
5.2
False
[{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1975623', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1975623', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://ubuntu.com/security/CVE-2021-3618', 'name': 'https://ubuntu.com/security/CVE-2021-3618', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991328', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991328', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991329', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991329', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Release Notes', 'Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991331', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991331', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/nginx/commit/173f16f736c10eae46cd15dd861b04b82d91a37a', 'name': 'https://github.com/nginx/nginx/commit/173f16f736c10eae46cd15dd861b04b82d91a37a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-295'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:nginx:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.21.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sendmail:sendmail:*:*:*:*:*:*:*:*', 'versionEndExcluding': '8.17', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:vsftpd_project:vsftpd:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "ALPACA is an application layer protocol content confusion attack, exploiting TLS servers implementing different protocols but using compatible certificates, such as multi-domain or wildcard certificates. A MiTM attacker having access to victim's traffic at the TCP/IP layer can redirect traffic from one subdomain to another, resulting in a valid TLS session. This breaks the authentication of TLS and cross-protocol attacks may be possible where the behavior of one protocol service may compromise the other at the application layer."}]
2022-04-04T20:46Z
2022-03-23T20:15Z
Improper Certificate Validation
The software does not validate, or incorrectly validates, a certificate.
When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
https://cwe.mitre.org/data/definitions/295.html
0
Maxim Dounin
2021-05-19 03:13:31+03:00
Mail: max_errors directive. Similarly to smtpd_hard_error_limit in Postfix and smtp_max_unknown_commands in Exim, specifies the number of errors after which the connection is closed.
173f16f736c10eae46cd15dd861b04b82d91a37a
False
nginx/nginx
An official read-only mirror of http://hg.nginx.org/nginx/ which is updated hourly. Pull requests on GitHub cannot be accepted and will be automatically closed. The proper way to submit changes to nginx is via the nginx development mailing list, see http://nginx.org/en/docs/contributing_changes.html
2015-06-23 10:26:27
2022-07-19 14:26:31
http://nginx.org/
nginx
17063.0
5940.0
ngx_mail_read_command
ngx_mail_read_command( ngx_mail_session_t * s , ngx_connection_t * c)
['s', 'c']
ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c) { ssize_t n; ngx_int_t rc; ngx_str_t l; ngx_mail_core_srv_conf_t *cscf; if (s->buffer->last < s->buffer->end) { n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer->last); if (n == NGX_ERROR || n == 0) { ngx_mail_close_connection(c); return NGX_ERROR; } if (n > 0) { s->buffer->last += n; } if (n == NGX_AGAIN) { if (s->buffer->pos == s->buffer->last) { return NGX_AGAIN; } } } cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); rc = cscf->protocol->parse_command(s); if (rc == NGX_AGAIN) { if (s->buffer->last < s->buffer->end) { return rc; } l.len = s->buffer->last - s->buffer->start; l.data = s->buffer->start; ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent too long command \"%V\"", &l); s->quit = 1; return NGX_MAIL_PARSE_INVALID_COMMAND; } if (rc == NGX_IMAP_NEXT || rc == NGX_MAIL_PARSE_INVALID_COMMAND) { return rc; } if (rc == NGX_ERROR) { ngx_mail_close_connection(c); return NGX_ERROR; } return NGX_OK; }
263
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Archive::GetComment
Archive::GetComment( Array<wchar> * CmtData)
['CmtData']
bool Archive::GetComment(Array<wchar> *CmtData) { if (!MainComment) return false; SaveFilePos SavePos(*this); #ifndef SFX_MODULE uint CmtLength; if (Format==RARFMT14) { Seek(SFXSize+SIZEOF_MAINHEAD14,SEEK_SET); CmtLength=GetByte(); CmtLength+=(GetByte()<<8); } else #endif { if (MainHead.CommentInHeader) { // Old style (RAR 2.9) archive comment embedded into the main // archive header. Seek(SFXSize+SIZEOF_MARKHEAD3+SIZEOF_MAINHEAD3,SEEK_SET); if (!ReadHeader()) return false; } else { // Current (RAR 3.0+) version of archive comment. Seek(GetStartPos(),SEEK_SET); return SearchSubBlock(SUBHEAD_TYPE_CMT)!=0 && ReadCommentData(CmtData); } #ifndef SFX_MODULE // Old style (RAR 2.9) comment header embedded into the main // archive header. if (BrokenHeader) { uiMsg(UIERROR_CMTBROKEN,FileName); return false; } CmtLength=CommHead.HeadSize-SIZEOF_COMMHEAD; #endif } #ifndef SFX_MODULE if (Format==RARFMT14 && MainHead.PackComment || Format!=RARFMT14 && CommHead.Method!=0x30) { if (Format!=RARFMT14 && (CommHead.UnpVer < 15 || CommHead.UnpVer > VER_UNPACK || CommHead.Method > 0x35)) return false; ComprDataIO DataIO; DataIO.SetTestMode(true); uint UnpCmtLength; if (Format==RARFMT14) { #ifdef RAR_NOCRYPT return false; #else UnpCmtLength=GetByte(); UnpCmtLength+=(GetByte()<<8); CmtLength-=2; DataIO.SetCmt13Encryption(); CommHead.UnpVer=15; #endif } else UnpCmtLength=CommHead.UnpSize; DataIO.SetFiles(this,NULL); DataIO.EnableShowProgress(false); DataIO.SetPackedSizeToRead(CmtLength); DataIO.UnpHash.Init(HASH_CRC32,1); DataIO.SetNoFileHeader(true); // this->FileHead is not filled yet. Unpack CmtUnpack(&DataIO); CmtUnpack.Init(0x10000,false); CmtUnpack.SetDestSize(UnpCmtLength); CmtUnpack.DoUnpack(CommHead.UnpVer,false); if (Format!=RARFMT14 && (DataIO.UnpHash.GetCRC32()&0xffff)!=CommHead.CommCRC) { uiMsg(UIERROR_CMTBROKEN,FileName); return false; } else { byte *UnpData; size_t UnpDataSize; DataIO.GetUnpackedData(&UnpData,&UnpDataSize); #ifdef _WIN_ALL // If we ever decide to extend it to Android, we'll need to alloc // 4x memory for OEM to UTF-8 output here. OemToCharBuffA((char *)UnpData,(char *)UnpData,(DWORD)UnpDataSize); #endif CmtData->Alloc(UnpDataSize+1); memset(CmtData->Addr(0),0,CmtData->Size()*sizeof(wchar)); CharToWide((char *)UnpData,CmtData->Addr(0),CmtData->Size()); CmtData->Alloc(wcslen(CmtData->Addr(0))); } } else { if (CmtLength==0) return false; Array<byte> CmtRaw(CmtLength); int ReadSize=Read(&CmtRaw[0],CmtLength); if (ReadSize>=0 && (uint)ReadSize<CmtLength) // Comment is shorter than declared. { CmtLength=ReadSize; CmtRaw.Alloc(CmtLength); } if (Format!=RARFMT14 && CommHead.CommCRC!=(~CRC32(0xffffffff,&CmtRaw[0],CmtLength)&0xffff)) { uiMsg(UIERROR_CMTBROKEN,FileName); return false; } CmtData->Alloc(CmtLength+1); CmtRaw.Push(0); #ifdef _WIN_ALL // If we ever decide to extend it to Android, we'll need to alloc // 4x memory for OEM to UTF-8 output here. OemToCharA((char *)&CmtRaw[0],(char *)&CmtRaw[0]); #endif CharToWide((char *)&CmtRaw[0],CmtData->Addr(0),CmtLength); CmtData->Alloc(wcslen(CmtData->Addr(0))); } #endif return CmtData->Size() > 0; }
665
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Archive::Read
Archive::Read( void * Data , size_t Size)
['Data', 'Size']
int Archive::Read(void *Data,size_t Size) { size_t Result; if (QOpen.Read(Data,Size,Result)) return (int)Result; return File::Read(Data,Size); }
45
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Archive::Seek
Archive::Seek( int64 Offset , int Method)
['Offset', 'Method']
void Archive::Seek(int64 Offset,int Method) { if (!QOpen.Seek(Offset,Method)) File::Seek(Offset,Method); }
33
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Archive::ProcessExtra50
Archive::ProcessExtra50( RawRead * Raw , size_t ExtraSize , BaseBlock * bb)
['Raw', 'ExtraSize', 'bb']
void Archive::ProcessExtra50(RawRead *Raw,size_t ExtraSize,BaseBlock *bb) { // Read extra data from the end of block skipping any fields before it. size_t ExtraStart=Raw->Size()-ExtraSize; if (ExtraStart<Raw->GetPos()) return; Raw->SetPos(ExtraStart); while (Raw->DataLeft()>=2) { int64 FieldSize=Raw->GetV(); // Needs to be signed for check below and can be negative. if (FieldSize<=0 || Raw->DataLeft()==0 || FieldSize>(int64)Raw->DataLeft()) break; size_t NextPos=size_t(Raw->GetPos()+FieldSize); uint64 FieldType=Raw->GetV(); FieldSize=int64(NextPos-Raw->GetPos()); // Field size without size and type fields. if (FieldSize<0) // FieldType is longer than expected extra field size. break; if (bb->HeaderType==HEAD_MAIN) { MainHeader *hd=(MainHeader *)bb; if (FieldType==MHEXTRA_LOCATOR) { hd->Locator=true; uint Flags=(uint)Raw->GetV(); if ((Flags & MHEXTRA_LOCATOR_QLIST)!=0) { uint64 Offset=Raw->GetV(); if (Offset!=0) // 0 means that reserved space was not enough to write the offset. hd->QOpenOffset=Offset+CurBlockPos; } if ((Flags & MHEXTRA_LOCATOR_RR)!=0) { uint64 Offset=Raw->GetV(); if (Offset!=0) // 0 means that reserved space was not enough to write the offset. hd->RROffset=Offset+CurBlockPos; } } } if (bb->HeaderType==HEAD_FILE || bb->HeaderType==HEAD_SERVICE) { FileHeader *hd=(FileHeader *)bb; switch(FieldType) { case FHEXTRA_CRYPT: { FileHeader *hd=(FileHeader *)bb; uint EncVersion=(uint)Raw->GetV(); if (EncVersion > CRYPT_VERSION) UnkEncVerMsg(hd->FileName); else { uint Flags=(uint)Raw->GetV(); hd->UsePswCheck=(Flags & FHEXTRA_CRYPT_PSWCHECK)!=0; hd->UseHashKey=(Flags & FHEXTRA_CRYPT_HASHMAC)!=0; hd->Lg2Count=Raw->Get1(); if (hd->Lg2Count>CRYPT5_KDF_LG2_COUNT_MAX) UnkEncVerMsg(hd->FileName); Raw->GetB(hd->Salt,SIZE_SALT50); Raw->GetB(hd->InitV,SIZE_INITV); if (hd->UsePswCheck) { Raw->GetB(hd->PswCheck,SIZE_PSWCHECK); // It is important to know if password check data is valid. // If it is damaged and header CRC32 fails to detect it, // archiver would refuse to decompress a possibly valid file. // Since we want to be sure distinguishing a wrong password // or corrupt file data, we use 64-bit password check data // and to control its validity we use 32 bits of password // check data SHA-256 additionally to 32-bit header CRC32. byte csum[SIZE_PSWCHECK_CSUM]; Raw->GetB(csum,SIZE_PSWCHECK_CSUM); sha256_context ctx; sha256_init(&ctx); sha256_process(&ctx, hd->PswCheck, SIZE_PSWCHECK); byte Digest[SHA256_DIGEST_SIZE]; sha256_done(&ctx, Digest); hd->UsePswCheck=memcmp(csum,Digest,SIZE_PSWCHECK_CSUM)==0; // RAR 5.21 and earlier set PswCheck field in service records to 0 // even if UsePswCheck was present. if (bb->HeaderType==HEAD_SERVICE && memcmp(hd->PswCheck,"\0\0\0\0\0\0\0\0",SIZE_PSWCHECK)==0) hd->UsePswCheck=0; } hd->SaltSet=true; hd->CryptMethod=CRYPT_RAR50; hd->Encrypted=true; } } break; case FHEXTRA_HASH: { FileHeader *hd=(FileHeader *)bb; uint Type=(uint)Raw->GetV(); if (Type==FHEXTRA_HASH_BLAKE2) { hd->FileHash.Type=HASH_BLAKE2; Raw->GetB(hd->FileHash.Digest,BLAKE2_DIGEST_SIZE); } } break; case FHEXTRA_HTIME: if (FieldSize>=5) { byte Flags=(byte)Raw->GetV(); bool UnixTime=(Flags & FHEXTRA_HTIME_UNIXTIME)!=0; if ((Flags & FHEXTRA_HTIME_MTIME)!=0) if (UnixTime) hd->mtime.SetUnix(Raw->Get4()); else hd->mtime.SetWin(Raw->Get8()); if ((Flags & FHEXTRA_HTIME_CTIME)!=0) if (UnixTime) hd->ctime.SetUnix(Raw->Get4()); else hd->ctime.SetWin(Raw->Get8()); if ((Flags & FHEXTRA_HTIME_ATIME)!=0) if (UnixTime) hd->atime.SetUnix((time_t)Raw->Get4()); else hd->atime.SetWin(Raw->Get8()); if (UnixTime && (Flags & FHEXTRA_HTIME_UNIX_NS)!=0) // Add nanoseconds. { uint ns; if ((Flags & FHEXTRA_HTIME_MTIME)!=0 && (ns=(Raw->Get4() & 0x3fffffff))<1000000000) hd->mtime.Adjust(ns); if ((Flags & FHEXTRA_HTIME_CTIME)!=0 && (ns=(Raw->Get4() & 0x3fffffff))<1000000000) hd->ctime.Adjust(ns); if ((Flags & FHEXTRA_HTIME_ATIME)!=0 && (ns=(Raw->Get4() & 0x3fffffff))<1000000000) hd->atime.Adjust(ns); } } break; case FHEXTRA_VERSION: if (FieldSize>=1) { Raw->GetV(); // Skip flags field. uint Version=(uint)Raw->GetV(); if (Version!=0) { hd->Version=true; wchar VerText[20]; swprintf(VerText,ASIZE(VerText),L";%u",Version); wcsncatz(FileHead.FileName,VerText,ASIZE(FileHead.FileName)); } } break; case FHEXTRA_REDIR: { hd->RedirType=(FILE_SYSTEM_REDIRECT)Raw->GetV(); uint Flags=(uint)Raw->GetV(); hd->DirTarget=(Flags & FHEXTRA_REDIR_DIR)!=0; size_t NameSize=(size_t)Raw->GetV(); char UtfName[NM*4]; *UtfName=0; if (NameSize<ASIZE(UtfName)-1) { Raw->GetB(UtfName,NameSize); UtfName[NameSize]=0; } #ifdef _WIN_ALL UnixSlashToDos(UtfName,UtfName,ASIZE(UtfName)); #endif UtfToWide(UtfName,hd->RedirName,ASIZE(hd->RedirName)); } break; case FHEXTRA_UOWNER: { uint Flags=(uint)Raw->GetV(); hd->UnixOwnerNumeric=(Flags & FHEXTRA_UOWNER_NUMUID)!=0; hd->UnixGroupNumeric=(Flags & FHEXTRA_UOWNER_NUMGID)!=0; *hd->UnixOwnerName=*hd->UnixGroupName=0; if ((Flags & FHEXTRA_UOWNER_UNAME)!=0) { size_t Length=(size_t)Raw->GetV(); Length=Min(Length,ASIZE(hd->UnixOwnerName)-1); Raw->GetB(hd->UnixOwnerName,Length); hd->UnixOwnerName[Length]=0; } if ((Flags & FHEXTRA_UOWNER_GNAME)!=0) { size_t Length=(size_t)Raw->GetV(); Length=Min(Length,ASIZE(hd->UnixGroupName)-1); Raw->GetB(hd->UnixGroupName,Length); hd->UnixGroupName[Length]=0; } #ifdef _UNIX if (hd->UnixOwnerNumeric) hd->UnixOwnerID=(uid_t)Raw->GetV(); if (hd->UnixGroupNumeric) hd->UnixGroupID=(gid_t)Raw->GetV(); #else // Need these fields in Windows too for 'list' command, // but uid_t and gid_t are not defined. if (hd->UnixOwnerNumeric) hd->UnixOwnerID=(uint)Raw->GetV(); if (hd->UnixGroupNumeric) hd->UnixGroupID=(uint)Raw->GetV(); #endif hd->UnixOwnerSet=true; } break; case FHEXTRA_SUBDATA: { // RAR 5.21 and earlier set FHEXTRA_SUBDATA size to 1 less than // required. It did not hurt extraction, because UnRAR 5.21 // and earlier ignored this field and set FieldSize as data left // in entire extra area. But now we set the correct field size // and set FieldSize based on the actual extra record size, // so we need to adjust it for those older archives here. // FHEXTRA_SUBDATA in those archives always belongs to HEAD_SERVICE // and always is last in extra area. So since its size is by 1 // less than needed, we always have 1 byte left in extra area, // which fact we use here to detect such archives. if (bb->HeaderType==HEAD_SERVICE && Raw->Size()-NextPos==1) FieldSize++; // We cannot allocate too much memory here, because above // we check FieldSize againt Raw size and we control that Raw size // is sensible when reading headers. hd->SubData.Alloc((size_t)FieldSize); Raw->GetB(hd->SubData.Addr(0),(size_t)FieldSize); } break; } } Raw->SetPos(NextPos); } }
1417
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Archive::ReadHeader50
Archive::ReadHeader50()
[]
size_t Archive::ReadHeader50() { RawRead Raw(this); bool Decrypt=Encrypted && CurBlockPos>(int64)SFXSize+SIZEOF_MARKHEAD5; if (Decrypt) { #if defined(RAR_NOCRYPT) return 0; #else byte HeadersInitV[SIZE_INITV]; if (Read(HeadersInitV,SIZE_INITV)!=SIZE_INITV) { UnexpEndArcMsg(); return 0; } while (true) // Repeat the password prompt for wrong passwords. { RequestArcPassword(); byte PswCheck[SIZE_PSWCHECK]; HeadersCrypt.SetCryptKeys(false,CRYPT_RAR50,&Cmd->Password,CryptHead.Salt,HeadersInitV,CryptHead.Lg2Count,NULL,PswCheck); // Verify password validity. if (CryptHead.UsePswCheck && memcmp(PswCheck,CryptHead.PswCheck,SIZE_PSWCHECK)!=0) { // This message is used by Android GUI and Windows GUI and SFX to // reset cached passwords. Update appropriate code if changed. uiMsg(UIWAIT_BADPSW,FileName); Cmd->Password.Clean(); continue; } break; } Raw.SetCrypt(&HeadersCrypt); #endif } // Header size must not occupy more than 3 variable length integer bytes // resulting in 2 MB maximum header size, so here we read 4 byte CRC32 // followed by 3 bytes or less of header size. const size_t FirstReadSize=7; // Smallest possible block size. if (Raw.Read(FirstReadSize)<FirstReadSize) { UnexpEndArcMsg(); return 0; } ShortBlock.Reset(); ShortBlock.HeadCRC=Raw.Get4(); uint SizeBytes=Raw.GetVSize(4); uint64 BlockSize=Raw.GetV(); if (BlockSize==0 || SizeBytes==0) { BrokenHeaderMsg(); return 0; } int SizeToRead=int(BlockSize); SizeToRead-=FirstReadSize-SizeBytes-4; // Adjust overread size bytes if any. uint HeaderSize=4+SizeBytes+(uint)BlockSize; if (SizeToRead<0 || HeaderSize<SIZEOF_SHORTBLOCKHEAD5) { BrokenHeaderMsg(); return 0; } Raw.Read(SizeToRead); if (Raw.Size()<HeaderSize) { UnexpEndArcMsg(); return 0; } uint HeaderCRC=Raw.GetCRC50(); ShortBlock.HeaderType=(HEADER_TYPE)Raw.GetV(); ShortBlock.Flags=(uint)Raw.GetV(); ShortBlock.SkipIfUnknown=(ShortBlock.Flags & HFL_SKIPIFUNKNOWN)!=0; ShortBlock.HeadSize=HeaderSize; CurHeaderType=ShortBlock.HeaderType; bool BadCRC=(ShortBlock.HeadCRC!=HeaderCRC); if (BadCRC) { BrokenHeaderMsg(); // Report, but attempt to process. BrokenHeader=true; ErrHandler.SetErrorCode(RARX_CRC); if (Decrypt) { uiMsg(UIERROR_CHECKSUMENC,FileName,FileName); FailedHeaderDecryption=true; return 0; } } uint64 ExtraSize=0; if ((ShortBlock.Flags & HFL_EXTRA)!=0) { ExtraSize=Raw.GetV(); if (ExtraSize>=ShortBlock.HeadSize) { BrokenHeaderMsg(); return 0; } } uint64 DataSize=0; if ((ShortBlock.Flags & HFL_DATA)!=0) DataSize=Raw.GetV(); NextBlockPos=CurBlockPos+FullHeaderSize(ShortBlock.HeadSize); // Set to 0 in case of overflow, so end of ReadHeader cares about it. NextBlockPos=SafeAdd(NextBlockPos,DataSize,0); switch(ShortBlock.HeaderType) { case HEAD_CRYPT: { *(BaseBlock *)&CryptHead=ShortBlock; uint CryptVersion=(uint)Raw.GetV(); if (CryptVersion>CRYPT_VERSION) { UnkEncVerMsg(FileName); return 0; } uint EncFlags=(uint)Raw.GetV(); CryptHead.UsePswCheck=(EncFlags & CHFL_CRYPT_PSWCHECK)!=0; CryptHead.Lg2Count=Raw.Get1(); if (CryptHead.Lg2Count>CRYPT5_KDF_LG2_COUNT_MAX) { UnkEncVerMsg(FileName); return 0; } Raw.GetB(CryptHead.Salt,SIZE_SALT50); if (CryptHead.UsePswCheck) { Raw.GetB(CryptHead.PswCheck,SIZE_PSWCHECK); byte csum[SIZE_PSWCHECK_CSUM]; Raw.GetB(csum,SIZE_PSWCHECK_CSUM); sha256_context ctx; sha256_init(&ctx); sha256_process(&ctx, CryptHead.PswCheck, SIZE_PSWCHECK); byte Digest[SHA256_DIGEST_SIZE]; sha256_done(&ctx, Digest); CryptHead.UsePswCheck=memcmp(csum,Digest,SIZE_PSWCHECK_CSUM)==0; } Encrypted=true; } break; case HEAD_MAIN: { MainHead.Reset(); *(BaseBlock *)&MainHead=ShortBlock; uint ArcFlags=(uint)Raw.GetV(); Volume=(ArcFlags & MHFL_VOLUME)!=0; Solid=(ArcFlags & MHFL_SOLID)!=0; Locked=(ArcFlags & MHFL_LOCK)!=0; Protected=(ArcFlags & MHFL_PROTECT)!=0; Signed=false; NewNumbering=true; if ((ArcFlags & MHFL_VOLNUMBER)!=0) VolNumber=(uint)Raw.GetV(); else VolNumber=0; FirstVolume=Volume && VolNumber==0; if (ExtraSize!=0) ProcessExtra50(&Raw,(size_t)ExtraSize,&MainHead); #ifdef USE_QOPEN if (MainHead.Locator && MainHead.QOpenOffset>0 && Cmd->QOpenMode!=QOPEN_NONE) { // We seek to QO block in the end of archive when processing // QOpen.Load, so we need to preserve current block positions // to not break normal archive processing by calling function. int64 SaveCurBlockPos=CurBlockPos,SaveNextBlockPos=NextBlockPos; HEADER_TYPE SaveCurHeaderType=CurHeaderType; QOpen.Init(this,false); QOpen.Load(MainHead.QOpenOffset); CurBlockPos=SaveCurBlockPos; NextBlockPos=SaveNextBlockPos; CurHeaderType=SaveCurHeaderType; } #endif } break; case HEAD_FILE: case HEAD_SERVICE: { FileHeader *hd=ShortBlock.HeaderType==HEAD_FILE ? &FileHead:&SubHead; hd->Reset(); *(BaseBlock *)hd=ShortBlock; bool FileBlock=ShortBlock.HeaderType==HEAD_FILE; hd->LargeFile=true; hd->PackSize=DataSize; hd->FileFlags=(uint)Raw.GetV(); hd->UnpSize=Raw.GetV(); hd->UnknownUnpSize=(hd->FileFlags & FHFL_UNPUNKNOWN)!=0; if (hd->UnknownUnpSize) hd->UnpSize=INT64NDF; hd->MaxSize=Max(hd->PackSize,hd->UnpSize); hd->FileAttr=(uint)Raw.GetV(); if ((hd->FileFlags & FHFL_UTIME)!=0) hd->mtime.SetUnix((time_t)Raw.Get4()); hd->FileHash.Type=HASH_NONE; if ((hd->FileFlags & FHFL_CRC32)!=0) { hd->FileHash.Type=HASH_CRC32; hd->FileHash.CRC32=Raw.Get4(); } hd->RedirType=FSREDIR_NONE; uint CompInfo=(uint)Raw.GetV(); hd->Method=(CompInfo>>7) & 7; // "+ 50" to not mix with old RAR format algorithms. For example, // we may need to use the compression algorithm 15 in the future, // but it was already used in RAR 1.5 and Unpack needs to distinguish // them. hd->UnpVer=(CompInfo & 0x3f) + 50; hd->HostOS=(byte)Raw.GetV(); size_t NameSize=(size_t)Raw.GetV(); hd->Inherited=(ShortBlock.Flags & HFL_INHERITED)!=0; hd->HSType=HSYS_UNKNOWN; if (hd->HostOS==HOST5_UNIX) hd->HSType=HSYS_UNIX; else if (hd->HostOS==HOST5_WINDOWS) hd->HSType=HSYS_WINDOWS; hd->SplitBefore=(hd->Flags & HFL_SPLITBEFORE)!=0; hd->SplitAfter=(hd->Flags & HFL_SPLITAFTER)!=0; hd->SubBlock=(hd->Flags & HFL_CHILD)!=0; hd->Solid=FileBlock && (CompInfo & FCI_SOLID)!=0; hd->Dir=(hd->FileFlags & FHFL_DIRECTORY)!=0; hd->WinSize=hd->Dir ? 0:size_t(0x20000)<<((CompInfo>>10)&0xf); hd->CryptMethod=hd->Encrypted ? CRYPT_RAR50:CRYPT_NONE; char FileName[NM*4]; size_t ReadNameSize=Min(NameSize,ASIZE(FileName)-1); Raw.GetB((byte *)FileName,ReadNameSize); FileName[ReadNameSize]=0; UtfToWide(FileName,hd->FileName,ASIZE(hd->FileName)); // Should do it before converting names, because extra fields can // affect name processing, like in case of NTFS streams. if (ExtraSize!=0) ProcessExtra50(&Raw,(size_t)ExtraSize,hd); if (FileBlock) { #ifndef SFX_MODULE ConvertNameCase(hd->FileName); #endif ConvertFileHeader(hd); } if (!FileBlock && hd->CmpName(SUBHEAD_TYPE_CMT)) MainComment=true; #if 0 // For RAR5 format we read the user specified recovery percent here. // It would be useful to do it for shell extension too, so we display // the correct recovery record size in archive properties. But then // we would need to include the entire recovery record processing // code to shell extension, which is not done now. if (!FileBlock && hd->CmpName(SUBHEAD_TYPE_RR) && hd->SubData.Size()>0) { RecoveryPercent=hd->SubData[0]; RSBlockHeader Header; GetRRInfo(this,&Header); RecoverySize=Header.RecSectionSize*Header.RecCount; } #endif if (BadCRC) // Add the file name to broken header message displayed above. uiMsg(UIERROR_FHEADERBROKEN,Archive::FileName,hd->FileName); } break; case HEAD_ENDARC: { *(BaseBlock *)&EndArcHead=ShortBlock; uint ArcFlags=(uint)Raw.GetV(); EndArcHead.NextVolume=(ArcFlags & EHFL_NEXTVOLUME)!=0; EndArcHead.StoreVolNumber=false; EndArcHead.DataCRC=false; EndArcHead.RevSpace=false; } break; } return Raw.Size(); }
1602
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
CommandData::IsProcessFile
CommandData::IsProcessFile( FileHeader & FileHead , bool * ExactMatch , int MatchType , wchar * MatchedArg , uint MatchedArgSize)
['FileHead', 'ExactMatch', 'MatchType', 'MatchedArg', 'MatchedArgSize']
int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType, wchar *MatchedArg,uint MatchedArgSize) { if (MatchedArg!=NULL && MatchedArgSize>0) *MatchedArg=0; if (wcslen(FileHead.FileName)>=NM) return 0; bool Dir=FileHead.Dir; if (ExclCheck(FileHead.FileName,Dir,false,true)) return 0; #ifndef SFX_MODULE if (TimeCheck(FileHead.mtime)) return 0; if ((FileHead.FileAttr & ExclFileAttr)!=0 || InclAttrSet && (FileHead.FileAttr & InclFileAttr)==0) return 0; if (!Dir && SizeCheck(FileHead.UnpSize)) return 0; #endif wchar *ArgName; FileArgs.Rewind(); for (int StringCount=1;(ArgName=FileArgs.GetString())!=NULL;StringCount++) if (CmpName(ArgName,FileHead.FileName,MatchType)) { if (ExactMatch!=NULL) *ExactMatch=wcsicompc(ArgName,FileHead.FileName)==0; if (MatchedArg!=NULL) wcsncpyz(MatchedArg,ArgName,MatchedArgSize); return StringCount; } return 0; }
220
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
CommandData::ParseArg
CommandData::ParseArg( wchar * Arg)
['Arg']
void CommandData::ParseArg(wchar *Arg) { if (IsSwitch(*Arg) && !NoMoreSwitches) if (Arg[1]=='-' && Arg[2]==0) NoMoreSwitches=true; else ProcessSwitch(Arg+1); else if (*Command==0) { wcsncpy(Command,Arg,ASIZE(Command)); *Command=toupperw(*Command); // 'I' and 'S' commands can contain case sensitive strings after // the first character, so we must not modify their case. // 'S' can contain SFX name, which case is important in Unix. if (*Command!='I' && *Command!='S') wcsupper(Command); } else if (*ArcName==0) wcsncpyz(ArcName,Arg,ASIZE(ArcName)); else { // Check if last character is the path separator. size_t Length=wcslen(Arg); wchar EndChar=Length==0 ? 0:Arg[Length-1]; bool EndSeparator=IsDriveDiv(EndChar) || IsPathDiv(EndChar); wchar CmdChar=toupperw(*Command); bool Add=wcschr(L"AFUM",CmdChar)!=NULL; bool Extract=CmdChar=='X' || CmdChar=='E'; if (EndSeparator && !Add) wcsncpyz(ExtrPath,Arg,ASIZE(ExtrPath)); else if ((Add || CmdChar=='T') && (*Arg!='@' || ListMode==RCLM_REJECT_LISTS)) FileArgs.AddString(Arg); else { FindData FileData; bool Found=FindFile::FastFind(Arg,&FileData); if ((!Found || ListMode==RCLM_ACCEPT_LISTS) && ListMode!=RCLM_REJECT_LISTS && *Arg=='@' && !IsWildcard(Arg)) { FileLists=true; ReadTextFile(Arg+1,&FileArgs,false,true,FilelistCharset,true,true,true); } else if (Found && FileData.IsDir && Extract && *ExtrPath==0) { wcsncpyz(ExtrPath,Arg,ASIZE(ExtrPath)); AddEndSlash(ExtrPath,ASIZE(ExtrPath)); } else FileArgs.AddString(Arg); } } }
359
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
CommandData::ProcessCommand
CommandData::ProcessCommand()
[]
void CommandData::ProcessCommand() { #ifndef SFX_MODULE const wchar *SingleCharCommands=L"FUADPXETK"; if (Command[0]!=0 && Command[1]!=0 && wcschr(SingleCharCommands,Command[0])!=NULL || *ArcName==0) OutHelp(*Command==0 ? RARX_SUCCESS:RARX_USERERROR); // Return 'success' for 'rar' without parameters. const wchar *ArcExt=GetExt(ArcName); #ifdef _UNIX if (ArcExt==NULL && (!FileExist(ArcName) || IsDir(GetFileAttr(ArcName)))) wcsncatz(ArcName,L".rar",ASIZE(ArcName)); #else if (ArcExt==NULL) wcsncatz(ArcName,L".rar",ASIZE(ArcName)); #endif // Treat arcname.part1 as arcname.part1.rar. if (ArcExt!=NULL && wcsnicomp(ArcExt,L".part",5)==0 && IsDigit(ArcExt[5]) && !FileExist(ArcName)) { wchar Name[NM]; wcsncpyz(Name,ArcName,ASIZE(Name)); wcsncatz(Name,L".rar",ASIZE(Name)); if (FileExist(Name)) wcsncpyz(ArcName,Name,ASIZE(ArcName)); } if (wcschr(L"AFUMD",*Command)==NULL) { if (GenerateArcName) GenerateArchiveName(ArcName,ASIZE(ArcName),GenerateMask,false); StringList ArcMasks; ArcMasks.AddString(ArcName); ScanTree Scan(&ArcMasks,Recurse,SaveSymLinks,SCAN_SKIPDIRS); FindData FindData; while (Scan.GetNext(&FindData)==SCAN_SUCCESS) AddArcName(FindData.Name); } else AddArcName(ArcName); #endif switch(Command[0]) { case 'P': case 'X': case 'E': case 'T': case 'I': { CmdExtract Extract(this); Extract.DoExtract(); } break; #ifndef SILENT case 'V': case 'L': ListArchive(this); break; default: OutHelp(RARX_USERERROR); #endif } if (!BareOutput) mprintf(L"\n"); }
363
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
File::IsOpened
File::IsOpened()
[]
bool IsOpened() {return hFile!=FILE_BAD_HANDLE;};
10
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
QuickOpen::Load
QuickOpen::Load( uint64 BlockPos)
['BlockPos']
void QuickOpen::Load(uint64 BlockPos) { if (!Loaded) // If loading the first time, perform additional intialization. { SeekPos=Arc->Tell(); UnsyncSeekPos=false; SaveFilePos SavePos(*Arc); Arc->Seek(BlockPos,SEEK_SET); if (Arc->ReadHeader()==0 || Arc->GetHeaderType()!=HEAD_SERVICE || !Arc->SubHead.CmpName(SUBHEAD_TYPE_QOPEN)) return; QLHeaderPos=Arc->CurBlockPos; RawDataStart=Arc->Tell(); RawDataSize=Arc->SubHead.UnpSize; Loaded=true; // Set only after all file processing calls like Tell, Seek, ReadHeader. } if (Arc->SubHead.Encrypted) { RAROptions *Cmd=Arc->GetRAROptions(); #ifndef RAR_NOCRYPT if (Cmd->Password.IsSet()) Crypt.SetCryptKeys(false,CRYPT_RAR50,&Cmd->Password,Arc->SubHead.Salt, Arc->SubHead.InitV,Arc->SubHead.Lg2Count, Arc->SubHead.HashKey,Arc->SubHead.PswCheck); else #endif return; } RawDataPos=0; ReadBufSize=0; ReadBufPos=0; LastReadHeader.Reset(); LastReadHeaderPos=0; ReadBuffer(); }
203
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
CharToWideMap
CharToWideMap( const char * Src , wchar * Dest , size_t DestSize , bool & Success)
['Src', 'Dest', 'DestSize', 'Success']
void CharToWideMap(const char *Src,wchar *Dest,size_t DestSize,bool &Success) { // Map inconvertible characters to private use Unicode area 0xE000. // Mark such string by placing special non-character code before // first inconvertible character. Success=false; bool MarkAdded=false; uint SrcPos=0,DestPos=0; while (DestPos<DestSize) { if (Src[SrcPos]==0) { Success=true; break; } mbstate_t ps; memset(&ps,0,sizeof(ps)); if (mbrtowc(Dest+DestPos,Src+SrcPos,MB_CUR_MAX,&ps)==-1) { // For security reasons we do not want to map low ASCII characters, // so we do not have additional .. and path separator codes. if (byte(Src[SrcPos])>=0x80) { if (!MarkAdded) { Dest[DestPos++]=MappedStringMark; MarkAdded=true; if (DestPos>=DestSize) break; } Dest[DestPos++]=byte(Src[SrcPos++])+MapAreaStart; } else break; } else { memset(&ps,0,sizeof(ps)); int Length=mbrlen(Src+SrcPos,MB_CUR_MAX,&ps); SrcPos+=Max(Length,1); DestPos++; } } Dest[Min(DestPos,DestSize-1)]=0; }
220
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
WideToCharMap
WideToCharMap( const wchar * Src , char * Dest , size_t DestSize , bool & Success)
['Src', 'Dest', 'DestSize', 'Success']
bool WideToCharMap(const wchar *Src,char *Dest,size_t DestSize,bool &Success) { // String with inconvertible characters mapped to private use Unicode area // must have the mark code somewhere. if (wcschr(Src,(wchar)MappedStringMark)==NULL) return false; Success=true; uint SrcPos=0,DestPos=0; while (Src[SrcPos]!=0 && DestPos<DestSize-MB_CUR_MAX) { if (uint(Src[SrcPos])==MappedStringMark) { SrcPos++; continue; } // For security reasons do not restore low ASCII codes, so mapping cannot // be used to hide control codes like path separators. if (uint(Src[SrcPos])>=MapAreaStart+0x80 && uint(Src[SrcPos])<MapAreaStart+0x100) Dest[DestPos++]=char(uint(Src[SrcPos++])-MapAreaStart); else { mbstate_t ps; memset(&ps,0,sizeof(ps)); if (wcrtomb(Dest+DestPos,Src[SrcPos],&ps)==-1) { Dest[DestPos]='_'; Success=false; } SrcPos++; memset(&ps,0,sizeof(ps)); int Length=mbrlen(Dest+DestPos,MB_CUR_MAX,&ps); DestPos+=Max(Length,1); } } Dest[Min(DestPos,DestSize-1)]=0; return true; }
241
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Unpack::AddVMCode
Unpack::AddVMCode( uint FirstByte , byte * Code , int CodeSize)
['FirstByte', 'Code', 'CodeSize']
bool Unpack::AddVMCode(uint FirstByte,byte *Code,int CodeSize) { VMCodeInp.InitBitInput(); memcpy(VMCodeInp.InBuf,Code,Min(BitInput::MAX_SIZE,CodeSize)); VM.Init(); uint FiltPos; if ((FirstByte & 0x80)!=0) { FiltPos=RarVM::ReadData(VMCodeInp); if (FiltPos==0) InitFilters30(false); else FiltPos--; } else FiltPos=LastFilter; // Use the same filter as last time. if (FiltPos>Filters30.Size() || FiltPos>OldFilterLengths.Size()) return false; LastFilter=FiltPos; bool NewFilter=(FiltPos==Filters30.Size()); UnpackFilter30 *StackFilter=new UnpackFilter30; // New filter for PrgStack. UnpackFilter30 *Filter; if (NewFilter) // New filter code, never used before since VM reset. { if (FiltPos>MAX3_UNPACK_FILTERS) { // Too many different filters, corrupt archive. delete StackFilter; return false; } Filters30.Add(1); Filters30[Filters30.Size()-1]=Filter=new UnpackFilter30; StackFilter->ParentFilter=(uint)(Filters30.Size()-1); // Reserve one item to store the data block length of our new filter // entry. We'll set it to real block length below, after reading it. // But we need to initialize it now, because when processing corrupt // data, we can access this item even before we set it to real value. OldFilterLengths.Push(0); } else // Filter was used in the past. { Filter=Filters30[FiltPos]; StackFilter->ParentFilter=FiltPos; } uint EmptyCount=0; for (uint I=0;I<PrgStack.Size();I++) { PrgStack[I-EmptyCount]=PrgStack[I]; if (PrgStack[I]==NULL) EmptyCount++; if (EmptyCount>0) PrgStack[I]=NULL; } if (EmptyCount==0) { if (PrgStack.Size()>MAX3_UNPACK_FILTERS) { delete StackFilter; return false; } PrgStack.Add(1); EmptyCount=1; } size_t StackPos=PrgStack.Size()-EmptyCount; PrgStack[StackPos]=StackFilter; uint BlockStart=RarVM::ReadData(VMCodeInp); if ((FirstByte & 0x40)!=0) BlockStart+=258; StackFilter->BlockStart=(uint)((BlockStart+UnpPtr)&MaxWinMask); if ((FirstByte & 0x20)!=0) { StackFilter->BlockLength=RarVM::ReadData(VMCodeInp); // Store the last data block length for current filter. OldFilterLengths[FiltPos]=StackFilter->BlockLength; } else { // Set the data block size to same value as the previous block size // for same filter. It is possible for corrupt data to access a new // and not filled yet item of OldFilterLengths array here. This is why // we set new OldFilterLengths items to zero above. StackFilter->BlockLength=FiltPos<OldFilterLengths.Size() ? OldFilterLengths[FiltPos]:0; } StackFilter->NextWindow=WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<=BlockStart; // DebugLog("\nNextWindow: UnpPtr=%08x WrPtr=%08x BlockStart=%08x",UnpPtr,WrPtr,BlockStart); memset(StackFilter->Prg.InitR,0,sizeof(StackFilter->Prg.InitR)); StackFilter->Prg.InitR[4]=StackFilter->BlockLength; if ((FirstByte & 0x10)!=0) // Set registers to optional parameters if any. { uint InitMask=VMCodeInp.fgetbits()>>9; VMCodeInp.faddbits(7); for (uint I=0;I<7;I++) if (InitMask & (1<<I)) StackFilter->Prg.InitR[I]=RarVM::ReadData(VMCodeInp); } if (NewFilter) { uint VMCodeSize=RarVM::ReadData(VMCodeInp); if (VMCodeSize>=0x10000 || VMCodeSize==0) return false; Array<byte> VMCode(VMCodeSize); for (uint I=0;I<VMCodeSize;I++) { if (VMCodeInp.Overflow(3)) return false; VMCode[I]=VMCodeInp.fgetbits()>>8; VMCodeInp.faddbits(8); } VM.Prepare(&VMCode[0],VMCodeSize,&Filter->Prg); } StackFilter->Prg.Type=Filter->Prg.Type; return true; }
679
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Unpack::Unpack5
Unpack::Unpack5( bool Solid)
['Solid']
void Unpack::Unpack5(bool Solid) { FileExtracted=true; if (!Suspended) { UnpInitData(Solid); if (!UnpReadBuf()) return; // Check TablesRead5 to be sure that we read tables at least once // regardless of current block header TablePresent flag. // So we can safefly use these tables below. if (!ReadBlockHeader(Inp,BlockHeader) || !ReadTables(Inp,BlockHeader,BlockTables) || !TablesRead5) return; } while (true) { UnpPtr&=MaxWinMask; if (Inp.InAddr>=ReadBorder) { bool FileDone=false; // We use 'while', because for empty block containing only Huffman table, // we'll be on the block border once again just after reading the table. while (Inp.InAddr>BlockHeader.BlockStart+BlockHeader.BlockSize-1 || Inp.InAddr==BlockHeader.BlockStart+BlockHeader.BlockSize-1 && Inp.InBit>=BlockHeader.BlockBitSize) { if (BlockHeader.LastBlockInFile) { FileDone=true; break; } if (!ReadBlockHeader(Inp,BlockHeader) || !ReadTables(Inp,BlockHeader,BlockTables)) return; } if (FileDone || !UnpReadBuf()) break; } if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr) { UnpWriteBuf(); if (WrittenFileSize>DestUnpSize) return; if (Suspended) { FileExtracted=false; return; } } uint MainSlot=DecodeNumber(Inp,&BlockTables.LD); if (MainSlot<256) { if (Fragmented) FragWindow[UnpPtr++]=(byte)MainSlot; else Window[UnpPtr++]=(byte)MainSlot; continue; } if (MainSlot>=262) { uint Length=SlotToLength(Inp,MainSlot-262); uint DBits,Distance=1,DistSlot=DecodeNumber(Inp,&BlockTables.DD); if (DistSlot<4) { DBits=0; Distance+=DistSlot; } else { DBits=DistSlot/2 - 1; Distance+=(2 | (DistSlot & 1)) << DBits; } if (DBits>0) { if (DBits>=4) { if (DBits>4) { Distance+=((Inp.getbits32()>>(36-DBits))<<4); Inp.addbits(DBits-4); } uint LowDist=DecodeNumber(Inp,&BlockTables.LDD); Distance+=LowDist; } else { Distance+=Inp.getbits32()>>(32-DBits); Inp.addbits(DBits); } } if (Distance>0x100) { Length++; if (Distance>0x2000) { Length++; if (Distance>0x40000) Length++; } } InsertOldDist(Distance); LastLength=Length; if (Fragmented) FragWindow.CopyString(Length,Distance,UnpPtr,MaxWinMask); else CopyString(Length,Distance); continue; } if (MainSlot==256) { UnpackFilter Filter; if (!ReadFilter(Inp,Filter) || !AddFilter(Filter)) break; continue; } if (MainSlot==257) { if (LastLength!=0) if (Fragmented) FragWindow.CopyString(LastLength,OldDist[0],UnpPtr,MaxWinMask); else CopyString(LastLength,OldDist[0]); continue; } if (MainSlot<262) { uint DistNum=MainSlot-258; uint Distance=OldDist[DistNum]; for (uint I=DistNum;I>0;I--) OldDist[I]=OldDist[I-1]; OldDist[0]=Distance; uint LengthSlot=DecodeNumber(Inp,&BlockTables.RD); uint Length=SlotToLength(Inp,LengthSlot); LastLength=Length; if (Fragmented) FragWindow.CopyString(Length,Distance,UnpPtr,MaxWinMask); else CopyString(Length,Distance); continue; } } UnpWriteBuf(); }
704
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Unpack::ProcessDecoded
Unpack::ProcessDecoded( UnpackThreadData & D)
['D']
bool Unpack::ProcessDecoded(UnpackThreadData &D) { UnpackDecodedItem *Item=D.Decoded,*Border=D.Decoded+D.DecodedSize; while (Item<Border) { UnpPtr&=MaxWinMask; if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr) { UnpWriteBuf(); if (WrittenFileSize>DestUnpSize) return false; } if (Item->Type==UNPDT_LITERAL) { #if defined(LITTLE_ENDIAN) && defined(ALLOW_MISALIGNED) if (Item->Length==3 && UnpPtr<MaxWinSize-4) { *(uint32 *)(Window+UnpPtr)=*(uint32 *)Item->Literal; UnpPtr+=4; } else #endif for (uint I=0;I<=Item->Length;I++) Window[UnpPtr++ & MaxWinMask]=Item->Literal[I]; } else if (Item->Type==UNPDT_MATCH) { InsertOldDist(Item->Distance); LastLength=Item->Length; CopyString(Item->Length,Item->Distance); } else if (Item->Type==UNPDT_REP) { uint Distance=OldDist[Item->Distance]; for (uint I=Item->Distance;I>0;I--) OldDist[I]=OldDist[I-1]; OldDist[0]=Distance; LastLength=Item->Length; CopyString(Item->Length,Distance); } else if (Item->Type==UNPDT_FULLREP) { if (LastLength!=0) CopyString(LastLength,OldDist[0]); } else if (Item->Type==UNPDT_FILTER) { UnpackFilter Filter; Filter.Type=(byte)Item->Length; Filter.BlockStart=Item->Distance; Item++; Filter.Channels=(byte)Item->Length; Filter.BlockLength=Item->Distance; AddFilter(Filter); } Item++; } return true; }
357
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Unpack::UnpackLargeBlock
Unpack::UnpackLargeBlock( UnpackThreadData & D)
['D']
bool Unpack::UnpackLargeBlock(UnpackThreadData &D) { if (!D.TableRead) { D.TableRead=true; if (!ReadTables(D.Inp,D.BlockHeader,D.BlockTables)) { D.DamagedData=true; return false; } } if (D.Inp.InAddr>D.BlockHeader.HeaderSize+D.BlockHeader.BlockSize) { D.DamagedData=true; return false; } int BlockBorder=D.BlockHeader.BlockStart+D.BlockHeader.BlockSize-1; // Reserve enough space even for filter entry. int DataBorder=D.DataSize-16; int ReadBorder=Min(BlockBorder,DataBorder); while (true) { UnpPtr&=MaxWinMask; if (D.Inp.InAddr>=ReadBorder) { if (D.Inp.InAddr>BlockBorder || D.Inp.InAddr==BlockBorder && D.Inp.InBit>=D.BlockHeader.BlockBitSize) break; // If we do not have any more data in file to read, we must process // what we have until last byte. Otherwise we can return and append // more data to unprocessed few bytes. if ((D.Inp.InAddr>=DataBorder) && !D.NoDataLeft || D.Inp.InAddr>=D.DataSize) { D.Incomplete=true; break; } } if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr) { UnpWriteBuf(); if (WrittenFileSize>DestUnpSize) return false; } uint MainSlot=DecodeNumber(D.Inp,&D.BlockTables.LD); if (MainSlot<256) { Window[UnpPtr++]=(byte)MainSlot; continue; } if (MainSlot>=262) { uint Length=SlotToLength(D.Inp,MainSlot-262); uint DBits,Distance=1,DistSlot=DecodeNumber(D.Inp,&D.BlockTables.DD); if (DistSlot<4) { DBits=0; Distance+=DistSlot; } else { DBits=DistSlot/2 - 1; Distance+=(2 | (DistSlot & 1)) << DBits; } if (DBits>0) { if (DBits>=4) { if (DBits>4) { Distance+=((D.Inp.getbits32()>>(36-DBits))<<4); D.Inp.addbits(DBits-4); } uint LowDist=DecodeNumber(D.Inp,&D.BlockTables.LDD); Distance+=LowDist; } else { Distance+=D.Inp.getbits32()>>(32-DBits); D.Inp.addbits(DBits); } } if (Distance>0x100) { Length++; if (Distance>0x2000) { Length++; if (Distance>0x40000) Length++; } } InsertOldDist(Distance); LastLength=Length; CopyString(Length,Distance); continue; } if (MainSlot==256) { UnpackFilter Filter; if (!ReadFilter(D.Inp,Filter) || !AddFilter(Filter)) break; continue; } if (MainSlot==257) { if (LastLength!=0) CopyString(LastLength,OldDist[0]); continue; } if (MainSlot<262) { uint DistNum=MainSlot-258; uint Distance=OldDist[DistNum]; for (uint I=DistNum;I>0;I--) OldDist[I]=OldDist[I-1]; OldDist[0]=Distance; uint LengthSlot=DecodeNumber(D.Inp,&D.BlockTables.RD); uint Length=SlotToLength(D.Inp,LengthSlot); LastLength=Length; CopyString(Length,Distance); continue; } } return true; }
690
True
1
CVE-2017-20006
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/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'name': 'https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unrar/OSV-2017-104.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4373', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rarlab:unrar:5.6.1.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': 'UnRAR 5.6.1.2 and 5.6.1.3 has a heap-based buffer overflow in Unpack::CopyString (called from Unpack::Unpack5 and CmdExtract::ExtractCurrentFile).'}]
2021-07-07T18:43Z
2021-07-01T03: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
Varun Khaneja
2017-11-29 14:39:10-08:00
5.6.1.4: Use in-memory archive instead of file IO
0ff832d31470471803b175cfff4e40c1b08ee779
False
aawc/unrar
A copy of the unrar library from https://www.rarlab.com/
2017-11-15 21:39:39
2022-06-22 12:40:12
null
aawc
27.0
20.0
Unpack::CopyString
Unpack::CopyString( uint Length , uint Distance)
['Length', 'Distance']
_forceinline void Unpack::CopyString(uint Length,uint Distance) { size_t SrcPtr=UnpPtr-Distance; if (SrcPtr<MaxWinSize-MAX_LZ_MATCH && UnpPtr<MaxWinSize-MAX_LZ_MATCH) { // If we are not close to end of window, we do not need to waste time // to "& MaxWinMask" pointer protection. byte *Src=Window+SrcPtr; byte *Dest=Window+UnpPtr; UnpPtr+=Length; #ifdef FAST_MEMCPY if (Distance<Length) // Overlapping strings #endif while (Length>=8) { Dest[0]=Src[0]; Dest[1]=Src[1]; Dest[2]=Src[2]; Dest[3]=Src[3]; Dest[4]=Src[4]; Dest[5]=Src[5]; Dest[6]=Src[6]; Dest[7]=Src[7]; Src+=8; Dest+=8; Length-=8; } #ifdef FAST_MEMCPY else while (Length>=8) { // In theory we still could overlap here. // Supposing Distance == MaxWinSize - 1 we have memcpy(Src, Src + 1, 8). // But for real RAR archives Distance <= MaxWinSize - MAX_LZ_MATCH // always, so overlap here is impossible. // This memcpy expanded inline by MSVC. We could also use uint64 // assignment, which seems to provide about the same speed. memcpy(Dest,Src,8); Src+=8; Dest+=8; Length-=8; } #endif // Unroll the loop for 0 - 7 bytes left. Note that we use nested "if"s. if (Length>0) { Dest[0]=Src[0]; if (Length>1) { Dest[1]=Src[1]; if (Length>2) { Dest[2]=Src[2]; if (Length>3) { Dest[3]=Src[3]; if (Length>4) { Dest[4]=Src[4]; if (Length>5) { Dest[5]=Src[5]; if (Length>6) { Dest[6]=Src[6]; } } } } } } } // Close all nested "if"s. } else while (Length-- > 0) // Slow copying with all possible precautions. { Window[UnpPtr]=Window[SrcPtr++ & MaxWinMask]; // We need to have masked UnpPtr after quit from loop, so it must not // be replaced with 'Window[UnpPtr++ & MaxWinMask]' UnpPtr=(UnpPtr+1) & MaxWinMask; } }
350
True
1
CVE-2017-2920
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
nan
[{'url': 'https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0427', 'name': 'https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0427', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/101186', 'name': '101186', 'refsource': 'BID', 'tags': ['Broken Link']}, {'url': 'https://github.com/libofx/libofx/commit/a70934eea95c76a7737b83773bffe8738935082d', 'name': 'https://github.com/libofx/libofx/commit/a70934eea95c76a7737b83773bffe8738935082d', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201908-26', 'name': 'GLSA-201908-26', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pl32:photoline:20.02:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An memory corruption vulnerability exists in the .SVG parsing functionality of Computerinsel Photoline 20.02. A specially crafted .SVG file can cause a vulnerability resulting in memory corruption, which can potentially lead to arbitrary code execution. An attacker can send a specific .SVG file to trigger this vulnerability.'}]
2022-06-13T19:18Z
2017-10-05T19:29Z
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
Christian Stimming
2017-09-17 21:02:10+02:00
Fix a buffer overflow. This is only the minimum workaround to prevent buffer overflow: Stop iterating once the (fixed!) size of the output buffers is reached. In response to https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0317 However, this code is a huge mess anyway and is in no way anything like up-to-date C++ code. Please, anyone, replace it with something more modern. Thanks.
a70934eea95c76a7737b83773bffe8738935082d
False
libofx/libofx
The libofx OFX banking protocol abstraction library
2016-09-08 20:32:37
2022-08-19 09:26:33
null
libofx
34.0
22.0
sanitize_proprietary_tags
sanitize_proprietary_tags( string input_string)
['input_string']
string sanitize_proprietary_tags(string input_string) { unsigned int i; size_t input_string_size; bool strip = false; bool tag_open = false; int tag_open_idx = 0; //Are we within < > ? bool closing_tag_open = false; //Are we within </ > ? int orig_tag_open_idx = 0; bool proprietary_tag = false; //Are we within a proprietary element? bool proprietary_closing_tag = false; int crop_end_idx = 0; char buffer[READ_BUFFER_SIZE] = ""; char tagname[READ_BUFFER_SIZE] = ""; int tagname_idx = 0; char close_tagname[READ_BUFFER_SIZE] = ""; for (i = 0; i < READ_BUFFER_SIZE; i++) { buffer[i] = 0; tagname[i] = 0; close_tagname[i] = 0; } input_string_size = input_string.size(); for (i = 0; i < input_string_size; i++) { if (input_string.c_str()[i] == '<') { tag_open = true; tag_open_idx = i; if (proprietary_tag == true && input_string.c_str()[i+1] == '/') { //We are now in a closing tag closing_tag_open = true; //cout<<"Comparaison: "<<tagname<<"|"<<&(input_string.c_str()[i+2])<<"|"<<strlen(tagname)<<endl; if (strncmp(tagname, &(input_string.c_str()[i+2]), strlen(tagname)) != 0) { //If it is the begining of an other tag //cout<<"DIFFERENT!"<<endl; crop_end_idx = i - 1; strip = true; } else { //Otherwise, it is the start of the closing tag of the proprietary tag proprietary_closing_tag = true; } } else if (proprietary_tag == true) { //It is the start of a new tag, following a proprietary tag crop_end_idx = i - 1; strip = true; } } else if (input_string.c_str()[i] == '>') { tag_open = false; closing_tag_open = false; tagname[tagname_idx] = 0; tagname_idx = 0; if (proprietary_closing_tag == true) { crop_end_idx = i; strip = true; } } else if (tag_open == true && closing_tag_open == false) { if (input_string.c_str()[i] == '.') { if (proprietary_tag != true) { orig_tag_open_idx = tag_open_idx; proprietary_tag = true; } } tagname[tagname_idx] = input_string.c_str()[i]; tagname_idx++; } //cerr <<i<<endl; if (strip == true && orig_tag_open_idx < input_string.size()) { input_string.copy(buffer, (crop_end_idx - orig_tag_open_idx) + 1, orig_tag_open_idx); message_out(INFO, "sanitize_proprietary_tags() (end tag or new tag) removed: " + string(buffer)); input_string.erase(orig_tag_open_idx, (crop_end_idx - orig_tag_open_idx) + 1); i = orig_tag_open_idx - 1; proprietary_tag = false; proprietary_closing_tag = false; closing_tag_open = false; tag_open = false; strip = false; input_string_size = input_string.size(); } }//end for if (proprietary_tag == true && orig_tag_open_idx < input_string.size()) { if (crop_end_idx == 0) //no closing tag { crop_end_idx = input_string.size() - 1; } input_string.copy(buffer, (crop_end_idx - orig_tag_open_idx) + 1, orig_tag_open_idx); message_out(INFO, "sanitize_proprietary_tags() (end of line) removed: " + string(buffer)); input_string.erase(orig_tag_open_idx, (crop_end_idx - orig_tag_open_idx) + 1); input_string_size = input_string.size(); } return input_string; }
551
True
1
CVE-2017-5207
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.0/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://security.gentoo.org/glsa/201701-62', 'name': 'GLSA-201701-62', 'refsource': 'GENTOO', 'tags': ['Patch', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/netblue30/firejail/issues/1023', 'name': 'https://github.com/netblue30/firejail/issues/1023', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/netblue30/firejail/commit/5d43fdcd215203868d440ffc42036f5f5ffc89fc', 'name': 'https://github.com/netblue30/firejail/commit/5d43fdcd215203868d440ffc42036f5f5ffc89fc', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://firejail.wordpress.com/download-2/release-notes/', 'name': 'https://firejail.wordpress.com/download-2/release-notes/', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2017/01/07/6', 'name': '[oss-security] 20170107 Re: Firejail local root exploit', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97385', 'name': '97385', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-269'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:firejail_project:firejail:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.44.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Firejail before 0.9.44.4, when running a bandwidth command, allows local users to gain root privileges via the --shell argument.'}]
2019-10-03T00:03Z
2017-03-23T16:59Z
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
netblue30
2017-01-06 22:45:11-05:00
security fix
5d43fdcd215203868d440ffc42036f5f5ffc89fc
False
netblue30/firejail
Linux namespaces and seccomp-bpf sandbox
2015-08-08 22:25:44
2022-08-26 19:34:23
https://firejail.wordpress.com
netblue30
4400.0
481.0
bandwidth_pid
bandwidth_pid( pid_t pid , const char * command , const char * dev , int down , int up)
['pid', 'command', 'dev', 'down', 'up']
void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, int up) { EUID_ASSERT(); //************************ // verify sandbox //************************ EUID_ROOT(); char *comm = pid_proc_comm(pid); EUID_USER(); if (!comm) { fprintf(stderr, "Error: cannot find sandbox\n"); exit(1); } // check for firejail sandbox if (strcmp(comm, "firejail") != 0) { fprintf(stderr, "Error: cannot find sandbox\n"); exit(1); } free(comm); // check network namespace char *name; if (asprintf(&name, "/run/firejail/network/%d-netmap", pid) == -1) errExit("asprintf"); struct stat s; if (stat(name, &s) == -1) { fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n"); exit(1); } //************************ // join the network namespace //************************ pid_t child; if (find_child(pid, &child) == -1) { fprintf(stderr, "Error: cannot join the network namespace\n"); exit(1); } EUID_ROOT(); if (join_namespace(child, "net")) { fprintf(stderr, "Error: cannot join the network namespace\n"); exit(1); } // set run file if (strcmp(command, "set") == 0) bandwidth_set(pid, dev, down, up); else if (strcmp(command, "clear") == 0) bandwidth_remove(pid, dev); //************************ // build command //************************ char *devname = NULL; if (dev) { // read network map file char *fname; if (asprintf(&fname, "%s/%d-netmap", RUN_FIREJAIL_NETWORK_DIR, (int) pid) == -1) errExit("asprintf"); FILE *fp = fopen(fname, "r"); if (!fp) { fprintf(stderr, "Error: cannot read network map file %s\n", fname); exit(1); } char buf[1024]; int len = strlen(dev); while (fgets(buf, 1024, fp)) { // remove '\n' char *ptr = strchr(buf, '\n'); if (ptr) *ptr = '\0'; if (*buf == '\0') break; if (strncmp(buf, dev, len) == 0 && buf[len] == ':') { devname = strdup(buf + len + 1); if (!devname) errExit("strdup"); // check device in namespace if (if_nametoindex(devname) == 0) { fprintf(stderr, "Error: cannot find network device %s\n", devname); exit(1); } break; } } free(fname); fclose(fp); } // build fshaper.sh command char *cmd = NULL; if (devname) { if (strcmp(command, "set") == 0) { if (asprintf(&cmd, "%s/firejail/fshaper.sh --%s %s %d %d", LIBDIR, command, devname, down, up) == -1) errExit("asprintf"); } else { if (asprintf(&cmd, "%s/firejail/fshaper.sh --%s %s", LIBDIR, command, devname) == -1) errExit("asprintf"); } } else { if (asprintf(&cmd, "%s/firejail/fshaper.sh --%s", LIBDIR, command) == -1) errExit("asprintf"); } assert(cmd); // wipe out environment variables environ = NULL; //************************ // build command //************************ // elevate privileges if (setreuid(0, 0)) errExit("setreuid"); if (setregid(0, 0)) errExit("setregid"); if (!cfg.shell) cfg.shell = guess_shell(); if (!cfg.shell) { fprintf(stderr, "Error: no POSIX shell found, please use --shell command line option\n"); exit(1); } char *arg[4]; arg[0] = cfg.shell; arg[1] = "-c"; arg[2] = cmd; arg[3] = NULL; clearenv(); execvp(arg[0], arg); // it will never get here errExit("execvp"); }
689
True
1
CVE-2019-12589
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.0/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
CHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.0
6.0
False
[{'url': 'https://github.com/netblue30/firejail/releases/tag/0.9.60', 'name': 'https://github.com/netblue30/firejail/releases/tag/0.9.60', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/netblue30/firejail/issues/2718', 'name': 'https://github.com/netblue30/firejail/issues/2718', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/netblue30/firejail/commit/eecf35c2f8249489a1d3e512bb07f0d427183134', 'name': 'https://github.com/netblue30/firejail/commit/eecf35c2f8249489a1d3e512bb07f0d427183134', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/CDY7B73YDRBURA25APSHD5PFEO4TNSFW/', 'name': 'FEDORA-2020-0fb484d7f7', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/RGVULJ6IKVDO6UAVIQRHQVSKOUD6QDWM/', 'name': 'FEDORA-2020-7f6e0e6e00', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-732'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:firejail_project:firejail:*:*:*:*:-:*:*:*', 'versionEndExcluding': '0.9.60', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In Firejail before 0.9.60, seccomp filters are writable inside the jail, leading to a lack of intended seccomp restrictions for a process that is joined to the jail after a filter has been modified by an attacker.'}]
2020-08-24T17:37Z
2019-06-03T03:29Z
Incorrect Permission Assignment for Critical Resource
The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.
When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.
https://cwe.mitre.org/data/definitions/732.html
0
smitsohu
2019-03-23 22:32:30+00:00
mount runtime seccomp files read-only (#2602) avoid creating locations in the file system that are both writable and executable (in this case for processes with euid of the user). for the same reason also remove user owned libfiles when it is not needed any more
eecf35c2f8249489a1d3e512bb07f0d427183134
False
netblue30/firejail
Linux namespaces and seccomp-bpf sandbox
2015-08-08 22:25:44
2022-08-26 19:34:23
https://firejail.wordpress.com
netblue30
4400.0
481.0
sandbox
sandbox( void * sandbox_arg)
['sandbox_arg']
int sandbox(void* sandbox_arg) { // Get rid of unused parameter warning (void)sandbox_arg; pid_t child_pid = getpid(); if (arg_debug) printf("Initializing child process\n"); // close each end of the unused pipes close(parent_to_child_fds[1]); close(child_to_parent_fds[0]); // wait for parent to do base setup wait_for_other(parent_to_child_fds[0]); if (arg_debug && child_pid == 1) printf("PID namespace installed\n"); //**************************** // set hostname //**************************** if (cfg.hostname) { if (sethostname(cfg.hostname, strlen(cfg.hostname)) < 0) errExit("sethostname"); } //**************************** // mount namespace //**************************** // mount events are not forwarded between the host the sandbox if (mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL) < 0) { chk_chroot(); } // ... and mount a tmpfs on top of /run/firejail/mnt directory preproc_mount_mnt_dir(); // bind-mount firejail binaries and helper programs if (mount(LIBDIR "/firejail", RUN_FIREJAIL_LIB_DIR, "none", MS_BIND, NULL) < 0) errExit("mounting " RUN_FIREJAIL_LIB_DIR); //**************************** // log sandbox data //**************************** if (cfg.name) fs_logger2("sandbox name:", cfg.name); fs_logger2int("sandbox pid:", (int) sandbox_pid); if (cfg.chrootdir) fs_logger("sandbox filesystem: chroot"); else if (arg_overlay) fs_logger("sandbox filesystem: overlay"); else fs_logger("sandbox filesystem: local"); fs_logger("install mount namespace"); //**************************** // netfilter //**************************** if (arg_netfilter && any_bridge_configured()) { // assuming by default the client filter netfilter(arg_netfilter_file); } if (arg_netfilter6 && any_bridge_configured()) { // assuming by default the client filter netfilter6(arg_netfilter6_file); } //**************************** // networking //**************************** int gw_cfg_failed = 0; // default gw configuration flag if (arg_nonetwork) { net_if_up("lo"); if (arg_debug) printf("Network namespace enabled, only loopback interface available\n"); } else if (arg_netns) { netns(arg_netns); if (arg_debug) printf("Network namespace '%s' activated\n", arg_netns); } else if (any_bridge_configured() || any_interface_configured()) { // configure lo and eth0...eth3 net_if_up("lo"); if (mac_not_zero(cfg.bridge0.macsandbox)) net_config_mac(cfg.bridge0.devsandbox, cfg.bridge0.macsandbox); sandbox_if_up(&cfg.bridge0); if (mac_not_zero(cfg.bridge1.macsandbox)) net_config_mac(cfg.bridge1.devsandbox, cfg.bridge1.macsandbox); sandbox_if_up(&cfg.bridge1); if (mac_not_zero(cfg.bridge2.macsandbox)) net_config_mac(cfg.bridge2.devsandbox, cfg.bridge2.macsandbox); sandbox_if_up(&cfg.bridge2); if (mac_not_zero(cfg.bridge3.macsandbox)) net_config_mac(cfg.bridge3.devsandbox, cfg.bridge3.macsandbox); sandbox_if_up(&cfg.bridge3); // moving an interface in a namespace using --interface will reset the interface configuration; // we need to put the configuration back if (cfg.interface0.configured && cfg.interface0.ip) { if (arg_debug) printf("Configuring %d.%d.%d.%d address on interface %s\n", PRINT_IP(cfg.interface0.ip), cfg.interface0.dev); net_config_interface(cfg.interface0.dev, cfg.interface0.ip, cfg.interface0.mask, cfg.interface0.mtu); } if (cfg.interface1.configured && cfg.interface1.ip) { if (arg_debug) printf("Configuring %d.%d.%d.%d address on interface %s\n", PRINT_IP(cfg.interface1.ip), cfg.interface1.dev); net_config_interface(cfg.interface1.dev, cfg.interface1.ip, cfg.interface1.mask, cfg.interface1.mtu); } if (cfg.interface2.configured && cfg.interface2.ip) { if (arg_debug) printf("Configuring %d.%d.%d.%d address on interface %s\n", PRINT_IP(cfg.interface2.ip), cfg.interface2.dev); net_config_interface(cfg.interface2.dev, cfg.interface2.ip, cfg.interface2.mask, cfg.interface2.mtu); } if (cfg.interface3.configured && cfg.interface3.ip) { if (arg_debug) printf("Configuring %d.%d.%d.%d address on interface %s\n", PRINT_IP(cfg.interface3.ip), cfg.interface3.dev); net_config_interface(cfg.interface3.dev, cfg.interface3.ip, cfg.interface3.mask, cfg.interface3.mtu); } // add a default route if (cfg.defaultgw) { // set the default route if (net_add_route(0, 0, cfg.defaultgw)) { fwarning("cannot configure default route\n"); gw_cfg_failed = 1; } } if (arg_debug) printf("Network namespace enabled\n"); } // print network configuration if (!arg_quiet) { if (any_bridge_configured() || any_interface_configured() || cfg.defaultgw || cfg.dns1) { fmessage("\n"); if (any_bridge_configured() || any_interface_configured()) { if (arg_scan) sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 3, PATH_FNET, "printif", "scan"); else sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, PATH_FNET, "printif"); } if (cfg.defaultgw != 0) { if (gw_cfg_failed) fmessage("Default gateway configuration failed\n"); else fmessage("Default gateway %d.%d.%d.%d\n", PRINT_IP(cfg.defaultgw)); } if (cfg.dns1 != NULL) fmessage("DNS server %s\n", cfg.dns1); if (cfg.dns2 != NULL) fmessage("DNS server %s\n", cfg.dns2); if (cfg.dns3 != NULL) fmessage("DNS server %s\n", cfg.dns3); if (cfg.dns4 != NULL) fmessage("DNS server %s\n", cfg.dns4); fmessage("\n"); } } // load IBUS env variables if (arg_nonetwork || any_bridge_configured() || any_interface_configured()) { // do nothing - there are problems with ibus version 1.5.11 } else { EUID_USER(); env_ibus_load(); EUID_ROOT(); } //**************************** // fs pre-processing: // - build seccomp filters // - create an empty /etc/ld.so.preload //**************************** #ifdef HAVE_SECCOMP if (cfg.protocol) { if (arg_debug) printf("Build protocol filter: %s\n", cfg.protocol); // build the seccomp filter as a regular user int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 5, PATH_FSECCOMP, "protocol", "build", cfg.protocol, RUN_SECCOMP_PROTOCOL); if (rv) exit(rv); } if (arg_seccomp && (cfg.seccomp_list || cfg.seccomp_list_drop || cfg.seccomp_list_keep)) arg_seccomp_postexec = 1; #endif // need ld.so.preload if tracing or seccomp with any non-default lists bool need_preload = arg_trace || arg_tracelog || arg_seccomp_postexec; // for --appimage, --chroot and --overlay* we force NO_NEW_PRIVS // and drop all capabilities if (getuid() != 0 && (arg_appimage || cfg.chrootdir || arg_overlay)) { enforce_filters(); need_preload = arg_trace || arg_tracelog; } // trace pre-install if (need_preload) fs_trace_preload(); // store hosts file if (cfg.hosts_file) fs_store_hosts_file(); //**************************** // configure filesystem //**************************** #ifdef HAVE_CHROOT if (cfg.chrootdir) { fs_chroot(cfg.chrootdir); //**************************** // trace pre-install, this time inside chroot //**************************** if (need_preload) fs_trace_preload(); } else #endif #ifdef HAVE_OVERLAYFS if (arg_overlay) fs_overlayfs(); else #endif fs_basic_fs(); //**************************** // private mode //**************************** if (arg_private) { if (cfg.home_private) { // --private= if (cfg.chrootdir) fwarning("private=directory feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private=directory feature is disabled in overlay\n"); else fs_private_homedir(); } else if (cfg.home_private_keep) { // --private-home= if (cfg.chrootdir) fwarning("private-home= feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-home= feature is disabled in overlay\n"); else fs_private_home_list(); } else // --private fs_private(); } if (arg_private_dev) fs_private_dev(); if (arg_private_etc) { if (cfg.chrootdir) fwarning("private-etc feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-etc feature is disabled in overlay\n"); else { fs_private_dir_list("/etc", RUN_ETC_DIR, cfg.etc_private_keep); // create /etc/ld.so.preload file again if (need_preload) fs_trace_preload(); } } if (arg_private_opt) { if (cfg.chrootdir) fwarning("private-opt feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-opt feature is disabled in overlay\n"); else { fs_private_dir_list("/opt", RUN_OPT_DIR, cfg.opt_private_keep); } } if (arg_private_srv) { if (cfg.chrootdir) fwarning("private-srv feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-srv feature is disabled in overlay\n"); else { fs_private_dir_list("/srv", RUN_SRV_DIR, cfg.srv_private_keep); } } // private-bin is disabled for appimages if (arg_private_bin && !arg_appimage) { if (cfg.chrootdir) fwarning("private-bin feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-bin feature is disabled in overlay\n"); else { // for --x11=xorg we need to add xauth command if (arg_x11_xorg) { EUID_USER(); char *tmp; if (asprintf(&tmp, "%s,xauth", cfg.bin_private_keep) == -1) errExit("asprintf"); cfg.bin_private_keep = tmp; EUID_ROOT(); } fs_private_bin_list(); } } // private-lib is disabled for appimages if (arg_private_lib && !arg_appimage) { if (cfg.chrootdir) fwarning("private-lib feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-lib feature is disabled in overlay\n"); else { fs_private_lib(); } } if (arg_private_cache) { if (cfg.chrootdir) fwarning("private-cache feature is disabled in chroot\n"); else if (arg_overlay) fwarning("private-cache feature is disabled in overlay\n"); else fs_private_cache(); } if (arg_private_tmp) { // private-tmp is implemented as a whitelist EUID_USER(); fs_private_tmp(); EUID_ROOT(); } //**************************** // Session D-BUS //**************************** if (arg_nodbus) dbus_session_disable(); //**************************** // hosts and hostname //**************************** if (cfg.hostname) fs_hostname(cfg.hostname); if (cfg.hosts_file) fs_mount_hosts_file(); //**************************** // /etc overrides from the network namespace //**************************** if (arg_netns) netns_mounts(arg_netns); //**************************** // update /proc, /sys, /dev, /boot directory //**************************** fs_proc_sys_dev_boot(); //**************************** // handle /mnt and /media //**************************** if (checkcfg(CFG_DISABLE_MNT)) fs_mnt(1); else if (arg_disable_mnt) fs_mnt(0); //**************************** // apply the profile file //**************************** // apply all whitelist commands ... fs_whitelist(); // ... followed by blacklist commands fs_blacklist(); // mkdir and mkfile are processed all over again //**************************** // nosound/no3d/notv/novideo and fix for pulseaudio 7.0 //**************************** if (arg_nosound) { // disable pulseaudio pulseaudio_disable(); // disable /dev/snd fs_dev_disable_sound(); } else if (!arg_noautopulse) pulseaudio_init(); if (arg_no3d) fs_dev_disable_3d(); if (arg_notv) fs_dev_disable_tv(); if (arg_nodvd) fs_dev_disable_dvd(); if (arg_nou2f) fs_dev_disable_u2f(); if (arg_novideo) fs_dev_disable_video(); //**************************** // install trace //**************************** if (need_preload) fs_trace(); //**************************** // set dns //**************************** fs_resolvconf(); //**************************** // fs post-processing //**************************** fs_logger_print(); fs_logger_change_owner(); //**************************** // set application environment //**************************** EUID_USER(); int cwd = 0; if (cfg.cwd) { if (chdir(cfg.cwd) == 0) cwd = 1; } if (!cwd) { if (chdir("/") < 0) errExit("chdir"); if (cfg.homedir) { struct stat s; if (stat(cfg.homedir, &s) == 0) { /* coverity[toctou] */ if (chdir(cfg.homedir) < 0) errExit("chdir"); } } } if (arg_debug) { char *cpath = get_current_dir_name(); if (cpath) { printf("Current directory: %s\n", cpath); free(cpath); } } EUID_ROOT(); // clean /tmp/.X11-unix sockets fs_x11(); if (arg_x11_xorg) x11_xorg(); // save original umask save_umask(); //**************************** // set security filters //**************************** // save state of nonewprivs save_nonewprivs(); // set capabilities set_caps(); // save cpu affinity mask to CPU_CFG file save_cpu(); // save cgroup in CGROUP_CFG file save_cgroup(); // set seccomp #ifdef HAVE_SECCOMP // install protocol filter #ifdef SYS_socket if (cfg.protocol) { if (arg_debug) printf("Install protocol filter: %s\n", cfg.protocol); seccomp_load(RUN_SECCOMP_PROTOCOL); // install filter protocol_filter_save(); // save filter in RUN_PROTOCOL_CFG } else { int rv = unlink(RUN_SECCOMP_PROTOCOL); (void) rv; } #endif // if a keep list is available, disregard the drop list if (arg_seccomp == 1) { if (cfg.seccomp_list_keep) seccomp_filter_keep(); else seccomp_filter_drop(); } else { // clean seccomp files under /run/firejail/mnt int rv = unlink(RUN_SECCOMP_CFG); rv |= unlink(RUN_SECCOMP_32); (void) rv; } if (arg_memory_deny_write_execute) { if (arg_debug) printf("Install memory write&execute filter\n"); seccomp_load(RUN_SECCOMP_MDWX); // install filter } else { int rv = unlink(RUN_SECCOMP_MDWX); (void) rv; } #endif //**************************************** // communicate progress of sandbox set up // to --join //**************************************** FILE *rj = create_ready_for_join_file(); //**************************************** // create a new user namespace // - too early to drop privileges //**************************************** save_nogroups(); if (arg_noroot) { int rv = unshare(CLONE_NEWUSER); if (rv == -1) { fwarning("cannot create a new user namespace, going forward without it...\n"); arg_noroot = 0; } } // notify parent that new user namespace has been created so a proper // UID/GID map can be setup notify_other(child_to_parent_fds[1]); close(child_to_parent_fds[1]); // wait for parent to finish setting up a proper UID/GID map wait_for_other(parent_to_child_fds[0]); close(parent_to_child_fds[0]); // somehow, the new user namespace resets capabilities; // we need to do them again if (arg_noroot) { if (arg_debug) printf("noroot user namespace installed\n"); set_caps(); } //**************************************** // Set NO_NEW_PRIVS if desired //**************************************** if (arg_nonewprivs) { prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); if (prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0) != 1) { fwarning("cannot set NO_NEW_PRIVS, it requires a Linux kernel version 3.5 or newer.\n"); if (force_nonewprivs) { fprintf(stderr, "Error: NO_NEW_PRIVS required for this sandbox, exiting ...\n"); exit(1); } } else if (arg_debug) printf("NO_NEW_PRIVS set\n"); } //**************************************** // drop privileges //**************************************** drop_privs(arg_nogroups); // kill the sandbox in case the parent died prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); //**************************************** // set cpu affinity //**************************************** if (cfg.cpus) set_cpu_affinity(); //**************************************** // fork the application and monitor it //**************************************** pid_t app_pid = fork(); if (app_pid == -1) errExit("fork"); if (app_pid == 0) { #ifdef HAVE_APPARMOR if (checkcfg(CFG_APPARMOR) && arg_apparmor) { errno = 0; if (aa_change_onexec("firejail-default")) { fwarning("Cannot confine the application using AppArmor.\n" "Maybe firejail-default AppArmor profile is not loaded into the kernel.\n" "As root, run \"aa-enforce firejail-default\" to load it.\n"); } else if (arg_debug) printf("AppArmor enabled\n"); } #endif // set nice and rlimits if (arg_nice) set_nice(cfg.nice); set_rlimits(); start_application(0, rj); } fclose(rj); int status = monitor_application(app_pid); // monitor application flush_stdin(); if (WIFEXITED(status)) { // if we had a proper exit, return that exit status return WEXITSTATUS(status); } else { // something else went wrong! return -1; } }
2298
True
1
CVE-2017-5209
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.0/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
nan
[{'url': 'https://github.com/libimobiledevice/libplist/commit/3a55ddd3c4c11ce75a86afbefd085d8d397ff957', 'name': 'https://github.com/libimobiledevice/libplist/commit/3a55ddd3c4c11ce75a86afbefd085d8d397ff957', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/95385', 'name': '95385', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/04/msg00002.html', 'name': '[debian-lts-announce] 20200402 [SECURITY] [DLA 2168-1] libplist security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libimobiledevice:libplist:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.12', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The base64decode function in base64.c in libimobiledevice libplist through 1.12 allows attackers to obtain sensitive information from process memory or cause a denial of service (buffer over-read) via split encoded Apple Property List data.'}]
2020-04-02T10:15Z
2017-01-11T16:59Z
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
Nikias Bassen
2017-01-11 03:49:31+01:00
base64: Rework base64decode to handle split encoded data correctly
3a55ddd3c4c11ce75a86afbefd085d8d397ff957
False
libimobiledevice/libplist
A library to handle Apple Property List format in binary or XML
2013-02-13 14:30:43
2022-08-24 15:22:06
https://libimobiledevice.org
libimobiledevice
413.0
253.0
base64decode
base64decode( const char * buf , size_t * size)
['buf', 'size']
unsigned char *base64decode(const char *buf, size_t *size) { if (!buf || !size) return NULL; size_t len = (*size > 0) ? *size : strlen(buf); if (len <= 0) return NULL; unsigned char *outbuf = (unsigned char*)malloc((len/4)*3+3); const char *ptr = buf; int p = 0; size_t l = 0; do { ptr += strspn(ptr, "\r\n\t "); if (*ptr == '\0' || ptr >= buf+len) { break; } l = strcspn(ptr, "\r\n\t "); if (l > 3 && ptr+l <= buf+len) { p+=base64decode_block(outbuf+p, ptr, l); ptr += l; } else { break; } } while (1); outbuf[p] = 0; *size = p; return outbuf; }
187
True
1
CVE-2017-5209
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.0/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
nan
[{'url': 'https://github.com/libimobiledevice/libplist/commit/3a55ddd3c4c11ce75a86afbefd085d8d397ff957', 'name': 'https://github.com/libimobiledevice/libplist/commit/3a55ddd3c4c11ce75a86afbefd085d8d397ff957', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/95385', 'name': '95385', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/04/msg00002.html', 'name': '[debian-lts-announce] 20200402 [SECURITY] [DLA 2168-1] libplist security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libimobiledevice:libplist:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.12', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The base64decode function in base64.c in libimobiledevice libplist through 1.12 allows attackers to obtain sensitive information from process memory or cause a denial of service (buffer over-read) via split encoded Apple Property List data.'}]
2020-04-02T10:15Z
2017-01-11T16:59Z
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
Nikias Bassen
2017-01-11 03:49:31+01:00
base64: Rework base64decode to handle split encoded data correctly
3a55ddd3c4c11ce75a86afbefd085d8d397ff957
False
libimobiledevice/libplist
A library to handle Apple Property List format in binary or XML
2013-02-13 14:30:43
2022-08-24 15:22:06
https://libimobiledevice.org
libimobiledevice
413.0
253.0
base64decode_block
base64decode_block( unsigned char * target , const char * data , size_t data_size)
['target', 'data', 'data_size']
static int base64decode_block(unsigned char *target, const char *data, size_t data_size) { int w1,w2,w3,w4; int i; size_t n; if (!data || (data_size <= 0)) { return 0; } n = 0; i = 0; while (n < data_size-3) { w1 = base64_table[(int)data[n]]; w2 = base64_table[(int)data[n+1]]; w3 = base64_table[(int)data[n+2]]; w4 = base64_table[(int)data[n+3]]; if (w2 >= 0) { target[i++] = (char)((w1*4 + (w2 >> 4)) & 255); } if (w3 >= 0) { target[i++] = (char)((w2*16 + (w3 >> 2)) & 255); } if (w4 >= 0) { target[i++] = (char)((w3*64 + w4) & 255); } n+=4; } return i; }
228
True
1
CVE-2017-6436
False
False
False
True
AV:L/AC:M/Au:N/C:N/I:N/A:P
LOCAL
MEDIUM
NONE
NONE
NONE
PARTIAL
1.9
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.0
MEDIUM
1.3
3.6
nan
[{'url': 'https://github.com/libimobiledevice/libplist/issues/94', 'name': 'https://github.com/libimobiledevice/libplist/issues/94', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libimobiledevice/libplist/commit/32ee5213fe64f1e10ec76c1ee861ee6f233120dd', 'name': 'https://github.com/libimobiledevice/libplist/commit/32ee5213fe64f1e10ec76c1ee861ee6f233120dd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97290', 'name': '97290', 'refsource': 'BID', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/04/msg00002.html', 'name': '[debian-lts-announce] 20200402 [SECURITY] [DLA 2168-1] libplist security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}, {'lang': 'en', 'value': 'CWE-20'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libplist_project:libplist:1.12:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The parse_string_node function in bplist.c in libimobiledevice libplist 1.12 allows local users to cause a denial of service (memory allocation error) via a crafted plist file.'}]
2019-10-03T00:03Z
2017-03-15T14:59Z
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
Nikias Bassen
2017-02-10 13:42:46+01:00
bplist: Fix data range check for string/data/dict/array nodes Passing a size of 0xFFFFFFFFFFFFFFFF to parse_string_node() might result in a memcpy with a size of -1, leading to undefined behavior. This commit makes sure that the actual node data (which depends on the size) is in the range start_of_object..start_of_object+size. Credit to OSS-Fuzz
32ee5213fe64f1e10ec76c1ee861ee6f233120dd
False
libimobiledevice/libplist
A library to handle Apple Property List format in binary or XML
2013-02-13 14:30:43
2022-08-24 15:22:06
https://libimobiledevice.org
libimobiledevice
413.0
253.0
parse_bin_node
parse_bin_node( struct bplist_data * bplist , const char ** object)
['bplist', 'object']
static plist_t parse_bin_node(struct bplist_data *bplist, const char** object) { uint16_t type = 0; uint64_t size = 0; if (!object) return NULL; type = (**object) & BPLIST_MASK; size = (**object) & BPLIST_FILL; (*object)++; if (size == BPLIST_FILL) { switch (type) { case BPLIST_DATA: case BPLIST_STRING: case BPLIST_UNICODE: case BPLIST_ARRAY: case BPLIST_SET: case BPLIST_DICT: { uint16_t next_size = **object & BPLIST_FILL; if ((**object & BPLIST_MASK) != BPLIST_UINT) { PLIST_BIN_ERR("%s: invalid size node type for node type 0x%02x: found 0x%02x, expected 0x%02x\n", __func__, type, **object & BPLIST_MASK, BPLIST_UINT); return NULL; } (*object)++; next_size = 1 << next_size; if (*object + next_size > bplist->offset_table) { PLIST_BIN_ERR("%s: size node data bytes for node type 0x%02x point outside of valid range\n", __func__, type); return NULL; } size = UINT_TO_HOST(*object, next_size); (*object) += next_size; break; } default: break; } } switch (type) { case BPLIST_NULL: switch (size) { case BPLIST_TRUE: { plist_data_t data = plist_new_plist_data(); data->type = PLIST_BOOLEAN; data->boolval = TRUE; data->length = 1; return node_create(NULL, data); } case BPLIST_FALSE: { plist_data_t data = plist_new_plist_data(); data->type = PLIST_BOOLEAN; data->boolval = FALSE; data->length = 1; return node_create(NULL, data); } case BPLIST_NULL: default: return NULL; } case BPLIST_UINT: if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UINT data bytes point outside of valid range\n", __func__); return NULL; } return parse_uint_node(object, size); case BPLIST_REAL: if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_REAL data bytes point outside of valid range\n", __func__); return NULL; } return parse_real_node(object, size); case BPLIST_DATE: if (3 != size) { PLIST_BIN_ERR("%s: invalid data size for BPLIST_DATE node\n", __func__); return NULL; } if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_DATE data bytes point outside of valid range\n", __func__); return NULL; } return parse_date_node(object, size); case BPLIST_DATA: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_DATA data bytes point outside of valid range\n", __func__); return NULL; } return parse_data_node(object, size); case BPLIST_STRING: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_STRING data bytes point outside of valid range\n", __func__); return NULL; } return parse_string_node(object, size); case BPLIST_UNICODE: if (size*2 < size) { PLIST_BIN_ERR("%s: Integer overflow when calculating BPLIST_UNICODE data size.\n", __func__); return NULL; } if (*object + size*2 > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UNICODE data bytes point outside of valid range\n", __func__); return NULL; } return parse_unicode_node(object, size); case BPLIST_SET: case BPLIST_ARRAY: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_ARRAY data bytes point outside of valid range\n", __func__); return NULL; } return parse_array_node(bplist, object, size); case BPLIST_UID: if (*object + size+1 > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UID data bytes point outside of valid range\n", __func__); return NULL; } return parse_uid_node(object, size); case BPLIST_DICT: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_REAL data bytes point outside of valid range\n", __func__); return NULL; } return parse_dict_node(bplist, object, size); default: PLIST_BIN_ERR("%s: unexpected node type 0x%02x\n", __func__, type); return NULL; } return NULL; }
686
True
1
CVE-2017-6436
False
False
False
True
AV:L/AC:M/Au:N/C:N/I:N/A:P
LOCAL
MEDIUM
NONE
NONE
NONE
PARTIAL
1.9
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.0
MEDIUM
1.3
3.6
nan
[{'url': 'https://github.com/libimobiledevice/libplist/issues/94', 'name': 'https://github.com/libimobiledevice/libplist/issues/94', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libimobiledevice/libplist/commit/32ee5213fe64f1e10ec76c1ee861ee6f233120dd', 'name': 'https://github.com/libimobiledevice/libplist/commit/32ee5213fe64f1e10ec76c1ee861ee6f233120dd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97290', 'name': '97290', 'refsource': 'BID', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/04/msg00002.html', 'name': '[debian-lts-announce] 20200402 [SECURITY] [DLA 2168-1] libplist security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}, {'lang': 'en', 'value': 'CWE-20'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libplist_project:libplist:1.12:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The parse_string_node function in bplist.c in libimobiledevice libplist 1.12 allows local users to cause a denial of service (memory allocation error) via a crafted plist file.'}]
2019-10-03T00:03Z
2017-03-15T14:59Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Nikias Bassen
2017-02-10 13:42:46+01:00
bplist: Fix data range check for string/data/dict/array nodes Passing a size of 0xFFFFFFFFFFFFFFFF to parse_string_node() might result in a memcpy with a size of -1, leading to undefined behavior. This commit makes sure that the actual node data (which depends on the size) is in the range start_of_object..start_of_object+size. Credit to OSS-Fuzz
32ee5213fe64f1e10ec76c1ee861ee6f233120dd
False
libimobiledevice/libplist
A library to handle Apple Property List format in binary or XML
2013-02-13 14:30:43
2022-08-24 15:22:06
https://libimobiledevice.org
libimobiledevice
413.0
253.0
parse_bin_node
parse_bin_node( struct bplist_data * bplist , const char ** object)
['bplist', 'object']
static plist_t parse_bin_node(struct bplist_data *bplist, const char** object) { uint16_t type = 0; uint64_t size = 0; if (!object) return NULL; type = (**object) & BPLIST_MASK; size = (**object) & BPLIST_FILL; (*object)++; if (size == BPLIST_FILL) { switch (type) { case BPLIST_DATA: case BPLIST_STRING: case BPLIST_UNICODE: case BPLIST_ARRAY: case BPLIST_SET: case BPLIST_DICT: { uint16_t next_size = **object & BPLIST_FILL; if ((**object & BPLIST_MASK) != BPLIST_UINT) { PLIST_BIN_ERR("%s: invalid size node type for node type 0x%02x: found 0x%02x, expected 0x%02x\n", __func__, type, **object & BPLIST_MASK, BPLIST_UINT); return NULL; } (*object)++; next_size = 1 << next_size; if (*object + next_size > bplist->offset_table) { PLIST_BIN_ERR("%s: size node data bytes for node type 0x%02x point outside of valid range\n", __func__, type); return NULL; } size = UINT_TO_HOST(*object, next_size); (*object) += next_size; break; } default: break; } } switch (type) { case BPLIST_NULL: switch (size) { case BPLIST_TRUE: { plist_data_t data = plist_new_plist_data(); data->type = PLIST_BOOLEAN; data->boolval = TRUE; data->length = 1; return node_create(NULL, data); } case BPLIST_FALSE: { plist_data_t data = plist_new_plist_data(); data->type = PLIST_BOOLEAN; data->boolval = FALSE; data->length = 1; return node_create(NULL, data); } case BPLIST_NULL: default: return NULL; } case BPLIST_UINT: if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UINT data bytes point outside of valid range\n", __func__); return NULL; } return parse_uint_node(object, size); case BPLIST_REAL: if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_REAL data bytes point outside of valid range\n", __func__); return NULL; } return parse_real_node(object, size); case BPLIST_DATE: if (3 != size) { PLIST_BIN_ERR("%s: invalid data size for BPLIST_DATE node\n", __func__); return NULL; } if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_DATE data bytes point outside of valid range\n", __func__); return NULL; } return parse_date_node(object, size); case BPLIST_DATA: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_DATA data bytes point outside of valid range\n", __func__); return NULL; } return parse_data_node(object, size); case BPLIST_STRING: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_STRING data bytes point outside of valid range\n", __func__); return NULL; } return parse_string_node(object, size); case BPLIST_UNICODE: if (size*2 < size) { PLIST_BIN_ERR("%s: Integer overflow when calculating BPLIST_UNICODE data size.\n", __func__); return NULL; } if (*object + size*2 > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UNICODE data bytes point outside of valid range\n", __func__); return NULL; } return parse_unicode_node(object, size); case BPLIST_SET: case BPLIST_ARRAY: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_ARRAY data bytes point outside of valid range\n", __func__); return NULL; } return parse_array_node(bplist, object, size); case BPLIST_UID: if (*object + size+1 > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UID data bytes point outside of valid range\n", __func__); return NULL; } return parse_uid_node(object, size); case BPLIST_DICT: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_REAL data bytes point outside of valid range\n", __func__); return NULL; } return parse_dict_node(bplist, object, size); default: PLIST_BIN_ERR("%s: unexpected node type 0x%02x\n", __func__, type); return NULL; } return NULL; }
686
True
1
CVE-2017-6439
False
False
False
True
AV:L/AC:M/Au:N/C:N/I:N/A:P
LOCAL
MEDIUM
NONE
NONE
NONE
PARTIAL
1.9
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.0
MEDIUM
1.3
3.6
nan
[{'url': 'https://github.com/libimobiledevice/libplist/issues/95', 'name': 'https://github.com/libimobiledevice/libplist/issues/95', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libimobiledevice/libplist/commit/32ee5213fe64f1e10ec76c1ee861ee6f233120dd', 'name': 'https://github.com/libimobiledevice/libplist/commit/32ee5213fe64f1e10ec76c1ee861ee6f233120dd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97278', 'name': '97278', 'refsource': 'BID', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/04/msg00002.html', 'name': '[debian-lts-announce] 20200402 [SECURITY] [DLA 2168-1] libplist security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libplist_project:libplist:1.12:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Heap-based buffer overflow in the parse_string_node function in bplist.c in libimobiledevice libplist 1.12 allows local users to cause a denial of service (out-of-bounds write) via a crafted plist file.'}]
2017-04-04T01:59Z
2017-03-15T14:59Z
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
Nikias Bassen
2017-02-10 13:42:46+01:00
bplist: Fix data range check for string/data/dict/array nodes Passing a size of 0xFFFFFFFFFFFFFFFF to parse_string_node() might result in a memcpy with a size of -1, leading to undefined behavior. This commit makes sure that the actual node data (which depends on the size) is in the range start_of_object..start_of_object+size. Credit to OSS-Fuzz
32ee5213fe64f1e10ec76c1ee861ee6f233120dd
False
libimobiledevice/libplist
A library to handle Apple Property List format in binary or XML
2013-02-13 14:30:43
2022-08-24 15:22:06
https://libimobiledevice.org
libimobiledevice
413.0
253.0
parse_bin_node
parse_bin_node( struct bplist_data * bplist , const char ** object)
['bplist', 'object']
static plist_t parse_bin_node(struct bplist_data *bplist, const char** object) { uint16_t type = 0; uint64_t size = 0; if (!object) return NULL; type = (**object) & BPLIST_MASK; size = (**object) & BPLIST_FILL; (*object)++; if (size == BPLIST_FILL) { switch (type) { case BPLIST_DATA: case BPLIST_STRING: case BPLIST_UNICODE: case BPLIST_ARRAY: case BPLIST_SET: case BPLIST_DICT: { uint16_t next_size = **object & BPLIST_FILL; if ((**object & BPLIST_MASK) != BPLIST_UINT) { PLIST_BIN_ERR("%s: invalid size node type for node type 0x%02x: found 0x%02x, expected 0x%02x\n", __func__, type, **object & BPLIST_MASK, BPLIST_UINT); return NULL; } (*object)++; next_size = 1 << next_size; if (*object + next_size > bplist->offset_table) { PLIST_BIN_ERR("%s: size node data bytes for node type 0x%02x point outside of valid range\n", __func__, type); return NULL; } size = UINT_TO_HOST(*object, next_size); (*object) += next_size; break; } default: break; } } switch (type) { case BPLIST_NULL: switch (size) { case BPLIST_TRUE: { plist_data_t data = plist_new_plist_data(); data->type = PLIST_BOOLEAN; data->boolval = TRUE; data->length = 1; return node_create(NULL, data); } case BPLIST_FALSE: { plist_data_t data = plist_new_plist_data(); data->type = PLIST_BOOLEAN; data->boolval = FALSE; data->length = 1; return node_create(NULL, data); } case BPLIST_NULL: default: return NULL; } case BPLIST_UINT: if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UINT data bytes point outside of valid range\n", __func__); return NULL; } return parse_uint_node(object, size); case BPLIST_REAL: if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_REAL data bytes point outside of valid range\n", __func__); return NULL; } return parse_real_node(object, size); case BPLIST_DATE: if (3 != size) { PLIST_BIN_ERR("%s: invalid data size for BPLIST_DATE node\n", __func__); return NULL; } if (*object + (uint64_t)(1 << size) > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_DATE data bytes point outside of valid range\n", __func__); return NULL; } return parse_date_node(object, size); case BPLIST_DATA: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_DATA data bytes point outside of valid range\n", __func__); return NULL; } return parse_data_node(object, size); case BPLIST_STRING: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_STRING data bytes point outside of valid range\n", __func__); return NULL; } return parse_string_node(object, size); case BPLIST_UNICODE: if (size*2 < size) { PLIST_BIN_ERR("%s: Integer overflow when calculating BPLIST_UNICODE data size.\n", __func__); return NULL; } if (*object + size*2 > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UNICODE data bytes point outside of valid range\n", __func__); return NULL; } return parse_unicode_node(object, size); case BPLIST_SET: case BPLIST_ARRAY: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_ARRAY data bytes point outside of valid range\n", __func__); return NULL; } return parse_array_node(bplist, object, size); case BPLIST_UID: if (*object + size+1 > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_UID data bytes point outside of valid range\n", __func__); return NULL; } return parse_uid_node(object, size); case BPLIST_DICT: if (*object + size > bplist->offset_table) { PLIST_BIN_ERR("%s: BPLIST_REAL data bytes point outside of valid range\n", __func__); return NULL; } return parse_dict_node(bplist, object, size); default: PLIST_BIN_ERR("%s: unexpected node type 0x%02x\n", __func__, type); return NULL; } return NULL; }
686
True
1
CVE-2019-12439
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.0/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/projectatomic/bubblewrap/releases/tag/v0.3.3', 'name': 'https://github.com/projectatomic/bubblewrap/releases/tag/v0.3.3', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/projectatomic/bubblewrap/issues/304', 'name': 'https://github.com/projectatomic/bubblewrap/issues/304', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/projectatomic/bubblewrap/commit/efc89e3b939b4bde42c10f065f6b7b02958ed50e', 'name': 'https://github.com/projectatomic/bubblewrap/commit/efc89e3b939b4bde42c10f065f6b7b02958ed50e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1695963', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1695963', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00028.html', 'name': 'openSUSE-SU-2019:1535', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00015.html', 'name': 'openSUSE-SU-2019:1721', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:1833', 'name': 'RHSA-2019:1833', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202006-18', 'name': 'GLSA-202006-18', 'refsource': 'GENTOO', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:projectatomic:bubblewrap:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'bubblewrap.c in Bubblewrap before 0.3.3 misuses temporary directories in /tmp as a mount point. In some particular configurations (related to XDG_RUNTIME_DIR), a local attacker may abuse this flaw to prevent other users from executing bubblewrap or potentially execute code.'}]
2020-06-15T18:15Z
2019-05-29T15:29Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Simon McVittie
2019-03-02 12:09:03+00:00
Don't create our own temporary mount point for pivot_root An attacker could pre-create /tmp/.bubblewrap-$UID and make it a non-directory, non-symlink (in which case mounting our tmpfs would fail, causing denial of service), or make it a symlink under their control (potentially allowing bad things if the protected_symlinks sysctl is not enabled). Instead, temporarily mount the tmpfs on a directory that we are sure exists and is not attacker-controlled. /tmp (the directory itself, not a subdirectory) will do. Fixes: #304 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923557 Signed-off-by: Simon McVittie <[email protected]> Closes: #305 Approved by: cgwalters
efc89e3b939b4bde42c10f065f6b7b02958ed50e
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
projectatomic
visit repo url
visit repo url
main
main( int argc , char ** argv)
['argc', 'argv']
main (int argc, char **argv) { mode_t old_umask; cleanup_free char *base_path = NULL; int clone_flags; char *old_cwd = NULL; pid_t pid; int event_fd = -1; int child_wait_fd = -1; int setup_finished_pipe[] = {-1, -1}; const char *new_cwd; uid_t ns_uid; gid_t ns_gid; struct stat sbuf; uint64_t val; int res UNUSED; cleanup_free char *seccomp_data = NULL; size_t seccomp_len; struct sock_fprog seccomp_prog; cleanup_free char *args_data = NULL; /* Handle --version early on before we try to acquire/drop * any capabilities so it works in a build environment; * right now flatpak's build runs bubblewrap --version. * https://github.com/projectatomic/bubblewrap/issues/185 */ if (argc == 2 && (strcmp (argv[1], "--version") == 0)) print_version_and_exit (); real_uid = getuid (); real_gid = getgid (); /* Get the (optional) privileges we need */ acquire_privs (); /* Never gain any more privs during exec */ if (prctl (PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) die_with_error ("prctl(PR_SET_NO_NEW_CAPS) failed"); /* The initial code is run with high permissions (i.e. CAP_SYS_ADMIN), so take lots of care. */ read_overflowids (); argv0 = argv[0]; if (isatty (1)) host_tty_dev = ttyname (1); argv++; argc--; if (argc == 0) usage (EXIT_FAILURE, stderr); parse_args (&argc, (const char ***) &argv); /* suck the args into a cleanup_free variable to control their lifecycle */ args_data = opt_args_data; opt_args_data = NULL; if ((requested_caps[0] || requested_caps[1]) && is_privileged) die ("--cap-add in setuid mode can be used only by root"); if (opt_userns_block_fd != -1 && !opt_unshare_user) die ("--userns-block-fd requires --unshare-user"); if (opt_userns_block_fd != -1 && opt_info_fd == -1) die ("--userns-block-fd requires --info-fd"); /* We have to do this if we weren't installed setuid (and we're not * root), so let's just DWIM */ if (!is_privileged && getuid () != 0) opt_unshare_user = TRUE; #ifdef ENABLE_REQUIRE_USERNS /* In this build option, we require userns. */ if (is_privileged && getuid () != 0) opt_unshare_user = TRUE; #endif if (opt_unshare_user_try && stat ("/proc/self/ns/user", &sbuf) == 0) { bool disabled = FALSE; /* RHEL7 has a kernel module parameter that lets you enable user namespaces */ if (stat ("/sys/module/user_namespace/parameters/enable", &sbuf) == 0) { cleanup_free char *enable = NULL; enable = load_file_at (AT_FDCWD, "/sys/module/user_namespace/parameters/enable"); if (enable != NULL && enable[0] == 'N') disabled = TRUE; } /* Check for max_user_namespaces */ if (stat ("/proc/sys/user/max_user_namespaces", &sbuf) == 0) { cleanup_free char *max_user_ns = NULL; max_user_ns = load_file_at (AT_FDCWD, "/proc/sys/user/max_user_namespaces"); if (max_user_ns != NULL && strcmp(max_user_ns, "0\n") == 0) disabled = TRUE; } /* Debian lets you disable *unprivileged* user namespaces. However this is not a problem if we're privileged, and if we're not opt_unshare_user is TRUE already, and there is not much we can do, its just a non-working setup. */ if (!disabled) opt_unshare_user = TRUE; } if (argc == 0) usage (EXIT_FAILURE, stderr); __debug__ (("Creating root mount point\n")); if (opt_sandbox_uid == -1) opt_sandbox_uid = real_uid; if (opt_sandbox_gid == -1) opt_sandbox_gid = real_gid; if (!opt_unshare_user && opt_sandbox_uid != real_uid) die ("Specifying --uid requires --unshare-user"); if (!opt_unshare_user && opt_sandbox_gid != real_gid) die ("Specifying --gid requires --unshare-user"); if (!opt_unshare_uts && opt_sandbox_hostname != NULL) die ("Specifying --hostname requires --unshare-uts"); if (opt_as_pid_1 && !opt_unshare_pid) die ("Specifying --as-pid-1 requires --unshare-pid"); if (opt_as_pid_1 && lock_files != NULL) die ("Specifying --as-pid-1 and --lock-file is not permitted"); /* We need to read stuff from proc during the pivot_root dance, etc. Lets keep a fd to it open */ proc_fd = open ("/proc", O_PATH); if (proc_fd == -1) die_with_error ("Can't open /proc"); /* We need *some* mountpoint where we can mount the root tmpfs. We first try in /run, and if that fails, try in /tmp. */ base_path = xasprintf ("/run/user/%d/.bubblewrap", real_uid); if (ensure_dir (base_path, 0755)) { free (base_path); base_path = xasprintf ("/tmp/.bubblewrap-%d", real_uid); if (ensure_dir (base_path, 0755)) die_with_error ("Creating root mountpoint failed"); } __debug__ (("creating new namespace\n")); if (opt_unshare_pid && !opt_as_pid_1) { event_fd = eventfd (0, EFD_CLOEXEC | EFD_NONBLOCK); if (event_fd == -1) die_with_error ("eventfd()"); } /* We block sigchild here so that we can use signalfd in the monitor. */ block_sigchild (); clone_flags = SIGCHLD | CLONE_NEWNS; if (opt_unshare_user) clone_flags |= CLONE_NEWUSER; if (opt_unshare_pid) clone_flags |= CLONE_NEWPID; if (opt_unshare_net) clone_flags |= CLONE_NEWNET; if (opt_unshare_ipc) clone_flags |= CLONE_NEWIPC; if (opt_unshare_uts) clone_flags |= CLONE_NEWUTS; if (opt_unshare_cgroup) { if (stat ("/proc/self/ns/cgroup", &sbuf)) { if (errno == ENOENT) die ("Cannot create new cgroup namespace because the kernel does not support it"); else die_with_error ("stat on /proc/self/ns/cgroup failed"); } clone_flags |= CLONE_NEWCGROUP; } if (opt_unshare_cgroup_try) if (!stat ("/proc/self/ns/cgroup", &sbuf)) clone_flags |= CLONE_NEWCGROUP; child_wait_fd = eventfd (0, EFD_CLOEXEC); if (child_wait_fd == -1) die_with_error ("eventfd()"); /* Track whether pre-exec setup finished if we're reporting process exit */ if (opt_json_status_fd != -1) { int ret; ret = pipe2 (setup_finished_pipe, O_CLOEXEC); if (ret == -1) die_with_error ("pipe2()"); } pid = raw_clone (clone_flags, NULL); if (pid == -1) { if (opt_unshare_user) { if (errno == EINVAL) die ("Creating new namespace failed, likely because the kernel does not support user namespaces. bwrap must be installed setuid on such systems."); else if (errno == EPERM && !is_privileged) die ("No permissions to creating new namespace, likely because the kernel does not allow non-privileged user namespaces. On e.g. debian this can be enabled with 'sysctl kernel.unprivileged_userns_clone=1'."); } die_with_error ("Creating new namespace failed"); } ns_uid = opt_sandbox_uid; ns_gid = opt_sandbox_gid; if (pid != 0) { /* Parent, outside sandbox, privileged (initially) */ if (is_privileged && opt_unshare_user && opt_userns_block_fd == -1) { /* We're running as euid 0, but the uid we want to map is * not 0. This means we're not allowed to write this from * the child user namespace, so we do it from the parent. * * Also, we map uid/gid 0 in the namespace (to overflowuid) * if opt_needs_devpts is true, because otherwise the mount * of devpts fails due to root not being mapped. */ write_uid_gid_map (ns_uid, real_uid, ns_gid, real_gid, pid, TRUE, opt_needs_devpts); } /* Initial launched process, wait for exec:ed command to exit */ /* We don't need any privileges in the launcher, drop them immediately. */ drop_privs (FALSE); /* Optionally bind our lifecycle to that of the parent */ handle_die_with_parent (); if (opt_info_fd != -1) { cleanup_free char *output = xasprintf ("{\n \"child-pid\": %i\n}\n", pid); dump_info (opt_info_fd, output, TRUE); close (opt_info_fd); } if (opt_json_status_fd != -1) { cleanup_free char *output = xasprintf ("{ \"child-pid\": %i }\n", pid); dump_info (opt_json_status_fd, output, TRUE); } if (opt_userns_block_fd != -1) { char b[1]; (void) TEMP_FAILURE_RETRY (read (opt_userns_block_fd, b, 1)); close (opt_userns_block_fd); } /* Let child run now that the uid maps are set up */ val = 1; res = write (child_wait_fd, &val, 8); /* Ignore res, if e.g. the child died and closed child_wait_fd we don't want to error out here */ close (child_wait_fd); return monitor_child (event_fd, pid, setup_finished_pipe[0]); } /* Child, in sandbox, privileged in the parent or in the user namespace (if --unshare-user). * * Note that for user namespaces we run as euid 0 during clone(), so * the child user namespace is owned by euid 0., This means that the * regular user namespace parent (with uid != 0) doesn't have any * capabilities in it, which is nice as we can't exploit those. In * particular the parent user namespace doesn't have CAP_PTRACE * which would otherwise allow the parent to hijack of the child * after this point. * * Unfortunately this also means you can't ptrace the final * sandboxed process from outside the sandbox either. */ if (opt_info_fd != -1) close (opt_info_fd); if (opt_json_status_fd != -1) close (opt_json_status_fd); /* Wait for the parent to init uid/gid maps and drop caps */ res = read (child_wait_fd, &val, 8); close (child_wait_fd); /* At this point we can completely drop root uid, but retain the * required permitted caps. This allow us to do full setup as * the user uid, which makes e.g. fuse access work. */ switch_to_user_with_privs (); if (opt_unshare_net) loopback_setup (); /* Will exit if unsuccessful */ ns_uid = opt_sandbox_uid; ns_gid = opt_sandbox_gid; if (!is_privileged && opt_unshare_user && opt_userns_block_fd == -1) { /* In the unprivileged case we have to write the uid/gid maps in * the child, because we have no caps in the parent */ if (opt_needs_devpts) { /* This is a bit hacky, but we need to first map the real uid/gid to 0, otherwise we can't mount the devpts filesystem because root is not mapped. Later we will create another child user namespace and map back to the real uid */ ns_uid = 0; ns_gid = 0; } write_uid_gid_map (ns_uid, real_uid, ns_gid, real_gid, -1, TRUE, FALSE); } old_umask = umask (0); /* Need to do this before the chroot, but after we're the real uid */ resolve_symlinks_in_ops (); /* Mark everything as slave, so that we still * receive mounts from the real root, but don't * propagate mounts to the real root. */ if (mount (NULL, "/", NULL, MS_SLAVE | MS_REC, NULL) < 0) die_with_error ("Failed to make / slave"); /* Create a tmpfs which we will use as / in the namespace */ if (mount ("tmpfs", base_path, "tmpfs", MS_NODEV | MS_NOSUID, NULL) != 0) die_with_error ("Failed to mount tmpfs"); old_cwd = get_current_dir_name (); /* Chdir to the new root tmpfs mount. This will be the CWD during the entire setup. Access old or new root via "oldroot" and "newroot". */ if (chdir (base_path) != 0) die_with_error ("chdir base_path"); /* We create a subdir "$base_path/newroot" for the new root, that * way we can pivot_root to base_path, and put the old root at * "$base_path/oldroot". This avoids problems accessing the oldroot * dir if the user requested to bind mount something over / */ if (mkdir ("newroot", 0755)) die_with_error ("Creating newroot failed"); if (mount ("newroot", "newroot", NULL, MS_MGC_VAL | MS_BIND | MS_REC, NULL) < 0) die_with_error ("setting up newroot bind"); if (mkdir ("oldroot", 0755)) die_with_error ("Creating oldroot failed"); if (pivot_root (base_path, "oldroot")) die_with_error ("pivot_root"); if (chdir ("/") != 0) die_with_error ("chdir / (base path)"); if (is_privileged) { pid_t child; int privsep_sockets[2]; if (socketpair (AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, privsep_sockets) != 0) die_with_error ("Can't create privsep socket"); child = fork (); if (child == -1) die_with_error ("Can't fork unprivileged helper"); if (child == 0) { /* Unprivileged setup process */ drop_privs (FALSE); close (privsep_sockets[0]); setup_newroot (opt_unshare_pid, privsep_sockets[1]); exit (0); } else { int status; uint32_t buffer[2048]; /* 8k, but is int32 to guarantee nice alignment */ uint32_t op, flags; const char *arg1, *arg2; cleanup_fd int unpriv_socket = -1; unpriv_socket = privsep_sockets[0]; close (privsep_sockets[1]); do { op = read_priv_sec_op (unpriv_socket, buffer, sizeof (buffer), &flags, &arg1, &arg2); privileged_op (-1, op, flags, arg1, arg2); if (write (unpriv_socket, buffer, 1) != 1) die ("Can't write to op_socket"); } while (op != PRIV_SEP_OP_DONE); waitpid (child, &status, 0); /* Continue post setup */ } } else { setup_newroot (opt_unshare_pid, -1); } close_ops_fd (); /* The old root better be rprivate or we will send unmount events to the parent namespace */ if (mount ("oldroot", "oldroot", NULL, MS_REC | MS_PRIVATE, NULL) != 0) die_with_error ("Failed to make old root rprivate"); if (umount2 ("oldroot", MNT_DETACH)) die_with_error ("unmount old root"); /* This is our second pivot. It's like we're a Silicon Valley startup flush * with cash but short on ideas! * * We're aiming to make /newroot the real root, and get rid of /oldroot. To do * that we need a temporary place to store it before we can unmount it. */ { cleanup_fd int oldrootfd = open ("/", O_DIRECTORY | O_RDONLY); if (oldrootfd < 0) die_with_error ("can't open /"); if (chdir ("/newroot") != 0) die_with_error ("chdir /newroot"); /* While the documentation claims that put_old must be underneath * new_root, it is perfectly fine to use the same directory as the * kernel checks only if old_root is accessible from new_root. * * Both runc and LXC are using this "alternative" method for * setting up the root of the container: * * https://github.com/opencontainers/runc/blob/master/libcontainer/rootfs_linux.go#L671 * https://github.com/lxc/lxc/blob/master/src/lxc/conf.c#L1121 */ if (pivot_root (".", ".") != 0) die_with_error ("pivot_root(/newroot)"); if (fchdir (oldrootfd) < 0) die_with_error ("fchdir to oldroot"); if (umount2 (".", MNT_DETACH) < 0) die_with_error ("umount old root"); if (chdir ("/") != 0) die_with_error ("chdir /"); } if (opt_unshare_user && (ns_uid != opt_sandbox_uid || ns_gid != opt_sandbox_gid) && opt_userns_block_fd == -1) { /* Now that devpts is mounted and we've no need for mount permissions we can create a new userspace and map our uid 1:1 */ if (unshare (CLONE_NEWUSER)) die_with_error ("unshare user ns"); write_uid_gid_map (opt_sandbox_uid, ns_uid, opt_sandbox_gid, ns_gid, -1, FALSE, FALSE); } /* All privileged ops are done now, so drop caps we don't need */ drop_privs (!is_privileged); if (opt_block_fd != -1) { char b[1]; (void) TEMP_FAILURE_RETRY (read (opt_block_fd, b, 1)); close (opt_block_fd); } if (opt_seccomp_fd != -1) { seccomp_data = load_file_data (opt_seccomp_fd, &seccomp_len); if (seccomp_data == NULL) die_with_error ("Can't read seccomp data"); if (seccomp_len % 8 != 0) die ("Invalid seccomp data, must be multiple of 8"); seccomp_prog.len = seccomp_len / 8; seccomp_prog.filter = (struct sock_filter *) seccomp_data; close (opt_seccomp_fd); } umask (old_umask); new_cwd = "/"; if (opt_chdir_path) { if (chdir (opt_chdir_path)) die_with_error ("Can't chdir to %s", opt_chdir_path); new_cwd = opt_chdir_path; } else if (chdir (old_cwd) == 0) { /* If the old cwd is mapped in the sandbox, go there */ new_cwd = old_cwd; } else { /* If the old cwd is not mapped, go to home */ const char *home = getenv ("HOME"); if (home != NULL && chdir (home) == 0) new_cwd = home; } xsetenv ("PWD", new_cwd, 1); free (old_cwd); if (opt_new_session && setsid () == (pid_t) -1) die_with_error ("setsid"); if (label_exec (opt_exec_label) == -1) die_with_error ("label_exec %s", argv[0]); __debug__ (("forking for child\n")); if (!opt_as_pid_1 && (opt_unshare_pid || lock_files != NULL || opt_sync_fd != -1)) { /* We have to have a pid 1 in the pid namespace, because * otherwise we'll get a bunch of zombies as nothing reaps * them. Alternatively if we're using sync_fd or lock_files we * need some process to own these. */ pid = fork (); if (pid == -1) die_with_error ("Can't fork for pid 1"); if (pid != 0) { drop_all_caps (FALSE); /* Close fds in pid 1, except stdio and optionally event_fd (for syncing pid 2 lifetime with monitor_child) and opt_sync_fd (for syncing sandbox lifetime with outside process). Any other fds will been passed on to the child though. */ { int dont_close[3]; int j = 0; if (event_fd != -1) dont_close[j++] = event_fd; if (opt_sync_fd != -1) dont_close[j++] = opt_sync_fd; dont_close[j++] = -1; fdwalk (proc_fd, close_extra_fds, dont_close); } return do_init (event_fd, pid, seccomp_data != NULL ? &seccomp_prog : NULL); } } __debug__ (("launch executable %s\n", argv[0])); if (proc_fd != -1) close (proc_fd); /* If we are using --as-pid-1 leak the sync fd into the sandbox. --sync-fd will still work unless the container process doesn't close this file. */ if (!opt_as_pid_1) { if (opt_sync_fd != -1) close (opt_sync_fd); } /* We want sigchild in the child */ unblock_sigchild (); /* Optionally bind our lifecycle */ handle_die_with_parent (); if (!is_privileged) set_ambient_capabilities (); /* Should be the last thing before execve() so that filters don't * need to handle anything above */ if (seccomp_data != NULL && prctl (PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &seccomp_prog) != 0) die_with_error ("prctl(PR_SET_SECCOMP)"); if (setup_finished_pipe[1] != -1) { char data = 0; res = write_to_fd (setup_finished_pipe[1], &data, 1); /* Ignore res, if e.g. the parent died and closed setup_finished_pipe[0] we don't want to error out here */ } if (execvp (argv[0], argv) == -1) { if (setup_finished_pipe[1] != -1) { int saved_errno = errno; char data = 0; res = write_to_fd (setup_finished_pipe[1], &data, 1); errno = saved_errno; /* Ignore res, if e.g. the parent died and closed setup_finished_pipe[0] we don't want to error out here */ } die_with_error ("execvp %s", argv[0]); } return 0; }
2308
True
1
CVE-2017-5473
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.0/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
nan
[{'url': 'https://github.com/ntop/ntopng/commit/f91fbe3d94c8346884271838ae3406ae633f6f15', 'name': 'https://github.com/ntop/ntopng/commit/f91fbe3d94c8346884271838ae3406ae633f6f15', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ntop/ntopng/commit/1b2ceac8f578a246af6351c4f476e3102cdf21b3', 'name': 'https://github.com/ntop/ntopng/commit/1b2ceac8f578a246af6351c4f476e3102cdf21b3', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/95654', 'name': '95654', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.exploit-db.com/exploits/41141/', 'name': '41141', 'refsource': 'EXPLOIT-DB', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-352'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ntop:ntopng:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Cross-site request forgery (CSRF) vulnerability in ntopng through 2.4 allows remote attackers to hijack the authentication of arbitrary users, as demonstrated by admin/add_user.lua, admin/change_user_prefs.lua, admin/delete_user.lua, and admin/password_reset.lua.'}]
2017-09-02T01:29Z
2017-01-14T07:59Z
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
When a web server is designed to receive a request from a client without any mechanism for verifying that it was intentionally sent, then it might be possible for an attacker to trick a client into making an unintentional request to the web server which will be treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.
https://cwe.mitre.org/data/definitions/352.html
0
Luca
2017-01-12 06:45:41-08:00
Check for presence of crsf in admin scripts
f91fbe3d94c8346884271838ae3406ae633f6f15
False
ntop/ntopng
Web-based Traffic and Security Network Traffic Monitoring
2015-04-30 10:07:16
2022-08-27 16:29:35
http://www.ntop.org
ntop
4792.0
571.0
Lua::handle_script_request
Lua::handle_script_request( struct mg_connection * conn , const struct mg_request_info * request_info , char * script_path)
['conn', 'request_info', 'script_path']
int Lua::handle_script_request(struct mg_connection *conn, const struct mg_request_info *request_info, char *script_path) { char buf[64], key[64], ifname[MAX_INTERFACE_NAME_LEN]; char *_cookies, user[64] = { '\0' }, outbuf[FILENAME_MAX]; AddressTree ptree; int rc; if(!L) return(-1); luaL_openlibs(L); /* Load base libraries */ lua_register_classes(L, true); /* Load custom classes */ lua_pushlightuserdata(L, (char*)conn); lua_setglobal(L, CONST_HTTP_CONN); /* Put the GET params into the environment */ lua_newtable(L); if(request_info->query_string != NULL) { char *query_string = strdup(request_info->query_string); if(query_string) { char *where; char *tok; // ntop->getTrace()->traceEvent(TRACE_WARNING, "[HTTP] %s", query_string); tok = strtok_r(query_string, "&", &where); while(tok != NULL) { /* key=val */ char *_equal = strchr(tok, '='); if(_equal) { char *equal; int len; _equal[0] = '\0'; _equal = &_equal[1]; len = strlen(_equal); purifyHTTPParameter(tok), purifyHTTPParameter(_equal); // ntop->getTrace()->traceEvent(TRACE_WARNING, "%s = %s", tok, _equal); if((equal = (char*)malloc(len+1)) != NULL) { char *decoded_buf; Utils::urlDecode(_equal, equal, len+1); if((decoded_buf = http_decode(equal)) != NULL) { FILE *fd; Utils::purifyHTTPparam(tok, true, false); Utils::purifyHTTPparam(decoded_buf, false, false); /* Now make sure that decoded_buf is not a file path */ if((decoded_buf[0] == '.') && ((fd = fopen(decoded_buf, "r")) || (fd = fopen(realpath(decoded_buf, outbuf), "r")))) { ntop->getTrace()->traceEvent(TRACE_WARNING, "Discarded '%s'='%s' as argument is a valid file path", tok, decoded_buf); decoded_buf[0] = '\0'; fclose(fd); } /* ntop->getTrace()->traceEvent(TRACE_WARNING, "'%s'='%s'", tok, decoded_buf); */ if(strcmp(tok, "csrf") == 0) { char rsp[32], user[64] = { '\0' }; mg_get_cookie(conn, "user", user, sizeof(user)); if((ntop->getRedis()->get(decoded_buf, rsp, sizeof(rsp)) == -1) || (strcmp(rsp, user) != 0)) { const char *msg = "The submitted form is expired. Please reload the page and try again"; ntop->getTrace()->traceEvent(TRACE_WARNING, "Invalid CSRF parameter specified [%s][%s][%s][%s]: page expired?", decoded_buf, rsp, user, tok); free(equal); return(send_error(conn, 500 /* Internal server error */, msg, PAGE_ERROR, query_string, msg)); } else ntop->getRedis()->delKey(decoded_buf); } lua_push_str_table_entry(L, tok, decoded_buf); free(decoded_buf); } free(equal); } else ntop->getTrace()->traceEvent(TRACE_WARNING, "Not enough memory"); } tok = strtok_r(NULL, "&", &where); } /* while */ free(query_string); } else ntop->getTrace()->traceEvent(TRACE_WARNING, "Not enough memory"); } lua_setglobal(L, "_GET"); /* Like in php */ /* _SERVER */ lua_newtable(L); lua_push_str_table_entry(L, "HTTP_REFERER", (char*)mg_get_header(conn, "Referer")); lua_push_str_table_entry(L, "HTTP_USER_AGENT", (char*)mg_get_header(conn, "User-Agent")); lua_push_str_table_entry(L, "SERVER_NAME", (char*)mg_get_header(conn, "Host")); lua_setglobal(L, "_SERVER"); /* Like in php */ /* Cookies */ lua_newtable(L); if((_cookies = (char*)mg_get_header(conn, "Cookie")) != NULL) { char *cookies = strdup(_cookies); char *tok, *where; // ntop->getTrace()->traceEvent(TRACE_WARNING, "=> '%s'", cookies); tok = strtok_r(cookies, "=", &where); while(tok != NULL) { char *val; while(tok[0] == ' ') tok++; if((val = strtok_r(NULL, ";", &where)) != NULL) { lua_push_str_table_entry(L, tok, val); // ntop->getTrace()->traceEvent(TRACE_WARNING, "'%s'='%s'", tok, val); } else break; tok = strtok_r(NULL, "=", &where); } free(cookies); } lua_setglobal(L, "_COOKIE"); /* Like in php */ /* Put the _SESSION params into the environment */ lua_newtable(L); mg_get_cookie(conn, "user", user, sizeof(user)); lua_push_str_table_entry(L, "user", user); mg_get_cookie(conn, "session", buf, sizeof(buf)); lua_push_str_table_entry(L, "session", buf); // now it's time to set the interface. setInterface(user); lua_setglobal(L, "_SESSION"); /* Like in php */ if(user[0] != '\0') { char val[255]; lua_pushlightuserdata(L, user); lua_setglobal(L, "user"); snprintf(key, sizeof(key), "ntopng.user.%s.allowed_nets", user); if((ntop->getRedis()->get(key, val, sizeof(val)) != -1) && (val[0] != '\0')) { ptree.addAddresses(val); lua_pushlightuserdata(L, &ptree); lua_setglobal(L, CONST_ALLOWED_NETS); // ntop->getTrace()->traceEvent(TRACE_WARNING, "SET %p", ptree); } snprintf(key, sizeof(key), CONST_STR_USER_ALLOWED_IFNAME, user); if(snprintf(key, sizeof(key), CONST_STR_USER_ALLOWED_IFNAME, user) && !ntop->getRedis()->get(key, ifname, sizeof(ifname))) { lua_pushlightuserdata(L, ifname); lua_setglobal(L, CONST_ALLOWED_IFNAME); } } #ifndef NTOPNG_PRO rc = luaL_dofile(L, script_path); #else if(ntop->getPro()->has_valid_license()) rc = __ntop_lua_handlefile(L, script_path, true); else rc = luaL_dofile(L, script_path); #endif if(rc != 0) { const char *err = lua_tostring(L, -1); ntop->getTrace()->traceEvent(TRACE_WARNING, "Script failure [%s][%s]", script_path, err); return(send_error(conn, 500 /* Internal server error */, "Internal server error", PAGE_ERROR, script_path, err)); } return(CONST_LUA_OK); }
1116
True
1
CVE-2017-7458
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
nan
[{'url': 'https://github.com/ntop/ntopng/commit/01f47e04fd7c8d54399c9e465f823f0017069f8f', 'name': 'https://github.com/ntop/ntopng/commit/01f47e04fd7c8d54399c9e465f823f0017069f8f', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Release Notes', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ntop/ntopng/blob/3.0/CHANGELOG.md', 'name': 'https://github.com/ntop/ntopng/blob/3.0/CHANGELOG.md', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ntop:ntopng:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The NetworkInterface::getHost function in NetworkInterface.cpp in ntopng before 3.0 allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via an empty field that should have contained a hostname or IP address.'}]
2017-06-29T15:31Z
2017-06-26T23:29Z
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
Simone Mainardi
2017-02-13 23:47:02+01:00
Security fix: prevents empty host from being used
01f47e04fd7c8d54399c9e465f823f0017069f8f
False
ntop/ntopng
Web-based Traffic and Security Network Traffic Monitoring
2015-04-30 10:07:16
2022-08-27 16:29:35
http://www.ntop.org
ntop
4792.0
571.0
Lua::setParamsTable
Lua::setParamsTable( lua_State * vm , const char * table_name , const char * query) const
['vm', 'table_name', 'query']
void Lua::setParamsTable(lua_State* vm, const char* table_name, const char* query) const { char outbuf[FILENAME_MAX]; char *where; char *tok; char *query_string = query ? strdup(query) : NULL; lua_newtable(L); if (query_string) { // ntop->getTrace()->traceEvent(TRACE_WARNING, "[HTTP] %s", query_string); tok = strtok_r(query_string, "&", &where); while(tok != NULL) { char *_equal; if(strncmp(tok, "csrf", strlen("csrf")) /* Do not put csrf into the params table */ && (_equal = strchr(tok, '='))) { char *decoded_buf; int len; _equal[0] = '\0'; _equal = &_equal[1]; len = strlen(_equal); purifyHTTPParameter(tok), purifyHTTPParameter(_equal); // ntop->getTrace()->traceEvent(TRACE_WARNING, "%s = %s", tok, _equal); if((decoded_buf = (char*)malloc(len+1)) != NULL) { Utils::urlDecode(_equal, decoded_buf, len+1); Utils::purifyHTTPparam(tok, true, false); Utils::purifyHTTPparam(decoded_buf, false, false); /* Now make sure that decoded_buf is not a file path */ FILE *fd; if((decoded_buf[0] == '.') && ((fd = fopen(decoded_buf, "r")) || (fd = fopen(realpath(decoded_buf, outbuf), "r")))) { ntop->getTrace()->traceEvent(TRACE_WARNING, "Discarded '%s'='%s' as argument is a valid file path", tok, decoded_buf); decoded_buf[0] = '\0'; fclose(fd); } /* ntop->getTrace()->traceEvent(TRACE_WARNING, "'%s'='%s'", tok, decoded_buf); */ /* put tok and the decoded buffer in to the table */ lua_push_str_table_entry(vm, tok, decoded_buf); free(decoded_buf); } else ntop->getTrace()->traceEvent(TRACE_WARNING, "Not enough memory"); } tok = strtok_r(NULL, "&", &where); } /* while */ } if(query_string) free(query_string); if(table_name) lua_setglobal(L, table_name); else lua_setglobal(L, (char*)"_GET"); /* Default */ }
352
True
1
CVE-2017-5592
False
False
False
False
AV:N/AC:M/Au:N/C:N/I:P/A:N
NETWORK
MEDIUM
NONE
NONE
PARTIAL
NONE
4.3
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
HIGH
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
5.9
MEDIUM
2.2
3.6
nan
[{'url': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'name': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'name': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'name': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'name': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96173', 'name': '96173', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-346'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:-:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An incorrect implementation of "XEP-0280: Message Carbons" in multiple XMPP clients allows a remote attacker to impersonate any user, including contacts, in the vulnerable application\'s display. This allows for various kinds of social engineering attacks. This CVE is for profanity (0.4.7 - 0.5.0).'}]
2020-01-23T18:29Z
2017-02-09T20:59Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
James Booth
2017-01-23 22:25:36+00:00
Add carbons from check
8e75437a7e43d4c55e861691f74892e666e29b0b
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
boothj5
visit repo url
visit repo url
_handle_carbons
_handle_carbons( xmpp_stanza_t * const stanza)
['stanza']
_handle_carbons(xmpp_stanza_t *const stanza) { xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS); if (!carbons) { return FALSE; } const char *name = xmpp_stanza_get_name(carbons); if (!name) { log_error("Unable to retrieve stanza name for Carbon"); return TRUE; } if (g_strcmp0(name, "private") == 0) { log_info("Carbon received with private element."); return FALSE; } if ((g_strcmp0(name, "received") != 0) && (g_strcmp0(name, "sent") != 0)) { log_warning("Carbon received with unrecognised stanza name: %s", name); return TRUE; } xmpp_stanza_t *forwarded = xmpp_stanza_get_child_by_ns(carbons, STANZA_NS_FORWARD); if (!forwarded) { log_warning("Carbon received with no forwarded element"); return TRUE; } xmpp_stanza_t *message = xmpp_stanza_get_child_by_name(forwarded, STANZA_NAME_MESSAGE); if (!message) { log_warning("Carbon received with no message element"); return TRUE; } char *message_txt = xmpp_message_get_body(message); if (!message_txt) { log_warning("Carbon received with no message."); return TRUE; } const gchar *to = xmpp_stanza_get_to(message); const gchar *from = xmpp_stanza_get_from(message); // happens when receive a carbon of a self sent message if (!to) to = from; Jid *jid_from = jid_create(from); Jid *jid_to = jid_create(to); Jid *my_jid = jid_create(connection_get_fulljid()); // check for pgp encrypted message char *enc_message = NULL; xmpp_stanza_t *x = xmpp_stanza_get_child_by_ns(message, STANZA_NS_ENCRYPTED); if (x) { enc_message = xmpp_stanza_get_text(x); } // if we are the recipient, treat as standard incoming message if (g_strcmp0(my_jid->barejid, jid_to->barejid) == 0) { sv_ev_incoming_carbon(jid_from->barejid, jid_from->resourcepart, message_txt, enc_message); // else treat as a sent message } else { sv_ev_outgoing_carbon(jid_to->barejid, message_txt, enc_message); } xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_free(ctx, message_txt); xmpp_free(ctx, enc_message); jid_destroy(jid_from); jid_destroy(jid_to); jid_destroy(my_jid); return TRUE; }
362
True
1
CVE-2017-5592
False
False
False
False
AV:N/AC:M/Au:N/C:N/I:P/A:N
NETWORK
MEDIUM
NONE
NONE
PARTIAL
NONE
4.3
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
HIGH
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
5.9
MEDIUM
2.2
3.6
nan
[{'url': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'name': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'name': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'name': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'name': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96173', 'name': '96173', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-346'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:-:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An incorrect implementation of "XEP-0280: Message Carbons" in multiple XMPP clients allows a remote attacker to impersonate any user, including contacts, in the vulnerable application\'s display. This allows for various kinds of social engineering attacks. This CVE is for profanity (0.4.7 - 0.5.0).'}]
2020-01-23T18:29Z
2017-02-09T20:59Z
Origin Validation Error
The software does not properly verify that the source of data or communication is valid.
https://cwe.mitre.org/data/definitions/346.html
0
James Booth
2017-01-23 22:25:36+00:00
Add carbons from check
8e75437a7e43d4c55e861691f74892e666e29b0b
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
boothj5
visit repo url
visit repo url
_handle_carbons
_handle_carbons( xmpp_stanza_t * const stanza)
['stanza']
_handle_carbons(xmpp_stanza_t *const stanza) { xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS); if (!carbons) { return FALSE; } const char *name = xmpp_stanza_get_name(carbons); if (!name) { log_error("Unable to retrieve stanza name for Carbon"); return TRUE; } if (g_strcmp0(name, "private") == 0) { log_info("Carbon received with private element."); return FALSE; } if ((g_strcmp0(name, "received") != 0) && (g_strcmp0(name, "sent") != 0)) { log_warning("Carbon received with unrecognised stanza name: %s", name); return TRUE; } xmpp_stanza_t *forwarded = xmpp_stanza_get_child_by_ns(carbons, STANZA_NS_FORWARD); if (!forwarded) { log_warning("Carbon received with no forwarded element"); return TRUE; } xmpp_stanza_t *message = xmpp_stanza_get_child_by_name(forwarded, STANZA_NAME_MESSAGE); if (!message) { log_warning("Carbon received with no message element"); return TRUE; } char *message_txt = xmpp_message_get_body(message); if (!message_txt) { log_warning("Carbon received with no message."); return TRUE; } const gchar *to = xmpp_stanza_get_to(message); const gchar *from = xmpp_stanza_get_from(message); // happens when receive a carbon of a self sent message if (!to) to = from; Jid *jid_from = jid_create(from); Jid *jid_to = jid_create(to); Jid *my_jid = jid_create(connection_get_fulljid()); // check for pgp encrypted message char *enc_message = NULL; xmpp_stanza_t *x = xmpp_stanza_get_child_by_ns(message, STANZA_NS_ENCRYPTED); if (x) { enc_message = xmpp_stanza_get_text(x); } // if we are the recipient, treat as standard incoming message if (g_strcmp0(my_jid->barejid, jid_to->barejid) == 0) { sv_ev_incoming_carbon(jid_from->barejid, jid_from->resourcepart, message_txt, enc_message); // else treat as a sent message } else { sv_ev_outgoing_carbon(jid_to->barejid, message_txt, enc_message); } xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_free(ctx, message_txt); xmpp_free(ctx, enc_message); jid_destroy(jid_from); jid_destroy(jid_to); jid_destroy(my_jid); return TRUE; }
362
True
1
CVE-2017-5592
False
False
False
False
AV:N/AC:M/Au:N/C:N/I:P/A:N
NETWORK
MEDIUM
NONE
NONE
PARTIAL
NONE
4.3
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
HIGH
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
5.9
MEDIUM
2.2
3.6
nan
[{'url': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'name': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'name': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'name': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'name': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96173', 'name': '96173', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-346'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:-:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An incorrect implementation of "XEP-0280: Message Carbons" in multiple XMPP clients allows a remote attacker to impersonate any user, including contacts, in the vulnerable application\'s display. This allows for various kinds of social engineering attacks. This CVE is for profanity (0.4.7 - 0.5.0).'}]
2020-01-23T18:29Z
2017-02-09T20:59Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
James Booth
2017-01-23 22:25:36+00:00
Add carbons from check
8e75437a7e43d4c55e861691f74892e666e29b0b
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
boothj5
visit repo url
visit repo url
receive_carbon
receive_carbon( void ** state)
['state']
receive_carbon(void **state) { prof_input("/carbons on"); prof_connect(); assert_true(stbbr_received( "<iq id='*' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>" )); stbbr_send( "<presence to='stabber@localhost' from='buddy1@localhost/mobile'>" "<priority>10</priority>" "<status>On my mobile</status>" "</presence>" ); assert_true(prof_output_exact("Buddy1 (mobile) is online, \"On my mobile\"")); prof_input("/msg Buddy1"); assert_true(prof_output_exact("unencrypted")); stbbr_send( "<message type='chat' to='stabber@localhost/profanity' from='buddy1@localhost'>" "<received xmlns='urn:xmpp:carbons:2'>" "<forwarded xmlns='urn:xmpp:forward:0'>" "<message id='prof_msg_7' xmlns='jabber:client' type='chat' lang='en' to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>" "<body>test carbon from recipient</body>" "</message>" "</forwarded>" "</received>" "</message>" ); assert_true(prof_output_regex("Buddy1/mobile: .+test carbon from recipient")); }
75
True
1
CVE-2017-5592
False
False
False
False
AV:N/AC:M/Au:N/C:N/I:P/A:N
NETWORK
MEDIUM
NONE
NONE
PARTIAL
NONE
4.3
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
NETWORK
HIGH
NONE
NONE
UNCHANGED
NONE
HIGH
NONE
5.9
MEDIUM
2.2
3.6
nan
[{'url': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'name': 'https://rt-solutions.de/wp-content/uploads/2017/02/CVE-2017-5589_xmpp_carbons.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'name': 'https://rt-solutions.de/en/2017/02/CVE-2017-5589_xmpp_carbons/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'name': 'https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'name': 'http://openwall.com/lists/oss-security/2017/02/09/29', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96173', 'name': '96173', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-346'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:cyg3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.4.7:patch1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:profanity_project:profanity:0.5.0:-:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An incorrect implementation of "XEP-0280: Message Carbons" in multiple XMPP clients allows a remote attacker to impersonate any user, including contacts, in the vulnerable application\'s display. This allows for various kinds of social engineering attacks. This CVE is for profanity (0.4.7 - 0.5.0).'}]
2020-01-23T18:29Z
2017-02-09T20:59Z
Origin Validation Error
The software does not properly verify that the source of data or communication is valid.
https://cwe.mitre.org/data/definitions/346.html
0
James Booth
2017-01-23 22:25:36+00:00
Add carbons from check
8e75437a7e43d4c55e861691f74892e666e29b0b
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
boothj5
visit repo url
visit repo url
receive_carbon
receive_carbon( void ** state)
['state']
receive_carbon(void **state) { prof_input("/carbons on"); prof_connect(); assert_true(stbbr_received( "<iq id='*' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>" )); stbbr_send( "<presence to='stabber@localhost' from='buddy1@localhost/mobile'>" "<priority>10</priority>" "<status>On my mobile</status>" "</presence>" ); assert_true(prof_output_exact("Buddy1 (mobile) is online, \"On my mobile\"")); prof_input("/msg Buddy1"); assert_true(prof_output_exact("unencrypted")); stbbr_send( "<message type='chat' to='stabber@localhost/profanity' from='buddy1@localhost'>" "<received xmlns='urn:xmpp:carbons:2'>" "<forwarded xmlns='urn:xmpp:forward:0'>" "<message id='prof_msg_7' xmlns='jabber:client' type='chat' lang='en' to='stabber@localhost/profanity' from='buddy1@localhost/mobile'>" "<body>test carbon from recipient</body>" "</message>" "</forwarded>" "</received>" "</message>" ); assert_true(prof_output_regex("Buddy1/mobile: .+test carbon from recipient")); }
75
True
1
CVE-2017-5847
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
nan
[{'url': 'https://github.com/GStreamer/gst-plugins-ugly/commit/d21017b52a585f145e8d62781bcc1c5fefc7ee37', 'name': 'https://github.com/GStreamer/gst-plugins-ugly/commit/d21017b52a585f145e8d62781bcc1c5fefc7ee37', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.gnome.org/show_bug.cgi?id=777955#c3', 'name': 'https://bugzilla.gnome.org/show_bug.cgi?id=777955#c3', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96001', 'name': '96001', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2017/02/02/9', 'name': '[oss-security] 20170202 Re: Multiple memory access issues in gstreamer', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2017/02/01/7', 'name': '[oss-security] 20170201 Multiple memory access issues in gstreamer', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201705-10', 'name': 'GLSA-201705-10', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3821', 'name': 'DSA-3821', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/05/msg00030.html', 'name': '[debian-lts-announce] 20200530 [SECURITY] [DLA 2226-1] gst-plugins-ugly0.10 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gstreamer_project:gstreamer:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.11.2', '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': 'The gst_asf_demux_process_ext_content_desc function in gst/asfdemux/gstasfdemux.c in gst-plugins-ugly in GStreamer allows remote attackers to cause a denial of service (out-of-bounds heap read) via vectors involving extended content descriptors.'}]
2020-11-20T19:01Z
2017-02-09T15:59Z
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 Dröge
2017-01-31 13:50:21+02:00
asfdemux: Check that we have enough data available before parsing bool/uint extended content descriptors https://bugzilla.gnome.org/show_bug.cgi?id=777955
d21017b52a585f145e8d62781bcc1c5fefc7ee37
False
GStreamer/gst-plugins-ugly
'Ugly' GStreamer plugins and helper libraries. This module has been merged into the main GStreamer repo for further development.
2015-12-01 21:48:51
2018-08-18 20:32:04
GStreamer
26.0
32.0
gst_asf_demux_process_ext_content_desc
gst_asf_demux_process_ext_content_desc( GstASFDemux * demux , guint8 * data , guint64 size)
['demux', 'data', 'size']
gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data, guint64 size) { /* Other known (and unused) 'text/unicode' metadata available : * * WM/Lyrics = * WM/MediaPrimaryClassID = {D1607DBC-E323-4BE2-86A1-48A42A28441E} * WMFSDKVersion = 9.00.00.2980 * WMFSDKNeeded = 0.0.0.0000 * WM/UniqueFileIdentifier = AMGa_id=R 15334;AMGp_id=P 5149;AMGt_id=T 2324984 * WM/Publisher = 4AD * WM/Provider = AMG * WM/ProviderRating = 8 * WM/ProviderStyle = Rock (similar to WM/Genre) * WM/GenreID (similar to WM/Genre) * WM/TrackNumber (same as WM/Track but as a string) * * Other known (and unused) 'non-text' metadata available : * * WM/EncodingTime * WM/MCDI * IsVBR * * We might want to read WM/TrackNumber and use atoi() if we don't have * WM/Track */ GstTagList *taglist; guint16 blockcount, i; gboolean content3D = FALSE; struct { const gchar *interleave_name; GstASF3DMode interleaving_type; } stereoscopic_layout_map[] = { { "SideBySideRF", GST_ASF_3D_SIDE_BY_SIDE_HALF_RL}, { "SideBySideLF", GST_ASF_3D_SIDE_BY_SIDE_HALF_LR}, { "OverUnderRT", GST_ASF_3D_TOP_AND_BOTTOM_HALF_RL}, { "OverUnderLT", GST_ASF_3D_TOP_AND_BOTTOM_HALF_LR}, { "DualStream", GST_ASF_3D_DUAL_STREAM} }; GST_INFO_OBJECT (demux, "object is an extended content description"); taglist = gst_tag_list_new_empty (); /* Content Descriptor Count */ if (size < 2) goto not_enough_data; blockcount = gst_asf_demux_get_uint16 (&data, &size); for (i = 1; i <= blockcount; ++i) { const gchar *gst_tag_name; guint16 datatype; guint16 value_len; guint16 name_len; GValue tag_value = { 0, }; gsize in, out; gchar *name; gchar *name_utf8 = NULL; gchar *value; /* Descriptor */ if (!gst_asf_demux_get_string (&name, &name_len, &data, &size)) goto not_enough_data; if (size < 2) { g_free (name); goto not_enough_data; } /* Descriptor Value Data Type */ datatype = gst_asf_demux_get_uint16 (&data, &size); /* Descriptor Value (not really a string, but same thing reading-wise) */ if (!gst_asf_demux_get_string (&value, &value_len, &data, &size)) { g_free (name); goto not_enough_data; } name_utf8 = g_convert (name, name_len, "UTF-8", "UTF-16LE", &in, &out, NULL); if (name_utf8 != NULL) { GST_DEBUG ("Found tag/metadata %s", name_utf8); gst_tag_name = gst_asf_demux_get_gst_tag_from_tag_name (name_utf8); GST_DEBUG ("gst_tag_name %s", GST_STR_NULL (gst_tag_name)); switch (datatype) { case ASF_DEMUX_DATA_TYPE_UTF16LE_STRING:{ gchar *value_utf8; value_utf8 = g_convert (value, value_len, "UTF-8", "UTF-16LE", &in, &out, NULL); /* get rid of tags with empty value */ if (value_utf8 != NULL && *value_utf8 != '\0') { GST_DEBUG ("string value %s", value_utf8); value_utf8[out] = '\0'; if (gst_tag_name != NULL) { if (strcmp (gst_tag_name, GST_TAG_DATE_TIME) == 0) { guint year = atoi (value_utf8); if (year > 0) { g_value_init (&tag_value, GST_TYPE_DATE_TIME); g_value_take_boxed (&tag_value, gst_date_time_new_y (year)); } } else if (strcmp (gst_tag_name, GST_TAG_GENRE) == 0) { guint id3v1_genre_id; const gchar *genre_str; if (sscanf (value_utf8, "(%u)", &id3v1_genre_id) == 1 && ((genre_str = gst_tag_id3_genre_get (id3v1_genre_id)))) { GST_DEBUG ("Genre: %s -> %s", value_utf8, genre_str); g_free (value_utf8); value_utf8 = g_strdup (genre_str); } } else { GType tag_type; /* convert tag from string to other type if required */ tag_type = gst_tag_get_type (gst_tag_name); g_value_init (&tag_value, tag_type); if (!gst_value_deserialize (&tag_value, value_utf8)) { GValue from_val = { 0, }; g_value_init (&from_val, G_TYPE_STRING); g_value_set_string (&from_val, value_utf8); if (!g_value_transform (&from_val, &tag_value)) { GST_WARNING_OBJECT (demux, "Could not transform string tag to " "%s tag type %s", gst_tag_name, g_type_name (tag_type)); g_value_unset (&tag_value); } g_value_unset (&from_val); } } } else { /* metadata ! */ GST_DEBUG ("Setting metadata"); g_value_init (&tag_value, G_TYPE_STRING); g_value_set_string (&tag_value, value_utf8); /* If we found a stereoscopic marker, look for StereoscopicLayout * metadata */ if (content3D) { guint i; if (strncmp ("StereoscopicLayout", name_utf8, strlen (name_utf8)) == 0) { for (i = 0; i < G_N_ELEMENTS (stereoscopic_layout_map); i++) { if (g_str_equal (stereoscopic_layout_map[i].interleave_name, value_utf8)) { demux->asf_3D_mode = stereoscopic_layout_map[i].interleaving_type; GST_INFO ("find interleave type %u", demux->asf_3D_mode); } } } GST_INFO_OBJECT (demux, "3d type is %u", demux->asf_3D_mode); } else { demux->asf_3D_mode = GST_ASF_3D_NONE; GST_INFO_OBJECT (demux, "None 3d type"); } } } else if (value_utf8 == NULL) { GST_WARNING ("Failed to convert string value to UTF8, skipping"); } else { GST_DEBUG ("Skipping empty string value for %s", GST_STR_NULL (gst_tag_name)); } g_free (value_utf8); break; } case ASF_DEMUX_DATA_TYPE_BYTE_ARRAY:{ if (gst_tag_name) { if (!g_str_equal (gst_tag_name, GST_TAG_IMAGE)) { GST_FIXME ("Unhandled byte array tag %s", GST_STR_NULL (gst_tag_name)); break; } else { asf_demux_parse_picture_tag (taglist, (guint8 *) value, value_len); } } break; } case ASF_DEMUX_DATA_TYPE_DWORD:{ guint uint_val = GST_READ_UINT32_LE (value); /* this is the track number */ g_value_init (&tag_value, G_TYPE_UINT); /* WM/Track counts from 0 */ if (!strcmp (name_utf8, "WM/Track")) ++uint_val; g_value_set_uint (&tag_value, uint_val); break; } /* Detect 3D */ case ASF_DEMUX_DATA_TYPE_BOOL:{ gboolean bool_val = GST_READ_UINT32_LE (value); if (strncmp ("Stereoscopic", name_utf8, strlen (name_utf8)) == 0) { if (bool_val) { GST_INFO_OBJECT (demux, "This is 3D contents"); content3D = TRUE; } else { GST_INFO_OBJECT (demux, "This is not 3D contenst"); content3D = FALSE; } } break; } default:{ GST_DEBUG ("Skipping tag %s of type %d", gst_tag_name, datatype); break; } } if (G_IS_VALUE (&tag_value)) { if (gst_tag_name) { GstTagMergeMode merge_mode = GST_TAG_MERGE_APPEND; /* WM/TrackNumber is more reliable than WM/Track, since the latter * is supposed to have a 0 base but is often wrongly written to start * from 1 as well, so prefer WM/TrackNumber when we have it: either * replace the value added earlier from WM/Track or put it first in * the list, so that it will get picked up by _get_uint() */ if (strcmp (name_utf8, "WM/TrackNumber") == 0) merge_mode = GST_TAG_MERGE_REPLACE; gst_tag_list_add_values (taglist, merge_mode, gst_tag_name, &tag_value, NULL); } else { GST_DEBUG ("Setting global metadata %s", name_utf8); gst_structure_set_value (demux->global_metadata, name_utf8, &tag_value); } g_value_unset (&tag_value); } } g_free (name); g_free (value); g_free (name_utf8); } gst_asf_demux_add_global_tags (demux, taglist); return GST_FLOW_OK; /* Errors */ not_enough_data: { GST_WARNING ("Unexpected end of data parsing ext content desc object"); gst_tag_list_unref (taglist); return GST_FLOW_OK; /* not really fatal */ } }
1044
True
1
CVE-2017-6059
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
nan
[{'url': 'https://github.com/pingidentity/mod_auth_openidc/releases/tag/v2.1.4', 'name': 'https://github.com/pingidentity/mod_auth_openidc/releases/tag/v2.1.4', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/pingidentity/mod_auth_openidc/issues/212', 'name': 'https://github.com/pingidentity/mod_auth_openidc/issues/212', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/pingidentity/mod_auth_openidc/commit/612e309bfffd6f9b8ad7cdccda3019fc0865f3b4', 'name': 'https://github.com/pingidentity/mod_auth_openidc/commit/612e309bfffd6f9b8ad7cdccda3019fc0865f3b4', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96299', 'name': '96299', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2017/02/17/6', 'name': '[oss-security] 20170217 OpenID Connect authentication module for Apache: CVE-2017-6059 CVE-2017-6062', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2112', 'name': 'RHSA-2019:2112', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EJXBG3DG2FUYFGTUTSJFMPIINVFKKB4Z/', 'name': 'FEDORA-2019-7b06f18a10', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/2V3HIGXMUKJGOBMAQAQPGC7G5YYWSUVA/', 'name': 'FEDORA-2019-23638d42f3', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/WTWUMQ46GZY3O4WU4JCF333LN53R2XQH/', 'name': 'FEDORA-2019-a25d5df3b4', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zmartzone:mod_auth_openidc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.1.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Mod_auth_openidc.c in the Ping Identity OpenID Connect authentication module for Apache (aka mod_auth_openidc) before 2.14 allows remote attackers to spoof page content via a malicious URL provided to the user, which triggers an invalid request.'}]
2020-06-16T15:23Z
2017-04-12T20:59Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Hans Zandbelt
2017-01-19 00:03:37+01:00
don't echo query params on invalid requests to redirect URI; closes #212 thanks @LukasReschke; I'm sure there's some OWASP guideline that warns against this
612e309bfffd6f9b8ad7cdccda3019fc0865f3b4
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
pingidentity
visit repo url
visit repo url
oidc_handle_redirect_uri_request
oidc_handle_redirect_uri_request( request_rec * r , oidc_cfg * c , oidc_session_t * session)
['r', 'c', 'session']
int oidc_handle_redirect_uri_request(request_rec *r, oidc_cfg *c, oidc_session_t *session) { if (oidc_proto_is_redirect_authorization_response(r, c)) { /* this is an authorization response from the OP using the Basic Client profile or a Hybrid flow*/ return oidc_handle_redirect_authorization_response(r, c, session); } else if (oidc_proto_is_post_authorization_response(r, c)) { /* this is an authorization response using the fragment(+POST) response_mode with the Implicit Client profile */ return oidc_handle_post_authorization_response(r, c, session); } else if (oidc_is_discovery_response(r, c)) { /* this is response from the OP discovery page */ return oidc_handle_discovery_response(r, c); } else if (oidc_util_request_has_parameter(r, "logout")) { /* handle logout */ return oidc_handle_logout(r, c, session); } else if (oidc_util_request_has_parameter(r, "jwks")) { /* handle JWKs request */ return oidc_handle_jwks(r, c); } else if (oidc_util_request_has_parameter(r, "session")) { /* handle session management request */ return oidc_handle_session_management(r, c, session); } else if (oidc_util_request_has_parameter(r, "refresh")) { /* handle refresh token request */ return oidc_handle_refresh_token_request(r, c, session); } else if (oidc_util_request_has_parameter(r, "request_uri")) { /* handle request object by reference request */ return oidc_handle_request_uri(r, c); } else if (oidc_util_request_has_parameter(r, "remove_at_cache")) { /* handle request to invalidate access token cache */ return oidc_handle_remove_at_cache(r, c); } else if ((r->args == NULL) || (apr_strnatcmp(r->args, "") == 0)) { /* this is a "bare" request to the redirect URI, indicating implicit flow using the fragment response_mode */ return oidc_proto_javascript_implicit(r, c); } /* this is not an authorization response or logout request */ /* check for "error" response */ if (oidc_util_request_has_parameter(r, "error")) { // char *error = NULL, *descr = NULL; // oidc_util_get_request_parameter(r, "error", &error); // oidc_util_get_request_parameter(r, "error_description", &descr); // // /* send user facing error to browser */ // return oidc_util_html_send_error(r, error, descr, DONE); oidc_handle_redirect_authorization_response(r, c, session); } /* something went wrong */ return oidc_util_html_send_error(r, c->error_template, "Invalid Request", apr_psprintf(r->pool, "The OpenID Connect callback URL received an invalid request: %s", r->args), HTTP_INTERNAL_SERVER_ERROR); }
286
True
1
CVE-2017-6413
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.0/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
NETWORK
LOW
NONE
NONE
CHANGED
NONE
HIGH
NONE
8.6
HIGH
3.9
4.0
nan
[{'url': 'https://github.com/pingidentity/mod_auth_openidc/releases/tag/v2.1.6', 'name': 'https://github.com/pingidentity/mod_auth_openidc/releases/tag/v2.1.6', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/pingidentity/mod_auth_openidc/commit/21e3728a825c41ab41efa75e664108051bb9665e', 'name': 'https://github.com/pingidentity/mod_auth_openidc/commit/21e3728a825c41ab41efa75e664108051bb9665e', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/pingidentity/mod_auth_openidc/blob/master/ChangeLog', 'name': 'https://github.com/pingidentity/mod_auth_openidc/blob/master/ChangeLog', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96549', 'name': '96549', 'refsource': 'BID', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2112', 'name': 'RHSA-2019:2112', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EJXBG3DG2FUYFGTUTSJFMPIINVFKKB4Z/', 'name': 'FEDORA-2019-7b06f18a10', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/2V3HIGXMUKJGOBMAQAQPGC7G5YYWSUVA/', 'name': 'FEDORA-2019-23638d42f3', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/WTWUMQ46GZY3O4WU4JCF333LN53R2XQH/', 'name': 'FEDORA-2019-a25d5df3b4', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-287'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pingidentity:mod_auth_openidc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.1.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The "OpenID Connect Relying Party and OAuth 2.0 Resource Server" (aka mod_auth_openidc) module before 2.1.6 for the Apache HTTP Server does not skip OIDC_CLAIM_ and OIDCAuthNHeader headers in an "AuthType oauth20" configuration, which allows remote attackers to bypass authentication via crafted HTTP traffic.'}]
2017-03-07T02:59Z
2017-03-02T06:59Z
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
0
Hans Zandbelt
2017-02-20 17:31:54+01:00
release 2.1.6 : security fix: scrub headers for "AuthType oauth20" Signed-off-by: Hans Zandbelt <[email protected]>
21e3728a825c41ab41efa75e664108051bb9665e
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
pingidentity
visit repo url
visit repo url
oidc_scrub_headers
oidc_scrub_headers( request_rec * r)
['r']
static void oidc_scrub_headers(request_rec *r) { oidc_cfg *cfg = ap_get_module_config(r->server->module_config, &auth_openidc_module); if (cfg->scrub_request_headers != 0) { /* scrub all headers starting with OIDC_ first */ oidc_scrub_request_headers(r, OIDC_DEFAULT_HEADER_PREFIX, oidc_cfg_dir_authn_header(r)); /* * then see if the claim headers need to be removed on top of that * (i.e. the prefix does not start with the default OIDC_) */ if ((strstr(cfg->claim_prefix, OIDC_DEFAULT_HEADER_PREFIX) != cfg->claim_prefix)) { oidc_scrub_request_headers(r, cfg->claim_prefix, NULL); } } }
76
True
1
CVE-2017-6308
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'name': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Several Integer Overflows, which can lead to Heap Overflows, have been identified in the functions that wrap memory allocation.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-17 09:43:21+01:00
Fix integer overflows and harden memory allocator.
c5044689e50039635e7700fe2472fd632ac77176
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
alloc_limit_assert
alloc_limit_assert( char * fn_name , size_t size)
['fn_name', 'size']
alloc_limit_assert (char *fn_name, size_t size) { if (alloc_limit && size > alloc_limit) { alloc_limit_failure (fn_name, size); exit (-1); } }
34
True
1
CVE-2017-6308
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'name': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Several Integer Overflows, which can lead to Heap Overflows, have been identified in the functions that wrap memory allocation.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-17 09:43:21+01:00
Fix integer overflows and harden memory allocator.
c5044689e50039635e7700fe2472fd632ac77176
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
alloc_limit_failure
alloc_limit_failure( char * fn_name , size_t size)
['fn_name', 'size']
alloc_limit_failure (char *fn_name, size_t size) { fprintf (stderr, "%s: Maximum allocation size exceeded " "(maxsize = %lu; size = %lu).\n", fn_name, (unsigned long)alloc_limit, (unsigned long)size); }
33
True
1
CVE-2017-6308
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'name': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Several Integer Overflows, which can lead to Heap Overflows, have been identified in the functions that wrap memory allocation.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-17 09:43:21+01:00
Fix integer overflows and harden memory allocator.
c5044689e50039635e7700fe2472fd632ac77176
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
checked_xcalloc
checked_xcalloc( size_t num , size_t size)
['num', 'size']
checked_xcalloc (size_t num, size_t size) { alloc_limit_assert ("checked_xcalloc", (num *size)); return xcalloc (num, size); }
29
True
1
CVE-2017-6308
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'name': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Several Integer Overflows, which can lead to Heap Overflows, have been identified in the functions that wrap memory allocation.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-17 09:43:21+01:00
Fix integer overflows and harden memory allocator.
c5044689e50039635e7700fe2472fd632ac77176
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
checked_xmalloc
checked_xmalloc( size_t size)
['size']
checked_xmalloc (size_t size) { alloc_limit_assert ("checked_xmalloc", size); return xmalloc (size); }
20
True
1
CVE-2017-6308
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'name': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Several Integer Overflows, which can lead to Heap Overflows, have been identified in the functions that wrap memory allocation.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-17 09:43:21+01:00
Fix integer overflows and harden memory allocator.
c5044689e50039635e7700fe2472fd632ac77176
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
xcalloc
xcalloc( size_t num , size_t size)
['num', 'size']
xcalloc (size_t num, size_t size) { void *ptr = malloc(num * size); if (ptr) { memset (ptr, '\0', (num * size)); } return ptr; }
43
True
1
CVE-2017-6308
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'name': 'https://github.com/verdammelt/tnef/commit/c5044689e50039635e7700fe2472fd632ac77176', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Several Integer Overflows, which can lead to Heap Overflows, have been identified in the functions that wrap memory allocation.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-17 09:43:21+01:00
Fix integer overflows and harden memory allocator.
c5044689e50039635e7700fe2472fd632ac77176
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
xmalloc
xmalloc( size_t size)
['size']
xmalloc (size_t size) { void *ptr = malloc (size); if (!ptr && (size != 0)) /* some libc don't like size == 0 */ { perror ("xmalloc: Memory allocation failure"); abort(); } return ptr; }
41
True
1
CVE-2017-6309
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Two type confusions have been identified in the parse_file() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
get_html_data
get_html_data( MAPI_Attr * a)
['a']
get_html_data (MAPI_Attr *a) { VarLenData **body = XCALLOC(VarLenData*, a->num_values + 1); int j; for (j = 0; j < a->num_values; j++) { body[j] = XMALLOC(VarLenData, 1); body[j]->len = a->values[j].len; body[j]->data = CHECKED_XCALLOC(unsigned char, a->values[j].len); memmove (body[j]->data, a->values[j].data.buf, body[j]->len); } return body; }
125
True
1
CVE-2017-6309
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Two type confusions have been identified in the parse_file() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
get_html_data
get_html_data( MAPI_Attr * a)
['a']
get_html_data (MAPI_Attr *a) { VarLenData **body = XCALLOC(VarLenData*, a->num_values + 1); int j; for (j = 0; j < a->num_values; j++) { body[j] = XMALLOC(VarLenData, 1); body[j]->len = a->values[j].len; body[j]->data = CHECKED_XCALLOC(unsigned char, a->values[j].len); memmove (body[j]->data, a->values[j].data.buf, body[j]->len); } return body; }
125
True
1
CVE-2017-6310
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Four type confusions have been identified in the file_add_mapi_attrs() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:56Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
get_html_data
get_html_data( MAPI_Attr * a)
['a']
get_html_data (MAPI_Attr *a) { VarLenData **body = XCALLOC(VarLenData*, a->num_values + 1); int j; for (j = 0; j < a->num_values; j++) { body[j] = XMALLOC(VarLenData, 1); body[j]->len = a->values[j].len; body[j]->data = CHECKED_XCALLOC(unsigned char, a->values[j].len); memmove (body[j]->data, a->values[j].data.buf, body[j]->len); } return body; }
125
True
1
CVE-2017-6310
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Four type confusions have been identified in the file_add_mapi_attrs() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:56Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
get_html_data
get_html_data( MAPI_Attr * a)
['a']
get_html_data (MAPI_Attr *a) { VarLenData **body = XCALLOC(VarLenData*, a->num_values + 1); int j; for (j = 0; j < a->num_values; j++) { body[j] = XMALLOC(VarLenData, 1); body[j]->len = a->values[j].len; body[j]->data = CHECKED_XCALLOC(unsigned char, a->values[j].len); memmove (body[j]->data, a->values[j].data.buf, body[j]->len); } return body; }
125
True
1
CVE-2017-6309
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Two type confusions have been identified in the parse_file() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
parse_file
parse_file( FILE * input_file , char * directory , char * body_filename , char * body_pref , int flags)
['input_file', 'directory', 'body_filename', 'body_pref', 'flags']
parse_file (FILE* input_file, char* directory, char *body_filename, char *body_pref, int flags) { uint32 d; uint16 key; Attr *attr = NULL; File *file = NULL; int rtf_size = 0, html_size = 0; MessageBody body; memset (&body, '\0', sizeof (MessageBody)); /* store the program options in our file global variables */ g_flags = flags; /* check that this is in fact a TNEF file */ d = geti32(input_file); if (d != TNEF_SIGNATURE) { fprintf (stdout, "Seems not to be a TNEF file\n"); return 1; } /* Get the key */ key = geti16(input_file); debug_print ("TNEF Key: %hx\n", key); /* The rest of the file is a series of 'messages' and 'attachments' */ while ( data_left( input_file ) ) { attr = read_object( input_file ); if ( attr == NULL ) break; /* This signals the beginning of a file */ if (attr->name == attATTACHRENDDATA) { if (file) { file_write (file, directory); file_free (file); } else { file = CHECKED_XCALLOC (File, 1); } } /* Add the data to our lists. */ switch (attr->lvl_type) { case LVL_MESSAGE: if (attr->name == attBODY) { body.text_body = get_text_data (attr); } else if (attr->name == attMAPIPROPS) { MAPI_Attr **mapi_attrs = mapi_attr_read (attr->len, attr->buf); if (mapi_attrs) { int i; for (i = 0; mapi_attrs[i]; i++) { MAPI_Attr *a = mapi_attrs[i]; if (a->name == MAPI_BODY_HTML) { body.html_bodies = get_html_data (a); html_size = a->num_values; } else if (a->name == MAPI_RTF_COMPRESSED) { body.rtf_bodies = get_rtf_data (a); rtf_size = a->num_values; } } /* cannot save attributes to file, since they * are not attachment attributes */ /* file_add_mapi_attrs (file, mapi_attrs); */ mapi_attr_free_list (mapi_attrs); XFREE (mapi_attrs); } } break; case LVL_ATTACHMENT: file_add_attr (file, attr); break; default: fprintf (stderr, "Invalid lvl type on attribute: %d\n", attr->lvl_type); return 1; break; } attr_free (attr); XFREE (attr); } if (file) { file_write (file, directory); file_free (file); XFREE (file); } /* Write the message body */ if (flags & SAVEBODY) { int i = 0; int all_flag = 0; if (strcmp (body_pref, "all") == 0) { all_flag = 1; body_pref = "rht"; } for (; i < 3; i++) { File **files = get_body_files (body_filename, body_pref[i], &body); if (files) { int j = 0; for (; files[j]; j++) { file_write(files[j], directory); file_free (files[j]); XFREE(files[j]); } XFREE(files); if (!all_flag) break; } } } if (body.text_body) { free_bodies(body.text_body, 1); XFREE(body.text_body); } if (rtf_size > 0) { free_bodies(body.rtf_bodies, rtf_size); XFREE(body.rtf_bodies); } if (html_size > 0) { free_bodies(body.html_bodies, html_size); XFREE(body.html_bodies); } return 0; }
594
True
1
CVE-2017-6309
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Two type confusions have been identified in the parse_file() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:58Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
parse_file
parse_file( FILE * input_file , char * directory , char * body_filename , char * body_pref , int flags)
['input_file', 'directory', 'body_filename', 'body_pref', 'flags']
parse_file (FILE* input_file, char* directory, char *body_filename, char *body_pref, int flags) { uint32 d; uint16 key; Attr *attr = NULL; File *file = NULL; int rtf_size = 0, html_size = 0; MessageBody body; memset (&body, '\0', sizeof (MessageBody)); /* store the program options in our file global variables */ g_flags = flags; /* check that this is in fact a TNEF file */ d = geti32(input_file); if (d != TNEF_SIGNATURE) { fprintf (stdout, "Seems not to be a TNEF file\n"); return 1; } /* Get the key */ key = geti16(input_file); debug_print ("TNEF Key: %hx\n", key); /* The rest of the file is a series of 'messages' and 'attachments' */ while ( data_left( input_file ) ) { attr = read_object( input_file ); if ( attr == NULL ) break; /* This signals the beginning of a file */ if (attr->name == attATTACHRENDDATA) { if (file) { file_write (file, directory); file_free (file); } else { file = CHECKED_XCALLOC (File, 1); } } /* Add the data to our lists. */ switch (attr->lvl_type) { case LVL_MESSAGE: if (attr->name == attBODY) { body.text_body = get_text_data (attr); } else if (attr->name == attMAPIPROPS) { MAPI_Attr **mapi_attrs = mapi_attr_read (attr->len, attr->buf); if (mapi_attrs) { int i; for (i = 0; mapi_attrs[i]; i++) { MAPI_Attr *a = mapi_attrs[i]; if (a->name == MAPI_BODY_HTML) { body.html_bodies = get_html_data (a); html_size = a->num_values; } else if (a->name == MAPI_RTF_COMPRESSED) { body.rtf_bodies = get_rtf_data (a); rtf_size = a->num_values; } } /* cannot save attributes to file, since they * are not attachment attributes */ /* file_add_mapi_attrs (file, mapi_attrs); */ mapi_attr_free_list (mapi_attrs); XFREE (mapi_attrs); } } break; case LVL_ATTACHMENT: file_add_attr (file, attr); break; default: fprintf (stderr, "Invalid lvl type on attribute: %d\n", attr->lvl_type); return 1; break; } attr_free (attr); XFREE (attr); } if (file) { file_write (file, directory); file_free (file); XFREE (file); } /* Write the message body */ if (flags & SAVEBODY) { int i = 0; int all_flag = 0; if (strcmp (body_pref, "all") == 0) { all_flag = 1; body_pref = "rht"; } for (; i < 3; i++) { File **files = get_body_files (body_filename, body_pref[i], &body); if (files) { int j = 0; for (; files[j]; j++) { file_write(files[j], directory); file_free (files[j]); XFREE(files[j]); } XFREE(files); if (!all_flag) break; } } } if (body.text_body) { free_bodies(body.text_body, 1); XFREE(body.text_body); } if (rtf_size > 0) { free_bodies(body.rtf_bodies, rtf_size); XFREE(body.rtf_bodies); } if (html_size > 0) { free_bodies(body.html_bodies, html_size); XFREE(body.html_bodies); } return 0; }
594
True
1
CVE-2017-6310
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Four type confusions have been identified in the file_add_mapi_attrs() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:56Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
parse_file
parse_file( FILE * input_file , char * directory , char * body_filename , char * body_pref , int flags)
['input_file', 'directory', 'body_filename', 'body_pref', 'flags']
parse_file (FILE* input_file, char* directory, char *body_filename, char *body_pref, int flags) { uint32 d; uint16 key; Attr *attr = NULL; File *file = NULL; int rtf_size = 0, html_size = 0; MessageBody body; memset (&body, '\0', sizeof (MessageBody)); /* store the program options in our file global variables */ g_flags = flags; /* check that this is in fact a TNEF file */ d = geti32(input_file); if (d != TNEF_SIGNATURE) { fprintf (stdout, "Seems not to be a TNEF file\n"); return 1; } /* Get the key */ key = geti16(input_file); debug_print ("TNEF Key: %hx\n", key); /* The rest of the file is a series of 'messages' and 'attachments' */ while ( data_left( input_file ) ) { attr = read_object( input_file ); if ( attr == NULL ) break; /* This signals the beginning of a file */ if (attr->name == attATTACHRENDDATA) { if (file) { file_write (file, directory); file_free (file); } else { file = CHECKED_XCALLOC (File, 1); } } /* Add the data to our lists. */ switch (attr->lvl_type) { case LVL_MESSAGE: if (attr->name == attBODY) { body.text_body = get_text_data (attr); } else if (attr->name == attMAPIPROPS) { MAPI_Attr **mapi_attrs = mapi_attr_read (attr->len, attr->buf); if (mapi_attrs) { int i; for (i = 0; mapi_attrs[i]; i++) { MAPI_Attr *a = mapi_attrs[i]; if (a->name == MAPI_BODY_HTML) { body.html_bodies = get_html_data (a); html_size = a->num_values; } else if (a->name == MAPI_RTF_COMPRESSED) { body.rtf_bodies = get_rtf_data (a); rtf_size = a->num_values; } } /* cannot save attributes to file, since they * are not attachment attributes */ /* file_add_mapi_attrs (file, mapi_attrs); */ mapi_attr_free_list (mapi_attrs); XFREE (mapi_attrs); } } break; case LVL_ATTACHMENT: file_add_attr (file, attr); break; default: fprintf (stderr, "Invalid lvl type on attribute: %d\n", attr->lvl_type); return 1; break; } attr_free (attr); XFREE (attr); } if (file) { file_write (file, directory); file_free (file); XFREE (file); } /* Write the message body */ if (flags & SAVEBODY) { int i = 0; int all_flag = 0; if (strcmp (body_pref, "all") == 0) { all_flag = 1; body_pref = "rht"; } for (; i < 3; i++) { File **files = get_body_files (body_filename, body_pref[i], &body); if (files) { int j = 0; for (; files[j]; j++) { file_write(files[j], directory); file_free (files[j]); XFREE(files[j]); } XFREE(files); if (!all_flag) break; } } } if (body.text_body) { free_bodies(body.text_body, 1); XFREE(body.text_body); } if (rtf_size > 0) { free_bodies(body.rtf_bodies, rtf_size); XFREE(body.rtf_bodies); } if (html_size > 0) { free_bodies(body.html_bodies, html_size); XFREE(body.html_bodies); } return 0; }
594
True
1
CVE-2017-6310
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.0/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://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'name': 'https://www.x41-dsec.de/lab/advisories/x41-2017-004-tnef/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'name': 'https://github.com/verdammelt/tnef/commit/8dccf79857ceeb7a6d3e42c1e762e7b865d5344d', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'name': 'https://github.com/verdammelt/tnef/blob/master/ChangeLog', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96427', 'name': '96427', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201708-02', 'name': 'GLSA-201708-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3798', 'name': 'DSA-3798', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tnef_project:tnef:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.12', '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 tnef before 1.4.13. Four type confusions have been identified in the file_add_mapi_attrs() function. These might lead to invalid read and write operations, controlled by an attacker.'}]
2019-03-13T17:56Z
2017-02-24T04:59Z
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
Eric Sesterhenn
2017-02-19 19:36:35+01:00
Check types to avoid invalid reads/writes.
8dccf79857ceeb7a6d3e42c1e762e7b865d5344d
False
verdammelt/tnef
tnef
2011-11-05 22:33:05
2020-12-23 15:06:10
verdammelt
54.0
21.0
parse_file
parse_file( FILE * input_file , char * directory , char * body_filename , char * body_pref , int flags)
['input_file', 'directory', 'body_filename', 'body_pref', 'flags']
parse_file (FILE* input_file, char* directory, char *body_filename, char *body_pref, int flags) { uint32 d; uint16 key; Attr *attr = NULL; File *file = NULL; int rtf_size = 0, html_size = 0; MessageBody body; memset (&body, '\0', sizeof (MessageBody)); /* store the program options in our file global variables */ g_flags = flags; /* check that this is in fact a TNEF file */ d = geti32(input_file); if (d != TNEF_SIGNATURE) { fprintf (stdout, "Seems not to be a TNEF file\n"); return 1; } /* Get the key */ key = geti16(input_file); debug_print ("TNEF Key: %hx\n", key); /* The rest of the file is a series of 'messages' and 'attachments' */ while ( data_left( input_file ) ) { attr = read_object( input_file ); if ( attr == NULL ) break; /* This signals the beginning of a file */ if (attr->name == attATTACHRENDDATA) { if (file) { file_write (file, directory); file_free (file); } else { file = CHECKED_XCALLOC (File, 1); } } /* Add the data to our lists. */ switch (attr->lvl_type) { case LVL_MESSAGE: if (attr->name == attBODY) { body.text_body = get_text_data (attr); } else if (attr->name == attMAPIPROPS) { MAPI_Attr **mapi_attrs = mapi_attr_read (attr->len, attr->buf); if (mapi_attrs) { int i; for (i = 0; mapi_attrs[i]; i++) { MAPI_Attr *a = mapi_attrs[i]; if (a->name == MAPI_BODY_HTML) { body.html_bodies = get_html_data (a); html_size = a->num_values; } else if (a->name == MAPI_RTF_COMPRESSED) { body.rtf_bodies = get_rtf_data (a); rtf_size = a->num_values; } } /* cannot save attributes to file, since they * are not attachment attributes */ /* file_add_mapi_attrs (file, mapi_attrs); */ mapi_attr_free_list (mapi_attrs); XFREE (mapi_attrs); } } break; case LVL_ATTACHMENT: file_add_attr (file, attr); break; default: fprintf (stderr, "Invalid lvl type on attribute: %d\n", attr->lvl_type); return 1; break; } attr_free (attr); XFREE (attr); } if (file) { file_write (file, directory); file_free (file); XFREE (file); } /* Write the message body */ if (flags & SAVEBODY) { int i = 0; int all_flag = 0; if (strcmp (body_pref, "all") == 0) { all_flag = 1; body_pref = "rht"; } for (; i < 3; i++) { File **files = get_body_files (body_filename, body_pref[i], &body); if (files) { int j = 0; for (; files[j]; j++) { file_write(files[j], directory); file_free (files[j]); XFREE(files[j]); } XFREE(files); if (!all_flag) break; } } } if (body.text_body) { free_bodies(body.text_body, 1); XFREE(body.text_body); } if (rtf_size > 0) { free_bodies(body.rtf_bodies, rtf_size); XFREE(body.rtf_bodies); } if (html_size > 0) { free_bodies(body.html_bodies, html_size); XFREE(body.html_bodies); } return 0; }
594
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
checkCurl
checkCurl()
[]
static bool checkCurl() { const char nul[] = R_SYS_DEVNULL; if (r_sys_cmdf ("curl --version > %s", nul) != 0) { return false; } return true; }
32
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
download
download( struct SPDBDownloader * pd)
['pd']
static int download(struct SPDBDownloader *pd) { SPDBDownloaderOpt *opt = pd->opt; char *curl_cmd = NULL; char *extractor_cmd = NULL; char *abspath_to_archive = NULL; char *abspath_to_file = NULL; char *archive_name = NULL; size_t archive_name_len = 0; char *symbol_store_path = NULL; char *dbg_file = NULL; char *guid = NULL; char *archive_name_escaped = NULL; char *user_agent = NULL; char *symbol_server = NULL; int res = 0; int cmd_ret; if (!opt->dbg_file || !*opt->dbg_file) { // no pdb debug file return 0; } if (!checkCurl ()) { return 0; } // dbg_file len is > 0 archive_name_len = strlen (opt->dbg_file); archive_name = malloc (archive_name_len + 1); if (!archive_name) { return 0; } memcpy (archive_name, opt->dbg_file, archive_name_len + 1); archive_name[archive_name_len - 1] = '_'; symbol_store_path = r_str_escape (opt->symbol_store_path); dbg_file = r_str_escape (opt->dbg_file); guid = r_str_escape (opt->guid); archive_name_escaped = r_str_escape (archive_name); user_agent = r_str_escape (opt->user_agent); symbol_server = r_str_escape (opt->symbol_server); abspath_to_archive = r_str_newf ("%s%s%s%s%s%s%s", symbol_store_path, R_SYS_DIR, dbg_file, R_SYS_DIR, guid, R_SYS_DIR, archive_name_escaped); abspath_to_file = strdup (abspath_to_archive); abspath_to_file[strlen (abspath_to_file) - 1] = 'b'; if (r_file_exists (abspath_to_file)) { eprintf ("File already downloaded.\n"); R_FREE (user_agent); R_FREE (abspath_to_archive); R_FREE (archive_name_escaped); R_FREE (symbol_store_path); R_FREE (dbg_file); R_FREE (guid); R_FREE (archive_name); R_FREE (abspath_to_file); R_FREE (symbol_server); return 1; } if (checkExtract () || opt->extract == 0) { res = 1; curl_cmd = r_str_newf ("curl -sfLA \"%s\" \"%s/%s/%s/%s\" --create-dirs -o \"%s\"", user_agent, symbol_server, dbg_file, guid, archive_name_escaped, abspath_to_archive); #if __WINDOWS__ const char *cabextractor = "expand"; const char *format = "%s %s %s"; // extractor_cmd -> %1 %2 %3 // %1 - 'expand' // %2 - absolute path to archive // %3 - absolute path to file that will be dearchive extractor_cmd = r_str_newf (format, cabextractor, abspath_to_archive, abspath_to_file); #else const char *cabextractor = "cabextract"; const char *format = "%s -d \"%s\" \"%s\""; char *abspath_to_dir = r_file_dirname (abspath_to_archive); // cabextract -d %1 %2 // %1 - path to directory where to extract all files from cab archive // %2 - absolute path to cab archive extractor_cmd = r_str_newf (format, cabextractor, abspath_to_dir, abspath_to_archive); R_FREE (abspath_to_dir); #endif eprintf ("Attempting to download compressed pdb in %s\n", abspath_to_archive); if ((cmd_ret = r_sys_cmd (curl_cmd) != 0)) { eprintf("curl exited with error %d\n", cmd_ret); res = 0; } eprintf ("Attempting to decompress pdb\n"); if (opt->extract > 0) { if (res && ((cmd_ret = r_sys_cmd (extractor_cmd)) != 0)) { eprintf ("cab extractor exited with error %d\n", cmd_ret); res = 0; } r_file_rm (abspath_to_archive); } R_FREE (curl_cmd); } if (res == 0) { eprintf ("Falling back to uncompressed pdb\n"); res = 1; archive_name_escaped[strlen (archive_name_escaped) - 1] = 'b'; curl_cmd = r_str_newf ("curl -sfLA \"%s\" \"%s/%s/%s/%s\" --create-dirs -o \"%s\"", opt->user_agent, opt->symbol_server, opt->dbg_file, opt->guid, archive_name_escaped, abspath_to_file); eprintf ("Attempting to download uncompressed pdb in %s\n", abspath_to_file); if ((cmd_ret = r_sys_cmd (curl_cmd) != 0)) { eprintf("curl exited with error %d\n", cmd_ret); res = 0; } R_FREE (curl_cmd); } R_FREE (abspath_to_archive); R_FREE (abspath_to_file); R_FREE (archive_name); R_FREE (extractor_cmd); R_FREE (symbol_store_path); R_FREE (dbg_file); R_FREE (guid); R_FREE (archive_name_escaped); R_FREE (user_agent); R_FREE (symbol_server); return res; }
670
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
r_socket_accept_timeout
r_socket_accept_timeout( RSocket * s , unsigned int timeout)
['s', 'timeout']
R_API RSocket *r_socket_accept_timeout(RSocket *s, unsigned int timeout) { fd_set read_fds; fd_set except_fds; FD_ZERO (&read_fds); FD_SET (s->fd, &read_fds); FD_ZERO (&except_fds); FD_SET (s->fd, &except_fds); struct timeval t; t.tv_sec = timeout; t.tv_usec = 0; int r = select (s->fd + 1, &read_fds, NULL, &except_fds, &t); if(r < 0) { perror ("select"); } else if (r > 0 && FD_ISSET (s->fd, &read_fds)) { return r_socket_accept (s); } return NULL; }
130
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
r_socket_block_time
r_socket_block_time( RSocket * s , int block , int sec , int usec)
['s', 'block', 'sec', 'usec']
R_API int r_socket_block_time(RSocket *s, int block, int sec, int usec) { #if __UNIX__ int ret, flags; #endif if (!s) { return false; } #if __UNIX__ flags = fcntl (s->fd, F_GETFL, 0); if (flags < 0) { return false; } ret = fcntl (s->fd, F_SETFL, block? (flags & ~O_NONBLOCK): (flags | O_NONBLOCK)); if (ret < 0) { return false; } #elif __WINDOWS__ ioctlsocket (s->fd, FIONBIO, (u_long FAR*)&block); #endif if (sec > 0 || usec > 0) { struct timeval tv = {0}; tv.tv_sec = sec; tv.tv_usec = usec; if (setsockopt (s->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof (tv)) < 0) { return false; } } return true; }
176
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
r_socket_connect
r_socket_connect( RSocket * s , const char * host , const char * port , int proto , unsigned int timeout)
['s', 'host', 'port', 'proto', 'timeout']
R_API bool r_socket_connect(RSocket *s, const char *host, const char *port, int proto, unsigned int timeout) { r_return_val_if_fail (s, false); #if __WINDOWS__ struct sockaddr_in sa; struct hostent *he; WSADATA wsadata; TIMEVAL Timeout; Timeout.tv_sec = timeout; Timeout.tv_usec = 0; if (WSAStartup (MAKEWORD (1, 1), &wsadata) == SOCKET_ERROR) { eprintf ("Error creating socket."); return false; } s->fd = socket (AF_INET, SOCK_STREAM, 0); if (s->fd == R_INVALID_SOCKET) { return false; } unsigned long iMode = 1; int iResult = ioctlsocket (s->fd, FIONBIO, &iMode); if (iResult != NO_ERROR) { eprintf ("ioctlsocket error: %d\n", iResult); } memset (&sa, 0, sizeof (sa)); sa.sin_family = AF_INET; he = (struct hostent *)gethostbyname (host); if (he == (struct hostent*)0) { #ifdef _MSC_VER closesocket (s->fd); #else close (s->fd); #endif return false; } sa.sin_addr = *((struct in_addr *)he->h_addr); s->port = r_socket_port_by_name (port); s->proto = proto; sa.sin_port = htons (s->port); if (!connect (s->fd, (const struct sockaddr*)&sa, sizeof (struct sockaddr))) { #ifdef _MSC_VER closesocket (s->fd); #else close (s->fd); #endif return false; } iMode = 0; iResult = ioctlsocket (s->fd, FIONBIO, &iMode); if (iResult != NO_ERROR) { eprintf ("ioctlsocket error: %d\n", iResult); } if (timeout > 0) { r_socket_block_time (s, 1, timeout, 0); } fd_set Write, Err; FD_ZERO (&Write); FD_ZERO (&Err); FD_SET (s->fd, &Write); FD_SET (s->fd, &Err); select (0, NULL, &Write, &Err, &Timeout); if (FD_ISSET (s->fd, &Write)) { return true; } return false; #elif __UNIX__ int ret; struct addrinfo hints = {0}; struct addrinfo *res, *rp; if (!proto) { proto = R_SOCKET_PROTO_TCP; } r_sys_signal (SIGPIPE, SIG_IGN); if (proto == R_SOCKET_PROTO_UNIX) { if (!__connect_unix (s, host)) { return false; } } else { hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ hints.ai_protocol = proto; int gai = getaddrinfo (host, port, &hints, &res); if (gai != 0) { eprintf ("r_socket_connect: Error in getaddrinfo: %s (%s:%s)\n", gai_strerror (gai), host, port); return false; } for (rp = res; rp != NULL; rp = rp->ai_next) { int flag = 1; s->fd = socket (rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (s->fd == -1) { perror ("socket"); continue; } ret = setsockopt (s->fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof (flag)); if (ret < 0) { perror ("setsockopt"); close (s->fd); s->fd = -1; continue; } r_socket_block_time (s, 0, 0, 0); ret = connect (s->fd, rp->ai_addr, rp->ai_addrlen); if (ret == 0) { freeaddrinfo (res); return true; } if (errno == EINPROGRESS) { struct timeval tv; tv.tv_sec = timeout; tv.tv_usec = 0; fd_set wfds; FD_ZERO(&wfds); FD_SET(s->fd, &wfds); if ((ret = select (s->fd + 1, NULL, &wfds, NULL, &tv)) != -1) { if (r_socket_is_connected (s)) { freeaddrinfo (res); return true; } } else { perror ("connect"); } } r_socket_close (s); } freeaddrinfo (res); if (!rp) { eprintf ("Could not resolve address '%s' or failed to connect\n", host); return false; } } #endif #if HAVE_LIB_SSL if (s->is_ssl) { s->ctx = SSL_CTX_new (SSLv23_client_method ()); if (!s->ctx) { r_socket_free (s); return false; } s->sfd = SSL_new (s->ctx); SSL_set_fd (s->sfd, s->fd); if (SSL_connect (s->sfd) != 1) { r_socket_free (s); return false; } } #endif return true; }
897
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
r_socket_read
r_socket_read( RSocket * s , unsigned char * buf , int len)
['s', 'buf', 'len']
R_API int r_socket_read(RSocket *s, unsigned char *buf, int len) { if (!s) { return -1; } #if HAVE_LIB_SSL if (s->is_ssl) { if (s->bio) { return BIO_read (s->bio, buf, len); } return SSL_read (s->sfd, buf, len); } #endif #if __WINDOWS__ rep: { int ret = recv (s->fd, (void *)buf, len, 0); if (ret == -1) { goto rep; } return ret; } #else // int r = read (s->fd, buf, len); int r = recv (s->fd, buf, len, 0); D { eprintf ("READ "); int i; for (i = 0; i<len; i++) { eprintf ("%02x ", buf[i]); } eprintf ("\n"); } return r; #endif }
166
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
r_socket_ready
r_socket_ready( RSocket * s , int secs , int usecs)
['s', 'secs', 'usecs']
R_API int r_socket_ready(RSocket *s, int secs, int usecs) { #if __UNIX__ //int msecs = (1000 * secs) + (usecs / 1000); int msecs = (usecs / 1000); struct pollfd fds[1]; fds[0].fd = s->fd; fds[0].events = POLLIN | POLLPRI; fds[0].revents = POLLNVAL | POLLHUP | POLLERR; return poll ((struct pollfd *)&fds, 1, msecs); #elif __WINDOWS__ fd_set rfds; struct timeval tv; if (s->fd == R_INVALID_SOCKET) { return -1; } FD_ZERO (&rfds); FD_SET (s->fd, &rfds); tv.tv_sec = secs; tv.tv_usec = usecs; return select (s->fd + 1, &rfds, NULL, NULL, &tv); #else return true; /* always ready if unknown */ #endif }
153
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
__socket_slurp
__socket_slurp( RSocket * s , ut8 * buf , int bufsz)
['s', 'buf', 'bufsz']
static int __socket_slurp (RSocket *s, ut8 *buf, int bufsz) { int i; int chsz = 1; // r_socket_block_time (s, 1, 1, 0); if (r_socket_read_block (s, (ut8 *) buf, 1) != 1) { return 0; } for (i = 1; i < bufsz; i += chsz) { buf[i] =0; r_socket_block_time (s, 1, 0, 1000); int olen = r_socket_read_block (s, (ut8 *) buf + i , chsz); if (olen != chsz) { buf[i] = 0; break; } } return i; }
117
True
1
CVE-2020-15121
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:C/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
CHANGED
HIGH
HIGH
HIGH
9.6
CRITICAL
2.8
6.0
False
[{'url': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'name': 'https://github.com/radareorg/radare2/commit/04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'name': 'https://github.com/radareorg/radare2/security/advisories/GHSA-r552-vp94-9358', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/issues/16945', 'name': 'https://github.com/radareorg/radare2/issues/16945', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radareorg/radare2/pull/16966', 'name': 'https://github.com/radareorg/radare2/pull/16966', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YE77P5RSE2T7JHEKMWF2ARTSJGMPXCFY/', 'name': 'FEDORA-2020-d5b33b6e6c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MWC7KNBETYE5MK6VIUU26LUIISIFGSBZ/', 'name': 'FEDORA-2020-aa51efe207', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.5.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "In radare2 before version 4.5.0, malformed PDB file names in the PDB server path cause shell injection. To trigger the problem it's required to open the executable in radare2 and run idpd to trigger the download. The shell code will execute, and will create a file called pwned in the current directory."}]
2022-01-04T16:33Z
2020-07-20T18:15Z
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage. There are at least two subtypes of OS command injection: The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system("nslookup [HOSTNAME]") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing. The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use "exec([COMMAND])" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line. From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.
https://cwe.mitre.org/data/definitions/78.html
0
GustavoLCR
2020-06-10 13:00:00-03:00
Fix command injection on PDB download (#16966) * Fix r_sys_mkdirp with absolute path on Windows * Fix build with --with-openssl * Use RBuffer in r_socket_http_answer() * r_socket_http_answer: Fix read for big responses * Implement r_str_escape_sh() * Cleanup r_socket_connect() on Windows * Fix socket being created without a protocol * Fix socket connect with SSL ##socket * Use select() in r_socket_ready() * Fix read failing if received only protocol answer * Fix double-free * r_socket_http_get: Fail if req. SSL with no support * Follow redirects in r_socket_http_answer() * Fix r_socket_http_get result length with R2_CURL=1 * Also follow redirects * Avoid using curl for downloading PDBs * Use r_socket_http_get() on UNIXs * Use WinINet API on Windows for r_socket_http_get() * Fix command injection * Fix r_sys_cmd_str_full output for binary data * Validate GUID on PDB download * Pass depth to socket_http_get_recursive() * Remove 'r_' and '__' from static function names * Fix is_valid_guid * Fix for comments
04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9
False
radareorg/radare2
UNIX-like reverse engineering framework and command-line toolset
2012-07-03 07:42:26
2022-08-24 23:09:24
https://www.radare.org/
radareorg
16739.0
2722.0
r_socket_http_answer
r_socket_http_answer( RSocket * s , int * code , int * rlen)
['s', 'code', 'rlen']
static char *r_socket_http_answer (RSocket *s, int *code, int *rlen) { r_return_val_if_fail (s, NULL); const char *p; int ret, len = 0, bufsz = 32768, delta = 0; char *dn, *buf = calloc (1, bufsz + 32); // XXX: use r_buffer here if (!buf) { return NULL; } char *res = NULL; int olen = __socket_slurp (s, (ut8*)buf, bufsz); if ((dn = (char*)r_str_casestr (buf, "\n\n"))) { delta += 2; } else if ((dn = (char*)r_str_casestr (buf, "\r\n\r\n"))) { delta += 4; } else { goto fail; } olen -= delta; *dn = 0; // chop headers /* Parse Len */ p = r_str_casestr (buf, "Content-Length: "); if (p) { len = atoi (p + 16); } else { len = olen - (dn - buf); } if (len > 0) { if (len > olen) { res = malloc (len + 2); memcpy (res, dn + delta, olen); do { ret = r_socket_read_block (s, (ut8*) res + olen, len - olen); if (ret < 1) { break; } olen += ret; } while (olen < len); res[len] = 0; } else { res = malloc (len + 1); if (res) { memcpy (res, dn + delta, len); res[len] = 0; } } } else { res = NULL; } fail: free (buf); // is 's' free'd? isn't this going to cause a double free? r_socket_close (s); if (rlen) { *rlen = len; } return res; }
345
True
1