cve_id
stringlengths
13
16
obtain_all_privilege
stringclasses
3 values
obtain_user_privilege
stringclasses
2 values
obtain_other_privilege
stringclasses
2 values
user_interaction_required
stringclasses
3 values
cvss2_vector_string
stringclasses
106 values
cvss2_access_vector
stringclasses
4 values
cvss2_access_complexity
stringclasses
4 values
cvss2_authentication
stringclasses
3 values
cvss2_confidentiality_impact
stringclasses
4 values
cvss2_integrity_impact
stringclasses
4 values
cvss2_availability_impact
stringclasses
4 values
cvss2_base_score
stringclasses
50 values
cvss3_vector_string
stringclasses
226 values
cvss3_attack_vector
stringclasses
5 values
cvss3_attack_complexity
stringclasses
3 values
cvss3_privileges_required
stringclasses
4 values
cvss3_user_interaction
stringclasses
3 values
cvss3_scope
stringclasses
3 values
cvss3_confidentiality_impact
stringclasses
4 values
cvss3_integrity_impact
stringclasses
4 values
cvss3_availability_impact
stringclasses
4 values
cvss3_base_score
stringclasses
55 values
cvss3_base_severity
stringclasses
5 values
exploitability_score
stringclasses
22 values
impact_score
stringclasses
15 values
ac_insuf_info
stringclasses
3 values
reference_json
stringlengths
221
23.3k
problemtype_json
stringclasses
200 values
severity
stringclasses
4 values
cve_nodes
stringlengths
2
33.1k
cve_description
stringlengths
64
1.99k
cve_last_modified_date
stringlengths
17
17
cve_published_date
stringlengths
17
17
cwe_name
stringclasses
125 values
cwe_description
stringclasses
124 values
cwe_extended_description
stringclasses
95 values
cwe_url
stringclasses
124 values
cwe_is_category
int64
0
1
commit_author
stringlengths
0
34
commit_author_date
stringlengths
25
25
commit_msg
stringlengths
0
13.3k
commit_hash
stringlengths
40
40
commit_is_merge
stringclasses
1 value
repo_name
stringclasses
467 values
repo_description
stringclasses
459 values
repo_date_created
stringclasses
467 values
repo_date_last_push
stringclasses
467 values
repo_homepage
stringclasses
294 values
repo_owner
stringclasses
470 values
repo_stars
stringclasses
406 values
repo_forks
stringclasses
352 values
function_name
stringlengths
3
120
function_signature
stringlengths
6
640
function_parameters
stringlengths
2
302
function
stringlengths
12
114k
function_token_count
stringlengths
1
5
function_before_change
stringclasses
1 value
labels
int64
1
1
CVE-2019-11455
False
False
False
False
AV:N/AC:L/Au:S/C:P/I:N/A:P
NETWORK
LOW
SINGLE
PARTIAL
NONE
PARTIAL
5.5
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
NETWORK
LOW
LOW
NONE
UNCHANGED
HIGH
NONE
HIGH
8.1
HIGH
2.8
5.2
False
[{'url': 'https://github.com/dzflack/exploits/blob/master/unix/monit_buffer_overread.py', 'name': 'https://github.com/dzflack/exploits/blob/master/unix/monit_buffer_overread.py', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/dzflack/exploits/blob/master/macos/monit_dos.py', 'name': 'https://github.com/dzflack/exploits/blob/master/macos/monit_dos.py', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bitbucket.org/tildeslash/monit/commits/f12d0cdb42d4e74dffe1525d4062c815c48ac57a', 'name': 'https://bitbucket.org/tildeslash/monit/commits/f12d0cdb42d4e74dffe1525d4062c815c48ac57a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/04/msg00028.html', 'name': '[debian-lts-announce] 20190426 [SECURITY] [DLA 1767-1] monit security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3971-1/', 'name': 'USN-3971-1', 'refsource': 'UBUNTU', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/L475QJMFFI2QV5QEHAKKPVX6QX6ECUL6/', 'name': 'FEDORA-2020-9c19202d55', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/HZQDHRSKTEX5MSYXNCGFTUSFGANBARHX/', 'name': 'FEDORA-2020-f70cd7c24b', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/12/msg00018.html', 'name': '[debian-lts-announce] 20211227 [SECURITY] [DLA 2855-1] monit 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:tildeslash:monit:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.25.3', '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:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.04:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A buffer over-read in Util_urlDecode in util.c in Tildeslash Monit before 5.25.3 allows a remote authenticated attacker to retrieve the contents of adjacent memory via manipulation of GET or POST parameters. The attacker can also cause a denial of service (application outage).'}]
2022-03-31T17:45Z
2019-04-22T16: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
tildeslash
2019-03-04 15:49:08+01:00
Fixed: Buffer overrun vulnerability in URL decoding. Thanks to Zack Flack for report.
f12d0cdb42d4e74dffe1525d4062c815c48ac57a
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
tildeslash
visit repo url
visit repo url
x2c
x2c( char * hex)
['hex']
static char x2c(char *hex) { register char digit; digit = ((hex[0] >= 'A') ? ((hex[0] & 0xdf) - 'A')+10 : (hex[0] - '0')); digit *= 16; digit += (hex[1] >= 'A' ? ((hex[1] & 0xdf) - 'A')+10 : (hex[1] - '0')); return(digit); }
94
True
1
CVE-2021-22897
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:N/A:N
NETWORK
MEDIUM
NONE
PARTIAL
NONE
NONE
4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://curl.se/docs/CVE-2021-22897.html', 'name': 'https://curl.se/docs/CVE-2021-22897.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/curl/curl/commit/bbb71507b7bab52002f9b1e0880bed6a32834511', 'name': 'https://github.com/curl/curl/commit/bbb71507b7bab52002f9b1e0880bed6a32834511', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://hackerone.com/reports/1172857', 'name': 'https://hackerone.com/reports/1172857', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-668'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.61.0', 'versionEndIncluding': '7.76.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionStartIncluding': '21.0', 'versionEndExcluding': '21.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.1.2.4.047', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.34', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_slice_selection_function:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_service_communication_proxy:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_binding_support_function:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire_\\&_hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:solidfire_baseboard_management_controller_firmware:-:*:*:*:*:*:*:*', '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:hci_compute_node_firmware:-:*:*:*:*:*:*:*', '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: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: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: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: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: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: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:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'curl 7.61.0 through 7.76.1 suffers from exposure of data element to wrong session due to a mistake in the code for CURLOPT_SSL_CIPHER_LIST when libcurl is built to use the Schannel TLS library. The selected cipher set was stored in a single "static" variable in the library, which has the surprising side-effect that if an application sets up multiple concurrent transfers, the last one that sets the ciphers will accidentally control the set used by all transfers. In a worst-case scenario, this weakens transport security significantly.'}]
2022-05-13T17:29Z
2021-06-11T16:15Z
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files. A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system. In either case, the end result is that a resource has been exposed to the wrong party.
https://cwe.mitre.org/data/definitions/668.html
0
Daniel Stenberg
2021-04-23 10:54:10+02:00
schannel: don't use static to store selected ciphers CVE-2021-22897 Bug: https://curl.se/docs/CVE-2021-22897.html
bbb71507b7bab52002f9b1e0880bed6a32834511
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
schannel_connect_step1
schannel_connect_step1( struct Curl_easy * data , struct connectdata * conn , int sockindex)
['data', 'conn', 'sockindex']
schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn, int sockindex) { ssize_t written = -1; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; SecBuffer outbuf; SecBufferDesc outbuf_desc; SecBuffer inbuf; SecBufferDesc inbuf_desc; #ifdef HAS_ALPN unsigned char alpn_buffer[128]; #endif SCHANNEL_CRED schannel_cred; PCCERT_CONTEXT client_certs[1] = { NULL }; SECURITY_STATUS sspi_status = SEC_E_OK; struct Curl_schannel_cred *old_cred = NULL; struct in_addr addr; #ifdef ENABLE_IPV6 struct in6_addr addr6; #endif TCHAR *host_name; CURLcode result; char * const hostname = SSL_HOST_NAME(); DEBUGF(infof(data, "schannel: SSL/TLS connection with %s port %hu (step 1/3)\n", hostname, conn->remote_port)); if(curlx_verify_windows_version(5, 1, PLATFORM_WINNT, VERSION_LESS_THAN_EQUAL)) { /* Schannel in Windows XP (OS version 5.1) uses legacy handshakes and algorithms that may not be supported by all servers. */ infof(data, "schannel: Windows version is old and may not be able to " "connect to some servers due to lack of SNI, algorithms, etc.\n"); } #ifdef HAS_ALPN /* ALPN is only supported on Windows 8.1 / Server 2012 R2 and above. Also it doesn't seem to be supported for Wine, see curl bug #983. */ BACKEND->use_alpn = conn->bits.tls_enable_alpn && !GetProcAddress(GetModuleHandle(TEXT("ntdll")), "wine_get_version") && curlx_verify_windows_version(6, 3, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL); #else BACKEND->use_alpn = false; #endif #ifdef _WIN32_WCE #ifdef HAS_MANUAL_VERIFY_API /* certificate validation on CE doesn't seem to work right; we'll * do it following a more manual process. */ BACKEND->use_manual_cred_validation = true; #else #error "compiler too old to support requisite manual cert verify for Win CE" #endif #else #ifdef HAS_MANUAL_VERIFY_API if(SSL_CONN_CONFIG(CAfile) || SSL_CONN_CONFIG(ca_info_blob)) { if(curlx_verify_windows_version(6, 1, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL)) { BACKEND->use_manual_cred_validation = true; } else { failf(data, "schannel: this version of Windows is too old to support " "certificate verification via CA bundle file."); return CURLE_SSL_CACERT_BADFILE; } } else BACKEND->use_manual_cred_validation = false; #else if(SSL_CONN_CONFIG(CAfile) || SSL_CONN_CONFIG(ca_info_blob)) { failf(data, "schannel: CA cert support not built in"); return CURLE_NOT_BUILT_IN; } #endif #endif BACKEND->cred = NULL; /* check for an existing re-usable credential handle */ if(SSL_SET_OPTION(primary.sessionid)) { Curl_ssl_sessionid_lock(data); if(!Curl_ssl_getsessionid(data, conn, SSL_IS_PROXY() ? TRUE : FALSE, (void **)&old_cred, NULL, sockindex)) { BACKEND->cred = old_cred; DEBUGF(infof(data, "schannel: re-using existing credential handle\n")); /* increment the reference counter of the credential/session handle */ BACKEND->cred->refcount++; DEBUGF(infof(data, "schannel: incremented credential handle refcount = %d\n", BACKEND->cred->refcount)); } Curl_ssl_sessionid_unlock(data); } if(!BACKEND->cred) { /* setup Schannel API options */ memset(&schannel_cred, 0, sizeof(schannel_cred)); schannel_cred.dwVersion = SCHANNEL_CRED_VERSION; if(conn->ssl_config.verifypeer) { #ifdef HAS_MANUAL_VERIFY_API if(BACKEND->use_manual_cred_validation) schannel_cred.dwFlags = SCH_CRED_MANUAL_CRED_VALIDATION; else #endif schannel_cred.dwFlags = SCH_CRED_AUTO_CRED_VALIDATION; if(SSL_SET_OPTION(no_revoke)) { schannel_cred.dwFlags |= SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE; DEBUGF(infof(data, "schannel: disabled server certificate revocation " "checks\n")); } else if(SSL_SET_OPTION(revoke_best_effort)) { schannel_cred.dwFlags |= SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE | SCH_CRED_REVOCATION_CHECK_CHAIN; DEBUGF(infof(data, "schannel: ignore revocation offline errors")); } else { schannel_cred.dwFlags |= SCH_CRED_REVOCATION_CHECK_CHAIN; DEBUGF(infof(data, "schannel: checking server certificate revocation\n")); } } else { schannel_cred.dwFlags = SCH_CRED_MANUAL_CRED_VALIDATION | SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE; DEBUGF(infof(data, "schannel: disabled server cert revocation checks\n")); } if(!conn->ssl_config.verifyhost) { schannel_cred.dwFlags |= SCH_CRED_NO_SERVERNAME_CHECK; DEBUGF(infof(data, "schannel: verifyhost setting prevents Schannel from " "comparing the supplied target name with the subject " "names in server certificates.\n")); } if(!SSL_SET_OPTION(auto_client_cert)) { schannel_cred.dwFlags &= ~SCH_CRED_USE_DEFAULT_CREDS; schannel_cred.dwFlags |= SCH_CRED_NO_DEFAULT_CREDS; infof(data, "schannel: disabled automatic use of client certificate\n"); } else infof(data, "schannel: enabled automatic use of client certificate\n"); switch(conn->ssl_config.version) { case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: case CURL_SSLVERSION_TLSv1_0: case CURL_SSLVERSION_TLSv1_1: case CURL_SSLVERSION_TLSv1_2: case CURL_SSLVERSION_TLSv1_3: { result = set_ssl_version_min_max(&schannel_cred, data, conn); if(result != CURLE_OK) return result; break; } case CURL_SSLVERSION_SSLv3: case CURL_SSLVERSION_SSLv2: failf(data, "SSL versions not supported"); return CURLE_NOT_BUILT_IN; default: failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); return CURLE_SSL_CONNECT_ERROR; } if(SSL_CONN_CONFIG(cipher_list)) { result = set_ssl_ciphers(&schannel_cred, SSL_CONN_CONFIG(cipher_list)); if(CURLE_OK != result) { failf(data, "Unable to set ciphers to passed via SSL_CONN_CONFIG"); return result; } } #ifdef HAS_CLIENT_CERT_PATH /* client certificate */ if(data->set.ssl.primary.clientcert || data->set.ssl.primary.cert_blob) { DWORD cert_store_name = 0; TCHAR *cert_store_path = NULL; TCHAR *cert_thumbprint_str = NULL; CRYPT_HASH_BLOB cert_thumbprint; BYTE cert_thumbprint_data[CERT_THUMBPRINT_DATA_LEN]; HCERTSTORE cert_store = NULL; FILE *fInCert = NULL; void *certdata = NULL; size_t certsize = 0; bool blob = data->set.ssl.primary.cert_blob != NULL; TCHAR *cert_path = NULL; if(blob) { certdata = data->set.ssl.primary.cert_blob->data; certsize = data->set.ssl.primary.cert_blob->len; } else { cert_path = curlx_convert_UTF8_to_tchar( data->set.ssl.primary.clientcert); if(!cert_path) return CURLE_OUT_OF_MEMORY; result = get_cert_location(cert_path, &cert_store_name, &cert_store_path, &cert_thumbprint_str); if(result && (data->set.ssl.primary.clientcert[0]!='\0')) fInCert = fopen(data->set.ssl.primary.clientcert, "rb"); if(result && !fInCert) { failf(data, "schannel: Failed to get certificate location" " or file for %s", data->set.ssl.primary.clientcert); curlx_unicodefree(cert_path); return result; } } if((fInCert || blob) && (data->set.ssl.cert_type) && (!strcasecompare(data->set.ssl.cert_type, "P12"))) { failf(data, "schannel: certificate format compatibility error " " for %s", blob ? "(memory blob)" : data->set.ssl.primary.clientcert); curlx_unicodefree(cert_path); return CURLE_SSL_CERTPROBLEM; } if(fInCert || blob) { /* Reading a .P12 or .pfx file, like the example at bottom of https://social.msdn.microsoft.com/Forums/windowsdesktop/ en-US/3e7bc95f-b21a-4bcd-bd2c-7f996718cae5 */ CRYPT_DATA_BLOB datablob; WCHAR* pszPassword; size_t pwd_len = 0; int str_w_len = 0; const char *cert_showfilename_error = blob ? "(memory blob)" : data->set.ssl.primary.clientcert; curlx_unicodefree(cert_path); if(fInCert) { long cert_tell = 0; bool continue_reading = fseek(fInCert, 0, SEEK_END) == 0; if(continue_reading) cert_tell = ftell(fInCert); if(cert_tell < 0) continue_reading = FALSE; else certsize = (size_t)cert_tell; if(continue_reading) continue_reading = fseek(fInCert, 0, SEEK_SET) == 0; if(continue_reading) certdata = malloc(certsize + 1); if((!certdata) || ((int) fread(certdata, certsize, 1, fInCert) != 1)) continue_reading = FALSE; fclose(fInCert); if(!continue_reading) { failf(data, "schannel: Failed to read cert file %s", data->set.ssl.primary.clientcert); free(certdata); return CURLE_SSL_CERTPROBLEM; } } /* Convert key-pair data to the in-memory certificate store */ datablob.pbData = (BYTE*)certdata; datablob.cbData = (DWORD)certsize; if(data->set.ssl.key_passwd != NULL) pwd_len = strlen(data->set.ssl.key_passwd); pszPassword = (WCHAR*)malloc(sizeof(WCHAR)*(pwd_len + 1)); if(pszPassword) { if(pwd_len > 0) str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, data->set.ssl.key_passwd, (int)pwd_len, pszPassword, (int)(pwd_len + 1)); if((str_w_len >= 0) && (str_w_len <= (int)pwd_len)) pszPassword[str_w_len] = 0; else pszPassword[0] = 0; cert_store = PFXImportCertStore(&datablob, pszPassword, 0); free(pszPassword); } if(!blob) free(certdata); if(!cert_store) { DWORD errorcode = GetLastError(); if(errorcode == ERROR_INVALID_PASSWORD) failf(data, "schannel: Failed to import cert file %s, " "password is bad", cert_showfilename_error); else failf(data, "schannel: Failed to import cert file %s, " "last error is 0x%x", cert_showfilename_error, errorcode); return CURLE_SSL_CERTPROBLEM; } client_certs[0] = CertFindCertificateInStore( cert_store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, NULL); if(!client_certs[0]) { failf(data, "schannel: Failed to get certificate from file %s" ", last error is 0x%x", cert_showfilename_error, GetLastError()); CertCloseStore(cert_store, 0); return CURLE_SSL_CERTPROBLEM; } schannel_cred.cCreds = 1; schannel_cred.paCred = client_certs; } else { cert_store = CertOpenStore(CURL_CERT_STORE_PROV_SYSTEM, 0, (HCRYPTPROV)NULL, CERT_STORE_OPEN_EXISTING_FLAG | cert_store_name, cert_store_path); if(!cert_store) { failf(data, "schannel: Failed to open cert store %x %s, " "last error is 0x%x", cert_store_name, cert_store_path, GetLastError()); free(cert_store_path); curlx_unicodefree(cert_path); return CURLE_SSL_CERTPROBLEM; } free(cert_store_path); cert_thumbprint.pbData = cert_thumbprint_data; cert_thumbprint.cbData = CERT_THUMBPRINT_DATA_LEN; if(!CryptStringToBinary(cert_thumbprint_str, CERT_THUMBPRINT_STR_LEN, CRYPT_STRING_HEX, cert_thumbprint_data, &cert_thumbprint.cbData, NULL, NULL)) { curlx_unicodefree(cert_path); CertCloseStore(cert_store, 0); return CURLE_SSL_CERTPROBLEM; } client_certs[0] = CertFindCertificateInStore( cert_store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_HASH, &cert_thumbprint, NULL); curlx_unicodefree(cert_path); if(client_certs[0]) { schannel_cred.cCreds = 1; schannel_cred.paCred = client_certs; } else { /* CRYPT_E_NOT_FOUND / E_INVALIDARG */ CertCloseStore(cert_store, 0); return CURLE_SSL_CERTPROBLEM; } } CertCloseStore(cert_store, 0); } #else if(data->set.ssl.primary.clientcert || data->set.ssl.primary.cert_blob) { failf(data, "schannel: client cert support not built in"); return CURLE_NOT_BUILT_IN; } #endif /* allocate memory for the re-usable credential handle */ BACKEND->cred = (struct Curl_schannel_cred *) calloc(1, sizeof(struct Curl_schannel_cred)); if(!BACKEND->cred) { failf(data, "schannel: unable to allocate memory"); if(client_certs[0]) CertFreeCertificateContext(client_certs[0]); return CURLE_OUT_OF_MEMORY; } BACKEND->cred->refcount = 1; /* https://msdn.microsoft.com/en-us/library/windows/desktop/aa374716.aspx */ sspi_status = s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *)UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, &schannel_cred, NULL, NULL, &BACKEND->cred->cred_handle, &BACKEND->cred->time_stamp); if(client_certs[0]) CertFreeCertificateContext(client_certs[0]); if(sspi_status != SEC_E_OK) { char buffer[STRERROR_LEN]; failf(data, "schannel: AcquireCredentialsHandle failed: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); Curl_safefree(BACKEND->cred); switch(sspi_status) { case SEC_E_INSUFFICIENT_MEMORY: return CURLE_OUT_OF_MEMORY; case SEC_E_NO_CREDENTIALS: case SEC_E_SECPKG_NOT_FOUND: case SEC_E_NOT_OWNER: case SEC_E_UNKNOWN_CREDENTIALS: case SEC_E_INTERNAL_ERROR: default: return CURLE_SSL_CONNECT_ERROR; } } } /* Warn if SNI is disabled due to use of an IP address */ if(Curl_inet_pton(AF_INET, hostname, &addr) #ifdef ENABLE_IPV6 || Curl_inet_pton(AF_INET6, hostname, &addr6) #endif ) { infof(data, "schannel: using IP address, SNI is not supported by OS.\n"); } #ifdef HAS_ALPN if(BACKEND->use_alpn) { int cur = 0; int list_start_index = 0; unsigned int *extension_len = NULL; unsigned short* list_len = NULL; /* The first four bytes will be an unsigned int indicating number of bytes of data in the rest of the buffer. */ extension_len = (unsigned int *)(&alpn_buffer[cur]); cur += sizeof(unsigned int); /* The next four bytes are an indicator that this buffer will contain ALPN data, as opposed to NPN, for example. */ *(unsigned int *)&alpn_buffer[cur] = SecApplicationProtocolNegotiationExt_ALPN; cur += sizeof(unsigned int); /* The next two bytes will be an unsigned short indicating the number of bytes used to list the preferred protocols. */ list_len = (unsigned short*)(&alpn_buffer[cur]); cur += sizeof(unsigned short); list_start_index = cur; #ifdef USE_HTTP2 if(data->state.httpwant >= CURL_HTTP_VERSION_2) { memcpy(&alpn_buffer[cur], ALPN_H2, ALPN_H2_LENGTH); cur += ALPN_H2_LENGTH; infof(data, "schannel: ALPN, offering %s\n", ALPN_H2); } #endif alpn_buffer[cur++] = ALPN_HTTP_1_1_LENGTH; memcpy(&alpn_buffer[cur], ALPN_HTTP_1_1, ALPN_HTTP_1_1_LENGTH); cur += ALPN_HTTP_1_1_LENGTH; infof(data, "schannel: ALPN, offering %s\n", ALPN_HTTP_1_1); *list_len = curlx_uitous(cur - list_start_index); *extension_len = *list_len + sizeof(unsigned int) + sizeof(unsigned short); InitSecBuffer(&inbuf, SECBUFFER_APPLICATION_PROTOCOLS, alpn_buffer, cur); InitSecBufferDesc(&inbuf_desc, &inbuf, 1); } else { InitSecBuffer(&inbuf, SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&inbuf_desc, &inbuf, 1); } #else /* HAS_ALPN */ InitSecBuffer(&inbuf, SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&inbuf_desc, &inbuf, 1); #endif /* setup output buffer */ InitSecBuffer(&outbuf, SECBUFFER_EMPTY, NULL, 0); InitSecBufferDesc(&outbuf_desc, &outbuf, 1); /* security request flags */ BACKEND->req_flags = ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT | ISC_REQ_CONFIDENTIALITY | ISC_REQ_ALLOCATE_MEMORY | ISC_REQ_STREAM; if(!SSL_SET_OPTION(auto_client_cert)) { BACKEND->req_flags |= ISC_REQ_USE_SUPPLIED_CREDS; } /* allocate memory for the security context handle */ BACKEND->ctxt = (struct Curl_schannel_ctxt *) calloc(1, sizeof(struct Curl_schannel_ctxt)); if(!BACKEND->ctxt) { failf(data, "schannel: unable to allocate memory"); return CURLE_OUT_OF_MEMORY; } host_name = curlx_convert_UTF8_to_tchar(hostname); if(!host_name) return CURLE_OUT_OF_MEMORY; /* Schannel InitializeSecurityContext: https://msdn.microsoft.com/en-us/library/windows/desktop/aa375924.aspx At the moment we don't pass inbuf unless we're using ALPN since we only use it for that, and Wine (for which we currently disable ALPN) is giving us problems with inbuf regardless. https://github.com/curl/curl/issues/983 */ sspi_status = s_pSecFn->InitializeSecurityContext( &BACKEND->cred->cred_handle, NULL, host_name, BACKEND->req_flags, 0, 0, (BACKEND->use_alpn ? &inbuf_desc : NULL), 0, &BACKEND->ctxt->ctxt_handle, &outbuf_desc, &BACKEND->ret_flags, &BACKEND->ctxt->time_stamp); curlx_unicodefree(host_name); if(sspi_status != SEC_I_CONTINUE_NEEDED) { char buffer[STRERROR_LEN]; Curl_safefree(BACKEND->ctxt); switch(sspi_status) { case SEC_E_INSUFFICIENT_MEMORY: failf(data, "schannel: initial InitializeSecurityContext failed: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); return CURLE_OUT_OF_MEMORY; case SEC_E_WRONG_PRINCIPAL: failf(data, "schannel: SNI or certificate check failed: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); return CURLE_PEER_FAILED_VERIFICATION; /* case SEC_E_INVALID_HANDLE: case SEC_E_INVALID_TOKEN: case SEC_E_LOGON_DENIED: case SEC_E_TARGET_UNKNOWN: case SEC_E_NO_AUTHENTICATING_AUTHORITY: case SEC_E_INTERNAL_ERROR: case SEC_E_NO_CREDENTIALS: case SEC_E_UNSUPPORTED_FUNCTION: case SEC_E_APPLICATION_PROTOCOL_MISMATCH: */ default: failf(data, "schannel: initial InitializeSecurityContext failed: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); return CURLE_SSL_CONNECT_ERROR; } } DEBUGF(infof(data, "schannel: sending initial handshake data: " "sending %lu bytes...\n", outbuf.cbBuffer)); /* send initial handshake data which is now stored in output buffer */ result = Curl_write_plain(data, conn->sock[sockindex], outbuf.pvBuffer, outbuf.cbBuffer, &written); s_pSecFn->FreeContextBuffer(outbuf.pvBuffer); if((result != CURLE_OK) || (outbuf.cbBuffer != (size_t) written)) { failf(data, "schannel: failed to send initial handshake data: " "sent %zd of %lu bytes", written, outbuf.cbBuffer); return CURLE_SSL_CONNECT_ERROR; } DEBUGF(infof(data, "schannel: sent initial handshake data: " "sent %zd bytes\n", written)); BACKEND->recv_unrecoverable_err = CURLE_OK; BACKEND->recv_sspi_close_notify = false; BACKEND->recv_connection_closed = false; BACKEND->encdata_is_incomplete = false; /* continue to second handshake step */ connssl->connecting_state = ssl_connect_2; return CURLE_OK; }
2622
True
1
CVE-2021-22897
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:N/A:N
NETWORK
MEDIUM
NONE
PARTIAL
NONE
NONE
4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
False
[{'url': 'https://curl.se/docs/CVE-2021-22897.html', 'name': 'https://curl.se/docs/CVE-2021-22897.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/curl/curl/commit/bbb71507b7bab52002f9b1e0880bed6a32834511', 'name': 'https://github.com/curl/curl/commit/bbb71507b7bab52002f9b1e0880bed6a32834511', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://hackerone.com/reports/1172857', 'name': 'https://hackerone.com/reports/1172857', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-668'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.61.0', 'versionEndIncluding': '7.76.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionStartIncluding': '21.0', 'versionEndExcluding': '21.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.1.2.4.047', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.34', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_slice_selection_function:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_service_communication_proxy:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_binding_support_function:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire_\\&_hci_management_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:solidfire_baseboard_management_controller_firmware:-:*:*:*:*:*:*:*', '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:hci_compute_node_firmware:-:*:*:*:*:*:*:*', '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: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: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: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: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: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: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:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'curl 7.61.0 through 7.76.1 suffers from exposure of data element to wrong session due to a mistake in the code for CURLOPT_SSL_CIPHER_LIST when libcurl is built to use the Schannel TLS library. The selected cipher set was stored in a single "static" variable in the library, which has the surprising side-effect that if an application sets up multiple concurrent transfers, the last one that sets the ciphers will accidentally control the set used by all transfers. In a worst-case scenario, this weakens transport security significantly.'}]
2022-05-13T17:29Z
2021-06-11T16:15Z
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files. A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system. In either case, the end result is that a resource has been exposed to the wrong party.
https://cwe.mitre.org/data/definitions/668.html
0
Daniel Stenberg
2021-04-23 10:54:10+02:00
schannel: don't use static to store selected ciphers CVE-2021-22897 Bug: https://curl.se/docs/CVE-2021-22897.html
bbb71507b7bab52002f9b1e0880bed6a32834511
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
set_ssl_ciphers
set_ssl_ciphers( SCHANNEL_CRED * schannel_cred , char * ciphers)
['schannel_cred', 'ciphers']
set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers) { char *startCur = ciphers; int algCount = 0; static ALG_ID algIds[45]; /*There are 45 listed in the MS headers*/ while(startCur && (0 != *startCur) && (algCount < 45)) { long alg = strtol(startCur, 0, 0); if(!alg) alg = get_alg_id_by_name(startCur); if(alg) algIds[algCount++] = alg; else if(!strncmp(startCur, "USE_STRONG_CRYPTO", sizeof("USE_STRONG_CRYPTO") - 1) || !strncmp(startCur, "SCH_USE_STRONG_CRYPTO", sizeof("SCH_USE_STRONG_CRYPTO") - 1)) schannel_cred->dwFlags |= SCH_USE_STRONG_CRYPTO; else return CURLE_SSL_CIPHER; startCur = strchr(startCur, ':'); if(startCur) startCur++; } schannel_cred->palgSupportedAlgs = algIds; schannel_cred->cSupportedAlgs = algCount; return CURLE_OK; }
159
True
1
CVE-2021-22898
False
False
False
True
AV:N/AC:H/Au:N/C:P/I:N/A:N
NETWORK
HIGH
NONE
PARTIAL
NONE
NONE
2.6
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
NETWORK
HIGH
NONE
REQUIRED
UNCHANGED
LOW
NONE
NONE
3.1
LOW
1.6
1.4
False
[{'url': 'https://hackerone.com/reports/1176461', 'name': 'https://hackerone.com/reports/1176461', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/curl/curl/commit/39ce47f219b09c380b81f89fe54ac586c8db6bde', 'name': 'https://github.com/curl/curl/commit/39ce47f219b09c380b81f89fe54ac586c8db6bde', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://curl.se/docs/CVE-2021-22898.html', 'name': 'https://curl.se/docs/CVE-2021-22898.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://lists.apache.org/thread.html/rc713534b10f9daeee2e0990239fa407e2118e4aa9e88a7041177497c@%3Cissues.guacamole.apache.org%3E', 'name': '[guacamole-issues] 20210618 [jira] [Created] (GUACAMOLE-1368) Latest docker image fails security scans.', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2021/07/21/4', 'name': '[oss-security] 20210721 [SECURITY ADVISORY] curl: TELNET stack contents disclosure again', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/POOC3UV7V6L4CJ5KA2PTWTNUV5Y72T3Q/', 'name': 'FEDORA-2021-83fdddca0f', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/FRUCW2UVNYUDZF72DQLFQR4PJEC6CF7V/', 'name': 'FEDORA-2021-5d21b90a30', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/08/msg00017.html', 'name': '[debian-lts-announce] 20210813 [SECURITY] [DLA 2734-1] curl security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5197', 'name': 'DSA-5197', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-909'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.7', 'versionEndIncluding': '7.76.1', '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:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.15', 'versionEndExcluding': '8.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.34', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionStartIncluding': '21.0', 'versionEndExcluding': '21.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.1.2.4.047', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_slice_selection_function:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_service_communication_proxy:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_binding_support_function:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'curl 7.7 through 7.76.1 suffers from an information disclosure when the `-t` command line option, known as `CURLOPT_TELNETOPTIONS` in libcurl, is used to send variable=content pairs to TELNET servers. Due to a flaw in the option parser for sending NEW_ENV variables, libcurl could be made to pass on uninitialized data from a stack based buffer to the server, resulting in potentially revealing sensitive internal information to the server using a clear-text network protocol.'}]
2022-08-02T03:15Z
2021-06-11T16:15Z
Missing Initialization of Resource
The software does not initialize a critical resource.
Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.
https://cwe.mitre.org/data/definitions/909.html
0
Harry Sintonen
2021-05-07 13:09:57+02:00
telnet: check sscanf() for correct number of matches CVE-2021-22898 Bug: https://curl.se/docs/CVE-2021-22898.html
39ce47f219b09c380b81f89fe54ac586c8db6bde
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
suboption
suboption( struct Curl_easy * data)
['data']
static void suboption(struct Curl_easy *data) { struct curl_slist *v; unsigned char temp[2048]; ssize_t bytes_written; size_t len; int err; char varname[128] = ""; char varval[128] = ""; struct TELNET *tn = data->req.p.telnet; struct connectdata *conn = data->conn; printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn) + 2); switch(CURL_SB_GET(tn)) { case CURL_TELOPT_TTYPE: len = strlen(tn->subopt_ttype) + 4 + 2; msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", CURL_IAC, CURL_SB, CURL_TELOPT_TTYPE, CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC, CURL_SE); bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); if(bytes_written < 0) { err = SOCKERRNO; failf(data,"Sending data failed (%d)",err); } printsub(data, '>', &temp[2], len-2); break; case CURL_TELOPT_XDISPLOC: len = strlen(tn->subopt_xdisploc) + 4 + 2; msnprintf((char *)temp, sizeof(temp), "%c%c%c%c%s%c%c", CURL_IAC, CURL_SB, CURL_TELOPT_XDISPLOC, CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC, CURL_SE); bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); if(bytes_written < 0) { err = SOCKERRNO; failf(data,"Sending data failed (%d)",err); } printsub(data, '>', &temp[2], len-2); break; case CURL_TELOPT_NEW_ENVIRON: msnprintf((char *)temp, sizeof(temp), "%c%c%c%c", CURL_IAC, CURL_SB, CURL_TELOPT_NEW_ENVIRON, CURL_TELQUAL_IS); len = 4; for(v = tn->telnet_vars; v; v = v->next) { size_t tmplen = (strlen(v->data) + 1); /* Add the variable only if it fits */ if(len + tmplen < (int)sizeof(temp)-6) { if(sscanf(v->data, "%127[^,],%127s", varname, varval)) { msnprintf((char *)&temp[len], sizeof(temp) - len, "%c%s%c%s", CURL_NEW_ENV_VAR, varname, CURL_NEW_ENV_VALUE, varval); len += tmplen; } } } msnprintf((char *)&temp[len], sizeof(temp) - len, "%c%c", CURL_IAC, CURL_SE); len += 2; bytes_written = swrite(conn->sock[FIRSTSOCKET], temp, len); if(bytes_written < 0) { err = SOCKERRNO; failf(data,"Sending data failed (%d)",err); } printsub(data, '>', &temp[2], len-2); break; } return; }
528
True
1
CVE-2021-22901
False
False
False
False
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:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
HIGH
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
8.1
HIGH
2.2
5.9
False
[{'url': 'https://curl.se/docs/CVE-2021-22901.html', 'name': 'https://curl.se/docs/CVE-2021-22901.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://hackerone.com/reports/1180380', 'name': 'https://hackerone.com/reports/1180380', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/curl/curl/commit/7f4a9a9b2a49547eae24d2e19bc5c346e9026479', 'name': 'https://github.com/curl/curl/commit/7f4a9a9b2a49547eae24d2e19bc5c346e9026479', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210723-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20210723-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-732250.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-732250.pdf', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.75.0', 'versionEndIncluding': '7.76.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionStartIncluding': '21.0', 'versionEndExcluding': '21.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.1.2.4.047', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.34', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_slice_selection_function:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_service_communication_proxy:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_binding_support_function:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:-:*:*:*:*:windows:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:solidfire_baseboard_management_controller_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire\\,_enterprise_sds_\\&_hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vsphere:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:hci_compute_node_firmware:-:*:*:*:*:*:*:*', '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: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: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: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: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: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: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:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'curl 7.75.0 through 7.76.1 suffers from a use-after-free vulnerability resulting in already freed memory being used when a TLS 1.3 session ticket arrives over a connection. A malicious server can use this in rare unfortunate circumstances to potentially reach remote code execution in the client. When libcurl at run-time sets up support for TLS 1.3 session tickets on a connection using OpenSSL, it stores pointers to the transfer in-memory object for later retrieval when a session ticket arrives. If the connection is used by multiple transfers (like with a reused HTTP/1.1 connection or multiplexed HTTP/2 connection) that first transfer object might be freed before the new session is established on that connection and then the function will access a memory buffer that might be freed. When using that memory, libcurl might even call a function pointer in the object, making it possible for a remote code execution if the server could somehow manage to get crafted memory content into the correct place in memory.'}]
2022-05-13T17:30Z
2021-06-11T16: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
Harry Sintonen
2021-05-05 13:42:26+02:00
openssl: associate/detach the transfer from connection CVE-2021-22901 Bug: https://curl.se/docs/CVE-2021-22901.html
7f4a9a9b2a49547eae24d2e19bc5c346e9026479
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
Curl_detach_connnection
Curl_detach_connnection( struct Curl_easy * data)
['data']
void Curl_detach_connnection(struct Curl_easy *data) { struct connectdata *conn = data->conn; if(conn) Curl_llist_remove(&conn->easyq, &data->conn_queue, NULL); data->conn = NULL; }
43
True
1
CVE-2021-22901
False
False
False
False
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:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
HIGH
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
8.1
HIGH
2.2
5.9
False
[{'url': 'https://curl.se/docs/CVE-2021-22901.html', 'name': 'https://curl.se/docs/CVE-2021-22901.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://hackerone.com/reports/1180380', 'name': 'https://hackerone.com/reports/1180380', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/curl/curl/commit/7f4a9a9b2a49547eae24d2e19bc5c346e9026479', 'name': 'https://github.com/curl/curl/commit/7f4a9a9b2a49547eae24d2e19bc5c346e9026479', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210723-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20210723-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-732250.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-732250.pdf', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.75.0', 'versionEndIncluding': '7.76.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionStartIncluding': '21.0', 'versionEndExcluding': '21.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.1.2.4.047', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.34', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_slice_selection_function:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_service_communication_proxy:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_binding_support_function:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:-:*:*:*:*:windows:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:solidfire_baseboard_management_controller_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire\\,_enterprise_sds_\\&_hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vsphere:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:hci_compute_node_firmware:-:*:*:*:*:*:*:*', '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: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: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: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: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: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: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:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'curl 7.75.0 through 7.76.1 suffers from a use-after-free vulnerability resulting in already freed memory being used when a TLS 1.3 session ticket arrives over a connection. A malicious server can use this in rare unfortunate circumstances to potentially reach remote code execution in the client. When libcurl at run-time sets up support for TLS 1.3 session tickets on a connection using OpenSSL, it stores pointers to the transfer in-memory object for later retrieval when a session ticket arrives. If the connection is used by multiple transfers (like with a reused HTTP/1.1 connection or multiplexed HTTP/2 connection) that first transfer object might be freed before the new session is established on that connection and then the function will access a memory buffer that might be freed. When using that memory, libcurl might even call a function pointer in the object, making it possible for a remote code execution if the server could somehow manage to get crafted memory content into the correct place in memory.'}]
2022-05-13T17:30Z
2021-06-11T16: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
Harry Sintonen
2021-05-05 13:42:26+02:00
openssl: associate/detach the transfer from connection CVE-2021-22901 Bug: https://curl.se/docs/CVE-2021-22901.html
7f4a9a9b2a49547eae24d2e19bc5c346e9026479
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
ossl_connect_step1
ossl_connect_step1( struct Curl_easy * data , struct connectdata * conn , int sockindex)
['data', 'conn', 'sockindex']
static CURLcode ossl_connect_step1(struct Curl_easy *data, struct connectdata *conn, int sockindex) { CURLcode result = CURLE_OK; char *ciphers; SSL_METHOD_QUAL SSL_METHOD *req_method = NULL; X509_LOOKUP *lookup = NULL; curl_socket_t sockfd = conn->sock[sockindex]; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; ctx_option_t ctx_options = 0; #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME bool sni; const char * const hostname = SSL_HOST_NAME(); #ifdef ENABLE_IPV6 struct in6_addr addr; #else struct in_addr addr; #endif #endif const long int ssl_version = SSL_CONN_CONFIG(version); #ifdef USE_OPENSSL_SRP const enum CURL_TLSAUTH ssl_authtype = SSL_SET_OPTION(authtype); #endif char * const ssl_cert = SSL_SET_OPTION(primary.clientcert); const struct curl_blob *ssl_cert_blob = SSL_SET_OPTION(primary.cert_blob); const struct curl_blob *ca_info_blob = SSL_CONN_CONFIG(ca_info_blob); const char * const ssl_cert_type = SSL_SET_OPTION(cert_type); const char * const ssl_cafile = /* CURLOPT_CAINFO_BLOB overrides CURLOPT_CAINFO */ (ca_info_blob ? NULL : SSL_CONN_CONFIG(CAfile)); const char * const ssl_capath = SSL_CONN_CONFIG(CApath); const bool verifypeer = SSL_CONN_CONFIG(verifypeer); const char * const ssl_crlfile = SSL_SET_OPTION(CRLfile); char error_buffer[256]; struct ssl_backend_data *backend = connssl->backend; bool imported_native_ca = false; DEBUGASSERT(ssl_connect_1 == connssl->connecting_state); /* Make funny stuff to get random input */ result = ossl_seed(data); if(result) return result; SSL_SET_OPTION_LVALUE(certverifyresult) = !X509_V_OK; /* check to see if we've been told to use an explicit SSL/TLS version */ switch(ssl_version) { case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: case CURL_SSLVERSION_TLSv1_0: case CURL_SSLVERSION_TLSv1_1: case CURL_SSLVERSION_TLSv1_2: case CURL_SSLVERSION_TLSv1_3: /* it will be handled later with the context options */ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) req_method = TLS_client_method(); #else req_method = SSLv23_client_method(); #endif use_sni(TRUE); break; case CURL_SSLVERSION_SSLv2: failf(data, "No SSLv2 support"); return CURLE_NOT_BUILT_IN; case CURL_SSLVERSION_SSLv3: failf(data, "No SSLv3 support"); return CURLE_NOT_BUILT_IN; default: failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); return CURLE_SSL_CONNECT_ERROR; } if(backend->ctx) SSL_CTX_free(backend->ctx); backend->ctx = SSL_CTX_new(req_method); if(!backend->ctx) { failf(data, "SSL: couldn't create a context: %s", ossl_strerror(ERR_peek_error(), error_buffer, sizeof(error_buffer))); return CURLE_OUT_OF_MEMORY; } #ifdef SSL_MODE_RELEASE_BUFFERS SSL_CTX_set_mode(backend->ctx, SSL_MODE_RELEASE_BUFFERS); #endif #ifdef SSL_CTRL_SET_MSG_CALLBACK if(data->set.fdebug && data->set.verbose) { /* the SSL trace callback is only used for verbose logging */ SSL_CTX_set_msg_callback(backend->ctx, ossl_trace); SSL_CTX_set_msg_callback_arg(backend->ctx, conn); set_logger(conn, data); } #endif /* OpenSSL contains code to work-around lots of bugs and flaws in various SSL-implementations. SSL_CTX_set_options() is used to enabled those work-arounds. The man page for this option states that SSL_OP_ALL enables all the work-arounds and that "It is usually safe to use SSL_OP_ALL to enable the bug workaround options if compatibility with somewhat broken implementations is desired." The "-no_ticket" option was introduced in Openssl0.9.8j. It's a flag to disable "rfc4507bis session ticket support". rfc4507bis was later turned into the proper RFC5077 it seems: https://tools.ietf.org/html/rfc5077 The enabled extension concerns the session management. I wonder how often libcurl stops a connection and then resumes a TLS session. also, sending the session data is some overhead. .I suggest that you just use your proposed patch (which explicitly disables TICKET). If someone writes an application with libcurl and openssl who wants to enable the feature, one can do this in the SSL callback. SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed proper interoperability with web server Netscape Enterprise Server 2.0.1 which was released back in 1996. Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate CVE-2010-4180 when using previous OpenSSL versions we no longer enable this option regardless of OpenSSL version and SSL_OP_ALL definition. OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability (https://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit to SSL_OP_ALL that _disables_ that work-around despite the fact that SSL_OP_ALL is documented to do "rather harmless" workarounds. In order to keep the secure work-around, the SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set. */ ctx_options = SSL_OP_ALL; #ifdef SSL_OP_NO_TICKET ctx_options |= SSL_OP_NO_TICKET; #endif #ifdef SSL_OP_NO_COMPRESSION ctx_options |= SSL_OP_NO_COMPRESSION; #endif #ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG /* mitigate CVE-2010-4180 */ ctx_options &= ~SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG; #endif #ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS /* unless the user explicitly ask to allow the protocol vulnerability we use the work-around */ if(!SSL_SET_OPTION(enable_beast)) ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; #endif switch(ssl_version) { case CURL_SSLVERSION_SSLv2: case CURL_SSLVERSION_SSLv3: return CURLE_NOT_BUILT_IN; /* "--tlsv<x.y>" options mean TLS >= version <x.y> */ case CURL_SSLVERSION_DEFAULT: case CURL_SSLVERSION_TLSv1: /* TLS >= version 1.0 */ case CURL_SSLVERSION_TLSv1_0: /* TLS >= version 1.0 */ case CURL_SSLVERSION_TLSv1_1: /* TLS >= version 1.1 */ case CURL_SSLVERSION_TLSv1_2: /* TLS >= version 1.2 */ case CURL_SSLVERSION_TLSv1_3: /* TLS >= version 1.3 */ /* asking for any TLS version as the minimum, means no SSL versions allowed */ ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) /* 1.1.0 */ result = set_ssl_version_min_max(backend->ctx, conn); #else result = set_ssl_version_min_max_legacy(&ctx_options, data, conn, sockindex); #endif if(result != CURLE_OK) return result; break; default: failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION"); return CURLE_SSL_CONNECT_ERROR; } SSL_CTX_set_options(backend->ctx, ctx_options); #ifdef HAS_NPN if(conn->bits.tls_enable_npn) SSL_CTX_set_next_proto_select_cb(backend->ctx, select_next_proto_cb, data); #endif #ifdef HAS_ALPN if(conn->bits.tls_enable_alpn) { int cur = 0; unsigned char protocols[128]; #ifdef USE_HTTP2 if(data->state.httpwant >= CURL_HTTP_VERSION_2 #ifndef CURL_DISABLE_PROXY && (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy) #endif ) { protocols[cur++] = ALPN_H2_LENGTH; memcpy(&protocols[cur], ALPN_H2, ALPN_H2_LENGTH); cur += ALPN_H2_LENGTH; infof(data, "ALPN, offering %s\n", ALPN_H2); } #endif protocols[cur++] = ALPN_HTTP_1_1_LENGTH; memcpy(&protocols[cur], ALPN_HTTP_1_1, ALPN_HTTP_1_1_LENGTH); cur += ALPN_HTTP_1_1_LENGTH; infof(data, "ALPN, offering %s\n", ALPN_HTTP_1_1); /* expects length prefixed preference ordered list of protocols in wire * format */ if(SSL_CTX_set_alpn_protos(backend->ctx, protocols, cur)) { failf(data, "Error setting ALPN"); return CURLE_SSL_CONNECT_ERROR; } } #endif if(ssl_cert || ssl_cert_blob || ssl_cert_type) { if(!result && !cert_stuff(data, backend->ctx, ssl_cert, ssl_cert_blob, ssl_cert_type, SSL_SET_OPTION(key), SSL_SET_OPTION(key_blob), SSL_SET_OPTION(key_type), SSL_SET_OPTION(key_passwd))) result = CURLE_SSL_CERTPROBLEM; if(result) /* failf() is already done in cert_stuff() */ return result; } ciphers = SSL_CONN_CONFIG(cipher_list); if(!ciphers) ciphers = (char *)DEFAULT_CIPHER_SELECTION; if(ciphers) { if(!SSL_CTX_set_cipher_list(backend->ctx, ciphers)) { failf(data, "failed setting cipher list: %s", ciphers); return CURLE_SSL_CIPHER; } infof(data, "Cipher selection: %s\n", ciphers); } #ifdef HAVE_SSL_CTX_SET_CIPHERSUITES { char *ciphers13 = SSL_CONN_CONFIG(cipher_list13); if(ciphers13) { if(!SSL_CTX_set_ciphersuites(backend->ctx, ciphers13)) { failf(data, "failed setting TLS 1.3 cipher suite: %s", ciphers13); return CURLE_SSL_CIPHER; } infof(data, "TLS 1.3 cipher selection: %s\n", ciphers13); } } #endif #ifdef HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH /* OpenSSL 1.1.1 requires clients to opt-in for PHA */ SSL_CTX_set_post_handshake_auth(backend->ctx, 1); #endif #ifdef HAVE_SSL_CTX_SET_EC_CURVES { char *curves = SSL_CONN_CONFIG(curves); if(curves) { if(!SSL_CTX_set1_curves_list(backend->ctx, curves)) { failf(data, "failed setting curves list: '%s'", curves); return CURLE_SSL_CIPHER; } } } #endif #ifdef USE_OPENSSL_SRP if(ssl_authtype == CURL_TLSAUTH_SRP) { char * const ssl_username = SSL_SET_OPTION(username); infof(data, "Using TLS-SRP username: %s\n", ssl_username); if(!SSL_CTX_set_srp_username(backend->ctx, ssl_username)) { failf(data, "Unable to set SRP user name"); return CURLE_BAD_FUNCTION_ARGUMENT; } if(!SSL_CTX_set_srp_password(backend->ctx, SSL_SET_OPTION(password))) { failf(data, "failed setting SRP password"); return CURLE_BAD_FUNCTION_ARGUMENT; } if(!SSL_CONN_CONFIG(cipher_list)) { infof(data, "Setting cipher list SRP\n"); if(!SSL_CTX_set_cipher_list(backend->ctx, "SRP")) { failf(data, "failed setting SRP cipher list"); return CURLE_SSL_CIPHER; } } } #endif #if defined(USE_WIN32_CRYPTO) /* Import certificates from the Windows root certificate store if requested. https://stackoverflow.com/questions/9507184/ https://github.com/d3x0r/SACK/blob/master/src/netlib/ssl_layer.c#L1037 https://tools.ietf.org/html/rfc5280 */ if((SSL_CONN_CONFIG(verifypeer) || SSL_CONN_CONFIG(verifyhost)) && (SSL_SET_OPTION(native_ca_store))) { X509_STORE *store = SSL_CTX_get_cert_store(backend->ctx); HCERTSTORE hStore = CertOpenSystemStore(0, TEXT("ROOT")); if(hStore) { PCCERT_CONTEXT pContext = NULL; /* The array of enhanced key usage OIDs will vary per certificate and is declared outside of the loop so that rather than malloc/free each iteration we can grow it with realloc, when necessary. */ CERT_ENHKEY_USAGE *enhkey_usage = NULL; DWORD enhkey_usage_size = 0; /* This loop makes a best effort to import all valid certificates from the MS root store. If a certificate cannot be imported it is skipped. 'result' is used to store only hard-fail conditions (such as out of memory) that cause an early break. */ result = CURLE_OK; for(;;) { X509 *x509; FILETIME now; BYTE key_usage[2]; DWORD req_size; const unsigned char *encoded_cert; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) char cert_name[256]; #endif pContext = CertEnumCertificatesInStore(hStore, pContext); if(!pContext) break; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) if(!CertGetNameStringA(pContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, cert_name, sizeof(cert_name))) { strcpy(cert_name, "Unknown"); } infof(data, "SSL: Checking cert \"%s\"\n", cert_name); #endif encoded_cert = (const unsigned char *)pContext->pbCertEncoded; if(!encoded_cert) continue; GetSystemTimeAsFileTime(&now); if(CompareFileTime(&pContext->pCertInfo->NotBefore, &now) > 0 || CompareFileTime(&now, &pContext->pCertInfo->NotAfter) > 0) continue; /* If key usage exists check for signing attribute */ if(CertGetIntendedKeyUsage(pContext->dwCertEncodingType, pContext->pCertInfo, key_usage, sizeof(key_usage))) { if(!(key_usage[0] & CERT_KEY_CERT_SIGN_KEY_USAGE)) continue; } else if(GetLastError()) continue; /* If enhanced key usage exists check for server auth attribute. * * Note "In a Microsoft environment, a certificate might also have EKU * extended properties that specify valid uses for the certificate." * The call below checks both, and behavior varies depending on what is * found. For more details see CertGetEnhancedKeyUsage doc. */ if(CertGetEnhancedKeyUsage(pContext, 0, NULL, &req_size)) { if(req_size && req_size > enhkey_usage_size) { void *tmp = realloc(enhkey_usage, req_size); if(!tmp) { failf(data, "SSL: Out of memory allocating for OID list"); result = CURLE_OUT_OF_MEMORY; break; } enhkey_usage = (CERT_ENHKEY_USAGE *)tmp; enhkey_usage_size = req_size; } if(CertGetEnhancedKeyUsage(pContext, 0, enhkey_usage, &req_size)) { if(!enhkey_usage->cUsageIdentifier) { /* "If GetLastError returns CRYPT_E_NOT_FOUND, the certificate is good for all uses. If it returns zero, the certificate has no valid uses." */ if((HRESULT)GetLastError() != CRYPT_E_NOT_FOUND) continue; } else { DWORD i; bool found = false; for(i = 0; i < enhkey_usage->cUsageIdentifier; ++i) { if(!strcmp("1.3.6.1.5.5.7.3.1" /* OID server auth */, enhkey_usage->rgpszUsageIdentifier[i])) { found = true; break; } } if(!found) continue; } } else continue; } else continue; x509 = d2i_X509(NULL, &encoded_cert, pContext->cbCertEncoded); if(!x509) continue; /* Try to import the certificate. This may fail for legitimate reasons such as duplicate certificate, which is allowed by MS but not OpenSSL. */ if(X509_STORE_add_cert(store, x509) == 1) { #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) infof(data, "SSL: Imported cert \"%s\"\n", cert_name); #endif imported_native_ca = true; } X509_free(x509); } free(enhkey_usage); CertFreeCertificateContext(pContext); CertCloseStore(hStore, 0); if(result) return result; } if(imported_native_ca) infof(data, "successfully imported windows ca store\n"); else infof(data, "error importing windows ca store, continuing anyway\n"); } #endif if(ca_info_blob) { result = load_cacert_from_memory(backend->ctx, ca_info_blob); if(result) { if(result == CURLE_OUT_OF_MEMORY || (verifypeer && !imported_native_ca)) { failf(data, "error importing CA certificate blob"); return result; } /* Only warning if no certificate verification is required. */ infof(data, "error importing CA certificate blob, continuing anyway\n"); } } #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) /* OpenSSL 3.0.0 has deprecated SSL_CTX_load_verify_locations */ { if(ssl_cafile) { if(!SSL_CTX_load_verify_file(backend->ctx, ssl_cafile)) { if(verifypeer && !imported_native_ca) { /* Fail if we insist on successfully verifying the server. */ failf(data, "error setting certificate file: %s", ssl_cafile); return CURLE_SSL_CACERT_BADFILE; } /* Continue with a warning if no certificate verif is required. */ infof(data, "error setting certificate file, continuing anyway\n"); } infof(data, " CAfile: %s\n", ssl_cafile); } if(ssl_capath) { if(!SSL_CTX_load_verify_dir(backend->ctx, ssl_capath)) { if(verifypeer && !imported_native_ca) { /* Fail if we insist on successfully verifying the server. */ failf(data, "error setting certificate path: %s", ssl_capath); return CURLE_SSL_CACERT_BADFILE; } /* Continue with a warning if no certificate verif is required. */ infof(data, "error setting certificate path, continuing anyway\n"); } infof(data, " CApath: %s\n", ssl_capath); } } #else if(ssl_cafile || ssl_capath) { /* tell SSL where to find CA certificates that are used to verify the servers certificate. */ if(!SSL_CTX_load_verify_locations(backend->ctx, ssl_cafile, ssl_capath)) { if(verifypeer && !imported_native_ca) { /* Fail if we insist on successfully verifying the server. */ failf(data, "error setting certificate verify locations:" " CAfile: %s CApath: %s", ssl_cafile ? ssl_cafile : "none", ssl_capath ? ssl_capath : "none"); return CURLE_SSL_CACERT_BADFILE; } /* Just continue with a warning if no strict certificate verification is required. */ infof(data, "error setting certificate verify locations," " continuing anyway:\n"); } else { /* Everything is fine. */ infof(data, "successfully set certificate verify locations:\n"); } infof(data, " CAfile: %s\n", ssl_cafile ? ssl_cafile : "none"); infof(data, " CApath: %s\n", ssl_capath ? ssl_capath : "none"); } #endif #ifdef CURL_CA_FALLBACK if(verifypeer && !ca_info_blob && !ssl_cafile && !ssl_capath && !imported_native_ca) { /* verifying the peer without any CA certificates won't work so use openssl's built in default as fallback */ SSL_CTX_set_default_verify_paths(backend->ctx); } #endif if(ssl_crlfile) { /* tell SSL where to find CRL file that is used to check certificate * revocation */ lookup = X509_STORE_add_lookup(SSL_CTX_get_cert_store(backend->ctx), X509_LOOKUP_file()); if(!lookup || (!X509_load_crl_file(lookup, ssl_crlfile, X509_FILETYPE_PEM)) ) { failf(data, "error loading CRL file: %s", ssl_crlfile); return CURLE_SSL_CRL_BADFILE; } /* Everything is fine. */ infof(data, "successfully load CRL file:\n"); X509_STORE_set_flags(SSL_CTX_get_cert_store(backend->ctx), X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); infof(data, " CRLfile: %s\n", ssl_crlfile); } if(verifypeer) { /* Try building a chain using issuers in the trusted store first to avoid problems with server-sent legacy intermediates. Newer versions of OpenSSL do alternate chain checking by default but we do not know how to determine that in a reliable manner. https://rt.openssl.org/Ticket/Display.html?id=3621&user=guest&pass=guest */ #if defined(X509_V_FLAG_TRUSTED_FIRST) X509_STORE_set_flags(SSL_CTX_get_cert_store(backend->ctx), X509_V_FLAG_TRUSTED_FIRST); #endif #ifdef X509_V_FLAG_PARTIAL_CHAIN if(!SSL_SET_OPTION(no_partialchain) && !ssl_crlfile) { /* Have intermediate certificates in the trust store be treated as trust-anchors, in the same way as self-signed root CA certificates are. This allows users to verify servers using the intermediate cert only, instead of needing the whole chain. Due to OpenSSL bug https://github.com/openssl/openssl/issues/5081 we cannot do partial chains with CRL check. */ X509_STORE_set_flags(SSL_CTX_get_cert_store(backend->ctx), X509_V_FLAG_PARTIAL_CHAIN); } #endif } /* SSL always tries to verify the peer, this only says whether it should * fail to connect if the verification fails, or if it should continue * anyway. In the latter case the result of the verification is checked with * SSL_get_verify_result() below. */ SSL_CTX_set_verify(backend->ctx, verifypeer ? SSL_VERIFY_PEER : SSL_VERIFY_NONE, NULL); /* Enable logging of secrets to the file specified in env SSLKEYLOGFILE. */ #ifdef HAVE_KEYLOG_CALLBACK if(Curl_tls_keylog_enabled()) { SSL_CTX_set_keylog_callback(backend->ctx, ossl_keylog_callback); } #endif /* Enable the session cache because it's a prerequisite for the "new session" * callback. Use the "external storage" mode to avoid that OpenSSL creates * an internal session cache. */ SSL_CTX_set_session_cache_mode(backend->ctx, SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL); SSL_CTX_sess_set_new_cb(backend->ctx, ossl_new_session_cb); /* give application a chance to interfere with SSL set up. */ if(data->set.ssl.fsslctx) { Curl_set_in_callback(data, true); result = (*data->set.ssl.fsslctx)(data, backend->ctx, data->set.ssl.fsslctxp); Curl_set_in_callback(data, false); if(result) { failf(data, "error signaled by ssl ctx callback"); return result; } } /* Lets make an SSL structure */ if(backend->handle) SSL_free(backend->handle); backend->handle = SSL_new(backend->ctx); if(!backend->handle) { failf(data, "SSL: couldn't create a context (handle)!"); return CURLE_OUT_OF_MEMORY; } #if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_TLSEXT) && \ !defined(OPENSSL_NO_OCSP) if(SSL_CONN_CONFIG(verifystatus)) SSL_set_tlsext_status_type(backend->handle, TLSEXT_STATUSTYPE_ocsp); #endif #if defined(OPENSSL_IS_BORINGSSL) && defined(ALLOW_RENEG) SSL_set_renegotiate_mode(backend->handle, ssl_renegotiate_freely); #endif SSL_set_connect_state(backend->handle); backend->server_cert = 0x0; #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME if((0 == Curl_inet_pton(AF_INET, hostname, &addr)) && #ifdef ENABLE_IPV6 (0 == Curl_inet_pton(AF_INET6, hostname, &addr)) && #endif sni) { size_t nlen = strlen(hostname); if((long)nlen >= data->set.buffer_size) /* this is seriously messed up */ return CURLE_SSL_CONNECT_ERROR; /* RFC 6066 section 3 says the SNI field is case insensitive, but browsers send the data lowercase and subsequently there are now numerous servers out there that don't work unless the name is lowercased */ Curl_strntolower(data->state.buffer, hostname, nlen); data->state.buffer[nlen] = 0; if(!SSL_set_tlsext_host_name(backend->handle, data->state.buffer)) infof(data, "WARNING: failed to configure server name indication (SNI) " "TLS extension\n"); } #endif /* Check if there's a cached ID we can/should use here! */ if(SSL_SET_OPTION(primary.sessionid)) { void *ssl_sessionid = NULL; int data_idx = ossl_get_ssl_data_index(); int connectdata_idx = ossl_get_ssl_conn_index(); int sockindex_idx = ossl_get_ssl_sockindex_index(); int proxy_idx = ossl_get_proxy_index(); if(data_idx >= 0 && connectdata_idx >= 0 && sockindex_idx >= 0 && proxy_idx >= 0) { /* Store the data needed for the "new session" callback. * The sockindex is stored as a pointer to an array element. */ SSL_set_ex_data(backend->handle, data_idx, data); SSL_set_ex_data(backend->handle, connectdata_idx, conn); SSL_set_ex_data(backend->handle, sockindex_idx, conn->sock + sockindex); #ifndef CURL_DISABLE_PROXY SSL_set_ex_data(backend->handle, proxy_idx, SSL_IS_PROXY() ? (void *) 1: NULL); #else SSL_set_ex_data(backend->handle, proxy_idx, NULL); #endif } Curl_ssl_sessionid_lock(data); if(!Curl_ssl_getsessionid(data, conn, SSL_IS_PROXY() ? TRUE : FALSE, &ssl_sessionid, NULL, sockindex)) { /* we got a session id, use it! */ if(!SSL_set_session(backend->handle, ssl_sessionid)) { Curl_ssl_sessionid_unlock(data); failf(data, "SSL: SSL_set_session failed: %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); return CURLE_SSL_CONNECT_ERROR; } /* Informational message */ infof(data, "SSL re-using session ID\n"); } Curl_ssl_sessionid_unlock(data); } #ifndef CURL_DISABLE_PROXY if(conn->proxy_ssl[sockindex].use) { BIO *const bio = BIO_new(BIO_f_ssl()); SSL *handle = conn->proxy_ssl[sockindex].backend->handle; DEBUGASSERT(ssl_connection_complete == conn->proxy_ssl[sockindex].state); DEBUGASSERT(handle != NULL); DEBUGASSERT(bio != NULL); BIO_set_ssl(bio, handle, FALSE); SSL_set_bio(backend->handle, bio, bio); } else #endif if(!SSL_set_fd(backend->handle, (int)sockfd)) { /* pass the raw socket into the SSL layers */ failf(data, "SSL: SSL_set_fd failed: %s", ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer))); return CURLE_SSL_CONNECT_ERROR; } connssl->connecting_state = ssl_connect_2; return CURLE_OK; }
2696
True
1
CVE-2021-22901
False
False
False
False
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:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
HIGH
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
8.1
HIGH
2.2
5.9
False
[{'url': 'https://curl.se/docs/CVE-2021-22901.html', 'name': 'https://curl.se/docs/CVE-2021-22901.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://hackerone.com/reports/1180380', 'name': 'https://hackerone.com/reports/1180380', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/curl/curl/commit/7f4a9a9b2a49547eae24d2e19bc5c346e9026479', 'name': 'https://github.com/curl/curl/commit/7f4a9a9b2a49547eae24d2e19bc5c346e9026479', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com//security-alerts/cpujul2021.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210723-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20210723-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20210727-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'name': 'https://www.oracle.com/security-alerts/cpujan2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'name': 'https://www.oracle.com/security-alerts/cpuapr2022.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cert-portal.siemens.com/productcert/pdf/ssa-732250.pdf', 'name': 'https://cert-portal.siemens.com/productcert/pdf/ssa-732250.pdf', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.75.0', 'versionEndIncluding': '7.76.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionStartIncluding': '21.0', 'versionEndExcluding': '21.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:essbase:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.1.2.4.047', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.7.34', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_slice_selection_function:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_function_cloud_native_environment:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_service_communication_proxy:1.15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_network_repository_function:1.15.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:communications_cloud_native_core_binding_support_function:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:-:*:*:*:*:windows:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:solidfire_baseboard_management_controller_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire\\,_enterprise_sds_\\&_hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:-:*:*:*:*:vsphere:*:*', 'cpe_name': []}]}, {'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:netapp:hci_compute_node_firmware:-:*:*:*:*:*:*:*', '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: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: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: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: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: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: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:h700s_firmware:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:h:netapp:h700s:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:siemens:sinec_infrastructure_network_services:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.0.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'curl 7.75.0 through 7.76.1 suffers from a use-after-free vulnerability resulting in already freed memory being used when a TLS 1.3 session ticket arrives over a connection. A malicious server can use this in rare unfortunate circumstances to potentially reach remote code execution in the client. When libcurl at run-time sets up support for TLS 1.3 session tickets on a connection using OpenSSL, it stores pointers to the transfer in-memory object for later retrieval when a session ticket arrives. If the connection is used by multiple transfers (like with a reused HTTP/1.1 connection or multiplexed HTTP/2 connection) that first transfer object might be freed before the new session is established on that connection and then the function will access a memory buffer that might be freed. When using that memory, libcurl might even call a function pointer in the object, making it possible for a remote code execution if the server could somehow manage to get crafted memory content into the correct place in memory.'}]
2022-05-13T17:30Z
2021-06-11T16: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
Harry Sintonen
2021-05-05 13:42:26+02:00
openssl: associate/detach the transfer from connection CVE-2021-22901 Bug: https://curl.se/docs/CVE-2021-22901.html
7f4a9a9b2a49547eae24d2e19bc5c346e9026479
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
set_ssl_ciphers
set_ssl_ciphers( SCHANNEL_CRED * schannel_cred , char * ciphers , int * algIds)
['schannel_cred', 'ciphers', 'algIds']
set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, int *algIds) { char *startCur = ciphers; int algCount = 0; while(startCur && (0 != *startCur) && (algCount < NUMOF_CIPHERS)) { long alg = strtol(startCur, 0, 0); if(!alg) alg = get_alg_id_by_name(startCur); if(alg) algIds[algCount++] = alg; else if(!strncmp(startCur, "USE_STRONG_CRYPTO", sizeof("USE_STRONG_CRYPTO") - 1) || !strncmp(startCur, "SCH_USE_STRONG_CRYPTO", sizeof("SCH_USE_STRONG_CRYPTO") - 1)) schannel_cred->dwFlags |= SCH_USE_STRONG_CRYPTO; else return CURLE_SSL_CIPHER; startCur = strchr(startCur, ':'); if(startCur) startCur++; } schannel_cred->palgSupportedAlgs = algIds; schannel_cred->cSupportedAlgs = algCount; return CURLE_OK; }
156
True
1
CVE-2017-7407
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:N
LOCAL
LOW
NONE
PARTIAL
NONE
NONE
2.1
CVSS:3.0/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
PHYSICAL
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
2.4
LOW
0.9
1.4
True
[{'url': 'https://github.com/curl/curl/commit/1890d59905414ab84a35892b2e45833654aa5c13', 'name': 'https://github.com/curl/curl/commit/1890d59905414ab84a35892b2e45833654aa5c13', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://security.gentoo.org/glsa/201709-14', 'name': 'GLSA-201709-14', 'refsource': 'GENTOO', 'tags': []}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2018:3558', 'name': 'RHSA-2018:3558', 'refsource': 'REDHAT', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:7.53.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "The ourWriteOut function in tool_writeout.c in curl 7.53.1 might allow physically proximate attackers to obtain sensitive information from process memory in opportunistic circumstances by reading a workstation screen during use of a --write-out argument ending in a '%' character, which leads to a heap-based buffer over-read."}]
2019-10-03T00:03Z
2017-04-03T20: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
Dan Fandrich
2017-03-11 10:59:34+01:00
tool_writeout: fixed a buffer read overrun on --write-out If a % ended the statement, the string's trailing NUL would be skipped and memory past the end of the buffer would be accessed and potentially displayed as part of the --write-out output. Added tests 1440 and 1441 to check for this kind of condition. Reported-by: Brian Carpenter
1890d59905414ab84a35892b2e45833654aa5c13
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
ourWriteOut
ourWriteOut( CURL * curl , struct OutStruct * outs , const char * writeinfo)
['curl', 'outs', 'writeinfo']
void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo) { FILE *stream = stdout; const char *ptr = writeinfo; char *stringp = NULL; long longinfo; double doubleinfo; while(ptr && *ptr) { if('%' == *ptr) { if('%' == ptr[1]) { /* an escaped %-letter */ fputc('%', stream); ptr += 2; } else { /* this is meant as a variable to output */ char *end; char keepit; int i; if('{' == ptr[1]) { bool match = FALSE; end = strchr(ptr, '}'); ptr += 2; /* pass the % and the { */ if(!end) { fputs("%{", stream); continue; } keepit = *end; *end = 0; /* zero terminate */ for(i = 0; replacements[i].name; i++) { if(curl_strequal(ptr, replacements[i].name)) { match = TRUE; switch(replacements[i].id) { case VAR_EFFECTIVE_URL: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_HTTP_CODE: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &longinfo)) fprintf(stream, "%03ld", longinfo); break; case VAR_HTTP_CODE_PROXY: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_HTTP_CONNECTCODE, &longinfo)) fprintf(stream, "%03ld", longinfo); break; case VAR_HEADER_SIZE: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_REQUEST_SIZE: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_NUM_CONNECTS: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_REDIRECT_COUNT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REDIRECT_COUNT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_REDIRECT_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_TOTAL_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_NAMELOOKUP_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_CONNECT_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_APPCONNECT_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_PRETRANSFER_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_STARTTRANSFER_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &doubleinfo)) fprintf(stream, "%.6f", doubleinfo); break; case VAR_SIZE_UPLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &doubleinfo)) fprintf(stream, "%.0f", doubleinfo); break; case VAR_SIZE_DOWNLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &doubleinfo)) fprintf(stream, "%.0f", doubleinfo); break; case VAR_SPEED_DOWNLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_SPEED_UPLOAD: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_CONTENT_TYPE: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_FTP_ENTRY_PATH: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_REDIRECT_URL: if((CURLE_OK == curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &stringp)) && stringp) fputs(stringp, stream); break; case VAR_SSL_VERIFY_RESULT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_PROXY_SSL_VERIFY_RESULT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_EFFECTIVE_FILENAME: if(outs->filename) fprintf(stream, "%s", outs->filename); break; case VAR_PRIMARY_IP: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &stringp)) fprintf(stream, "%s", stringp); break; case VAR_PRIMARY_PORT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_LOCAL_IP: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_LOCAL_IP, &stringp)) fprintf(stream, "%s", stringp); break; case VAR_LOCAL_PORT: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_LOCAL_PORT, &longinfo)) fprintf(stream, "%ld", longinfo); break; case VAR_HTTP_VERSION: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION, &longinfo)) { const char *version = "0"; switch(longinfo) { case CURL_HTTP_VERSION_1_0: version = "1.0"; break; case CURL_HTTP_VERSION_1_1: version = "1.1"; break; case CURL_HTTP_VERSION_2_0: version = "2"; break; } fprintf(stream, version); } break; case VAR_SCHEME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_SCHEME, &stringp)) fprintf(stream, "%s", stringp); break; default: break; } break; } } if(!match) { fprintf(stderr, "curl: unknown --write-out variable: '%s'\n", ptr); } ptr = end + 1; /* pass the end */ *end = keepit; } else { /* illegal syntax, then just output the characters that are used */ fputc('%', stream); fputc(ptr[1], stream); ptr += 2; } } } else if('\\' == *ptr) { switch(ptr[1]) { case 'r': fputc('\r', stream); break; case 'n': fputc('\n', stream); break; case 't': fputc('\t', stream); break; default: /* unknown, just output this */ fputc(*ptr, stream); fputc(ptr[1], stream); break; } ptr += 2; } else { fputc(*ptr, stream); ptr++; } } }
1234
True
1
CVE-2018-0500
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.0/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/curl/curl/commit/ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628', 'name': 'https://github.com/curl/curl/commit/ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://curl.haxx.se/docs/adv_2018-70a2.html', 'name': 'https://curl.haxx.se/docs/adv_2018-70a2.html', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://usn.ubuntu.com/3710-1/', 'name': 'USN-3710-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1041280', 'name': '1041280', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:2486', 'name': 'RHSA-2018:2486', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201807-04', 'name': 'GLSA-201807-04', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.54.1', 'versionEndIncluding': '7.60.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:17.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Curl_smtp_escape_eob in lib/smtp.c in curl 7.54.1 to and including curl 7.60.0 has a heap-based buffer overflow that might be exploitable by an attacker who can control the data that curl transmits over SMTP with certain settings (i.e., use of a nonstandard --limit-rate argument or CURLOPT_BUFFERSIZE value).'}]
2020-08-24T17:37Z
2018-07-11T13: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
Daniel Stenberg
2018-06-13 12:24:40+02:00
smtp: use the upload buffer size for scratch buffer malloc ... not the read buffer size, as that can be set smaller and thus cause a buffer overflow! CVE-2018-0500 Reported-by: Peter Wu Bug: https://curl.haxx.se/docs/adv_2018-70a2.html
ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
Curl_smtp_escape_eob
Curl_smtp_escape_eob( struct connectdata * conn , const ssize_t nread)
['conn', 'nread']
CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread) { /* When sending a SMTP payload we must detect CRLF. sequences making sure they are sent as CRLF.. instead, as a . on the beginning of a line will be deleted by the server when not part of an EOB terminator and a genuine CRLF.CRLF which isn't escaped will wrongly be detected as end of data by the server */ ssize_t i; ssize_t si; struct Curl_easy *data = conn->data; struct SMTP *smtp = data->req.protop; char *scratch = data->state.scratch; char *newscratch = NULL; char *oldscratch = NULL; size_t eob_sent; /* Do we need to allocate a scratch buffer? */ if(!scratch || data->set.crlf) { oldscratch = scratch; scratch = newscratch = malloc(2 * data->set.buffer_size); if(!newscratch) { failf(data, "Failed to alloc scratch buffer!"); return CURLE_OUT_OF_MEMORY; } } /* Have we already sent part of the EOB? */ eob_sent = smtp->eob; /* This loop can be improved by some kind of Boyer-Moore style of approach but that is saved for later... */ for(i = 0, si = 0; i < nread; i++) { if(SMTP_EOB[smtp->eob] == data->req.upload_fromhere[i]) { smtp->eob++; /* Is the EOB potentially the terminating CRLF? */ if(2 == smtp->eob || SMTP_EOB_LEN == smtp->eob) smtp->trailing_crlf = TRUE; else smtp->trailing_crlf = FALSE; } else if(smtp->eob) { /* A previous substring matched so output that first */ memcpy(&scratch[si], &SMTP_EOB[eob_sent], smtp->eob - eob_sent); si += smtp->eob - eob_sent; /* Then compare the first byte */ if(SMTP_EOB[0] == data->req.upload_fromhere[i]) smtp->eob = 1; else smtp->eob = 0; eob_sent = 0; /* Reset the trailing CRLF flag as there was more data */ smtp->trailing_crlf = FALSE; } /* Do we have a match for CRLF. as per RFC-5321, sect. 4.5.2 */ if(SMTP_EOB_FIND_LEN == smtp->eob) { /* Copy the replacement data to the target buffer */ memcpy(&scratch[si], &SMTP_EOB_REPL[eob_sent], SMTP_EOB_REPL_LEN - eob_sent); si += SMTP_EOB_REPL_LEN - eob_sent; smtp->eob = 0; eob_sent = 0; } else if(!smtp->eob) scratch[si++] = data->req.upload_fromhere[i]; } if(smtp->eob - eob_sent) { /* A substring matched before processing ended so output that now */ memcpy(&scratch[si], &SMTP_EOB[eob_sent], smtp->eob - eob_sent); si += smtp->eob - eob_sent; } /* Only use the new buffer if we replaced something */ if(si != nread) { /* Upload from the new (replaced) buffer instead */ data->req.upload_fromhere = scratch; /* Save the buffer so it can be freed later */ data->state.scratch = scratch; /* Free the old scratch buffer */ free(oldscratch); /* Set the new amount too */ data->req.upload_present = si; } else free(newscratch); return CURLE_OK; }
420
True
1
CVE-2018-16840
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.0/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/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3f', 'name': 'https://github.com/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3f', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://curl.haxx.se/docs/CVE-2018-16840.html', 'name': 'https://curl.haxx.se/docs/CVE-2018-16840.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16840', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16840', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3805-1/', 'name': 'USN-3805-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1042013', 'name': '1042013', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201903-03', 'name': 'GLSA-201903-03', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.59.0', 'versionEndIncluding': '7.61.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux: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 heap use-after-free flaw was found in curl versions from 7.59.0 through 7.61.1 in the code related to closing an easy handle. When closing and cleaning up an 'easy' handle in the `Curl_close()` function, the library code first frees a struct (without nulling the pointer) and might then subsequently erroneously write to a struct field within that already freed struct."}]
2019-10-09T23:36Z
2018-10-31T18:29Z
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
Daniel Stenberg
2018-10-18 15:07:15+02:00
Curl_close: clear data->multi_easy on free to avoid use-after-free Regression from b46cfbc068 (7.59.0) CVE-2018-16840 Reported-by: Brian Carpenter (Geeknik Labs) Bug: https://curl.haxx.se/docs/CVE-2018-16840.html
81d135d67155c5295b1033679c606165d4e28f3f
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
Curl_close
Curl_close( struct Curl_easy * data)
['data']
CURLcode Curl_close(struct Curl_easy *data) { struct Curl_multi *m; if(!data) return CURLE_OK; Curl_expire_clear(data); /* shut off timers */ m = data->multi; if(m) /* This handle is still part of a multi handle, take care of this first and detach this handle from there. */ curl_multi_remove_handle(data->multi, data); if(data->multi_easy) /* when curl_easy_perform() is used, it creates its own multi handle to use and this is the one */ curl_multi_cleanup(data->multi_easy); /* Destroy the timeout list that is held in the easy handle. It is /normally/ done by curl_multi_remove_handle() but this is "just in case" */ Curl_llist_destroy(&data->state.timeoutlist, NULL); data->magic = 0; /* force a clear AFTER the possibly enforced removal from the multi handle, since that function uses the magic field! */ if(data->state.rangestringalloc) free(data->state.range); /* freed here just in case DONE wasn't called */ Curl_free_request_state(data); /* Close down all open SSL info and sessions */ Curl_ssl_close_all(data); Curl_safefree(data->state.first_host); Curl_safefree(data->state.scratch); Curl_ssl_free_certinfo(data); /* Cleanup possible redirect junk */ free(data->req.newurl); data->req.newurl = NULL; if(data->change.referer_alloc) { Curl_safefree(data->change.referer); data->change.referer_alloc = FALSE; } data->change.referer = NULL; Curl_up_free(data); Curl_safefree(data->state.buffer); Curl_safefree(data->state.headerbuff); Curl_safefree(data->state.ulbuf); Curl_flush_cookies(data, 1); Curl_digest_cleanup(data); Curl_safefree(data->info.contenttype); Curl_safefree(data->info.wouldredirect); /* this destroys the channel and we cannot use it anymore after this */ Curl_resolver_cleanup(data->state.resolver); Curl_http2_cleanup_dependencies(data); Curl_convert_close(data); /* No longer a dirty share, if it exists */ if(data->share) { Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE); data->share->dirty--; Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); } /* destruct wildcard structures if it is needed */ Curl_wildcard_dtor(&data->wildcard); Curl_freeset(data); free(data); return CURLE_OK; }
312
True
1
CVE-2018-16839
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.0/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/curl/curl/commit/f3a24d7916b9173c69a3e0ee790102993833d6c5', 'name': 'https://github.com/curl/curl/commit/f3a24d7916b9173c69a3e0ee790102993833d6c5', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://curl.haxx.se/docs/CVE-2018-16839.html', 'name': 'https://curl.haxx.se/docs/CVE-2018-16839.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16839', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16839', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3805-1/', 'name': 'USN-3805-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1042012', 'name': '1042012', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.debian.org/security/2018/dsa-4331', 'name': 'DSA-4331', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/11/msg00005.html', 'name': '[debian-lts-announce] 20181106 [SECURITY] [DLA 1568-1] curl security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201903-03', 'name': 'GLSA-201903-03', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/8338a0f605bdbb3a6098bb76f666a95fc2b2f53f37fa1ecc89f1146f@%3Cdevnull.infra.apache.org%3E', 'name': '[infra-devnull] 20190404 [GitHub] [incubator-openwhisk-runtime-ballerina] falkzoll commented on issue #15: Update to new base image jdk8u202-b08_openj9-0.12.1.', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.33.0', 'versionEndIncluding': '7.61.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o: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': 'Curl versions 7.33.0 through 7.61.1 are vulnerable to a buffer overrun in the SASL authentication code that may lead to denial of service.'}]
2019-10-09T23:36Z
2018-10-31T18: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
Daniel Stenberg
2018-09-28 16:08:16+02:00
Curl_auth_create_plain_message: fix too-large-input-check CVE-2018-16839 Reported-by: Harry Sintonen Bug: https://curl.haxx.se/docs/CVE-2018-16839.html
f3a24d7916b9173c69a3e0ee790102993833d6c5
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
Curl_auth_create_plain_message
Curl_auth_create_plain_message( struct Curl_easy * data , const char * userp , const char * passwdp , char ** outptr , size_t * outlen)
['data', 'userp', 'passwdp', 'outptr', 'outlen']
CURLcode Curl_auth_create_plain_message(struct Curl_easy *data, const char *userp, const char *passwdp, char **outptr, size_t *outlen) { CURLcode result; char *plainauth; size_t ulen; size_t plen; size_t plainlen; *outlen = 0; *outptr = NULL; ulen = strlen(userp); plen = strlen(passwdp); /* Compute binary message length. Check for overflows. */ if((ulen > SIZE_T_MAX/2) || (plen > (SIZE_T_MAX/2 - 2))) return CURLE_OUT_OF_MEMORY; plainlen = 2 * ulen + plen + 2; plainauth = malloc(plainlen); if(!plainauth) return CURLE_OUT_OF_MEMORY; /* Calculate the reply */ memcpy(plainauth, userp, ulen); plainauth[ulen] = '\0'; memcpy(plainauth + ulen + 1, userp, ulen); plainauth[2 * ulen + 1] = '\0'; memcpy(plainauth + 2 * ulen + 2, passwdp, plen); /* Base64 encode the reply */ result = Curl_base64_encode(data, plainauth, plainlen, outptr, outlen); free(plainauth); return result; }
195
True
1
CVE-2018-16842
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
False
[{'url': 'https://github.com/curl/curl/commit/d530e92f59ae9bb2d47066c3c460b25d2ffeb211', 'name': 'https://github.com/curl/curl/commit/d530e92f59ae9bb2d47066c3c460b25d2ffeb211', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://curl.haxx.se/docs/CVE-2018-16842.html', 'name': 'https://curl.haxx.se/docs/CVE-2018-16842.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16842', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16842', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3805-1/', 'name': 'USN-3805-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1042014', 'name': '1042014', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://usn.ubuntu.com/3805-2/', 'name': 'USN-3805-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4331', 'name': 'DSA-4331', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/11/msg00005.html', 'name': '[debian-lts-announce] 20181106 [SECURITY] [DLA 1568-1] curl security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201903-03', 'name': 'GLSA-201903-03', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:2181', 'name': 'RHSA-2019:2181', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html', 'name': 'https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.14.1', 'versionEndIncluding': '7.61.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux: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:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Curl versions 7.14.1 through 7.61.1 are vulnerable to a heap-based buffer over-read in the tool_msgs.c:voutf() function that may result in information exposure and denial of service.'}]
2019-08-06T17:15Z
2018-10-31T19: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
Daniel Stenberg
2018-10-28 01:33:23+02:00
voutf: fix bad arethmetic when outputting warnings to stderr CVE-2018-16842 Reported-by: Brian Carpenter Bug: https://curl.haxx.se/docs/CVE-2018-16842.html
d530e92f59ae9bb2d47066c3c460b25d2ffeb211
False
curl/curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
2010-03-18 22:32:22
2022-08-27 17:53:52
https://curl.se/
curl
26362.0
5268.0
voutf
voutf( struct GlobalConfig * config , const char * prefix , const char * fmt , va_list ap)
['config', 'prefix', 'fmt', 'ap']
static void voutf(struct GlobalConfig *config, const char *prefix, const char *fmt, va_list ap) { size_t width = (79 - strlen(prefix)); if(!config->mute) { size_t len; char *ptr; char *print_buffer; print_buffer = curlx_mvaprintf(fmt, ap); if(!print_buffer) return; len = strlen(print_buffer); ptr = print_buffer; while(len > 0) { fputs(prefix, config->errors); if(len > width) { size_t cut = width-1; while(!ISSPACE(ptr[cut]) && cut) { cut--; } if(0 == cut) /* not a single cutting position was found, just cut it at the max text width then! */ cut = width-1; (void)fwrite(ptr, cut + 1, 1, config->errors); fputs("\n", config->errors); ptr += cut + 1; /* skip the space too */ len -= cut; } else { fputs(ptr, config->errors); len = 0; } } curl_free(print_buffer); } }
201
True
1
CVE-2016-7151
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/aquynh/capstone/pull/725', 'name': 'https://github.com/aquynh/capstone/pull/725', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/aquynh/capstone/commit/87a25bb543c8e4c09b48d4b4a6c7db31ce58df06', 'name': 'https://github.com/aquynh/capstone/commit/87a25bb543c8e4c09b48d4b4a6c7db31ce58df06', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:capstone-engine:capstone:3.0.4:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Capstone 3.0.4 has an out-of-bounds vulnerability (SEGV caused by a read memory access) in X86_insn_reg_intel in arch/X86/X86Mapping.c.'}]
2019-05-16T14:04Z
2019-05-15T14: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
Nguyen Anh Quynh
2016-08-27 20:54:37+08:00
x86: fast path checking for X86_insn_reg_intel()
87a25bb543c8e4c09b48d4b4a6c7db31ce58df06
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
aquynh
visit repo url
visit repo url
X86_insn_reg_intel
X86_insn_reg_intel( unsigned int id , enum cs_ac_type * access)
['id', 'access']
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access) { unsigned int first = 0; unsigned int last = ARR_SIZE(insn_regs_intel) - 1; unsigned int mid = ARR_SIZE(insn_regs_intel) / 2; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted)); qsort(insn_regs_intel_sorted, ARR_SIZE(insn_regs_intel_sorted), sizeof(struct insn_reg), regs_cmp); intel_regs_sorted = true; } while (first <= last) { if (insn_regs_intel_sorted[mid].insn < id) { first = mid + 1; } else if (insn_regs_intel_sorted[mid].insn == id) { if (access) { *access = insn_regs_intel_sorted[mid].access; } return insn_regs_intel_sorted[mid].reg; } else { if (mid == 0) break; last = mid - 1; } mid = (first + last) / 2; } // not found return 0; }
177
True
1
CVE-2017-6952
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.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/aquynh/capstone/commit/6fe86eef621b9849f51a5e1e5d73258a93440403', 'name': 'https://github.com/aquynh/capstone/commit/6fe86eef621b9849f51a5e1e5d73258a93440403', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/97323', 'name': '97323', 'refsource': 'BID', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:capstone-engine:capstone:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.0.4', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Integer overflow in the cs_winkernel_malloc function in winkernel_mm.c in Capstone 3.0.4 and earlier allows attackers to cause a denial of service (heap-based buffer overflow in a kernel driver) or possibly have unspecified other impact via a large value.'}]
2017-04-05T01:59Z
2017-03-16T21: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
Quang Nguyễn
2017-03-13 22:34:48+07:00
provide a validity check to prevent against Integer overflow conditions (#870) * provide a validity check to prevent against Integer overflow conditions * fix some style issues.
6fe86eef621b9849f51a5e1e5d73258a93440403
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
aquynh
visit repo url
visit repo url
cs_winkernel_malloc
cs_winkernel_malloc( size_t size)
['size']
void * CAPSTONE_API cs_winkernel_malloc(size_t size) { // Disallow zero length allocation because they waste pool header space and, // in many cases, indicate a potential validation issue in the calling code. NT_ASSERT(size); // FP; a use of NonPagedPool is required for Windows 7 support #pragma prefast(suppress : 30030) // Allocating executable POOL_TYPE memory CS_WINKERNEL_MEMBLOCK *block = (CS_WINKERNEL_MEMBLOCK *)ExAllocatePoolWithTag( NonPagedPool, size + sizeof(CS_WINKERNEL_MEMBLOCK), CS_WINKERNEL_POOL_TAG); if (!block) { return NULL; } block->size = size; return block->data; }
55
True
1
CVE-2021-36084
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
LOW
3.3
LOW
1.8
1.4
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31065', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31065', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-417.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-417.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SELinuxProject/selinux/commit/f34d3d30c8325e4847a6b696fe7a3936a8a361f3', 'name': 'https://github.com/SELinuxProject/selinux/commit/f34d3d30c8325e4847a6b696fe7a3936a8a361f3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/U7ZYR3PIJ75N6U2IONJWCKZ5L2NKJTGR/', 'name': 'FEDORA-2021-67efe88c29', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:selinux_project:selinux:3.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The CIL compiler in SELinux 3.2 has a use-after-free in __cil_verify_classperms (called from __cil_verify_classpermission and __cil_pre_verify_helper).'}]
2021-11-17T03:16Z
2021-07-01T03: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
James Carter
2021-04-08 13:32:01-04:00
libsepol/cil: Destroy classperms list when resetting classpermission Nicolas Iooss reports: A few months ago, OSS-Fuzz found a crash in the CIL compiler, which got reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28648 (the title is misleading, or is caused by another issue that conflicts with the one I report in this message). Here is a minimized CIL policy which reproduces the issue: (class CLASS (PERM)) (classorder (CLASS)) (sid SID) (sidorder (SID)) (user USER) (role ROLE) (type TYPE) (category CAT) (categoryorder (CAT)) (sensitivity SENS) (sensitivityorder (SENS)) (sensitivitycategory SENS (CAT)) (allow TYPE self (CLASS (PERM))) (roletype ROLE TYPE) (userrole USER ROLE) (userlevel USER (SENS)) (userrange USER ((SENS)(SENS (CAT)))) (sidcontext SID (USER ROLE TYPE ((SENS)(SENS)))) (classpermission CLAPERM) (optional OPT (roletype nonexistingrole nonexistingtype) (classpermissionset CLAPERM (CLASS (PERM))) ) The CIL policy fuzzer (which mimics secilc built with clang Address Sanitizer) reports: ==36541==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000004f98 at pc 0x56445134c842 bp 0x7ffe2a256590 sp 0x7ffe2a256588 READ of size 8 at 0x603000004f98 thread T0 #0 0x56445134c841 in __cil_verify_classperms /selinux/libsepol/src/../cil/src/cil_verify.c:1620:8 #1 0x56445134a43e in __cil_verify_classpermission /selinux/libsepol/src/../cil/src/cil_verify.c:1650:9 #2 0x56445134a43e in __cil_pre_verify_helper /selinux/libsepol/src/../cil/src/cil_verify.c:1715:8 #3 0x5644513225ac in cil_tree_walk_core /selinux/libsepol/src/../cil/src/cil_tree.c:272:9 #4 0x564451322ab1 in cil_tree_walk /selinux/libsepol/src/../cil/src/cil_tree.c:316:7 #5 0x5644513226af in cil_tree_walk_core /selinux/libsepol/src/../cil/src/cil_tree.c:284:9 #6 0x564451322ab1 in cil_tree_walk /selinux/libsepol/src/../cil/src/cil_tree.c:316:7 #7 0x5644512b88fd in cil_pre_verify /selinux/libsepol/src/../cil/src/cil_post.c:2510:7 #8 0x5644512b88fd in cil_post_process /selinux/libsepol/src/../cil/src/cil_post.c:2524:7 #9 0x5644511856ff in cil_compile /selinux/libsepol/src/../cil/src/cil.c:564:7 The classperms list of a classpermission rule is created and filled in when classpermissionset rules are processed, so it doesn't own any part of the list and shouldn't retain any of it when it is reset. Destroy the classperms list (without destroying the data in it) when resetting a classpermission rule. Reported-by: Nicolas Iooss <[email protected]> Signed-off-by: James Carter <[email protected]>
f34d3d30c8325e4847a6b696fe7a3936a8a361f3
False
SELinuxProject/selinux
This is the upstream repository for the Security Enhanced Linux (SELinux) userland libraries and tools. The software provided by this project complements the SELinux features integrated into the Linux kernel and is used by Linux distributions. All bugs and patches should be submitted to [email protected]
2014-06-09 14:09:57
2022-08-25 01:39:55
SELinuxProject
978.0
331.0
cil_reset_classpermission
cil_reset_classpermission( struct cil_classpermission * cp)
['cp']
static void cil_reset_classpermission(struct cil_classpermission *cp) { if (cp == NULL) { return; } cil_reset_classperms_list(cp->classperms); }
26
True
1
CVE-2021-36085
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
LOW
3.3
LOW
1.8
1.4
False
[{'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-421.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-421.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31124', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31124', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/SELinuxProject/selinux/commit/2d35fcc7e9e976a2346b1de20e54f8663e8a6cba', 'name': 'https://github.com/SELinuxProject/selinux/commit/2d35fcc7e9e976a2346b1de20e54f8663e8a6cba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/U7ZYR3PIJ75N6U2IONJWCKZ5L2NKJTGR/', 'name': 'FEDORA-2021-67efe88c29', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:selinux_project:selinux:3.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The CIL compiler in SELinux 3.2 has a use-after-free in __cil_verify_classperms (called from __verify_map_perm_classperms and hashtab_map).'}]
2021-11-17T03:26Z
2021-07-01T03: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
James Carter
2021-04-08 13:32:04-04:00
libsepol/cil: Destroy classperm list when resetting map perms Map perms share the same struct as regular perms, but only the map perms use the classperms field. This field is a pointer to a list of classperms that is created and added to when resolving classmapping rules, so the map permission doesn't own any of the data in the list and this list should be destroyed when the AST is reset. When resetting a perm, destroy the classperms list without destroying the data in the list. Signed-off-by: James Carter <[email protected]>
2d35fcc7e9e976a2346b1de20e54f8663e8a6cba
False
SELinuxProject/selinux
This is the upstream repository for the Security Enhanced Linux (SELinux) userland libraries and tools. The software provided by this project complements the SELinux features integrated into the Linux kernel and is used by Linux distributions. All bugs and patches should be submitted to [email protected]
2014-06-09 14:09:57
2022-08-25 01:39:55
SELinuxProject
978.0
331.0
cil_reset_perm
cil_reset_perm( struct cil_perm * perm)
['perm']
static void cil_reset_perm(struct cil_perm *perm) { cil_reset_classperms_list(perm->classperms); }
16
True
1
CVE-2021-36086
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
LOW
3.3
LOW
1.8
1.4
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32177', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32177', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-536.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-536.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/SELinuxProject/selinux/commit/c49a8ea09501ad66e799ea41b8154b6770fec2c8', 'name': 'https://github.com/SELinuxProject/selinux/commit/c49a8ea09501ad66e799ea41b8154b6770fec2c8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/U7ZYR3PIJ75N6U2IONJWCKZ5L2NKJTGR/', 'name': 'FEDORA-2021-67efe88c29', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:selinux_project:selinux:-:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The CIL compiler in SELinux 3.2 has a use-after-free in cil_reset_classpermission (called from cil_reset_classperms_set and cil_reset_classperms_list).'}]
2021-11-17T03:27Z
2021-07-01T03: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
James Carter
2021-04-08 13:32:06-04:00
libsepol/cil: cil_reset_classperms_set() should not reset classpermission In struct cil_classperms_set, the set field is a pointer to a struct cil_classpermission which is looked up in the symbol table. Since the cil_classperms_set does not create the cil_classpermission, it should not reset it. Set the set field to NULL instead of resetting the classpermission that it points to. Signed-off-by: James Carter <[email protected]>
c49a8ea09501ad66e799ea41b8154b6770fec2c8
False
SELinuxProject/selinux
This is the upstream repository for the Security Enhanced Linux (SELinux) userland libraries and tools. The software provided by this project complements the SELinux features integrated into the Linux kernel and is used by Linux distributions. All bugs and patches should be submitted to [email protected]
2014-06-09 14:09:57
2022-08-25 01:39:55
SELinuxProject
978.0
331.0
cil_reset_classperms_set
cil_reset_classperms_set( struct cil_classperms_set * cp_set)
['cp_set']
static void cil_reset_classperms_set(struct cil_classperms_set *cp_set) { cil_reset_classpermission(cp_set->set); }
16
True
1
CVE-2021-36087
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
LOW
3.3
LOW
1.8
1.4
False
[{'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-585.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/selinux/OSV-2021-585.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32675', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32675', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lore.kernel.org/selinux/CAEN2sdqJKHvDzPnxS-J8grU8fSf32DDtx=kyh84OsCq_Vm+yaQ@mail.gmail.com/T/', 'name': 'https://lore.kernel.org/selinux/CAEN2sdqJKHvDzPnxS-J8grU8fSf32DDtx=kyh84OsCq_Vm+yaQ@mail.gmail.com/T/', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/SELinuxProject/selinux/commit/340f0eb7f3673e8aacaf0a96cbfcd4d12a405521', 'name': 'https://github.com/SELinuxProject/selinux/commit/340f0eb7f3673e8aacaf0a96cbfcd4d12a405521', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/U7ZYR3PIJ75N6U2IONJWCKZ5L2NKJTGR/', 'name': 'FEDORA-2021-67efe88c29', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:selinux_project:selinux:3.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The CIL compiler in SELinux 3.2 has a heap-based buffer over-read in ebitmap_match_any (called indirectly from cil_check_neverallow). This occurs because there is sometimes a lack of checks for invalid statements in an optional block.'}]
2021-11-17T14:05Z
2021-07-01T03:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
James Carter
2021-03-30 13:39:18-04:00
libsepol/cil: Check for statements not allowed in optional blocks While there are some checks for invalid statements in an optional block when resolving the AST, there are no checks when building the AST. OSS-Fuzz found the following policy which caused a null dereference in cil_tree_get_next_path(). (blockinherit b3) (sid SID) (sidorder(SID)) (optional o (ibpkeycon :(1 0)s) (block b3 (filecon""block()) (filecon""block()))) The problem is that the blockinherit copies block b3 before the optional block is disabled. When the optional is disabled, block b3 is deleted along with everything else in the optional. Later, when filecon statements with the same path are found an error message is produced and in trying to find out where the block was copied from, the reference to the deleted block is used. The error handling code assumes (rightly) that if something was copied from a block then that block should still exist. It is clear that in-statements, blocks, and macros cannot be in an optional, because that allows nodes to be copied from the optional block to somewhere outside even though the optional could be disabled later. When optionals are disabled the AST is reset and the resolution is restarted at the point of resolving macro calls, so anything resolved before macro calls will never be re-resolved. This includes tunableifs, in-statements, blockinherits, blockabstracts, and macro definitions. Tunable declarations also cannot be in an optional block because they are needed to resolve tunableifs. It should be fine to allow blockinherit statements in an optional, because that is copying nodes from outside the optional to the optional and if the optional is later disabled, everything will be deleted anyway. Check and quit with an error if a tunable declaration, in-statement, block, blockabstract, or macro definition is found within an optional when either building or resolving the AST. Signed-off-by: James Carter <[email protected]>
340f0eb7f3673e8aacaf0a96cbfcd4d12a405521
False
SELinuxProject/selinux
This is the upstream repository for the Security Enhanced Linux (SELinux) userland libraries and tools. The software provided by this project complements the SELinux features integrated into the Linux kernel and is used by Linux distributions. All bugs and patches should be submitted to [email protected]
2014-06-09 14:09:57
2022-08-25 01:39:55
SELinuxProject
978.0
331.0
__cil_resolve_ast_node_helper
__cil_resolve_ast_node_helper( struct cil_tree_node * node , uint32_t * finished , void * extra_args)
['node', 'finished', 'extra_args']
int __cil_resolve_ast_node_helper(struct cil_tree_node *node, uint32_t *finished, void *extra_args) { int rc = SEPOL_OK; struct cil_args_resolve *args = extra_args; enum cil_pass pass = args->pass; struct cil_tree_node *block = args->block; struct cil_tree_node *macro = args->macro; struct cil_tree_node *optional = args->optional; struct cil_tree_node *boolif = args->boolif; if (node == NULL) { goto exit; } if (block != NULL) { if (node->flavor == CIL_CAT || node->flavor == CIL_SENS) { cil_tree_log(node, CIL_ERR, "%s statement is not allowed in blocks", cil_node_to_string(node)); rc = SEPOL_ERR; goto exit; } } if (macro != NULL) { if (node->flavor == CIL_BLOCK || node->flavor == CIL_BLOCKINHERIT || node->flavor == CIL_BLOCKABSTRACT || node->flavor == CIL_MACRO) { cil_tree_log(node, CIL_ERR, "%s statement is not allowed in macros", cil_node_to_string(node)); rc = SEPOL_ERR; goto exit; } } if (optional != NULL) { if (node->flavor == CIL_TUNABLE || node->flavor == CIL_MACRO) { /* tuanbles and macros are not allowed in optionals*/ cil_tree_log(node, CIL_ERR, "%s statement is not allowed in optionals", cil_node_to_string(node)); rc = SEPOL_ERR; goto exit; } } if (boolif != NULL) { if (node->flavor != CIL_TUNABLEIF && node->flavor != CIL_CALL && node->flavor != CIL_CONDBLOCK && node->flavor != CIL_AVRULE && node->flavor != CIL_TYPE_RULE && node->flavor != CIL_NAMETYPETRANSITION) { rc = SEPOL_ERR; } else if (node->flavor == CIL_AVRULE) { struct cil_avrule *rule = node->data; if (rule->rule_kind == CIL_AVRULE_NEVERALLOW) { rc = SEPOL_ERR; } } if (rc == SEPOL_ERR) { if (((struct cil_booleanif*)boolif->data)->preserved_tunable) { cil_tree_log(node, CIL_ERR, "%s statement is not allowed in booleanifs (tunableif treated as a booleanif)", cil_node_to_string(node)); } else { cil_tree_log(node, CIL_ERR, "%s statement is not allowed in booleanifs", cil_node_to_string(node)); } goto exit; } } if (node->flavor == CIL_MACRO) { if (pass != CIL_PASS_TIF && pass != CIL_PASS_MACRO) { *finished = CIL_TREE_SKIP_HEAD; rc = SEPOL_OK; goto exit; } } if (node->flavor == CIL_BLOCK && ((((struct cil_block*)node->data)->is_abstract == CIL_TRUE) && (pass > CIL_PASS_BLKABS))) { *finished = CIL_TREE_SKIP_HEAD; rc = SEPOL_OK; goto exit; } rc = __cil_resolve_ast_node(node, extra_args); if (rc == SEPOL_ENOENT) { enum cil_log_level lvl = CIL_ERR; if (optional != NULL) { lvl = CIL_INFO; struct cil_optional *opt = (struct cil_optional *)optional->data; struct cil_tree_node *opt_node = NODE(opt);; /* disable an optional if something failed to resolve */ opt->enabled = CIL_FALSE; cil_tree_log(node, lvl, "Failed to resolve %s statement", cil_node_to_string(node)); cil_tree_log(opt_node, lvl, "Disabling optional '%s'", opt->datum.name); rc = SEPOL_OK; goto exit; } cil_tree_log(node, lvl, "Failed to resolve %s statement", cil_node_to_string(node)); goto exit; } return rc; exit: return rc; }
584
True
1
CVE-2016-7798
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:N
NETWORK
LOW
NONE
PARTIAL
NONE
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
7.5
HIGH
3.9
3.6
True
[{'url': 'https://github.com/ruby/openssl/issues/49', 'name': 'https://github.com/ruby/openssl/issues/49', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/ruby/openssl/commit/8108e0a6db133f3375608303fdd2083eb5115062', 'name': 'https://github.com/ruby/openssl/commit/8108e0a6db133f3375608303fdd2083eb5115062', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/10/01/2', 'name': '[oss-security] 20160930 Re: CVE Request - Ruby OpenSSL Library - IV Reuse in GCM Mode', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/09/30/6', 'name': '[oss-security] 20160930 Re: CVE Request - Ruby OpenSSL Library - IV Reuse in GCM Mode', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/09/19/9', 'name': '[oss-security] 20160919 CVE Request - Ruby OpenSSL Library - IV Reuse in GCM Mode', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/93031', 'name': '93031', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.debian.org/security/2017/dsa-3966', 'name': 'DSA-3966', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/07/msg00012.html', 'name': '[debian-lts-announce] 20180714 [SECURITY] [DLA 1421-1] ruby2.1 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-326'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ruby-lang:openssl:*:*:*:*:*:ruby:*:*', 'versionEndExcluding': '2.0.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The openssl gem for Ruby uses the same initialization vector (IV) in GCM Mode (aes-*-gcm) when the IV is set before the key, which makes it easier for context-dependent attackers to bypass the encryption protection mechanism.'}]
2020-11-05T14:56Z
2017-01-30T22:59Z
Inadequate Encryption Strength
The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.
A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.
https://cwe.mitre.org/data/definitions/326.html
0
Kazuki Yamaguchi
2016-09-20 21:27:28+09:00
cipher: don't set dummy encryption key in Cipher#initialize Remove the encryption key initialization from Cipher#initialize. This is effectively a revert of r32723 ("Avoid possible SEGV from AES encryption/decryption", 2011-07-28). r32723, which added the key initialization, was a workaround for Ruby Bug #2768. For some certain ciphers, calling EVP_CipherUpdate() before setting an encryption key caused segfault. It was not a problem until OpenSSL implemented GCM mode - the encryption key could be overridden by repeated calls of EVP_CipherInit_ex(). But, it is not the case for AES-GCM ciphers. Setting a key, an IV, a key, in this order causes the IV to be reset to an all-zero IV. The problem of Bug #2768 persists on the current versions of OpenSSL. So, make Cipher#update raise an exception if a key is not yet set by the user. Since encrypting or decrypting without key does not make any sense, this should not break existing applications. Users can still call Cipher#key= and Cipher#iv= multiple times with their own responsibility. Reference: https://bugs.ruby-lang.org/issues/2768 Reference: https://bugs.ruby-lang.org/issues/8221 Reference: https://github.com/ruby/openssl/issues/49
8108e0a6db133f3375608303fdd2083eb5115062
False
ruby/openssl
Provides SSL, TLS and general purpose cryptography.
2014-10-27 02:12:48
2022-08-23 15:59:14
ruby
207.0
137.0
ossl_cipher_initialize
ossl_cipher_initialize( VALUE self , VALUE str)
['self', 'str']
ossl_cipher_initialize(VALUE self, VALUE str) { EVP_CIPHER_CTX *ctx; const EVP_CIPHER *cipher; char *name; unsigned char dummy_key[EVP_MAX_KEY_LENGTH] = { 0 }; name = StringValueCStr(str); GetCipherInit(self, ctx); if (ctx) { ossl_raise(rb_eRuntimeError, "Cipher already inititalized!"); } AllocCipher(self, ctx); if (!(cipher = EVP_get_cipherbyname(name))) { ossl_raise(rb_eRuntimeError, "unsupported cipher algorithm (%"PRIsVALUE")", str); } /* * EVP_CipherInit_ex() allows to specify NULL to key and IV, however some * ciphers don't handle well (OpenSSL's bug). [Bug #2768] * * The EVP which has EVP_CIPH_RAND_KEY flag (such as DES3) allows * uninitialized key, but other EVPs (such as AES) does not allow it. * Calling EVP_CipherUpdate() without initializing key causes SEGV so we * set the data filled with "\0" as the key by default. */ if (EVP_CipherInit_ex(ctx, cipher, NULL, dummy_key, NULL, -1) != 1) ossl_raise(eCipherError, NULL); return self; }
123
True
1
CVE-2016-7838
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
nan
[{'url': 'https://www.wireshark.org/news/20161214.html', 'name': 'https://www.wireshark.org/news/20161214.html', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://jvn.jp/en/jp/JVN96681653/index.html', 'name': 'JVN#96681653', 'refsource': 'JVN', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://jvn.jp/en/jp/JVN90813656/index.html', 'name': 'JVN#90813656', 'refsource': 'JVN', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/vslavik/winsparkle/commit/bb454857348245a7397f9e4fbb3a902f4ac25913', 'name': 'https://github.com/vslavik/winsparkle/commit/bb454857348245a7397f9e4fbb3a902f4ac25913', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/95099', 'name': '95099', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-426'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:winsparkle:winsparkle:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.5.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Untrusted search path vulnerability in WinSparkle versions prior to 0.5.3 allows remote attackers to execute arbitrary code via a specially crafted executable file in an unspecified directory.'}]
2017-06-20T14:50Z
2017-06-09T16:29Z
Untrusted Search Path
The application searches for critical resources using an externally-supplied search path that can point to resources that are not under the application's direct control.
This might allow attackers to execute their own programs, access unauthorized data files, or modify configuration in unexpected ways. If the application uses a search path to locate critical resources such as programs, then an attacker could modify that search path to point to a malicious program, which the targeted application would then execute. The problem extends to any type of critical resource that the application trusts. Some of the most common variants of untrusted search path are: In various UNIX and Linux-based systems, the PATH environment variable may be consulted to locate executable programs, and LD_PRELOAD may be used to locate a separate library. In various Microsoft-based systems, the PATH environment variable is consulted to locate a DLL, if the DLL is not found in other paths that appear earlier in the search order.
https://cwe.mitre.org/data/definitions/426.html
0
Václav Slavík
2016-12-12 18:32:14+01:00
Verify UpdateTempDir isn't maliciously modified Don't just delete the stored updates temporary directory on launch, but validate the registry key to ensure it is in an expected location and follows WinSparkle's naming convention. This is to prevent malicious users from modifying this registry key and forcing the host app to delete arbitrary directories (a user being able to delete the key would be able to delete the directory themselves, so it's not a serious issue, but it nevertheless is bad behavior and shouldn't be possible).
bb454857348245a7397f9e4fbb3a902f4ac25913
False
vslavik/winsparkle
App update framework for Windows, inspired by Sparkle for macOS
2010-01-11 16:13:10
2022-06-09 17:12:50
http://winsparkle.org
vslavik
1066.0
241.0
winsparkle::CreateUniqueTempDirectory
winsparkle::CreateUniqueTempDirectory()
[]
std::wstring CreateUniqueTempDirectory() { // We need to put downloaded updates into a directory of their own, because // if we put it in $TMP, some DLLs could be there and interfere with the // installer. // // This code creates a new randomized directory name and tries to create it; // this process is repeated if the directory already exists. wchar_t tmpdir[MAX_PATH+1]; if ( GetTempPath(MAX_PATH+1, tmpdir) == 0 ) throw Win32Exception("Cannot create temporary directory"); for ( ;; ) { std::wstring dir(tmpdir); dir += L"Update-"; UUID uuid; UuidCreate(&uuid); RPC_WSTR uuidStr; RPC_STATUS status = UuidToString(&uuid, &uuidStr); dir += reinterpret_cast<wchar_t*>(uuidStr); RpcStringFree(&uuidStr); if ( CreateDirectory(dir.c_str(), NULL) ) return dir; else if ( GetLastError() != ERROR_ALREADY_EXISTS ) throw Win32Exception("Cannot create temporary directory"); } }
124
True
1
CVE-2016-7969
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://security.gentoo.org/glsa/201702-25', 'name': 'GLSA-201702-25', 'refsource': 'GENTOO', 'tags': ['Patch', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VUOUOK3VULMMZTNSCRFCNPDAPDWAVK7X/', 'name': 'FEDORA-2016-d2a05a0644', 'refsource': 'FEDORA', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/R7JJ2SGVOX6UQQIRMVC3QACJLKHE2PYN/', 'name': 'FEDORA-2016-95407a836f', 'refsource': 'FEDORA', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KW6DNERYHPI5Y6SQYU3XKTVSCOWMIHUC/', 'name': 'FEDORA-2016-282507c3e9', 'refsource': 'FEDORA', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libass/libass/releases/tag/0.13.4', 'name': 'https://github.com/libass/libass/releases/tag/0.13.4', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1381960', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1381960', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch']}, {'url': 'http://www.securityfocus.com/bid/93358', 'name': '93358', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/10/05/2', 'name': '[oss-security] 20161004 Re: Handful of libass issues', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2016-12/msg00068.html', 'name': 'openSUSE-SU-2016:3087', 'refsource': 'SUSE', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/libass/libass/commit/f4f48950788b91c6a30029cc28a240b834713ea7', 'name': 'https://github.com/libass/libass/commit/f4f48950788b91c6a30029cc28a240b834713ea7', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:13.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:25:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:24:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:23:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libass_project:libass:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.13.3', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The wrap_lines_smart function in ass_render.c in libass before 0.13.4 allows remote attackers to cause a denial of service (out-of-bounds read) via unspecified vectors, related to "0/3 line wrapping equalization."'}]
2020-10-14T18:16Z
2017-03-03T16: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
Grigori Goronzy
2016-10-04 21:25:41+02:00
Fix line wrapping mode 0/3 bugs This fixes two separate bugs: a) Don't move a linebreak into the first symbol. This results in a empty line at the front, which does not help to equalize line lengths at all. Instead, merge line with the second one. b) When moving a linebreak into a symbol that already is a break, the number of lines must be decremented. Otherwise, uninitialized memory is possibly used for later layout operations. Found by fuzzer test case id:000085,sig:11,src:003377+003350,op:splice,rep:8. This might also affect and hopefully fix libass#229. v2: change semantics according to review
f4f48950788b91c6a30029cc28a240b834713ea7
False
libass/libass
libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format.
2013-07-26 23:11:51
2022-08-20 23:45:21
libass
684.0
179.0
wrap_lines_smart
wrap_lines_smart( ASS_Renderer * render_priv , double max_text_width)
['render_priv', 'max_text_width']
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last_space = -1; text_info->n_lines = 1; break_type = 0; s1 = text_info->glyphs; // current line start for (i = 0; i < text_info->length; ++i) { int break_at = -1; double s_offset, len; cur = text_info->glyphs + i; s_offset = d6_to_double(s1->bbox.xMin + s1->pos.x); len = d6_to_double(cur->bbox.xMax + cur->pos.x) - s_offset; if (cur->symbol == '\n') { break_type = 2; break_at = i; ass_msg(render_priv->library, MSGL_DBG2, "forced line break at %d", break_at); } else if (cur->symbol == ' ') { last_space = i; } else if (len >= max_text_width && (render_priv->state.wrap_style != 2)) { break_type = 1; break_at = last_space; if (break_at >= 0) ass_msg(render_priv->library, MSGL_DBG2, "line break at %d", break_at); } if (break_at != -1) { // need to use one more line // marking break_at+1 as start of a new line int lead = break_at + 1; // the first symbol of the new line if (text_info->n_lines >= text_info->max_lines) { // Raise maximum number of lines text_info->max_lines *= 2; text_info->lines = realloc(text_info->lines, sizeof(LineInfo) * text_info->max_lines); } if (lead < text_info->length) { text_info->glyphs[lead].linebreak = break_type; last_space = -1; s1 = text_info->glyphs + lead; text_info->n_lines++; } } } #define DIFF(x,y) (((x) < (y)) ? (y - x) : (x - y)) exit = 0; while (!exit && render_priv->state.wrap_style != 1) { exit = 1; s3 = text_info->glyphs; s1 = s2 = 0; for (i = 0; i <= text_info->length; ++i) { cur = text_info->glyphs + i; if ((i == text_info->length) || cur->linebreak) { s1 = s2; s2 = s3; s3 = cur; if (s1 && (s2->linebreak == 1)) { // have at least 2 lines, and linebreak is 'soft' double l1, l2, l1_new, l2_new; GlyphInfo *w = s2; do { --w; } while ((w > s1) && (w->symbol == ' ')); while ((w > s1) && (w->symbol != ' ')) { --w; } e1 = w; while ((e1 > s1) && (e1->symbol == ' ')) { --e1; } if (w->symbol == ' ') ++w; l1 = d6_to_double(((s2 - 1)->bbox.xMax + (s2 - 1)->pos.x) - (s1->bbox.xMin + s1->pos.x)); l2 = d6_to_double(((s3 - 1)->bbox.xMax + (s3 - 1)->pos.x) - (s2->bbox.xMin + s2->pos.x)); l1_new = d6_to_double( (e1->bbox.xMax + e1->pos.x) - (s1->bbox.xMin + s1->pos.x)); l2_new = d6_to_double( ((s3 - 1)->bbox.xMax + (s3 - 1)->pos.x) - (w->bbox.xMin + w->pos.x)); if (DIFF(l1_new, l2_new) < DIFF(l1, l2)) { w->linebreak = 1; s2->linebreak = 0; exit = 0; } } } if (i == text_info->length) break; } } assert(text_info->n_lines >= 1); #undef DIFF measure_text(render_priv); trim_whitespace(render_priv); cur_line = 1; run_offset = 0; i = 0; cur = text_info->glyphs + i; while (i < text_info->length && cur->skip) cur = text_info->glyphs + ++i; pen_shift_x = d6_to_double(-cur->pos.x); pen_shift_y = 0.; for (i = 0; i < text_info->length; ++i) { cur = text_info->glyphs + i; if (cur->linebreak) { while (i < text_info->length && cur->skip && cur->symbol != '\n') cur = text_info->glyphs + ++i; double height = text_info->lines[cur_line - 1].desc + text_info->lines[cur_line].asc; text_info->lines[cur_line - 1].len = i - text_info->lines[cur_line - 1].offset; text_info->lines[cur_line].offset = i; cur_line++; run_offset++; pen_shift_x = d6_to_double(-cur->pos.x); pen_shift_y += height + render_priv->settings.line_spacing; } cur->pos.x += double_to_d6(pen_shift_x); cur->pos.y += double_to_d6(pen_shift_y); } text_info->lines[cur_line - 1].len = text_info->length - text_info->lines[cur_line - 1].offset; #if 0 // print line info for (i = 0; i < text_info->n_lines; i++) { printf("line %d offset %d length %d\n", i, text_info->lines[i].offset, text_info->lines[i].len); } #endif }
1049
True
1
CVE-2020-36430
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/libass/libass/commit/017137471d0043e0321e377ed8da48e45a3ec632', 'name': 'https://github.com/libass/libass/commit/017137471d0043e0321e377ed8da48e45a3ec632', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libass/OSV-2020-2099.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libass/OSV-2020-2099.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26674', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26674', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/6JUXFQUJ32GWG5E46A63DFDCYJAF3VU6/', 'name': 'FEDORA-2022-2af150223a', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202208-13', 'name': 'GLSA-202208-13', 'refsource': 'GENTOO', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libass_project:libass:*:*:*:*:*:*:*:*', 'versionStartIncluding': '0.15.0', 'versionEndExcluding': '0.15.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libass 0.15.x before 0.15.1 has a heap-based buffer overflow in decode_chars (called from decode_font and process_text) because the wrong integer data type is used for subtraction.'}]
2022-08-10T20:15Z
2021-07-20T07:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Oleg Oshmyan
2020-10-27 15:46:04+02:00
decode_font: fix subtraction broken by change to unsigned type This caused a one-byte buffer overwrite and an assertion failure. Regression in commit 910211f1c0078e37546f73e95306724358b89be2. Discovered by OSS-Fuzz. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26674. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26678.
017137471d0043e0321e377ed8da48e45a3ec632
False
libass/libass
libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format.
2013-07-26 23:11:51
2022-08-20 23:45:21
libass
684.0
179.0
decode_font
decode_font( ASS_Track * track)
['track']
static int decode_font(ASS_Track *track) { unsigned char *p; unsigned char *q; size_t i; size_t size; // original size size_t dsize; // decoded size unsigned char *buf = 0; ass_msg(track->library, MSGL_V, "Font: %d bytes encoded data", track->parser_priv->fontdata_used); size = track->parser_priv->fontdata_used; if (size % 4 == 1) { ass_msg(track->library, MSGL_ERR, "Bad encoded data size"); goto error_decode_font; } buf = malloc(size / 4 * 3 + FFMAX(size % 4 - 1, 0)); if (!buf) goto error_decode_font; q = buf; for (i = 0, p = (unsigned char *) track->parser_priv->fontdata; i < size / 4; i++, p += 4) { q = decode_chars(p, q, 4); } if (size % 4 == 2) { q = decode_chars(p, q, 2); } else if (size % 4 == 3) { q = decode_chars(p, q, 3); } dsize = q - buf; assert(dsize == size / 4 * 3 + FFMAX(size % 4 - 1, 0)); if (track->library->extract_fonts) { ass_add_font(track->library, track->parser_priv->fontname, (char *) buf, dsize); } error_decode_font: free(buf); reset_embedded_font_parsing(track->parser_priv); return 0; }
281
True
1
CVE-2017-12847
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:C/A:C
LOCAL
MEDIUM
NONE
NONE
COMPLETE
COMPLETE
6.3
CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
LOCAL
HIGH
LOW
NONE
UNCHANGED
NONE
HIGH
HIGH
6.3
MEDIUM
1.0
5.2
False
[{'url': 'https://github.com/NagiosEnterprises/nagioscore/issues/404', 'name': 'https://github.com/NagiosEnterprises/nagioscore/issues/404', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Vendor Advisory']}, {'url': 'https://github.com/NagiosEnterprises/nagioscore/commit/3baffa78bafebbbdf9f448890ba5a952ea2d73cb', 'name': 'https://github.com/NagiosEnterprises/nagioscore/commit/3baffa78bafebbbdf9f448890ba5a952ea2d73cb', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/NagiosEnterprises/nagioscore/commit/1b197346d490df2e2d3b1dcce5ac6134ad0c8752', 'name': 'https://github.com/NagiosEnterprises/nagioscore/commit/1b197346d490df2e2d3b1dcce5ac6134ad0c8752', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/NagiosEnterprises/nagioscore/blob/master/Changelog', 'name': 'https://github.com/NagiosEnterprises/nagioscore/blob/master/Changelog', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/100403', 'name': '100403', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/201710-20', 'name': 'GLSA-201710-20', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-665'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nagios:nagios:*:*:*:*:*:*:*:*', 'versionEndIncluding': '4.3.2', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Nagios Core before 4.3.3 creates a nagios.lock PID file after dropping privileges to a non-root account, which might allow local users to kill arbitrary processes by leveraging access to this non-root account for nagios.lock modification before a root script executes a "kill `cat /pathname/nagios.lock`" command.'}]
2019-10-03T00:03Z
2017-08-23T21:29Z
Improper Initialization
The software does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.
This can have security implications when the associated resource is expected to have certain properties or values, such as a variable that determines whether a user has been authenticated or not.
https://cwe.mitre.org/data/definitions/665.html
0
Bryan Heden
2017-07-30 16:28:11-05:00
halfway revert hack/configure changes - switch order of daemon_init/drop_privileges
1b197346d490df2e2d3b1dcce5ac6134ad0c8752
False
NagiosEnterprises/nagioscore
Nagios Core
2014-01-21 21:33:23
2022-07-27 09:29:40
null
NagiosEnterprises
1148.0
388.0
main
main( int argc , char ** argv)
['argc', 'argv']
int main(int argc, char **argv) { int result; int error = FALSE; int display_license = FALSE; int display_help = FALSE; int c = 0; struct tm *tm, tm_s; time_t now; char datestring[256]; nagios_macros *mac; const char *worker_socket = NULL; int i; #ifdef HAVE_SIGACTION struct sigaction sig_action; #endif #ifdef HAVE_GETOPT_H int option_index = 0; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"license", no_argument, 0, 'V'}, {"verify-config", no_argument, 0, 'v'}, {"daemon", no_argument, 0, 'd'}, {"test-scheduling", no_argument, 0, 's'}, {"precache-objects", no_argument, 0, 'p'}, {"use-precached-objects", no_argument, 0, 'u'}, {"enable-timing-point", no_argument, 0, 'T'}, {"worker", required_argument, 0, 'W'}, {0, 0, 0, 0} }; #define getopt(argc, argv, o) getopt_long(argc, argv, o, long_options, &option_index) #endif memset(&loadctl, 0, sizeof(loadctl)); mac = get_global_macros(); /* make sure we have the correct number of command line arguments */ if(argc < 2) error = TRUE; /* get all command line arguments */ while(1) { c = getopt(argc, argv, "+hVvdspuxTW"); if(c == -1 || c == EOF) break; switch(c) { case '?': /* usage */ case 'h': display_help = TRUE; break; case 'V': /* version */ display_license = TRUE; break; case 'v': /* verify */ verify_config++; break; case 's': /* scheduling check */ test_scheduling = TRUE; break; case 'd': /* daemon mode */ daemon_mode = TRUE; break; case 'p': /* precache object config */ precache_objects = TRUE; break; case 'u': /* use precached object config */ use_precached_objects = TRUE; break; case 'T': enable_timing_point = TRUE; break; case 'W': worker_socket = optarg; break; case 'x': printf("Warning: -x is deprecated and will be removed\n"); break; default: break; } } #ifdef DEBUG_MEMORY mtrace(); #endif /* if we're a worker we can skip everything below */ if(worker_socket) { exit(nagios_core_worker(worker_socket)); } /* Initialize configuration variables */ init_main_cfg_vars(1); init_shared_cfg_vars(1); if(daemon_mode == FALSE) { printf("\nNagios Core %s\n", PROGRAM_VERSION); printf("Copyright (c) 2009-present Nagios Core Development Team and Community Contributors\n"); printf("Copyright (c) 1999-2009 Ethan Galstad\n"); printf("Last Modified: %s\n", PROGRAM_MODIFICATION_DATE); printf("License: GPL\n\n"); printf("Website: https://www.nagios.org\n"); } /* just display the license */ if(display_license == TRUE) { printf("This program is free software; you can redistribute it and/or modify\n"); printf("it under the terms of the GNU General Public License version 2 as\n"); printf("published by the Free Software Foundation.\n\n"); printf("This program is distributed in the hope that it will be useful,\n"); printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); printf("GNU General Public License for more details.\n\n"); printf("You should have received a copy of the GNU General Public License\n"); printf("along with this program; if not, write to the Free Software\n"); printf("Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"); exit(OK); } /* make sure we got the main config file on the command line... */ if(optind >= argc) error = TRUE; /* if there are no command line options (or if we encountered an error), print usage */ if(error == TRUE || display_help == TRUE) { printf("Usage: %s [options] <main_config_file>\n", argv[0]); printf("\n"); printf("Options:\n"); printf("\n"); printf(" -v, --verify-config Verify all configuration data (-v -v for more info)\n"); printf(" -s, --test-scheduling Shows projected/recommended check scheduling and other\n"); printf(" diagnostic info based on the current configuration files.\n"); printf(" -T, --enable-timing-point Enable timed commentary on initialization\n"); printf(" -x, --dont-verify-paths Deprecated (Don't check for circular object paths)\n"); printf(" -p, --precache-objects Precache object configuration\n"); printf(" -u, --use-precached-objects Use precached object config file\n"); printf(" -d, --daemon Starts Nagios in daemon mode, instead of as a foreground process\n"); printf(" -W, --worker /path/to/socket Act as a worker for an already running daemon\n"); printf("\n"); printf("Visit the Nagios website at https://www.nagios.org/ for bug fixes, new\n"); printf("releases, online documentation, FAQs, information on subscribing to\n"); printf("the mailing lists, and commercial support options for Nagios.\n"); printf("\n"); exit(ERROR); } /* * config file is last argument specified. * Make sure it uses an absolute path */ config_file = nspath_absolute(argv[optind], NULL); if(config_file == NULL) { printf("Error allocating memory.\n"); exit(ERROR); } config_file_dir = nspath_absolute_dirname(config_file, NULL); /* * Set the signal handler for the SIGXFSZ signal here because * we may encounter this signal before the other signal handlers * are set. */ #ifdef HAVE_SIGACTION sig_action.sa_sigaction = NULL; sig_action.sa_handler = handle_sigxfsz; sigfillset(&sig_action.sa_mask); sig_action.sa_flags = SA_NODEFER|SA_RESTART; sigaction(SIGXFSZ, &sig_action, NULL); #else signal(SIGXFSZ, handle_sigxfsz); #endif /* * let's go to town. We'll be noisy if we're verifying config * or running scheduling tests. */ if(verify_config || test_scheduling || precache_objects) { reset_variables(); /* * if we don't beef up our resource limits as much as * we can, it's quite possible we'll run headlong into * EAGAIN due to too many processes when we try to * drop privileges later. */ set_loadctl_defaults(); if(verify_config) printf("Reading configuration data...\n"); /* read our config file */ result = read_main_config_file(config_file); if(result != OK) { printf(" Error processing main config file!\n\n"); exit(EXIT_FAILURE); } if(verify_config) printf(" Read main config file okay...\n"); /* drop privileges */ if((result = drop_privileges(nagios_user, nagios_group)) == ERROR) { printf(" Failed to drop privileges. Aborting."); exit(EXIT_FAILURE); } /* * this must come after dropping privileges, so we make * sure to test access permissions as the right user. */ if (!verify_config && test_configured_paths() == ERROR) { printf(" One or more path problems detected. Aborting.\n"); exit(EXIT_FAILURE); } /* read object config files */ result = read_all_object_data(config_file); if(result != OK) { printf(" Error processing object config files!\n\n"); /* if the config filename looks fishy, warn the user */ if(!strstr(config_file, "nagios.cfg")) { printf("\n***> The name of the main configuration file looks suspicious...\n"); printf("\n"); printf(" Make sure you are specifying the name of the MAIN configuration file on\n"); printf(" the command line and not the name of another configuration file. The\n"); printf(" main configuration file is typically '%s'\n", DEFAULT_CONFIG_FILE); } printf("\n***> One or more problems was encountered while processing the config files...\n"); printf("\n"); printf(" Check your configuration file(s) to ensure that they contain valid\n"); printf(" directives and data definitions. If you are upgrading from a previous\n"); printf(" version of Nagios, you should be aware that some variables/definitions\n"); printf(" may have been removed or modified in this version. Make sure to read\n"); printf(" the HTML documentation regarding the config files, as well as the\n"); printf(" 'Whats New' section to find out what has changed.\n\n"); exit(EXIT_FAILURE); } if(verify_config) { printf(" Read object config files okay...\n\n"); printf("Running pre-flight check on configuration data...\n\n"); } /* run the pre-flight check to make sure things look okay... */ result = pre_flight_check(); if(result != OK) { printf("\n***> One or more problems was encountered while running the pre-flight check...\n"); printf("\n"); printf(" Check your configuration file(s) to ensure that they contain valid\n"); printf(" directives and data definitions. If you are upgrading from a previous\n"); printf(" version of Nagios, you should be aware that some variables/definitions\n"); printf(" may have been removed or modified in this version. Make sure to read\n"); printf(" the HTML documentation regarding the config files, as well as the\n"); printf(" 'Whats New' section to find out what has changed.\n\n"); exit(EXIT_FAILURE); } if(verify_config) { printf("\nThings look okay - No serious problems were detected during the pre-flight check\n"); } /* scheduling tests need a bit more than config verifications */ if(test_scheduling == TRUE) { /* we'll need the event queue here so we can time insertions */ init_event_queue(); timing_point("Done initializing event queue\n"); /* read initial service and host state information */ initialize_retention_data(config_file); read_initial_state_information(); timing_point("Retention data and initial state parsed\n"); /* initialize the event timing loop */ init_timing_loop(); timing_point("Timing loop initialized\n"); /* display scheduling information */ display_scheduling_info(); } if(precache_objects) { result = fcache_objects(object_precache_file); timing_point("Done precaching objects\n"); if(result == OK) { printf("Object precache file created:\n%s\n", object_precache_file); } else { printf("Failed to precache objects to '%s': %s\n", object_precache_file, strerror(errno)); } } /* clean up after ourselves */ cleanup(); /* exit */ timing_point("Exiting\n"); /* make valgrind shut up about still reachable memory */ neb_free_module_list(); free(config_file_dir); free(config_file); exit(result); } /* else start to monitor things... */ else { /* * if we're called with a relative path we must make * it absolute so we can launch our workers. * If not, we needn't bother, as we're using execvp() */ if (strchr(argv[0], '/')) nagios_binary_path = nspath_absolute(argv[0], NULL); else nagios_binary_path = strdup(argv[0]); if (!nagios_binary_path) { logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Unable to allocate memory for nagios_binary_path\n"); exit(EXIT_FAILURE); } if (!(nagios_iobs = iobroker_create())) { logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Failed to create IO broker set: %s\n", strerror(errno)); exit(EXIT_FAILURE); } /* keep monitoring things until we get a shutdown command */ do { /* reset internal book-keeping (in case we're restarting) */ wproc_num_workers_spawned = wproc_num_workers_online = 0; caught_signal = sigshutdown = FALSE; sig_id = 0; /* reset program variables */ reset_variables(); timing_point("Variables reset\n"); /* get PID */ nagios_pid = (int)getpid(); /* read in the configuration files (main and resource config files) */ result = read_main_config_file(config_file); if (result != OK) { logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Failed to process config file '%s'. Aborting\n", config_file); exit(EXIT_FAILURE); } timing_point("Main config file read\n"); /* NOTE 11/06/07 EG moved to after we read config files, as user may have overridden timezone offset */ /* get program (re)start time and save as macro */ program_start = time(NULL); my_free(mac->x[MACRO_PROCESSSTARTTIME]); asprintf(&mac->x[MACRO_PROCESSSTARTTIME], "%llu", (unsigned long long)program_start); /* drop privileges */ if(drop_privileges(nagios_user, nagios_group) == ERROR) { logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_CONFIG_ERROR, TRUE, "Failed to drop privileges. Aborting."); cleanup(); exit(ERROR); } if (test_path_access(nagios_binary_path, X_OK)) { logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: failed to access() %s: %s\n", nagios_binary_path, strerror(errno)); logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Spawning workers will be impossible. Aborting.\n"); exit(EXIT_FAILURE); } if (test_configured_paths() == ERROR) { /* error has already been logged */ exit(EXIT_FAILURE); } /* enter daemon mode (unless we're restarting...) */ if(daemon_mode == TRUE && sigrestart == FALSE) { result = daemon_init(); /* we had an error daemonizing, so bail... */ if(result == ERROR) { logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR, TRUE, "Bailing out due to failure to daemonize. (PID=%d)", (int)getpid()); cleanup(); exit(EXIT_FAILURE); } /* get new PID */ nagios_pid = (int)getpid(); } /* this must be logged after we read config data, as user may have changed location of main log file */ logit(NSLOG_PROCESS_INFO, TRUE, "Nagios %s starting... (PID=%d)\n", PROGRAM_VERSION, (int)getpid()); /* log the local time - may be different than clock time due to timezone offset */ now = time(NULL); tm = localtime_r(&now, &tm_s); strftime(datestring, sizeof(datestring), "%a %b %d %H:%M:%S %Z %Y", tm); logit(NSLOG_PROCESS_INFO, TRUE, "Local time is %s", datestring); /* write log version/info */ write_log_file_info(NULL); /* open debug log now that we're the right user */ open_debug_log(); #ifdef USE_EVENT_BROKER /* initialize modules */ neb_init_modules(); neb_init_callback_list(); #endif timing_point("NEB module API initialized\n"); /* handle signals (interrupts) before we do any socket I/O */ setup_sighandler(); /* * Initialize query handler and event subscription service. * This must be done before modules are initialized, so * the modules can use our in-core stuff properly */ if (qh_init(qh_socket_path ? qh_socket_path : DEFAULT_QUERY_SOCKET) != OK) { logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Failed to initialize query handler. Aborting\n"); exit(EXIT_FAILURE); } timing_point("Query handler initialized\n"); nerd_init(); timing_point("NERD initialized\n"); /* initialize check workers */ if(init_workers(num_check_workers) < 0) { logit(NSLOG_RUNTIME_ERROR, TRUE, "Failed to spawn workers. Aborting\n"); exit(EXIT_FAILURE); } timing_point("%u workers spawned\n", wproc_num_workers_spawned); i = 0; while (i < 50 && wproc_num_workers_online < wproc_num_workers_spawned) { iobroker_poll(nagios_iobs, 50); i++; } timing_point("%u workers connected\n", wproc_num_workers_online); /* now that workers have arrived we can set the defaults */ set_loadctl_defaults(); #ifdef USE_EVENT_BROKER /* load modules */ if (neb_load_all_modules() != OK) { logit(NSLOG_CONFIG_ERROR, ERROR, "Error: Module loading failed. Aborting.\n"); /* if we're dumping core, we must remove all dl-files */ if (daemon_dumps_core) neb_unload_all_modules(NEBMODULE_FORCE_UNLOAD, NEBMODULE_NEB_SHUTDOWN); exit(EXIT_FAILURE); } timing_point("Modules loaded\n"); /* send program data to broker */ broker_program_state(NEBTYPE_PROCESS_PRELAUNCH, NEBFLAG_NONE, NEBATTR_NONE, NULL); timing_point("First callback made\n"); #endif /* read in all object config data */ if(result == OK) result = read_all_object_data(config_file); /* there was a problem reading the config files */ if(result != OK) logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_CONFIG_ERROR, TRUE, "Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=%d)", (int)getpid()); else { /* run the pre-flight check to make sure everything looks okay*/ if((result = pre_flight_check()) != OK) logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_VERIFICATION_ERROR, TRUE, "Bailing out due to errors encountered while running the pre-flight check. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=%d)\n", (int)getpid()); } /* an error occurred that prevented us from (re)starting */ if(result != OK) { /* if we were restarting, we need to cleanup from the previous run */ if(sigrestart == TRUE) { /* clean up the status data */ cleanup_status_data(TRUE); } #ifdef USE_EVENT_BROKER /* send program data to broker */ broker_program_state(NEBTYPE_PROCESS_SHUTDOWN, NEBFLAG_PROCESS_INITIATED, NEBATTR_SHUTDOWN_ABNORMAL, NULL); #endif cleanup(); exit(ERROR); } timing_point("Object configuration parsed and understood\n"); /* write the objects.cache file */ fcache_objects(object_cache_file); timing_point("Objects cached\n"); init_event_queue(); timing_point("Event queue initialized\n"); #ifdef USE_EVENT_BROKER /* send program data to broker */ broker_program_state(NEBTYPE_PROCESS_START, NEBFLAG_NONE, NEBATTR_NONE, NULL); #endif /* initialize status data unless we're starting */ if(sigrestart == FALSE) { initialize_status_data(config_file); timing_point("Status data initialized\n"); } /* initialize scheduled downtime data */ initialize_downtime_data(); timing_point("Downtime data initialized\n"); /* read initial service and host state information */ initialize_retention_data(config_file); timing_point("Retention data initialized\n"); read_initial_state_information(); timing_point("Initial state information read\n"); /* initialize comment data */ initialize_comment_data(); timing_point("Comment data initialized\n"); /* initialize performance data */ initialize_performance_data(config_file); timing_point("Performance data initialized\n"); /* initialize the event timing loop */ init_timing_loop(); timing_point("Event timing loop initialized\n"); /* initialize check statistics */ init_check_stats(); timing_point("check stats initialized\n"); /* check for updates */ check_for_nagios_updates(FALSE, TRUE); timing_point("Update check concluded\n"); /* update all status data (with retained information) */ update_all_status_data(); timing_point("Status data updated\n"); /* log initial host and service state */ log_host_states(INITIAL_STATES, NULL); log_service_states(INITIAL_STATES, NULL); timing_point("Initial states logged\n"); /* reset the restart flag */ sigrestart = FALSE; /* fire up command file worker */ launch_command_file_worker(); timing_point("Command file worker launched\n"); #ifdef USE_EVENT_BROKER /* send program data to broker */ broker_program_state(NEBTYPE_PROCESS_EVENTLOOPSTART, NEBFLAG_NONE, NEBATTR_NONE, NULL); #endif /* get event start time and save as macro */ event_start = time(NULL); my_free(mac->x[MACRO_EVENTSTARTTIME]); asprintf(&mac->x[MACRO_EVENTSTARTTIME], "%llu", (unsigned long long)event_start); timing_point("Entering event execution loop\n"); /***** start monitoring all services *****/ /* (doesn't return until a restart or shutdown signal is encountered) */ event_execution_loop(); /* * immediately deinitialize the query handler so it * can remove modules that have stashed data with it */ qh_deinit(qh_socket_path ? qh_socket_path : DEFAULT_QUERY_SOCKET); /* 03/01/2007 EG Moved from sighandler() to prevent FUTEX locking problems under NPTL */ /* 03/21/2007 EG SIGSEGV signals are still logged in sighandler() so we don't loose them */ /* did we catch a signal? */ if(caught_signal == TRUE) { if(sig_id == SIGHUP) logit(NSLOG_PROCESS_INFO, TRUE, "Caught SIGHUP, restarting...\n"); } #ifdef USE_EVENT_BROKER /* send program data to broker */ broker_program_state(NEBTYPE_PROCESS_EVENTLOOPEND, NEBFLAG_NONE, NEBATTR_NONE, NULL); if(sigshutdown == TRUE) broker_program_state(NEBTYPE_PROCESS_SHUTDOWN, NEBFLAG_USER_INITIATED, NEBATTR_SHUTDOWN_NORMAL, NULL); else if(sigrestart == TRUE) broker_program_state(NEBTYPE_PROCESS_RESTART, NEBFLAG_USER_INITIATED, NEBATTR_RESTART_NORMAL, NULL); #endif /* save service and host state information */ save_state_information(FALSE); cleanup_retention_data(); /* clean up performance data */ cleanup_performance_data(); /* clean up the scheduled downtime data */ cleanup_downtime_data(); /* clean up the status data unless we're restarting */ if(sigrestart == FALSE) { cleanup_status_data(TRUE); } free_worker_memory(WPROC_FORCE); /* shutdown stuff... */ if(sigshutdown == TRUE) { iobroker_destroy(nagios_iobs, IOBROKER_CLOSE_SOCKETS); nagios_iobs = NULL; /* log a shutdown message */ logit(NSLOG_PROCESS_INFO, TRUE, "Successfully shutdown... (PID=%d)\n", (int)getpid()); } /* clean up after ourselves */ cleanup(); /* close debug log */ close_debug_log(); } while(sigrestart == TRUE && sigshutdown == FALSE); if(daemon_mode == TRUE) unlink(lock_file); /* free misc memory */ my_free(lock_file); my_free(config_file); my_free(config_file_dir); my_free(nagios_binary_path); } return OK; }
2267
True
1
CVE-2016-8675
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/libav/libav/commit/e5b019725f53b79159931d3a7317107cbbfd0860', 'name': 'https://github.com/libav/libav/commit/e5b019725f53b79159931d3a7317107cbbfd0860', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://blogs.gentoo.org/ago/2016/09/07/libav-null-pointer-dereference-in-get_vlc2_get_bits_h/', 'name': 'https://blogs.gentoo.org/ago/2016/09/07/libav-null-pointer-dereference-in-get_vlc2_get_bits_h/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.securityfocus.com/bid/93468', 'name': '93468', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/10/16/13', 'name': '[oss-security] 20161015 Re: libav: null pointer dereference in get_vlc2 (get_bits.h)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libav:libav:*:*:*:*:*:*:*:*', 'versionEndIncluding': '11.8', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_vlc2 function in get_bits.h in Libav before 11.9 allows remote attackers to cause a denial of service (NULL pointer dereference and crash) via a crafted mp3 file, possibly related to startcode sequences during m4v detection.'}]
2017-02-17T14:10Z
2017-02-15T21:59Z
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
Michael Niedermayer
2014-09-07 16:39:39+02:00
m4vdec: Check for non-startcode 00 00 00 sequences in probe This makes the m4v detection less trigger-happy. Bug-Id: 949 Signed-off-by: Diego Biurrun <[email protected]>
e5b019725f53b79159931d3a7317107cbbfd0860
False
libav/libav
Libav github mirror, clone of git://git.libav.org/libav
2011-03-14 11:24:50
2021-05-22 23:16:28
www.libav.org
libav
928.0
374.0
mpeg4video_probe
mpeg4video_probe( AVProbeData * probe_packet)
['probe_packet']
static int mpeg4video_probe(AVProbeData *probe_packet) { uint32_t temp_buffer = -1; int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0; int i; for (i = 0; i < probe_packet->buf_size; i++) { temp_buffer = (temp_buffer << 8) + probe_packet->buf[i]; if ((temp_buffer & 0xffffff00) != 0x100) continue; if (temp_buffer == VOP_START_CODE) VOP++; else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++; else if (temp_buffer < 0x120) VO++; else if (temp_buffer < 0x130) VOL++; else if (!(0x1AF < temp_buffer && temp_buffer < 0x1B7) && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++; } if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res == 0) return AVPROBE_SCORE_EXTENSION; return 0; }
178
True
1
CVE-2017-9051
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.0/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
nan
[{'url': 'https://github.com/libav/libav/commit/fe6eea99efac66839052af547426518efd970b24', 'name': 'https://github.com/libav/libav/commit/fe6eea99efac66839052af547426518efd970b24', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.libav.org/show_bug.cgi?id=1039', 'name': 'https://bugzilla.libav.org/show_bug.cgi?id=1039', 'refsource': 'MISC', 'tags': ['Issue Tracking']}, {'url': 'http://www.securityfocus.com/bid/98548', 'name': '98548', 'refsource': 'BID', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libav:libav:*:*:*:*:*:*:*:*', 'versionEndIncluding': '12.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libav before 12.1 is vulnerable to an invalid read of size 1 due to NULL pointer dereferencing in the nsv_read_chunk function in libavformat/nsvdec.c.'}]
2017-05-25T01:29Z
2017-05-18T06: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
Sean McGovern
2017-03-24 13:36:51-04:00
nsvdec: don't ignore the return value of av_get_packet() Fixes invalid reads with corrupted files. CC: [email protected] Bug-Id: 1039
fe6eea99efac66839052af547426518efd970b24
False
libav/libav
Libav github mirror, clone of git://git.libav.org/libav
2011-03-14 11:24:50
2021-05-22 23:16:28
www.libav.org
libav
928.0
374.0
nsv_read_chunk
nsv_read_chunk( AVFormatContext * s , int fill_header)
['s', 'fill_header']
static int nsv_read_chunk(AVFormatContext *s, int fill_header) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; AVStream *st[2] = {NULL, NULL}; NSVStream *nst; AVPacket *pkt; int i, err = 0; uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */ uint32_t vsize; uint16_t asize; uint16_t auxsize; if (nsv->ahead[0].data || nsv->ahead[1].data) return 0; //-1; /* hey! eat what you've in your plate first! */ null_chunk_retry: if (pb->eof_reached) return -1; for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++) err = nsv_resync(s); if (err < 0) return err; if (nsv->state == NSV_FOUND_NSVS) err = nsv_parse_NSVs_header(s); if (err < 0) return err; if (nsv->state != NSV_HAS_READ_NSVS && nsv->state != NSV_FOUND_BEEF) return -1; auxcount = avio_r8(pb); vsize = avio_rl16(pb); asize = avio_rl16(pb); vsize = (vsize << 4) | (auxcount >> 4); auxcount &= 0x0f; av_log(s, AV_LOG_TRACE, "NSV CHUNK %"PRIu8" aux, %"PRIu32" bytes video, %"PRIu16" bytes audio\n", auxcount, vsize, asize); /* skip aux stuff */ for (i = 0; i < auxcount; i++) { uint32_t av_unused auxtag; auxsize = avio_rl16(pb); auxtag = avio_rl32(pb); avio_skip(pb, auxsize); vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming brain-dead */ } if (pb->eof_reached) return -1; if (!vsize && !asize) { nsv->state = NSV_UNSYNC; goto null_chunk_retry; } /* map back streams to v,a */ if (s->nb_streams > 0) st[s->streams[0]->id] = s->streams[0]; if (s->nb_streams > 1) st[s->streams[1]->id] = s->streams[1]; if (vsize && st[NSV_ST_VIDEO]) { nst = st[NSV_ST_VIDEO]->priv_data; pkt = &nsv->ahead[NSV_ST_VIDEO]; av_get_packet(pb, pkt, vsize); pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO; pkt->dts = nst->frame_offset; pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ for (i = 0; i < FFMIN(8, vsize); i++) av_log(s, AV_LOG_TRACE, "NSV video: [%d] = %02"PRIx8"\n", i, pkt->data[i]); } if(st[NSV_ST_VIDEO]) ((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset++; if (asize && st[NSV_ST_AUDIO]) { nst = st[NSV_ST_AUDIO]->priv_data; pkt = &nsv->ahead[NSV_ST_AUDIO]; /* read raw audio specific header on the first audio chunk... */ /* on ALL audio chunks ?? seems so! */ if (asize && st[NSV_ST_AUDIO]->codecpar->codec_tag == MKTAG('P', 'C', 'M', ' ')/* && fill_header*/) { uint8_t bps; uint8_t channels; uint16_t samplerate; bps = avio_r8(pb); channels = avio_r8(pb); samplerate = avio_rl16(pb); if (!channels || !samplerate) return AVERROR_INVALIDDATA; asize-=4; av_log(s, AV_LOG_TRACE, "NSV RAWAUDIO: bps %"PRIu8", nchan %"PRIu8", srate %"PRIu16"\n", bps, channels, samplerate); if (fill_header) { st[NSV_ST_AUDIO]->need_parsing = AVSTREAM_PARSE_NONE; /* we know everything */ if (bps != 16) { av_log(s, AV_LOG_TRACE, "NSV AUDIO bit/sample != 16 (%"PRIu8")!!!\n", bps); } bps /= channels; // ??? if (bps == 8) st[NSV_ST_AUDIO]->codecpar->codec_id = AV_CODEC_ID_PCM_U8; samplerate /= 4;/* UGH ??? XXX */ channels = 1; st[NSV_ST_AUDIO]->codecpar->channels = channels; st[NSV_ST_AUDIO]->codecpar->sample_rate = samplerate; av_log(s, AV_LOG_TRACE, "NSV RAWAUDIO: bps %"PRIu8", nchan %"PRIu8", srate %"PRIu16"\n", bps, channels, samplerate); } } av_get_packet(pb, pkt, asize); pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO; pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) { /* on a nsvs frame we have new information on a/v sync */ pkt->dts = (((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset-1); pkt->dts *= (int64_t)1000 * nsv->framerate.den; pkt->dts += (int64_t)nsv->avsync * nsv->framerate.num; av_log(s, AV_LOG_TRACE, "NSV AUDIO: sync:%"PRId16", dts:%"PRId64, nsv->avsync, pkt->dts); } nst->frame_offset++; } nsv->state = NSV_UNSYNC; return 0; }
885
True
1
CVE-2017-0380
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:N/A:N
NETWORK
MEDIUM
NONE
PARTIAL
NONE
NONE
4.3
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
NETWORK
HIGH
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
5.9
MEDIUM
2.2
3.6
nan
[{'url': 'https://trac.torproject.org/projects/tor/ticket/23490', 'name': 'https://trac.torproject.org/projects/tor/ticket/23490', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torproject/tor/commit/09ea89764a4d3a907808ed7d4fe42abfe64bd486', 'name': 'https://github.com/torproject/tor/commit/09ea89764a4d3a907808ed7d4fe42abfe64bd486', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1039519', 'name': '1039519', 'refsource': 'SECTRACK', 'tags': []}, {'url': 'http://www.debian.org/security/2017/dsa-3993', 'name': 'DSA-3993', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-532'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.0:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.3:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.1:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.2:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.2:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.3:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.1:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.1.2:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.1.3:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.5:rc:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.4:rc:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.1.4:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.1.5:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.1.1:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.1.6:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.4:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.5:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.8.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The rend_service_intro_established function in or/rendservice.c in Tor before 0.2.8.15, 0.2.9.x before 0.2.9.12, 0.3.0.x before 0.3.0.11, 0.3.1.x before 0.3.1.7, and 0.3.2.x before 0.3.2.1-alpha, when SafeLogging is disabled, allows attackers to obtain sensitive information by leveraging access to the log files of a hidden service, because uninitialized stack data is included in an error message about construction of an introduction point circuit.'}]
2017-11-06T02:29Z
2017-09-18T16:29Z
Insertion of Sensitive Information into Log File
Information written to log files can be of a sensitive nature and give valuable guidance to an attacker or expose sensitive user information.
While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers. Different log files may be produced and stored for: Server log files (e.g. server.log). This can give information on whatever application left the file. Usually this can give full path names and system information, and sometimes usernames and passwords. log files that are used for debugging
https://cwe.mitre.org/data/definitions/532.html
0
Nick Mathewson
2017-09-18 09:25:21-04:00
Fix log-uninitialized-stack bug in rend_service_intro_established. Fixes bug 23490; bugfix on 0.2.7.2-alpha. TROVE-2017-008 CVE-2017-0380
09ea89764a4d3a907808ed7d4fe42abfe64bd486
False
torproject/tor
unofficial git repo -- report bugs/issues/pull requests on https://gitlab.torproject.org/ --
2013-06-05 21:50:25
2022-08-12 15:04:39
https://gitweb.torproject.org/tor.git
torproject
3272.0
836.0
rend_service_intro_established
rend_service_intro_established( origin_circuit_t * circuit , const uint8_t * request , size_t request_len)
['circuit', 'request', 'request_len']
rend_service_intro_established(origin_circuit_t *circuit, const uint8_t *request, size_t request_len) { rend_service_t *service; rend_intro_point_t *intro; char serviceid[REND_SERVICE_ID_LEN_BASE32+1]; (void) request; (void) request_len; tor_assert(circuit->rend_data); /* XXX: This is version 2 specific (only supported one for now). */ const char *rend_pk_digest = (char *) rend_data_get_pk_digest(circuit->rend_data, NULL); if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_ESTABLISH_INTRO) { log_warn(LD_PROTOCOL, "received INTRO_ESTABLISHED cell on non-intro circuit."); goto err; } service = rend_service_get_by_pk_digest(rend_pk_digest); if (!service) { log_warn(LD_REND, "Unknown service on introduction circuit %u.", (unsigned)circuit->base_.n_circ_id); goto err; } /* We've just successfully established a intro circuit to one of our * introduction point, account for it. */ intro = find_intro_point(circuit); if (intro == NULL) { log_warn(LD_REND, "Introduction circuit established without a rend_intro_point_t " "object for service %s on circuit %u", safe_str_client(serviceid), (unsigned)circuit->base_.n_circ_id); goto err; } intro->circuit_established = 1; /* We might not have every introduction point ready but at this point we * know that the descriptor needs to be uploaded. */ service->desc_is_dirty = time(NULL); circuit_change_purpose(TO_CIRCUIT(circuit), CIRCUIT_PURPOSE_S_INTRO); base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32 + 1, rend_pk_digest, REND_SERVICE_ID_LEN); log_info(LD_REND, "Received INTRO_ESTABLISHED cell on circuit %u for service %s", (unsigned)circuit->base_.n_circ_id, serviceid); /* Getting a valid INTRODUCE_ESTABLISHED means we've successfully * used the circ */ pathbias_mark_use_success(circuit); return 0; err: circuit_mark_for_close(TO_CIRCUIT(circuit), END_CIRC_REASON_TORPROTOCOL); return -1; }
242
True
1
CVE-2016-8860
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://trac.torproject.org/projects/tor/ticket/20384', 'name': 'https://trac.torproject.org/projects/tor/ticket/20384', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/torproject/tor/commit/3cea86eb2fbb65949673eb4ba8ebb695c87a57ce', 'name': 'https://github.com/torproject/tor/commit/3cea86eb2fbb65949673eb4ba8ebb695c87a57ce', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://blog.torproject.org/blog/tor-0289-released-important-fixes', 'name': 'https://blog.torproject.org/blog/tor-0289-released-important-fixes', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://openwall.com/lists/oss-security/2016/10/19/11', 'name': '[oss-security] 20161019 Re: CVE request for tor', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/95116', 'name': '95116', 'refsource': 'BID', 'tags': []}, {'url': 'http://www.debian.org/security/2016/dsa-3694', 'name': 'DSA-3694', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/201612-45', 'name': 'GLSA-201612-45', 'refsource': 'GENTOO', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.8.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.0:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.2:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.3:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.2.9.1:alpha:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Tor before 0.2.8.9 and 0.2.9.x before 0.2.9.4-alpha had internal functions that were entitled to expect that buf_t data had NUL termination, but the implementation of or/buffers.c did not ensure that NUL termination was present, which allows remote attackers to cause a denial of service (client, hidden service, relay, or authority crash) via crafted data.'}]
2017-07-01T01:30Z
2017-01-04T20: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
Nick Mathewson
2016-10-14 09:38:12-04:00
Add a one-word sentinel value of 0x0 at the end of each buf_t chunk This helps protect against bugs where any part of a buf_t's memory is passed to a function that expects a NUL-terminated input. It also closes TROVE-2016-10-001 (aka bug 20384).
3cea86eb2fbb65949673eb4ba8ebb695c87a57ce
False
torproject/tor
unofficial git repo -- report bugs/issues/pull requests on https://gitlab.torproject.org/ --
2013-06-05 21:50:25
2022-08-12 15:04:39
https://gitweb.torproject.org/tor.git
torproject
3272.0
836.0
chunk_grow
chunk_grow( chunk_t * chunk , size_t sz)
['chunk', 'sz']
chunk_grow(chunk_t *chunk, size_t sz) { off_t offset; size_t memlen_orig = chunk->memlen; tor_assert(sz > chunk->memlen); offset = chunk->data - chunk->mem; chunk = tor_realloc(chunk, CHUNK_ALLOC_SIZE(sz)); chunk->memlen = sz; chunk->data = chunk->mem + offset; #ifdef DEBUG_CHUNK_ALLOC tor_assert(chunk->DBG_alloc == CHUNK_ALLOC_SIZE(memlen_orig)); chunk->DBG_alloc = CHUNK_ALLOC_SIZE(sz); #endif total_bytes_allocated_in_chunks += CHUNK_ALLOC_SIZE(sz) - CHUNK_ALLOC_SIZE(memlen_orig); return chunk; }
104
True
1
CVE-2017-0375
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://trac.torproject.org/projects/tor/ticket/22493', 'name': 'https://trac.torproject.org/projects/tor/ticket/22493', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking']}, {'url': 'https://lists.torproject.org/pipermail/tor-announce/2017-June/000131.html', 'name': 'https://lists.torproject.org/pipermail/tor-announce/2017-June/000131.html', 'refsource': 'CONFIRM', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/torproject/tor/commit/79b59a2dfcb68897ee89d98587d09e55f07e68d7', 'name': 'https://github.com/torproject/tor/commit/79b59a2dfcb68897ee89d98587d09e55f07e68d7', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/99017', 'name': '99017', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0.8', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The hidden-service feature in Tor before 0.3.0.8 allows a denial of service (assertion failure and daemon exit) in the relay_send_end_cell_from_edge_ function via a malformed BEGIN cell.'}]
2019-10-03T00:03Z
2017-06-09T17:29Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
David Goulet
2017-06-05 09:35:03-04:00
TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_ This fixes an assertion failure in relay_send_end_cell_from_edge_() when an origin circuit and a cpath_layer = NULL were passed. A service rendezvous circuit could do such a thing when a malformed BEGIN cell is received but shouldn't in the first place because the service needs to send an END cell on the circuit for which it can not do without a cpath_layer. Fixes #22493 Reported-by: Roger Dingledine <[email protected]> Signed-off-by: David Goulet <[email protected]>
79b59a2dfcb68897ee89d98587d09e55f07e68d7
False
torproject/tor
unofficial git repo -- report bugs/issues/pull requests on https://gitlab.torproject.org/ --
2013-06-05 21:50:25
2022-08-12 15:04:39
https://gitweb.torproject.org/tor.git
torproject
3272.0
836.0
connection_exit_begin_conn
connection_exit_begin_conn( cell_t * cell , circuit_t * circ)
['cell', 'circ']
connection_exit_begin_conn(cell_t *cell, circuit_t *circ) { edge_connection_t *n_stream; relay_header_t rh; char *address = NULL; uint16_t port = 0; or_circuit_t *or_circ = NULL; const or_options_t *options = get_options(); begin_cell_t bcell; int rv; uint8_t end_reason=0; assert_circuit_ok(circ); if (!CIRCUIT_IS_ORIGIN(circ)) or_circ = TO_OR_CIRCUIT(circ); relay_header_unpack(&rh, cell->payload); if (rh.length > RELAY_PAYLOAD_SIZE) return -END_CIRC_REASON_TORPROTOCOL; /* Note: we have to use relay_send_command_from_edge here, not * connection_edge_end or connection_edge_send_command, since those require * that we have a stream connected to a circuit, and we don't connect to a * circuit until we have a pending/successful resolve. */ if (!server_mode(options) && circ->purpose != CIRCUIT_PURPOSE_S_REND_JOINED) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Relay begin cell at non-server. Closing."); relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_EXITPOLICY, NULL); return 0; } rv = begin_cell_parse(cell, &bcell, &end_reason); if (rv < -1) { return -END_CIRC_REASON_TORPROTOCOL; } else if (rv == -1) { tor_free(bcell.address); relay_send_end_cell_from_edge(rh.stream_id, circ, end_reason, NULL); return 0; } if (! bcell.is_begindir) { /* Steal reference */ address = bcell.address; port = bcell.port; if (or_circ && or_circ->p_chan) { if (!options->AllowSingleHopExits && (or_circ->is_first_hop || (!connection_or_digest_is_known_relay( or_circ->p_chan->identity_digest) && should_refuse_unknown_exits(options)))) { /* Don't let clients use us as a single-hop proxy, unless the user * has explicitly allowed that in the config. It attracts attackers * and users who'd be better off with, well, single-hop proxies. */ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Attempt by %s to open a stream %s. Closing.", safe_str(channel_get_canonical_remote_descr(or_circ->p_chan)), or_circ->is_first_hop ? "on first hop of circuit" : "from unknown relay"); relay_send_end_cell_from_edge(rh.stream_id, circ, or_circ->is_first_hop ? END_STREAM_REASON_TORPROTOCOL : END_STREAM_REASON_MISC, NULL); tor_free(address); return 0; } } } else if (rh.command == RELAY_COMMAND_BEGIN_DIR) { if (!directory_permits_begindir_requests(options) || circ->purpose != CIRCUIT_PURPOSE_OR) { relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_NOTDIRECTORY, NULL); return 0; } /* Make sure to get the 'real' address of the previous hop: the * caller might want to know whether the remote IP address has changed, * and we might already have corrected base_.addr[ess] for the relay's * canonical IP address. */ if (or_circ && or_circ->p_chan) address = tor_strdup(channel_get_actual_remote_address(or_circ->p_chan)); else address = tor_strdup("127.0.0.1"); port = 1; /* XXXX This value is never actually used anywhere, and there * isn't "really" a connection here. But we * need to set it to something nonzero. */ } else { log_warn(LD_BUG, "Got an unexpected command %d", (int)rh.command); relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_INTERNAL, NULL); return 0; } if (! options->IPv6Exit) { /* I don't care if you prefer IPv6; I can't give you any. */ bcell.flags &= ~BEGIN_FLAG_IPV6_PREFERRED; /* If you don't want IPv4, I can't help. */ if (bcell.flags & BEGIN_FLAG_IPV4_NOT_OK) { tor_free(address); relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_EXITPOLICY, NULL); return 0; } } log_debug(LD_EXIT,"Creating new exit connection."); /* The 'AF_INET' here is temporary; we might need to change it later in * connection_exit_connect(). */ n_stream = edge_connection_new(CONN_TYPE_EXIT, AF_INET); /* Remember the tunneled request ID in the new edge connection, so that * we can measure download times. */ n_stream->dirreq_id = circ->dirreq_id; n_stream->base_.purpose = EXIT_PURPOSE_CONNECT; n_stream->begincell_flags = bcell.flags; n_stream->stream_id = rh.stream_id; n_stream->base_.port = port; /* leave n_stream->s at -1, because it's not yet valid */ n_stream->package_window = STREAMWINDOW_START; n_stream->deliver_window = STREAMWINDOW_START; if (circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED) { origin_circuit_t *origin_circ = TO_ORIGIN_CIRCUIT(circ); log_info(LD_REND,"begin is for rendezvous. configuring stream."); n_stream->base_.address = tor_strdup("(rendezvous)"); n_stream->base_.state = EXIT_CONN_STATE_CONNECTING; n_stream->rend_data = rend_data_dup(origin_circ->rend_data); tor_assert(connection_edge_is_rendezvous_stream(n_stream)); assert_circuit_ok(circ); const int r = rend_service_set_connection_addr_port(n_stream, origin_circ); if (r < 0) { log_info(LD_REND,"Didn't find rendezvous service (port %d)", n_stream->base_.port); /* Send back reason DONE because we want to make hidden service port * scanning harder thus instead of returning that the exit policy * didn't match, which makes it obvious that the port is closed, * return DONE and kill the circuit. That way, a user (malicious or * not) needs one circuit per bad port unless it matches the policy of * the hidden service. */ relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_DONE, origin_circ->cpath->prev); connection_free(TO_CONN(n_stream)); tor_free(address); /* Drop the circuit here since it might be someone deliberately * scanning the hidden service ports. Note that this mitigates port * scanning by adding more work on the attacker side to successfully * scan but does not fully solve it. */ if (r < -1) return END_CIRC_AT_ORIGIN; else return 0; } assert_circuit_ok(circ); log_debug(LD_REND,"Finished assigning addr/port"); n_stream->cpath_layer = origin_circ->cpath->prev; /* link it */ /* add it into the linked list of p_streams on this circuit */ n_stream->next_stream = origin_circ->p_streams; n_stream->on_circuit = circ; origin_circ->p_streams = n_stream; assert_circuit_ok(circ); origin_circ->rend_data->nr_streams++; connection_exit_connect(n_stream); /* For path bias: This circuit was used successfully */ pathbias_mark_use_success(origin_circ); tor_free(address); return 0; } tor_strlower(address); n_stream->base_.address = address; n_stream->base_.state = EXIT_CONN_STATE_RESOLVEFAILED; /* default to failed, change in dns_resolve if it turns out not to fail */ if (we_are_hibernating()) { relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_HIBERNATING, NULL); connection_free(TO_CONN(n_stream)); return 0; } n_stream->on_circuit = circ; if (rh.command == RELAY_COMMAND_BEGIN_DIR) { tor_addr_t tmp_addr; tor_assert(or_circ); if (or_circ->p_chan && channel_get_addr_if_possible(or_circ->p_chan, &tmp_addr)) { tor_addr_copy(&n_stream->base_.addr, &tmp_addr); } return connection_exit_connect_dir(n_stream); } log_debug(LD_EXIT,"about to start the dns_resolve()."); /* send it off to the gethostbyname farm */ switch (dns_resolve(n_stream)) { case 1: /* resolve worked; now n_stream is attached to circ. */ assert_circuit_ok(circ); log_debug(LD_EXIT,"about to call connection_exit_connect()."); connection_exit_connect(n_stream); return 0; case -1: /* resolve failed */ relay_send_end_cell_from_edge(rh.stream_id, circ, END_STREAM_REASON_RESOLVEFAILED, NULL); /* n_stream got freed. don't touch it. */ break; case 0: /* resolve added to pending list */ assert_circuit_ok(circ); break; } return 0; }
939
True
1
CVE-2017-0376
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://trac.torproject.org/projects/tor/ticket/22494', 'name': 'https://trac.torproject.org/projects/tor/ticket/22494', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.torproject.org/pipermail/tor-announce/2017-June/000131.html', 'name': 'https://lists.torproject.org/pipermail/tor-announce/2017-June/000131.html', 'refsource': 'CONFIRM', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/torproject/tor/commit/56a7c5bc15e0447203a491c1ee37de9939ad1dcd', 'name': 'https://github.com/torproject/tor/commit/56a7c5bc15e0447203a491c1ee37de9939ad1dcd', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3877', 'name': 'DSA-3877', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0.8', '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 hidden-service feature in Tor before 0.3.0.8 allows a denial of service (assertion failure and daemon exit) in the connection_edge_process_relay_cell function via a BEGIN_DIR cell on a rendezvous circuit.'}]
2019-10-03T00:03Z
2017-06-09T17:29Z
Reachable Assertion
The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
https://cwe.mitre.org/data/definitions/617.html
0
David Goulet
2017-06-05 11:11:42-04:00
TROVE-2017-005: Fix assertion failure in connection_edge_process_relay_cell On an hidden service rendezvous circuit, a BEGIN_DIR could be sent (maliciously) which would trigger a tor_assert() because connection_edge_process_relay_cell() thought that the circuit is an or_circuit_t but is an origin circuit in reality. Fixes #22494 Reported-by: Roger Dingledine <[email protected]> Signed-off-by: David Goulet <[email protected]>
56a7c5bc15e0447203a491c1ee37de9939ad1dcd
False
torproject/tor
unofficial git repo -- report bugs/issues/pull requests on https://gitlab.torproject.org/ --
2013-06-05 21:50:25
2022-08-12 15:04:39
https://gitweb.torproject.org/tor.git
torproject
3272.0
836.0
connection_edge_process_relay_cell
connection_edge_process_relay_cell( cell_t * cell , circuit_t * circ , edge_connection_t * conn , crypt_path_t * layer_hint)
['cell', 'circ', 'conn', 'layer_hint']
connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, edge_connection_t *conn, crypt_path_t *layer_hint) { static int num_seen=0; relay_header_t rh; unsigned domain = layer_hint?LD_APP:LD_EXIT; int reason; int optimistic_data = 0; /* Set to 1 if we receive data on a stream * that's in the EXIT_CONN_STATE_RESOLVING * or EXIT_CONN_STATE_CONNECTING states. */ tor_assert(cell); tor_assert(circ); relay_header_unpack(&rh, cell->payload); // log_fn(LOG_DEBUG,"command %d stream %d", rh.command, rh.stream_id); num_seen++; log_debug(domain, "Now seen %d relay cells here (command %d, stream %d).", num_seen, rh.command, rh.stream_id); if (rh.length > RELAY_PAYLOAD_SIZE) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Relay cell length field too long. Closing circuit."); return - END_CIRC_REASON_TORPROTOCOL; } if (rh.stream_id == 0) { switch (rh.command) { case RELAY_COMMAND_BEGIN: case RELAY_COMMAND_CONNECTED: case RELAY_COMMAND_DATA: case RELAY_COMMAND_END: case RELAY_COMMAND_RESOLVE: case RELAY_COMMAND_RESOLVED: case RELAY_COMMAND_BEGIN_DIR: log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Relay command %d with zero " "stream_id. Dropping.", (int)rh.command); return 0; default: ; } } /* either conn is NULL, in which case we've got a control cell, or else * conn points to the recognized stream. */ if (conn && !connection_state_is_open(TO_CONN(conn))) { if (conn->base_.type == CONN_TYPE_EXIT && (conn->base_.state == EXIT_CONN_STATE_CONNECTING || conn->base_.state == EXIT_CONN_STATE_RESOLVING) && rh.command == RELAY_COMMAND_DATA) { /* Allow DATA cells to be delivered to an exit node in state * EXIT_CONN_STATE_CONNECTING or EXIT_CONN_STATE_RESOLVING. * This speeds up HTTP, for example. */ optimistic_data = 1; } else { return connection_edge_process_relay_cell_not_open( &rh, cell, circ, conn, layer_hint); } } switch (rh.command) { case RELAY_COMMAND_DROP: // log_info(domain,"Got a relay-level padding cell. Dropping."); return 0; case RELAY_COMMAND_BEGIN: case RELAY_COMMAND_BEGIN_DIR: if (layer_hint && circ->purpose != CIRCUIT_PURPOSE_S_REND_JOINED) { log_fn(LOG_PROTOCOL_WARN, LD_APP, "Relay begin request unsupported at AP. Dropping."); return 0; } if (circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED && layer_hint != TO_ORIGIN_CIRCUIT(circ)->cpath->prev) { log_fn(LOG_PROTOCOL_WARN, LD_APP, "Relay begin request to Hidden Service " "from intermediary node. Dropping."); return 0; } if (conn) { log_fn(LOG_PROTOCOL_WARN, domain, "Begin cell for known stream. Dropping."); return 0; } if (rh.command == RELAY_COMMAND_BEGIN_DIR) { /* Assign this circuit and its app-ward OR connection a unique ID, * so that we can measure download times. The local edge and dir * connection will be assigned the same ID when they are created * and linked. */ static uint64_t next_id = 0; circ->dirreq_id = ++next_id; TO_OR_CIRCUIT(circ)->p_chan->dirreq_id = circ->dirreq_id; } return connection_exit_begin_conn(cell, circ); case RELAY_COMMAND_DATA: ++stats_n_data_cells_received; if (( layer_hint && --layer_hint->deliver_window < 0) || (!layer_hint && --circ->deliver_window < 0)) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "(relay data) circ deliver_window below 0. Killing."); if (conn) { /* XXXX Do we actually need to do this? Will killing the circuit * not send an END and mark the stream for close as appropriate? */ connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL); connection_mark_for_close(TO_CONN(conn)); } return -END_CIRC_REASON_TORPROTOCOL; } log_debug(domain,"circ deliver_window now %d.", layer_hint ? layer_hint->deliver_window : circ->deliver_window); circuit_consider_sending_sendme(circ, layer_hint); if (!conn) { log_info(domain,"data cell dropped, unknown stream (streamid %d).", rh.stream_id); return 0; } if (--conn->deliver_window < 0) { /* is it below 0 after decrement? */ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "(relay data) conn deliver_window below 0. Killing."); return -END_CIRC_REASON_TORPROTOCOL; } stats_n_data_bytes_received += rh.length; connection_write_to_buf((char*)(cell->payload + RELAY_HEADER_SIZE), rh.length, TO_CONN(conn)); if (!optimistic_data) { /* Only send a SENDME if we're not getting optimistic data; otherwise * a SENDME could arrive before the CONNECTED. */ connection_edge_consider_sending_sendme(conn); } return 0; case RELAY_COMMAND_END: reason = rh.length > 0 ? get_uint8(cell->payload+RELAY_HEADER_SIZE) : END_STREAM_REASON_MISC; if (!conn) { log_info(domain,"end cell (%s) dropped, unknown stream.", stream_end_reason_to_string(reason)); return 0; } /* XXX add to this log_fn the exit node's nickname? */ log_info(domain,TOR_SOCKET_T_FORMAT": end cell (%s) for stream %d. " "Removing stream.", conn->base_.s, stream_end_reason_to_string(reason), conn->stream_id); if (conn->base_.type == CONN_TYPE_AP) { entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn); if (entry_conn->socks_request && !entry_conn->socks_request->has_finished) log_warn(LD_BUG, "open stream hasn't sent socks answer yet? Closing."); } /* We just *got* an end; no reason to send one. */ conn->edge_has_sent_end = 1; if (!conn->end_reason) conn->end_reason = reason | END_STREAM_REASON_FLAG_REMOTE; if (!conn->base_.marked_for_close) { /* only mark it if not already marked. it's possible to * get the 'end' right around when the client hangs up on us. */ connection_mark_and_flush(TO_CONN(conn)); } return 0; case RELAY_COMMAND_EXTEND: case RELAY_COMMAND_EXTEND2: { static uint64_t total_n_extend=0, total_nonearly=0; total_n_extend++; if (rh.stream_id) { log_fn(LOG_PROTOCOL_WARN, domain, "'extend' cell received for non-zero stream. Dropping."); return 0; } if (cell->command != CELL_RELAY_EARLY && !networkstatus_get_param(NULL,"AllowNonearlyExtend",0,0,1)) { #define EARLY_WARNING_INTERVAL 3600 static ratelim_t early_warning_limit = RATELIM_INIT(EARLY_WARNING_INTERVAL); char *m; if (cell->command == CELL_RELAY) { ++total_nonearly; if ((m = rate_limit_log(&early_warning_limit, approx_time()))) { double percentage = ((double)total_nonearly)/total_n_extend; percentage *= 100; log_fn(LOG_PROTOCOL_WARN, domain, "EXTEND cell received, " "but not via RELAY_EARLY. Dropping.%s", m); log_fn(LOG_PROTOCOL_WARN, domain, " (We have dropped %.02f%% of " "all EXTEND cells for this reason)", percentage); tor_free(m); } } else { log_fn(LOG_WARN, domain, "EXTEND cell received, in a cell with type %d! Dropping.", cell->command); } return 0; } return circuit_extend(cell, circ); } case RELAY_COMMAND_EXTENDED: case RELAY_COMMAND_EXTENDED2: if (!layer_hint) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "'extended' unsupported at non-origin. Dropping."); return 0; } log_debug(domain,"Got an extended cell! Yay."); { extended_cell_t extended_cell; if (extended_cell_parse(&extended_cell, rh.command, (const uint8_t*)cell->payload+RELAY_HEADER_SIZE, rh.length)<0) { log_warn(LD_PROTOCOL, "Can't parse EXTENDED cell; killing circuit."); return -END_CIRC_REASON_TORPROTOCOL; } if ((reason = circuit_finish_handshake(TO_ORIGIN_CIRCUIT(circ), &extended_cell.created_cell)) < 0) { log_warn(domain,"circuit_finish_handshake failed."); return reason; } } if ((reason=circuit_send_next_onion_skin(TO_ORIGIN_CIRCUIT(circ)))<0) { log_info(domain,"circuit_send_next_onion_skin() failed."); return reason; } return 0; case RELAY_COMMAND_TRUNCATE: if (layer_hint) { log_fn(LOG_PROTOCOL_WARN, LD_APP, "'truncate' unsupported at origin. Dropping."); return 0; } if (circ->n_hop) { if (circ->n_chan) log_warn(LD_BUG, "n_chan and n_hop set on the same circuit!"); extend_info_free(circ->n_hop); circ->n_hop = NULL; tor_free(circ->n_chan_create_cell); circuit_set_state(circ, CIRCUIT_STATE_OPEN); } if (circ->n_chan) { uint8_t trunc_reason = get_uint8(cell->payload + RELAY_HEADER_SIZE); circuit_clear_cell_queue(circ, circ->n_chan); channel_send_destroy(circ->n_circ_id, circ->n_chan, trunc_reason); circuit_set_n_circid_chan(circ, 0, NULL); } log_debug(LD_EXIT, "Processed 'truncate', replying."); { char payload[1]; payload[0] = (char)END_CIRC_REASON_REQUESTED; relay_send_command_from_edge(0, circ, RELAY_COMMAND_TRUNCATED, payload, sizeof(payload), NULL); } return 0; case RELAY_COMMAND_TRUNCATED: if (!layer_hint) { log_fn(LOG_PROTOCOL_WARN, LD_EXIT, "'truncated' unsupported at non-origin. Dropping."); return 0; } circuit_truncated(TO_ORIGIN_CIRCUIT(circ), layer_hint, get_uint8(cell->payload + RELAY_HEADER_SIZE)); return 0; case RELAY_COMMAND_CONNECTED: if (conn) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "'connected' unsupported while open. Closing circ."); return -END_CIRC_REASON_TORPROTOCOL; } log_info(domain, "'connected' received, no conn attached anymore. Ignoring."); return 0; case RELAY_COMMAND_SENDME: if (!rh.stream_id) { if (layer_hint) { if (layer_hint->package_window + CIRCWINDOW_INCREMENT > CIRCWINDOW_START_MAX) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Unexpected sendme cell from exit relay. " "Closing circ."); return -END_CIRC_REASON_TORPROTOCOL; } layer_hint->package_window += CIRCWINDOW_INCREMENT; log_debug(LD_APP,"circ-level sendme at origin, packagewindow %d.", layer_hint->package_window); circuit_resume_edge_reading(circ, layer_hint); } else { if (circ->package_window + CIRCWINDOW_INCREMENT > CIRCWINDOW_START_MAX) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Unexpected sendme cell from client. " "Closing circ (window %d).", circ->package_window); return -END_CIRC_REASON_TORPROTOCOL; } circ->package_window += CIRCWINDOW_INCREMENT; log_debug(LD_APP, "circ-level sendme at non-origin, packagewindow %d.", circ->package_window); circuit_resume_edge_reading(circ, layer_hint); } return 0; } if (!conn) { log_info(domain,"sendme cell dropped, unknown stream (streamid %d).", rh.stream_id); return 0; } conn->package_window += STREAMWINDOW_INCREMENT; log_debug(domain,"stream-level sendme, packagewindow now %d.", conn->package_window); if (circuit_queue_streams_are_blocked(circ)) { /* Still waiting for queue to flush; don't touch conn */ return 0; } connection_start_reading(TO_CONN(conn)); /* handle whatever might still be on the inbuf */ if (connection_edge_package_raw_inbuf(conn, 1, NULL) < 0) { /* (We already sent an end cell if possible) */ connection_mark_for_close(TO_CONN(conn)); return 0; } return 0; case RELAY_COMMAND_RESOLVE: if (layer_hint) { log_fn(LOG_PROTOCOL_WARN, LD_APP, "resolve request unsupported at AP; dropping."); return 0; } else if (conn) { log_fn(LOG_PROTOCOL_WARN, domain, "resolve request for known stream; dropping."); return 0; } else if (circ->purpose != CIRCUIT_PURPOSE_OR) { log_fn(LOG_PROTOCOL_WARN, domain, "resolve request on circ with purpose %d; dropping", circ->purpose); return 0; } connection_exit_begin_resolve(cell, TO_OR_CIRCUIT(circ)); return 0; case RELAY_COMMAND_RESOLVED: if (conn) { log_fn(LOG_PROTOCOL_WARN, domain, "'resolved' unsupported while open. Closing circ."); return -END_CIRC_REASON_TORPROTOCOL; } log_info(domain, "'resolved' received, no conn attached anymore. Ignoring."); return 0; case RELAY_COMMAND_ESTABLISH_INTRO: case RELAY_COMMAND_ESTABLISH_RENDEZVOUS: case RELAY_COMMAND_INTRODUCE1: case RELAY_COMMAND_INTRODUCE2: case RELAY_COMMAND_INTRODUCE_ACK: case RELAY_COMMAND_RENDEZVOUS1: case RELAY_COMMAND_RENDEZVOUS2: case RELAY_COMMAND_INTRO_ESTABLISHED: case RELAY_COMMAND_RENDEZVOUS_ESTABLISHED: rend_process_relay_cell(circ, layer_hint, rh.command, rh.length, cell->payload+RELAY_HEADER_SIZE); return 0; } log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Received unknown relay command %d. Perhaps the other side is using " "a newer version of Tor? Dropping.", rh.command); return 0; /* for forward compatibility, don't kill the circuit */ }
1679
True
1
CVE-2017-0377
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:N
NETWORK
LOW
NONE
PARTIAL
NONE
NONE
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
7.5
HIGH
3.9
3.6
True
[{'url': 'https://trac.torproject.org/projects/tor/ticket/22753', 'name': 'https://trac.torproject.org/projects/tor/ticket/22753', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Vendor Advisory']}, {'url': 'https://security-tracker.debian.org/CVE-2017-0377', 'name': 'https://security-tracker.debian.org/CVE-2017-0377', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/torproject/tor/commit/665baf5ed5c6186d973c46cdea165c0548027350', 'name': 'https://github.com/torproject/tor/commit/665baf5ed5c6186d973c46cdea165c0548027350', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blog.torproject.org/blog/tor-0314-alpha-released-security-update-clients', 'name': 'https://blog.torproject.org/blog/tor-0314-alpha-released-security-update-clients', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://blog.torproject.org/blog/tor-0309-released-security-update-clients', 'name': 'https://blog.torproject.org/blog/tor-0309-released-security-update-clients', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.3:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.1:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.2:alpha:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:torproject:tor:0.3.0.6:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "Tor 0.3.x before 0.3.0.9 has a guard-selection algorithm that only considers the exit relay (not the exit relay's family), which might allow remote attackers to defeat intended anonymity properties by leveraging the existence of large families."}]
2017-07-14T14:21Z
2017-07-02T15:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Nick Mathewson
2017-06-28 11:41:50-04:00
Consider the exit family when applying guard restrictions. When the new path selection logic went into place, I accidentally dropped the code that considered the _family_ of the exit node when deciding if the guard was usable, and we didn't catch that during code review. This patch makes the guard_restriction_t code consider the exit family as well, and adds some (hopefully redundant) checks for the case where we lack a node_t for a guard but we have a bridge_info_t for it. Fixes bug 22753; bugfix on 0.3.0.1-alpha. Tracked as TROVE-2016-006 and CVE-2017-0377.
665baf5ed5c6186d973c46cdea165c0548027350
False
torproject/tor
unofficial git repo -- report bugs/issues/pull requests on https://gitlab.torproject.org/ --
2013-06-05 21:50:25
2022-08-12 15:04:39
https://gitweb.torproject.org/tor.git
torproject
3272.0
836.0
entry_guard_obeys_restriction
entry_guard_obeys_restriction( const entry_guard_t * guard , const entry_guard_restriction_t * rst)
['guard', 'rst']
entry_guard_obeys_restriction(const entry_guard_t *guard, const entry_guard_restriction_t *rst) { tor_assert(guard); if (! rst) return 1; // No restriction? No problem. // Only one kind of restriction exists right now return tor_memneq(guard->identity, rst->exclude_id, DIGEST_LEN); }
41
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::DSA_PrivateKey::create_signature_op
Botan::DSA_PrivateKey::create_signature_op( RandomNumberGenerator & , const std :: string & params , const std :: string & provider) const
['params', 'provider']
DSA_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/, const std::string& params, const std::string& provider) const { if(provider == "base" || provider.empty()) return std::unique_ptr<PK_Ops::Signature>(new DSA_Signature_Operation(*this, params)); throw Provider_Not_Found(algo_name(), provider); }
66
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::DSA_Signature_Operation::DSA_Signature_Operation
Botan::DSA_Signature_Operation::DSA_Signature_Operation( const DSA_PrivateKey & dsa , const std :: string & emsa)
['dsa', 'emsa']
DSA_Signature_Operation(const DSA_PrivateKey& dsa, const std::string& emsa) : PK_Ops::Signature_with_EMSA(emsa), m_group(dsa.get_group()), m_x(dsa.get_x()), m_mod_q(dsa.group_q()) { #if defined(BOTAN_HAS_RFC6979_GENERATOR) m_rfc6979_hash = hash_for_emsa(emsa); #endif }
57
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::DSA_Signature_Operation::raw_sign
Botan::DSA_Signature_Operation::raw_sign( const uint8_t msg [ ] , size_t msg_len , RandomNumberGenerator & rng)
['msg_len', 'rng']
DSA_Signature_Operation::raw_sign(const uint8_t msg[], size_t msg_len, RandomNumberGenerator& rng) { const BigInt& q = m_group.get_q(); BigInt i(msg, msg_len, q.bits()); while(i >= q) i -= q; #if defined(BOTAN_HAS_RFC6979_GENERATOR) BOTAN_UNUSED(rng); const BigInt k = generate_rfc6979_nonce(m_x, q, i, m_rfc6979_hash); #else const BigInt k = BigInt::random_integer(rng, 1, q); #endif BigInt s = inverse_mod(k, q); const BigInt r = m_mod_q.reduce(m_group.power_g_p(k)); s = m_mod_q.multiply(s, mul_add(m_x, r, i)); // With overwhelming probability, a bug rather than actual zero r/s if(r.is_zero() || s.is_zero()) throw Internal_Error("Computed zero r/s during DSA signature"); return BigInt::encode_fixed_length_int_pair(r, s, q.bytes()); }
169
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::DSA_Verification_Operation::DSA_Verification_Operation
Botan::DSA_Verification_Operation::DSA_Verification_Operation( const DSA_PublicKey & dsa , const std :: string & emsa)
['dsa', 'emsa']
DSA_Verification_Operation(const DSA_PublicKey& dsa, const std::string& emsa) : PK_Ops::Verification_with_EMSA(emsa), m_group(dsa.get_group()), m_y(dsa.get_y()), m_mod_q(dsa.group_q()) {}
50
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::ECDSA_PrivateKey::create_signature_op
Botan::ECDSA_PrivateKey::create_signature_op( RandomNumberGenerator & , const std :: string & params , const std :: string & provider) const
['params', 'provider']
ECDSA_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/, const std::string& params, const std::string& provider) const { #if defined(BOTAN_HAS_BEARSSL) if(provider == "bearssl" || provider.empty()) { try { return make_bearssl_ecdsa_sig_op(*this, params); } catch(Lookup_Error& e) { if(provider == "bearssl") throw; } } #endif #if defined(BOTAN_HAS_OPENSSL) if(provider == "openssl" || provider.empty()) { try { return make_openssl_ecdsa_sig_op(*this, params); } catch(Lookup_Error& e) { if(provider == "openssl") throw; } } #endif if(provider == "base" || provider.empty()) return std::unique_ptr<PK_Ops::Signature>(new ECDSA_Signature_Operation(*this, params)); throw Provider_Not_Found(algo_name(), provider); }
150
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::ECDSA_Signature_Operation::ECDSA_Signature_Operation
Botan::ECDSA_Signature_Operation::ECDSA_Signature_Operation( const ECDSA_PrivateKey & ecdsa , const std :: string & emsa)
['ecdsa', 'emsa']
ECDSA_Signature_Operation(const ECDSA_PrivateKey& ecdsa, const std::string& emsa) : PK_Ops::Signature_with_EMSA(emsa), m_group(ecdsa.domain()), m_x(ecdsa.private_value()) { #if defined(BOTAN_HAS_RFC6979_GENERATOR) m_rfc6979_hash = hash_for_emsa(emsa); #endif }
48
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::ECDSA_Signature_Operation::raw_sign
Botan::ECDSA_Signature_Operation::raw_sign( const uint8_t msg [ ] , size_t msg_len , RandomNumberGenerator & rng)
['msg_len', 'rng']
ECDSA_Signature_Operation::raw_sign(const uint8_t msg[], size_t msg_len, RandomNumberGenerator& rng) { BigInt m(msg, msg_len, m_group.get_order_bits()); #if defined(BOTAN_HAS_RFC6979_GENERATOR) const BigInt k = generate_rfc6979_nonce(m_x, m_group.get_order(), m, m_rfc6979_hash); #else const BigInt k = m_group.random_scalar(rng); #endif const BigInt k_inv = m_group.inverse_mod_order(k); const BigInt r = m_group.mod_order( m_group.blinded_base_point_multiply_x(k, rng, m_ws)); const BigInt xrm = m_group.mod_order(m_group.multiply_mod_order(m_x, r) + m); const BigInt s = m_group.multiply_mod_order(k_inv, xrm); // With overwhelming probability, a bug rather than actual zero r/s if(r.is_zero() || s.is_zero()) throw Internal_Error("During ECDSA signature generated zero r/s"); return BigInt::encode_fixed_length_int_pair(r, s, m_group.get_order_bytes()); }
163
True
1
CVE-2018-12435
False
False
False
False
AV:L/AC:M/Au:N/C:P/I:N/A:N
LOCAL
MEDIUM
NONE
PARTIAL
NONE
NONE
1.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
LOCAL
HIGH
NONE
NONE
CHANGED
HIGH
NONE
NONE
5.9
MEDIUM
1.4
4.0
nan
[{'url': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'name': 'https://www.nccgroup.trust/us/our-research/technical-advisory-return-of-the-hidden-number-problem/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'name': 'https://github.com/randombit/botan/commit/48fc8df51d99f9d8ba251219367b3d629cc848e3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://botan.randombit.net/security.html', 'name': 'https://botan.randombit.net/security.html', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:botan_project:botan:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.5.0', 'versionEndIncluding': '2.7.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Botan 2.5.0 through 2.6.0 before 2.7.0 allows a memory-cache side-channel attack on ECDSA signatures, aka the Return Of the Hidden Number Problem or ROHNP, related to dsa/dsa.cpp, ec_group/ec_group.cpp, and ecdsa/ecdsa.cpp. To discover an ECDSA key, the attacker needs access to either the local machine or a different virtual machine on the same physical host.'}]
2018-08-22T19:57Z
2018-06-15T02:29Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Jack Lloyd
2018-06-05 18:40:14-04:00
Address DSA/ECDSA side channel
48fc8df51d99f9d8ba251219367b3d629cc848e3
False
randombit/botan
Cryptography Toolkit
2013-03-06 16:51:39
2022-08-25 13:41:24
https://botan.randombit.net
randombit
1972.0
471.0
Botan::ECDSA_Verification_Operation::verify
Botan::ECDSA_Verification_Operation::verify( const uint8_t msg [ ] , size_t msg_len , const uint8_t sig [ ] , size_t sig_len)
['msg_len', 'sig_len']
bool ECDSA_Verification_Operation::verify(const uint8_t msg[], size_t msg_len, const uint8_t sig[], size_t sig_len) { if(sig_len != m_group.get_order_bytes() * 2) return false; const BigInt e(msg, msg_len, m_group.get_order_bits()); const BigInt r(sig, sig_len / 2); const BigInt s(sig + sig_len / 2, sig_len / 2); if(r <= 0 || r >= m_group.get_order() || s <= 0 || s >= m_group.get_order()) return false; const BigInt w = m_group.inverse_mod_order(s); const BigInt u1 = m_group.multiply_mod_order(e, w); const BigInt u2 = m_group.multiply_mod_order(r, w); const PointGFp R = m_gy_mul.multi_exp(u1, u2); if(R.is_zero()) return false; const BigInt v = m_group.mod_order(R.get_affine_x()); return (v == r); }
192
True
1
CVE-2016-9842
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
nan
[{'url': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'name': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'name': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201701-56', 'name': 'GLSA-201701-56', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/e54e1299404101a5a9d0cf5e45512b543967f958', 'name': 'https://github.com/madler/zlib/commit/e54e1299404101a5a9d0cf5e45512b543967f958', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402348', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402348', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/95131', 'name': '95131', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/12/05/21', 'name': '[oss-security] 20161205 Re: CVE Request: zlib security issues found during audit', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00053.html', 'name': 'openSUSE-SU-2017:0080', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00050.html', 'name': 'openSUSE-SU-2017:0077', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2016-12/msg00127.html', 'name': 'openSUSE-SU-2016:3202', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1039427', 'name': '1039427', 'refsource': 'SECTRACK', 'tags': ['Broken Link', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://support.apple.com/HT208144', 'name': 'https://support.apple.com/HT208144', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208115', 'name': 'https://support.apple.com/HT208115', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208113', 'name': 'https://support.apple.com/HT208113', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208112', 'name': 'https://support.apple.com/HT208112', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3047', 'name': 'RHSA-2017:3047', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3046', 'name': 'RHSA-2017:3046', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3453', 'name': 'RHSA-2017:3453', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:2999', 'name': 'RHSA-2017:2999', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1222', 'name': 'RHSA-2017:1222', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1221', 'name': 'RHSA-2017:1221', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1220', 'name': 'RHSA-2017:1220', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/03/msg00027.html', 'name': '[debian-lts-announce] 20190324 [SECURITY] [DLA 1725-1] rsync security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4246-1/', 'name': 'USN-4246-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00030.html', 'name': '[debian-lts-announce] 20200129 [SECURITY] [DLA 2085-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4292-1/', 'name': 'USN-4292-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'name': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202007-54', 'name': 'GLSA-202007-54', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:zlib:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.2.3.4', 'versionEndExcluding': '1.2.9', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:13.2:*:*:*:*:*:*:*', '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:18.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:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.7.0', 'versionEndIncluding': '5.7.23', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.12', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.5.0', 'versionEndIncluding': '5.5.61', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.6.0', 'versionEndIncluding': '5.6.41', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:database_server:18c:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:satellite:5.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.0.0', 'versionEndExcluding': '10.13.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '4.0.0', 'versionEndIncluding': '4.1.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.8.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '4.2.0', 'versionEndExcluding': '4.8.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '6.9.0', 'versionEndExcluding': '6.10.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '7.0.0', 'versionEndExcluding': '7.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The inflateMark function in inflate.c in zlib 1.2.8 might allow context-dependent attackers to have unspecified impact via vectors involving left shifts of negative integers.'}]
2022-08-16T13:02Z
2017-05-23T04: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
Mark Adler
2015-09-05 17:45:55-07:00
Avoid shifts of negative values inflateMark(). The C standard says that bit shifts of negative integers is undefined. This casts to unsigned values to assure a known result.
e54e1299404101a5a9d0cf5e45512b543967f958
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
inflateMark
inflateMark( strm)
['strm']
long ZEXPORT inflateMark(strm) z_streamp strm; { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : (state->mode == MATCH ? state->was - state->length : 0)); }
91
True
1
CVE-2016-9841
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
nan
[{'url': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'name': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'name': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201701-56', 'name': 'GLSA-201701-56', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/9aaec95e82117c1cb0f9624264c3618fc380cecb', 'name': 'https://github.com/madler/zlib/commit/9aaec95e82117c1cb0f9624264c3618fc380cecb', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402346', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402346', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking']}, {'url': 'http://www.securityfocus.com/bid/95131', 'name': '95131', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/12/05/21', 'name': '[oss-security] 20161205 Re: CVE Request: zlib security issues found during audit', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00053.html', 'name': 'openSUSE-SU-2017:0080', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00050.html', 'name': 'openSUSE-SU-2017:0077', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2016-12/msg00127.html', 'name': 'openSUSE-SU-2016:3202', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1039427', 'name': '1039427', 'refsource': 'SECTRACK', 'tags': ['Broken Link', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.securitytracker.com/id/1039596', 'name': '1039596', 'refsource': 'SECTRACK', 'tags': ['Broken Link', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://support.apple.com/HT208144', 'name': 'https://support.apple.com/HT208144', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208115', 'name': 'https://support.apple.com/HT208115', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208113', 'name': 'https://support.apple.com/HT208113', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208112', 'name': 'https://support.apple.com/HT208112', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20171019-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20171019-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3047', 'name': 'RHSA-2017:3047', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3046', 'name': 'RHSA-2017:3046', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3453', 'name': 'RHSA-2017:3453', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:2999', 'name': 'RHSA-2017:2999', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1222', 'name': 'RHSA-2017:1222', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1221', 'name': 'RHSA-2017:1221', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1220', 'name': 'RHSA-2017:1220', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/03/msg00027.html', 'name': '[debian-lts-announce] 20190324 [SECURITY] [DLA 1725-1] rsync security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4246-1/', 'name': 'USN-4246-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00030.html', 'name': '[debian-lts-announce] 20200129 [SECURITY] [DLA 2085-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4292-1/', 'name': 'USN-4292-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'name': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202007-54', 'name': 'GLSA-202007-54', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.2.0', 'versionEndExcluding': '1.2.9', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:13.2:*:*:*:*:*:*:*', '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:18.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:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.7.0', 'versionEndIncluding': '5.7.23', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.12', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.5.0', 'versionEndIncluding': '5.5.61', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.6.0', 'versionEndIncluding': '5.6.41', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:database_server:18c:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:satellite:5.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.0.0', 'versionEndExcluding': '10.13.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_balance:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:steelstore_cloud_integrated_storage:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapmanager:-:*:*:*:*:oracle:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapmanager:-:*:*:*:*:sap:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:e-series_santricity_management:-:*:*:*:*:vmware_sra:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:e-series_santricity_management:-:*:*:*:*:vmware_vasa:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:e-series_santricity_storage_manager:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_unified_manager:-:*:*:*:*:7-mode:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:*:*:*:*:*:windows:*:*', 'versionStartIncluding': '7.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:*:*:*:*:*:vmware_vsphere:*:*', 'versionStartIncluding': '9.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:vasa_provider_for_clustered_data_ontap:*:*:*:*:*:*:*:*', 'versionStartIncluding': '7.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:solidfire:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:h:netapp:hci_storage_node:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_shift:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_performance_manager:-:*:*:*:*:vmware_vsphere:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:e-series_santricity_web_services:-:*:*:*:*:web_services_proxy:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:e-series_santricity_management:-:*:*:*:*:vmware_vcenter:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:symantec_netbackup:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:e-series_santricity_os_controller:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0.0', 'versionEndIncluding': '11.70.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_unified_manager:*:*:*:*:*:vsphere:*:*', 'versionEndIncluding': '7.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_unified_manager:*:*:*:*:*:windows:*:*', 'versionEndIncluding': '7.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:virtual_storage_console:-:*:*:*:*:vmware_vsphere:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:storage_replication_adapter_for_clustered_data_ontap:-:*:*:*:*:vmware_vsphere:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '4.0.0', 'versionEndIncluding': '4.1.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.8.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '4.2.0', 'versionEndExcluding': '4.8.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '6.9.0', 'versionEndExcluding': '6.10.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '7.0.0', 'versionEndExcluding': '7.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'inffast.c in zlib 1.2.8 might allow context-dependent attackers to have unspecified impact by leveraging improper pointer arithmetic.'}]
2022-08-16T13:02Z
2017-05-23T04: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
Mark Adler
2016-09-21 22:25:21-07:00
Use post-increment only in inffast.c. An old inffast.c optimization turns out to not be optimal anymore with modern compilers, and furthermore was not compliant with the C standard, for which decrementing a pointer before its allocated memory is undefined. Per the recommendation of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation, this "optimization" was removed, in order to avoid the possibility of undefined behavior.
9aaec95e82117c1cb0f9624264c3618fc380cecb
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
inflate_fast
inflate_fast( strm , start)
['strm', 'start']
void ZLIB_INTERNAL inflate_fast(strm, start) z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { struct inflate_state FAR *state; z_const unsigned char FAR *in; /* local strm->next_in */ z_const unsigned char FAR *last; /* have enough input while in < last */ unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ #ifdef INFLATE_STRICT unsigned dmax; /* maximum distance from zlib header */ #endif unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned wnext; /* window write index */ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ unsigned long hold; /* local strm->hold */ unsigned bits; /* local strm->bits */ code const FAR *lcode; /* local strm->lencode */ code const FAR *dcode; /* local strm->distcode */ unsigned lmask; /* mask for first level of length codes */ unsigned dmask; /* mask for first level of distance codes */ code here; /* retrieved table entry */ unsigned op; /* code bits, operation, extra bits, or */ /* window position, window bytes to copy */ unsigned len; /* match length, unused bytes */ unsigned dist; /* match distance */ unsigned char FAR *from; /* where to copy match from */ /* copy state to local variables */ state = (struct inflate_state FAR *)strm->state; in = strm->next_in - OFF; last = in + (strm->avail_in - 5); out = strm->next_out - OFF; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); #ifdef INFLATE_STRICT dmax = state->dmax; #endif wsize = state->wsize; whave = state->whave; wnext = state->wnext; window = state->window; hold = state->hold; bits = state->bits; lcode = state->lencode; dcode = state->distcode; lmask = (1U << state->lenbits) - 1; dmask = (1U << state->distbits) - 1; /* decode literals and length/distances until end-of-block or not enough input data or output space */ do { if (bits < 15) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; hold += (unsigned long)(PUP(in)) << bits; bits += 8; } here = lcode[hold & lmask]; dolen: op = (unsigned)(here.bits); hold >>= op; bits -= op; op = (unsigned)(here.op); if (op == 0) { /* literal */ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? "inflate: literal '%c'\n" : "inflate: literal 0x%02x\n", here.val)); PUP(out) = (unsigned char)(here.val); } else if (op & 16) { /* length base */ len = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (op) { if (bits < op) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; } len += (unsigned)hold & ((1U << op) - 1); hold >>= op; bits -= op; } Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; hold += (unsigned long)(PUP(in)) << bits; bits += 8; } here = dcode[hold & dmask]; dodist: op = (unsigned)(here.bits); hold >>= op; bits -= op; op = (unsigned)(here.op); if (op & 16) { /* distance base */ dist = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (bits < op) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; if (bits < op) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; } } dist += (unsigned)hold & ((1U << op) - 1); #ifdef INFLATE_STRICT if (dist > dmax) { strm->msg = (char *)"invalid distance too far back"; state->mode = BAD; break; } #endif hold >>= op; bits -= op; Tracevv((stderr, "inflate: distance %u\n", dist)); op = (unsigned)(out - beg); /* max distance in output */ if (dist > op) { /* see if copy from window */ op = dist - op; /* distance back in window */ if (op > whave) { if (state->sane) { strm->msg = (char *)"invalid distance too far back"; state->mode = BAD; break; } #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR if (len <= op - whave) { do { PUP(out) = 0; } while (--len); continue; } len -= op - whave; do { PUP(out) = 0; } while (--op > whave); if (op == 0) { from = out - dist; do { PUP(out) = PUP(from); } while (--len); continue; } #endif } from = window - OFF; if (wnext == 0) { /* very common case */ from += wsize - op; if (op < len) { /* some from window */ len -= op; do { PUP(out) = PUP(from); } while (--op); from = out - dist; /* rest from output */ } } else if (wnext < op) { /* wrap around window */ from += wsize + wnext - op; op -= wnext; if (op < len) { /* some from end of window */ len -= op; do { PUP(out) = PUP(from); } while (--op); from = window - OFF; if (wnext < len) { /* some from start of window */ op = wnext; len -= op; do { PUP(out) = PUP(from); } while (--op); from = out - dist; /* rest from output */ } } } else { /* contiguous in window */ from += wnext - op; if (op < len) { /* some from window */ len -= op; do { PUP(out) = PUP(from); } while (--op); from = out - dist; /* rest from output */ } } while (len > 2) { PUP(out) = PUP(from); PUP(out) = PUP(from); PUP(out) = PUP(from); len -= 3; } if (len) { PUP(out) = PUP(from); if (len > 1) PUP(out) = PUP(from); } } else { from = out - dist; /* copy direct from output */ do { /* minimum length is three */ PUP(out) = PUP(from); PUP(out) = PUP(from); PUP(out) = PUP(from); len -= 3; } while (len > 2); if (len) { PUP(out) = PUP(from); if (len > 1) PUP(out) = PUP(from); } } } else if ((op & 64) == 0) { /* 2nd level distance code */ here = dcode[here.val + (hold & ((1U << op) - 1))]; goto dodist; } else { strm->msg = (char *)"invalid distance code"; state->mode = BAD; break; } } else if ((op & 64) == 0) { /* 2nd level length code */ here = lcode[here.val + (hold & ((1U << op) - 1))]; goto dolen; } else if (op & 32) { /* end-of-block */ Tracevv((stderr, "inflate: end of block\n")); state->mode = TYPE; break; } else { strm->msg = (char *)"invalid literal/length code"; state->mode = BAD; break; } } while (in < last && out < end); /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ len = bits >> 3; in -= len; bits -= len << 3; hold &= (1U << bits) - 1; /* update state and return */ strm->next_in = in + OFF; strm->next_out = out + OFF; strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); strm->avail_out = (unsigned)(out < end ? 257 + (end - out) : 257 - (out - end)); state->hold = hold; state->bits = bits; return; }
1508
True
1
CVE-2016-9840
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
nan
[{'url': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'name': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'name': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201701-56', 'name': 'GLSA-201701-56', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/6a043145ca6e9c55184013841a67b2fef87e44c0', 'name': 'https://github.com/madler/zlib/commit/6a043145ca6e9c55184013841a67b2fef87e44c0', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402345', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402345', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/95131', 'name': '95131', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/12/05/21', 'name': '[oss-security] 20161205 Re: CVE Request: zlib security issues found during audit', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00053.html', 'name': 'openSUSE-SU-2017:0080', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00050.html', 'name': 'openSUSE-SU-2017:0077', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2016-12/msg00127.html', 'name': 'openSUSE-SU-2016:3202', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1039427', 'name': '1039427', 'refsource': 'SECTRACK', 'tags': ['Broken Link', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://support.apple.com/HT208144', 'name': 'https://support.apple.com/HT208144', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208115', 'name': 'https://support.apple.com/HT208115', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208113', 'name': 'https://support.apple.com/HT208113', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208112', 'name': 'https://support.apple.com/HT208112', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3047', 'name': 'RHSA-2017:3047', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3046', 'name': 'RHSA-2017:3046', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3453', 'name': 'RHSA-2017:3453', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:2999', 'name': 'RHSA-2017:2999', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1222', 'name': 'RHSA-2017:1222', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1221', 'name': 'RHSA-2017:1221', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1220', 'name': 'RHSA-2017:1220', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/03/msg00027.html', 'name': '[debian-lts-announce] 20190324 [SECURITY] [DLA 1725-1] rsync security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4246-1/', 'name': 'USN-4246-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00030.html', 'name': '[debian-lts-announce] 20200129 [SECURITY] [DLA 2085-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4292-1/', 'name': 'USN-4292-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'name': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202007-54', 'name': 'GLSA-202007-54', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.2.0.6', 'versionEndExcluding': '1.2.9', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:13.2:*:*:*:*:*:*:*', '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:18.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:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.7.0', 'versionEndIncluding': '5.7.23', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.12', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.5.0', 'versionEndIncluding': '5.5.61', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.6.0', 'versionEndIncluding': '5.6.41', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:database_server:18c:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:satellite:5.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.0.0', 'versionEndExcluding': '10.13.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '4.0.0', 'versionEndIncluding': '4.1.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.8.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '4.2.0', 'versionEndExcluding': '4.8.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '6.9.0', 'versionEndExcluding': '6.10.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '7.0.0', 'versionEndExcluding': '7.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'inftrees.c in zlib 1.2.8 might allow context-dependent attackers to have unspecified impact by leveraging improper pointer arithmetic.'}]
2022-08-16T13:16Z
2017-05-23T04: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
Mark Adler
2016-09-21 23:35:50-07:00
Remove offset pointer optimization in inftrees.c. inftrees.c was subtracting an offset from a pointer to an array, in order to provide a pointer that allowed indexing starting at the offset. This is not compliant with the C standard, for which the behavior of a pointer decremented before its allocated memory is undefined. Per the recommendation of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation, this tiny optimization was removed, in order to avoid the possibility of undefined behavior.
6a043145ca6e9c55184013841a67b2fef87e44c0
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
inflate_table
inflate_table( type , lens , codes , table , bits , work)
['type', 'lens', 'codes', 'table', 'bits', 'work']
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) codetype type; unsigned short FAR *lens; unsigned codes; code FAR * FAR *table; unsigned FAR *bits; unsigned short FAR *work; { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ unsigned root; /* number of index bits for root table */ unsigned curr; /* number of index bits for current table */ unsigned drop; /* code bits to drop for sub-table */ int left; /* number of prefix codes available */ unsigned used; /* code entries in table used */ unsigned huff; /* Huffman code */ unsigned incr; /* for incrementing code, index */ unsigned fill; /* index for replicating entries */ unsigned low; /* low bits for current root entry */ unsigned mask; /* mask for low root bits */ code here; /* table entry for duplication */ code FAR *next; /* next available space in table */ const unsigned short FAR *base; /* base value table to use */ const unsigned short FAR *extra; /* extra bits table to use */ int end; /* use base and extra for symbol > end */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ static const unsigned short lbase[31] = { /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 198}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0}; static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64}; /* Process a set of code lengths to create a canonical Huffman code. The code lengths are lens[0..codes-1]. Each length corresponds to the symbols 0..codes-1. The Huffman code is generated by first sorting the symbols by length from short to long, and retaining the symbol order for codes with equal lengths. Then the code starts with all zero bits for the first code of the shortest length, and the codes are integer increments for the same length, and zeros are appended as the length increases. For the deflate format, these bits are stored backwards from their more natural integer increment ordering, and so when the decoding tables are built in the large loop below, the integer codes are incremented backwards. This routine assumes, but does not check, that all of the entries in lens[] are in the range 0..MAXBITS. The caller must assure this. 1..MAXBITS is interpreted as that code length. zero means that that symbol does not occur in this code. The codes are sorted by computing a count of codes for each length, creating from that a table of starting indices for each length in the sorted table, and then entering the symbols in order in the sorted table. The sorted table is work[], with that space being provided by the caller. The length counts are used for other purposes as well, i.e. finding the minimum and maximum length codes, determining if there are any codes at all, checking for a valid set of lengths, and looking ahead at length counts to determine sub-table sizes when building the decoding tables. */ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ for (len = 0; len <= MAXBITS; len++) count[len] = 0; for (sym = 0; sym < codes; sym++) count[lens[sym]]++; /* bound code lengths, force root to be within code lengths */ root = *bits; for (max = MAXBITS; max >= 1; max--) if (count[max] != 0) break; if (root > max) root = max; if (max == 0) { /* no symbols to code at all */ here.op = (unsigned char)64; /* invalid code marker */ here.bits = (unsigned char)1; here.val = (unsigned short)0; *(*table)++ = here; /* make a table to force an error */ *(*table)++ = here; *bits = 1; return 0; /* no symbols, but wait for decoding to report error */ } for (min = 1; min < max; min++) if (count[min] != 0) break; if (root < min) root = min; /* check for an over-subscribed or incomplete set of lengths */ left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= count[len]; if (left < 0) return -1; /* over-subscribed */ } if (left > 0 && (type == CODES || max != 1)) return -1; /* incomplete set */ /* generate offsets into symbol table for each length for sorting */ offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + count[len]; /* sort symbols by length, by symbol order within each length */ for (sym = 0; sym < codes; sym++) if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; /* Create and fill in decoding tables. In this loop, the table being filled is at next and has curr index bits. The code being used is huff with length len. That code is converted to an index by dropping drop bits off of the bottom. For codes where len is less than drop + curr, those top drop + curr - len bits are incremented through all values to fill the table with replicated entries. root is the number of index bits for the root table. When len exceeds root, sub-tables are created pointed to by the root entry with an index of the low root bits of huff. This is saved in low to check for when a new sub-table should be started. drop is zero when the root table is being filled, and drop is root when sub-tables are being filled. When a new sub-table is needed, it is necessary to look ahead in the code lengths to determine what size sub-table is needed. The length counts are used for this, and so count[] is decremented as codes are entered in the tables. used keeps track of how many table entries have been allocated from the provided *table space. It is checked for LENS and DIST tables against the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in the initial root table size constants. See the comments in inftrees.h for more information. sym increments through all symbols, and the loop terminates when all codes of length max, i.e. all codes, have been processed. This routine permits incomplete codes, so another loop after this one fills in the rest of the decoding tables with invalid code markers. */ /* set up for code type */ switch (type) { case CODES: base = extra = work; /* dummy value--not used */ end = 19; break; case LENS: base = lbase; base -= 257; extra = lext; extra -= 257; end = 256; break; default: /* DISTS */ base = dbase; extra = dext; end = -1; } /* initialize state for loop */ huff = 0; /* starting code */ sym = 0; /* starting code symbol */ len = min; /* starting code length */ next = *table; /* current table to fill in */ curr = root; /* current table index bits */ drop = 0; /* current bits to drop from code for index */ low = (unsigned)(-1); /* trigger new sub-table when len > root */ used = 1U << root; /* use root table entries */ mask = used - 1; /* mask for comparing low */ /* check available table space */ if ((type == LENS && used > ENOUGH_LENS) || (type == DISTS && used > ENOUGH_DISTS)) return 1; /* process all codes and make table entries */ for (;;) { /* create table entry */ here.bits = (unsigned char)(len - drop); if ((int)(work[sym]) < end) { here.op = (unsigned char)0; here.val = work[sym]; } else if ((int)(work[sym]) > end) { here.op = (unsigned char)(extra[work[sym]]); here.val = base[work[sym]]; } else { here.op = (unsigned char)(32 + 64); /* end of block */ here.val = 0; } /* replicate for those indices with low len bits equal to huff */ incr = 1U << (len - drop); fill = 1U << curr; min = fill; /* save offset to next table */ do { fill -= incr; next[(huff >> drop) + fill] = here; } while (fill != 0); /* backwards increment the len-bit code huff */ incr = 1U << (len - 1); while (huff & incr) incr >>= 1; if (incr != 0) { huff &= incr - 1; huff += incr; } else huff = 0; /* go to next symbol, update count, len */ sym++; if (--(count[len]) == 0) { if (len == max) break; len = lens[work[sym]]; } /* create new sub-table if needed */ if (len > root && (huff & mask) != low) { /* if first time, transition to sub-tables */ if (drop == 0) drop = root; /* increment past last table */ next += min; /* here min is 1 << curr */ /* determine length of next table */ curr = len - drop; left = (int)(1 << curr); while (curr + drop < max) { left -= count[curr + drop]; if (left <= 0) break; curr++; left <<= 1; } /* check for enough space */ used += 1U << curr; if ((type == LENS && used > ENOUGH_LENS) || (type == DISTS && used > ENOUGH_DISTS)) return 1; /* point entry in root table to sub-table */ low = huff & mask; (*table)[low].op = (unsigned char)curr; (*table)[low].bits = (unsigned char)root; (*table)[low].val = (unsigned short)(next - *table); } } /* fill in remaining table entry if code is incomplete (guaranteed to have at most one remaining entry, since if the code is incomplete, the maximum code length that was allowed to get this far is one bit) */ if (huff != 0) { here.op = (unsigned char)64; /* invalid code marker */ here.bits = (unsigned char)(len - drop); here.val = (unsigned short)0; next[huff] = here; } /* set return parameters */ *table += used; *bits = root; return 0; }
1366
True
1
CVE-2016-9843
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
nan
[{'url': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'name': 'https://wiki.mozilla.org/MOSS/Secure_Open_Source/Completed#zlib', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'name': 'https://wiki.mozilla.org/images/0/09/Zlib-report.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201701-56', 'name': 'GLSA-201701-56', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/d1d577490c15a0c6862473d7576352a9f18ef811', 'name': 'https://github.com/madler/zlib/commit/d1d577490c15a0c6862473d7576352a9f18ef811', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402351', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1402351', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/95131', 'name': '95131', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.openwall.com/lists/oss-security/2016/12/05/21', 'name': '[oss-security] 20161205 Re: CVE Request: zlib security issues found during audit', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory', 'VDB Entry']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00053.html', 'name': 'openSUSE-SU-2017:0080', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2017-01/msg00050.html', 'name': 'openSUSE-SU-2017:0077', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2016-12/msg00127.html', 'name': 'openSUSE-SU-2016:3202', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1039427', 'name': '1039427', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://support.apple.com/HT208144', 'name': 'https://support.apple.com/HT208144', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208115', 'name': 'https://support.apple.com/HT208115', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208113', 'name': 'https://support.apple.com/HT208113', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://support.apple.com/HT208112', 'name': 'https://support.apple.com/HT208112', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3047', 'name': 'RHSA-2017:3047', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3046', 'name': 'RHSA-2017:3046', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3453', 'name': 'RHSA-2017:3453', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:2999', 'name': 'RHSA-2017:2999', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1222', 'name': 'RHSA-2017:1222', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1221', 'name': 'RHSA-2017:1221', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:1220', 'name': 'RHSA-2017:1220', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'name': 'http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1041888', 'name': '1041888', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.netapp.com/advisory/ntap-20181018-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20181018-0002/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/03/msg00027.html', 'name': '[debian-lts-announce] 20190324 [SECURITY] [DLA 1725-1] rsync security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4246-1/', 'name': 'USN-4246-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00030.html', 'name': '[debian-lts-announce] 20200129 [SECURITY] [DLA 2085-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4292-1/', 'name': 'USN-4292-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'name': 'https://www.oracle.com/security-alerts/cpujul2020.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202007-54', 'name': 'GLSA-202007-54', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.2.0', 'versionEndExcluding': '1.2.9', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:42.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:13.2:*:*:*:*:*:*:*', '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:18.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:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.7.0', 'versionEndIncluding': '5.7.23', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8.0.0', 'versionEndIncluding': '8.0.12', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.5.0', 'versionEndIncluding': '5.5.61', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.6.0', 'versionEndIncluding': '5.6.41', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:database_server:18c:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jdk:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.6.0:update161:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.8.0:update144:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:oracle:jre:1.7.0:update151:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_eus:7.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:satellite:5.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:tvos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:iphone_os:*:*:*:*:*:*:*:*', 'versionEndExcluding': '11', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:watchos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.0.0', 'versionEndExcluding': '10.13.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:*:*:*:*:*:windows:*:*', 'versionStartIncluding': '7.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:active_iq_unified_manager:*:*:*:*:*:vmware_vsphere:*:*', 'versionStartIncluding': '9.5', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.0.0', 'versionEndExcluding': '10.0.37', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.2.0', 'versionEndExcluding': '10.2.19', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.3.0', 'versionEndExcluding': '10.3.11', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.5.0', 'versionEndExcluding': '5.5.62', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.1.0', 'versionEndExcluding': '10.1.37', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '4.0.0', 'versionEndIncluding': '4.1.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.8.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '4.2.0', 'versionEndExcluding': '4.8.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*', 'versionStartIncluding': '6.9.0', 'versionEndExcluding': '6.10.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*', 'versionStartIncluding': '7.0.0', 'versionEndExcluding': '7.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The crc32_big function in crc32.c in zlib 1.2.8 might allow context-dependent attackers to have unspecified impact via vectors involving big-endian CRC calculation.'}]
2022-08-16T13:02Z
2017-05-23T04: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
Mark Adler
2016-09-28 20:20:25-07:00
Avoid pre-decrement of pointer in big-endian CRC calculation. There was a small optimization for PowerPCs to pre-increment a pointer when accessing a word, instead of post-incrementing. This required prefacing the loop with a decrement of the pointer, possibly pointing before the object passed. This is not compliant with the C standard, for which decrementing a pointer before its allocated memory is undefined. When tested on a modern PowerPC with a modern compiler, the optimization no longer has any effect. Due to all that, and per the recommendation of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation, this "optimization" was removed, in order to avoid the possibility of undefined behavior.
d1d577490c15a0c6862473d7576352a9f18ef811
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
crc32_big
crc32_big( crc , buf , len) const
['crc', 'buf', 'len']
local unsigned long crc32_big(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; unsigned len; { register z_crc_t c; register const z_crc_t FAR *buf4; c = ZSWAP32((z_crc_t)crc); c = ~c; while (len && ((ptrdiff_t)buf & 3)) { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); len--; } buf4 = (const z_crc_t FAR *)(const void FAR *)buf; buf4--; while (len >= 32) { DOBIG32; len -= 32; } while (len >= 4) { DOBIG4; len -= 4; } buf4++; buf = (const unsigned char FAR *)buf4; if (len) do { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); } while (--len); c = ~c; return (unsigned long)(ZSWAP32(c)); }
209
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflateCopy
deflateCopy( dest , source)
['dest', 'source']
int ZEXPORT deflateCopy (dest, source) z_streamp dest; z_streamp source; { #ifdef MAXSEG_64K return Z_STREAM_ERROR; #else deflate_state *ds; deflate_state *ss; ushf *overlay; if (deflateStateCheck(source) || dest == Z_NULL) { return Z_STREAM_ERROR; } ss = source->state; zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); if (ds == Z_NULL) return Z_MEM_ERROR; dest->state = (struct internal_state FAR *) ds; zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); ds->strm = dest; ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); ds->pending_buf = (uchf *) overlay; if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { deflateEnd (dest); return Z_MEM_ERROR; } /* following zmemcpy do not work for 16-bit MSDOS */ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; ds->bl_desc.dyn_tree = ds->bl_tree; return Z_OK; #endif /* MAXSEG_64K */ }
447
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflateInit2_
deflateInit2_( strm , level , method , windowBits , memLevel , strategy , version , stream_size) const
['strm', 'level', 'method', 'windowBits', 'memLevel', 'strategy', 'version', 'stream_size']
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size) z_streamp strm; int level; int method; int windowBits; int memLevel; int strategy; const char *version; int stream_size; { deflate_state *s; int wrap = 1; static const char my_version[] = ZLIB_VERSION; ushf *overlay; /* We overlay pending_buf and d_buf+l_buf. This works since the average * output size for (length,distance) codes is <= 24 bits. */ if (version == Z_NULL || version[0] != my_version[0] || stream_size != sizeof(z_stream)) { return Z_VERSION_ERROR; } if (strm == Z_NULL) return Z_STREAM_ERROR; strm->msg = Z_NULL; if (strm->zalloc == (alloc_func)0) { #ifdef Z_SOLO return Z_STREAM_ERROR; #else strm->zalloc = zcalloc; strm->opaque = (voidpf)0; #endif } if (strm->zfree == (free_func)0) #ifdef Z_SOLO return Z_STREAM_ERROR; #else strm->zfree = zcfree; #endif #ifdef FASTEST if (level != 0) level = 1; #else if (level == Z_DEFAULT_COMPRESSION) level = 6; #endif if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; windowBits = -windowBits; } #ifdef GZIP else if (windowBits > 15) { wrap = 2; /* write gzip wrapper instead */ windowBits -= 16; } #endif if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) { return Z_STREAM_ERROR; } if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); if (s == Z_NULL) return Z_MEM_ERROR; strm->state = (struct internal_state FAR *)s; s->strm = strm; s->status = INIT_STATE; /* to pass state test in deflateReset() */ s->wrap = wrap; s->gzhead = Z_NULL; s->w_bits = (uInt)windowBits; s->w_size = 1 << s->w_bits; s->w_mask = s->w_size - 1; s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); s->high_water = 0; /* nothing written to s->window yet */ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); s->pending_buf = (uchf *) overlay; s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { s->status = FINISH_STATE; strm->msg = ERR_MSG(Z_MEM_ERROR); deflateEnd (strm); return Z_MEM_ERROR; } s->d_buf = overlay + s->lit_bufsize/sizeof(ush); s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; s->level = level; s->strategy = strategy; s->method = (Byte)method; return deflateReset(strm); }
675
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflatePrime
deflatePrime( strm , bits , value)
['strm', 'bits', 'value']
int ZEXPORT deflatePrime (strm, bits, value) z_streamp strm; int bits; int value; { deflate_state *s; int put; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; do { put = Buf_size - s->bi_valid; if (put > bits) put = bits; s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid); s->bi_valid += put; _tr_flush_bits(s); value >>= put; bits -= put; } while (bits); return Z_OK; }
149
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflate_fast
deflate_fast( s , flush)
['s', 'flush']
local block_state deflate_fast(s, flush) deflate_state *s; int flush; { IPos hash_head; /* head of the hash chain */ int bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { return need_more; } if (s->lookahead == 0) break; /* flush the current block */ } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; if (s->lookahead >= MIN_MATCH) { INSERT_STRING(s, s->strstart, hash_head); } /* Find the longest match, discarding those <= prev_length. * At this point we have always match_length < MIN_MATCH */ if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s->match_length = longest_match (s, hash_head); /* longest_match() sets match_start */ } if (s->match_length >= MIN_MATCH) { check_match(s, s->strstart, s->match_start, s->match_length); _tr_tally_dist(s, s->strstart - s->match_start, s->match_length - MIN_MATCH, bflush); s->lookahead -= s->match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ #ifndef FASTEST if (s->match_length <= s->max_insert_length && s->lookahead >= MIN_MATCH) { s->match_length--; /* string at strstart already in table */ do { s->strstart++; INSERT_STRING(s, s->strstart, hash_head); /* strstart never exceeds WSIZE-MAX_MATCH, so there are * always MIN_MATCH bytes ahead. */ } while (--s->match_length != 0); s->strstart++; } else #endif { s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not * matter since it will be recomputed at next deflate call. */ } } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); _tr_tally_lit (s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } if (bflush) FLUSH_BLOCK(s, 0); } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; if (flush == Z_FINISH) { FLUSH_BLOCK(s, 1); return finish_done; } if (s->last_lit) FLUSH_BLOCK(s, 0); return block_done; }
409
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflate_huff
deflate_huff( s , flush)
['s', 'flush']
local block_state deflate_huff(s, flush) deflate_state *s; int flush; { int bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we have a literal to write. */ if (s->lookahead == 0) { fill_window(s); if (s->lookahead == 0) { if (flush == Z_NO_FLUSH) return need_more; break; /* flush the current block */ } } /* Output a literal byte */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); _tr_tally_lit (s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); } s->insert = 0; if (flush == Z_FINISH) { FLUSH_BLOCK(s, 1); return finish_done; } if (s->last_lit) FLUSH_BLOCK(s, 0); return block_done; }
162
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflate_rle
deflate_rle( s , flush)
['s', 'flush']
local block_state deflate_rle(s, flush) deflate_state *s; int flush; { int bflush; /* set if current block must be flushed */ uInt prev; /* byte at distance one to match */ Bytef *scan, *strend; /* scan goes up to strend for length of run */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ if (s->lookahead <= MAX_MATCH) { fill_window(s); if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { return need_more; } if (s->lookahead == 0) break; /* flush the current block */ } /* See how many times the previous byte repeats */ s->match_length = 0; if (s->lookahead >= MIN_MATCH && s->strstart > 0) { scan = s->window + s->strstart - 1; prev = *scan; if (prev == *++scan && prev == *++scan && prev == *++scan) { strend = s->window + s->strstart + MAX_MATCH; do { } while (prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && scan < strend); s->match_length = MAX_MATCH - (uInt)(strend - scan); if (s->match_length > s->lookahead) s->match_length = s->lookahead; } Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ if (s->match_length >= MIN_MATCH) { check_match(s, s->strstart, s->strstart - 1, s->match_length); _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush); s->lookahead -= s->match_length; s->strstart += s->match_length; s->match_length = 0; } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); _tr_tally_lit (s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } if (bflush) FLUSH_BLOCK(s, 0); } s->insert = 0; if (flush == Z_FINISH) { FLUSH_BLOCK(s, 1); return finish_done; } if (s->last_lit) FLUSH_BLOCK(s, 0); return block_done; }
427
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
deflate_slow
deflate_slow( s , flush)
['s', 'flush']
local block_state deflate_slow(s, flush) deflate_state *s; int flush; { IPos hash_head; /* head of hash chain */ int bflush; /* set if current block must be flushed */ /* Process the input block. */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { return need_more; } if (s->lookahead == 0) break; /* flush the current block */ } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; if (s->lookahead >= MIN_MATCH) { INSERT_STRING(s, s->strstart, hash_head); } /* Find the longest match, discarding those <= prev_length. */ s->prev_length = s->match_length, s->prev_match = s->match_start; s->match_length = MIN_MATCH-1; if (hash_head != NIL && s->prev_length < s->max_lazy_match && s->strstart - hash_head <= MAX_DIST(s)) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s->match_length = longest_match (s, hash_head); /* longest_match() sets match_start */ if (s->match_length <= 5 && (s->strategy == Z_FILTERED #if TOO_FAR <= 32767 || (s->match_length == MIN_MATCH && s->strstart - s->match_start > TOO_FAR) #endif )) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ s->match_length = MIN_MATCH-1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ check_match(s, s->strstart-1, s->prev_match, s->prev_length); _tr_tally_dist(s, s->strstart -1 - s->prev_match, s->prev_length - MIN_MATCH, bflush); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ s->lookahead -= s->prev_length-1; s->prev_length -= 2; do { if (++s->strstart <= max_insert) { INSERT_STRING(s, s->strstart, hash_head); } } while (--s->prev_length != 0); s->match_available = 0; s->match_length = MIN_MATCH-1; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); } else if (s->match_available) { /* If there was no match at the previous position, output a * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ Tracevv((stderr,"%c", s->window[s->strstart-1])); _tr_tally_lit(s, s->window[s->strstart-1], bflush); if (bflush) { FLUSH_BLOCK_ONLY(s, 0); } s->strstart++; s->lookahead--; if (s->strm->avail_out == 0) return need_more; } else { /* There is no previous match to compare with, wait for * the next step to decide. */ s->match_available = 1; s->strstart++; s->lookahead--; } } Assert (flush != Z_NO_FLUSH, "no flush?"); if (s->match_available) { Tracevv((stderr,"%c", s->window[s->strstart-1])); _tr_tally_lit(s, s->window[s->strstart-1], bflush); s->match_available = 0; } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; if (flush == Z_FINISH) { FLUSH_BLOCK(s, 1); return finish_done; } if (s->last_lit) FLUSH_BLOCK(s, 0); return block_done; }
572
True
1
CVE-2018-25032
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://www.openwall.com/lists/oss-security/2022/03/24/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/24/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'name': 'https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aaceab7c615f8020c531', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/25/2', 'name': '[oss-security] 20220325 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2022/03/26/1', 'name': '[oss-security] 20220326 Re: zlib memory corruption on deflate (i.e. compress)', 'refsource': 'MLIST', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'name': 'https://github.com/madler/zlib/compare/v1.2.11...v1.2.12', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'name': 'https://www.openwall.com/lists/oss-security/2022/03/28/3', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/madler/zlib/issues/605', 'name': 'https://github.com/madler/zlib/issues/605', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5111', 'name': 'DSA-5111', 'refsource': 'DEBIAN', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00000.html', 'name': '[debian-lts-announce] 20220402 [SECURITY] [DLA 2968-1] zlib security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/NS2D2GFPFGOJUL4WQ3DUAY7HF4VWQ77F/', 'name': 'FEDORA-2022-413a80a102', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XOKFMSNQ5D5WGMALBNBXU3GE442V74WU/', 'name': 'FEDORA-2022-dbd2935e44', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/VOKNP2L734AEL47NRYGVZIKEFOUBQY5Y/', 'name': 'FEDORA-2022-12b89e2aad', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00008.html', 'name': '[debian-lts-announce] 20220507 [SECURITY] [DLA 2993-1] libz-mingw-w64 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', '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': '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/38', 'name': '20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'name': 'https://security.netapp.com/advisory/ntap-20220526-0009/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DF62MVMH3QUGMBDCB3DY2ERQ6EBHTADB/', 'name': 'FEDORA-2022-61cf1c64f6', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpujul2022.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JZZPTWRYQULAOL3AW7RZJNVZ2UONXCV4/', 'name': 'FEDORA-2022-3a92250fd5', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DCZFIJBJTZ7CL5QXBFKTQ22Q26VINRUF/', 'name': 'FEDORA-2022-b58a85e167', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '12.0.0', 'versionEndExcluding': '12.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.13', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_workflow_automation:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:netapp:oncommand_insight:-:*:*:*:*:*:*:*', '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:active_iq_unified_manager:-:*:*:*:*:windows:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches.'}]
2022-08-26T14:15Z
2022-03-25T09: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
Mark Adler
2018-04-17 22:09:22-07:00
Fix a bug that can crash deflate on some input when using Z_FIXED. This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
5c44459c3b28a9bd3283aaceab7c615f8020c531
False
madler/zlib
A massively spiffy yet delicately unobtrusive compression library.
2011-09-10 03:27:31
2022-08-27 16:43:04
http://zlib.net/
madler
3759.0
1932.0
init_block
init_block( s)
['s']
local void init_block(s) deflate_state *s; { int n; /* iterates over tree elements */ /* Initialize the trees. */ for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; s->dyn_ltree[END_BLOCK].Freq = 1; s->opt_len = s->static_len = 0L; s->last_lit = s->matches = 0; }
116
True
1
CVE-2016-9888
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://secunia.com/secunia_research/2016-17/', 'name': 'https://secunia.com/secunia_research/2016-17/', 'refsource': 'MISC', 'tags': ['Permissions Required', 'Third Party Advisory']}, {'url': 'https://github.com/GNOME/libgsf/commit/95a8351a75758cf10b3bf6abae0b6b461f90d9e5', 'name': 'https://github.com/GNOME/libgsf/commit/95a8351a75758cf10b3bf6abae0b6b461f90d9e5', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://secunia.com/advisories/71201/', 'name': 'https://secunia.com/advisories/71201/', 'refsource': 'MISC', 'tags': ['Permissions Required', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/94860', 'name': '94860', 'refsource': 'BID', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/04/msg00016.html', 'name': '[debian-lts-announce] 20200425 [SECURITY] [DLA 2183-1] libgsf security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnome:libgsf:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.14.40', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An error within the "tar_directory_for_file()" function (gsf-infile-tar.c) in GNOME Structured File Library before 1.14.41 can be exploited to trigger a Null pointer dereference and subsequently cause a crash via a crafted TAR file.'}]
2016-12-15T03:00Z
2016-12-08T08:59Z
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
Morten Welinder
2016-12-02 22:19:54-05:00
tar: fix crash on broken tar file.
95a8351a75758cf10b3bf6abae0b6b461f90d9e5
False
GNOME/libgsf
Read-only mirror of https://gitlab.gnome.org/GNOME/libgsf
2012-06-03 14:09:24
2022-07-21 15:26:59
https://gitlab.gnome.org/GNOME/libgsf
GNOME
26.0
7.0
tar_directory_for_file
tar_directory_for_file( GsfInfileTar * dir , const char * name , gboolean last)
['dir', 'name', 'last']
tar_directory_for_file (GsfInfileTar *dir, const char *name, gboolean last) { const char *s = name; while (1) { const char *s0 = s; char *dirname; /* Find a directory component, if any. */ while (1) { if (*s == 0) { if (last && s != s0) break; else return dir; } /* This is deliberately slash-only. */ if (*s == '/') break; s++; } dirname = g_strndup (s0, s - s0); while (*s == '/') s++; if (strcmp (dirname, ".") != 0) { GsfInput *subdir = gsf_infile_child_by_name (GSF_INFILE (dir), dirname); if (subdir) { /* Undo the ref. */ g_object_unref (subdir); dir = GSF_INFILE_TAR (subdir); } else dir = tar_create_dir (dir, dirname); } g_free (dirname); } }
162
True
1
CVE-2017-0196
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:N/A:N
NETWORK
MEDIUM
NONE
PARTIAL
NONE
NONE
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
NONE
NONE
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/Microsoft/ChakraCore/commit/065b7978c40ded35c356ced6cd922a40156c9c46', 'name': 'https://github.com/Microsoft/ChakraCore/commit/065b7978c40ded35c356ced6cd922a40156c9c46', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-200'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:microsoft:edge:*:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An information disclosure vulnerability in Microsoft scripting engine allows remote attackers to obtain sensitive information from process memory via a crafted web site, aka "Microsoft Browser Information Disclosure Vulnerability."'}]
2017-07-21T16:23Z
2017-07-17T13:18Z
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
There are many different kinds of mistakes that introduce information exposures. The severity of the error can range widely, depending on the context in which the product operates, the type of sensitive information that is revealed, and the benefits it may provide to an attacker. Some kinds of sensitive information include: private, personal information, such as personal messages, financial data, health records, geographic location, or contact details system status and environment, such as the operating system and installed packages business secrets and intellectual property network status and configuration the product's own code or internal state metadata, e.g. logging of connections or message headers indirect information, such as a discrepancy between two internal operations that can be observed by an outsider Information might be sensitive to different parties, each of which may have their own expectations for whether the information should be protected. These parties include: the product's own users people or organizations whose information is created or used by the product, even if they are not direct product users the product's administrators, including the admins of the system(s) and/or networks on which the product operates the developer Information exposures can occur in different ways: the code explicitly inserts sensitive information into resources or messages that are intentionally made accessible to unauthorized actors, but should not contain the information - i.e., the information should have been "scrubbed" or "sanitized" a different weakness or mistake indirectly inserts the sensitive information into resources, such as a web script error revealing the full system path of the program. the code manages resources that intentionally contain sensitive information, but the resources are unintentionally made accessible to unauthorized actors. In this case, the information exposure is resultant - i.e., a different weakness enabled the access to the information in the first place. It is common practice to describe any loss of confidentiality as an "information exposure," but this can lead to overuse of CWE-200 in CWE mapping. From the CWE perspective, loss of confidentiality is a technical impact that can arise from dozens of different weaknesses, such as insecure file permissions or out-of-bounds read. CWE-200 and its lower-level descendants are intended to cover the mistakes that occur in behaviors that explicitly manage, store, transfer, or cleanse sensitive information.
https://cwe.mitre.org/data/definitions/200.html
0
Akrosh Gandhi
2017-01-19 14:17:27-08:00
[CVE-2017-0196] Fixing an heap overread during slice. The MissingItem check is happening on the array in a loop. It is possible that we get called into script and that mutates the array. So the Array's head is newly created with length. However the loop is still performing over the old length. Fixed this by checking the length In IsMissingItem function. Added a unittest.
065b7978c40ded35c356ced6cd922a40156c9c46
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
Microsoft
visit repo url
visit repo url
Js::JavascriptArray::SliceHelper
Js::JavascriptArray::SliceHelper(JavascriptArray*pArr,JavascriptArray*pnewArr,uint32start,uint32newLen)
[]
void JavascriptArray::SliceHelper(JavascriptArray* pArr, JavascriptArray* pnewArr, uint32 start, uint32 newLen) { SparseArraySegment<T>* headSeg = (SparseArraySegment<T>*)pArr->head; SparseArraySegment<T>* pnewHeadSeg = (SparseArraySegment<T>*)pnewArr->head; // Fill the newly created sliced array js_memcpy_s(pnewHeadSeg->elements, sizeof(T) * newLen, headSeg->elements + start, sizeof(T) * newLen); pnewHeadSeg->length = newLen; Assert(pnewHeadSeg->length <= pnewHeadSeg->size); // Prototype lookup for missing elements if (!pArr->HasNoMissingValues()) { for (uint32 i = 0; i < newLen; i++) { // array type might be changed in the below call to DirectGetItemAtFull // need recheck array type before checking array item [i + start] if (pArr->IsMissingItem(i + start)) { Var element; pnewArr->SetHasNoMissingValues(false); if (pArr->DirectGetItemAtFull(i + start, &element)) { pnewArr->SetItem(i, element, PropertyOperation_None); } } } } #ifdef DBG else { for (uint32 i = 0; i < newLen; i++) { AssertMsg(!SparseArraySegment<T>::IsMissingItem(&headSeg->elements[i+start]), "Array marked incorrectly as having missing value"); } } #endif }
220
True
1
CVE-2017-0152
False
False
False
False
AV:N/AC:M/Au:N/C:C/I:C/A:C
NETWORK
MEDIUM
NONE
COMPLETE
COMPLETE
COMPLETE
9.3
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
HIGH
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
8.1
HIGH
2.2
5.9
nan
[{'url': 'https://github.com/Microsoft/ChakraCore/commit/9da019424601325a6e95e6be0fa03d7d21d0b517', 'name': 'https://github.com/Microsoft/ChakraCore/commit/9da019424601325a6e95e6be0fa03d7d21d0b517', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:microsoft:edge:*:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A remote code execution vulnerability exists in the way affected Microsoft scripting engine render when handling objects in memory in Microsoft browsers. The vulnerability could corrupt memory in such a way that an attacker could execute arbitrary code in the context of the current user. An attacker who successfully exploited the vulnerability could gain the same user rights as the current user, aka "Scripting Engine Memory Corruption Vulnerability."'}]
2017-07-21T16:27Z
2017-07-17T13:18Z
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
Aneesh Divakarakurup
2017-03-08 16:58:06-08:00
[CVE-2017-0152] MSFT: 10592731 : Issue with Function name capturing in param scope In a function expression with name, where the name is captured in one of the param scope functions, if there is a function or var declaration with the same name as the function expression name we were marking the function expression name as shadowed. In non-eval case this causes issue because the name symbol won't get added to the body. This change is to fix it in such a way if the name is captured in the param scope then we split the param and body scope such that the name symbol is added to the param scope not body scope.
9da019424601325a6e95e6be0fa03d7d21d0b517
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
Microsoft
visit repo url
visit repo url
ByteCodeGenerator::EmitOneFunction
ByteCodeGenerator::EmitOneFunction( ParseNode * pnode)
['pnode']
void ByteCodeGenerator::EmitOneFunction(ParseNode *pnode) { Assert(pnode && (pnode->nop == knopProg || pnode->nop == knopFncDecl)); FuncInfo *funcInfo = pnode->sxFnc.funcInfo; Assert(funcInfo != nullptr); if (funcInfo->IsFakeGlobalFunction(this->flags)) { return; } Js::ParseableFunctionInfo* deferParseFunction = funcInfo->byteCodeFunction; deferParseFunction->SetGrfscr(deferParseFunction->GetGrfscr() | (this->flags & ~fscrDeferredFncExpression)); deferParseFunction->SetSourceInfo(this->GetCurrentSourceIndex(), funcInfo->root, !!(this->flags & fscrEvalCode), ((this->flags & fscrDynamicCode) && !(this->flags & fscrEvalCode))); deferParseFunction->SetInParamsCount(funcInfo->inArgsCount); if (pnode->sxFnc.HasDefaultArguments()) { deferParseFunction->SetReportedInParamsCount(pnode->sxFnc.firstDefaultArg + 1); } else { deferParseFunction->SetReportedInParamsCount(funcInfo->inArgsCount); } if (funcInfo->root->sxFnc.pnodeBody == nullptr) { if (!PHASE_OFF1(Js::SkipNestedDeferredPhase)) { deferParseFunction->BuildDeferredStubs(funcInfo->root); } Assert(!deferParseFunction->IsFunctionBody() || deferParseFunction->GetFunctionBody()->GetByteCode() != nullptr); return; } Js::FunctionBody* byteCodeFunction = funcInfo->GetParsedFunctionBody(); // We've now done a full parse of this function, so we no longer need to remember the extents // and attributes of the top-level nested functions. (The above code has run for all of those, // so they have pointers to the stub sub-trees they need.) byteCodeFunction->SetDeferredStubs(nullptr); try { if (!funcInfo->IsGlobalFunction()) { // Note: Do not set the stack nested func flag if the function has been redeferred and recompiled. // In that case the flag already has the value we want. if (CanStackNestedFunc(funcInfo, true) && byteCodeFunction->GetCompileCount() == 0) { #if DBG byteCodeFunction->SetCanDoStackNestedFunc(); #endif if (funcInfo->root->sxFnc.astSize <= PnFnc::MaxStackClosureAST) { byteCodeFunction->SetStackNestedFunc(true); } } } if (byteCodeFunction->DoStackNestedFunc()) { uint nestedCount = byteCodeFunction->GetNestedCount(); for (uint i = 0; i < nestedCount; i++) { Js::FunctionProxy * nested = byteCodeFunction->GetNestedFunctionProxy(i); if (nested->IsFunctionBody()) { nested->GetFunctionBody()->SetStackNestedFuncParent(byteCodeFunction->GetFunctionInfo()); } } } if (byteCodeFunction->GetByteCode() != nullptr) { // Previously compiled function nested within a re-deferred and re-compiled function. return; } // Bug : 301517 // In the debug mode the hasOnlyThis optimization needs to be disabled, since user can break in this function // and do operation on 'this' and its property, which may not be defined yet. if (funcInfo->root->sxFnc.HasOnlyThisStmts() && !IsInDebugMode()) { byteCodeFunction->SetHasOnlyThisStmts(true); } if (byteCodeFunction->IsInlineApplyDisabled() || this->scriptContext->GetConfig()->IsNoNative()) { if ((pnode->nop == knopFncDecl) && (funcInfo->GetHasHeapArguments()) && (!funcInfo->GetCallsEval()) && ApplyEnclosesArgs(pnode, this)) { bool applyEnclosesArgs = true; for (ParseNode* pnodeVar = funcInfo->root->sxFnc.pnodeVars; pnodeVar; pnodeVar = pnodeVar->sxVar.pnodeNext) { Symbol* sym = pnodeVar->sxVar.sym; if (sym->GetSymbolType() == STVariable && !sym->GetIsArguments()) { applyEnclosesArgs = false; break; } } auto constAndLetCheck = [](ParseNode *pnodeBlock, bool *applyEnclosesArgs) { if (*applyEnclosesArgs) { for (auto lexvar = pnodeBlock->sxBlock.pnodeLexVars; lexvar; lexvar = lexvar->sxVar.pnodeNext) { Symbol* sym = lexvar->sxVar.sym; if (sym->GetSymbolType() == STVariable && !sym->GetIsArguments()) { *applyEnclosesArgs = false; break; } } } }; constAndLetCheck(funcInfo->root->sxFnc.pnodeScopes, &applyEnclosesArgs); constAndLetCheck(funcInfo->root->sxFnc.pnodeBodyScope, &applyEnclosesArgs); funcInfo->SetApplyEnclosesArgs(applyEnclosesArgs); } } InitScopeSlotArray(funcInfo); FinalizeRegisters(funcInfo, byteCodeFunction); DebugOnly(Js::RegSlot firstTmpReg = funcInfo->varRegsCount); // Reserve temp registers for the inner scopes. We prefer temps because the JIT will then renumber them // and see different lifetimes. (Note that debug mode requires permanent registers. See FinalizeRegisters.) uint innerScopeCount = funcInfo->InnerScopeCount(); if (!this->IsInDebugMode()) { byteCodeFunction->SetInnerScopeCount(innerScopeCount); if (innerScopeCount) { funcInfo->SetFirstInnerScopeReg(funcInfo->AcquireTmpRegister()); for (uint i = 1; i < innerScopeCount; i++) { funcInfo->AcquireTmpRegister(); } } } funcInfo->inlineCacheMap = Anew(alloc, FuncInfo::InlineCacheMap, alloc, funcInfo->RegCount() // Pass the actual register count. // TODO: Check if we can reduce this count ); funcInfo->rootObjectLoadInlineCacheMap = Anew(alloc, FuncInfo::RootObjectInlineCacheIdMap, alloc, 10); funcInfo->rootObjectLoadMethodInlineCacheMap = Anew(alloc, FuncInfo::RootObjectInlineCacheIdMap, alloc, 10); funcInfo->rootObjectStoreInlineCacheMap = Anew(alloc, FuncInfo::RootObjectInlineCacheIdMap, alloc, 10); funcInfo->referencedPropertyIdToMapIndex = Anew(alloc, FuncInfo::RootObjectInlineCacheIdMap, alloc, 10); byteCodeFunction->AllocateLiteralRegexArray(); m_callSiteId = 0; m_writer.Begin(byteCodeFunction, alloc, this->DoJitLoopBodies(funcInfo), funcInfo->hasLoop, this->IsInDebugMode()); this->PushFuncInfo(_u("EmitOneFunction"), funcInfo); this->inPrologue = true; // Class constructors do not have a [[call]] slot but we don't implement a generic way to express this. // What we do is emit a check for the new flag here. If we don't have CallFlags_New set, the opcode will throw. // We need to do this before emitting 'this' since the base class constructor will try to construct a new object. if (funcInfo->IsClassConstructor()) { m_writer.Empty(Js::OpCode::ChkNewCallFlag); } Scope* currentScope = funcInfo->GetCurrentChildScope(); Scope* paramScope = funcInfo->GetParamScope(); Scope* bodyScope = funcInfo->GetBodyScope(); // For now, emit all constant loads at top of function (should instead put in closest dominator of uses). LoadAllConstants(funcInfo); HomeArguments(funcInfo); if (!currentScope->GetCanMergeWithBodyScope()) { byteCodeFunction->SetParamAndBodyScopeNotMerged(); // Pop the body scope before emitting the default args PopScope(); Assert(this->GetCurrentScope() == paramScope); } if (funcInfo->root->sxFnc.pnodeRest != nullptr) { byteCodeFunction->SetHasRestParameter(); } if (funcInfo->thisScopeSlot != Js::Constants::NoRegister && !(funcInfo->IsLambda() || (funcInfo->IsGlobalFunction() && this->flags & fscrEval))) { EmitInitCapturedThis(funcInfo, funcInfo->bodyScope); } // Any function with a super reference or an eval call inside a method or a constructor needs to load super, if ((funcInfo->HasSuperReference() || (funcInfo->GetCallsEval() && (funcInfo->root->sxFnc.IsMethod() || funcInfo->root->sxFnc.IsConstructor()))) // unless we are already inside the 'global' scope inside an eval (in which case 'ScopedLdHomeObj' is emitted at every 'super' reference). && !((GetFlags() & fscrEval) && funcInfo->IsGlobalFunction())) { if (funcInfo->IsLambda()) { Scope *scope; Js::PropertyId envIndex = -1; GetEnclosingNonLambdaScope(funcInfo, scope, envIndex); FuncInfo* parent = scope->GetFunc(); if (!parent->IsGlobalFunction()) { // lambda in non-global scope (eval and non-eval) EmitInternalScopedSlotLoad(funcInfo, scope, envIndex, parent->superScopeSlot, funcInfo->superRegister); if (funcInfo->superCtorRegister != Js::Constants::NoRegister) { EmitInternalScopedSlotLoad(funcInfo, scope, envIndex, parent->superCtorScopeSlot, funcInfo->superCtorRegister); } } else if (!(GetFlags() & fscrEval)) { // lambda in non-eval global scope m_writer.Reg1(Js::OpCode::LdUndef, funcInfo->superRegister); } // lambda in eval global scope: ScopedLdHomeObj will handle error throwing } else { m_writer.Reg1(Js::OpCode::LdHomeObj, funcInfo->superRegister); if (funcInfo->superCtorRegister != Js::Constants::NoRegister) // super() is allowed only in derived class constructors { m_writer.Reg1(Js::OpCode::LdFuncObj, funcInfo->superCtorRegister); } if (!funcInfo->IsGlobalFunction()) { if (bodyScope->GetIsObject() && bodyScope->GetLocation() != Js::Constants::NoRegister) { // Stash the super reference in case something inside the eval or lambda references it. uint cacheId = funcInfo->FindOrAddInlineCacheId(bodyScope->GetLocation(), Js::PropertyIds::_superReferenceSymbol, false, true); m_writer.ElementP(Js::OpCode::InitLocalFld, funcInfo->superRegister, cacheId); if (funcInfo->superCtorRegister != Js::Constants::NoRegister) { cacheId = funcInfo->FindOrAddInlineCacheId(bodyScope->GetLocation(), Js::PropertyIds::_superCtorReferenceSymbol, false, true); m_writer.ElementP(Js::OpCode::InitLocalFld, funcInfo->superCtorRegister, cacheId); } } else if (funcInfo->superScopeSlot == Js::Constants::NoProperty || funcInfo->superCtorScopeSlot == Js::Constants::NoProperty) { // While the diag locals walker will pick up super from scoped slots or an activation object, // it will not pick it up when it is only in a register. byteCodeFunction->InsertSymbolToRegSlotList(funcInfo->superRegister, Js::PropertyIds::_superReferenceSymbol, funcInfo->varRegsCount); if (funcInfo->superCtorRegister != Js::Constants::NoRegister) { byteCodeFunction->InsertSymbolToRegSlotList(funcInfo->superCtorRegister, Js::PropertyIds::_superCtorReferenceSymbol, funcInfo->varRegsCount); } } } } } if (funcInfo->newTargetScopeSlot != Js::Constants::NoRegister && !funcInfo->IsGlobalFunction()) { EmitInitCapturedNewTarget(funcInfo, bodyScope); } // We don't want to load super if we are already in an eval. ScopedLdHomeObj will take care of loading super in that case. if (!(GetFlags() & fscrEval) && !bodyScope->GetIsObject()) { if (funcInfo->superScopeSlot != Js::Constants::NoRegister) { this->EmitInternalScopedSlotStore(funcInfo, funcInfo->superScopeSlot, funcInfo->superRegister); } if (funcInfo->superCtorScopeSlot != Js::Constants::NoRegister) { this->EmitInternalScopedSlotStore(funcInfo, funcInfo->superCtorScopeSlot, funcInfo->superCtorRegister); } } if (funcInfo->IsGlobalFunction()) { EnsureNoRedeclarations(pnode->sxFnc.pnodeScopes, funcInfo); } ::BeginEmitBlock(pnode->sxFnc.pnodeScopes, this, funcInfo); DefineLabels(funcInfo); if (pnode->sxFnc.HasNonSimpleParameterList()) { this->InitBlockScopedNonTemps(funcInfo->root->sxFnc.pnodeScopes, funcInfo); EmitDefaultArgs(funcInfo, pnode); if (!currentScope->GetCanMergeWithBodyScope()) { Assert(this->GetCurrentScope() == paramScope); // Push the body scope PushScope(bodyScope); funcInfo->SetCurrentChildScope(bodyScope); // Mark the beginning of the body scope so that new scope slots can be created. this->Writer()->Empty(Js::OpCode::BeginBodyScope); } } InitSpecialScopeSlots(funcInfo); // Emit all scope-wide function definitions before emitting function bodies // so that calls may reference functions they precede lexically. // Note, global eval scope is a fake local scope and is handled as if it were // a lexical block instead of a true global scope, so do not define the functions // here. They will be defined during BeginEmitBlock. if (!(funcInfo->IsGlobalFunction() && this->IsEvalWithNoParentScopeInfo())) { // This only handles function declarations, which param scope cannot have any. DefineFunctions(funcInfo); } DefineUserVars(funcInfo); if (pnode->sxFnc.HasNonSimpleParameterList()) { this->InitBlockScopedNonTemps(funcInfo->root->sxFnc.pnodeBodyScope, funcInfo); } else { this->InitBlockScopedNonTemps(funcInfo->root->sxFnc.pnodeScopes, funcInfo); } if (!pnode->sxFnc.HasNonSimpleParameterList() && funcInfo->GetHasArguments() && !NeedScopeObjectForArguments(funcInfo, pnode)) { // If we didn't create a scope object and didn't have default args, we still need to transfer the formals to their slots. MapFormalsWithoutRest(pnode, [&](ParseNode *pnodeArg) { EmitPropStore(pnodeArg->sxVar.sym->GetLocation(), pnodeArg->sxVar.sym, pnodeArg->sxVar.pid, funcInfo); }); } // Rest needs to trigger use before declaration until all default args have been processed. if (pnode->sxFnc.pnodeRest != nullptr) { pnode->sxFnc.pnodeRest->sxVar.sym->SetNeedDeclaration(false); } if (paramScope && !paramScope->GetCanMergeWithBodyScope()) { // Emit bytecode to copy the initial values from param names to their corresponding body bindings. // We have to do this after the rest param is marked as false for need declaration. paramScope->ForEachSymbol([&](Symbol* param) { Symbol* varSym = funcInfo->GetBodyScope()->FindLocalSymbol(param->GetName()); Assert(varSym || pnode->sxFnc.pnodeName->sxVar.sym == param); Assert(param->GetIsArguments() || param->IsInSlot(funcInfo)); if (param->GetIsArguments() && !funcInfo->GetHasArguments()) { // Do not copy the arguments to the body if it is not used } else if (varSym && varSym->GetSymbolType() == STVariable && (varSym->IsInSlot(funcInfo) || varSym->GetLocation() != Js::Constants::NoRegister)) { // Simulating EmitPropLoad here. We can't directly call the method as we have to use the param scope specifically. // Walking the scope chain is not possible at this time. Js::RegSlot tempReg = funcInfo->AcquireTmpRegister(); Js::PropertyId slot = param->EnsureScopeSlot(funcInfo); Js::ProfileId profileId = funcInfo->FindOrAddSlotProfileId(paramScope, slot); Js::OpCode op = paramScope->GetIsObject() ? Js::OpCode::LdParamObjSlot : Js::OpCode::LdParamSlot; slot = slot + (paramScope->GetIsObject() ? 0 : Js::ScopeSlots::FirstSlotIndex); this->m_writer.SlotI1(op, tempReg, slot, profileId); if (ShouldTrackDebuggerMetadata() && !varSym->GetIsArguments() && !varSym->IsInSlot(funcInfo)) { byteCodeFunction->InsertSymbolToRegSlotList(varSym->GetName(), varSym->GetLocation(), funcInfo->varRegsCount); } this->EmitPropStore(tempReg, varSym, varSym->GetPid(), funcInfo); funcInfo->ReleaseTmpRegister(tempReg); } }); // In split scope as the body has a separate closure we have to copy the value of this and other special slots // from param scope to the body scope auto copySpecialSymbolsToBody = [this, funcInfo, paramScope] (Js::PropertyId src, Js::PropertyId dest) { if (dest != Js::Constants::NoProperty) { Js::RegSlot tempReg = funcInfo->AcquireTmpRegister(); Js::PropertyId slot = src; Js::ProfileId profileId = funcInfo->FindOrAddSlotProfileId(paramScope, slot); Js::OpCode op = paramScope->GetIsObject() ? Js::OpCode::LdParamObjSlot : Js::OpCode::LdParamSlot; slot = slot + (paramScope->GetIsObject() ? 0 : Js::ScopeSlots::FirstSlotIndex); this->m_writer.SlotI1(op, tempReg, slot, profileId); op = funcInfo->bodyScope->GetIsObject() ? Js::OpCode::StLocalObjSlot : Js::OpCode::StLocalSlot; slot = dest + (funcInfo->bodyScope->GetIsObject() ? 0 : Js::ScopeSlots::FirstSlotIndex); this->m_writer.SlotI1(op, tempReg, slot); funcInfo->ReleaseTmpRegister(tempReg); } }; copySpecialSymbolsToBody(funcInfo->innerThisScopeSlot, funcInfo->thisScopeSlot); copySpecialSymbolsToBody(funcInfo->innerSuperScopeSlot, funcInfo->superScopeSlot); copySpecialSymbolsToBody(funcInfo->innerSuperCtorScopeSlot, funcInfo->superCtorScopeSlot); copySpecialSymbolsToBody(funcInfo->innerNewTargetScopeSlot, funcInfo->newTargetScopeSlot); } if (pnode->sxFnc.pnodeBodyScope != nullptr) { ::BeginEmitBlock(pnode->sxFnc.pnodeBodyScope, this, funcInfo); } this->inPrologue = false; if (funcInfo->IsGlobalFunction()) { EmitGlobalBody(funcInfo); } else { EmitFunctionBody(funcInfo); } if (pnode->sxFnc.pnodeBodyScope != nullptr) { ::EndEmitBlock(pnode->sxFnc.pnodeBodyScope, this, funcInfo); } ::EndEmitBlock(pnode->sxFnc.pnodeScopes, this, funcInfo); if (!this->IsInDebugMode()) { // Release the temp registers that we reserved for inner scopes above. if (innerScopeCount) { Js::RegSlot tmpReg = funcInfo->FirstInnerScopeReg() + innerScopeCount - 1; for (uint i = 0; i < innerScopeCount; i++) { funcInfo->ReleaseTmpRegister(tmpReg); tmpReg--; } } } Assert(funcInfo->firstTmpReg == firstTmpReg); Assert(funcInfo->curTmpReg == firstTmpReg); Assert(byteCodeFunction->GetFirstTmpReg() == firstTmpReg + byteCodeFunction->GetConstantCount()); byteCodeFunction->CheckAndSetVarCount(funcInfo->varRegsCount); byteCodeFunction->CheckAndSetOutParamMaxDepth(funcInfo->outArgsMaxDepth); byteCodeFunction->SetForInLoopDepth(funcInfo->GetMaxForInLoopLevel()); // Do a uint32 add just to verify that we haven't overflowed the reg slot type. UInt32Math::Add(funcInfo->varRegsCount, funcInfo->constRegsCount); #if DBG_DUMP if (PHASE_STATS1(Js::ByteCodePhase)) { Output::Print(_u(" BCode: %-10d, Aux: %-10d, AuxC: %-10d Total: %-10d, %s\n"), m_writer.ByteCodeDataSize(), m_writer.AuxiliaryDataSize(), m_writer.AuxiliaryContextDataSize(), m_writer.ByteCodeDataSize() + m_writer.AuxiliaryDataSize() + m_writer.AuxiliaryContextDataSize(), funcInfo->name); this->scriptContext->byteCodeDataSize += m_writer.ByteCodeDataSize(); this->scriptContext->byteCodeAuxiliaryDataSize += m_writer.AuxiliaryDataSize(); this->scriptContext->byteCodeAuxiliaryContextDataSize += m_writer.AuxiliaryContextDataSize(); } #endif this->MapCacheIdsToPropertyIds(funcInfo); this->MapReferencedPropertyIds(funcInfo); Assert(this->TopFuncInfo() == funcInfo); PopFuncInfo(_u("EmitOneFunction")); m_writer.SetCallSiteCount(m_callSiteId); #ifdef LOG_BYTECODE_AST_RATIO m_writer.End(funcInfo->root->sxFnc.astSize, this->maxAstSize); #else m_writer.End(); #endif } catch (...) { // Failed to generate byte-code for this function body (likely OOM or stack overflow). Notify the function body so that // it can revert intermediate state changes that may have taken place during byte code generation before the failure. byteCodeFunction->ResetByteCodeGenState(); m_writer.Reset(); throw; } #ifdef PERF_HINT if (PHASE_TRACE1(Js::PerfHintPhase) && !byteCodeFunction->GetIsGlobalFunc()) { if (byteCodeFunction->GetHasTry()) { WritePerfHint(PerfHints::HasTryBlock_Verbose, byteCodeFunction); } if (funcInfo->GetCallsEval()) { WritePerfHint(PerfHints::CallsEval_Verbose, byteCodeFunction); } else if (funcInfo->GetChildCallsEval()) { WritePerfHint(PerfHints::ChildCallsEval, byteCodeFunction); } } #endif byteCodeFunction->SetInitialDefaultEntryPoint(); byteCodeFunction->SetCompileCount(UInt32Math::Add(byteCodeFunction->GetCompileCount(), 1)); #ifdef ENABLE_DEBUG_CONFIG_OPTIONS if (byteCodeFunction->IsInDebugMode() != scriptContext->IsScriptContextInDebugMode()) // debug mode mismatch { if (m_utf8SourceInfo->GetIsLibraryCode()) { Assert(!byteCodeFunction->IsInDebugMode()); // Library script byteCode is never in debug mode } else { Js::Throw::FatalInternalError(); } } #endif #if DBG_DUMP if (PHASE_DUMP(Js::ByteCodePhase, funcInfo->byteCodeFunction) && Js::Configuration::Global.flags.Verbose) { pnode->Dump(); } if (this->Trace() || PHASE_DUMP(Js::ByteCodePhase, funcInfo->byteCodeFunction)) { Js::ByteCodeDumper::Dump(byteCodeFunction); } if (PHASE_DUMP(Js::DebuggerScopePhase, funcInfo->byteCodeFunction)) { byteCodeFunction->DumpScopes(); } #endif #if ENABLE_NATIVE_CODEGEN if ((!PHASE_OFF(Js::BackEndPhase, funcInfo->byteCodeFunction)) && !this->forceNoNative && !this->scriptContext->GetConfig()->IsNoNative()) { GenerateFunction(this->scriptContext->GetNativeCodeGenerator(), byteCodeFunction); } #endif }
3131
True
1
CVE-2017-1000083
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://github.com/GNOME/evince/commit/717df38fd8509bf883b70d680c9b1b3cf36732ee', 'name': 'https://github.com/GNOME/evince/commit/717df38fd8509bf883b70d680c9b1b3cf36732ee', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.gnome.org/show_bug.cgi?id=784630', 'name': 'https://bugzilla.gnome.org/show_bug.cgi?id=784630', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://seclists.org/oss-sec/2017/q3/128', 'name': 'http://seclists.org/oss-sec/2017/q3/128', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99597', 'name': '99597', 'refsource': 'BID', 'tags': ['VDB Entry', 'Third Party Advisory']}, {'url': 'http://www.debian.org/security/2017/dsa-3911', 'name': 'DSA-3911', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:2388', 'name': 'RHSA-2017:2388', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/45824/', 'name': '45824', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'VDB Entry', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/46341/', 'name': '46341', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnome:evince:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.24.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_desktop:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_workstation:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_aus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_eus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_tus:7.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_eus:7.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_eus:7.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_aus:7.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server_tus:7.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux_server:7.6:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'backend/comics/comics-document.c (aka the comic book backend) in GNOME Evince before 3.24.1 allows remote attackers to execute arbitrary commands via a .cbt file that is a TAR archive containing a filename beginning with a "--" command-line option substring, as demonstrated by a --checkpoint-action=exec=bash at the beginning of the filename.'}]
2019-10-03T00:03Z
2017-09-05T06: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
Bastien Nocera
2017-07-06 20:02:00+02:00
comics: Remove support for tar and tar-like commands When handling tar files, or using a command with tar-compatible syntax, to open comic-book archives, both the archive name (the name of the comics file) and the filename (the name of a page within the archive) are quoted to not be interpreted by the shell. But the filename is completely with the attacker's control and can start with "--" which leads to tar interpreting it as a command line flag. This can be exploited by creating a CBT file (a tar archive with the .cbt suffix) with an embedded file named something like this: "--checkpoint-action=exec=bash -c 'touch ~/hacked;'.jpg" CBT files are infinitely rare (CBZ is usually used for DRM-free commercial releases, CBR for those from more dubious provenance), so removing support is the easiest way to avoid the bug triggering. All this code was rewritten in the development release for GNOME 3.26 to not shell out to any command, closing off this particular attack vector. This also removes the ability to use libarchive's bsdtar-compatible binary for CBZ (ZIP), CB7 (7zip), and CBR (RAR) formats. The first two are already supported by unzip and 7zip respectively. libarchive's RAR support is limited, so unrar is a requirement anyway. Discovered by Felix Wilhelm from the Google Security Team. https://bugzilla.gnome.org/show_bug.cgi?id=784630
717df38fd8509bf883b70d680c9b1b3cf36732ee
False
GNOME/evince
Read-only mirror of https://gitlab.gnome.org/GNOME/evince
2012-06-02 23:09:41
2022-08-26 13:38:21
https://gitlab.gnome.org/GNOME/evince
GNOME
279.0
106.0
comics_check_decompress_command
comics_check_decompress_command( gchar * mime_type , ComicsDocument * comics_document , GError ** error)
['mime_type', 'comics_document', 'error']
comics_check_decompress_command (gchar *mime_type, ComicsDocument *comics_document, GError **error) { gboolean success; gchar *std_out, *std_err; gint retval; GError *err = NULL; /* FIXME, use proper cbr/cbz mime types once they're * included in shared-mime-info */ if (g_content_type_is_a (mime_type, "application/x-cbr") || g_content_type_is_a (mime_type, "application/x-rar")) { /* The RARLAB provides a no-charge proprietary (freeware) * decompress-only client for Linux called unrar. Another * option is a GPLv2-licensed command-line tool developed by * the Gna! project. Confusingly enough, the free software RAR * decoder is also named unrar. For this reason we need to add * some lines for disambiguation. Sorry for the added the * complexity but it's life :) * Finally, some distributions, like Debian, rename this free * option as unrar-free. * */ comics_document->selected_command = g_find_program_in_path ("unrar"); if (comics_document->selected_command) { /* We only use std_err to avoid printing useless error * messages on the terminal */ success = g_spawn_command_line_sync ( comics_document->selected_command, &std_out, &std_err, &retval, &err); if (!success) { g_propagate_error (error, err); g_error_free (err); return FALSE; /* I don't check retval status because RARLAB unrar * doesn't have a way to return 0 without involving an * operation with a file*/ } else if (WIFEXITED (retval)) { if (g_strrstr (std_out,"freeware") != NULL) /* The RARLAB freeware client */ comics_document->command_usage = RARLABS; else /* The Gna! free software client */ comics_document->command_usage = GNAUNRAR; g_free (std_out); g_free (std_err); return TRUE; } } /* The Gna! free software client with Debian naming convention */ comics_document->selected_command = g_find_program_in_path ("unrar-free"); if (comics_document->selected_command) { comics_document->command_usage = GNAUNRAR; return TRUE; } comics_document->selected_command = g_find_program_in_path ("bsdtar"); if (comics_document->selected_command) { comics_document->command_usage = TAR; return TRUE; } } else if (g_content_type_is_a (mime_type, "application/x-cbz") || g_content_type_is_a (mime_type, "application/zip")) { /* InfoZIP's unzip program */ comics_document->selected_command = g_find_program_in_path ("unzip"); comics_document->alternative_command = g_find_program_in_path ("zipnote"); if (comics_document->selected_command && comics_document->alternative_command) { comics_document->command_usage = UNZIP; return TRUE; } /* fallback mode using 7za and 7z from p7zip project */ comics_document->selected_command = g_find_program_in_path ("7za"); if (comics_document->selected_command) { comics_document->command_usage = P7ZIP; return TRUE; } comics_document->selected_command = g_find_program_in_path ("7z"); if (comics_document->selected_command) { comics_document->command_usage = P7ZIP; return TRUE; } comics_document->selected_command = g_find_program_in_path ("bsdtar"); if (comics_document->selected_command) { comics_document->command_usage = TAR; return TRUE; } } else if (g_content_type_is_a (mime_type, "application/x-cb7") || g_content_type_is_a (mime_type, "application/x-7z-compressed")) { /* 7zr, 7za and 7z are the commands from the p7zip project able * to decompress .7z files */ comics_document->selected_command = g_find_program_in_path ("7zr"); if (comics_document->selected_command) { comics_document->command_usage = P7ZIP; return TRUE; } comics_document->selected_command = g_find_program_in_path ("7za"); if (comics_document->selected_command) { comics_document->command_usage = P7ZIP; return TRUE; } comics_document->selected_command = g_find_program_in_path ("7z"); if (comics_document->selected_command) { comics_document->command_usage = P7ZIP; return TRUE; } comics_document->selected_command = g_find_program_in_path ("bsdtar"); if (comics_document->selected_command) { comics_document->command_usage = TAR; return TRUE; } } else if (g_content_type_is_a (mime_type, "application/x-cbt") || g_content_type_is_a (mime_type, "application/x-tar")) { /* tar utility (Tape ARchive) */ comics_document->selected_command = g_find_program_in_path ("tar"); if (comics_document->selected_command) { comics_document->command_usage = TAR; return TRUE; } comics_document->selected_command = g_find_program_in_path ("bsdtar"); if (comics_document->selected_command) { comics_document->command_usage = TAR; return TRUE; } } else { g_set_error (error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_INVALID, _("Not a comic book MIME type: %s"), mime_type); return FALSE; } g_set_error_literal (error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_INVALID, _("Can’t find an appropriate command to " "decompress this type of comic book")); return FALSE; }
582
True
1
CVE-2017-1000198
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
True
[{'url': 'https://github.com/open-iscsi/tcmu-runner/commit/61bd03e600d2abf309173e9186f4d465bb1b7157', 'name': 'https://github.com/open-iscsi/tcmu-runner/commit/61bd03e600d2abf309173e9186f4d465bb1b7157', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2017:3277', 'name': 'RHSA-2017:3277', 'refsource': 'REDHAT', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:1.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:1.1.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:1.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:0.9.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:0.9.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:0.9.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:0.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tcmu-runner_project:tcmu-runner:0.9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'tcmu-runner daemon version 0.9.0 to 1.2.0 is vulnerable to invalid memory references in the handler_glfs.so handler resulting in denial of service'}]
2017-12-02T02:29Z
2017-11-17T02: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
Prasanna Kumar Kalever
2017-05-21 15:02:05+05:18
glfs: discard glfs_check_config Signed-off-by: Prasanna Kumar Kalever <[email protected]>
61bd03e600d2abf309173e9186f4d465bb1b7157
False
open-iscsi/tcmu-runner
A daemon that handles the userspace side of the LIO TCM-User backstore.
2014-07-16 21:20:00
2022-08-10 00:26:02
null
open-iscsi
167.0
142.0
glfs_check_config
glfs_check_config( const char * cfgstring , char ** reason)
['cfgstring', 'reason']
static bool glfs_check_config(const char *cfgstring, char **reason) { char *path; glfs_t *fs = NULL; glfs_fd_t *gfd = NULL; gluster_server *hosts = NULL; /* gluster server defination */ bool result = true; path = strchr(cfgstring, '/'); if (!path) { if (asprintf(reason, "No path found") == -1) *reason = NULL; result = false; goto done; } path += 1; /* get past '/' */ fs = tcmu_create_glfs_object(path, &hosts); if (!fs) { tcmu_err("tcmu_create_glfs_object failed\n"); goto done; } gfd = glfs_open(fs, hosts->path, ALLOWED_BSOFLAGS); if (!gfd) { if (asprintf(reason, "glfs_open failed: %m") == -1) *reason = NULL; result = false; goto unref; } if (glfs_access(fs, hosts->path, R_OK|W_OK) == -1) { if (asprintf(reason, "glfs_access file not present, or not writable") == -1) *reason = NULL; result = false; goto unref; } goto done; unref: gluster_cache_refresh(fs, path); done: if (gfd) glfs_close(gfd); gluster_free_server(&hosts); return result; }
229
True
1
CVE-2017-1000211
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:N
NETWORK
LOW
NONE
PARTIAL
NONE
NONE
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
LOW
NONE
NONE
5.3
MEDIUM
3.9
1.4
True
[{'url': 'https://github.com/ThomasDickey/lynx-snapshots/commit/280a61b300a1614f6037efc0902ff7ecf17146e9', 'name': 'https://github.com/ThomasDickey/lynx-snapshots/commit/280a61b300a1614f6037efc0902ff7ecf17146e9', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'http://lynx.invisible-island.net/current/CHANGES.html', 'name': 'http://lynx.invisible-island.net/current/CHANGES.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/102180', 'name': '102180', 'refsource': 'BID', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2017/11/msg00021.html', 'name': '[debian-lts-announce] 20171118 [SECURITY] [DLA 1175-1] lynx-cur security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lynx_project:lynx:2.8.9:dev15:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Lynx before 2.8.9dev.16 is vulnerable to a use after free in the HTML parser resulting in memory disclosure, because HTML_put_string() can append a chunk onto itself.'}]
2018-02-04T02:29Z
2017-11-17T15:29Z
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
Thomas E. Dickey
2017-07-05 23:04:01+00:00
snapshot of project "lynx", label v2-8-9dev_15b
280a61b300a1614f6037efc0902ff7ecf17146e9
False
ThomasDickey/lynx-snapshots
snapshots of releases and interim labels for "lynx" program
2016-07-07 08:24:46
2022-08-07 23:22:09
http://lynx.invisible-island.net/index.html
ThomasDickey
4.0
4.0
HTML_put_string
HTML_put_string( HTStructured * me , const char * s)
['me', 's']
void HTML_put_string(HTStructured * me, const char *s) { #ifdef USE_PRETTYSRC char *translated_string = NULL; #endif if (s == NULL || (LYMapsOnly && me->sp[0].tag_number != HTML_OBJECT)) return; #ifdef USE_PRETTYSRC if (psrc_convert_string) { StrAllocCopy(translated_string, s); TRANSLATE_AND_UNESCAPE_ENTITIES(&translated_string, TRUE, FALSE); s = (const char *) translated_string; } #endif switch (me->sp[0].tag_number) { case HTML_COMMENT: break; /* Do Nothing */ case HTML_TITLE: HTChunkPuts(&me->title, s); break; case HTML_STYLE: HTChunkPuts(&me->style_block, s); break; case HTML_SCRIPT: HTChunkPuts(&me->script, s); break; case HTML_PRE: /* Formatted text */ case HTML_LISTING: /* Literal text */ case HTML_XMP: case HTML_PLAINTEXT: /* * We guarantee that the style is up-to-date in begin_litteral */ HText_appendText(me->text, s); break; case HTML_OBJECT: HTChunkPuts(&me->object, s); break; case HTML_TEXTAREA: HTChunkPuts(&me->textarea, s); break; case HTML_SELECT: case HTML_OPTION: HTChunkPuts(&me->option, s); break; case HTML_MATH: HTChunkPuts(&me->math, s); break; default: /* Free format text? */ if (!me->sp->style->freeFormat) { /* * If we are within a preformatted text style not caught by the * cases above (HTML_PRE or similar may not be the last element * pushed on the style stack). - kw */ #ifdef USE_PRETTYSRC if (psrc_view) { /* * We do this so that a raw '\r' in the string will not be * interpreted as an internal request to break a line - passing * '\r' to HText_appendText is treated by it as a request to * insert a blank line - VH */ for (; *s; ++s) HTML_put_character(me, *s); } else #endif HText_appendText(me->text, s); break; } else { const char *p = s; char c; if (me->style_change) { for (; *p && ((*p == '\n') || (*p == '\r') || (*p == ' ') || (*p == '\t')); p++) ; /* Ignore leaders */ if (!*p) break; UPDATE_STYLE; } for (; *p; p++) { if (*p == 13 && p[1] != 10) { /* * Treat any '\r' which is not followed by '\n' as '\n', to * account for macintosh lineend in ALT attributes etc. - * kw */ c = '\n'; } else { c = *p; } if (me->style_change) { if ((c == '\n') || (c == ' ') || (c == '\t')) continue; /* Ignore it */ UPDATE_STYLE; } if (c == '\n') { if (!FIX_JAPANESE_SPACES) { if (me->in_word) { if (HText_getLastChar(me->text) != ' ') HText_appendCharacter(me->text, ' '); me->in_word = NO; } } } else if (c == ' ' || c == '\t') { if (HText_getLastChar(me->text) != ' ') HText_appendCharacter(me->text, ' '); } else if (c == '\r') { /* ignore */ } else { HText_appendCharacter(me->text, c); me->in_word = YES; } /* set the Last Character */ if (c == '\n' || c == '\t') { /* set it to a generic separator */ HText_setLastChar(me->text, ' '); } else if (c == '\r' && HText_getLastChar(me->text) == ' ') { /* * \r's are ignored. In order to keep collapsing spaces * correctly, we must default back to the previous * separator, if there was one. So we set LastChar to a * generic separator. */ HText_setLastChar(me->text, ' '); } else { HText_setLastChar(me->text, c); } } /* for */ } } /* end switch */ #ifdef USE_PRETTYSRC if (psrc_convert_string) { psrc_convert_string = FALSE; FREE(translated_string); } #endif }
599
True
1
CVE-2017-1000215
False
False
False
False
AV:N/AC:L/Au:N/C:C/I:C/A:C
NETWORK
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
10.0
CVSS:3.0/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
True
[{'url': 'https://github.com/xrootd/xrootd/commit/befa2e627a5a33a38c92db3e57c07d8246a24acf', 'name': 'https://github.com/xrootd/xrootd/commit/befa2e627a5a33a38c92db3e57c07d8246a24acf', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/xrootd/xrootd/blob/v4.6.1/docs/ReleaseNotes.txt', 'name': 'https://github.com/xrootd/xrootd/blob/v4.6.1/docs/ReleaseNotes.txt', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/xrootd/xrootd/blob/befa2e627a5a33a38c92db3e57c07d8246a24acf/src/XrdSecgsi/XrdSecgsiGMAPFunLDAP.cc#L85', 'name': 'https://github.com/xrootd/xrootd/blob/befa2e627a5a33a38c92db3e57c07d8246a24acf/src/XrdSecgsi/XrdSecgsiGMAPFunLDAP.cc#L85', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/201903-11', 'name': 'GLSA-201903-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-78'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:xrootd:xrootd:*:*:*:*:*:*:*:*', 'versionEndIncluding': '4.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'ROOT xrootd version 4.6.0 and below is vulnerable to an unauthenticated shell command injection resulting in remote code execution'}]
2019-10-03T00:03Z
2017-11-17T20:29Z
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
Gerardo Ganis
2017-04-20 11:04:21+02:00
secgsi: do not build/package libXrdSecgsiGMAPLDAP-4.so The way the LDAP query is implemented may represent a security threat. Any related building and packaging reference is removed. The code is left in place (for the time being) to remind its functionality in the case a sanitized version is required.
befa2e627a5a33a38c92db3e57c07d8246a24acf
False
xrootd/xrootd
The XRootD central repository
2013-03-21 08:25:19
2022-08-26 09:57:36
null
xrootd
113.0
128.0
XrdCl::DefaultEnv::Initialize
XrdCl::DefaultEnv::Initialize()
[]
void DefaultEnv::Initialize() { sLog = new Log(); SetUpLog(); sEnv = new DefaultEnv(); sForkHandler = new ForkHandler(); sFileTimer = new FileTimer(); sPlugInManager = new PlugInManager(); sPlugInManager->ProcessEnvironmentSettings(); sForkHandler->RegisterFileTimer( sFileTimer ); //-------------------------------------------------------------------------- // MacOSX library loading is completely moronic. We cannot dlopen a library // from a thread other than a main thread, so we-pre dlopen all the // libraries that we may potentially want. //-------------------------------------------------------------------------- #ifdef __APPLE__ char *errBuff = new char[1024]; const char *libs[] = { "libXrdSeckrb5.so", "libXrdSecgsi.so", "libXrdSecgsiAuthzVO.so", "libXrdSecgsiGMAPDN.so", "libXrdSecgsiGMAPLDAP.so", "libXrdSecpwd.so", "libXrdSecsss.so", "libXrdSecunix.so", 0 }; for( int i = 0; libs[i]; ++i ) { sLog->Debug( UtilityMsg, "Attempting to pre-load: %s", libs[i] ); bool ok = XrdOucPreload( libs[i], errBuff, 1024 ); if( !ok ) sLog->Error( UtilityMsg, "Unable to pre-load %s: %s", libs[i], errBuff ); } delete [] errBuff; #endif }
168
True
1
CVE-2022-37452
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
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
nan
[{'url': 'https://www.exim.org/static/doc/security/', 'name': 'https://www.exim.org/static/doc/security/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/ivd38/exim_overflow', 'name': 'https://github.com/ivd38/exim_overflow', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/08/06/8', 'name': 'https://www.openwall.com/lists/oss-security/2022/08/06/8', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/commit/d4bc023436e4cce7c23c5f8bb5199e178b4cc743', 'name': 'https://github.com/Exim/exim/commit/d4bc023436e4cce7c23c5f8bb5199e178b4cc743', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/wiki/EximSecurity', 'name': 'https://github.com/Exim/exim/wiki/EximSecurity', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/compare/exim-4.94...exim-4.95', 'name': 'https://github.com/Exim/exim/compare/exim-4.94...exim-4.95', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:exim:exim:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.95', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Exim before 4.95 has a heap-based buffer overflow for the alias list in host_name_lookup in host.c when sender_host_name is set.'}]
2022-08-11T17:01Z
2022-08-07T18: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
Heiko Schlittermann (HS12-RIPE)
2021-05-16 19:11:19+02:00
Fix host_name_lookup (Close 2747) Thanks to Nico R for providing a reproducing configuration. host_lookup = * message_size_limit = ${if def:sender_host_name {32M}{32M}} acl_smtp_connect = acl_smtp_connect acl_smtp_rcpt = acl_smtp_rcpt begin acl acl_smtp_connect: warn ratelimit = 256 / 1m / per_conn accept acl_smtp_rcpt: accept hosts = 127.0.0.* begin routers null: driver = accept transport = null begin transports null: driver = appendfile file = /dev/null Tested with swaks -f [email protected] -t [email protected] --pipe 'exim -bh 127.0.0.1 -C /opt/exim/etc/exim-bug.conf' The IP must have a PTR to "localhost." to reproduce it. (cherry picked from commit 20812729e3e47a193a21d326ecd036d67a8b2724)
d4bc023436e4cce7c23c5f8bb5199e178b4cc743
False
Exim/exim
Exim Mail Transport Agent - source, testsuite and documentation
2011-11-18 10:56:08
2022-08-23 18:17:04
https://www.exim.org/
Exim
631.0
162.0
host_name_lookup
host_name_lookup( void)
['void']
host_name_lookup(void) { int old_pool, rc; int sep = 0; uschar *save_hostname; uschar **aliases; uschar *ordername; const uschar *list = host_lookup_order; dns_answer * dnsa = store_get_dns_answer(); dns_scan dnss; sender_host_dnssec = host_lookup_deferred = host_lookup_failed = FALSE; HDEBUG(D_host_lookup) debug_printf("looking up host name for %s\n", sender_host_address); /* For testing the case when a lookup does not complete, we have a special reserved IP address. */ if (f.running_in_test_harness && Ustrcmp(sender_host_address, "99.99.99.99") == 0) { HDEBUG(D_host_lookup) debug_printf("Test harness: host name lookup returns DEFER\n"); host_lookup_deferred = TRUE; return DEFER; } /* Do lookups directly in the DNS or via gethostbyaddr() (or equivalent), in the order specified by the host_lookup_order option. */ while ((ordername = string_nextinlist(&list, &sep, NULL, 0))) { if (strcmpic(ordername, US"bydns") == 0) { uschar * name = dns_build_reverse(sender_host_address); dns_init(FALSE, FALSE, FALSE); /* dnssec ctrl by dns_dnssec_ok glbl */ rc = dns_lookup_timerwrap(dnsa, name, T_PTR, NULL); /* The first record we come across is used for the name; others are considered to be aliases. We have to scan twice, in order to find out the number of aliases. However, if all the names are empty, we will behave as if failure. (PTR records that yield empty names have been encountered in the DNS.) */ if (rc == DNS_SUCCEED) { uschar **aptr = NULL; int ssize = 264; int count = 0; int old_pool = store_pool; sender_host_dnssec = dns_is_secure(dnsa); DEBUG(D_dns) debug_printf("Reverse DNS security status: %s\n", sender_host_dnssec ? "DNSSEC verified (AD)" : "unverified"); store_pool = POOL_PERM; /* Save names in permanent storage */ for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr; rr = dns_next_rr(dnsa, &dnss, RESET_NEXT)) if (rr->type == T_PTR) count++; /* Get store for the list of aliases. For compatibility with gethostbyaddr, we make an empty list if there are none. */ aptr = sender_host_aliases = store_get(count * sizeof(uschar *), FALSE); /* Re-scan and extract the names */ for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr; rr = dns_next_rr(dnsa, &dnss, RESET_NEXT)) if (rr->type == T_PTR) { uschar * s = store_get(ssize, TRUE); /* names are tainted */ /* If an overlong response was received, the data will have been truncated and dn_expand may fail. */ if (dn_expand(dnsa->answer, dnsa->answer + dnsa->answerlen, US (rr->data), (DN_EXPAND_ARG4_TYPE)(s), ssize) < 0) { log_write(0, LOG_MAIN, "host name alias list truncated for %s", sender_host_address); break; } store_release_above(s + Ustrlen(s) + 1); if (!s[0]) { HDEBUG(D_host_lookup) debug_printf("IP address lookup yielded an " "empty name: treated as non-existent host name\n"); continue; } if (!sender_host_name) sender_host_name = s; else *aptr++ = s; while (*s) { *s = tolower(*s); s++; } } *aptr = NULL; /* End of alias list */ store_pool = old_pool; /* Reset store pool */ /* If we've found a name, break out of the "order" loop */ if (sender_host_name) break; } /* If the DNS lookup deferred, we must also defer. */ if (rc == DNS_AGAIN) { HDEBUG(D_host_lookup) debug_printf("IP address PTR lookup gave temporary error\n"); host_lookup_deferred = TRUE; return DEFER; } } /* Do a lookup using gethostbyaddr() - or equivalent */ else if (strcmpic(ordername, US"byaddr") == 0) { HDEBUG(D_host_lookup) debug_printf("IP address lookup using gethostbyaddr()\n"); rc = host_name_lookup_byaddr(); if (rc == DEFER) { host_lookup_deferred = TRUE; return rc; /* Can't carry on */ } if (rc == OK) break; /* Found a name */ } } /* Loop for bydns/byaddr scanning */ /* If we have failed to find a name, return FAIL and log when required. NB host_lookup_msg must be in permanent store. */ if (!sender_host_name) { if (host_checking || !f.log_testing_mode) log_write(L_host_lookup_failed, LOG_MAIN, "no host name found for IP " "address %s", sender_host_address); host_lookup_msg = US" (failed to find host name from IP address)"; host_lookup_failed = TRUE; return FAIL; } HDEBUG(D_host_lookup) { uschar **aliases = sender_host_aliases; debug_printf("IP address lookup yielded \"%s\"\n", sender_host_name); while (*aliases != NULL) debug_printf(" alias \"%s\"\n", *aliases++); } /* We need to verify that a forward lookup on the name we found does indeed correspond to the address. This is for security: in principle a malefactor who happened to own a reverse zone could set it to point to any names at all. This code was present in versions of Exim before 3.20. At that point I took it out because I thought that gethostbyaddr() did the check anyway. It turns out that this isn't always the case, so it's coming back in at 4.01. This version is actually better, because it also checks aliases. The code was made more robust at release 4.21. Prior to that, it accepted all the names if any of them had the correct IP address. Now the code checks all the names, and accepts only those that have the correct IP address. */ save_hostname = sender_host_name; /* Save for error messages */ aliases = sender_host_aliases; for (uschar * hname = sender_host_name; hname; hname = *aliases++) { int rc; BOOL ok = FALSE; host_item h = { .next = NULL, .name = hname, .mx = MX_NONE, .address = NULL }; dnssec_domains d = { .request = sender_host_dnssec ? US"*" : NULL, .require = NULL }; if ( (rc = host_find_bydns(&h, NULL, HOST_FIND_BY_A | HOST_FIND_BY_AAAA, NULL, NULL, NULL, &d, NULL, NULL)) == HOST_FOUND || rc == HOST_FOUND_LOCAL ) { HDEBUG(D_host_lookup) debug_printf("checking addresses for %s\n", hname); /* If the forward lookup was not secure we cancel the is-secure variable */ DEBUG(D_dns) debug_printf("Forward DNS security status: %s\n", h.dnssec == DS_YES ? "DNSSEC verified (AD)" : "unverified"); if (h.dnssec != DS_YES) sender_host_dnssec = FALSE; for (host_item * hh = &h; hh; hh = hh->next) if (host_is_in_net(hh->address, sender_host_address, 0)) { HDEBUG(D_host_lookup) debug_printf(" %s OK\n", hh->address); ok = TRUE; break; } else HDEBUG(D_host_lookup) debug_printf(" %s\n", hh->address); if (!ok) HDEBUG(D_host_lookup) debug_printf("no IP address for %s matched %s\n", hname, sender_host_address); } else if (rc == HOST_FIND_AGAIN) { HDEBUG(D_host_lookup) debug_printf("temporary error for host name lookup\n"); host_lookup_deferred = TRUE; sender_host_name = NULL; return DEFER; } else HDEBUG(D_host_lookup) debug_printf("no IP addresses found for %s\n", hname); /* If this name is no good, and it's the sender name, set it null pro tem; if it's an alias, just remove it from the list. */ if (!ok) { if (hname == sender_host_name) sender_host_name = NULL; else { uschar **a; /* Don't amalgamate - some */ a = --aliases; /* compilers grumble */ while (*a != NULL) { *a = a[1]; a++; } } } } /* If sender_host_name == NULL, it means we didn't like the name. Replace it with the first alias, if there is one. */ if (sender_host_name == NULL && *sender_host_aliases != NULL) sender_host_name = *sender_host_aliases++; /* If we now have a main name, all is well. */ if (sender_host_name != NULL) return OK; /* We have failed to find an address that matches. */ HDEBUG(D_host_lookup) debug_printf("%s does not match any IP address for %s\n", sender_host_address, save_hostname); /* This message must be in permanent store */ old_pool = store_pool; store_pool = POOL_PERM; host_lookup_msg = string_sprintf(" (%s does not match any IP address for %s)", sender_host_address, save_hostname); store_pool = old_pool; host_lookup_failed = TRUE; return FAIL; }
1016
True
1
CVE-2022-37452
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
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
nan
[{'url': 'https://www.exim.org/static/doc/security/', 'name': 'https://www.exim.org/static/doc/security/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/ivd38/exim_overflow', 'name': 'https://github.com/ivd38/exim_overflow', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/08/06/8', 'name': 'https://www.openwall.com/lists/oss-security/2022/08/06/8', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/commit/d4bc023436e4cce7c23c5f8bb5199e178b4cc743', 'name': 'https://github.com/Exim/exim/commit/d4bc023436e4cce7c23c5f8bb5199e178b4cc743', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/wiki/EximSecurity', 'name': 'https://github.com/Exim/exim/wiki/EximSecurity', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/compare/exim-4.94...exim-4.95', 'name': 'https://github.com/Exim/exim/compare/exim-4.94...exim-4.95', 'refsource': 'MISC', 'tags': ['Patch', 'Release Notes', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:exim:exim:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.95', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Exim before 4.95 has a heap-based buffer overflow for the alias list in host_name_lookup in host.c when sender_host_name is set.'}]
2022-08-11T17:01Z
2022-08-07T18: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
Heiko Schlittermann (HS12-RIPE)
2021-05-16 19:11:19+02:00
Fix host_name_lookup (Close 2747) Thanks to Nico R for providing a reproducing configuration. host_lookup = * message_size_limit = ${if def:sender_host_name {32M}{32M}} acl_smtp_connect = acl_smtp_connect acl_smtp_rcpt = acl_smtp_rcpt begin acl acl_smtp_connect: warn ratelimit = 256 / 1m / per_conn accept acl_smtp_rcpt: accept hosts = 127.0.0.* begin routers null: driver = accept transport = null begin transports null: driver = appendfile file = /dev/null Tested with swaks -f [email protected] -t [email protected] --pipe 'exim -bh 127.0.0.1 -C /opt/exim/etc/exim-bug.conf' The IP must have a PTR to "localhost." to reproduce it. (cherry picked from commit 20812729e3e47a193a21d326ecd036d67a8b2724)
d4bc023436e4cce7c23c5f8bb5199e178b4cc743
False
Exim/exim
Exim Mail Transport Agent - source, testsuite and documentation
2011-11-18 10:56:08
2022-08-23 18:17:04
https://www.exim.org/
Exim
631.0
162.0
host_name_lookup_byaddr
host_name_lookup_byaddr( void)
['void']
host_name_lookup_byaddr(void) { struct hostent * hosts; struct in_addr addr; unsigned long time_msec = 0; /* init to quieten dumb static analysis */ if (slow_lookup_log) time_msec = get_time_in_ms(); /* Lookup on IPv6 system */ #if HAVE_IPV6 if (Ustrchr(sender_host_address, ':') != NULL) { struct in6_addr addr6; if (inet_pton(AF_INET6, CS sender_host_address, &addr6) != 1) log_write(0, LOG_MAIN|LOG_PANIC_DIE, "unable to parse \"%s\" as an " "IPv6 address", sender_host_address); #if HAVE_GETIPNODEBYADDR hosts = getipnodebyaddr(CS &addr6, sizeof(addr6), AF_INET6, &h_errno); #else hosts = gethostbyaddr(CS &addr6, sizeof(addr6), AF_INET6); #endif } else { if (inet_pton(AF_INET, CS sender_host_address, &addr) != 1) log_write(0, LOG_MAIN|LOG_PANIC_DIE, "unable to parse \"%s\" as an " "IPv4 address", sender_host_address); #if HAVE_GETIPNODEBYADDR hosts = getipnodebyaddr(CS &addr, sizeof(addr), AF_INET, &h_errno); #else hosts = gethostbyaddr(CS &addr, sizeof(addr), AF_INET); #endif } /* Do lookup on IPv4 system */ #else addr.s_addr = (S_ADDR_TYPE)inet_addr(CS sender_host_address); hosts = gethostbyaddr(CS(&addr), sizeof(addr), AF_INET); #endif if ( slow_lookup_log && (time_msec = get_time_in_ms() - time_msec) > slow_lookup_log ) log_long_lookup(US"gethostbyaddr", sender_host_address, time_msec); /* Failed to look up the host. */ if (!hosts) { HDEBUG(D_host_lookup) debug_printf("IP address lookup failed: h_errno=%d\n", h_errno); return (h_errno == TRY_AGAIN || h_errno == NO_RECOVERY) ? DEFER : FAIL; } /* It seems there are some records in the DNS that yield an empty name. We treat this as non-existent. In some operating systems, this is returned as an empty string; in others as a single dot. */ if (!hosts->h_name || !hosts->h_name[0] || hosts->h_name[0] == '.') { HDEBUG(D_host_lookup) debug_printf("IP address lookup yielded an empty name: " "treated as non-existent host name\n"); return FAIL; } /* Copy and lowercase the name, which is in static storage in many systems. Put it in permanent memory. */ { int old_pool = store_pool; store_pool = POOL_TAINT_PERM; /* names are tainted */ sender_host_name = string_copylc(US hosts->h_name); /* If the host has aliases, build a copy of the alias list */ if (hosts->h_aliases) { int count = 1; uschar **ptr; for (uschar ** aliases = USS hosts->h_aliases; *aliases; aliases++) count++; store_pool = POOL_PERM; ptr = sender_host_aliases = store_get(count * sizeof(uschar *), FALSE); store_pool = POOL_TAINT_PERM; for (uschar ** aliases = USS hosts->h_aliases; *aliases; aliases++) *ptr++ = string_copylc(*aliases); *ptr = NULL; } store_pool = old_pool; } return OK; }
430
True
1
CVE-2022-37451
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
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://www.exim.org/static/doc/security/', 'name': 'https://www.exim.org/static/doc/security/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/ivd38/exim_invalid_free', 'name': 'https://github.com/ivd38/exim_invalid_free', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/compare/exim-4.95...exim-4.96', 'name': 'https://github.com/Exim/exim/compare/exim-4.95...exim-4.96', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://lists.exim.org/lurker/message/20220625.141825.d6de6074.en.html', 'name': 'https://lists.exim.org/lurker/message/20220625.141825.d6de6074.en.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Release Notes', 'Vendor Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2022/08/06/1', 'name': 'https://www.openwall.com/lists/oss-security/2022/08/06/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/wiki/EximSecurity', 'name': 'https://github.com/Exim/exim/wiki/EximSecurity', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://cwe.mitre.org/data/definitions/762.html', 'name': 'https://cwe.mitre.org/data/definitions/762.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/Exim/exim/commit/51be321b27825c01829dffd90f11bfff256f7e42', 'name': 'https://github.com/Exim/exim/commit/51be321b27825c01829dffd90f11bfff256f7e42', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-763'}]}]
nan
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:exim:exim:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.96', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Exim before 4.96 has an invalid free in pam_converse in auths/call_pam.c because store_free is not used after store_malloc.'}]
2022-08-11T00:13Z
2022-08-06T18:15Z
Release of Invalid Pointer or Reference
The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly.
This weakness can take several forms, such as: The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762). The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.
https://cwe.mitre.org/data/definitions/763.html
0
Adam Lackorzynski
2021-10-16 16:30:07+01:00
Fix PAM auth. Bug 2813
51be321b27825c01829dffd90f11bfff256f7e42
False
Exim/exim
Exim Mail Transport Agent - source, testsuite and documentation
2011-11-18 10:56:08
2022-08-23 18:17:04
https://www.exim.org/
Exim
631.0
162.0
pam_converse
pam_converse( int num_msg , PAM_CONVERSE_ARG2_TYPE ** msg , struct pam_response ** resp , void * appdata_ptr)
['num_msg', 'msg', 'resp', 'appdata_ptr']
pam_converse (int num_msg, PAM_CONVERSE_ARG2_TYPE **msg, struct pam_response **resp, void *appdata_ptr) { int sep = 0; struct pam_response *reply; /* It seems that PAM frees reply[] */ if ( pam_arg_ended || !(reply = malloc(sizeof(struct pam_response) * num_msg))) return PAM_CONV_ERR; for (int i = 0; i < num_msg; i++) { uschar *arg; switch (msg[i]->msg_style) { case PAM_PROMPT_ECHO_ON: case PAM_PROMPT_ECHO_OFF: if (!(arg = string_nextinlist(&pam_args, &sep, NULL, 0))) { arg = US""; pam_arg_ended = TRUE; } reply[i].resp = CS string_copy_malloc(arg); /* PAM frees resp */ reply[i].resp_retcode = PAM_SUCCESS; break; case PAM_TEXT_INFO: /* Just acknowledge messages */ case PAM_ERROR_MSG: reply[i].resp_retcode = PAM_SUCCESS; reply[i].resp = NULL; break; default: /* Must be an error of some sort... */ free(reply); pam_conv_had_error = TRUE; return PAM_CONV_ERR; } } *resp = reply; return PAM_SUCCESS; }
193
True
1
CVE-2017-1000414
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://www.impulseadventure.com/photo/jpeg-snoop-history.html', 'name': 'https://www.impulseadventure.com/photo/jpeg-snoop-history.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes']}, {'url': 'https://github.com/ImpulseAdventure/JPEGsnoop/commit/b4e458612d4294e0cfe01dbf1c0b09a07a8133a4#diff-cf9182aecc9d630e8db2e0e35f1eec65', 'name': 'https://github.com/ImpulseAdventure/JPEGsnoop/commit/b4e458612d4294e0cfe01dbf1c0b09a07a8133a4#diff-cf9182aecc9d630e8db2e0e35f1eec65', 'refsource': 'CONFIRM', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-369'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:impulseadventure:jpegsnoop:1.7.5:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'ImpulseAdventure JPEGsnoop version 1.7.5 is vulnerable to a division by zero in the JFIF decode handling resulting denial of service.'}]
2018-02-08T16:17Z
2018-01-25T16:29Z
Divide By Zero
The product divides a value by zero.
This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.
https://cwe.mitre.org/data/definitions/369.html
0
Calvin Hass
2017-06-05 23:32:45-07:00
Fixed div0 vulnerability in SampFact
b4e458612d4294e0cfe01dbf1c0b09a07a8133a4
False
ImpulseAdventure/JPEGsnoop
JPEGsnoop: JPEG decoder and detailed analysis
2017-04-30 15:25:25
2021-01-01 12:10:36
http://www.impulseadventure.com/photo/jpeg-snoop.html
ImpulseAdventure
371.0
69.0
CjfifDecode::DecodeMarker
CjfifDecode::DecodeMarker()
[]
unsigned CjfifDecode::DecodeMarker() { TCHAR acIdentifier[MAX_IDENTIFIER]; CString strTmp; CString strFull; // Used for concatenation unsigned nLength; // General purpose unsigned nTmpVal; unsigned nCode; unsigned long nPosEnd; unsigned long nPosSaved; // General-purpose saved position in file unsigned long nPosExifStart; unsigned nRet; // General purpose return value bool bRet; unsigned long nPosMarkerStart; // Offset for current marker unsigned nColTransform = 0; // Color Transform from APP14 marker // For DQT CString strDqtPrecision = _T(""); CString strDqtZigZagOrder = _T(""); if (Buf(m_nPos) != 0xFF) { if (m_nPos == 0) { // Don't give error message if we've already alerted them of AVI / PSD if ((!m_bAvi) && (!m_bPsd)) { strTmp.Format(_T("NOTE: File did not start with JPEG marker. Consider using [Tools->Img Search Fwd] to locate embedded JPEG.")); m_pLog->AddLineErr(strTmp); } } else { strTmp.Format(_T("ERROR: Expected marker 0xFF, got 0x%02X @ offset 0x%08X. Consider using [Tools->Img Search Fwd/Rev]."),Buf(m_nPos),m_nPos); m_pLog->AddLineErr(strTmp); } m_nPos++; return DECMARK_ERR; } m_nPos++; // Read the current marker code nCode = Buf(m_nPos++); // Handle Marker Padding // // According to Section B.1.1.2: // "Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code XFF." // unsigned nSkipMarkerPad = 0; while (nCode == 0xFF) { // Count the pad nSkipMarkerPad++; // Read another byte nCode = Buf(m_nPos++); } // Report out any padding if (nSkipMarkerPad>0) { strTmp.Format(_T("*** Skipped %u marker pad bytes ***"),nSkipMarkerPad); m_pLog->AddLineHdr(strTmp); } // Save the current marker offset nPosMarkerStart = m_nPos; AddHeader(nCode); switch (nCode) { case JFIF_SOI: // SOI m_bStateSoi = true; break; case JFIF_APP12: // Photoshop DUCKY (Save For Web) nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); //nLength = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); nPosSaved = m_nPos; m_nPos += 2; // Move past length now that we've used it _tcscpy_s(acIdentifier,MAX_IDENTIFIER,m_pWBuf->BufReadStrn(m_nPos,MAX_IDENTIFIER-1)); acIdentifier[MAX_IDENTIFIER-1] = 0; // Null terminate just in case strTmp.Format(_T(" Identifier = [%s]"),acIdentifier); m_pLog->AddLine(strTmp); m_nPos += (unsigned)_tcslen(acIdentifier)+1; if (_tcscmp(acIdentifier,_T("Ducky")) != 0) { m_pLog->AddLine(_T(" Not Photoshop DUCKY. Skipping remainder.")); } else // Photoshop { // Please see reference on http://cpan.uwinnipeg.ca/htdocs/Image-ExifTool/Image/ExifTool/APP12.pm.html // A direct indexed approach should be safe m_nImgQualPhotoshopSfw = Buf(m_nPos+6); strTmp.Format(_T(" Photoshop Save For Web Quality = [%d]"),m_nImgQualPhotoshopSfw); m_pLog->AddLine(strTmp); } // Restore original position in file to a point // after the section m_nPos = nPosSaved+nLength; break; case JFIF_APP14: // JPEG Adobe tag nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); nPosSaved = m_nPos; // Some files had very short segment (eg. nLength=2) if (nLength < 2+12) { m_pLog->AddLine(_T(" Segment too short for Identifier. Skipping remainder.")); m_nPos = nPosSaved+nLength; break; } m_nPos += 2; // Move past length now that we've used it // TODO: Confirm Adobe flag m_nPos += 5; nTmpVal = Buf(m_nPos+0)*256 + Buf(m_nPos+1); strTmp.Format(_T(" DCTEncodeVersion = %u"),nTmpVal); m_pLog->AddLine(strTmp); nTmpVal = Buf(m_nPos+2)*256 + Buf(m_nPos+3); strTmp.Format(_T(" APP14Flags0 = %u"),nTmpVal); m_pLog->AddLine(strTmp); nTmpVal = Buf(m_nPos+4)*256 + Buf(m_nPos+5); strTmp.Format(_T(" APP14Flags1 = %u"),nTmpVal); m_pLog->AddLine(strTmp); nColTransform = Buf(m_nPos+6); switch (nColTransform) { case APP14_COLXFM_UNK_RGB: strTmp.Format(_T(" ColorTransform = %u [Unknown (RGB or CMYK)]"),nColTransform); break; case APP14_COLXFM_YCC: strTmp.Format(_T(" ColorTransform = %u [YCbCr]"),nColTransform); break; case APP14_COLXFM_YCCK: strTmp.Format(_T(" ColorTransform = %u [YCCK]"),nColTransform); break; default: strTmp.Format(_T(" ColorTransform = %u [???]"),nColTransform); break; } m_pLog->AddLine(strTmp); m_nApp14ColTransform = (nColTransform & 0xFF); // Restore original position in file to a point // after the section m_nPos = nPosSaved+nLength; break; case JFIF_APP13: // Photoshop (Save As) nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); //nLength = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); nPosSaved = m_nPos; // Some files had very short segment (eg. nLength=2) if (nLength < 2+20) { m_pLog->AddLine(_T(" Segment too short for Identifier. Skipping remainder.")); m_nPos = nPosSaved+nLength; break; } m_nPos += 2; // Move past length now that we've used it _tcscpy_s(acIdentifier,MAX_IDENTIFIER,m_pWBuf->BufReadStrn(m_nPos,MAX_IDENTIFIER-1)); acIdentifier[MAX_IDENTIFIER-1] = 0; // Null terminate just in case strTmp.Format(_T(" Identifier = [%s]"),acIdentifier); m_pLog->AddLine(strTmp); m_nPos += (unsigned)_tcslen(acIdentifier)+1; if (_tcscmp(acIdentifier,_T("Photoshop 3.0")) != 0) { m_pLog->AddLine(_T(" Not Photoshop. Skipping remainder.")); } else // Photoshop { DecodeApp13Ps(); } // Restore original position in file to a point // after the section m_nPos = nPosSaved+nLength; break; case JFIF_APP1: nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); //nLength = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); nPosSaved = m_nPos; m_nPos += 2; // Move past length now that we've used it _tcscpy_s(acIdentifier,MAX_IDENTIFIER,m_pWBuf->BufReadStrn(m_nPos,MAX_IDENTIFIER-1)); acIdentifier[MAX_IDENTIFIER-1] = 0; // Null terminate just in case strTmp.Format(_T(" Identifier = [%s]"),acIdentifier); m_pLog->AddLine(strTmp); m_nPos += (unsigned)_tcslen(acIdentifier); if (!_tcsnccmp(acIdentifier,_T("http://ns.adobe.com/xap/1.0/\x00"),29) != 0) { // XMP m_pLog->AddLine(_T(" XMP = ")); m_nPos++; unsigned nPosMarkerEnd = nPosSaved+nLength-1; unsigned sXmpLen = nPosMarkerEnd-m_nPos; char cXmpChar; bool bNonSpace; CString strLine; // Reset state strLine = _T(" |"); bNonSpace = false; for (unsigned nInd=0;nInd<sXmpLen;nInd++) { // Get the next char cXmpChar = (char)m_pWBuf->Buf(m_nPos+nInd); // Detect a non-space in line if ((cXmpChar != 0x20) && (cXmpChar != 0x0A)) { bNonSpace = true; } // Detect Linefeed, print out line if (cXmpChar == 0x0A) { // Only print line if some non-space elements! if (bNonSpace) { m_pLog->AddLine(strLine); } // Reset state strLine = _T(" |"); bNonSpace = false; } else { // Add the char strLine.AppendChar(cXmpChar); } } } else if (!_tcscmp(acIdentifier,_T("Exif")) != 0) { // Only decode it further if it is EXIF format m_nPos += 2; // Skip two 00 bytes nPosExifStart = m_nPos; // Save m_nPos @ start of EXIF used for all IFD offsets // =========== EXIF TIFF Header (Start) =========== // - Defined in Exif 2.2 Standard (JEITA CP-3451) section 4.5.2 // - Contents (8 bytes total) // - Byte order (2 bytes) // - 0x002A (2 bytes) // - Offset of 0th IFD (4 bytes) unsigned char acIdentifierTiff[9]; strFull = _T(""); strTmp = _T(""); strFull = _T(" Identifier TIFF = "); for (unsigned int i=0;i<8;i++) { acIdentifierTiff[i] = (unsigned char)Buf(m_nPos++); } strTmp = PrintAsHexUC(acIdentifierTiff,8); strFull += strTmp; m_pLog->AddLine(strFull); switch (acIdentifierTiff[0]*256+acIdentifierTiff[1]) { case 0x4949: // "II" // Intel alignment m_nImgExifEndian = 0; m_pLog->AddLine(_T(" Endian = Intel (little)")); break; case 0x4D4D: // "MM" // Motorola alignment m_nImgExifEndian = 1; m_pLog->AddLine(_T(" Endian = Motorola (big)")); break; } // We expect the TAG mark of 0x002A (depending on endian mode) unsigned test_002a; test_002a = ByteSwap2(acIdentifierTiff[2],acIdentifierTiff[3]); strTmp.Format(_T(" TAG Mark x002A = 0x%04X"),test_002a); m_pLog->AddLine(strTmp); unsigned nIfdCount; // Current IFD # unsigned nOffsetIfd1; // Mark pointer to EXIF Sub IFD as 0 so that we can // detect if the tag never showed up. m_nImgExifSubIfdPtr = 0; m_nImgExifMakerPtr = 0; m_nImgExifGpsIfdPtr = 0; m_nImgExifInteropIfdPtr = 0; bool exif_done = FALSE; nOffsetIfd1 = ByteSwap4(acIdentifierTiff[4],acIdentifierTiff[5], acIdentifierTiff[6],acIdentifierTiff[7]); // =========== EXIF TIFF Header (End) =========== // =========== EXIF IFD 0 =========== // Do we start the 0th IFD for the "Primary Image Data"? // Even though the nOffsetIfd1 pointer should indicate to // us where the IFD should start (0x0008 if immediately after // EXIF TIFF Header), I have observed JPEG files that // do not contain the IFD. Therefore, we must check for this // condition by comparing against the APP marker length. // Example file: http://img9.imageshack.us/img9/194/90114543.jpg if ((nPosSaved + nLength) <= (nPosExifStart+nOffsetIfd1)) { // We've run out of space for any IFD, so cancel now exif_done = true; m_pLog->AddLine(_T(" NOTE: No IFD entries")); } nIfdCount = 0; while (!exif_done) { m_pLog->AddLine(_T("")); strTmp.Format(_T("IFD%u"),nIfdCount); // Process the IFD nRet = DecodeExifIfd(strTmp,nPosExifStart,nOffsetIfd1); // Now that we have gone through all entries in the IFD directory, // we read the offset to the next IFD nOffsetIfd1 = ByteSwap4(Buf(m_nPos+0),Buf(m_nPos+1),Buf(m_nPos+2),Buf(m_nPos+3)); m_nPos += 4; strTmp.Format(_T(" Offset to Next IFD = 0x%08X"),nOffsetIfd1); m_pLog->AddLine(strTmp); if (nRet != 0) { // Error condition (DecodeExifIfd returned error) nOffsetIfd1 = 0x00000000; } if (nOffsetIfd1 == 0x00000000) { // Either error condition or truly end of IFDs exif_done = TRUE; } else { nIfdCount++; } } // while ! exif_done // If EXIF SubIFD was defined, then handle it now if (m_nImgExifSubIfdPtr != 0) { m_pLog->AddLine(_T("")); DecodeExifIfd(_T("SubIFD"),nPosExifStart,m_nImgExifSubIfdPtr); } if (m_nImgExifMakerPtr != 0) { m_pLog->AddLine(_T("")); DecodeExifIfd(_T("MakerIFD"),nPosExifStart,m_nImgExifMakerPtr); } if (m_nImgExifGpsIfdPtr != 0) { m_pLog->AddLine(_T("")); DecodeExifIfd(_T("GPSIFD"),nPosExifStart,m_nImgExifGpsIfdPtr); } if (m_nImgExifInteropIfdPtr != 0) { m_pLog->AddLine(_T("")); DecodeExifIfd(_T("InteropIFD"),nPosExifStart,m_nImgExifInteropIfdPtr); } } else { strTmp.Format(_T("Identifier [%s] not supported. Skipping remainder."),(LPCTSTR)acIdentifier); m_pLog->AddLine(strTmp); } ////////// // Dump out Makernote area // TODO: Disabled for now #if 0 unsigned ptr_base; if (m_bVerbose) { if (m_nImgExifMakerPtr != 0) { // FIXME: Seems that nPosExifStart is not initialized in VERBOSE mode ptr_base = nPosExifStart+m_nImgExifMakerPtr; m_pLog->AddLine(_T("Exif Maker IFD DUMP")); strFull.Format(_T(" MarkerOffset @ 0x%08X"),ptr_base); m_pLog->AddLine(strFull); } } #endif // End of dump out makernote area // Restore file position m_nPos = nPosSaved; // Restore original position in file to a point // after the section m_nPos = nPosSaved+nLength; break; case JFIF_APP2: // Typically used for Flashpix and possibly ICC profiles // Photoshop (Save As) nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); //nLength = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); nPosSaved = m_nPos; m_nPos += 2; // Move past length now that we've used it _tcscpy_s(acIdentifier,MAX_IDENTIFIER,m_pWBuf->BufReadStrn(m_nPos,MAX_IDENTIFIER-1)); acIdentifier[MAX_IDENTIFIER-1] = 0; // Null terminate just in case strTmp.Format(_T(" Identifier = [%s]"),acIdentifier); m_pLog->AddLine(strTmp); m_nPos += (unsigned)_tcslen(acIdentifier)+1; if (_tcscmp(acIdentifier,_T("FPXR")) == 0) { // Photoshop m_pLog->AddLine(_T(" FlashPix:")); DecodeApp2Flashpix(); } else if (_tcscmp(acIdentifier,_T("ICC_PROFILE")) == 0) { // ICC Profile m_pLog->AddLine(_T(" ICC Profile:")); DecodeApp2IccProfile(nLength); } else { m_pLog->AddLine(_T(" Not supported. Skipping remainder.")); } // Restore original position in file to a point // after the section m_nPos = nPosSaved+nLength; break; case JFIF_APP3: case JFIF_APP4: case JFIF_APP5: case JFIF_APP6: case JFIF_APP7: case JFIF_APP8: case JFIF_APP9: case JFIF_APP10: case JFIF_APP11: //case JFIF_APP12: // Handled separately //case JFIF_APP13: // Handled separately //case JFIF_APP14: // Handled separately case JFIF_APP15: nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); //nLength = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); if (m_bVerbose) { strFull = _T(""); for (unsigned int i=0;i<nLength;i++) { // Start a new line for every 16 codes if ((i % 16) == 0) { strFull.Format(_T(" MarkerOffset [%04X]: "),i); } else if ((i % 8) == 0) { strFull += _T(" "); } nTmpVal = Buf(m_nPos+i); strTmp.Format(_T("%02X "),nTmpVal); strFull += strTmp; if ((i%16) == 15) { m_pLog->AddLine(strFull); strFull = _T(""); } } m_pLog->AddLine(strFull); strFull = _T(""); for (unsigned int i=0;i<nLength;i++) { // Start a new line for every 16 codes if ((i % 32) == 0) { strFull.Format(_T(" MarkerOffset [%04X]: "),i); } else if ((i % 8) == 0) { strFull += _T(" "); } nTmpVal = Buf(m_nPos+i); if (_istprint(nTmpVal)) { strTmp.Format(_T("%c"),nTmpVal); strFull += strTmp; } else { strFull += _T("."); } if ((i%32)==31) { m_pLog->AddLine(strFull); } } m_pLog->AddLine(strFull); } // nVerbose m_nPos += nLength; break; case JFIF_APP0: // APP0 nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); //nLength = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); m_nPos+=2; strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); _tcscpy_s(m_acApp0Identifier,MAX_IDENTIFIER,m_pWBuf->BufReadStrn(m_nPos,MAX_IDENTIFIER-1)); m_acApp0Identifier[MAX_IDENTIFIER-1] = 0; // Null terminate just in case strTmp.Format(_T(" Identifier = [%s]"),m_acApp0Identifier); m_pLog->AddLine(strTmp); if (!_tcscmp(m_acApp0Identifier,_T("JFIF"))) { // Only process remainder if it is JFIF. This marker // is also used for application-specific functions. m_nPos += (unsigned)(_tcslen(m_acApp0Identifier)+1); m_nImgVersionMajor = Buf(m_nPos++); m_nImgVersionMinor = Buf(m_nPos++); strTmp.Format(_T(" version = [%u.%u]"),m_nImgVersionMajor,m_nImgVersionMinor); m_pLog->AddLine(strTmp); m_nImgUnits = Buf(m_nPos++); m_nImgDensityX = Buf(m_nPos)*256 + Buf(m_nPos+1); //m_nImgDensityX = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); m_nPos+=2; m_nImgDensityY = Buf(m_nPos)*256 + Buf(m_nPos+1); //m_nImgDensityY = m_pWBuf->BufX(m_nPos,2,!m_nImgExifEndian); m_nPos+=2; strTmp.Format(_T(" density = %u x %u "),m_nImgDensityX,m_nImgDensityY); strFull = strTmp; switch (m_nImgUnits) { case 0: strFull += _T("(aspect ratio)"); m_pLog->AddLine(strFull); break; case 1: strFull += _T("DPI (dots per inch)"); m_pLog->AddLine(strFull); break; case 2: strFull += _T("DPcm (dots per cm)"); m_pLog->AddLine(strFull); break; default: strTmp.Format(_T("ERROR: Unknown ImgUnits parameter [%u]"),m_nImgUnits); strFull += strTmp; m_pLog->AddLineWarn(strFull); //return DECMARK_ERR; break; } m_nImgThumbSizeX = Buf(m_nPos++); m_nImgThumbSizeY = Buf(m_nPos++); strTmp.Format(_T(" thumbnail = %u x %u"),m_nImgThumbSizeX,m_nImgThumbSizeY); m_pLog->AddLine(strTmp); // Unpack the thumbnail: unsigned thumbnail_r,thumbnail_g,thumbnail_b; if (m_nImgThumbSizeX && m_nImgThumbSizeY) { for (unsigned y=0;y<m_nImgThumbSizeY;y++) { strFull.Format(_T(" Thumb[%03u] = "),y); for (unsigned x=0;x<m_nImgThumbSizeX;x++) { thumbnail_r = Buf(m_nPos++); thumbnail_g = Buf(m_nPos++); thumbnail_b = Buf(m_nPos++); strTmp.Format(_T("(0x%02X,0x%02X,0x%02X) "),thumbnail_r,thumbnail_g,thumbnail_b); strFull += strTmp; m_pLog->AddLine(strFull); } } } // TODO: // - In JPEG-B mode (GeoRaster), we will need to fake out // the DHT & DQT tables here. Unfortunately, we'll have to // rely on the user to put us into this mode as there is nothing // in the file that specifies this mode. /* // TODO: Need to ensure that Faked DHT is correct table AddHeader(JFIF_DHT_FAKE); DecodeDHT(true); // Need to mark DHT tables as OK m_bStateDht = true; m_bStateDhtFake = true; m_bStateDhtOk = true; // ... same for DQT */ } else if (!_tcsnccmp(m_acApp0Identifier,_T("AVI1"),4)) { // AVI MJPEG type // Need to fill in predefined DHT table from spec: // OpenDML file format for AVI, section "Proposed Data Chunk Format" // Described in MMREG.H m_pLog->AddLine(_T(" Detected MotionJPEG")); m_pLog->AddLine(_T(" Importing standard Huffman table...")); m_pLog->AddLine(_T("")); AddHeader(JFIF_DHT_FAKE); DecodeDHT(true); // Need to mark DHT tables as OK m_bStateDht = true; m_bStateDhtFake = true; m_bStateDhtOk = true; m_nPos += nLength-2; // Skip over, and undo length short read } else { // Not JFIF or AVI1 m_pLog->AddLine(_T(" Not known APP0 type. Skipping remainder.")); m_nPos += nLength-2; } if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_DQT: // Define quantization tables m_bStateDqt = true; unsigned nDqtPrecision_Pq; unsigned nDqtQuantDestId_Tq; nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); // Lq nPosEnd = m_nPos+nLength; m_nPos+=2; //XXX strTmp.Format(_T(" Table length <Lq> = %u"),nLength); strTmp.Format(_T(" Table length = %u"),nLength); m_pLog->AddLine(strTmp); while (nPosEnd > m_nPos) { strTmp.Format(_T(" ----")); m_pLog->AddLine(strTmp); nTmpVal = Buf(m_nPos++); // Pq | Tq nDqtPrecision_Pq = (nTmpVal & 0xF0) >> 4; // Pq, range 0-1 nDqtQuantDestId_Tq = nTmpVal & 0x0F; // Tq, range 0-3 // Decode per ITU-T.81 standard #if 1 if (nDqtPrecision_Pq == 0) { strDqtPrecision = _T("8 bits"); } else if (nDqtPrecision_Pq == 1) { strDqtPrecision = _T("16 bits"); } else { strTmp.Format(_T(" Unsupported precision value [%u]"),nDqtPrecision_Pq); m_pLog->AddLineWarn(strTmp); strDqtPrecision = _T("???"); // FIXME: Consider terminating marker parsing early } if (!ValidateValue(nDqtPrecision_Pq,0,1,_T("DQT Precision <Pq>"),true,0)) return DECMARK_ERR; if (!ValidateValue(nDqtQuantDestId_Tq,0,3,_T("DQT Destination ID <Tq>"),true,0)) return DECMARK_ERR; strTmp.Format(_T(" Precision=%s"),(LPCTSTR)strDqtPrecision); m_pLog->AddLine(strTmp); #else // Decode with additional DQT extension (ITU-T-JPEG-Plus-Proposal_R3.doc) if ((nDqtPrecision_Pq & 0xE) == 0) { // Per ITU-T.81 Standard if (nDqtPrecision_Pq == 0) { strDqtPrecision = _T("8 bits"); } else if (nDqtPrecision_Pq == 1) { strDqtPrecision = _T("16 bits"); } strTmp.Format(_T(" Precision=%s"),strDqtPrecision); m_pLog->AddLine(strTmp); } else { // Non-standard // JPEG-Plus-Proposal-R3: // - Alternative sub-block-wise sequence strTmp.Format(_T(" Non-Standard DQT Extension detected")); m_pLog->AddLineWarn(strTmp); // FIXME: Should prevent attempt to decode until this is implemented if (nDqtPrecision_Pq == 0) { strDqtPrecision = _T("8 bits"); } else if (nDqtPrecision_Pq == 1) { strDqtPrecision = _T("16 bits"); } strTmp.Format(_T(" Precision=%s"),strDqtPrecision); m_pLog->AddLine(strTmp); if ((nDqtPrecision_Pq & 0x2) == 0) { strDqtZigZagOrder = _T("Diagonal zig-zag coeff scan seqeunce"); } else if ((nDqtPrecision_Pq & 0x2) == 1) { strDqtZigZagOrder = _T("Alternate coeff scan seqeunce"); } strTmp.Format(_T(" Coeff Scan Sequence=%s"),strDqtZigZagOrder); m_pLog->AddLine(strTmp); if ((nDqtPrecision_Pq & 0x4) == 1) { strTmp.Format(_T(" Custom coeff scan sequence")); m_pLog->AddLine(strTmp); // Now expect sequence of 64 coefficient entries CString strSequence = _T(""); for (unsigned nInd=0;nInd<64;nInd++) { nTmpVal = Buf(m_nPos++); strTmp.Format(_T("%u"),nTmpVal); strSequence += strTmp; if (nInd!=63) { strSequence += _T(", "); } } strTmp.Format(_T(" Custom sequence = [ %s ]"),strSequence); m_pLog->AddLine(strTmp); } } #endif strTmp.Format(_T(" Destination ID=%u"),nDqtQuantDestId_Tq); if (nDqtQuantDestId_Tq == 0) { strTmp += _T(" (Luminance)"); } else if (nDqtQuantDestId_Tq == 1) { strTmp += _T(" (Chrominance)"); } else if (nDqtQuantDestId_Tq == 2) { strTmp += _T(" (Chrominance)"); } else { strTmp += _T(" (???)"); } m_pLog->AddLine(strTmp); // FIXME: The following is somewhat superseded by ValidateValue() above // with the exception of skipping remainder if (nDqtQuantDestId_Tq >= MAX_DQT_DEST_ID) { strTmp.Format(_T("ERROR: Destination ID <Tq> = %u, >= %u"),nDqtQuantDestId_Tq,MAX_DQT_DEST_ID); m_pLog->AddLineErr(strTmp); if (!m_pAppConfig->bRelaxedParsing) { m_pLog->AddLineErr(_T(" Stopping decode")); return DECMARK_ERR; } else { // Now skip remainder of DQT // FIXME strTmp.Format(_T(" Skipping remainder of marker [%u bytes]"),nPosMarkerStart + nLength - m_nPos); m_pLog->AddLineWarn(strTmp); m_pLog->AddLine(_T("")); m_nPos = nPosMarkerStart + nLength; return DECMARK_OK; } } bool bQuantAllOnes = true; double dComparePercent; double dSumPercent=0; double dSumPercentSqr=0; for (unsigned nCoeffInd=0;nCoeffInd<MAX_DQT_COEFF;nCoeffInd++) { nTmpVal = Buf(m_nPos++); if (nDqtPrecision_Pq == 1) { // 16-bit DQT entries! nTmpVal <<= 8; nTmpVal += Buf(m_nPos++); } m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]] = nTmpVal; /* scaling factor in percent */ // Now calculate the comparison with the Annex sample // FIXME: Should probably use check for landscape orientation and // rotate comparison matrix accordingly if (nDqtQuantDestId_Tq == 0) { if (m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]] != 0) { m_afStdQuantLumCompare[glb_anZigZag[nCoeffInd]] = (float)(glb_anStdQuantLum[glb_anZigZag[nCoeffInd]]) / (float)(m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]]); dComparePercent = 100.0 * (double)(m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]]) / (double)(glb_anStdQuantLum[glb_anZigZag[nCoeffInd]]); } else { m_afStdQuantLumCompare[glb_anZigZag[nCoeffInd]] = (float)999.99; dComparePercent = 999.99; } } else { if (m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]] != 0) { m_afStdQuantChrCompare[glb_anZigZag[nCoeffInd]] = (float)(glb_anStdQuantChr[glb_anZigZag[nCoeffInd]]) / (float)(m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]]); dComparePercent = 100.0 * (double)(m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]]) / (double)(glb_anStdQuantChr[glb_anZigZag[nCoeffInd]]); } else { m_afStdQuantChrCompare[glb_anZigZag[nCoeffInd]] = (float)999.99; } } dSumPercent += dComparePercent; dSumPercentSqr += dComparePercent * dComparePercent; // Check just in case entire table are ones (Quality 100) if (m_anImgDqtTbl[nDqtQuantDestId_Tq][glb_anZigZag[nCoeffInd]] != 1) bQuantAllOnes = 0; } // 0..63 // Note that the DQT table that we are saving is already // after doing zigzag reordering: // From high freq -> low freq // To X,Y, left-to-right, top-to-bottom // Flag this DQT table as being set! m_abImgDqtSet[nDqtQuantDestId_Tq] = true; unsigned nCoeffInd; // Now display the table for (unsigned nDqtY=0;nDqtY<8;nDqtY++) { strFull.Format(_T(" DQT, Row #%u: "),nDqtY); for (unsigned nDqtX=0;nDqtX<8;nDqtX++) { nCoeffInd = nDqtY*8+nDqtX; strTmp.Format(_T("%3u "),m_anImgDqtTbl[nDqtQuantDestId_Tq][nCoeffInd]); strFull += strTmp; // Store the DQT entry into the Image Decoder bRet = m_pImgDec->SetDqtEntry(nDqtQuantDestId_Tq,nCoeffInd,glb_anUnZigZag[nCoeffInd], m_anImgDqtTbl[nDqtQuantDestId_Tq][nCoeffInd]); DecodeErrCheck(bRet); } // Now add the compare with Annex K // Decided to disable this as it was confusing users /* strFull += _T(" AnnexRatio: <"); for (unsigned nDqtX=0;nDqtX<8;nDqtX++) { nCoeffInd = nDqtY*8+nDqtX; if (nDqtQuantDestId_Tq == 0) { strTmp.Format(_T("%5.1f "),m_afStdQuantLumCompare[nCoeffInd]); } else { strTmp.Format(_T("%5.1f "),m_afStdQuantChrCompare[nCoeffInd]); } strFull += strTmp; } strFull += _T(">"); */ m_pLog->AddLine(strFull); } // Perform some statistical analysis of the quality factor // to determine the likelihood of the current quantization // table being a scaled version of the "standard" tables. // If the variance is high, it is unlikely to be the case. double dQuality; double dVariance; dSumPercent /= 64.0; /* mean scale factor */ dSumPercentSqr /= 64.0; dVariance = dSumPercentSqr - (dSumPercent * dSumPercent); /* variance */ // Generate the equivalent IJQ "quality" factor if (bQuantAllOnes) /* special case for all-ones table */ dQuality = 100.0; else if (dSumPercent <= 100.0) dQuality = (200.0 - dSumPercent) / 2.0; else dQuality = 5000.0 / dSumPercent; // Save the quality rating for later m_adImgDqtQual[nDqtQuantDestId_Tq] = dQuality; strTmp.Format(_T(" Approx quality factor = %.2f (scaling=%.2f variance=%.2f)"), dQuality,dSumPercent,dVariance); m_pLog->AddLine(strTmp); } m_bStateDqtOk = true; if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_DAC: // DAC (Arithmetic Coding) nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); // La m_nPos+=2; //XXX strTmp.Format(_T(" Arithmetic coding header length <La> = %u"),nLength); strTmp.Format(_T(" Arithmetic coding header length = %u"),nLength); m_pLog->AddLine(strTmp); unsigned nDAC_n; unsigned nDAC_Tc,nDAC_Tb; unsigned nDAC_Cs; nDAC_n = (nLength>2)?(nLength-2)/2:0; for (unsigned nInd=0;nInd<nDAC_n;nInd++) { nTmpVal = Buf(m_nPos++); // Tc,Tb nDAC_Tc = (nTmpVal & 0xF0) >> 4; nDAC_Tb = (nTmpVal & 0x0F); //XXX strTmp.Format(_T(" #%02u: Table class <Tc> = %u"),nInd+1,nDAC_Tc); strTmp.Format(_T(" #%02u: Table class = %u"),nInd+1,nDAC_Tc); m_pLog->AddLine(strTmp); //XXX strTmp.Format(_T(" #%02u: Table destination identifier <Tb> = %u"),nInd+1,nDAC_Tb); strTmp.Format(_T(" #%02u: Table destination identifier = %u"),nInd+1,nDAC_Tb); m_pLog->AddLine(strTmp); nDAC_Cs = Buf(m_nPos++); // Cs //XXX strTmp.Format(_T(" #%02u: Conditioning table value <Cs> = %u"),nInd+1,nDAC_Cs); strTmp.Format(_T(" #%02u: Conditioning table value = %u"),nInd+1,nDAC_Cs); m_pLog->AddLine(strTmp); if (!ValidateValue(nDAC_Tc,0,1,_T("Table class <Tc>"),true,0)) return DECMARK_ERR; if (!ValidateValue(nDAC_Tb,0,3,_T("Table destination ID <Tb>"),true,0)) return DECMARK_ERR; // Parameter range constraints per Table B.6: // ------------|-------------------------|-------------------|------------ // | Sequential DCT | Progressive DCT | Lossless // Parameter | Baseline Extended | | // ------------|-----------|-------------|-------------------|------------ // Cs | Undef | Tc=0: 0-255 | Tc=0: 0-255 | 0-255 // | | Tc=1: 1-63 | Tc=1: 1-63 | // ------------|-----------|-------------|-------------------|------------ // However, to keep it simple (and not depend on lossless mode), // we will only check the maximal range if (!ValidateValue(nDAC_Cs,0,255,_T("Conditioning table value <Cs>"),true,0)) return DECMARK_ERR; } if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_DNL: // DNL (Define number of lines) nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); // Ld m_nPos+=2; //XXX strTmp.Format(_T(" Header length <Ld> = %u"),nLength); strTmp.Format(_T(" Header length = %u"),nLength); m_pLog->AddLine(strTmp); nTmpVal = Buf(m_nPos)*256 + Buf(m_nPos+1); // NL m_nPos+=2; //XXX strTmp.Format(_T(" Number of lines <NL> = %u"),nTmpVal); strTmp.Format(_T(" Number of lines = %u"),nTmpVal); m_pLog->AddLine(strTmp); if (!ValidateValue(nTmpVal,1,65535,_T("Number of lines <NL>"),true,1)) return DECMARK_ERR; if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_EXP: nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); // Le m_nPos+=2; //XXX strTmp.Format(_T(" Header length <Le> = %u"),nLength); strTmp.Format(_T(" Header length = %u"),nLength); m_pLog->AddLine(strTmp); unsigned nEXP_Eh,nEXP_Ev; nTmpVal = Buf(m_nPos)*256 + Buf(m_nPos+1); // Eh,Ev nEXP_Eh = (nTmpVal & 0xF0) >> 4; nEXP_Ev = (nTmpVal & 0x0F); m_nPos+=2; //XXX strTmp.Format(_T(" Expand horizontally <Eh> = %u"),nEXP_Eh); strTmp.Format(_T(" Expand horizontally = %u"),nEXP_Eh); m_pLog->AddLine(strTmp); //XXX strTmp.Format(_T(" Expand vertically <Ev> = %u"),nEXP_Ev); strTmp.Format(_T(" Expand vertically = %u"),nEXP_Ev); m_pLog->AddLine(strTmp); if (!ValidateValue(nEXP_Eh,0,1,_T("Expand horizontally <Eh>"),true,0)) return DECMARK_ERR; if (!ValidateValue(nEXP_Ev,0,1,_T("Expand vertically <Ev>"),true,0)) return DECMARK_ERR; if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_SOF0: // SOF0 (Baseline DCT) case JFIF_SOF1: // SOF1 (Extended sequential) case JFIF_SOF2: // SOF2 (Progressive) case JFIF_SOF3: case JFIF_SOF5: case JFIF_SOF6: case JFIF_SOF7: case JFIF_SOF9: case JFIF_SOF10: case JFIF_SOF11: case JFIF_SOF13: case JFIF_SOF14: case JFIF_SOF15: // TODO: // - JFIF_DHP should be able to reuse the JFIF_SOF marker parsing // however as we don't support hierarchical image decode, we // would want to skip the update of class members. m_bStateSof = true; // Determine if this is a SOF mode that we support // At this time, we only support Baseline DCT & Extended Sequential Baseline DCT // (non-differential) with Huffman coding. Progressive, Lossless, // Differential and Arithmetic coded modes are not supported. m_bImgSofUnsupported = true; if (nCode == JFIF_SOF0) { m_bImgSofUnsupported = false; } if (nCode == JFIF_SOF1) { m_bImgSofUnsupported = false; } // For reference, note progressive scan files even though // we don't currently support their decode if (nCode == JFIF_SOF2) { m_bImgProgressive = true; } nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); // Lf m_nPos+=2; //XXX strTmp.Format(_T(" Frame header length <Lf> = %u"),nLength); strTmp.Format(_T(" Frame header length = %u"),nLength); m_pLog->AddLine(strTmp); m_nSofPrecision_P = Buf(m_nPos++); // P //XXX strTmp.Format(_T(" Precision <P> = %u"),m_nSofPrecision_P); strTmp.Format(_T(" Precision = %u"),m_nSofPrecision_P); m_pLog->AddLine(strTmp); if (!ValidateValue(m_nSofPrecision_P,2,16,_T("Precision <P>"),true,8)) return DECMARK_ERR; m_nSofNumLines_Y = Buf(m_nPos)*256 + Buf(m_nPos+1); // Y m_nPos += 2; //XXX strTmp.Format(_T(" Number of Lines <Y> = %u"),m_nSofNumLines_Y); strTmp.Format(_T(" Number of Lines = %u"),m_nSofNumLines_Y); m_pLog->AddLine(strTmp); if (!ValidateValue(m_nSofNumLines_Y,0,65535,_T("Number of Lines <Y>"),true,0)) return DECMARK_ERR; m_nSofSampsPerLine_X = Buf(m_nPos)*256 + Buf(m_nPos+1); // X m_nPos += 2; //XXX strTmp.Format(_T(" Samples per Line <X> = %u"),m_nSofSampsPerLine_X); strTmp.Format(_T(" Samples per Line = %u"),m_nSofSampsPerLine_X); m_pLog->AddLine(strTmp); if (!ValidateValue(m_nSofSampsPerLine_X,1,65535,_T("Samples per Line <X>"),true,1)) return DECMARK_ERR; strTmp.Format(_T(" Image Size = %u x %u"),m_nSofSampsPerLine_X,m_nSofNumLines_Y); m_pLog->AddLine(strTmp); // Determine orientation // m_nSofSampsPerLine_X = X // m_nSofNumLines_Y = Y m_eImgLandscape = ENUM_LANDSCAPE_YES; if (m_nSofNumLines_Y > m_nSofSampsPerLine_X) m_eImgLandscape = ENUM_LANDSCAPE_NO; strTmp.Format(_T(" Raw Image Orientation = %s"),(m_eImgLandscape==ENUM_LANDSCAPE_YES)?_T("Landscape"):_T("Portrait")); m_pLog->AddLine(strTmp); m_nSofNumComps_Nf = Buf(m_nPos++); // Nf, range 1..255 //XXX strTmp.Format(_T(" Number of Img components <Nf> = %u"),m_nSofNumComps_Nf); strTmp.Format(_T(" Number of Img components = %u"),m_nSofNumComps_Nf); m_pLog->AddLine(strTmp); if (!ValidateValue(m_nSofNumComps_Nf,1,255,_T("Number of Img components <Nf>"),true,1)) return DECMARK_ERR; unsigned nCompIdent; unsigned anSofSampFact[MAX_SOF_COMP_NF]; m_nSofHorzSampFactMax_Hmax = 0; m_nSofVertSampFactMax_Vmax = 0; // Now clear the output image content (all components) // TODO: Migrate some of the bitmap allocation / clearing from // DecodeScanImg() into ResetImageContent() and call here //m_pImgDec->ResetImageContent(); // Per JFIF v1.02: // - Nf = 1 or 3 // - C1 = Y // - C2 = Cb // - C3 = Cr for (unsigned nCompInd=1;((!m_bStateAbort)&&(nCompInd<=m_nSofNumComps_Nf));nCompInd++) { nCompIdent = Buf(m_nPos++); // Ci, range 0..255 m_anSofQuantCompId[nCompInd] = nCompIdent; //if (!ValidateValue(m_anSofQuantCompId[nCompInd],0,255,_T("Component ID <Ci>"),true,0)) return DECMARK_ERR; anSofSampFact[nCompIdent] = Buf(m_nPos++); m_anSofQuantTblSel_Tqi[nCompIdent] = Buf(m_nPos++); // Tqi, range 0..3 //if (!ValidateValue(m_anSofQuantTblSel_Tqi[nCompIdent],0,3,_T("Table Destination ID <Tqi>"),true,0)) return DECMARK_ERR; // NOTE: We protect against bad input here as replication ratios are // determined later that depend on dividing by sampling factor (hence // possibility of div by 0). m_anSofHorzSampFact_Hi[nCompIdent] = (anSofSampFact[nCompIdent] & 0xF0) >> 4; // Hi, range 1..4 m_anSofVertSampFact_Vi[nCompIdent] = (anSofSampFact[nCompIdent] & 0x0F); // Vi, range 1..4 //if (!ValidateValue(m_anSofHorzSampFact_Hi[nCompIdent],1,4,_T("Horizontal Sampling Factor <Hi>"),true,1)) return DECMARK_ERR; //if (!ValidateValue(m_anSofVertSampFact_Vi[nCompIdent],1,4,_T("Vertical Sampling Factor <Vi>"),true,1)) return DECMARK_ERR; } // Calculate max sampling factors for (unsigned nCompInd=1;((!m_bStateAbort)&&(nCompInd<=m_nSofNumComps_Nf));nCompInd++) { nCompIdent = m_anSofQuantCompId[nCompInd]; // Calculate maximum sampling factor for the SOF. This is only // used for later generation of m_strImgQuantCss an the SOF // reporting below. The CimgDecode block is responsible for // calculating the maximum sampling factor on a per-scan basis. m_nSofHorzSampFactMax_Hmax = max(m_nSofHorzSampFactMax_Hmax,m_anSofHorzSampFact_Hi[nCompIdent]); m_nSofVertSampFactMax_Vmax = max(m_nSofVertSampFactMax_Vmax,m_anSofVertSampFact_Vi[nCompIdent]); } // Report per-component sampling factors and quantization table selectors for (unsigned nCompInd=1;((!m_bStateAbort)&&(nCompInd<=m_nSofNumComps_Nf));nCompInd++) { nCompIdent = m_anSofQuantCompId[nCompInd]; // Create subsampling ratio // - Protect against division-by-zero CString strSubsampH = _T("?"); CString strSubsampV = _T("?"); if (m_anSofHorzSampFact_Hi[nCompIdent] > 0) { strSubsampH.Format(_T("%u"),m_nSofHorzSampFactMax_Hmax/m_anSofHorzSampFact_Hi[nCompIdent]); } if (m_anSofVertSampFact_Vi[nCompIdent] > 0) { strSubsampV.Format(_T("%u"),m_nSofVertSampFactMax_Vmax/m_anSofVertSampFact_Vi[nCompIdent]); } strFull.Format(_T(" Component[%u]: "),nCompInd); // Note i in Ci is 1-based //XXX strTmp.Format(_T("ID=0x%02X, Samp Fac <Hi,Vi>=0x%02X (Subsamp %u x %u), Quant Tbl Sel <Tqi>=0x%02X"), strTmp.Format(_T("ID=0x%02X, Samp Fac=0x%02X (Subsamp %s x %s), Quant Tbl Sel=0x%02X"), nCompIdent,anSofSampFact[nCompIdent], (LPCTSTR)strSubsampH,(LPCTSTR)strSubsampV, m_anSofQuantTblSel_Tqi[nCompIdent]); strFull += strTmp; // Mapping from component index (not ID) to colour channel per JFIF if (m_nSofNumComps_Nf == 1) { // Assume grayscale strFull += _T(" (Lum: Y)"); } else if (m_nSofNumComps_Nf == 3) { // Assume YCC if (nCompInd == SCAN_COMP_Y) { strFull += _T(" (Lum: Y)"); } else if (nCompInd == SCAN_COMP_CB) { strFull += _T(" (Chrom: Cb)"); } else if (nCompInd == SCAN_COMP_CR) { strFull += _T(" (Chrom: Cr)"); } } else if (m_nSofNumComps_Nf == 4) { // Assume YCCK if (nCompInd == 1) { strFull += _T(" (Y)"); } else if (nCompInd == 2) { strFull += _T(" (Cb)"); } else if (nCompInd == 3) { strFull += _T(" (Cr)"); } else if (nCompInd == 4) { strFull += _T(" (K)"); } } else { strFull += _T(" (???)"); // Unknown } m_pLog->AddLine(strFull); } // Test for bad input, clean up if bad for (unsigned nCompInd=1;((!m_bStateAbort)&&(nCompInd<=m_nSofNumComps_Nf));nCompInd++) { nCompIdent = m_anSofQuantCompId[nCompInd]; if (!ValidateValue(m_anSofQuantCompId[nCompInd],0,255,_T("Component ID <Ci>"),true,0)) return DECMARK_ERR; if (!ValidateValue(m_anSofQuantTblSel_Tqi[nCompIdent],0,3,_T("Table Destination ID <Tqi>"),true,0)) return DECMARK_ERR; if (!ValidateValue(m_anSofHorzSampFact_Hi[nCompIdent],1,4,_T("Horizontal Sampling Factor <Hi>"),true,1)) return DECMARK_ERR; if (!ValidateValue(m_anSofVertSampFact_Vi[nCompIdent],1,4,_T("Vertical Sampling Factor <Vi>"),true,1)) return DECMARK_ERR; } // Finally, assign the cleaned values to the decoder for (unsigned nCompInd=1;((!m_bStateAbort)&&(nCompInd<=m_nSofNumComps_Nf));nCompInd++) { nCompIdent = m_anSofQuantCompId[nCompInd]; // Store the DQT Table selection for the Image Decoder // Param values: Nf,Tqi // Param ranges: 1..255,0..3 // Note that the Image Decoder doesn't need to see the Component Identifiers bRet = m_pImgDec->SetDqtTables(nCompInd,m_anSofQuantTblSel_Tqi[nCompIdent]); DecodeErrCheck(bRet); // Store the Precision (to handle 12-bit decode) m_pImgDec->SetPrecision(m_nSofPrecision_P); } if (!m_bStateAbort) { // Set the component sampling factors (chroma subsampling) // FIXME: check ranging for (unsigned nCompInd=1;nCompInd<=m_nSofNumComps_Nf;nCompInd++) { // nCompInd is component index (1...Nf) // nCompIdent is Component Identifier (Ci) // Note that the Image Decoder doesn't need to see the Component Identifiers nCompIdent = m_anSofQuantCompId[nCompInd]; m_pImgDec->SetSofSampFactors(nCompInd,m_anSofHorzSampFact_Hi[nCompIdent],m_anSofVertSampFact_Vi[nCompIdent]); } // Now mark the image as been somewhat OK (ie. should // also be suitable for EmbeddedThumb() and PrepareSignature() m_bImgOK = true; m_bStateSofOk = true; } if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_COM: // COM nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); m_nPos+=2; strTmp.Format(_T(" Comment length = %u"),nLength); m_pLog->AddLine(strTmp); // Check for JPEG COM vulnerability // http://marc.info/?l=bugtraq&m=109524346729948 // Note that the recovery is not very graceful. It will assume that the // field is actually zero-length, which will make the next byte trigger the // "Expected marker 0xFF" error message and probably abort. There is no // obvious way to if ( (nLength == 0) || (nLength == 1) ) { strTmp.Format(_T(" JPEG Comment Field Vulnerability detected!")); m_pLog->AddLineErr(strTmp); strTmp.Format(_T(" Skipping data until next marker...")); m_pLog->AddLineErr(strTmp); nLength = 2; bool bDoneSearch = false; unsigned nSkipStart = m_nPos; while (!bDoneSearch) { if (Buf(m_nPos) != 0xFF) { m_nPos++; } else { bDoneSearch = true; } if (m_nPos >= m_pWBuf->GetPosEof()) { bDoneSearch = true; } } strTmp.Format(_T(" Skipped %u bytes"),m_nPos - nSkipStart); m_pLog->AddLineErr(strTmp); // Break out of case statement break; } // Assume COM field valid length (ie. >= 2) strFull = _T(" Comment="); m_strComment = _T(""); for (unsigned ind=0;ind<nLength-2;ind++) { nTmpVal = Buf(m_nPos++); if (_istprint(nTmpVal)) { strTmp.Format(_T("%c"),nTmpVal); m_strComment += strTmp; } else { m_strComment += _T("."); } } strFull += m_strComment; m_pLog->AddLine(strFull); break; case JFIF_DHT: // DHT m_bStateDht = true; DecodeDHT(false); m_bStateDhtOk = true; break; case JFIF_SOS: // SOS unsigned long nPosScanStart; // Byte count at start of scan data segment m_bStateSos = true; // NOTE: Only want to capture position of first SOS // This should make other function such as AVI frame extract // more robust in case we get multiple SOS segments. // We assume that this value is reset when we start a new decode if (m_nPosSos == 0) { m_nPosSos = m_nPos-2; // Used for Extract. Want to include actual marker } nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); m_nPos+=2; // Ensure that we have seen proper markers before we try this one! if (!m_bStateSofOk) { strTmp.Format(_T(" ERROR: SOS before valid SOF defined")); m_pLog->AddLineErr(strTmp); return DECMARK_ERR; } strTmp.Format(_T(" Scan header length = %u"),nLength); m_pLog->AddLine(strTmp); m_nSosNumCompScan_Ns = Buf(m_nPos++); // Ns, range 1..4 //XXX strTmp.Format(_T(" Number of image components <Ns> = %u"),m_nSosNumCompScan_Ns); strTmp.Format(_T(" Number of img components = %u"),m_nSosNumCompScan_Ns); m_pLog->AddLine(strTmp); // Just in case something got corrupted, don't want to get out // of range here. Note that this will be a hard abort, and // will not resume decoding. if (m_nSosNumCompScan_Ns > MAX_SOS_COMP_NS) { strTmp.Format(_T(" ERROR: Scan decode does not support > %u components"),MAX_SOS_COMP_NS); m_pLog->AddLineErr(strTmp); return DECMARK_ERR; } unsigned nSosCompSel_Cs; unsigned nSosHuffTblSel; unsigned nSosHuffTblSelDc_Td; unsigned nSosHuffTblSelAc_Ta; // Max range of components indices is between 1..4 for (unsigned int nScanCompInd=1;((nScanCompInd<=m_nSosNumCompScan_Ns) && (!m_bStateAbort));nScanCompInd++) { strFull.Format(_T(" Component[%u]: "),nScanCompInd); nSosCompSel_Cs = Buf(m_nPos++); // Cs, range 0..255 nSosHuffTblSel = Buf(m_nPos++); nSosHuffTblSelDc_Td = (nSosHuffTblSel & 0xf0)>>4; // Td, range 0..3 nSosHuffTblSelAc_Ta = (nSosHuffTblSel & 0x0f); // Ta, range 0..3 strTmp.Format(_T("selector=0x%02X, table=%u(DC),%u(AC)"),nSosCompSel_Cs,nSosHuffTblSelDc_Td,nSosHuffTblSelAc_Ta); strFull += strTmp; m_pLog->AddLine(strFull); bRet = m_pImgDec->SetDhtTables(nScanCompInd,nSosHuffTblSelDc_Td,nSosHuffTblSelAc_Ta); DecodeErrCheck(bRet); } m_nSosSpectralStart_Ss = Buf(m_nPos++); m_nSosSpectralEnd_Se = Buf(m_nPos++); m_nSosSuccApprox_A = Buf(m_nPos++); strTmp.Format(_T(" Spectral selection = %u .. %u"),m_nSosSpectralStart_Ss,m_nSosSpectralEnd_Se); m_pLog->AddLine(strTmp); strTmp.Format(_T(" Successive approximation = 0x%02X"),m_nSosSuccApprox_A); m_pLog->AddLine(strTmp); if (m_pAppConfig->bOutputScanDump) { m_pLog->AddLine(_T("")); m_pLog->AddLine(_T(" Scan Data: (after bitstuff removed)")); } // Save the scan data segment position nPosScanStart = m_nPos; // Skip over the Scan Data segment // Pass 1) Quick, allowing for bOutputScanDump to dump first 640B. // Pass 2) If bDecodeScanImg, we redo the process but in detail decoding. // FIXME: Not sure why, but if I skip over Pass 1 (eg if I leave in the // following line uncommented), then I get an error at the end of the // pass 2 decode (indicating that EOI marker not seen, and expecting // marker). // if (m_pAppConfig->bOutputScanDump) { // --- PASS 1 --- bool bSkipDone; unsigned nSkipCount; unsigned nSkipData; unsigned nSkipPos; bool bScanDumpTrunc; bSkipDone = false; nSkipCount = 0; nSkipPos = 0; bScanDumpTrunc = FALSE; strFull = _T(""); while (!bSkipDone) { nSkipCount++; nSkipPos++; nSkipData = Buf(m_nPos++); if (nSkipData == 0xFF) { // this could either be a marker or a byte stuff nSkipData = Buf(m_nPos++); nSkipCount++; if (nSkipData == 0x00) { // Byte stuff nSkipData = 0xFF; } else if ((nSkipData >= JFIF_RST0) && (nSkipData <= JFIF_RST7)) { // Skip over } else { // Marker bSkipDone = true; m_nPos -= 2; } } if (m_pAppConfig->bOutputScanDump && (!bSkipDone) ) { // Only display 20 lines of scan data if (nSkipPos > 640) { if (!bScanDumpTrunc) { m_pLog->AddLineWarn(_T(" WARNING: Dump truncated.")); bScanDumpTrunc = TRUE; } } else { if ( ((nSkipPos-1) == 0) || (((nSkipPos-1) % 32) == 0) ) { strFull = _T(" "); } strTmp.Format(_T("%02x "),nSkipData); strFull += strTmp; if (((nSkipPos-1) % 32) == 31) { m_pLog->AddLine(strFull); strFull = _T(""); } } } // Did we run out of bytes? // FIXME: // NOTE: This line here doesn't allow us to attempt to // decode images that are missing EOI. Maybe this is // not the best solution here? Instead, we should be // checking m_nPos against file length? .. and not // return but "break". if (!m_pWBuf->GetBufOk()) { strTmp.Format(_T("ERROR: Ran out of buffer before EOI during phase 1 of Scan decode @ 0x%08X"),m_nPos); m_pLog->AddLineErr(strTmp); break; } } m_pLog->AddLine(strFull); // } // --- PASS 2 --- // If the option is set, start parsing! if (m_pAppConfig->bDecodeScanImg && m_bImgSofUnsupported) { // SOF marker was of type we don't support, so skip decoding m_pLog->AddLineWarn(_T(" NOTE: Scan parsing doesn't support this SOF mode.")); #ifndef DEBUG_YCCK } else if (m_pAppConfig->bDecodeScanImg && (m_nSofNumComps_Nf == 4)) { m_pLog->AddLineWarn(_T(" NOTE: Scan parsing doesn't support CMYK files yet.")); #endif } else if (m_pAppConfig->bDecodeScanImg && !m_bImgSofUnsupported) { if (!m_bStateSofOk) { m_pLog->AddLineWarn(_T(" NOTE: Scan decode disabled as SOF not decoded.")); } else if (!m_bStateDqtOk) { m_pLog->AddLineWarn(_T(" NOTE: Scan decode disabled as DQT not decoded.")); } else if (!m_bStateDhtOk) { m_pLog->AddLineWarn(_T(" NOTE: Scan decode disabled as DHT not decoded.")); } else { m_pLog->AddLine(_T("")); // Set the primary image details m_pImgDec->SetImageDetails(m_nSofSampsPerLine_X,m_nSofNumLines_Y, m_nSofNumComps_Nf,m_nSosNumCompScan_Ns,m_nImgRstEn,m_nImgRstInterval); // Only recalculate the scan decoding if we need to (i.e. file // changed, offset changed, scan option changed) // TODO: In order to decode multiple scans, we will need to alter the // way that m_pImgSrcDirty is set if (m_pImgSrcDirty) { m_pImgDec->DecodeScanImg(nPosScanStart,true,false); m_pImgSrcDirty = false; } } } m_bStateSosOk = true; break; case JFIF_DRI: unsigned nVal; nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); strTmp.Format(_T(" Length = %u"),nLength); m_pLog->AddLine(strTmp); nVal = Buf(m_nPos+2)*256 + Buf(m_nPos+3); // According to ITU-T spec B.2.4.4, we only expect // restart markers if DRI value is non-zero! m_nImgRstInterval = nVal; if (nVal != 0) { m_nImgRstEn = true; } else { m_nImgRstEn = false; } strTmp.Format(_T(" interval = %u"),m_nImgRstInterval); m_pLog->AddLine(strTmp); m_nPos += 4; if (!ExpectMarkerEnd(nPosMarkerStart,nLength)) return DECMARK_ERR; break; case JFIF_EOI: // EOI m_pLog->AddLine(_T("")); // Save the EOI file position // NOTE: If the file is missing the EOI, then this variable will be // set to mark the end of file. m_nPosEmbedEnd = m_nPos; m_nPosEoi = m_nPos; m_bStateEoi = true; return DECMARK_EOI; break; // Markers that are not yet supported in JPEGsnoop case JFIF_DHP: // Markers defined for future use / extensions case JFIF_JPG: case JFIF_JPG0: case JFIF_JPG1: case JFIF_JPG2: case JFIF_JPG3: case JFIF_JPG4: case JFIF_JPG5: case JFIF_JPG6: case JFIF_JPG7: case JFIF_JPG8: case JFIF_JPG9: case JFIF_JPG10: case JFIF_JPG11: case JFIF_JPG12: case JFIF_JPG13: case JFIF_TEM: // Unsupported marker // - Provide generic decode based on length nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); // Length strTmp.Format(_T(" Header length = %u"),nLength); m_pLog->AddLine(strTmp); m_pLog->AddLineWarn(_T(" Skipping unsupported marker")); m_nPos += nLength; break; case JFIF_RST0: case JFIF_RST1: case JFIF_RST2: case JFIF_RST3: case JFIF_RST4: case JFIF_RST5: case JFIF_RST6: case JFIF_RST7: // We don't expect to see restart markers outside the entropy coded segment. // NOTE: RST# are standalone markers, so no length indicator exists // But for the sake of robustness, we can check here to see if treating // as a standalone marker will arrive at another marker (ie. OK). If not, // proceed to assume there is a length indicator. strTmp.Format(_T(" WARNING: Restart marker [0xFF%02X] detected outside scan"),nCode); m_pLog->AddLineWarn(strTmp); if (!m_pAppConfig->bRelaxedParsing) { // Abort m_pLog->AddLineErr(_T(" Stopping decode")); m_pLog->AddLine(_T(" Use [Img Search Fwd/Rev] to locate other valid embedded JPEGs")); return DECMARK_ERR; } else { // Ignore // Check to see if standalone marker treatment looks OK if (Buf(m_nPos+2) == 0xFF) { // Looks like standalone m_pLog->AddLineWarn(_T(" Ignoring standalone marker. Proceeding with decode.")); m_nPos += 2; } else { // Looks like marker with length nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); strTmp.Format(_T(" Header length = %u"),nLength); m_pLog->AddLine(strTmp); m_pLog->AddLineWarn(_T(" Skipping marker")); m_nPos += nLength; } } break; default: strTmp.Format(_T(" WARNING: Unknown marker [0xFF%02X]"),nCode); m_pLog->AddLineWarn(strTmp); if (!m_pAppConfig->bRelaxedParsing) { // Abort m_pLog->AddLineErr(_T(" Stopping decode")); m_pLog->AddLine(_T(" Use [Img Search Fwd/Rev] to locate other valid embedded JPEGs")); return DECMARK_ERR; } else { // Skip nLength = Buf(m_nPos)*256 + Buf(m_nPos+1); strTmp.Format(_T(" Header length = %u"),nLength); m_pLog->AddLine(strTmp); m_pLog->AddLineWarn(_T(" Skipping marker")); m_nPos += nLength; } } // Add white-space between each marker m_pLog->AddLine(_T(" ")); // If we decided to abort for any reason, make sure we trap it now. // This will stop the ProcessFile() while loop. We can set m_bStateAbort // if user says that they want to stop. if (m_bStateAbort) { return DECMARK_ERR; } return DECMARK_OK; }
7528
True
1
CVE-2017-11664
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV: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': 'http://seclists.org/fulldisclosure/2017/Aug/12', 'name': '20170808 wildmidi multiple vulnerabilities', 'refsource': 'FULLDISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/42433/', 'name': '42433', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'name': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mindwerks:wildmidi:0.4.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The _WM_SetupMidiEvent function in internal_midi.c:2122 in WildMIDI 0.4.2 can cause a denial of service (invalid memory read and application crash) via a crafted mid file.'}]
2020-11-10T19:39Z
2017-08-17T16: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
sezero
2017-08-02 17:55:10+03:00
Fix bug #175: CVE-2017-11661, CVE-2017-11662, CVE-2017-11663, CVE-2017-11664: Add a new size parameter to _WM_SetupMidiEvent() so that it knows where to stop reading, and adjust its clients properly.
ad6d7cf88d6673167ca1f517248af9409a9f1be1
False
Mindwerks/wildmidi
WildMIDI is a simple software midi player which has a core softsynth library that can be used with other applications.
2014-01-09 15:02:09
2021-07-25 20:17:37
http://www.mindwerks.net/projects/wildmidi
Mindwerks
163.0
29.0
_WM_ParseNewHmi
_WM_ParseNewHmi( uint8_t * hmi_data , uint32_t hmi_size)
['hmi_data', 'hmi_size']
_WM_ParseNewHmi(uint8_t *hmi_data, uint32_t hmi_size) { uint32_t hmi_tmp = 0; uint8_t *hmi_base = hmi_data; uint16_t hmi_bpm = 0; uint16_t hmi_division = 0; // uint32_t hmi_duration_secs = 0; uint32_t hmi_track_cnt = 0; uint32_t *hmi_track_offset = NULL; uint32_t i = 0; uint32_t j = 0; uint8_t *hmi_addr = NULL; uint32_t *hmi_track_header_length = NULL; struct _mdi *hmi_mdi = NULL; uint32_t tempo_f = 5000000.0; uint32_t *hmi_track_end = NULL; uint8_t hmi_tracks_ended = 0; uint8_t *hmi_running_event = NULL; uint32_t setup_ret = 0; uint32_t *hmi_delta = NULL; uint32_t smallest_delta = 0; uint32_t subtract_delta = 0; uint32_t sample_count = 0; float sample_count_f = 0; float sample_remainder = 0; float samples_per_delta_f = 0.0; struct _note { uint32_t length; uint8_t channel; } *note; //FIXME: This needs to be used for sanity check. UNUSED(hmi_size); if (memcmp(hmi_data, "HMI-MIDISONG061595", 18)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMI, NULL, 0); return NULL; } //FIXME: Unsure if this is correct but it seems to be the only offset that plays the files at what appears to be the right speed. hmi_bpm = hmi_data[212]; hmi_division = 60; hmi_track_cnt = hmi_data[228]; hmi_mdi = _WM_initMDI(); _WM_midi_setup_divisions(hmi_mdi, hmi_division); if ((_WM_MixerOptions & WM_MO_ROUNDTEMPO)) { tempo_f = (float) (60000000 / hmi_bpm) + 0.5f; } else { tempo_f = (float) (60000000 / hmi_bpm); } samples_per_delta_f = _WM_GetSamplesPerTick(hmi_division, (uint32_t)tempo_f); _WM_midi_setup_tempo(hmi_mdi, (uint32_t)tempo_f); hmi_track_offset = (uint32_t *)malloc(sizeof(uint32_t) * hmi_track_cnt); hmi_track_header_length = malloc(sizeof(uint32_t) * hmi_track_cnt); hmi_track_end = malloc(sizeof(uint32_t) * hmi_track_cnt); hmi_delta = malloc(sizeof(uint32_t) * hmi_track_cnt); note = malloc(sizeof(struct _note) * 128 * hmi_track_cnt); hmi_running_event = malloc(sizeof(uint8_t) * 128 * hmi_track_cnt); hmi_data += 370; smallest_delta = 0xffffffff; if (hmi_size < (370 + (hmi_track_cnt * 17))) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMI, "file too short", 0); goto _hmi_end; } hmi_track_offset[0] = *hmi_data; // To keep Xcode happy for (i = 0; i < hmi_track_cnt; i++) { hmi_track_offset[i] = *hmi_data++; hmi_track_offset[i] += (*hmi_data++ << 8); hmi_track_offset[i] += (*hmi_data++ << 16); hmi_track_offset[i] += (*hmi_data++ << 24); if (hmi_size < (hmi_track_offset[i] + 0x5a + 4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMI, "file too short", 0); goto _hmi_end; } hmi_addr = hmi_base + hmi_track_offset[i]; if (memcmp(hmi_addr, "HMI-MIDITRACK", 13)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMI, NULL, 0); goto _hmi_end; } hmi_track_header_length[i] = hmi_addr[0x57]; hmi_track_header_length[i] += (hmi_addr[0x58] << 8); hmi_track_header_length[i] += (hmi_addr[0x59] << 16); hmi_track_header_length[i] += (hmi_addr[0x5a] << 24); hmi_addr += hmi_track_header_length[i]; hmi_track_offset[i] += hmi_track_header_length[i]; // Get tracks initial delta and set its samples_till_next; hmi_delta[i] = 0; if (*hmi_addr > 0x7f) { do { hmi_delta[i] = (hmi_delta[i] << 7) + (*hmi_addr & 0x7f); hmi_addr++; hmi_track_offset[i]++; } while (*hmi_addr > 0x7f); } hmi_delta[i] = (hmi_delta[i] << 7) + (*hmi_addr & 0x7f); hmi_track_offset[i]++; hmi_addr++; // Find smallest delta to work with if (hmi_delta[i] < smallest_delta) { smallest_delta = hmi_delta[i]; } hmi_track_end[i] = 0; hmi_running_event[i] = 0; for (j = 0; j < 128; j++) { hmi_tmp = (128 * i) + j; note[hmi_tmp].length = 0; note[hmi_tmp].channel = 0; } } subtract_delta = smallest_delta; sample_count_f= (((float) smallest_delta * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; hmi_mdi->events[hmi_mdi->event_count - 1].samples_to_next += sample_count; hmi_mdi->extra_info.approx_total_samples += sample_count; while (hmi_tracks_ended < hmi_track_cnt) { smallest_delta = 0; for (i = 0; i < hmi_track_cnt; i++) { if (hmi_track_end[i]) continue; // first check to see if any active notes need turning off. for (j = 0; j < 128; j++) { hmi_tmp = (128 * i) + j; if (note[hmi_tmp].length) { note[hmi_tmp].length -= subtract_delta; if (note[hmi_tmp].length) { if ((!smallest_delta) || (smallest_delta > note[hmi_tmp].length)) { smallest_delta = note[hmi_tmp].length; } } else { _WM_midi_setup_noteoff(hmi_mdi, note[hmi_tmp].channel, j, 0); } } } if (hmi_delta[i]) { hmi_delta[i] -= subtract_delta; if (hmi_delta[i]) { if ((!smallest_delta) || (smallest_delta > hmi_delta[i])) { smallest_delta = hmi_delta[i]; } continue; } } do { hmi_data = hmi_base + hmi_track_offset[i]; hmi_delta[i] = 0; if (hmi_data[0] == 0xfe) { // HMI only event of some sort. if (hmi_data[1] == 0x10) { hmi_tmp = (hmi_data[4] + 5); hmi_data += hmi_tmp; hmi_track_offset[i] += hmi_tmp; } else if (hmi_data[1] == 0x15) { hmi_data += 4; hmi_track_offset[i] += 4; } hmi_data += 4; hmi_track_offset[i] += 4; } else { if ((setup_ret = _WM_SetupMidiEvent(hmi_mdi,hmi_data,hmi_running_event[i])) == 0) { goto _hmi_end; } if ((hmi_data[0] == 0xff) && (hmi_data[1] == 0x2f) && (hmi_data[2] == 0x00)) { hmi_track_end[i] = 1; hmi_tracks_ended++; for(j = 0; j < 128; j++) { hmi_tmp = (128 * i) + j; if (note[hmi_tmp].length) { _WM_midi_setup_noteoff(hmi_mdi, note[hmi_tmp].channel, j, 0); note[hmi_tmp].length = 0; } } goto _hmi_next_track; } // Running event // 0xff does not alter running event if ((*hmi_data == 0xF0) || (*hmi_data == 0xF7)) { // Sysex resets running event data hmi_running_event[i] = 0; } else if (*hmi_data < 0xF0) { // MIDI events 0x80 to 0xEF set running event if (*hmi_data >= 0x80) { hmi_running_event[i] = *hmi_data; } } if ((hmi_running_event[i] & 0xf0) == 0x90) { // note on has extra data to specify how long the note is. if (*hmi_data > 127) { hmi_tmp = hmi_data[1]; } else { hmi_tmp = *hmi_data; } hmi_tmp += (i * 128); note[hmi_tmp].channel = hmi_running_event[i] & 0xf; hmi_data += setup_ret; hmi_track_offset[i] += setup_ret; note[hmi_tmp].length = 0; if (*hmi_data > 0x7f) { do { note[hmi_tmp].length = (note[hmi_tmp].length << 7) | (*hmi_data & 0x7F); hmi_data++; hmi_track_offset[i]++; } while (*hmi_data > 0x7F); } note[hmi_tmp].length = (note[hmi_tmp].length << 7) | (*hmi_data & 0x7F); hmi_data++; hmi_track_offset[i]++; if (note[hmi_tmp].length) { if ((!smallest_delta) || (smallest_delta > note[hmi_tmp].length)) { smallest_delta = note[hmi_tmp].length; } } else { _WM_midi_setup_noteoff(hmi_mdi, note[hmi_tmp].channel, j, 0); } } else { hmi_data += setup_ret; hmi_track_offset[i] += setup_ret; } } // get track delta // hmi_delta[i] = 0; // set at start of loop if (*hmi_data > 0x7f) { do { hmi_delta[i] = (hmi_delta[i] << 7) | (*hmi_data & 0x7F); hmi_data++; hmi_track_offset[i]++; } while (*hmi_data > 0x7F); } hmi_delta[i] = (hmi_delta[i] << 7) | (*hmi_data & 0x7F); hmi_data++; hmi_track_offset[i]++; } while (!hmi_delta[i]); if ((!smallest_delta) || (smallest_delta > hmi_delta[i])) { smallest_delta = hmi_delta[i]; } _hmi_next_track: hmi_tmp = 0; UNUSED(hmi_tmp); } // convert smallest delta to samples till next subtract_delta = smallest_delta; sample_count_f= (((float) smallest_delta * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; hmi_mdi->events[hmi_mdi->event_count - 1].samples_to_next += sample_count; hmi_mdi->extra_info.approx_total_samples += sample_count; } if ((hmi_mdi->reverb = _WM_init_reverb(_WM_SampleRate, _WM_reverb_room_width, _WM_reverb_room_length, _WM_reverb_listen_posx, _WM_reverb_listen_posy)) == NULL) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to init reverb", 0); goto _hmi_end; } hmi_mdi->extra_info.current_sample = 0; hmi_mdi->current_event = &hmi_mdi->events[0]; hmi_mdi->samples_to_mix = 0; hmi_mdi->note = NULL; _WM_ResetToStart(hmi_mdi); _hmi_end: free(hmi_track_offset); free(hmi_track_header_length); free(hmi_track_end); free(hmi_delta); free(note); free(hmi_running_event); if (hmi_mdi->reverb) return (hmi_mdi); _WM_freeMDI(hmi_mdi); return 0; }
1870
True
1
CVE-2017-11664
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV: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': 'http://seclists.org/fulldisclosure/2017/Aug/12', 'name': '20170808 wildmidi multiple vulnerabilities', 'refsource': 'FULLDISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/42433/', 'name': '42433', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'name': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mindwerks:wildmidi:0.4.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The _WM_SetupMidiEvent function in internal_midi.c:2122 in WildMIDI 0.4.2 can cause a denial of service (invalid memory read and application crash) via a crafted mid file.'}]
2020-11-10T19:39Z
2017-08-17T16: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
sezero
2017-08-02 17:55:10+03:00
Fix bug #175: CVE-2017-11661, CVE-2017-11662, CVE-2017-11663, CVE-2017-11664: Add a new size parameter to _WM_SetupMidiEvent() so that it knows where to stop reading, and adjust its clients properly.
ad6d7cf88d6673167ca1f517248af9409a9f1be1
False
Mindwerks/wildmidi
WildMIDI is a simple software midi player which has a core softsynth library that can be used with other applications.
2014-01-09 15:02:09
2021-07-25 20:17:37
http://www.mindwerks.net/projects/wildmidi
Mindwerks
163.0
29.0
_WM_ParseNewHmp
_WM_ParseNewHmp( uint8_t * hmp_data , uint32_t hmp_size)
['hmp_data', 'hmp_size']
_WM_ParseNewHmp(uint8_t *hmp_data, uint32_t hmp_size) { uint8_t is_hmp2 = 0; uint32_t zero_cnt = 0; uint32_t i = 0; uint32_t hmp_file_length = 0; uint32_t hmp_chunks = 0; uint32_t hmp_divisions = 0; uint32_t hmp_unknown = 0; uint32_t hmp_bpm = 0; uint32_t hmp_song_time = 0; struct _mdi *hmp_mdi; uint8_t **hmp_chunk; uint32_t *chunk_length; uint32_t *chunk_ofs; uint32_t *chunk_delta; uint8_t *chunk_end; uint32_t chunk_num = 0; uint32_t hmp_track = 0; // uint32_t j = 0; uint32_t smallest_delta = 0; uint32_t subtract_delta = 0; // uint32_t chunks_finished = 0; uint32_t end_of_chunks = 0; uint32_t var_len_shift = 0; float tempo_f = 500000.0; float samples_per_delta_f = 0.0; // uint8_t hmp_event = 0; // uint8_t hmp_channel = 0; uint32_t sample_count = 0; float sample_count_f = 0; float sample_remainder = 0; if (memcmp(hmp_data, "HMIMIDIP", 8)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMP, NULL, 0); return NULL; } hmp_data += 8; hmp_size -= 8; if (!memcmp(hmp_data, "013195", 6)) { hmp_data += 6; hmp_size -= 6; is_hmp2 = 1; } // should be a bunch of \0's if (is_hmp2) { zero_cnt = 18; } else { zero_cnt = 24; } for (i = 0; i < zero_cnt; i++) { if (hmp_data[i] != 0) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMP, NULL, 0); return NULL; } } hmp_data += zero_cnt; hmp_size -= zero_cnt; hmp_file_length = *hmp_data++; hmp_file_length += (*hmp_data++ << 8); hmp_file_length += (*hmp_data++ << 16); hmp_file_length += (*hmp_data++ << 24); hmp_size -= 4; UNUSED(hmp_file_length); // Next 12 bytes are normally \0 so skipping over them hmp_data += 12; hmp_size -= 12; hmp_chunks = *hmp_data++; hmp_chunks += (*hmp_data++ << 8); hmp_chunks += (*hmp_data++ << 16); hmp_chunks += (*hmp_data++ << 24); hmp_size -= 4; // Still decyphering what this is hmp_unknown = *hmp_data++; hmp_unknown += (*hmp_data++ << 8); hmp_unknown += (*hmp_data++ << 16); hmp_unknown += (*hmp_data++ << 24); hmp_size -= 4; UNUSED(hmp_unknown); // Defaulting: experimenting has found this to be the ideal value hmp_divisions = 60; // Beats per minute hmp_bpm = *hmp_data++; hmp_bpm += (*hmp_data++ << 8); hmp_bpm += (*hmp_data++ << 16); hmp_bpm += (*hmp_data++ << 24); hmp_size -= 4; /* Slow but needed for accuracy */ if ((_WM_MixerOptions & WM_MO_ROUNDTEMPO)) { tempo_f = (float) (60000000 / hmp_bpm) + 0.5f; } else { tempo_f = (float) (60000000 / hmp_bpm); } samples_per_delta_f = _WM_GetSamplesPerTick(hmp_divisions, tempo_f); //DEBUG //fprintf(stderr, "DEBUG: Samples Per Delta Tick: %f\r\n",samples_per_delta_f); // FIXME: This value is incorrect hmp_song_time = *hmp_data++; hmp_song_time += (*hmp_data++ << 8); hmp_song_time += (*hmp_data++ << 16); hmp_song_time += (*hmp_data++ << 24); hmp_size -= 4; // DEBUG //fprintf(stderr,"DEBUG: ??DIVISIONS??: %u, BPM: %u, ??SONG TIME??: %u:%.2u\r\n",hmp_divisions, hmp_bpm, (hmp_song_time / 60), (hmp_song_time % 60)); UNUSED(hmp_song_time); if (is_hmp2) { hmp_data += 840; hmp_size -= 840; } else { hmp_data += 712; hmp_size -= 712; } hmp_mdi = _WM_initMDI(); _WM_midi_setup_divisions(hmp_mdi, hmp_divisions); _WM_midi_setup_tempo(hmp_mdi, (uint32_t)tempo_f); hmp_chunk = malloc(sizeof(uint8_t *) * hmp_chunks); chunk_length = malloc(sizeof(uint32_t) * hmp_chunks); chunk_delta = malloc(sizeof(uint32_t) * hmp_chunks); chunk_ofs = malloc(sizeof(uint32_t) * hmp_chunks); chunk_end = malloc(sizeof(uint8_t) * hmp_chunks); smallest_delta = 0xffffffff; // store chunk info for use, and check chunk lengths for (i = 0; i < hmp_chunks; i++) { hmp_chunk[i] = hmp_data; chunk_ofs[i] = 0; chunk_num = *hmp_data++; chunk_num += (*hmp_data++ << 8); chunk_num += (*hmp_data++ << 16); chunk_num += (*hmp_data++ << 24); chunk_ofs[i] += 4; UNUSED(chunk_num); chunk_length[i] = *hmp_data++; chunk_length[i] += (*hmp_data++ << 8); chunk_length[i] += (*hmp_data++ << 16); chunk_length[i] += (*hmp_data++ << 24); chunk_ofs[i] += 4; if (chunk_length[i] > hmp_size) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_HMP, "file too short", 0); goto _hmp_end; } hmp_size -= chunk_length[i]; hmp_track = *hmp_data++; hmp_track += (*hmp_data++ << 8); hmp_track += (*hmp_data++ << 16); hmp_track += (*hmp_data++ << 24); chunk_ofs[i] += 4; UNUSED(hmp_track); // Start of Midi Data chunk_delta[i] = 0; var_len_shift = 0; if (*hmp_data < 0x80) { do { chunk_delta[i] = chunk_delta[i] | ((*hmp_data++ & 0x7F) << var_len_shift); var_len_shift += 7; chunk_ofs[i]++; } while (*hmp_data < 0x80); } chunk_delta[i] = chunk_delta[i] | ((*hmp_data++ & 0x7F) << var_len_shift); chunk_ofs[i]++; if (chunk_delta[i] < smallest_delta) { smallest_delta = chunk_delta[i]; } // goto start of next chunk hmp_data = hmp_chunk[i] + chunk_length[i]; hmp_chunk[i] += chunk_ofs[i]++; chunk_end[i] = 0; } subtract_delta = smallest_delta; sample_count_f = (((float) smallest_delta * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; hmp_mdi->events[hmp_mdi->event_count - 1].samples_to_next += sample_count; hmp_mdi->extra_info.approx_total_samples += sample_count; while (end_of_chunks < hmp_chunks) { smallest_delta = 0; // DEBUG // fprintf(stderr,"DEBUG: Delta Ticks: %u\r\n",subtract_delta); for (i = 0; i < hmp_chunks; i++) { if (chunk_end[i]) continue; if (chunk_delta[i]) { chunk_delta[i] -= subtract_delta; if (chunk_delta[i]) { if ((!smallest_delta) || (smallest_delta > chunk_delta[i])) { smallest_delta = chunk_delta[i]; } continue; } } do { if (((hmp_chunk[i][0] & 0xf0) == 0xb0 ) && ((hmp_chunk[i][1] == 110) || (hmp_chunk[i][1] == 111)) && (hmp_chunk[i][2] > 0x7f)) { // Reserved for loop markers // TODO: still deciding what to do about these hmp_chunk[i] += 3; } else { uint32_t setup_ret = 0; if ((setup_ret = _WM_SetupMidiEvent(hmp_mdi, hmp_chunk[i], 0)) == 0) { goto _hmp_end; } if ((hmp_chunk[i][0] == 0xff) && (hmp_chunk[i][1] == 0x2f) && (hmp_chunk[i][2] == 0x00)) { /* End of Chunk */ end_of_chunks++; chunk_end[i] = 1; hmp_chunk[i] += 3; goto NEXT_CHUNK; } else if ((hmp_chunk[i][0] == 0xff) && (hmp_chunk[i][1] == 0x51) && (hmp_chunk[i][2] == 0x03)) { /* Tempo */ tempo_f = (float)((hmp_chunk[i][3] << 16) + (hmp_chunk[i][4] << 8)+ hmp_chunk[i][5]); if (tempo_f == 0.0) tempo_f = 500000.0; // DEBUG fprintf(stderr,"DEBUG: Tempo change %f\r\n", tempo_f); } hmp_chunk[i] += setup_ret; } var_len_shift = 0; chunk_delta[i] = 0; if (*hmp_chunk[i] < 0x80) { do { chunk_delta[i] = chunk_delta[i] + ((*hmp_chunk[i] & 0x7F) << var_len_shift); var_len_shift += 7; hmp_chunk[i]++; } while (*hmp_chunk[i] < 0x80); } chunk_delta[i] = chunk_delta[i] + ((*hmp_chunk[i] & 0x7F) << var_len_shift); hmp_chunk[i]++; } while (!chunk_delta[i]); if ((!smallest_delta) || (smallest_delta > chunk_delta[i])) { smallest_delta = chunk_delta[i]; } NEXT_CHUNK: continue; } subtract_delta = smallest_delta; sample_count_f= (((float) smallest_delta * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; hmp_mdi->events[hmp_mdi->event_count - 1].samples_to_next += sample_count; hmp_mdi->extra_info.approx_total_samples += sample_count; // DEBUG // fprintf(stderr,"DEBUG: Sample Count %u\r\n",sample_count); } if ((hmp_mdi->reverb = _WM_init_reverb(_WM_SampleRate, _WM_reverb_room_width, _WM_reverb_room_length, _WM_reverb_listen_posx, _WM_reverb_listen_posy)) == NULL) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to init reverb", 0); goto _hmp_end; } hmp_mdi->extra_info.current_sample = 0; hmp_mdi->current_event = &hmp_mdi->events[0]; hmp_mdi->samples_to_mix = 0; hmp_mdi->note = NULL; _WM_ResetToStart(hmp_mdi); _hmp_end: free(hmp_chunk); free(chunk_length); free(chunk_delta); free(chunk_ofs); free(chunk_end); if (hmp_mdi->reverb) return (hmp_mdi); _WM_freeMDI(hmp_mdi); return NULL; }
1779
True
1
CVE-2017-11664
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV: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': 'http://seclists.org/fulldisclosure/2017/Aug/12', 'name': '20170808 wildmidi multiple vulnerabilities', 'refsource': 'FULLDISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/42433/', 'name': '42433', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'name': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mindwerks:wildmidi:0.4.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The _WM_SetupMidiEvent function in internal_midi.c:2122 in WildMIDI 0.4.2 can cause a denial of service (invalid memory read and application crash) via a crafted mid file.'}]
2020-11-10T19:39Z
2017-08-17T16: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
sezero
2017-08-02 17:55:10+03:00
Fix bug #175: CVE-2017-11661, CVE-2017-11662, CVE-2017-11663, CVE-2017-11664: Add a new size parameter to _WM_SetupMidiEvent() so that it knows where to stop reading, and adjust its clients properly.
ad6d7cf88d6673167ca1f517248af9409a9f1be1
False
Mindwerks/wildmidi
WildMIDI is a simple software midi player which has a core softsynth library that can be used with other applications.
2014-01-09 15:02:09
2021-07-25 20:17:37
http://www.mindwerks.net/projects/wildmidi
Mindwerks
163.0
29.0
_WM_ParseNewMidi
_WM_ParseNewMidi( uint8_t * midi_data , uint32_t midi_size)
['midi_data', 'midi_size']
_WM_ParseNewMidi(uint8_t *midi_data, uint32_t midi_size) { struct _mdi *mdi; uint32_t tmp_val; uint32_t midi_type; uint32_t track_size; uint8_t **tracks; uint32_t end_of_tracks = 0; uint32_t no_tracks; uint32_t i; uint32_t divisions = 96; uint32_t tempo = 500000; float samples_per_delta_f = 0.0; uint32_t sample_count = 0; float sample_count_f = 0.0; float sample_remainder = 0.0; uint8_t *sysex_store = NULL; // uint32_t sysex_store_len = 0; uint32_t *track_delta; uint8_t *track_end; uint32_t smallest_delta = 0; uint32_t subtract_delta = 0; // uint32_t tmp_length = 0; // uint8_t current_event = 0; // uint8_t current_event_ch = 0; uint8_t *running_event; uint32_t setup_ret = 0; if (midi_size < 14) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0); return (NULL); } if (!memcmp(midi_data, "RIFF", 4)) { if (midi_size < 34) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0); return (NULL); } midi_data += 20; midi_size -= 20; } if (memcmp(midi_data, "MThd", 4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_MIDI, NULL, 0); return (NULL); } midi_data += 4; midi_size -= 4; /* * Get Midi Header Size - must always be 6 */ tmp_val = *midi_data++ << 24; tmp_val |= *midi_data++ << 16; tmp_val |= *midi_data++ << 8; tmp_val |= *midi_data++; midi_size -= 4; if (tmp_val != 6) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, NULL, 0); return (NULL); } /* * Get Midi Format - we only support 0, 1 & 2 */ tmp_val = *midi_data++ << 8; tmp_val |= *midi_data++; midi_size -= 2; if (tmp_val > 2) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, NULL, 0); return (NULL); } midi_type = tmp_val; /* * Get No. of Tracks */ tmp_val = *midi_data++ << 8; tmp_val |= *midi_data++; midi_size -= 2; if (tmp_val < 1) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(no tracks)", 0); return (NULL); } no_tracks = tmp_val; /* * Check that type 0 midi file has only 1 track */ if ((midi_type == 0) && (no_tracks > 1)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(expected 1 track for type 0 midi file, found more)", 0); return (NULL); } /* * Get Divisions */ divisions = *midi_data++ << 8; divisions |= *midi_data++; midi_size -= 2; if (divisions & 0x00008000) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, NULL, 0); return (NULL); } samples_per_delta_f = _WM_GetSamplesPerTick(divisions, tempo); mdi = _WM_initMDI(); _WM_midi_setup_divisions(mdi,divisions); tracks = malloc(sizeof(uint8_t *) * no_tracks); track_delta = malloc(sizeof(uint32_t) * no_tracks); track_end = malloc(sizeof(uint8_t) * no_tracks); running_event = malloc(sizeof(uint8_t) * no_tracks); smallest_delta = 0xffffffff; for (i = 0; i < no_tracks; i++) { if (midi_size < 8) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0); goto _end; } if (memcmp(midi_data, "MTrk", 4) != 0) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(missing track header)", 0); goto _end; } midi_data += 4; midi_size -= 4; track_size = *midi_data++ << 24; track_size |= *midi_data++ << 16; track_size |= *midi_data++ << 8; track_size |= *midi_data++; midi_size -= 4; if (midi_size < track_size) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0); goto _end; } if (track_size < 3) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(bad track size)", 0); goto _end; } if ((midi_data[track_size - 3] != 0xFF) || (midi_data[track_size - 2] != 0x2F) || (midi_data[track_size - 1] != 0x00)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(missing EOT)", 0); goto _end; } tracks[i] = midi_data; midi_data += track_size; midi_size -= track_size; track_end[i] = 0; running_event[i] = 0; track_delta[i] = 0; while (*tracks[i] > 0x7F) { track_delta[i] = (track_delta[i] << 7) + (*tracks[i] & 0x7F); tracks[i]++; } track_delta[i] = (track_delta[i] << 7) + (*tracks[i] & 0x7F); tracks[i]++; if (midi_type == 1 ) { if (track_delta[i] < smallest_delta) { smallest_delta = track_delta[i]; } } else { /* * Type 0 & 2 midi only needs delta from 1st track * for initial sample calculations. */ if (i == 0) smallest_delta = track_delta[i]; } } subtract_delta = smallest_delta; sample_count_f = (((float) smallest_delta * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; mdi->events[mdi->event_count - 1].samples_to_next += sample_count; mdi->extra_info.approx_total_samples += sample_count; /* * Handle type 0 & 2 the same, but type 1 differently */ if (midi_type == 1) { /* Type 1 */ while (end_of_tracks != no_tracks) { smallest_delta = 0; for (i = 0; i < no_tracks; i++) { if (track_end[i]) continue; if (track_delta[i]) { track_delta[i] -= subtract_delta; if (track_delta[i]) { if ((!smallest_delta) || (smallest_delta > track_delta[i])) { smallest_delta = track_delta[i]; } continue; } } do { setup_ret = _WM_SetupMidiEvent(mdi, tracks[i], running_event[i]); if (setup_ret == 0) { goto _end; } if (tracks[i][0] > 0x7f) { if (tracks[i][0] < 0xf0) { /* Events 0x80 - 0xef set running event */ running_event[i] = tracks[i][0]; } else if ((tracks[i][0] == 0xf0) || (tracks[i][0] == 0xf7)) { /* Sysex resets running event */ running_event[i] = 0; } else if ((tracks[i][0] == 0xff) && (tracks[i][1] == 0x2f) && (tracks[i][2] == 0x00)) { /* End of Track */ end_of_tracks++; track_end[i] = 1; tracks[i] += 3; goto NEXT_TRACK; } else if ((tracks[i][0] == 0xff) && (tracks[i][1] == 0x51) && (tracks[i][2] == 0x03)) { /* Tempo */ tempo = (tracks[i][3] << 16) + (tracks[i][4] << 8)+ tracks[i][5]; if (!tempo) tempo = 500000; samples_per_delta_f = _WM_GetSamplesPerTick(divisions, tempo); } } tracks[i] += setup_ret; if (*tracks[i] > 0x7f) { do { track_delta[i] = (track_delta[i] << 7) + (*tracks[i] & 0x7F); tracks[i]++; } while (*tracks[i] > 0x7f); } track_delta[i] = (track_delta[i] << 7) + (*tracks[i] & 0x7F); tracks[i]++; } while (!track_delta[i]); if ((!smallest_delta) || (smallest_delta > track_delta[i])) { smallest_delta = track_delta[i]; } NEXT_TRACK: continue; } subtract_delta = smallest_delta; sample_count_f = (((float) smallest_delta * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; mdi->events[mdi->event_count - 1].samples_to_next += sample_count; mdi->extra_info.approx_total_samples += sample_count; } } else { /* Type 0 & 2 */ if (midi_type == 2) { mdi->is_type2 = 1; } sample_remainder = 0.0; for (i = 0; i < no_tracks; i++) { running_event[i] = 0; do { setup_ret = _WM_SetupMidiEvent(mdi, tracks[i], running_event[i]); if (setup_ret == 0) { goto _end; } if (tracks[i][0] > 0x7f) { if (tracks[i][0] < 0xf0) { /* Events 0x80 - 0xef set running event */ running_event[i] = tracks[i][0]; } else if ((tracks[i][0] == 0xf0) || (tracks[i][0] == 0xf7)) { /* Sysex resets running event */ running_event[i] = 0; } else if ((tracks[i][0] == 0xff) && (tracks[i][1] == 0x2f) && (tracks[i][2] == 0x00)) { /* End of Track */ track_end[i] = 1; goto NEXT_TRACK2; } else if ((tracks[i][0] == 0xff) && (tracks[i][1] == 0x51) && (tracks[i][2] == 0x03)) { /* Tempo */ tempo = (tracks[i][3] << 16) + (tracks[i][4] << 8)+ tracks[i][5]; if (!tempo) tempo = 500000; samples_per_delta_f = _WM_GetSamplesPerTick(divisions, tempo); } } tracks[i] += setup_ret; track_delta[i] = 0; if (*tracks[i] > 0x7f) { do { track_delta[i] = (track_delta[i] << 7) + (*tracks[i] & 0x7F); tracks[i]++; } while (*tracks[i] > 0x7f); } track_delta[i] = (track_delta[i] << 7) + (*tracks[i] & 0x7F); tracks[i]++; sample_count_f = (((float) track_delta[i] * samples_per_delta_f) + sample_remainder); sample_count = (uint32_t) sample_count_f; sample_remainder = sample_count_f - (float) sample_count; mdi->events[mdi->event_count - 1].samples_to_next += sample_count; mdi->extra_info.approx_total_samples += sample_count; NEXT_TRACK2: smallest_delta = track_delta[i]; /* Added just to keep Xcode happy */ UNUSED(smallest_delta); /* Added to just keep clang happy */ } while (track_end[i] == 0); } } if ((mdi->reverb = _WM_init_reverb(_WM_SampleRate, _WM_reverb_room_width, _WM_reverb_room_length, _WM_reverb_listen_posx, _WM_reverb_listen_posy)) == NULL) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to init reverb", 0); goto _end; } mdi->extra_info.current_sample = 0; mdi->current_event = &mdi->events[0]; mdi->samples_to_mix = 0; mdi->note = NULL; _WM_ResetToStart(mdi); _end: free(sysex_store); free(track_end); free(track_delta); free(running_event); free(tracks); if (mdi->reverb) return (mdi); _WM_freeMDI(mdi); return (NULL); }
2122
True
1
CVE-2017-11664
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV: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': 'http://seclists.org/fulldisclosure/2017/Aug/12', 'name': '20170808 wildmidi multiple vulnerabilities', 'refsource': 'FULLDISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/42433/', 'name': '42433', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'name': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mindwerks:wildmidi:0.4.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The _WM_SetupMidiEvent function in internal_midi.c:2122 in WildMIDI 0.4.2 can cause a denial of service (invalid memory read and application crash) via a crafted mid file.'}]
2020-11-10T19:39Z
2017-08-17T16: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
sezero
2017-08-02 17:55:10+03:00
Fix bug #175: CVE-2017-11661, CVE-2017-11662, CVE-2017-11663, CVE-2017-11664: Add a new size parameter to _WM_SetupMidiEvent() so that it knows where to stop reading, and adjust its clients properly.
ad6d7cf88d6673167ca1f517248af9409a9f1be1
False
Mindwerks/wildmidi
WildMIDI is a simple software midi player which has a core softsynth library that can be used with other applications.
2014-01-09 15:02:09
2021-07-25 20:17:37
http://www.mindwerks.net/projects/wildmidi
Mindwerks
163.0
29.0
_WM_ParseNewXmi
_WM_ParseNewXmi( uint8_t * xmi_data , uint32_t xmi_size)
['xmi_data', 'xmi_size']
struct _mdi *_WM_ParseNewXmi(uint8_t *xmi_data, uint32_t xmi_size) { struct _mdi *xmi_mdi = NULL; uint32_t xmi_tmpdata = 0; uint8_t xmi_formcnt = 0; uint32_t xmi_catlen = 0; uint32_t xmi_subformlen = 0; uint32_t i = 0; uint32_t j = 0; uint32_t xmi_evntlen = 0; uint32_t xmi_divisions = 60; uint32_t xmi_tempo = 500000; uint32_t xmi_sample_count = 0; float xmi_sample_count_f = 0.0; float xmi_sample_remainder = 0.0; float xmi_samples_per_delta_f = 0.0; uint8_t xmi_ch = 0; uint8_t xmi_note = 0; uint32_t *xmi_notelen = NULL; uint32_t setup_ret = 0; uint32_t xmi_delta = 0; uint32_t xmi_lowestdelta = 0; uint32_t xmi_evnt_cnt = 0; if (memcmp(xmi_data,"FORM",4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); return NULL; } xmi_data += 4; xmi_size -= 4; // bytes until next entry xmi_tmpdata = *xmi_data++ << 24; xmi_tmpdata |= *xmi_data++ << 16; xmi_tmpdata |= *xmi_data++ << 8; xmi_tmpdata |= *xmi_data++; xmi_size -= 4; if (memcmp(xmi_data,"XDIRINFO",8)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); return NULL; } xmi_data += 8; xmi_size -= 8; /* 0x00 0x00 0x00 0x02 at this point are unknown so skip over them */ xmi_data += 4; xmi_size -= 4; // number of forms contained after this point xmi_formcnt = *xmi_data++; if (xmi_formcnt == 0) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); return NULL; } xmi_size--; /* at this stage unsure if remaining data in this section means anything */ xmi_tmpdata -= 13; xmi_data += xmi_tmpdata; xmi_size -= xmi_tmpdata; /* FIXME: Check: may not even need to process CAT information */ if (memcmp(xmi_data,"CAT ",4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); return NULL; } xmi_data += 4; xmi_size -= 4; xmi_catlen = *xmi_data++ << 24; xmi_catlen |= *xmi_data++ << 16; xmi_catlen |= *xmi_data++ << 8; xmi_catlen |= *xmi_data++; xmi_size -= 4; UNUSED(xmi_catlen); if (memcmp(xmi_data,"XMID",4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); return NULL; } xmi_data += 4; xmi_size -= 4; xmi_mdi = _WM_initMDI(); _WM_midi_setup_divisions(xmi_mdi, xmi_divisions); _WM_midi_setup_tempo(xmi_mdi, xmi_tempo); xmi_samples_per_delta_f = _WM_GetSamplesPerTick(xmi_divisions, xmi_tempo); xmi_notelen = malloc(sizeof(uint32_t) * 16 * 128); memset(xmi_notelen, 0, (sizeof(uint32_t) * 16 * 128)); for (i = 0; i < xmi_formcnt; i++) { if (memcmp(xmi_data,"FORM",4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); goto _xmi_end; } xmi_data += 4; xmi_size -= 4; xmi_subformlen = *xmi_data++ << 24; xmi_subformlen |= *xmi_data++ << 16; xmi_subformlen |= *xmi_data++ << 8; xmi_subformlen |= *xmi_data++; xmi_size -= 4; if (memcmp(xmi_data,"XMID",4)) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); goto _xmi_end; } xmi_data += 4; xmi_size -= 4; xmi_subformlen -= 4; // Process Subform do { if (!memcmp(xmi_data,"TIMB",4)) { // Holds patch information // FIXME: May not be needed for playback as EVNT seems to // hold patch events xmi_data += 4; xmi_tmpdata = *xmi_data++ << 24; xmi_tmpdata |= *xmi_data++ << 16; xmi_tmpdata |= *xmi_data++ << 8; xmi_tmpdata |= *xmi_data++; xmi_data += xmi_tmpdata; xmi_size -= (8 + xmi_tmpdata); xmi_subformlen -= (8 + xmi_tmpdata); } else if (!memcmp(xmi_data,"RBRN",4)) { // Unknown what this is // FIXME: May not be needed for playback xmi_data += 4; xmi_tmpdata = *xmi_data++ << 24; xmi_tmpdata |= *xmi_data++ << 16; xmi_tmpdata |= *xmi_data++ << 8; xmi_tmpdata |= *xmi_data++; xmi_data += xmi_tmpdata; xmi_size -= (8 + xmi_tmpdata); xmi_subformlen -= (8 + xmi_tmpdata); } else if (!memcmp(xmi_data,"EVNT",4)) { // EVNT is where all the MIDI music information is stored xmi_data += 4; xmi_evnt_cnt++; xmi_evntlen = *xmi_data++ << 24; xmi_evntlen |= *xmi_data++ << 16; xmi_evntlen |= *xmi_data++ << 8; xmi_evntlen |= *xmi_data++; xmi_size -= 8; xmi_subformlen -= 8; do { if (*xmi_data < 0x80) { xmi_delta = 0; if (*xmi_data > 0x7f) { while (*xmi_data > 0x7f) { xmi_delta = (xmi_delta << 7) | (*xmi_data++ & 0x7f); xmi_size--; xmi_evntlen--; xmi_subformlen--; } } xmi_delta = (xmi_delta << 7) | (*xmi_data++ & 0x7f); xmi_size--; xmi_evntlen--; xmi_subformlen--; do { // determine delta till next event if ((xmi_lowestdelta != 0) && (xmi_lowestdelta <= xmi_delta)) { xmi_tmpdata = xmi_lowestdelta; } else { xmi_tmpdata = xmi_delta; } xmi_sample_count_f= (((float) xmi_tmpdata * xmi_samples_per_delta_f) + xmi_sample_remainder); xmi_sample_count = (uint32_t) xmi_sample_count_f; xmi_sample_remainder = xmi_sample_count_f - (float) xmi_sample_count; xmi_mdi->events[xmi_mdi->event_count - 1].samples_to_next += xmi_sample_count; xmi_mdi->extra_info.approx_total_samples += xmi_sample_count; xmi_lowestdelta = 0; // scan through on notes for (j = 0; j < (16*128); j++) { // only want notes that are on if (xmi_notelen[j] == 0) continue; // remove delta to next event from on notes xmi_notelen[j] -= xmi_tmpdata; // Check if we need to turn note off if (xmi_notelen[j] == 0) { xmi_ch = j / 128; xmi_note = j - (xmi_ch * 128); _WM_midi_setup_noteoff(xmi_mdi, xmi_ch, xmi_note, 0); } else { // otherwise work out new lowest delta if ((xmi_lowestdelta == 0) || (xmi_lowestdelta > xmi_notelen[j])) { xmi_lowestdelta = xmi_notelen[j]; } } } xmi_delta -= xmi_tmpdata; } while (xmi_delta); } else { if ((xmi_data[0] == 0xff) && (xmi_data[1] == 0x51) && (xmi_data[2] == 0x03)) { // Ignore tempo events setup_ret = 6; goto _XMI_Next_Event; } if ((setup_ret = _WM_SetupMidiEvent(xmi_mdi,xmi_data,0)) == 0) { goto _xmi_end; } if ((*xmi_data & 0xf0) == 0x90) { // Note on has extra data stating note length xmi_ch = *xmi_data & 0x0f; xmi_note = xmi_data[1]; xmi_data += setup_ret; xmi_size -= setup_ret; xmi_evntlen -= setup_ret; xmi_subformlen -= setup_ret; xmi_tmpdata = 0; if (*xmi_data > 0x7f) { while (*xmi_data > 0x7f) { xmi_tmpdata = (xmi_tmpdata << 7) | (*xmi_data++ & 0x7f); xmi_size--; xmi_evntlen--; xmi_subformlen--; } } xmi_tmpdata = (xmi_tmpdata << 7) | (*xmi_data++ & 0x7f); xmi_size--; xmi_evntlen--; xmi_subformlen--; // store length xmi_notelen[128 * xmi_ch + xmi_note] = xmi_tmpdata; if ((xmi_tmpdata > 0) && ((xmi_lowestdelta == 0) || (xmi_tmpdata < xmi_lowestdelta))) { xmi_lowestdelta = xmi_tmpdata; } } else { _XMI_Next_Event: xmi_data += setup_ret; xmi_size -= setup_ret; xmi_evntlen -= setup_ret; xmi_subformlen -= setup_ret; } } } while (xmi_evntlen); } else { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_XMI, NULL, 0); goto _xmi_end; } } while (xmi_subformlen); } // Finalise mdi structure if ((xmi_mdi->reverb = _WM_init_reverb(_WM_SampleRate, _WM_reverb_room_width, _WM_reverb_room_length, _WM_reverb_listen_posx, _WM_reverb_listen_posy)) == NULL) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to init reverb", 0); goto _xmi_end; } xmi_mdi->extra_info.current_sample = 0; xmi_mdi->current_event = &xmi_mdi->events[0]; xmi_mdi->samples_to_mix = 0; xmi_mdi->note = NULL; /* More than 1 event form in XMI means treat as type 2 */ if (xmi_evnt_cnt > 1) { xmi_mdi->is_type2 = 1; } _WM_ResetToStart(xmi_mdi); _xmi_end: if (xmi_notelen != NULL) free(xmi_notelen); if (xmi_mdi->reverb) return (xmi_mdi); _WM_freeMDI(xmi_mdi); return NULL; }
1485
True
1
CVE-2017-11664
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV: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': 'http://seclists.org/fulldisclosure/2017/Aug/12', 'name': '20170808 wildmidi multiple vulnerabilities', 'refsource': 'FULLDISC', 'tags': ['Exploit', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/42433/', 'name': '42433', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'name': 'https://github.com/Mindwerks/wildmidi/commit/ad6d7cf88d6673167ca1f517248af9409a9f1be1', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mindwerks:wildmidi:0.4.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The _WM_SetupMidiEvent function in internal_midi.c:2122 in WildMIDI 0.4.2 can cause a denial of service (invalid memory read and application crash) via a crafted mid file.'}]
2020-11-10T19:39Z
2017-08-17T16: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
sezero
2017-08-02 17:55:10+03:00
Fix bug #175: CVE-2017-11661, CVE-2017-11662, CVE-2017-11663, CVE-2017-11664: Add a new size parameter to _WM_SetupMidiEvent() so that it knows where to stop reading, and adjust its clients properly.
ad6d7cf88d6673167ca1f517248af9409a9f1be1
False
Mindwerks/wildmidi
WildMIDI is a simple software midi player which has a core softsynth library that can be used with other applications.
2014-01-09 15:02:09
2021-07-25 20:17:37
http://www.mindwerks.net/projects/wildmidi
Mindwerks
163.0
29.0
_WM_SetupMidiEvent
_WM_SetupMidiEvent( struct _mdi * mdi , uint8_t * event_data , uint8_t running_event)
['mdi', 'event_data', 'running_event']
uint32_t _WM_SetupMidiEvent(struct _mdi *mdi, uint8_t * event_data, uint8_t running_event) { /* Only add standard MIDI and Sysex events in here. Non-standard events need to be handled by calling function to avoid compatibility issues. TODO: Add value limit checks */ uint32_t ret_cnt = 0; uint8_t command = 0; uint8_t channel = 0; uint8_t data_1 = 0; uint8_t data_2 = 0; char *text = NULL; if (event_data[0] >= 0x80) { command = *event_data & 0xf0; channel = *event_data++ & 0x0f; ret_cnt++; } else { command = running_event & 0xf0; channel = running_event & 0x0f; } switch(command) { case 0x80: _SETUP_NOTEOFF: data_1 = *event_data++; data_2 = *event_data++; _WM_midi_setup_noteoff(mdi, channel, data_1, data_2); ret_cnt += 2; break; case 0x90: if (event_data[1] == 0) goto _SETUP_NOTEOFF; /* A velocity of 0 in a note on is actually a note off */ data_1 = *event_data++; data_2 = *event_data++; midi_setup_noteon(mdi, channel, data_1, data_2); ret_cnt += 2; break; case 0xa0: data_1 = *event_data++; data_2 = *event_data++; midi_setup_aftertouch(mdi, channel, data_1, data_2); ret_cnt += 2; break; case 0xb0: data_1 = *event_data++; data_2 = *event_data++; midi_setup_control(mdi, channel, data_1, data_2); ret_cnt += 2; break; case 0xc0: data_1 = *event_data++; midi_setup_patch(mdi, channel, data_1); ret_cnt++; break; case 0xd0: data_1 = *event_data++; midi_setup_channel_pressure(mdi, channel, data_1); ret_cnt++; break; case 0xe0: data_1 = *event_data++; data_2 = *event_data++; midi_setup_pitch(mdi, channel, ((data_2 << 7) | (data_1 & 0x7f))); ret_cnt += 2; break; case 0xf0: if (channel == 0x0f) { /* MIDI Meta Events */ uint32_t tmp_length = 0; if ((event_data[0] == 0x00) && (event_data[1] == 0x02)) { /* Sequence Number We only setting this up here for WM_Event2Midi function */ midi_setup_sequenceno(mdi, ((event_data[2] << 8) + event_data[3])); ret_cnt += 4; } else if (event_data[0] == 0x01) { /* Text Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_text(mdi, text); ret_cnt += tmp_length; } else if (event_data[0] == 0x02) { /* Copyright Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; /* Copy copyright info in the getinfo struct */ if (mdi->extra_info.copyright) { mdi->extra_info.copyright = realloc(mdi->extra_info.copyright,(strlen(mdi->extra_info.copyright) + 1 + tmp_length + 1)); memcpy(&mdi->extra_info.copyright[strlen(mdi->extra_info.copyright) + 1], event_data, tmp_length); mdi->extra_info.copyright[strlen(mdi->extra_info.copyright) + 1 + tmp_length] = '\0'; mdi->extra_info.copyright[strlen(mdi->extra_info.copyright)] = '\n'; } else { mdi->extra_info.copyright = malloc(tmp_length + 1); memcpy(mdi->extra_info.copyright, event_data, tmp_length); mdi->extra_info.copyright[tmp_length] = '\0'; } /* NOTE: free'd when events are cleared during closure of mdi */ text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_copyright(mdi, text); ret_cnt += tmp_length; } else if (event_data[0] == 0x03) { /* Track Name Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_trackname(mdi, text); ret_cnt += tmp_length; } else if (event_data[0] == 0x04) { /* Instrument Name Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_instrumentname(mdi, text); ret_cnt += tmp_length; } else if (event_data[0] == 0x05) { /* Lyric Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_lyric(mdi, text); ret_cnt += tmp_length; } else if (event_data[0] == 0x06) { /* Marker Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_marker(mdi, text); ret_cnt += tmp_length; } else if (event_data[0] == 0x07) { /* Cue Point Event */ /* Get Length */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; text = malloc(tmp_length + 1); memcpy(text, event_data, tmp_length); text[tmp_length] = '\0'; midi_setup_cuepoint(mdi, text); ret_cnt += tmp_length; } else if ((event_data[0] == 0x20) && (event_data[1] == 0x01)) { /* Channel Prefix We only setting this up here for WM_Event2Midi function */ midi_setup_channelprefix(mdi, event_data[2]); ret_cnt += 3; } else if ((event_data[0] == 0x21) && (event_data[1] == 0x01)) { /* Port Prefix We only setting this up here for WM_Event2Midi function */ midi_setup_portprefix(mdi, event_data[2]); ret_cnt += 3; } else if ((event_data[0] == 0x2F) && (event_data[1] == 0x00)) { /* End of Track Deal with this inside calling function We only setting this up here for _WM_Event2Midi function */ _WM_midi_setup_endoftrack(mdi); ret_cnt += 2; } else if ((event_data[0] == 0x51) && (event_data[1] == 0x03)) { /* Tempo Deal with this inside calling function. We only setting this up here for _WM_Event2Midi function */ _WM_midi_setup_tempo(mdi, ((event_data[2] << 16) + (event_data[3] << 8) + event_data[4])); ret_cnt += 5; } else if ((event_data[0] == 0x54) && (event_data[1] == 0x05)) { /* SMPTE Offset We only setting this up here for WM_Event2Midi function */ midi_setup_smpteoffset(mdi, ((event_data[3] << 24) + (event_data[4] << 16) + (event_data[5] << 8) + event_data[6])); /* Because this has 5 bytes of data we gonna "hack" it a little */ mdi->events[mdi->events_size - 1].event_data.channel = event_data[2]; ret_cnt += 7; } else if ((event_data[0] == 0x58) && (event_data[1] == 0x04)) { /* Time Signature We only setting this up here for WM_Event2Midi function */ midi_setup_timesignature(mdi, ((event_data[2] << 24) + (event_data[3] << 16) + (event_data[4] << 8) + event_data[5])); ret_cnt += 6; } else if ((event_data[0] == 0x59) && (event_data[1] == 0x02)) { /* Key Signature We only setting this up here for WM_Event2Midi function */ midi_setup_keysignature(mdi, ((event_data[2] << 8) + event_data[3])); ret_cnt += 4; } else { /* Unsupported Meta Event */ event_data++; ret_cnt++; if (*event_data > 0x7f) { do { tmp_length = (tmp_length << 7) + (*event_data & 0x7f); event_data++; ret_cnt++; } while (*event_data > 0x7f); } tmp_length = (tmp_length << 7) + (*event_data & 0x7f); ret_cnt++; ret_cnt += tmp_length; } } else if ((channel == 0) || (channel == 7)) { /* Sysex Events */ uint32_t sysex_len = 0; uint8_t *sysex_store = NULL; if (*event_data > 0x7f) { do { sysex_len = (sysex_len << 7) + (*event_data & 0x7F); event_data++; ret_cnt++; } while (*event_data > 0x7f); } sysex_len = (sysex_len << 7) + (*event_data & 0x7F); event_data++; if (!sysex_len) break; ret_cnt++; sysex_store = malloc(sizeof(uint8_t) * sysex_len); memcpy(sysex_store, event_data, sysex_len); if (sysex_store[sysex_len - 1] == 0xF7) { uint8_t rolandsysexid[] = { 0x41, 0x10, 0x42, 0x12 }; if (memcmp(rolandsysexid, sysex_store, 4) == 0) { /* For Roland Sysex Messages */ /* checksum */ uint8_t sysex_cs = 0; uint32_t sysex_ofs = 4; do { sysex_cs += sysex_store[sysex_ofs]; if (sysex_cs > 0x7F) { sysex_cs -= 0x80; } sysex_ofs++; } while (sysex_store[sysex_ofs + 1] != 0xf7); sysex_cs = 128 - sysex_cs; /* is roland sysex message valid */ if (sysex_cs == sysex_store[sysex_ofs]) { /* process roland sysex event */ if (sysex_store[4] == 0x40) { if (((sysex_store[5] & 0xf0) == 0x10) && (sysex_store[6] == 0x15)) { /* Roland Drum Track Setting */ uint8_t sysex_ch = 0x0f & sysex_store[5]; if (sysex_ch == 0x00) { sysex_ch = 0x09; } else if (sysex_ch <= 0x09) { sysex_ch -= 1; } midi_setup_sysex_roland_drum_track(mdi, sysex_ch, sysex_store[7]); } else if ((sysex_store[5] == 0x00) && (sysex_store[6] == 0x7F) && (sysex_store[7] == 0x00)) { /* Roland GS Reset */ midi_setup_sysex_roland_reset(mdi); } } } } else { /* For non-Roland Sysex Messages */ uint8_t gm_reset[] = {0x7e, 0x7f, 0x09, 0x01, 0xf7}; uint8_t yamaha_reset[] = {0x43, 0x10, 0x4c, 0x00, 0x00, 0x7e, 0x00, 0xf7}; if (memcmp(gm_reset, sysex_store, 5) == 0) { /* GM Reset */ midi_setup_sysex_gm_reset(mdi); } else if (memcmp(yamaha_reset,sysex_store,8) == 0) { /* Yamaha Reset */ midi_setup_sysex_yamaha_reset(mdi); } } } free(sysex_store); sysex_store = NULL; /* event_data += sysex_len; */ ret_cnt += sysex_len; } else { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(unrecognized meta type event)", 0); return 0; } break; default: /* Should NEVER get here */ ret_cnt = 0; break; } if (ret_cnt == 0) _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(missing event)", 0); return ret_cnt; }
2308
True
1
CVE-2017-10671
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
nan
[{'url': 'https://github.com/blueness/sthttpd/releases/tag/v2.27.1', 'name': 'https://github.com/blueness/sthttpd/releases/tag/v2.27.1', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/blueness/sthttpd/commit/c0dc63a49d8605649f1d8e4a96c9b468b0bff660', 'name': 'https://github.com/blueness/sthttpd/commit/c0dc63a49d8605649f1d8e4a96c9b468b0bff660', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2017/06/15/9', 'name': 'http://www.openwall.com/lists/oss-security/2017/06/15/9', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sthttpd_project:sthttpd:-:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Heap-based Buffer Overflow in the de_dotdot function in libhttpd.c in sthttpd before 2.27.1 allows remote attackers to cause a denial of service (daemon crash) or possibly have unspecified other impact via a crafted filename.'}]
2017-07-03T13:01Z
2017-06-29T08: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
Alexandre Rebert
2017-06-06 14:19:43-04:00
Fix heap buffer overflow in de_dotdot
c0dc63a49d8605649f1d8e4a96c9b468b0bff660
False
blueness/sthttpd
A fork of Jef Poskanzer's popular thttpd.
2015-01-25 02:44:26
2018-07-31 16:41:41
null
blueness
67.0
12.0
de_dotdot
de_dotdot( char * file)
['file']
de_dotdot( char* file ) { char* cp; char* cp2; int l; /* Collapse any multiple / sequences. */ while ( ( cp = strstr( file, "//") ) != (char*) 0 ) { for ( cp2 = cp + 2; *cp2 == '/'; ++cp2 ) continue; (void) strcpy( cp + 1, cp2 ); } /* Remove leading ./ and any /./ sequences. */ while ( strncmp( file, "./", 2 ) == 0 ) (void) memmove( file, file + 2, strlen( file ) - 1 ); while ( ( cp = strstr( file, "/./") ) != (char*) 0 ) (void) memmove( cp, cp + 2, strlen( file ) - 1 ); /* Alternate between removing leading ../ and removing xxx/../ */ for (;;) { while ( strncmp( file, "../", 3 ) == 0 ) (void) memmove( file, file + 3, strlen( file ) - 2 ); cp = strstr( file, "/../" ); if ( cp == (char*) 0 ) break; for ( cp2 = cp - 1; cp2 >= file && *cp2 != '/'; --cp2 ) continue; (void) strcpy( cp2 + 1, cp + 4 ); } /* Also elide any xxx/.. at the end. */ while ( ( l = strlen( file ) ) > 3 && strcmp( ( cp = file + l - 3 ), "/.." ) == 0 ) { for ( cp2 = cp - 1; cp2 >= file && *cp2 != '/'; --cp2 ) continue; if ( cp2 < file ) break; *cp2 = '\0'; } }
303
True
1
CVE-2017-10807
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.0/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
nan
[{'url': 'https://github.com/jabberd2/jabberd2/releases/tag/jabberd-2.6.1', 'name': 'https://github.com/jabberd2/jabberd2/releases/tag/jabberd-2.6.1', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/jabberd2/jabberd2/commit/8416ae54ecefa670534f27a31db71d048b9c7f16', 'name': 'https://github.com/jabberd2/jabberd2/commit/8416ae54ecefa670534f27a31db71d048b9c7f16', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://bugs.debian.org/867032', 'name': 'https://bugs.debian.org/867032', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99511', 'name': '99511', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://www.debian.org/security/2017/dsa-3902', 'name': 'DSA-3902', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-287'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:jabberd2:jabberd2:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.6.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'JabberD 2.x (aka jabberd2) before 2.6.1 allows anyone to authenticate using SASL ANONYMOUS, even when the sasl.anonymous c2s.xml option is not enabled.'}]
2017-11-04T01:29Z
2017-07-04T15:29Z
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
Tomasz Sterna
2017-07-01 17:23:52+02:00
Fixed offered SASL mechanism check
8416ae54ecefa670534f27a31db71d048b9c7f16
False
jabberd2/jabberd2
JabberD XMPP Server
2012-02-12 14:12:37
2019-01-02 10:49:51
http://jabberd2.org/
jabberd2
436.0
187.0
_sx_sasl_client_process
_sx_sasl_client_process( sx_t s , sx_plugin_t p , Gsasl_session * sd , const char * mech , const char * in , int inlen)
['s', 'p', 'sd', 'mech', 'in', 'inlen']
static void _sx_sasl_client_process(sx_t s, sx_plugin_t p, Gsasl_session *sd, const char *mech, const char *in, int inlen) { _sx_sasl_t ctx = (_sx_sasl_t) p->private; _sx_sasl_sess_t sctx = NULL; char *buf = NULL, *out = NULL, *realm = NULL, **ext_id; char hostname[256]; int ret; #ifdef HAVE_SSL int i; #endif size_t buflen, outlen; assert(ctx); assert(ctx->cb); if(mech != NULL) { _sx_debug(ZONE, "auth request from client (mechanism=%s)", mech); if(!gsasl_server_support_p(ctx->gsasl_ctx, mech)) { _sx_debug(ZONE, "client requested mechanism (%s) that we didn't offer", mech); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INVALID_MECHANISM, NULL), 0); return; } /* startup */ ret = gsasl_server_start(ctx->gsasl_ctx, mech, &sd); if(ret != GSASL_OK) { _sx_debug(ZONE, "gsasl_server_start failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_TEMPORARY_FAILURE, gsasl_strerror(ret)), 0); return; } /* get the realm */ (ctx->cb)(sx_sasl_cb_GET_REALM, NULL, (void **) &realm, s, ctx->cbarg); /* cleanup any existing session context */ sctx = gsasl_session_hook_get(sd); if (sctx != NULL) free(sctx); /* allocate and initialize our per session context */ sctx = (_sx_sasl_sess_t) calloc(1, sizeof(struct _sx_sasl_sess_st)); sctx->s = s; sctx->ctx = ctx; gsasl_session_hook_set(sd, (void *) sctx); gsasl_property_set(sd, GSASL_SERVICE, ctx->appname); gsasl_property_set(sd, GSASL_REALM, realm); /* get hostname */ hostname[0] = '\0'; gethostname(hostname, 256); hostname[255] = '\0'; gsasl_property_set(sd, GSASL_HOSTNAME, hostname); /* get EXTERNAL data from the ssl plugin */ ext_id = NULL; #ifdef HAVE_SSL for(i = 0; i < s->env->nplugins; i++) if(s->env->plugins[i]->magic == SX_SSL_MAGIC && s->plugin_data[s->env->plugins[i]->index] != NULL) ext_id = ((_sx_ssl_conn_t) s->plugin_data[s->env->plugins[i]->index])->external_id; if (ext_id != NULL) { //_sx_debug(ZONE, "sasl context ext id '%s'", ext_id); /* if there is, store it for later */ for (i = 0; i < SX_CONN_EXTERNAL_ID_MAX_COUNT; i++) if (ext_id[i] != NULL) { ctx->ext_id[i] = strdup(ext_id[i]); } else { ctx->ext_id[i] = NULL; break; } } #endif _sx_debug(ZONE, "sasl context initialised for %d", s->tag); s->plugin_data[p->index] = (void *) sd; if(strcmp(mech, "ANONYMOUS") == 0) { /* * special case for SASL ANONYMOUS: ignore the initial * response provided by the client and generate a random * authid to use as the jid node for the user, as * specified in XEP-0175 */ (ctx->cb)(sx_sasl_cb_GEN_AUTHZID, NULL, (void **)&out, s, ctx->cbarg); buf = strdup(out); buflen = strlen(buf); } else if (strstr(in, "<") != NULL && strncmp(in, "=", strstr(in, "<") - in ) == 0) { /* XXX The above check is hackish, but `in` is just weird */ /* This is a special case for SASL External c2s. See XEP-0178 */ _sx_debug(ZONE, "gsasl auth string is empty"); buf = strdup(""); buflen = strlen(buf); } else { /* decode and process */ ret = gsasl_base64_from(in, inlen, &buf, &buflen); if (ret != GSASL_OK) { _sx_debug(ZONE, "gsasl_base64_from failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INCORRECT_ENCODING, gsasl_strerror(ret)), 0); if(buf != NULL) free(buf); return; } } ret = gsasl_step(sd, buf, buflen, &out, &outlen); } else { /* decode and process */ ret = gsasl_base64_from(in, inlen, &buf, &buflen); if (ret != GSASL_OK) { _sx_debug(ZONE, "gsasl_base64_from failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INCORRECT_ENCODING, gsasl_strerror(ret)), 0); return; } if(!sd) { _sx_debug(ZONE, "response send before auth request enabling mechanism (decoded: %.*s)", buflen, buf); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MECH_TOO_WEAK, "response send before auth request enabling mechanism"), 0); if(buf != NULL) free(buf); return; } _sx_debug(ZONE, "response from client (decoded: %.*s)", buflen, buf); ret = gsasl_step(sd, buf, buflen, &out, &outlen); } if(buf != NULL) free(buf); /* auth completed */ if(ret == GSASL_OK) { _sx_debug(ZONE, "sasl handshake completed"); /* encode the leftover response */ ret = gsasl_base64_to(out, outlen, &buf, &buflen); if (ret == GSASL_OK) { /* send success */ _sx_nad_write(s, _sx_sasl_success(s, buf, buflen), 0); free(buf); /* set a notify on the success nad buffer */ ((sx_buf_t) s->wbufq->front->data)->notify = _sx_sasl_notify_success; ((sx_buf_t) s->wbufq->front->data)->notify_arg = (void *) p; } else { _sx_debug(ZONE, "gsasl_base64_to failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INCORRECT_ENCODING, gsasl_strerror(ret)), 0); if(buf != NULL) free(buf); } if(out != NULL) free(out); return; } /* in progress */ if(ret == GSASL_NEEDS_MORE) { _sx_debug(ZONE, "sasl handshake in progress (challenge: %.*s)", outlen, out); /* encode the challenge */ ret = gsasl_base64_to(out, outlen, &buf, &buflen); if (ret == GSASL_OK) { _sx_nad_write(s, _sx_sasl_challenge(s, buf, buflen), 0); free(buf); } else { _sx_debug(ZONE, "gsasl_base64_to failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INCORRECT_ENCODING, gsasl_strerror(ret)), 0); if(buf != NULL) free(buf); } if(out != NULL) free(out); return; } if(out != NULL) free(out); /* its over */ _sx_debug(ZONE, "sasl handshake failed; (%d): %s", ret, gsasl_strerror(ret)); switch (ret) { case GSASL_AUTHENTICATION_ERROR: case GSASL_NO_ANONYMOUS_TOKEN: case GSASL_NO_AUTHID: case GSASL_NO_AUTHZID: case GSASL_NO_PASSWORD: case GSASL_NO_PASSCODE: case GSASL_NO_PIN: case GSASL_NO_SERVICE: case GSASL_NO_HOSTNAME: out = _sasl_err_NOT_AUTHORIZED; break; case GSASL_UNKNOWN_MECHANISM: case GSASL_MECHANISM_PARSE_ERROR: out = _sasl_err_INVALID_MECHANISM; break; case GSASL_BASE64_ERROR: out = _sasl_err_INCORRECT_ENCODING; break; default: out = _sasl_err_MALFORMED_REQUEST; } _sx_nad_write(s, _sx_sasl_failure(s, out, gsasl_strerror(ret)), 0); }
1232
True
1
CVE-2017-6197
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/6816', 'name': 'https://github.com/radare/radare2/issues/6816', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/radare/radare2/commit/1ea23bd6040441a21fbcfba69dce9a01af03f989', 'name': 'https://github.com/radare/radare2/commit/1ea23bd6040441a21fbcfba69dce9a01af03f989', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/96433', 'name': '96433', 'refsource': 'BID', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The r_read_* functions in libr/include/r_endian.h in radare2 1.2.1 allow remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted binary file, as demonstrated by the r_read_le32 function.'}]
2017-03-02T02:59Z
2017-02-24T04:59Z
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
pancake
2017-02-20 12:08:06+01:00
Fix #6816 - null deref in r_read_*
1ea23bd6040441a21fbcfba69dce9a01af03f989
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
parse_class
parse_class( RBinFile * binfile , RBinDexObj * bin , RBinDexClass * c , int class_index , int * methods , int * sym_count)
['binfile', 'bin', 'c', 'class_index', 'methods', 'sym_count']
static void parse_class(RBinFile *binfile, RBinDexObj *bin, RBinDexClass *c, int class_index, int *methods, int *sym_count) { struct r_bin_t *rbin = binfile->rbin; char *class_name; int z; const ut8 *p, *p_end; if (!c) { return; } class_name = dex_class_name (bin, c); class_name = r_str_replace (class_name, ";", "", 0); //TODO: move to func if (!class_name || !*class_name) { return; } RBinClass *cls = R_NEW0 (RBinClass); if (!cls) { return; } cls->name = class_name; cls->index = class_index; cls->addr = bin->header.class_offset + class_index * DEX_CLASS_SIZE; cls->methods = r_list_new (); if (!cls->methods) { free (cls); return; } cls->fields = r_list_new (); if (!cls->fields) { r_list_free (cls->methods); free (cls); return; } r_list_append (bin->classes_list, cls); if (dexdump) { rbin->cb_printf (" Class descriptor : '%s;'\n", class_name); rbin->cb_printf ( " Access flags : 0x%04x (%s)\n", c->access_flags, createAccessFlagStr (c->access_flags, kAccessForClass)); rbin->cb_printf (" Superclass : '%s'\n", dex_class_super_name (bin, c)); rbin->cb_printf (" Interfaces -\n"); } if (c->interfaces_offset > 0 && bin->header.data_offset < c->interfaces_offset && c->interfaces_offset < bin->header.data_offset + bin->header.data_size) { p = r_buf_get_at (binfile->buf, c->interfaces_offset, NULL); int types_list_size = r_read_le32(p); if (types_list_size < 0 || types_list_size >= bin->header.types_size ) { return; } for (z = 0; z < types_list_size; z++) { int t = r_read_le16 (p + 4 + z * 2); if (t > 0 && t < bin->header.types_size ) { int tid = bin->types[t].descriptor_id; if (dexdump) { rbin->cb_printf ( " #%d : '%s'\n", z, getstr (bin, tid)); } } } } // TODO: this is quite ugly if (!c || !c->class_data_offset) { if (dexdump) { rbin->cb_printf ( " Static fields -\n Instance fields " "-\n Direct methods -\n Virtual methods " "-\n"); } } else { // TODO: move to func, def or inline // class_data_offset => [class_offset, class_defs_off+class_defs_size*32] if (bin->header.class_offset > c->class_data_offset || c->class_data_offset < bin->header.class_offset + bin->header.class_size * DEX_CLASS_SIZE) { return; } p = r_buf_get_at (binfile->buf, c->class_data_offset, NULL); p_end = p + binfile->buf->length - c->class_data_offset; //XXX check for NULL!! c->class_data = (struct dex_class_data_item_t *)malloc ( sizeof (struct dex_class_data_item_t)); p = r_uleb128 (p, p_end - p, &c->class_data->static_fields_size); p = r_uleb128 (p, p_end - p, &c->class_data->instance_fields_size); p = r_uleb128 (p, p_end - p, &c->class_data->direct_methods_size); p = r_uleb128 (p, p_end - p, &c->class_data->virtual_methods_size); if (dexdump) { rbin->cb_printf (" Static fields -\n"); } p = parse_dex_class_fields ( binfile, bin, c, cls, p, p_end, sym_count, c->class_data->static_fields_size, true); if (dexdump) { rbin->cb_printf (" Instance fields -\n"); } p = parse_dex_class_fields ( binfile, bin, c, cls, p, p_end, sym_count, c->class_data->instance_fields_size, false); if (dexdump) { rbin->cb_printf (" Direct methods -\n"); } p = parse_dex_class_method ( binfile, bin, c, cls, p, p_end, sym_count, c->class_data->direct_methods_size, methods, true); if (dexdump) { rbin->cb_printf (" Virtual methods -\n"); } p = parse_dex_class_method ( binfile, bin, c, cls, p, p_end, sym_count, c->class_data->virtual_methods_size, methods, false); } if (dexdump) { char *source_file = getstr (bin, c->source_file); if (!source_file) { rbin->cb_printf ( " source_file_idx : %d (unknown)\n\n", c->source_file); } else { rbin->cb_printf (" source_file_idx : %d (%s)\n\n", c->source_file, source_file); } } // TODO:!!!! // FIX: FREE BEFORE ALLOCATE!!! //free (class_name); }
815
True
1
CVE-2017-6194
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
nan
[{'url': 'https://github.com/radare/radare2/issues/6829', 'name': 'https://github.com/radare/radare2/issues/6829', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch']}, {'url': 'https://github.com/radare/radare2/commit/72794dc3523bbd5bb370de3c5857cb736c387e18', 'name': 'https://github.com/radare/radare2/commit/72794dc3523bbd5bb370de3c5857cb736c387e18', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/97299', 'name': '97299', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The relocs function in libr/bin/p/bin_bflt.c in radare2 1.2.1 allows remote attackers to cause a denial of service (heap-based buffer overflow and application crash) or possibly have unspecified other impact via a crafted binary file.'}]
2017-04-10T22:09Z
2017-04-03T05: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
alvarofe
2017-02-21 21:53:59+01:00
Fix #6829 oob write because of using wrong struct
72794dc3523bbd5bb370de3c5857cb736c387e18
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
relocs
relocs( RBinFile * arch)
['arch']
static RList *relocs(RBinFile *arch) { struct r_bin_bflt_obj *obj = (struct r_bin_bflt_obj*)arch->o->bin_obj; RList *list = r_list_newf ((RListFree)free); int i, len, n_got, amount; if (!list || !obj) { r_list_free (list); return NULL; } if (obj->hdr->flags & FLAT_FLAG_GOTPIC) { n_got = get_ngot_entries (obj); if (n_got) { amount = n_got * sizeof (ut32); if (amount < n_got || amount > UT32_MAX) { goto out_error; } struct reloc_struct_t *got_table = calloc (1, n_got * sizeof (ut32)); if (got_table) { ut32 offset = 0; for (i = 0; i < n_got ; offset += 4, i++) { ut32 got_entry; if (obj->hdr->data_start + offset + 4 > obj->size || obj->hdr->data_start + offset + 4 < offset) { break; } len = r_buf_read_at (obj->b, obj->hdr->data_start + offset, (ut8 *)&got_entry, sizeof (ut32)); if (!VALID_GOT_ENTRY (got_entry) || len != sizeof (ut32)) { break; } got_table[i].addr_to_patch = got_entry; got_table[i].data_offset = got_entry + BFLT_HDR_SIZE; } obj->n_got = n_got; obj->got_table = got_table; } } } if (obj->hdr->reloc_count > 0) { int n_reloc = obj->hdr->reloc_count; amount = n_reloc * sizeof (struct reloc_struct_t); if (amount < n_reloc || amount > UT32_MAX) { goto out_error; } struct reloc_struct_t *reloc_table = calloc (1, amount + 1); if (!reloc_table) { goto out_error; } amount = n_reloc * sizeof (ut32); if (amount < n_reloc || amount > UT32_MAX) { free (reloc_table); goto out_error; } ut32 *reloc_pointer_table = calloc (1, amount + 1); if (!reloc_pointer_table) { free (reloc_table); goto out_error; } if (obj->hdr->reloc_start + amount > obj->size || obj->hdr->reloc_start + amount < amount) { free (reloc_table); free (reloc_pointer_table); goto out_error; } len = r_buf_read_at (obj->b, obj->hdr->reloc_start, (ut8 *)reloc_pointer_table, amount); if (len != amount) { free (reloc_table); free (reloc_pointer_table); goto out_error; } for (i = 0; i < obj->hdr->reloc_count; i++) { //XXX it doesn't take endian as consideration when swapping ut32 reloc_offset = r_swap_ut32 (reloc_pointer_table[i]) + BFLT_HDR_SIZE; if (reloc_offset < obj->hdr->bss_end && reloc_offset < obj->size) { ut32 reloc_fixed, reloc_data_offset; if (reloc_offset + sizeof (ut32) > obj->size || reloc_offset + sizeof (ut32) < reloc_offset) { free (reloc_table); free (reloc_pointer_table); goto out_error; } len = r_buf_read_at (obj->b, reloc_offset, (ut8 *)&reloc_fixed, sizeof (ut32)); if (len != sizeof (ut32)) { eprintf ("problem while reading relocation entries\n"); free (reloc_table); free (reloc_pointer_table); goto out_error; } reloc_data_offset = r_swap_ut32 (reloc_fixed) + BFLT_HDR_SIZE; reloc_table[i].addr_to_patch = reloc_offset; reloc_table[i].data_offset = reloc_data_offset; RBinReloc *reloc = R_NEW0 (RBinReloc); if (reloc) { reloc->type = R_BIN_RELOC_32; reloc->paddr = reloc_table[i].addr_to_patch; reloc->vaddr = reloc->paddr; r_list_append (list, reloc); } } } free (reloc_pointer_table); obj->reloc_table = reloc_table; } return list; out_error: r_list_free (list); return NULL; }
726
True
1
CVE-2017-6194
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
nan
[{'url': 'https://github.com/radare/radare2/issues/6829', 'name': 'https://github.com/radare/radare2/issues/6829', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch']}, {'url': 'https://github.com/radare/radare2/commit/72794dc3523bbd5bb370de3c5857cb736c387e18', 'name': 'https://github.com/radare/radare2/commit/72794dc3523bbd5bb370de3c5857cb736c387e18', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/97299', 'name': '97299', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The relocs function in libr/bin/p/bin_bflt.c in radare2 1.2.1 allows remote attackers to cause a denial of service (heap-based buffer overflow and application crash) or possibly have unspecified other impact via a crafted binary file.'}]
2017-04-10T22:09Z
2017-04-03T05: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
alvarofe
2017-02-21 21:53:59+01:00
Fix #6829 oob write because of using wrong struct
72794dc3523bbd5bb370de3c5857cb736c387e18
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
search_old_relocation
search_old_relocation( struct reloc_struct_t * reloc_table , ut32 addr_to_patch , int n_reloc)
['reloc_table', 'addr_to_patch', 'n_reloc']
static int search_old_relocation(struct reloc_struct_t *reloc_table, ut32 addr_to_patch, int n_reloc) { int i; for (i = 0; i < n_reloc; i++) { if (addr_to_patch == reloc_table[i].data_offset) { return i; } } return -1; }
53
True
1
CVE-2017-6319
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
nan
[{'url': 'https://github.com/radare/radare2/issues/6836', 'name': 'https://github.com/radare/radare2/issues/6836', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/ad55822430a03fe075221b543efb434567e9e431', 'name': 'https://github.com/radare/radare2/commit/ad55822430a03fe075221b543efb434567e9e431', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96520', 'name': '96520', 'refsource': 'BID', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The dex_parse_debug_item function in libr/bin/p/bin_dex.c in radare2 1.2.1 allows remote attackers to cause a denial of service (buffer overflow and application crash) or possibly have unspecified other impact via a crafted DEX file.'}]
2017-03-04T02:59Z
2017-03-02T01: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
pancake
2017-02-23 19:17:28+01:00
Fix #6836 - oob write in dex
ad55822430a03fe075221b543efb434567e9e431
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
dex_parse_debug_item
dex_parse_debug_item( RBinFile * binfile , RBinDexObj * bin , RBinDexClass * c , int MI , int MA , int paddr , int ins_size , int insns_size , char * class_name , int regsz , int debug_info_off)
['binfile', 'bin', 'c', 'MI', 'MA', 'paddr', 'ins_size', 'insns_size', 'class_name', 'regsz', 'debug_info_off']
static void dex_parse_debug_item(RBinFile *binfile, RBinDexObj *bin, RBinDexClass *c, int MI, int MA, int paddr, int ins_size, int insns_size, char *class_name, int regsz, int debug_info_off) { struct r_bin_t *rbin = binfile->rbin; const ut8 *p4 = r_buf_get_at (binfile->buf, debug_info_off, NULL); const ut8 *p4_end = p4 + binfile->buf->length - debug_info_off; ut64 line_start; ut64 parameters_size; ut64 param_type_idx; ut16 argReg = regsz - ins_size; ut64 source_file_idx = c->source_file; RList *params, *debug_positions, *emitted_debug_locals = NULL; bool keep = true; if (argReg >= regsz) { //return; // this return breaks tests } p4 = r_uleb128 (p4, p4_end - p4, &line_start); p4 = r_uleb128 (p4, p4_end - p4, &parameters_size); // TODO: check when we should use source_file // The state machine consists of five registers ut32 address = 0; ut32 line = line_start; if (!(debug_positions = r_list_newf ((RListFree)free))) { return; } if (!(emitted_debug_locals = r_list_newf ((RListFree)free))) { r_list_free (debug_positions); return; } struct dex_debug_local_t debug_locals[regsz]; memset (debug_locals, 0, sizeof (struct dex_debug_local_t) * regsz); if (!(MA & 0x0008)) { debug_locals[argReg].name = "this"; debug_locals[argReg].descriptor = r_str_newf("%s;", class_name); debug_locals[argReg].startAddress = 0; debug_locals[argReg].signature = NULL; debug_locals[argReg].live = true; argReg++; } if (!(params = dex_method_signature2 (bin, MI))) { r_list_free (debug_positions); r_list_free (emitted_debug_locals); return; } RListIter *iter = r_list_iterator (params); char *name; char *type; int reg; r_list_foreach (params, iter, type) { if ((argReg >= regsz) || !type || parameters_size <= 0) { r_list_free (debug_positions); r_list_free (params); r_list_free (emitted_debug_locals); return; } p4 = r_uleb128 (p4, p4_end - p4, &param_type_idx); // read uleb128p1 param_type_idx -= 1; name = getstr (bin, param_type_idx); reg = argReg; switch (type[0]) { case 'D': case 'J': argReg += 2; break; default: argReg += 1; break; } if (name) { debug_locals[reg].name = name; debug_locals[reg].descriptor = type; debug_locals[reg].signature = NULL; debug_locals[reg].startAddress = address; debug_locals[reg].live = true; } --parameters_size; } ut8 opcode = *(p4++) & 0xff; while (keep) { switch (opcode) { case 0x0: // DBG_END_SEQUENCE keep = false; break; case 0x1: // DBG_ADVANCE_PC { ut64 addr_diff; p4 = r_uleb128 (p4, p4_end - p4, &addr_diff); address += addr_diff; } break; case 0x2: // DBG_ADVANCE_LINE { st64 line_diff = r_sleb128 (&p4, p4_end); line += line_diff; } break; case 0x3: // DBG_START_LOCAL { ut64 register_num; ut64 name_idx; ut64 type_idx; p4 = r_uleb128 (p4, p4_end - p4, &register_num); p4 = r_uleb128 (p4, p4_end - p4, &name_idx); name_idx -= 1; p4 = r_uleb128 (p4, p4_end - p4, &type_idx); type_idx -= 1; if (register_num >= regsz) { r_list_free (debug_positions); r_list_free (params); return; } // Emit what was previously there, if anything // emitLocalCbIfLive if (debug_locals[register_num].live) { struct dex_debug_local_t *local = malloc ( sizeof (struct dex_debug_local_t)); if (!local) { keep = false; break; } local->name = debug_locals[register_num].name; local->descriptor = debug_locals[register_num].descriptor; local->startAddress = debug_locals[register_num].startAddress; local->signature = debug_locals[register_num].signature; local->live = true; local->reg = register_num; local->endAddress = address; r_list_append (emitted_debug_locals, local); } debug_locals[register_num].name = getstr (bin, name_idx); debug_locals[register_num].descriptor = dex_type_descriptor (bin, type_idx); debug_locals[register_num].startAddress = address; debug_locals[register_num].signature = NULL; debug_locals[register_num].live = true; //eprintf("DBG_START_LOCAL %x %x %x\n", register_num, name_idx, type_idx); } break; case 0x4: //DBG_START_LOCAL_EXTENDED { ut64 register_num; ut64 name_idx; ut64 type_idx; ut64 sig_idx; p4 = r_uleb128 (p4, p4_end - p4, &register_num); p4 = r_uleb128 (p4, p4_end - p4, &name_idx); name_idx -= 1; p4 = r_uleb128 (p4, p4_end - p4, &type_idx); type_idx -= 1; p4 = r_uleb128 (p4, p4_end - p4, &sig_idx); sig_idx -= 1; if (register_num >= regsz) { r_list_free (debug_positions); r_list_free (params); return; } // Emit what was previously there, if anything // emitLocalCbIfLive if (debug_locals[register_num].live) { struct dex_debug_local_t *local = malloc ( sizeof (struct dex_debug_local_t)); if (!local) { keep = false; break; } local->name = debug_locals[register_num].name; local->descriptor = debug_locals[register_num].descriptor; local->startAddress = debug_locals[register_num].startAddress; local->signature = debug_locals[register_num].signature; local->live = true; local->reg = register_num; local->endAddress = address; r_list_append (emitted_debug_locals, local); } debug_locals[register_num].name = getstr (bin, name_idx); debug_locals[register_num].descriptor = dex_type_descriptor (bin, type_idx); debug_locals[register_num].startAddress = address; debug_locals[register_num].signature = getstr (bin, sig_idx); debug_locals[register_num].live = true; } break; case 0x5: // DBG_END_LOCAL { ut64 register_num; p4 = r_uleb128 (p4, p4_end - p4, &register_num); // emitLocalCbIfLive if (debug_locals[register_num].live) { struct dex_debug_local_t *local = malloc ( sizeof (struct dex_debug_local_t)); if (!local) { keep = false; break; } local->name = debug_locals[register_num].name; local->descriptor = debug_locals[register_num].descriptor; local->startAddress = debug_locals[register_num].startAddress; local->signature = debug_locals[register_num].signature; local->live = true; local->reg = register_num; local->endAddress = address; r_list_append (emitted_debug_locals, local); } debug_locals[register_num].live = false; } break; case 0x6: // DBG_RESTART_LOCAL { ut64 register_num; p4 = r_uleb128 (p4, p4_end - p4, &register_num); if (!debug_locals[register_num].live) { debug_locals[register_num].startAddress = address; debug_locals[register_num].live = true; } } break; case 0x7: //DBG_SET_PROLOGUE_END break; case 0x8: //DBG_SET_PROLOGUE_BEGIN break; case 0x9: { p4 = r_uleb128 (p4, p4_end - p4, &source_file_idx); source_file_idx--; } break; default: { int adjusted_opcode = opcode - 0x0a; address += (adjusted_opcode / 15); line += -4 + (adjusted_opcode % 15); struct dex_debug_position_t *position = malloc (sizeof (struct dex_debug_position_t)); if (!position) { keep = false; break; } position->source_file_idx = source_file_idx; position->address = address; position->line = line; r_list_append (debug_positions, position); } break; } opcode = *(p4++) & 0xff; } if (!binfile->sdb_addrinfo) { binfile->sdb_addrinfo = sdb_new0 (); } char *fileline; char offset[64]; char *offset_ptr; RListIter *iter1; struct dex_debug_position_t *pos; r_list_foreach (debug_positions, iter1, pos) { fileline = r_str_newf ("%s|%"PFMT64d, getstr (bin, pos->source_file_idx), pos->line); offset_ptr = sdb_itoa (pos->address + paddr, offset, 16); sdb_set (binfile->sdb_addrinfo, offset_ptr, fileline, 0); sdb_set (binfile->sdb_addrinfo, fileline, offset_ptr, 0); } if (!dexdump) { r_list_free (debug_positions); r_list_free (emitted_debug_locals); r_list_free (params); return; } RListIter *iter2; struct dex_debug_position_t *position; rbin->cb_printf (" positions :\n"); r_list_foreach (debug_positions, iter2, position) { rbin->cb_printf (" 0x%04llx line=%llu\n", position->address, position->line); } rbin->cb_printf (" locals :\n"); RListIter *iter3; struct dex_debug_local_t *local; r_list_foreach (emitted_debug_locals, iter3, local) { if (local->signature) { rbin->cb_printf ( " 0x%04x - 0x%04x reg=%d %s %s %s\n", local->startAddress, local->endAddress, local->reg, local->name, local->descriptor, local->signature); } else { rbin->cb_printf ( " 0x%04x - 0x%04x reg=%d %s %s\n", local->startAddress, local->endAddress, local->reg, local->name, local->descriptor); } } for (reg = 0; reg < regsz; reg++) { if (debug_locals[reg].live) { if (debug_locals[reg].signature) { rbin->cb_printf ( " 0x%04x - 0x%04x reg=%d %s %s " "%s\n", debug_locals[reg].startAddress, insns_size, reg, debug_locals[reg].name, debug_locals[reg].descriptor, debug_locals[reg].signature); } else { rbin->cb_printf ( " 0x%04x - 0x%04x reg=%d %s %s" "\n", debug_locals[reg].startAddress, insns_size, reg, debug_locals[reg].name, debug_locals[reg].descriptor); } } } r_list_free (debug_positions); r_list_free (emitted_debug_locals); r_list_free (params); }
1828
True
1
CVE-2017-6387
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.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/6857', 'name': 'https://github.com/radare/radare2/issues/6857', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/ead645853a63bf83d8386702cad0cf23b31d7eeb', 'name': 'https://github.com/radare/radare2/commit/ead645853a63bf83d8386702cad0cf23b31d7eeb', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/96521', 'name': '96521', 'refsource': 'BID', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The dex_loadcode function in libr/bin/p/bin_dex.c in radare2 1.2.1 allows remote attackers to cause a denial of service (out-of-bounds read and application crash) via a crafted DEX file.'}]
2017-03-04T02:59Z
2017-03-02T01: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
h4ng3r
2017-02-27 23:55:33+01:00
fix #6857
ead645853a63bf83d8386702cad0cf23b31d7eeb
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
dex_loadcode
dex_loadcode( RBinFile * arch , RBinDexObj * bin)
['arch', 'bin']
static int dex_loadcode(RBinFile *arch, RBinDexObj *bin) { struct r_bin_t *rbin = arch->rbin; int i; int *methods = NULL; int sym_count = 0; // doublecheck?? if (!bin || bin->methods_list) { return false; } bin->code_from = UT64_MAX; bin->code_to = 0; bin->methods_list = r_list_newf ((RListFree)free); if (!bin->methods_list) { return false; } bin->imports_list = r_list_newf ((RListFree)free); if (!bin->imports_list) { r_list_free (bin->methods_list); return false; } bin->classes_list = r_list_newf ((RListFree)__r_bin_class_free); if (!bin->classes_list) { r_list_free (bin->methods_list); r_list_free (bin->imports_list); return false; } if (bin->header.method_size>bin->size) { bin->header.method_size = 0; return false; } /* WrapDown the header sizes to avoid huge allocations */ bin->header.method_size = R_MIN (bin->header.method_size, bin->size); bin->header.class_size = R_MIN (bin->header.class_size, bin->size); bin->header.strings_size = R_MIN (bin->header.strings_size, bin->size); // TODO: is this posible after R_MIN ?? if (bin->header.strings_size > bin->size) { eprintf ("Invalid strings size\n"); return false; } if (bin->classes) { ut64 amount = sizeof (int) * bin->header.method_size; if (amount > UT32_MAX || amount < bin->header.method_size) { return false; } methods = calloc (1, amount + 1); for (i = 0; i < bin->header.class_size; i++) { char *super_name, *class_name; struct dex_class_t *c = &bin->classes[i]; class_name = dex_class_name (bin, c); super_name = dex_class_super_name (bin, c); if (dexdump) { rbin->cb_printf ("Class #%d -\n", i); } parse_class (arch, bin, c, i, methods, &sym_count); free (class_name); free (super_name); } } if (methods) { int import_count = 0; int sym_count = bin->methods_list->length; for (i = 0; i < bin->header.method_size; i++) { int len = 0; if (methods[i]) { continue; } if (bin->methods[i].class_id > bin->header.types_size - 1) { continue; } if (is_class_idx_in_code_classes(bin, bin->methods[i].class_id)) { continue; } char *class_name = getstr ( bin, bin->types[bin->methods[i].class_id] .descriptor_id); if (!class_name) { free (class_name); continue; } len = strlen (class_name); if (len < 1) { continue; } class_name[len - 1] = 0; // remove last char ";" char *method_name = dex_method_name (bin, i); char *signature = dex_method_signature (bin, i); if (method_name && *method_name) { RBinImport *imp = R_NEW0 (RBinImport); imp->name = r_str_newf ("%s.method.%s%s", class_name, method_name, signature); imp->type = r_str_const ("FUNC"); imp->bind = r_str_const ("NONE"); imp->ordinal = import_count++; r_list_append (bin->imports_list, imp); RBinSymbol *sym = R_NEW0 (RBinSymbol); sym->name = r_str_newf ("imp.%s", imp->name); sym->type = r_str_const ("FUNC"); sym->bind = r_str_const ("NONE"); //XXX so damn unsafe check buffer boundaries!!!! //XXX use r_buf API!! sym->paddr = sym->vaddr = bin->b->base + bin->header.method_offset + (sizeof (struct dex_method_t) * i) ; sym->ordinal = sym_count++; r_list_append (bin->methods_list, sym); sdb_num_set (mdb, sdb_fmt (0, "method.%d", i), sym->paddr, 0); } free (method_name); free (signature); free (class_name); } free (methods); } return true; }
789
True
1
CVE-2017-6448
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
nan
[{'url': 'https://github.com/radare/radare2/issues/6885', 'name': 'https://github.com/radare/radare2/issues/6885', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch']}, {'url': 'https://github.com/radare/radare2/commit/f41e941341e44aa86edd4483c4487ec09a074257', 'name': 'https://github.com/radare/radare2/commit/f41e941341e44aa86edd4483c4487ec09a074257', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/97313', 'name': '97313', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The dalvik_disassemble function in libr/asm/p/asm_dalvik.c in radare2 1.2.1 allows remote attackers to cause a denial of service (stack-based buffer overflow and application crash) or possibly have unspecified other impact via a crafted DEX file.'}]
2017-04-10T21:37Z
2017-04-03T05: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
h4ng3r
2017-03-02 20:16:22+01:00
Fix #6885 - oob write in dalvik_disassemble
f41e941341e44aa86edd4483c4487ec09a074257
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
dalvik_disassemble
dalvik_disassemble( RAsm * a , RAsmOp * op , const ut8 * buf , int len)
['a', 'op', 'buf', 'len']
static int dalvik_disassemble (RAsm *a, RAsmOp *op, const ut8 *buf, int len) { int vA, vB, vC, payload = 0, i = (int) buf[0]; int size = dalvik_opcodes[i].len; char str[1024], *strasm; ut64 offset; const char *flag_str; op->buf_asm[0] = 0; if (buf[0] == 0x00) { /* nop */ switch (buf[1]) { case 0x01: /* packed-switch-payload */ // ushort size // int first_key // int[size] = relative offsets { unsigned short array_size = buf[2] | (buf[3] << 8); int first_key = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24); sprintf (op->buf_asm, "packed-switch-payload %d, %d", array_size, first_key); size = 8; payload = 2 * (array_size * 2); len = 0; } break; case 0x02: /* sparse-switch-payload */ // ushort size // int[size] keys // int[size] relative offsets { unsigned short array_size = buf[2] | (buf[3] << 8); sprintf (op->buf_asm, "sparse-switch-payload %d", array_size); size = 4; payload = 2 * (array_size*4); len = 0; } break; case 0x03: /* fill-array-data-payload */ // element_width = 2 bytes ushort little endian // size = 4 bytes uint // ([size*element_width+1)/2)+4 if (len > 7) { unsigned short elem_width = buf[2] | (buf[3] << 8); unsigned int array_size = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24); snprintf (op->buf_asm, sizeof (op->buf_asm), "fill-array-data-payload %d, %d", elem_width, array_size); payload = 2 * ((array_size * elem_width+1)/2); } size = 8; len = 0; break; default: /* nop */ break; } } strasm = NULL; if (size <= len) { strncpy (op->buf_asm, dalvik_opcodes[i].name, sizeof (op->buf_asm) - 1); strasm = strdup (op->buf_asm); size = dalvik_opcodes[i].len; switch (dalvik_opcodes[i].fmt) { case fmtop: break; case fmtopvAvB: vA = buf[1] & 0x0f; vB = (buf[1] & 0xf0) >> 4; sprintf (str, " v%i, v%i", vA, vB); strasm = r_str_concat (strasm, str); break; case fmtopvAAvBBBB: vA = (int) buf[1]; vB = (buf[3] << 8) | buf[2]; sprintf (str, " v%i, v%i", vA, vB); strasm = r_str_concat (strasm, str); break; case fmtopvAAAAvBBBB: // buf[1] seems useless :/ vA = (buf[3] << 8) | buf[2]; vB = (buf[5] << 8) | buf[4]; sprintf (str, " v%i, v%i", vA, vB); strasm = r_str_concat (strasm, str); break; case fmtopvAA: vA = (int) buf[1]; sprintf (str, " v%i", vA); strasm = r_str_concat (strasm, str); break; case fmtopvAcB: vA = buf[1] & 0x0f; vB = (buf[1] & 0xf0) >> 4; sprintf (str, " v%i, %#x", vA, vB); strasm = r_str_concat (strasm, str); break; case fmtopvAAcBBBB: vA = (int) buf[1]; { short sB = (buf[3] << 8) | buf[2]; sprintf (str, " v%i, %#04hx", vA, sB); strasm = r_str_concat (strasm, str); } break; case fmtopvAAcBBBBBBBB: vA = (int) buf[1]; vB = buf[2] | (buf[3] << 8) | (buf[4] << 16) | (buf[5] << 24); if (buf[0] == 0x17) { //const-wide/32 snprintf (str, sizeof (str), " v%i:v%i, 0x%08x", vA, vA + 1, vB); } else { //const snprintf (str, sizeof (str), " v%i, 0x%08x", vA, vB); } strasm = r_str_concat (strasm, str); break; case fmtopvAAcBBBB0000: vA = (int) buf[1]; // vB = 0|(buf[3]<<16)|(buf[2]<<24); vB = 0 | (buf[2] << 16) | (buf[3] << 24); if (buf[0] == 0x19) { // const-wide/high16 snprintf (str, sizeof (str), " v%i:v%i, 0x%08x", vA, vA + 1, vB); } else { snprintf (str, sizeof (str), " v%i, 0x%08x", vA, vB); } strasm = r_str_concat (strasm, str); break; case fmtopvAAcBBBBBBBBBBBBBBBB: vA = (int) buf[1]; #define llint long long int llint lB = (llint)buf[2] | ((llint)buf[3] << 8)| ((llint)buf[4] << 16) | ((llint)buf[5] << 24)| ((llint)buf[6] << 32) | ((llint)buf[7] << 40)| ((llint)buf[8] << 48) | ((llint)buf[9] << 56); #undef llint sprintf (str, " v%i:v%i, 0x%"PFMT64x, vA, vA + 1, lB); strasm = r_str_concat (strasm, str); break; case fmtopvAAvBBvCC: vA = (int) buf[1]; vB = (int) buf[2]; vC = (int) buf[3]; sprintf (str, " v%i, v%i, v%i", vA, vB, vC); strasm = r_str_concat (strasm, str); break; case fmtopvAAvBBcCC: vA = (int) buf[1]; vB = (int) buf[2]; vC = (int) buf[3]; sprintf (str, " v%i, v%i, %#x", vA, vB, vC); strasm = r_str_concat (strasm, str); break; case fmtopvAvBcCCCC: vA = buf[1] & 0x0f; vB = (buf[1] & 0xf0) >> 4; vC = (buf[3] << 8) | buf[2]; sprintf (str, " v%i, v%i, %#x", vA, vB, vC); strasm = r_str_concat (strasm, str); break; case fmtoppAA: vA = (char) buf[1]; //sprintf (str, " %i", vA*2); // vA : word -> byte snprintf (str, sizeof (str), " 0x%08"PFMT64x, a->pc + (vA * 2)); // vA : word -> byte strasm = r_str_concat (strasm, str); break; case fmtoppAAAA: vA = (short) (buf[3] << 8 | buf[2]); snprintf (str, sizeof (str), " 0x%08"PFMT64x, a->pc + (vA * 2)); // vA : word -> byte strasm = r_str_concat (strasm, str); break; case fmtopvAApBBBB: // if-*z vA = (int) buf[1]; vB = (int) (buf[3] << 8 | buf[2]); //sprintf (str, " v%i, %i", vA, vB); snprintf (str, sizeof (str), " v%i, 0x%08"PFMT64x, vA, a->pc + (vB * 2)); strasm = r_str_concat (strasm, str); break; case fmtoppAAAAAAAA: vA = (int) (buf[2] | (buf[3] << 8) | (buf[4] << 16) | (buf[5] << 24)); //sprintf (str, " %#08x", vA*2); // vA: word -> byte snprintf (str, sizeof (str), " 0x%08"PFMT64x, a->pc + (vA*2)); // vA : word -> byte strasm = r_str_concat (strasm, str); break; case fmtopvAvBpCCCC: // if-* vA = buf[1] & 0x0f; vB = (buf[1] & 0xf0) >> 4; vC = (int) (buf[3] << 8 | buf[2]); //sprintf (str, " v%i, v%i, %i", vA, vB, vC); snprintf (str, sizeof (str)," v%i, v%i, 0x%08"PFMT64x, vA, vB, a->pc + (vC * 2)); strasm = r_str_concat (strasm, str); break; case fmtopvAApBBBBBBBB: vA = (int) buf[1]; vB = (int) (buf[2] | (buf[3] << 8) | (buf[4] << 16) | (buf[5] << 24)); snprintf (str, sizeof (str), " v%i, 0x%08"PFMT64x, vA, a->pc + vB); // + (vB*2)); strasm = r_str_concat (strasm, str); break; case fmtoptinlineI: vA = (int) (buf[1] & 0x0f); vB = (buf[3] << 8) | buf[2]; *str = 0; switch (vA) { case 1: sprintf (str, " {v%i}", buf[4] & 0x0f); break; case 2: sprintf (str, " {v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4); break; case 3: sprintf (str, " {v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f); break; case 4: sprintf (str, " {v%i, v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f, (buf[5] & 0xf0) >> 4); break; default: sprintf (str, " {}"); } strasm = r_str_concat (strasm, str); sprintf (str, ", [%04x]", vB); strasm = r_str_concat (strasm, str); break; case fmtoptinlineIR: case fmtoptinvokeVSR: vA = (int) buf[1]; vB = (buf[3] << 8) | buf[2]; vC = (buf[5] << 8) | buf[4]; sprintf (str, " {v%i..v%i}, [%04x]", vC, vC + vA - 1, vB); strasm = r_str_concat (strasm, str); break; case fmtoptinvokeVS: vA = (int) (buf[1] & 0xf0) >> 4; vB = (buf[3] << 8) | buf[2]; switch (vA) { case 1: sprintf (str, " {v%i}", buf[4] & 0x0f); break; case 2: sprintf (str, " {v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4); break; case 3: sprintf (str, " {v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f); break; case 4: sprintf (str, " {v%i, v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f, (buf[5] & 0xf0) >> 4); break; default: sprintf (str, " {}"); break; } strasm = r_str_concat (strasm, str); sprintf (str, ", [%04x]", vB); strasm = r_str_concat (strasm, str); break; case fmtopvAAtBBBB: // "sput-*" vA = (int) buf[1]; vB = (buf[3] << 8) | buf[2]; if (buf[0] == 0x1a) { offset = R_ASM_GET_OFFSET (a, 's', vB); if (offset == -1) { sprintf (str, " v%i, string+%i", vA, vB); } else { sprintf (str, " v%i, 0x%"PFMT64x, vA, offset); } } else if (buf[0] == 0x1c || buf[0] == 0x1f || buf[0] == 0x22) { flag_str = R_ASM_GET_NAME (a, 'c', vB); if (!flag_str) { sprintf (str, " v%i, class+%i", vA, vB); } else { sprintf (str, " v%i, %s", vA, flag_str); } } else { flag_str = R_ASM_GET_NAME (a, 'f', vB); if (!flag_str) { sprintf (str, " v%i, field+%i", vA, vB); } else { sprintf (str, " v%i, %s", vA, flag_str); } } strasm = r_str_concat (strasm, str); break; case fmtoptopvAvBoCCCC: vA = (buf[1] & 0x0f); vB = (buf[1] & 0xf0) >> 4; vC = (buf[3]<<8) | buf[2]; offset = R_ASM_GET_OFFSET (a, 'o', vC); if (offset == -1) { sprintf (str, " v%i, v%i, [obj+%04x]", vA, vB, vC); } else { sprintf (str, " v%i, v%i, [0x%"PFMT64x"]", vA, vB, offset); } strasm = r_str_concat (strasm, str); break; case fmtopAAtBBBB: vA = (int) buf[1]; vB = (buf[3] << 8) | buf[2]; offset = R_ASM_GET_OFFSET (a, 't', vB); if (offset == -1) { sprintf (str, " v%i, thing+%i", vA, vB); } else { sprintf (str, " v%i, 0x%"PFMT64x, vA, offset); } strasm = r_str_concat (strasm, str); break; case fmtopvAvBtCCCC: vA = (buf[1] & 0x0f); vB = (buf[1] & 0xf0) >> 4; vC = (buf[3] << 8) | buf[2]; if (buf[0] == 0x20 || buf[0] == 0x23) { //instance-of & new-array flag_str = R_ASM_GET_NAME (a, 'c', vC); if (flag_str) { sprintf (str, " v%i, v%i, %s", vA, vB, flag_str); } else { sprintf (str, " v%i, v%i, class+%i", vA, vB, vC); } } else { flag_str = R_ASM_GET_NAME (a, 'f', vC); if (flag_str) { sprintf (str, " v%i, v%i, %s", vA, vB, flag_str); } else { sprintf (str, " v%i, v%i, field+%i", vA, vB, vC); } } strasm = r_str_concat (strasm, str); break; case fmtopvAAtBBBBBBBB: vA = (int) buf[1]; vB = (int) (buf[5] | (buf[4] << 8) | (buf[3] << 16) | (buf[2] << 24)); offset = R_ASM_GET_OFFSET (a, 's', vB); if (offset == -1) { sprintf (str, " v%i, string+%i", vA, vB); } else { sprintf (str, " v%i, 0x%"PFMT64x, vA, offset); } strasm = r_str_concat (strasm, str); break; case fmtopvCCCCmBBBB: vA = (int) buf[1]; vB = (buf[3] << 8) | buf[2]; vC = (buf[5] << 8) | buf[4]; if (buf[0] == 0x25) { // filled-new-array/range flag_str = R_ASM_GET_NAME (a, 'c', vB); if (flag_str) { sprintf (str, " {v%i..v%i}, %s", vC, vC + vA - 1, flag_str); } else { sprintf (str, " {v%i..v%i}, class+%i", vC, vC + vA - 1, vB); } } else { flag_str = R_ASM_GET_NAME (a, 'm', vB); if (flag_str) { sprintf (str, " {v%i..v%i}, %s", vC, vC + vA - 1, flag_str); } else { sprintf (str, " {v%i..v%i}, method+%i", vC, vC + vA - 1, vB); } } strasm = r_str_concat (strasm, str); break; case fmtopvXtBBBB: vA = (int) (buf[1] & 0xf0) >> 4; vB = (buf[3] << 8) | buf[2]; switch (vA) { case 1: sprintf (str, " {v%i}", buf[4] & 0x0f); break; case 2: sprintf (str, " {v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4); break; case 3: sprintf (str, " {v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f); break; case 4: sprintf (str, " {v%i, v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f, (buf[5] & 0xf0) >> 4); break; case 5: sprintf (str, " {v%i, v%i, v%i, v%i, v%i}", buf[4] & 0x0f, (buf[4] & 0xf0) >> 4, buf[5] & 0x0f, (buf[5] & 0xf0) >> 4, buf[1] & 0x0f); // TOODO: recheck this break; default: sprintf (str, " {}"); } strasm = r_str_concat (strasm, str); if (buf[0] == 0x24) { // filled-new-array flag_str = R_ASM_GET_NAME (a, 'c', vB); if (flag_str) { sprintf (str, ", %s ; 0x%x", flag_str, vB); } else { sprintf (str, ", class+%i", vB); } } else { flag_str = R_ASM_GET_NAME (a, 'm', vB); if (flag_str) { sprintf (str, ", %s ; 0x%x", flag_str, vB); } else { sprintf (str, ", method+%i", vB); } } strasm = r_str_concat (strasm, str); break; case fmtoptinvokeI: // Any opcode has this formats case fmtoptinvokeIR: case fmt00: default: strcpy (op->buf_asm, "invalid "); free (strasm); strasm = NULL; size = 2; } if (strasm) { strncpy (op->buf_asm, strasm, sizeof (op->buf_asm) - 1); op->buf_asm[sizeof (op->buf_asm) - 1] = 0; } else { //op->buf_asm[0] = 0; strcpy (op->buf_asm , "invalid"); } } else if (len > 0) { strcpy (op->buf_asm, "invalid "); op->size = len; size = len; } op->payload = payload; size += payload; // XXX // align to 2 op->size = size; free (strasm); return size; }
3571
True
1
CVE-2017-7274
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7152', 'name': 'https://github.com/radare/radare2/issues/7152', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/7ab66cca5bbdf6cb2d69339ef4f513d95e532dbf', 'name': 'https://github.com/radare/radare2/commit/7ab66cca5bbdf6cb2d69339ef4f513d95e532dbf', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97181', 'name': '97181', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The r_pkcs7_parse_cms function in libr/util/r_pkcs7.c in radare2 1.3.0 allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted PE file.'}]
2017-03-31T12:31Z
2017-03-27T17:59Z
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
Giovanni
2017-03-27 12:55:16+02:00
Fix #7152 - Null deref in cms
7ab66cca5bbdf6cb2d69339ef4f513d95e532dbf
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_pkcs7_parse_cms
r_pkcs7_parse_cms( const ut8 * buffer , ut32 length)
['buffer', 'length']
RCMS *r_pkcs7_parse_cms (const ut8 *buffer, ut32 length) { RASN1Object *object; RCMS *container; if (!buffer || !length) { return NULL; } container = R_NEW0 (RCMS); if (!container) { return NULL; } object = r_asn1_create_object (buffer, length); if (!object || object->list.length != 2 || !object->list.objects[0] || object->list.objects[1]->list.length != 1) { r_asn1_free_object (object); free (container); return NULL; } container->contentType = r_asn1_stringify_oid (object->list.objects[0]->sector, object->list.objects[0]->length); r_pkcs7_parse_signeddata (&container->signedData, object->list.objects[1]->list.objects[0]); r_asn1_free_object (object); return container; }
173
True
1
CVE-2018-19842
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/radare/radare2/issues/12239', 'name': 'https://github.com/radare/radare2/issues/12239', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/66191f780863ea8c66ace4040d0d04a8842e8432', 'name': 'https://github.com/radare/radare2/commit/66191f780863ea8c66ace4040d0d04a8842e8432', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.1.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'getToken in libr/asm/p/asm_x86_nz.c in radare2 before 3.1.0 allows attackers to cause a denial of service (stack-based buffer over-read) via crafted x86 assembly data, as demonstrated by rasm2.'}]
2018-12-31T14:22Z
2018-12-04T09: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
radare
2018-11-21 17:50:58+01:00
Fix #12239 - crash in the x86.nz assembler ##asm (#12252)
66191f780863ea8c66ace4040d0d04a8842e8432
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
getToken
getToken( const char * str , size_t * begin , size_t * end)
['str', 'begin', 'end']
static x86newTokenType getToken(const char *str, size_t *begin, size_t *end) { // Skip whitespace while (begin && isspace ((ut8)str[*begin])) { ++(*begin); } if (!str[*begin]) { // null byte *end = *begin; return TT_EOF; } else if (isalpha ((ut8)str[*begin])) { // word token *end = *begin; while (end && isalnum ((ut8)str[*end])) { ++(*end); } return TT_WORD; } else if (isdigit ((ut8)str[*begin])) { // number token *end = *begin; while (end && isalnum ((ut8)str[*end])) { // accept alphanumeric characters, because hex. ++(*end); } return TT_NUMBER; } else { // special character: [, ], +, *, ... *end = *begin + 1; return TT_SPECIAL; } }
175
True
1
CVE-2018-19843
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/radare/radare2/issues/12242', 'name': 'https://github.com/radare/radare2/issues/12242', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/f17bfd9f1da05f30f23a4dd05e9d2363e1406948', 'name': 'https://github.com/radare/radare2/commit/f17bfd9f1da05f30f23a4dd05e9d2363e1406948', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'opmov in libr/asm/p/asm_x86_nz.c in radare2 before 3.1.0 allows attackers to cause a denial of service (buffer over-read) via crafted x86 assembly data, as demonstrated by rasm2.'}]
2018-12-31T14:21Z
2018-12-04T09: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
radare
2018-11-22 10:48:39+01:00
Fix #12242 - Crash in x86.nz assembler (#12266)
f17bfd9f1da05f30f23a4dd05e9d2363e1406948
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
opmov
opmov( RAsm * a , ut8 * data , const Opcode * op)
['a', 'data', 'op']
static int opmov(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; st64 offset = 0; int mod = 0; int base = 0; int rex = 0; ut64 immediate = 0; if (op->operands[1].type & OT_CONSTANT) { if (!op->operands[1].is_good_flag) { return -1; } if (op->operands[1].immediate == -1) { return -1; } immediate = op->operands[1].immediate * op->operands[1].sign; if (op->operands[0].type & OT_GPREG && !(op->operands[0].type & OT_MEMORY)) { if (a->bits == 64 && ((op->operands[0].type & OT_QWORD) | (op->operands[1].type & OT_QWORD))) { if (!(op->operands[1].type & OT_CONSTANT) && op->operands[1].extended) { data[l++] = 0x49; } else { data[l++] = 0x48; } } else if (op->operands[0].extended) { data[l++] = 0x41; } if (op->operands[0].type & OT_WORD) { if (a->bits > 16) { data[l++] = 0x66; } } if (op->operands[0].type & OT_BYTE) { data[l++] = 0xb0 | op->operands[0].reg; data[l++] = immediate; } else { if (a->bits == 64 && ((op->operands[0].type & OT_QWORD) | (op->operands[1].type & OT_QWORD)) && immediate < UT32_MAX) { data[l++] = 0xc7; data[l++] = 0xc0 | op->operands[0].reg; } else { data[l++] = 0xb8 | op->operands[0].reg; } data[l++] = immediate; data[l++] = immediate >> 8; if (!(op->operands[0].type & OT_WORD)) { data[l++] = immediate >> 16; data[l++] = immediate >> 24; } if (a->bits == 64 && immediate > UT32_MAX) { data[l++] = immediate >> 32; data[l++] = immediate >> 40; data[l++] = immediate >> 48; data[l++] = immediate >> 56; } } } else if (op->operands[0].type & OT_MEMORY) { if (!op->operands[0].explicit_size) { if (op->operands[0].type & OT_GPREG) { ((Opcode *)op)->operands[0].dest_size = op->operands[0].reg_size; } else { return -1; } } int dest_bits = 8 * ((op->operands[0].dest_size & ALL_SIZE) >> OPSIZE_SHIFT); int reg_bits = 8 * ((op->operands[0].reg_size & ALL_SIZE) >> OPSIZE_SHIFT); int offset = op->operands[0].offset * op->operands[0].offset_sign; //addr_size_override prefix bool use_aso = false; if (reg_bits < a->bits) { use_aso = true; } //op_size_override prefix bool use_oso = false; if (dest_bits == 16) { use_oso = true; } bool rip_rel = op->operands[0].regs[0] == X86R_RIP; //rex prefix int rex = 1 << 6; bool use_rex = false; if (dest_bits == 64) { //W field use_rex = true; rex |= 1 << 3; } if (op->operands[0].extended) { //B field use_rex = true; rex |= 1; } //opcode selection int opcode; if (dest_bits == 8) { opcode = 0xc6; } else { opcode = 0xc7; } //modrm and SIB selection int modrm = 0; int mod; int reg = 0; int rm; bool use_sib = false; int sib; //mod if (offset == 0) { mod = 0; } else if (offset < 128 && offset > -129) { mod = 1; } else { mod = 2; } if (reg_bits == 16) { if (op->operands[0].regs[0] == X86R_BX && op->operands[0].regs[1] == X86R_SI) { rm = B0000; } else if (op->operands[0].regs[0] == X86R_BX && op->operands[0].regs[1] == X86R_DI) { rm = B0001; } else if (op->operands[0].regs[0] == X86R_BP && op->operands[0].regs[1] == X86R_SI) { rm = B0010; } else if (op->operands[0].regs[0] == X86R_BP && op->operands[0].regs[1] == X86R_DI) { rm = B0011; } else if (op->operands[0].regs[0] == X86R_SI && op->operands[0].regs[1] == -1) { rm = B0100; } else if (op->operands[0].regs[0] == X86R_DI && op->operands[0].regs[1] == -1) { rm = B0101; } else if (op->operands[0].regs[0] == X86R_BX && op->operands[0].regs[1] == -1) { rm = B0111; } else { //TODO allow for displacement only when parser is reworked return -1; } modrm = (mod << 6) | (reg << 3) | rm; } else { //rm if (op->operands[0].extended) { rm = op->operands[0].reg; } else { rm = op->operands[0].regs[0]; } //[epb] alone is illegal, so we need to fake a [ebp+0] if (rm == 5 && mod == 0) { mod = 1; } //sib int index = op->operands[0].regs[1]; int scale = getsib(op->operands[0].scale[1]); if (index != -1) { use_sib = true; sib = (scale << 6) | (index << 3) | rm; } else if (rm == 4) { use_sib = true; sib = 0x24; } if (use_sib) { rm = B0100; } if (rip_rel) { modrm = (B0000 << 6) | (reg << 3) | B0101; sib = (scale << 6) | (B0100 << 3) | B0101; } else { modrm = (mod << 6) | (reg << 3) | rm; } } //build the final result if (use_aso) { data[l++] = 0x67; } if (use_oso) { data[l++] = 0x66; } if (use_rex) { data[l++] = rex; } data[l++] = opcode; data[l++] = modrm; if (use_sib) { data[l++] = sib; } //offset if (mod == 1) { data[l++] = offset; } else if (reg_bits == 16 && mod == 2) { data[l++] = offset; data[l++] = offset >> 8; } else if (mod == 2 || rip_rel) { data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } //immediate int byte; for (byte = 0; byte < dest_bits && byte < 32; byte += 8) { data[l++] = (immediate >> byte); } } } else if (op->operands[1].type & OT_REGALL && !(op->operands[1].type & OT_MEMORY)) { if (op->operands[0].type & OT_CONSTANT) { return -1; } if (op->operands[0].type & OT_REGTYPE & OT_SEGMENTREG && op->operands[1].type & OT_REGTYPE & OT_SEGMENTREG) { return -1; } // Check reg sizes match if (op->operands[0].type & OT_REGTYPE && op->operands[1].type & OT_REGTYPE) { if (!((op->operands[0].type & ALL_SIZE) & (op->operands[1].type & ALL_SIZE))) { return -1; } } if (a->bits == 64) { if (op->operands[0].extended) { rex = 1; } if (op->operands[1].extended) { rex += 4; } if (op->operands[1].type & OT_QWORD) { if (!(op->operands[0].type & OT_QWORD)) { data[l++] = 0x67; data[l++] = 0x48; } } if (op->operands[1].type & OT_QWORD && op->operands[0].type & OT_QWORD) { data[l++] = 0x48 | rex; } if (op->operands[1].type & OT_DWORD && op->operands[0].type & OT_DWORD) { data[l++] = 0x40 | rex; } } else if (op->operands[0].extended && op->operands[1].extended) { data[l++] = 0x45; } offset = op->operands[0].offset * op->operands[0].offset_sign; if (op->operands[1].type & OT_REGTYPE & OT_SEGMENTREG) { data[l++] = 0x8c; } else { if (op->operands[0].type & OT_WORD) { data[l++] = 0x66; } data[l++] = (op->operands[0].type & OT_BYTE) ? 0x88 : 0x89; } if (op->operands[0].scale[0] > 1) { data[l++] = op->operands[1].reg << 3 | 4; data[l++] = getsib (op->operands[0].scale[0]) << 6 | op->operands[0].regs[0] << 3 | 5; data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; return l; } if (!(op->operands[0].type & OT_MEMORY)) { if (op->operands[0].reg == X86R_UNDEFINED || op->operands[1].reg == X86R_UNDEFINED) { return -1; } mod = 0x3; data[l++] = mod << 6 | op->operands[1].reg << 3 | op->operands[0].reg; } else if (op->operands[0].regs[0] == X86R_UNDEFINED) { data[l++] = op->operands[1].reg << 3 | 0x5; data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } else { if (op->operands[0].type & OT_MEMORY) { if (op->operands[0].regs[1] != X86R_UNDEFINED) { data[l++] = op->operands[1].reg << 3 | 0x4; data[l++] = op->operands[0].regs[1] << 3 | op->operands[0].regs[0]; return l; } if (offset) { mod = (offset > 128 || offset < -129) ? 0x2 : 0x1; } if (op->operands[0].regs[0] == X86R_EBP) { mod = 0x2; } data[l++] = mod << 6 | op->operands[1].reg << 3 | op->operands[0].regs[0]; if (op->operands[0].regs[0] == X86R_ESP) { data[l++] = 0x24; } if (offset) { data[l++] = offset; } if (mod == 2) { // warning C4293: '>>': shift count negative or too big, undefined behavior data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } } else if (op->operands[1].type & OT_MEMORY) { if (op->operands[0].type & OT_MEMORY) { return -1; } offset = op->operands[1].offset * op->operands[1].offset_sign; if (op->operands[0].reg == X86R_EAX && op->operands[1].regs[0] == X86R_UNDEFINED) { if (a->bits == 64) { data[l++] = 0x48; } if (op->operands[0].type & OT_BYTE) { data[l++] = 0xa0; } else { data[l++] = 0xa1; } data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; if (a->bits == 64) { data[l++] = offset >> 32; data[l++] = offset >> 40; data[l++] = offset >> 48; data[l++] = offset >> 54; } return l; } if (op->operands[0].type & OT_BYTE && a->bits == 64 && op->operands[1].regs[0]) { if (op->operands[1].regs[0] >= X86R_R8 && op->operands[0].reg < 4) { data[l++] = 0x41; data[l++] = 0x8a; data[l++] = op->operands[0].reg << 3 | (op->operands[1].regs[0] - 8); return l; } return -1; } if (op->operands[1].type & OT_REGTYPE & OT_SEGMENTREG) { if (op->operands[1].scale[0] == 0) { return -1; } data[l++] = SEG_REG_PREFIXES[op->operands[1].regs[0]]; data[l++] = 0x8b; data[l++] = op->operands[0].reg << 3 | 0x5; data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; return l; } if (a->bits == 64) { if (op->operands[0].type & OT_QWORD) { if (!(op->operands[1].type & OT_QWORD)) { if (op->operands[1].regs[0] != -1) { data[l++] = 0x67; } data[l++] = 0x48; } } else if (op->operands[1].type & OT_DWORD) { data[l++] = 0x44; } else if (!(op->operands[1].type & OT_QWORD)) { data[l++] = 0x67; } if (op->operands[1].type & OT_QWORD && op->operands[0].type & OT_QWORD) { data[l++] = 0x48; } } if (op->operands[0].type & OT_WORD) { data[l++] = 0x66; data[l++] = op->operands[1].type & OT_BYTE ? 0x8a : 0x8b; } else { data[l++] = (op->operands[1].type & OT_BYTE || op->operands[0].type & OT_BYTE) ? 0x8a : 0x8b; } if (op->operands[1].regs[0] == X86R_UNDEFINED) { if (a->bits == 64) { data[l++] = op->operands[0].reg << 3 | 0x4; data[l++] = 0x25; } else { data[l++] = op->operands[0].reg << 3 | 0x5; } data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } else { if (op->operands[1].scale[0] > 1) { data[l++] = op->operands[0].reg << 3 | 4; if (op->operands[1].scale[0] >= 2) { base = 5; } if (base) { data[l++] = getsib (op->operands[1].scale[0]) << 6 | op->operands[1].regs[0] << 3 | base; } else { data[l++] = getsib (op->operands[1].scale[0]) << 3 | op->operands[1].regs[0]; } if (offset || base) { data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } return l; } if (op->operands[1].regs[1] != X86R_UNDEFINED) { data[l++] = op->operands[0].reg << 3 | 0x4; data[l++] = op->operands[1].regs[1] << 3 | op->operands[1].regs[0]; return l; } if (offset || op->operands[1].regs[0] == X86R_EBP) { mod = 0x2; if (op->operands[1].offset > 127) { mod = 0x4; } } if (a->bits == 64 && offset && op->operands[0].type & OT_QWORD) { if (op->operands[1].regs[0] == X86R_RIP) { data[l++] = 0x5; } else { if (op->operands[1].offset > 127) { data[l++] = 0x80 | op->operands[0].reg << 3 | op->operands[1].regs[0]; } else { data[l++] = 0x40 | op->operands[1].regs[0]; } } if (op->operands[1].offset > 127) { mod = 0x1; } } else { if (op->operands[1].regs[0] == X86R_EIP && (op->operands[0].type & OT_DWORD)) { data[l++] = 0x0d; } else if (op->operands[1].regs[0] == X86R_RIP && (op->operands[0].type & OT_QWORD)) { data[l++] = 0x05; } else { data[l++] = mod << 5 | op->operands[0].reg << 3 | op->operands[1].regs[0]; } } if (op->operands[1].regs[0] == X86R_ESP) { data[l++] = 0x24; } if (mod >= 0x2) { data[l++] = offset; if (op->operands[1].offset > 128 || op->operands[1].regs[0] == X86R_EIP) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } else if (a->bits == 64 && (offset || op->operands[1].regs[0] == X86R_RIP)) { data[l++] = offset; if (op->operands[1].offset > 127 || op->operands[1].regs[0] == X86R_RIP) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } } return l; }
4193
True
1
CVE-2018-20455
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/radare/radare2/issues/12373', 'name': 'https://github.com/radare/radare2/issues/12373', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185', 'name': 'https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In radare2 prior to 3.1.1, the parseOperand function inside libr/asm/p/asm_x86_nz.c may allow attackers to cause a denial of service (application crash via a stack-based buffer overflow) by crafting an input file, a related issue to CVE-2018-20456.'}]
2020-08-24T17:37Z
2018-12-25T19: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
radare
2018-12-03 01:46:58+01:00
Fix #12372 and #12373 - Crash in x86 assembler (#12380) 0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL- leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
9b46d38dd3c4de6048a488b655c7319f845af185
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
parseOperand
parseOperand( RAsm * a , const char * str , Operand * op , bool isrepop)
['a', 'str', 'op', 'isrepop']
static int parseOperand(RAsm *a, const char *str, Operand *op, bool isrepop) { size_t pos, nextpos = 0; x86newTokenType last_type; int size_token = 1; bool explicit_size = false; int reg_index = 0; // Reset type op->type = 0; // Consume tokens denoting the operand size while (size_token) { pos = nextpos; last_type = getToken (str, &pos, &nextpos); // Token may indicate size: then skip if (!r_str_ncasecmp (str + pos, "ptr", 3)) { continue; } else if (!r_str_ncasecmp (str + pos, "byte", 4)) { op->type |= OT_MEMORY | OT_BYTE; op->dest_size = OT_BYTE; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "word", 4)) { op->type |= OT_MEMORY | OT_WORD; op->dest_size = OT_WORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "dword", 5)) { op->type |= OT_MEMORY | OT_DWORD; op->dest_size = OT_DWORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "qword", 5)) { op->type |= OT_MEMORY | OT_QWORD; op->dest_size = OT_QWORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "oword", 5)) { op->type |= OT_MEMORY | OT_OWORD; op->dest_size = OT_OWORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "tbyte", 5)) { op->type |= OT_MEMORY | OT_TBYTE; op->dest_size = OT_TBYTE; explicit_size = true; } else { // the current token doesn't denote a size size_token = 0; } } // Next token: register, immediate, or '[' if (str[pos] == '[') { // Don't care about size, if none is given. if (!op->type) { op->type = OT_MEMORY; } // At the moment, we only accept plain linear combinations: // part := address | [factor *] register // address := part {+ part}* op->offset = op->scale[0] = op->scale[1] = 0; ut64 temp = 1; Register reg = X86R_UNDEFINED; bool first_reg = true; while (str[pos] != ']') { if (pos > nextpos) { // eprintf ("Error parsing instruction\n"); break; } pos = nextpos; if (!str[pos]) { break; } last_type = getToken (str, &pos, &nextpos); if (last_type == TT_SPECIAL) { if (str[pos] == '+' || str[pos] == '-' || str[pos] == ']') { if (reg != X86R_UNDEFINED) { op->regs[reg_index] = reg; op->scale[reg_index] = temp; ++reg_index; } else { op->offset += temp; op->regs[reg_index] = X86R_UNDEFINED; } temp = 1; reg = X86R_UNDEFINED; } else if (str[pos] == '*') { // go to ], + or - to get scale // Something to do here? // Seems we are just ignoring '*' or assuming it implicitly. } } else if (last_type == TT_WORD) { ut32 reg_type = 0; // We can't multiply registers if (reg != X86R_UNDEFINED) { op->type = 0; // Make the result invalid } // Reset nextpos: parseReg wants to parse from the beginning nextpos = pos; reg = parseReg (a, str, &nextpos, &reg_type); if (first_reg) { op->extended = false; if (reg > 8) { op->extended = true; op->reg = reg - 9; } first_reg = false; } else if (reg > 8) { op->reg = reg - 9; } if (reg_type & OT_REGTYPE & OT_SEGMENTREG) { op->reg = reg; op->type = reg_type; parse_segment_offset (a, str, &nextpos, op, reg_index); return nextpos; } // Still going to need to know the size if not specified if (!explicit_size) { op->type |= reg_type; } op->reg_size = reg_type; op->explicit_size = explicit_size; // Addressing only via general purpose registers if (!(reg_type & OT_GPREG)) { op->type = 0; // Make the result invalid } } else { char *p = strchr (str, '+'); op->offset_sign = 1; if (!p) { p = strchr (str, '-'); if (p) { op->offset_sign = -1; } } //with SIB notation, we need to consider the right sign char * plus = strchr (str, '+'); char * minus = strchr (str, '-'); char * closeB = strchr (str, ']'); if (plus && minus && plus < closeB && minus < closeB) { op->offset_sign = -1; } // If there's a scale, we don't want to parse out the // scale with the offset (scale + offset) otherwise the scale // will be the sum of the two. This splits the numbers char *tmp; tmp = malloc (strlen (str + pos) + 1); strcpy (tmp, str + pos); strtok (tmp, "+-"); st64 read = getnum (a, tmp); free (tmp); temp *= read; } } } else if (last_type == TT_WORD) { // register nextpos = pos; RFlagItem *flag; if (isrepop) { op->is_good_flag = false; strncpy (op->rep_op, str, MAX_REPOP_LENGTH - 1); op->rep_op[MAX_REPOP_LENGTH - 1] = '\0'; return nextpos; } op->reg = parseReg (a, str, &nextpos, &op->type); op->extended = false; if (op->reg > 8) { op->extended = true; op->reg -= 9; } if (op->type & OT_REGTYPE & OT_SEGMENTREG) { parse_segment_offset (a, str, &nextpos, op, reg_index); return nextpos; } if (op->reg == X86R_UNDEFINED) { op->is_good_flag = false; if (a->num && a->num->value == 0) { return nextpos; } op->type = OT_CONSTANT; RCore *core = a->num? (RCore *)(a->num->userptr): NULL; if (core && (flag = r_flag_get (core->flags, str))) { op->is_good_flag = true; } char *p = strchr (str, '-'); if (p) { op->sign = -1; str = ++p; } op->immediate = getnum (a, str); } else if (op->reg < X86R_UNDEFINED) { strncpy (op->rep_op, str, MAX_REPOP_LENGTH - 1); op->rep_op[MAX_REPOP_LENGTH - 1] = '\0'; } } else { // immediate // We don't know the size, so let's just set no size flag. op->type = OT_CONSTANT; op->sign = 1; char *p = strchr (str, '-'); if (p) { op->sign = -1; str = ++p; } op->immediate = getnum (a, str); } return nextpos; }
1215
True
1
CVE-2018-20456
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://github.com/radare/radare2/issues/12372', 'name': 'https://github.com/radare/radare2/issues/12372', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185', 'name': 'https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.1.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In radare2 prior to 3.1.1, the parseOperand function inside libr/asm/p/asm_x86_nz.c may allow attackers to cause a denial of service (application crash in libr/util/strbuf.c via a stack-based buffer over-read) by crafting an input file, a related issue to CVE-2018-20455.'}]
2018-12-31T14:15Z
2018-12-25T19: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
radare
2018-12-03 01:46:58+01:00
Fix #12372 and #12373 - Crash in x86 assembler (#12380) 0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL- leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
9b46d38dd3c4de6048a488b655c7319f845af185
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
parseOperand
parseOperand( RAsm * a , const char * str , Operand * op , bool isrepop)
['a', 'str', 'op', 'isrepop']
static int parseOperand(RAsm *a, const char *str, Operand *op, bool isrepop) { size_t pos, nextpos = 0; x86newTokenType last_type; int size_token = 1; bool explicit_size = false; int reg_index = 0; // Reset type op->type = 0; // Consume tokens denoting the operand size while (size_token) { pos = nextpos; last_type = getToken (str, &pos, &nextpos); // Token may indicate size: then skip if (!r_str_ncasecmp (str + pos, "ptr", 3)) { continue; } else if (!r_str_ncasecmp (str + pos, "byte", 4)) { op->type |= OT_MEMORY | OT_BYTE; op->dest_size = OT_BYTE; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "word", 4)) { op->type |= OT_MEMORY | OT_WORD; op->dest_size = OT_WORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "dword", 5)) { op->type |= OT_MEMORY | OT_DWORD; op->dest_size = OT_DWORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "qword", 5)) { op->type |= OT_MEMORY | OT_QWORD; op->dest_size = OT_QWORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "oword", 5)) { op->type |= OT_MEMORY | OT_OWORD; op->dest_size = OT_OWORD; explicit_size = true; } else if (!r_str_ncasecmp (str + pos, "tbyte", 5)) { op->type |= OT_MEMORY | OT_TBYTE; op->dest_size = OT_TBYTE; explicit_size = true; } else { // the current token doesn't denote a size size_token = 0; } } // Next token: register, immediate, or '[' if (str[pos] == '[') { // Don't care about size, if none is given. if (!op->type) { op->type = OT_MEMORY; } // At the moment, we only accept plain linear combinations: // part := address | [factor *] register // address := part {+ part}* op->offset = op->scale[0] = op->scale[1] = 0; ut64 temp = 1; Register reg = X86R_UNDEFINED; bool first_reg = true; while (str[pos] != ']') { if (pos > nextpos) { // eprintf ("Error parsing instruction\n"); break; } pos = nextpos; if (!str[pos]) { break; } last_type = getToken (str, &pos, &nextpos); if (last_type == TT_SPECIAL) { if (str[pos] == '+' || str[pos] == '-' || str[pos] == ']') { if (reg != X86R_UNDEFINED) { op->regs[reg_index] = reg; op->scale[reg_index] = temp; ++reg_index; } else { op->offset += temp; op->regs[reg_index] = X86R_UNDEFINED; } temp = 1; reg = X86R_UNDEFINED; } else if (str[pos] == '*') { // go to ], + or - to get scale // Something to do here? // Seems we are just ignoring '*' or assuming it implicitly. } } else if (last_type == TT_WORD) { ut32 reg_type = 0; // We can't multiply registers if (reg != X86R_UNDEFINED) { op->type = 0; // Make the result invalid } // Reset nextpos: parseReg wants to parse from the beginning nextpos = pos; reg = parseReg (a, str, &nextpos, &reg_type); if (first_reg) { op->extended = false; if (reg > 8) { op->extended = true; op->reg = reg - 9; } first_reg = false; } else if (reg > 8) { op->reg = reg - 9; } if (reg_type & OT_REGTYPE & OT_SEGMENTREG) { op->reg = reg; op->type = reg_type; parse_segment_offset (a, str, &nextpos, op, reg_index); return nextpos; } // Still going to need to know the size if not specified if (!explicit_size) { op->type |= reg_type; } op->reg_size = reg_type; op->explicit_size = explicit_size; // Addressing only via general purpose registers if (!(reg_type & OT_GPREG)) { op->type = 0; // Make the result invalid } } else { char *p = strchr (str, '+'); op->offset_sign = 1; if (!p) { p = strchr (str, '-'); if (p) { op->offset_sign = -1; } } //with SIB notation, we need to consider the right sign char * plus = strchr (str, '+'); char * minus = strchr (str, '-'); char * closeB = strchr (str, ']'); if (plus && minus && plus < closeB && minus < closeB) { op->offset_sign = -1; } // If there's a scale, we don't want to parse out the // scale with the offset (scale + offset) otherwise the scale // will be the sum of the two. This splits the numbers char *tmp; tmp = malloc (strlen (str + pos) + 1); strcpy (tmp, str + pos); strtok (tmp, "+-"); st64 read = getnum (a, tmp); free (tmp); temp *= read; } } } else if (last_type == TT_WORD) { // register nextpos = pos; RFlagItem *flag; if (isrepop) { op->is_good_flag = false; strncpy (op->rep_op, str, MAX_REPOP_LENGTH - 1); op->rep_op[MAX_REPOP_LENGTH - 1] = '\0'; return nextpos; } op->reg = parseReg (a, str, &nextpos, &op->type); op->extended = false; if (op->reg > 8) { op->extended = true; op->reg -= 9; } if (op->type & OT_REGTYPE & OT_SEGMENTREG) { parse_segment_offset (a, str, &nextpos, op, reg_index); return nextpos; } if (op->reg == X86R_UNDEFINED) { op->is_good_flag = false; if (a->num && a->num->value == 0) { return nextpos; } op->type = OT_CONSTANT; RCore *core = a->num? (RCore *)(a->num->userptr): NULL; if (core && (flag = r_flag_get (core->flags, str))) { op->is_good_flag = true; } char *p = strchr (str, '-'); if (p) { op->sign = -1; str = ++p; } op->immediate = getnum (a, str); } else if (op->reg < X86R_UNDEFINED) { strncpy (op->rep_op, str, MAX_REPOP_LENGTH - 1); op->rep_op[MAX_REPOP_LENGTH - 1] = '\0'; } } else { // immediate // We don't know the size, so let's just set no size flag. op->type = OT_CONSTANT; op->sign = 1; char *p = strchr (str, '-'); if (p) { op->sign = -1; str = ++p; } op->immediate = getnum (a, str); } return nextpos; }
1215
True
1
CVE-2017-7854
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7265', 'name': 'https://github.com/radare/radare2/issues/7265', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'name': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97648', 'name': '97648', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The consume_init_expr function in wasm.c in radare2 1.3.0 allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash) via a crafted Web Assembly file.'}]
2019-10-03T00:03Z
2017-04-13T16: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
pancake
2017-04-13 15:31:24+02:00
Fix crash in fuzzed wasm r2_hoobr_consume_init_expr
d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
consume_init_expr
consume_init_expr( ut8 * buf , ut8 * max , ut8 eoc , void * out , ut32 * offset)
['buf', 'max', 'eoc', 'out', 'offset']
static size_t consume_init_expr (ut8 *buf, ut8 *max, ut8 eoc, void *out, ut32 *offset) { ut32 i = 0; while (buf + i < max && buf[i] != eoc) { // TODO: calc the expresion with the bytcode (ESIL?) i += 1; } if (buf[i] != eoc) { return 0; } if (offset) { *offset += i + 1; } return i + 1; }
81
True
1
CVE-2017-7854
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7265', 'name': 'https://github.com/radare/radare2/issues/7265', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'name': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97648', 'name': '97648', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The consume_init_expr function in wasm.c in radare2 1.3.0 allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash) via a crafted Web Assembly file.'}]
2019-10-03T00:03Z
2017-04-13T16: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
pancake
2017-04-13 15:31:24+02:00
Fix crash in fuzzed wasm r2_hoobr_consume_init_expr
d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_bin_wasm_get_data_entries
r_bin_wasm_get_data_entries( RBinWasmObj * bin , RBinWasmSection * sec)
['bin', 'sec']
static RList *r_bin_wasm_get_data_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmDataEntry *ptr = NULL; if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->buf + (ut32)sec->payload_data; ut32 len = sec->payload_len; ut32 count = sec->count; ut32 i = 0, r = 0; size_t n = 0; while (i < len && r < count) { if (!(ptr = R_NEW0 (RBinWasmDataEntry))) { return ret; } if (!(consume_u32 (buf + i, buf + len, &ptr->index, &i))) { free (ptr); return ret; } if (!(n = consume_init_expr (buf + i, buf + len, R_BIN_WASM_END_OF_CODE, NULL, &i))) { free (ptr); return ret; } ptr->offset.len = n; if (!(consume_u32 (buf + i, buf + len, &ptr->size, &i))) { free (ptr); return ret; } ptr->data = sec->payload_data + i; r_list_append (ret, ptr); r += 1; } return ret; }
253
True
1
CVE-2017-7854
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7265', 'name': 'https://github.com/radare/radare2/issues/7265', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'name': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97648', 'name': '97648', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The consume_init_expr function in wasm.c in radare2 1.3.0 allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash) via a crafted Web Assembly file.'}]
2019-10-03T00:03Z
2017-04-13T16: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
pancake
2017-04-13 15:31:24+02:00
Fix crash in fuzzed wasm r2_hoobr_consume_init_expr
d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_bin_wasm_get_element_entries
r_bin_wasm_get_element_entries( RBinWasmObj * bin , RBinWasmSection * sec)
['bin', 'sec']
static RList *r_bin_wasm_get_element_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmElementEntry *ptr = NULL; if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->buf + (ut32)sec->payload_data; ut32 len = sec->payload_len; ut32 count = sec->count; ut32 i = 0, r = 0; while (i < len && r < count) { if (!(ptr = R_NEW0 (RBinWasmElementEntry))) { return ret; } if (!(consume_u32 (buf + i, buf + len, &ptr->index, &i))) { free (ptr); return ret; } if (!(consume_init_expr (buf + i, buf + len, R_BIN_WASM_END_OF_CODE, NULL, &i))) { free (ptr); return ret; } if (!(consume_u32 (buf + i, buf + len, &ptr->num_elem, &i))) { free (ptr); return ret; } ut32 j = 0; while (i < len && j < ptr->num_elem ) { // TODO: allocate space and fill entry ut32 e; if (!(consume_u32 (buf + i, buf + len, &e, &i))) { free (ptr); return ret; } } r_list_append (ret, ptr); r += 1; } return ret; }
282
True
1
CVE-2017-7854
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7265', 'name': 'https://github.com/radare/radare2/issues/7265', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'name': 'https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/97648', 'name': '97648', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The consume_init_expr function in wasm.c in radare2 1.3.0 allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash) via a crafted Web Assembly file.'}]
2019-10-03T00:03Z
2017-04-13T16: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
pancake
2017-04-13 15:31:24+02:00
Fix crash in fuzzed wasm r2_hoobr_consume_init_expr
d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_bin_wasm_get_global_entries
r_bin_wasm_get_global_entries( RBinWasmObj * bin , RBinWasmSection * sec)
['bin', 'sec']
static RList *r_bin_wasm_get_global_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmGlobalEntry *ptr = NULL; int buflen = bin->buf->length; if (sec->payload_data + 32 > buflen) { return NULL; } if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->buf + (ut32)sec->payload_data; ut32 len = sec->payload_len; ut32 count = sec->count; ut32 i = 0, r = 0; while (i < len && len < buflen && r < count) { if (!(ptr = R_NEW0 (RBinWasmGlobalEntry))) { return ret; } if (len + 8 > buflen || !(consume_u8 (buf + i, buf + len, (ut8*)&ptr->content_type, &i))) { goto beach; } if (len + 8 > buflen || !(consume_u8 (buf + i, buf + len, &ptr->mutability, &i))) { goto beach; } if (len + 8 > buflen || !(consume_init_expr (buf + i, buf + len, R_BIN_WASM_END_OF_CODE, NULL, &i))) { goto beach; } r_list_append (ret, ptr); r++; } return ret; beach: free (ptr); return ret; }
272
True
1
CVE-2017-7946
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7301', 'name': 'https://github.com/radare/radare2/issues/7301', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'name': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_relocs_64 function in libr/bin/format/mach0/mach0.c in radare2 1.3.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted Mach0 file.'}]
2017-04-21T15:22Z
2017-04-18T20:59Z
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
pancake
2017-04-18 13:37:33+02:00
Fix null deref and uaf in mach0 parser
d1e8ac62c6d978d4662f69116e30230d43033c92
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
MACH0_( get_baddr)
MACH0_( get_baddr)( struct MACH0_(obj_t) * bin)
['bin']
ut64 MACH0_(get_baddr)(struct MACH0_(obj_t)* bin) { int i; if (bin->hdr.filetype != MH_EXECUTE && bin->hdr.filetype != MH_DYLINKER) return 0; for (i = 0; i < bin->nsegs; ++i) if (bin->segs[i].fileoff == 0 && bin->segs[i].filesize != 0) return bin->segs[i].vmaddr; return 0; }
87
True
1
CVE-2017-7946
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7301', 'name': 'https://github.com/radare/radare2/issues/7301', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'name': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_relocs_64 function in libr/bin/format/mach0/mach0.c in radare2 1.3.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted Mach0 file.'}]
2017-04-21T15:22Z
2017-04-18T20:59Z
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
pancake
2017-04-18 13:37:33+02:00
Fix null deref and uaf in mach0 parser
d1e8ac62c6d978d4662f69116e30230d43033c92
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
MACH0_( get_entrypoint)
MACH0_( get_entrypoint)( struct MACH0_(obj_t) * bin)
['bin']
struct addr_t* MACH0_(get_entrypoint)(struct MACH0_(obj_t)* bin) { struct addr_t *entry; int i; if (!bin->entry && !bin->sects) { return NULL; } if (!(entry = calloc (1, sizeof (struct addr_t)))) { return NULL; } if (bin->entry) { entry->addr = entry_to_vaddr (bin); entry->offset = addr_to_offset (bin, entry->addr); entry->haddr = sdb_num_get (bin->kv, "mach0.entry.offset", 0); } if (!bin->entry || entry->offset == 0) { // XXX: section name doesnt matters at all.. just check for exec flags for (i = 0; i < bin->nsects; i++) { if (!strncmp (bin->sects[i].sectname, "__text", 6)) { entry->offset = (ut64)bin->sects[i].offset; sdb_num_set (bin->kv, "mach0.entry", entry->offset, 0); entry->addr = (ut64)bin->sects[i].addr; if (!entry->addr) { // workaround for object files entry->addr = entry->offset; } break; } } bin->entry = entry->addr; } return entry; }
234
True
1
CVE-2017-7946
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7301', 'name': 'https://github.com/radare/radare2/issues/7301', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'name': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_relocs_64 function in libr/bin/format/mach0/mach0.c in radare2 1.3.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted Mach0 file.'}]
2017-04-21T15:22Z
2017-04-18T20:59Z
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
pancake
2017-04-18 13:37:33+02:00
Fix null deref and uaf in mach0 parser
d1e8ac62c6d978d4662f69116e30230d43033c92
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
MACH0_( get_libs)
MACH0_( get_libs)( struct MACH0_(obj_t) * bin)
['bin']
struct lib_t* MACH0_(get_libs)(struct MACH0_(obj_t)* bin) { struct lib_t *libs; int i; if (!bin->nlibs) return NULL; if (!(libs = calloc ((bin->nlibs + 1), sizeof(struct lib_t)))) return NULL; for (i = 0; i < bin->nlibs; i++) { strncpy (libs[i].name, bin->libs[i], R_BIN_MACH0_STRING_LENGTH); libs[i].name[R_BIN_MACH0_STRING_LENGTH-1] = '\0'; libs[i].last = 0; } libs[i].last = 1; return libs; }
127
True
1
CVE-2017-7946
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7301', 'name': 'https://github.com/radare/radare2/issues/7301', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'name': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_relocs_64 function in libr/bin/format/mach0/mach0.c in radare2 1.3.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted Mach0 file.'}]
2017-04-21T15:22Z
2017-04-18T20:59Z
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
pancake
2017-04-18 13:37:33+02:00
Fix null deref and uaf in mach0 parser
d1e8ac62c6d978d4662f69116e30230d43033c92
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
MACH0_( get_main)
MACH0_( get_main)( struct MACH0_(obj_t) * bin)
['bin']
ut64 MACH0_(get_main)(struct MACH0_(obj_t)* bin) { ut64 addr = 0LL; struct symbol_t *symbols; int i; if (!(symbols = MACH0_(get_symbols) (bin))) { return 0; } for (i = 0; !symbols[i].last; i++) { if (!strcmp (symbols[i].name, "_main")) { addr = symbols[i].addr; break; } } free (symbols); if (!addr && bin->main_cmd.cmd == LC_MAIN) { addr = bin->entry + bin->baddr; } if (!addr) { ut8 b[128]; ut64 entry = addr_to_offset(bin, bin->entry); // XXX: X86 only and hacky! if (entry > bin->size || entry + sizeof (b) > bin->size) return 0; i = r_buf_read_at (bin->b, entry, b, sizeof (b)); if (i < 1) { return 0; } for (i = 0; i < 64; i++) { if (b[i] == 0xe8 && !b[i+3] && !b[i+4]) { int delta = b[i+1] | (b[i+2] << 8) | (b[i+3] << 16) | (b[i+4] << 24); return bin->entry + i + 5 + delta; } } } return addr; }
299
True
1
CVE-2017-7946
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7301', 'name': 'https://github.com/radare/radare2/issues/7301', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'name': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_relocs_64 function in libr/bin/format/mach0/mach0.c in radare2 1.3.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted Mach0 file.'}]
2017-04-21T15:22Z
2017-04-18T20:59Z
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
pancake
2017-04-18 13:37:33+02:00
Fix null deref and uaf in mach0 parser
d1e8ac62c6d978d4662f69116e30230d43033c92
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
MACH0_( get_relocs)
MACH0_( get_relocs)( struct MACH0_(obj_t) * bin)
['bin']
struct reloc_t* MACH0_(get_relocs)(struct MACH0_(obj_t)* bin) { struct reloc_t *relocs; int i = 0, len; ulebr ur = {NULL}; int wordsize = MACH0_(get_bits)(bin) / 8; if (bin->dyld_info) { ut8 *opcodes,*end, type = 0, rel_type = 0; int lib_ord, seg_idx = -1, sym_ord = -1; size_t j, count, skip, bind_size, lazy_size; st64 addend = 0; ut64 segmentAddress = 0LL; ut64 addr = 0LL; ut8 done = 0; #define CASE(T) case (T / 8): rel_type = R_BIN_RELOC_ ## T; break switch (wordsize) { CASE(8); CASE(16); CASE(32); CASE(64); default: return NULL; } #undef CASE bind_size = bin->dyld_info->bind_size; lazy_size = bin->dyld_info->lazy_bind_size; if (!bind_size || !lazy_size) { return NULL; } if ((bind_size + lazy_size)<1) { return NULL; } if (bin->dyld_info->bind_off > bin->size || bin->dyld_info->bind_off + bind_size > bin->size) return NULL; if (bin->dyld_info->lazy_bind_off > bin->size || \ bin->dyld_info->lazy_bind_off + lazy_size > bin->size) return NULL; if (bin->dyld_info->bind_off+bind_size+lazy_size > bin->size) return NULL; // NOTE(eddyb) it's a waste of memory, but we don't know the actual number of relocs. if (!(relocs = calloc (1, (1 + bind_size + lazy_size) * sizeof (struct reloc_t)))) return NULL; opcodes = calloc (1, bind_size + lazy_size + 1); if (!opcodes) { free (relocs); return NULL; } len = r_buf_read_at (bin->b, bin->dyld_info->bind_off, opcodes, bind_size); i = r_buf_read_at (bin->b, bin->dyld_info->lazy_bind_off, opcodes + bind_size, lazy_size); if (len < 1 || i < 1) { bprintf ("Error: read (dyld_info bind) at 0x%08"PFMT64x"\n", (ut64)(size_t)bin->dyld_info->bind_off); free (opcodes); relocs[i].last = 1; return relocs; } i = 0; // that +2 is a minimum required for uleb128, this may be wrong, // the correct fix would be to make ULEB() must use rutil's // implementation that already checks for buffer boundaries for (ur.p = opcodes, end = opcodes + bind_size + lazy_size ; (ur.p+2 < end) && !done; ) { ut8 imm = *ur.p & BIND_IMMEDIATE_MASK, op = *ur.p & BIND_OPCODE_MASK; ++ur.p; switch (op) { #define ULEB() read_uleb128 (&ur,end) #define SLEB() read_sleb128 (&ur,end) case BIND_OPCODE_DONE: done = 1; break; case BIND_OPCODE_SET_DYLIB_ORDINAL_IMM: lib_ord = imm; break; case BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB: lib_ord = ULEB(); break; case BIND_OPCODE_SET_DYLIB_SPECIAL_IMM: lib_ord = imm? (st8)(BIND_OPCODE_MASK | imm) : 0; break; case BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: { char *sym_name = (char*)ur.p; //ut8 sym_flags = imm; while (*ur.p++ && ur.p<end) { /* empty loop */ } sym_ord = -1; if (bin->symtab && bin->dysymtab.nundefsym < 0xffff) for (j = 0; j < bin->dysymtab.nundefsym; j++) { int stridx = 0; int iundefsym = bin->dysymtab.iundefsym; if (iundefsym>=0 && iundefsym < bin->nsymtab) { int sidx = iundefsym +j; if (sidx<0 || sidx>= bin->nsymtab) continue; stridx = bin->symtab[sidx].n_strx; if (stridx < 0 || stridx >= bin->symstrlen) continue; } if (!strcmp ((char *)bin->symstr + stridx, sym_name)) { sym_ord = j; break; } } break; } case BIND_OPCODE_SET_TYPE_IMM: type = imm; break; case BIND_OPCODE_SET_ADDEND_SLEB: addend = SLEB(); break; case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: seg_idx = imm; if (seg_idx < 0 || seg_idx >= bin->nsegs) { bprintf ("Error: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB" " has unexistent segment %d\n", seg_idx); addr = 0LL; return 0; // early exit to avoid future mayhem } else { addr = bin->segs[seg_idx].vmaddr + ULEB(); segmentAddress = bin->segs[seg_idx].vmaddr \ + bin->segs[seg_idx].vmsize; } break; case BIND_OPCODE_ADD_ADDR_ULEB: addr += ULEB(); break; #define DO_BIND() do {\ if (sym_ord < 0 || seg_idx < 0 ) break;\ if (i >= (bind_size + lazy_size)) break;\ relocs[i].addr = addr;\ relocs[i].offset = addr - bin->segs[seg_idx].vmaddr + bin->segs[seg_idx].fileoff;\ if (type == BIND_TYPE_TEXT_PCREL32)\ relocs[i].addend = addend - (bin->baddr + addr);\ else relocs[i].addend = addend;\ /* library ordinal ??? */ \ relocs[i].ord = lib_ord;\ relocs[i].ord = sym_ord;\ relocs[i].type = rel_type;\ relocs[i++].last = 0;\ } while (0) case BIND_OPCODE_DO_BIND: if (addr >= segmentAddress) { bprintf ("Error: Malformed DO bind opcode\n"); goto beach; } DO_BIND(); addr += wordsize; break; case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: if (addr >= segmentAddress) { bprintf ("Error: Malformed ADDR ULEB bind opcode\n"); goto beach; } DO_BIND(); addr += ULEB() + wordsize; break; case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: if (addr >= segmentAddress) { bprintf ("Error: Malformed IMM SCALED bind opcode\n"); goto beach; } DO_BIND(); addr += (ut64)imm * (ut64)wordsize + wordsize; break; case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: count = ULEB(); skip = ULEB(); for (j = 0; j < count; j++) { if (addr >= segmentAddress) { bprintf ("Error: Malformed ULEB TIMES bind opcode\n"); goto beach; } DO_BIND(); addr += skip + wordsize; } break; #undef DO_BIND #undef ULEB #undef SLEB default: bprintf ("Error: unknown bind opcode 0x%02x in dyld_info\n", *ur.p); free (opcodes); relocs[i].last = 1; return relocs; } } free (opcodes); } else { int j; if (!bin->symtab || !bin->symstr || !bin->sects || !bin->indirectsyms) return NULL; if (!(relocs = malloc ((bin->dysymtab.nundefsym + 1) * sizeof(struct reloc_t)))) return NULL; for (j = 0; j < bin->dysymtab.nundefsym; j++) { if (parse_import_ptr(bin, &relocs[i], bin->dysymtab.iundefsym + j)) { relocs[i].ord = j; relocs[i++].last = 0; } } } beach: relocs[i].last = 1; return relocs; }
1128
True
1
CVE-2017-7946
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7301', 'name': 'https://github.com/radare/radare2/issues/7301', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'name': 'https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The get_relocs_64 function in libr/bin/format/mach0/mach0.c in radare2 1.3.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted Mach0 file.'}]
2017-04-21T15:22Z
2017-04-18T20:59Z
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
pancake
2017-04-18 13:37:33+02:00
Fix null deref and uaf in mach0 parser
d1e8ac62c6d978d4662f69116e30230d43033c92
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
init_items
init_items( struct MACH0_(obj_t) * bin)
['bin']
static int init_items(struct MACH0_(obj_t)* bin) { struct load_command lc = {0, 0}; ut8 loadc[sizeof (struct load_command)] = {0}; bool is_first_thread = true; ut64 off = 0LL; int i, len; bin->uuidn = 0; bin->os = 0; bin->has_crypto = 0; if (bin->hdr.sizeofcmds > bin->size) { bprintf ("Warning: chopping hdr.sizeofcmds\n"); bin->hdr.sizeofcmds = bin->size - 128; //return false; } //bprintf ("Commands: %d\n", bin->hdr.ncmds); for (i = 0, off = sizeof (struct MACH0_(mach_header)); \ i < bin->hdr.ncmds; i++, off += lc.cmdsize) { if (off > bin->size || off + sizeof (struct load_command) > bin->size){ bprintf ("mach0: out of bounds command\n"); return false; } len = r_buf_read_at (bin->b, off, loadc, sizeof (struct load_command)); if (len < 1) { bprintf ("Error: read (lc) at 0x%08"PFMT64x"\n", off); return false; } lc.cmd = r_read_ble32 (&loadc[0], bin->big_endian); lc.cmdsize = r_read_ble32 (&loadc[4], bin->big_endian); if (lc.cmdsize < 1 || off + lc.cmdsize > bin->size) { bprintf ("Warning: mach0_header %d = cmdsize<1.\n", i); break; } // TODO: a different format for each cmd sdb_num_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.offset", i), off, 0); sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.format", i), "xd cmd size", 0); //bprintf ("%d\n", lc.cmd); switch (lc.cmd) { case LC_DATA_IN_CODE: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "data_in_code", 0); // TODO table of non-instructions in __text break; case LC_RPATH: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "rpath", 0); //bprintf ("--->\n"); break; case LC_SEGMENT_64: case LC_SEGMENT: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "segment", 0); bin->nsegs++; if (!parse_segments (bin, off)) { bprintf ("error parsing segment\n"); bin->nsegs--; return false; } break; case LC_SYMTAB: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "symtab", 0); if (!parse_symtab (bin, off)) { bprintf ("error parsing symtab\n"); return false; } break; case LC_DYSYMTAB: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "dysymtab", 0); if (!parse_dysymtab(bin, off)) { bprintf ("error parsing dysymtab\n"); return false; } break; case LC_DYLIB_CODE_SIGN_DRS: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "dylib_code_sign_drs", 0); //bprintf ("[mach0] code is signed\n"); break; case LC_VERSION_MIN_MACOSX: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "version_min_macosx", 0); bin->os = 1; // set OS = osx //bprintf ("[mach0] Requires OSX >= x\n"); break; case LC_VERSION_MIN_IPHONEOS: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "version_min_iphoneos", 0); bin->os = 2; // set OS = ios //bprintf ("[mach0] Requires iOS >= x\n"); break; case LC_VERSION_MIN_TVOS: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "version_min_tvos", 0); bin->os = 4; break; case LC_VERSION_MIN_WATCHOS: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "version_min_watchos", 0); bin->os = 3; break; case LC_UUID: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "uuid", 0); { struct uuid_command uc = {0}; if (off + sizeof (struct uuid_command) > bin->size) { bprintf ("UUID out of obunds\n"); return false; } if (r_buf_fread_at (bin->b, off, (ut8*)&uc, "24c", 1) != -1) { char key[128]; char val[128]; snprintf (key, sizeof (key)-1, "uuid.%d", bin->uuidn++); r_hex_bin2str ((ut8*)&uc.uuid, 16, val); sdb_set (bin->kv, key, val, 0); //for (i=0;i<16; i++) bprintf ("%02x%c", uc.uuid[i], (i==15)?'\n':'-'); } } break; case LC_ENCRYPTION_INFO_64: /* TODO: the struct is probably different here */ case LC_ENCRYPTION_INFO: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "encryption_info", 0); { struct MACH0_(encryption_info_command) eic = {0}; ut8 seic[sizeof (struct MACH0_(encryption_info_command))] = {0}; if (off + sizeof (struct MACH0_(encryption_info_command)) > bin->size) { bprintf ("encryption info out of bounds\n"); return false; } if (r_buf_read_at (bin->b, off, seic, sizeof (struct MACH0_(encryption_info_command))) != -1) { eic.cmd = r_read_ble32 (&seic[0], bin->big_endian); eic.cmdsize = r_read_ble32 (&seic[4], bin->big_endian); eic.cryptoff = r_read_ble32 (&seic[8], bin->big_endian); eic.cryptsize = r_read_ble32 (&seic[12], bin->big_endian); eic.cryptid = r_read_ble32 (&seic[16], bin->big_endian); bin->has_crypto = eic.cryptid; sdb_set (bin->kv, "crypto", "true", 0); sdb_num_set (bin->kv, "cryptid", eic.cryptid, 0); sdb_num_set (bin->kv, "cryptoff", eic.cryptoff, 0); sdb_num_set (bin->kv, "cryptsize", eic.cryptsize, 0); sdb_num_set (bin->kv, "cryptheader", off, 0); } } break; case LC_LOAD_DYLINKER: { sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "dylinker", 0); free (bin->intrp); bin->intrp = NULL; //bprintf ("[mach0] load dynamic linker\n"); struct dylinker_command dy = {0}; ut8 sdy[sizeof (struct dylinker_command)] = {0}; if (off + sizeof (struct dylinker_command) > bin->size){ bprintf ("Warning: Cannot parse dylinker command\n"); return false; } if (r_buf_read_at (bin->b, off, sdy, sizeof (struct dylinker_command)) == -1) { bprintf ("Warning: read (LC_DYLD_INFO) at 0x%08"PFMT64x"\n", off); } else { dy.cmd = r_read_ble32 (&sdy[0], bin->big_endian); dy.cmdsize = r_read_ble32 (&sdy[4], bin->big_endian); dy.name = r_read_ble32 (&sdy[8], bin->big_endian); int len = dy.cmdsize; char *buf = malloc (len+1); if (buf) { // wtf @ off + 0xc ? r_buf_read_at (bin->b, off + 0xc, (ut8*)buf, len); buf[len] = 0; free (bin->intrp); bin->intrp = buf; } } } break; case LC_MAIN: { struct { ut64 eo; ut64 ss; } ep = {0}; ut8 sep[2 * sizeof (ut64)] = {0}; sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "main", 0); if (!is_first_thread) { bprintf("Error: LC_MAIN with other threads\n"); return false; } if (off + 8 > bin->size || off + sizeof (ep) > bin->size) { bprintf ("invalid command size for main\n"); return false; } r_buf_read_at (bin->b, off + 8, sep, 2 * sizeof (ut64)); ep.eo = r_read_ble64 (&sep[0], bin->big_endian); ep.ss = r_read_ble64 (&sep[8], bin->big_endian); bin->entry = ep.eo; bin->main_cmd = lc; sdb_num_set (bin->kv, "mach0.entry.offset", off + 8, 0); sdb_num_set (bin->kv, "stacksize", ep.ss, 0); is_first_thread = false; } break; case LC_UNIXTHREAD: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "unixthread", 0); if (!is_first_thread) { bprintf("Error: LC_UNIXTHREAD with other threads\n"); return false; } case LC_THREAD: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "thread", 0); if (!parse_thread (bin, &lc, off, is_first_thread)) { bprintf ("Cannot parse thread\n"); return false; } is_first_thread = false; break; case LC_LOAD_DYLIB: case LC_LOAD_WEAK_DYLIB: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "load_dylib", 0); bin->nlibs++; if (!parse_dylib(bin, off)){ bprintf ("Cannot parse dylib\n"); bin->nlibs--; return false; } break; case LC_DYLD_INFO: case LC_DYLD_INFO_ONLY: { ut8 dyldi[sizeof (struct dyld_info_command)] = {0}; sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "dyld_info", 0); bin->dyld_info = malloc (sizeof(struct dyld_info_command)); if (off + sizeof (struct dyld_info_command) > bin->size){ bprintf ("Cannot parse dyldinfo\n"); free (bin->dyld_info); return false; } if (r_buf_read_at (bin->b, off, dyldi, sizeof (struct dyld_info_command)) == -1) { free (bin->dyld_info); bin->dyld_info = NULL; bprintf ("Error: read (LC_DYLD_INFO) at 0x%08"PFMT64x"\n", off); } else { bin->dyld_info->cmd = r_read_ble32 (&dyldi[0], bin->big_endian); bin->dyld_info->cmdsize = r_read_ble32 (&dyldi[4], bin->big_endian); bin->dyld_info->rebase_off = r_read_ble32 (&dyldi[8], bin->big_endian); bin->dyld_info->rebase_size = r_read_ble32 (&dyldi[12], bin->big_endian); bin->dyld_info->bind_off = r_read_ble32 (&dyldi[16], bin->big_endian); bin->dyld_info->bind_size = r_read_ble32 (&dyldi[20], bin->big_endian); bin->dyld_info->weak_bind_off = r_read_ble32 (&dyldi[24], bin->big_endian); bin->dyld_info->weak_bind_size = r_read_ble32 (&dyldi[28], bin->big_endian); bin->dyld_info->lazy_bind_off = r_read_ble32 (&dyldi[32], bin->big_endian); bin->dyld_info->lazy_bind_size = r_read_ble32 (&dyldi[36], bin->big_endian); bin->dyld_info->export_off = r_read_ble32 (&dyldi[40], bin->big_endian); bin->dyld_info->export_size = r_read_ble32 (&dyldi[44], bin->big_endian); } } break; case LC_CODE_SIGNATURE: parse_signature (bin, off); sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "signature", 0); /* ut32 dataoff // ut32 datasize */ break; case LC_SOURCE_VERSION: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "version", 0); /* uint64_t version; */ /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */ //bprintf ("mach0: TODO: Show source version\n"); break; case LC_SEGMENT_SPLIT_INFO: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "split_info", 0); /* TODO */ break; case LC_FUNCTION_STARTS: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "function_starts", 0); if (!parse_function_starts (bin, off)) { bprintf ("Cannot parse LC_FUNCTION_STARTS\n"); } break; case LC_REEXPORT_DYLIB: sdb_set (bin->kv, sdb_fmt (0, "mach0_cmd_%d.cmd", i), "dylib", 0); /* TODO */ break; default: //bprintf ("mach0: Unknown header command %x\n", lc.cmd); break; } } return true; }
2198
True
1
CVE-2017-9949
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
nan
[{'url': 'https://github.com/radare/radare2/issues/7683', 'name': 'https://github.com/radare/radare2/issues/7683', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191', 'name': 'https://github.com/radare/radare2/commit/796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99305', 'name': '99305', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_memmove function in shlr/grub/kern/misc.c in radare2 1.5.0 allows remote attackers to cause a denial of service (stack-based buffer underflow and application crash) or possibly have unspecified other impact via a crafted binary file, possibly related to a buffer underflow in fs/ext2.c in GNU GRUB 2.02.'}]
2019-10-03T00:03Z
2017-06-26T20: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
pancake
2017-06-05 12:38:39+02:00
Fix ext2 buffer overflow in r2_sbu_grub_memmove
796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
grub_ext2_iterate_dir
grub_ext2_iterate_dir( grub_fshelp_node_t dir , int(*hook)(const char*filename,enum grub_fshelp_filetype filetype,grub_fshelp_node_t node,void*closure) , void * closure)
['dir', 'int', 'closure']
grub_ext2_iterate_dir (grub_fshelp_node_t dir, int (*hook) (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node, void *closure), void *closure) { unsigned int fpos = 0; struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; if (! diro->inode_read) { grub_ext2_read_inode (diro->data, diro->ino, &diro->inode); if (grub_errno) return 0; } /* Search the file. */ if (hook) while (fpos < grub_le_to_cpu32 (diro->inode.size)) { struct ext2_dirent dirent; grub_ext2_read_file (diro, NULL, NULL, 0, fpos, sizeof (dirent), (char *) &dirent); if (grub_errno) return 0; if (dirent.direntlen == 0) return 0; if (dirent.namelen != 0) { #ifndef _MSC_VER char filename[dirent.namelen + 1]; #else char * filename = grub_malloc (dirent.namelen + 1); #endif struct grub_fshelp_node *fdiro; enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN; grub_ext2_read_file (diro, 0, 0, 0, fpos + sizeof (struct ext2_dirent), dirent.namelen, filename); if (grub_errno) return 0; fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); if (! fdiro) return 0; fdiro->data = diro->data; fdiro->ino = grub_le_to_cpu32 (dirent.inode); filename[dirent.namelen] = '\0'; if (dirent.filetype != FILETYPE_UNKNOWN) { fdiro->inode_read = 0; if (dirent.filetype == FILETYPE_DIRECTORY) type = GRUB_FSHELP_DIR; else if (dirent.filetype == FILETYPE_SYMLINK) type = GRUB_FSHELP_SYMLINK; else if (dirent.filetype == FILETYPE_REG) type = GRUB_FSHELP_REG; } else { /* The filetype can not be read from the dirent, read the inode to get more information. */ grub_ext2_read_inode (diro->data, grub_le_to_cpu32 (dirent.inode), &fdiro->inode); if (grub_errno) { grub_free (fdiro); return 0; } fdiro->inode_read = 1; if ((grub_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY) type = GRUB_FSHELP_DIR; else if ((grub_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_SYMLINK) type = GRUB_FSHELP_SYMLINK; else if ((grub_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_REG) type = GRUB_FSHELP_REG; } if (hook (filename, type, fdiro, closure)) return 1; } fpos += grub_le_to_cpu16 (dirent.direntlen); } return 0; }
462
True
1
CVE-2017-9949
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
nan
[{'url': 'https://github.com/radare/radare2/issues/7683', 'name': 'https://github.com/radare/radare2/issues/7683', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191', 'name': 'https://github.com/radare/radare2/commit/796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99305', 'name': '99305', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_memmove function in shlr/grub/kern/misc.c in radare2 1.5.0 allows remote attackers to cause a denial of service (stack-based buffer underflow and application crash) or possibly have unspecified other impact via a crafted binary file, possibly related to a buffer underflow in fs/ext2.c in GNU GRUB 2.02.'}]
2019-10-03T00:03Z
2017-06-26T20: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
pancake
2017-06-05 12:38:39+02:00
Fix ext2 buffer overflow in r2_sbu_grub_memmove
796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
grub_ext2_read_block
grub_ext2_read_block( grub_fshelp_node_t node , grub_disk_addr_t fileblock)
['node', 'fileblock']
grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_ext2_data *data = node->data; struct grub_ext2_inode *inode = &node->inode; int blknr = -1; unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); if (grub_le_to_cpu32(inode->flags) & EXT4_EXTENTS_FLAG) { #ifndef _MSC_VER char buf[EXT2_BLOCK_SIZE (data)]; #else char * buf = grub_malloc (EXT2_BLOCK_SIZE(data)); #endif struct grub_ext4_extent_header *leaf; struct grub_ext4_extent *ext; int i; leaf = grub_ext4_find_leaf (data, buf, (struct grub_ext4_extent_header *) inode->blocks.dir_blocks, fileblock); if (! leaf) { grub_error (GRUB_ERR_BAD_FS, "invalid extent"); return -1; } ext = (struct grub_ext4_extent *) (leaf + 1); for (i = 0; i < grub_le_to_cpu16 (leaf->entries); i++) { if (fileblock < grub_le_to_cpu32 (ext[i].block)) break; } if (--i >= 0) { fileblock -= grub_le_to_cpu32 (ext[i].block); if (fileblock >= grub_le_to_cpu16 (ext[i].len)) return 0; else { grub_disk_addr_t start; start = grub_le_to_cpu16 (ext[i].start_hi); start = (start << 32) + grub_le_to_cpu32 (ext[i].start); return fileblock + start; } } else { grub_error (GRUB_ERR_BAD_FS, "something wrong with extent"); return -1; } } /* Direct blocks. */ if (fileblock < INDIRECT_BLOCKS) blknr = grub_le_to_cpu32 (inode->blocks.dir_blocks[fileblock]); /* Indirect. */ else if (fileblock < INDIRECT_BLOCKS + blksz / 4) { grub_uint32_t *indir; indir = grub_malloc (blksz); if (! indir) return grub_errno; if (grub_disk_read (data->disk, ((grub_disk_addr_t) grub_le_to_cpu32 (inode->blocks.indir_block)) << log2_blksz, 0, blksz, indir)) return grub_errno; blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]); grub_free (indir); } /* Double indirect. */ else if (fileblock < (grub_disk_addr_t)(INDIRECT_BLOCKS + blksz / 4) \ * (grub_disk_addr_t)(blksz / 4 + 1)) { unsigned int perblock = blksz / 4; unsigned int rblock = fileblock - (INDIRECT_BLOCKS + blksz / 4); grub_uint32_t *indir; indir = grub_malloc (blksz); if (! indir) return grub_errno; if (grub_disk_read (data->disk, ((grub_disk_addr_t) grub_le_to_cpu32 (inode->blocks.double_indir_block)) << log2_blksz, 0, blksz, indir)) return grub_errno; if (grub_disk_read (data->disk, ((grub_disk_addr_t) grub_le_to_cpu32 (indir[rblock / perblock])) << log2_blksz, 0, blksz, indir)) return grub_errno; blknr = grub_le_to_cpu32 (indir[rblock % perblock]); grub_free (indir); } /* triple indirect. */ else { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ext2fs doesn't support triple indirect blocks"); } return blknr; }
558
True
1
CVE-2017-9520
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7698', 'name': 'https://github.com/radare/radare2/issues/7698', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking']}, {'url': 'https://github.com/radare/radare2/commit/f85bc674b2a2256a364fe796351bc1971e106005', 'name': 'https://github.com/radare/radare2/commit/f85bc674b2a2256a364fe796351bc1971e106005', 'refsource': 'CONFIRM', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The r_config_set function in libr/config/config.c in radare2 1.5.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted DEX file.'}]
2017-06-27T14:57Z
2017-06-08T14:29Z
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
pancake
2017-06-07 23:50:59+02:00
Fix #7698 - UAF in r_config_set when loading a dex
f85bc674b2a2256a364fe796351bc1971e106005
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_config_set
r_config_set( RConfig * cfg , const char * name , const char * value)
['cfg', 'name', 'value']
R_API RConfigNode* r_config_set(RConfig *cfg, const char *name, const char *value) { RConfigNode *node = NULL; char *ov = NULL; ut64 oi; if (!cfg || STRNULL (name)) { return NULL; } node = r_config_node_get (cfg, name); if (node) { if (node->flags & CN_RO) { eprintf ("(error: '%s' config key is read only)\n", name); return node; } oi = node->i_value; if (node->value) { ov = strdup (node->value); if (!ov) { goto beach; } } else { free (node->value); node->value = strdup (""); } if (node->flags & CN_BOOL) { bool b = is_true (value); node->i_value = (ut64) b? 1: 0; char *value = strdup (r_str_bool (b)); if (value) { free (node->value); node->value = value; } } else { if (!value) { free (node->value); node->value = strdup (""); node->i_value = 0; } else { if (node->value == value) { goto beach; } free (node->value); node->value = strdup (value); if (IS_DIGIT (*value)) { if (strchr (value, '/')) { node->i_value = r_num_get (cfg->num, value); } else { node->i_value = r_num_math (cfg->num, value); } } else { node->i_value = 0; } node->flags |= CN_INT; } } } else { // Create a new RConfigNode oi = UT64_MAX; if (!cfg->lock) { node = r_config_node_new (name, value); if (node) { if (value && is_bool (value)) { node->flags |= CN_BOOL; node->i_value = is_true (value)? 1: 0; } if (cfg->ht) { ht_insert (cfg->ht, node->name, node); r_list_append (cfg->nodes, node); cfg->n_nodes++; } } else { eprintf ("r_config_set: unable to create a new RConfigNode\n"); } } else { eprintf ("r_config_set: variable '%s' not found\n", name); } } if (node && node->setter) { int ret = node->setter (cfg->user, node); if (ret == false) { if (oi != UT64_MAX) { node->i_value = oi; } free (node->value); node->value = strdup (ov? ov: ""); } } beach: free (ov); return node; }
516
True
1
CVE-2017-9520
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7698', 'name': 'https://github.com/radare/radare2/issues/7698', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking']}, {'url': 'https://github.com/radare/radare2/commit/f85bc674b2a2256a364fe796351bc1971e106005', 'name': 'https://github.com/radare/radare2/commit/f85bc674b2a2256a364fe796351bc1971e106005', 'refsource': 'CONFIRM', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The r_config_set function in libr/config/config.c in radare2 1.5.0 allows remote attackers to cause a denial of service (use-after-free and application crash) via a crafted DEX file.'}]
2017-06-27T14:57Z
2017-06-08T14:29Z
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
pancake
2017-06-07 23:50:59+02:00
Fix #7698 - UAF in r_config_set when loading a dex
f85bc674b2a2256a364fe796351bc1971e106005
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_core_bin_set_env
r_core_bin_set_env( RCore * r , RBinFile * binfile)
['r', 'binfile']
R_API int r_core_bin_set_env(RCore *r, RBinFile *binfile) { RBinObject *binobj = binfile ? binfile->o: NULL; RBinInfo *info = binobj ? binobj->info: NULL; if (info) { int va = info->has_va; const char * arch = info->arch; ut16 bits = info->bits; ut64 baseaddr = r_bin_get_baddr (r->bin); /* Hack to make baddr work on some corner */ r_config_set_i (r->config, "io.va", (binobj->info)? binobj->info->has_va: 0); r_config_set_i (r->config, "bin.baddr", baseaddr); r_config_set (r->config, "asm.arch", arch); r_config_set_i (r->config, "asm.bits", bits); r_config_set (r->config, "anal.arch", arch); if (info->cpu && *info->cpu) { r_config_set (r->config, "anal.cpu", info->cpu); } else { r_config_set (r->config, "anal.cpu", arch); } r_asm_use (r->assembler, arch); r_core_bin_info (r, R_CORE_BIN_ACC_ALL, R_CORE_BIN_SET, va, NULL, NULL); r_core_bin_set_cur (r, binfile); return true; } return false; }
219
True
1
CVE-2017-9763
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/radare/radare2/issues/7723', 'name': 'https://github.com/radare/radare2/issues/7723', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'name': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'name': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99141', 'name': '99141', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_ext2_read_block function in fs/ext2.c in GNU GRUB before 2013-11-12, as used in shlr/grub/fs/ext2.c in radare2 1.5.0, allows remote attackers to cause a denial of service (excessive stack use and application crash) via a crafted binary file, related to use of a variable-size stack array.'}]
2017-07-05T17:54Z
2017-06-19T16: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
pancake
2017-06-12 09:57:30+02:00
Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
65000a7fd9eea62359e6d6714f17b94a99a82edd
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
cmd_mount
cmd_mount( void * data , const char * _input)
['data', '_input']
static int cmd_mount(void *data, const char *_input) { ut64 off = 0; char *input, *oinput, *ptr, *ptr2; RList *list; RListIter *iter; RFSFile *file; RFSRoot *root; RFSPlugin *plug; RFSPartition *part; RCore *core = (RCore *)data; if (!strncmp ("kdir", _input, 4)) { return cmd_mkdir (data, _input); } if (!strncmp ("v", _input, 1)) { return cmd_mv (data, _input); } input = oinput = strdup (_input); switch (*input) { case ' ': input++; if (input[0]==' ') input++; ptr = strchr (input, ' '); if (ptr) { *ptr = 0; ptr++; ptr2 = strchr (ptr, ' '); if (ptr2) { *ptr2 = 0; off = r_num_math (core->num, ptr2+1); } if (!r_fs_mount (core->fs, ptr, input, off)) eprintf ("Cannot mount %s\n", input); } else { if (!(ptr = r_fs_name (core->fs, core->offset))) eprintf ("Unknown filesystem type\n"); else if (!r_fs_mount (core->fs, ptr, input, core->offset)) eprintf ("Cannot mount %s\n", input); free (ptr); } break; case '-': r_fs_umount (core->fs, input+1); break; case '*': eprintf ("List commands in radare format\n"); r_list_foreach (core->fs->roots, iter, root) { r_cons_printf ("m %s %s 0x%"PFMT64x"\n", root-> path, root->p->name, root->delta); } break; case '\0': r_list_foreach (core->fs->roots, iter, root) { r_cons_printf ("%s\t0x%"PFMT64x"\t%s\n", root->p->name, root->delta, root->path); } break; case 'l': // list of plugins r_list_foreach (core->fs->plugins, iter, plug) { r_cons_printf ("%10s %s\n", plug->name, plug->desc); } break; case 'd': input++; if (input[0]==' ') input++; list = r_fs_dir (core->fs, input); if (list) { r_list_foreach (list, iter, file) { r_cons_printf ("%c %s\n", file->type, file->name); } r_list_free (list); } else eprintf ("Cannot open '%s' directory\n", input); break; case 'p': input++; if (*input == ' ') input++; ptr = strchr (input, ' '); if (ptr) { *ptr = 0; off = r_num_math (core->num, ptr+1); } list = r_fs_partitions (core->fs, input, off); if (list) { r_list_foreach (list, iter, part) { r_cons_printf ("%d %02x 0x%010"PFMT64x" 0x%010"PFMT64x"\n", part->number, part->type, part->start, part->start+part->length); } r_list_free (list); } else eprintf ("Cannot read partition\n"); break; case 'o': input++; if (input[0]==' ') input++; file = r_fs_open (core->fs, input); if (file) { // XXX: dump to file or just pipe? r_fs_read (core->fs, file, 0, file->size); r_cons_printf ("f file %d 0x%08"PFMT64x"\n", file->size, file->off); r_fs_close (core->fs, file); } else eprintf ("Cannot open file\n"); break; case 'g': input++; if (*input == ' ') input++; ptr = strchr (input, ' '); if (ptr) *ptr++ = 0; else ptr = "./"; file = r_fs_open (core->fs, input); if (file) { r_fs_read (core->fs, file, 0, file->size); write (1, file->data, file->size); r_fs_close (core->fs, file); write (1, "\n", 1); } else if (!r_fs_dir_dump (core->fs, input, ptr)) eprintf ("Cannot open file\n"); break; case 'f': input++; switch (*input) { case '?': r_cons_printf ( "Usage: mf[no] [...]\n" " mfn /foo *.c ; search files by name in /foo path\n" " mfo /foo 0x5e91 ; search files by offset in /foo path\n" ); break; case 'n': input++; if (*input == ' ') input++; ptr = strchr (input, ' '); if (ptr) { *ptr++ = 0; list = r_fs_find_name (core->fs, input, ptr); r_list_foreach (list, iter, ptr) { r_str_chop_path (ptr); printf ("%s\n", ptr); } //XXX: r_list_purge (list); } else eprintf ("Unknown store path\n"); break; case 'o': input++; if (*input == ' ') input++; ptr = strchr (input, ' '); if (ptr) { *ptr++ = 0; ut64 off = r_num_math (core->num, ptr); list = r_fs_find_off (core->fs, input, off); r_list_foreach (list, iter, ptr) { r_str_chop_path (ptr); printf ("%s\n", ptr); } //XXX: r_list_purge (list); } else eprintf ("Unknown store path\n"); break; } break; case 's': if (core->http_up) { free (oinput); return false; } input++; if (input[0]==' ') input++; r_fs_prompt (core->fs, input); break; case 'y': eprintf ("TODO\n"); break; case '?': { const char* help_msg[] = { "Usage:", "m[-?*dgy] [...] ", "Mountpoints management", "m", "", "List all mountpoints in human readable format", "m*", "", "Same as above, but in r2 commands", "ml", "", "List filesystem plugins", "m", " /mnt", "Mount fs at /mnt with autodetect fs and current offset", "m", " /mnt ext2 0", "Mount ext2 fs at /mnt with delta 0 on IO", "m-/", "", "Umount given path (/)", "my", "", "Yank contents of file into clipboard", "mo", " /foo", "Get offset and size of given file", "mg", " /foo", "Get contents of file/dir dumped to disk (XXX?)", "mf", "[?] [o|n]", "Search files for given filename or for offset", "md", " /", "List directory contents for path", "mp", "", "List all supported partition types", "mp", " msdos 0", "Show partitions in msdos format at offset 0", "ms", " /mnt", "Open filesystem prompt at /mnt", //"TODO: support multiple mountpoints and RFile IO's (need io+core refactorn", NULL}; r_core_cmd_help (core, help_msg); } break; } free (oinput); return 0; }
1191
True
1
CVE-2017-9763
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/radare/radare2/issues/7723', 'name': 'https://github.com/radare/radare2/issues/7723', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'name': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'name': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99141', 'name': '99141', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_ext2_read_block function in fs/ext2.c in GNU GRUB before 2013-11-12, as used in shlr/grub/fs/ext2.c in radare2 1.5.0, allows remote attackers to cause a denial of service (excessive stack use and application crash) via a crafted binary file, related to use of a variable-size stack array.'}]
2017-07-05T17:54Z
2017-06-19T16: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
pancake
2017-06-12 09:57:30+02:00
Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
65000a7fd9eea62359e6d6714f17b94a99a82edd
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
grub_ext2_read_block
grub_ext2_read_block( grub_fshelp_node_t node , grub_disk_addr_t fileblock)
['node', 'fileblock']
grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_ext2_data *data = node->data; struct grub_ext2_inode *inode = &node->inode; int blknr = -1; unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); if (grub_le_to_cpu32(inode->flags) & EXT4_EXTENTS_FLAG) { #ifndef _MSC_VER char buf[EXT2_BLOCK_SIZE (data)]; #else char * buf = grub_malloc (EXT2_BLOCK_SIZE(data)); #endif struct grub_ext4_extent_header *leaf; struct grub_ext4_extent *ext; int i; leaf = grub_ext4_find_leaf (data, buf, (struct grub_ext4_extent_header *) inode->blocks.dir_blocks, fileblock); if (! leaf) { grub_error (GRUB_ERR_BAD_FS, "invalid extent"); return -1; } ext = (struct grub_ext4_extent *) (leaf + 1); for (i = 0; i < grub_le_to_cpu16 (leaf->entries); i++) { if (fileblock < grub_le_to_cpu32 (ext[i].block)) break; } if (--i >= 0) { fileblock -= grub_le_to_cpu32 (ext[i].block); if (fileblock >= grub_le_to_cpu16 (ext[i].len)) return 0; else { grub_disk_addr_t start; start = grub_le_to_cpu16 (ext[i].start_hi); start = (start << 32) + grub_le_to_cpu32 (ext[i].start); return fileblock + start; } } else { grub_error (GRUB_ERR_BAD_FS, "something wrong with extent"); return -1; } } /* Direct blocks. */ if (fileblock < INDIRECT_BLOCKS) { blknr = grub_le_to_cpu32 (inode->blocks.dir_blocks[fileblock]); /* Indirect. */ } else if (fileblock < INDIRECT_BLOCKS + blksz / 4) { grub_uint32_t *indir; indir = grub_malloc (blksz); if (! indir) return grub_errno; if (grub_disk_read (data->disk, ((grub_disk_addr_t) grub_le_to_cpu32 (inode->blocks.indir_block)) << log2_blksz, 0, blksz, indir)) return grub_errno; blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]); grub_free (indir); } /* Double indirect. */ else if (fileblock < (grub_disk_addr_t)(INDIRECT_BLOCKS + blksz / 4) \ * (grub_disk_addr_t)(blksz / 4 + 1)) { unsigned int perblock = blksz / 4; unsigned int rblock = fileblock - (INDIRECT_BLOCKS + blksz / 4); grub_uint32_t *indir; indir = grub_malloc (blksz); if (! indir) return grub_errno; if (grub_disk_read (data->disk, ((grub_disk_addr_t) grub_le_to_cpu32 (inode->blocks.double_indir_block)) << log2_blksz, 0, blksz, indir)) return grub_errno; if (grub_disk_read (data->disk, ((grub_disk_addr_t) grub_le_to_cpu32 (indir[rblock / perblock])) << log2_blksz, 0, blksz, indir)) return grub_errno; blknr = grub_le_to_cpu32 (indir[rblock % perblock]); grub_free (indir); } /* triple indirect. */ else { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ext2fs doesn't support triple indirect blocks"); } return blknr; }
560
True
1
CVE-2017-9763
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/radare/radare2/issues/7723', 'name': 'https://github.com/radare/radare2/issues/7723', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'name': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'name': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99141', 'name': '99141', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_ext2_read_block function in fs/ext2.c in GNU GRUB before 2013-11-12, as used in shlr/grub/fs/ext2.c in radare2 1.5.0, allows remote attackers to cause a denial of service (excessive stack use and application crash) via a crafted binary file, related to use of a variable-size stack array.'}]
2017-07-05T17:54Z
2017-06-19T16: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
pancake
2017-06-12 09:57:30+02:00
Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
65000a7fd9eea62359e6d6714f17b94a99a82edd
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
grub_ext4_find_leaf
grub_ext4_find_leaf( struct grub_ext2_data * data , char * buf , struct grub_ext4_extent_header * ext_block , grub_uint32_t fileblock)
['data', 'buf', 'ext_block', 'fileblock']
grub_ext4_find_leaf (struct grub_ext2_data *data, char *buf, struct grub_ext4_extent_header *ext_block, grub_uint32_t fileblock) { struct grub_ext4_extent_idx *index; while (1) { int i; grub_disk_addr_t block; index = (struct grub_ext4_extent_idx *) (ext_block + 1); if (grub_le_to_cpu16(ext_block->magic) != EXT4_EXT_MAGIC) return 0; if (ext_block->depth == 0) return ext_block; for (i = 0; i < grub_le_to_cpu16 (ext_block->entries); i++) { if (fileblock < grub_le_to_cpu32(index[i].block)) break; } if (--i < 0) return 0; block = grub_le_to_cpu16 (index[i].leaf_hi); block = (block << 32) + grub_le_to_cpu32 (index[i].leaf); if (grub_disk_read (data->disk, block << LOG2_EXT2_BLOCK_SIZE (data), 0, EXT2_BLOCK_SIZE(data), buf)) return 0; ext_block = (struct grub_ext4_extent_header *) buf; } }
191
True
1
CVE-2017-9763
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/radare/radare2/issues/7723', 'name': 'https://github.com/radare/radare2/issues/7723', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'name': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'name': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99141', 'name': '99141', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_ext2_read_block function in fs/ext2.c in GNU GRUB before 2013-11-12, as used in shlr/grub/fs/ext2.c in radare2 1.5.0, allows remote attackers to cause a denial of service (excessive stack use and application crash) via a crafted binary file, related to use of a variable-size stack array.'}]
2017-07-05T17:54Z
2017-06-19T16: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
pancake
2017-06-12 09:57:30+02:00
Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
65000a7fd9eea62359e6d6714f17b94a99a82edd
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
find_file
find_file( const char * currpath , grub_fshelp_node_t currroot , grub_fshelp_node_t * currfound , struct grub_fshelp_find_file_closure * c)
['currpath', 'currroot', 'currfound', 'c']
find_file (const char *currpath, grub_fshelp_node_t currroot, grub_fshelp_node_t *currfound, struct grub_fshelp_find_file_closure *c) { #ifndef _MSC_VER char fpath[grub_strlen (currpath) + 1]; #else char *fpath = grub_malloc (grub_strlen (currpath) + 1); #endif char *name = fpath; char *next; enum grub_fshelp_filetype type = GRUB_FSHELP_DIR; grub_fshelp_node_t currnode = currroot; grub_fshelp_node_t oldnode = currroot; c->currroot = currroot; grub_strncpy (fpath, currpath, grub_strlen (currpath) + 1); /* Remove all leading slashes. */ while (*name == '/') name++; if (! *name) { *currfound = currnode; return 0; } for (;;) { int found; struct find_file_closure cc; /* Extract the actual part from the pathname. */ next = grub_strchr (name, '/'); if (next) { /* Remove all leading slashes. */ while (*next == '/') *(next++) = '\0'; } /* At this point it is expected that the current node is a directory, check if this is true. */ if (type != GRUB_FSHELP_DIR) { free_node (currnode, c); return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); } cc.name = name; cc.type = &type; cc.oldnode = &oldnode; cc.currnode = &currnode; /* Iterate over the directory. */ found = c->iterate_dir (currnode, iterate, &cc); if (! found) { if (grub_errno) return grub_errno; break; } /* Read in the symlink and follow it. */ if (type == GRUB_FSHELP_SYMLINK) { char *symlink; /* Test if the symlink does not loop. */ if (++(c->symlinknest) == 8) { free_node (currnode, c); free_node (oldnode, c); return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); } symlink = c->read_symlink (currnode); free_node (currnode, c); if (!symlink) { free_node (oldnode, c); return grub_errno; } /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') { free_node (oldnode, c); oldnode = c->rootnode; } /* Lookup the node the symlink points to. */ find_file (symlink, oldnode, &currnode, c); type = c->foundtype; grub_free (symlink); if (grub_errno) { free_node (oldnode, c); return grub_errno; } } free_node (oldnode, c); /* Found the node! */ if (! next || *next == '\0') { *currfound = currnode; c->foundtype = type; return 0; } name = next; } return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); }
430
True
1
CVE-2017-9763
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/radare/radare2/issues/7723', 'name': 'https://github.com/radare/radare2/issues/7723', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'name': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'name': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99141', 'name': '99141', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_ext2_read_block function in fs/ext2.c in GNU GRUB before 2013-11-12, as used in shlr/grub/fs/ext2.c in radare2 1.5.0, allows remote attackers to cause a denial of service (excessive stack use and application crash) via a crafted binary file, related to use of a variable-size stack array.'}]
2017-07-05T17:54Z
2017-06-19T16: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
pancake
2017-06-12 09:57:30+02:00
Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
65000a7fd9eea62359e6d6714f17b94a99a82edd
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
grubfs_free
grubfs_free( GrubFS * gf)
['gf']
void grubfs_free (GrubFS *gf) { if (gf) { if (gf->file && gf->file->device) free (gf->file->device->disk); //free (gf->file->device); free (gf->file); free (gf); } }
49
True
1
CVE-2017-9763
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/radare/radare2/issues/7723', 'name': 'https://github.com/radare/radare2/issues/7723', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'name': 'https://github.com/radare/radare2/commit/65000a7fd9eea62359e6d6714f17b94a99a82edd', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'name': 'http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/fs/ext2.c?id=ac8cac1dac50daaf1c390d701cca3b55e16ee768', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99141', 'name': '99141', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The grub_ext2_read_block function in fs/ext2.c in GNU GRUB before 2013-11-12, as used in shlr/grub/fs/ext2.c in radare2 1.5.0, allows remote attackers to cause a denial of service (excessive stack use and application crash) via a crafted binary file, related to use of a variable-size stack array.'}]
2017-07-05T17:54Z
2017-06-19T16: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
pancake
2017-06-12 09:57:30+02:00
Fix #7723 - crash in ext2 GRUB code because of variable size array in stack
65000a7fd9eea62359e6d6714f17b94a99a82edd
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
read_foo
read_foo( struct grub_disk * disk , grub_disk_addr_t sector , grub_size_t size , char * buf)
['disk', 'sector', 'size', 'buf']
static grub_err_t read_foo (struct grub_disk *disk, grub_disk_addr_t sector, grub_size_t size, char *buf) { if (disk != NULL) { const int blocksize = 512; // unhardcode 512 int ret; RIOBind *iob = disk->data; if (bio) iob = bio; //printf ("io %p\n", file->root->iob.io); ret = iob->read_at (iob->io, delta+(blocksize*sector), (ut8*)buf, size*blocksize); if (ret == -1) return 1; //printf ("DISK PTR = %p\n", disk->data); //printf ("\nBUF: %x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]); } else eprintf ("oops. no disk\n"); return 0; // 0 is ok }
100
True
1
CVE-2017-9761
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:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
nan
[{'url': 'https://github.com/radare/radare2/issues/7727', 'name': 'https://github.com/radare/radare2/issues/7727', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/radare/radare2/commit/00e8f205475332d7842d0f0d1481eeab4e83017c', 'name': 'https://github.com/radare/radare2/commit/00e8f205475332d7842d0f0d1481eeab4e83017c', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/99138', 'name': '99138', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:radare:radare2:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The find_eoq function in libr/core/cmd.c in radare2 1.5.0 allows remote attackers to cause a denial of service (heap-based out-of-bounds read and application crash) via a crafted binary file.'}]
2017-06-27T14:49Z
2017-06-19T16: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
pancake
2017-06-12 15:50:52+02:00
Fix #7727 - undefined pointers and out of band string access fixes
00e8f205475332d7842d0f0d1481eeab4e83017c
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
radare
visit repo url
visit repo url
r_core_cmd_subst_i
r_core_cmd_subst_i( RCore * core , char * cmd , char * colon)
['core', 'cmd', 'colon']
static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon) { const char *quotestr = "`"; const char *tick = NULL; char *ptr, *ptr2, *str; char *arroba = NULL; int i, ret = 0, pipefd; bool usemyblock = false; int scr_html = -1; int scr_color = -1; bool eos = false; bool haveQuote = false; if (!cmd) { return 0; } cmd = r_str_trim_head_tail (cmd); /* quoted / raw command */ switch (*cmd) { case '.': if (cmd[1] == '"') { /* interpret */ return r_cmd_call (core->rcmd, cmd); } break; case '"': for (; *cmd; ) { int pipefd = -1; ut64 oseek = UT64_MAX; char *line, *p; haveQuote = *cmd == '"'; if (haveQuote) { // *cmd = 0; cmd++; p = find_eoq (cmd + 1); if (!p || !*p) { eprintf ("Missing \" in (%s).", cmd); return false; } *p++ = 0; if (!*p) { eos = true; } } else { char *sc = strchr (cmd, ';'); if (sc) { *sc = 0; } r_core_cmd0 (core, cmd); if (!sc) { break; } cmd = sc + 1; continue; } if (p[0]) { // workaround :D if (p[0] == '@') { p--; } while (p[1] == ';' || IS_WHITESPACE (p[1])) { p++; } if (p[1] == '@' || (p[1] && p[2] == '@')) { char *q = strchr (p + 1, '"'); if (q) { *q = 0; } haveQuote = q != NULL; oseek = core->offset; r_core_seek (core, r_num_math (core->num, p + 2), 1); if (q) { *p = '"'; p = q; } else { p = strchr (p + 1, ';'); } } if (p && *p && p[1] == '>') { str = p + 2; while (*str == '>') { str++; } while (IS_WHITESPACE (*str)) { str++; } r_cons_flush (); pipefd = r_cons_pipe_open (str, 1, p[2] == '>'); } } line = strdup (cmd); line = r_str_replace (line, "\\\"", "\"", true); if (p && *p && p[1] == '|') { str = p + 2; while (IS_WHITESPACE (*str)) { str++; } r_core_cmd_pipe (core, cmd, str); } else { r_cmd_call (core->rcmd, line); } free (line); if (oseek != UT64_MAX) { r_core_seek (core, oseek, 1); oseek = UT64_MAX; } if (pipefd != -1) { r_cons_flush (); r_cons_pipe_close (pipefd); } if (!p) { break; } if (eos) { break; } if (haveQuote) { if (*p == ';') { cmd = p + 1; } else { if (*p == '"') { cmd = p + 1; } else { *p = '"'; cmd = p; } } } else { cmd = p + 1; } } return true; case '(': if (cmd[1] != '*') { return r_cmd_call (core->rcmd, cmd); } } // TODO must honor " and ` /* comments */ if (*cmd != '#') { ptr = (char *)r_str_lastbut (cmd, '#', quotestr); if (ptr && (ptr[1] == ' ' || ptr[1] == '\t')) { *ptr = '\0'; } } /* multiple commands */ // TODO: must honor " and ` boundaries //ptr = strrchr (cmd, ';'); if (*cmd != '#') { ptr = (char *)r_str_lastbut (cmd, ';', quotestr); if (colon && ptr) { int ret ; *ptr = '\0'; if (r_core_cmd_subst (core, cmd) == -1) { return -1; } cmd = ptr + 1; ret = r_core_cmd_subst (core, cmd); *ptr = ';'; return ret; //r_cons_flush (); } } // TODO must honor " and ` /* pipe console to shell process */ //ptr = strchr (cmd, '|'); ptr = (char *)r_str_lastbut (cmd, '|', quotestr); if (ptr) { char *ptr2 = strchr (cmd, '`'); if (!ptr2 || (ptr2 && ptr2 > ptr)) { if (!tick || (tick && tick > ptr)) { *ptr = '\0'; cmd = r_str_clean (cmd); if (!strcmp (ptr + 1, "?")) { // "|?" // TODO: should be disable scr.color in pd| ? eprintf ("Usage: <r2command> | <program|H|>\n"); eprintf (" pd|? - show this help\n"); eprintf (" pd| - disable scr.html and scr.color\n"); eprintf (" pd|H - enable scr.html, respect scr.color\n"); return ret; } else if (!strcmp (ptr + 1, "H")) { // "|H" scr_html = r_config_get_i (core->config, "scr.html"); r_config_set_i (core->config, "scr.html", true); } else if (ptr[1]) { // "| grep .." int value = core->num->value; if (*cmd) { r_core_cmd_pipe (core, cmd, ptr + 1); } else { r_io_system (core->io, ptr + 1); } core->num->value = value; return 0; } else { // "|" scr_html = r_config_get_i (core->config, "scr.html"); r_config_set_i (core->config, "scr.html", 0); scr_color = r_config_get_i (core->config, "scr.color"); r_config_set_i (core->config, "scr.color", false); } } } } // TODO must honor " and ` /* bool conditions */ ptr = (char *)r_str_lastbut (cmd, '&', quotestr); //ptr = strchr (cmd, '&'); while (ptr && ptr[1] == '&') { *ptr = '\0'; ret = r_cmd_call (core->rcmd, cmd); if (ret == -1) { eprintf ("command error(%s)\n", cmd); if (scr_html != -1) { r_config_set_i (core->config, "scr.html", scr_html); } if (scr_color != -1) { r_config_set_i (core->config, "scr.color", scr_color); } return ret; } for (cmd = ptr + 2; cmd && *cmd == ' '; cmd++); ptr = strchr (cmd, '&'); } /* Out Of Band Input */ free (core->oobi); core->oobi = NULL; ptr = strstr (cmd, "?*"); if (ptr) { char *prech = ptr - 1; if (*prech != '~') { ptr[1] = 0; if (*cmd != '#' && strlen (cmd) < 5) { r_cons_break_push (NULL, NULL); recursive_help (core, cmd); r_cons_break_pop (); r_cons_grep_parsecmd (ptr + 2, "`"); if (scr_html != -1) { r_config_set_i (core->config, "scr.html", scr_html); } if (scr_color != -1) { r_config_set_i (core->config, "scr.color", scr_color); } return 0; } } } #if 0 ptr = strchr (cmd, '<'); if (ptr) { ptr[0] = '\0'; if (r_cons_singleton()->is_interactive) { if (ptr[1] == '<') { /* this is a bit mess */ //const char *oprompt = strdup (r_line_singleton ()->prompt); //oprompt = ">"; for (str = ptr + 2; str[0] == ' '; str++) { //nothing to see here } eprintf ("==> Reading from stdin until '%s'\n", str); free (core->oobi); core->oobi = malloc (1); if (core->oobi) { core->oobi[0] = '\0'; } core->oobi_len = 0; for (;;) { char buf[1024]; int ret; write (1, "> ", 2); fgets (buf, sizeof (buf) - 1, stdin); // XXX use r_line ?? if (feof (stdin)) { break; } if (*buf) buf[strlen (buf) - 1]='\0'; ret = strlen (buf); core->oobi_len += ret; core->oobi = realloc (core->oobi, core->oobi_len + 1); if (core->oobi) { if (!strcmp (buf, str)) { break; } strcat ((char *)core->oobi, buf); } } //r_line_set_prompt (oprompt); } else { for (str = ptr + 1; *str == ' '; str++) { //nothing to see here } if (!*str) { goto next; } eprintf ("Slurping file '%s'\n", str); free (core->oobi); core->oobi = (ut8*)r_file_slurp (str, &core->oobi_len); if (!core->oobi) { eprintf ("cannot open file\n"); } else if (ptr == cmd) { return r_core_cmd_buffer (core, (const char *)core->oobi); } } } else { eprintf ("Cannot slurp with << in non-interactive mode\n"); return 0; } } next: #endif // TODO must honor " and ` /* pipe console to file */ ptr = strchr (cmd, '>'); if (ptr) { int fdn = 1; int pipecolor = r_config_get_i (core->config, "scr.pipecolor"); int use_editor = false; int ocolor = r_config_get_i (core->config, "scr.color"); *ptr = '\0'; str = r_str_trim_head_tail (ptr + 1 + (ptr[1] == '>')); if (!*str) { eprintf ("No output?\n"); goto next2; } /* r_cons_flush() handles interactive output (to the terminal) * differently (e.g. asking about too long output). This conflicts * with piping to a file. Disable it while piping. */ if (ptr > (cmd + 1) && ISWHITECHAR (ptr[-2])) { char *fdnum = ptr - 1; if (*fdnum == 'H') { // "H>" scr_html = r_config_get_i (core->config, "scr.html"); r_config_set_i (core->config, "scr.html", true); pipecolor = true; *fdnum = 0; } else { if (IS_DIGIT(*fdnum)) { fdn = *fdnum - '0'; } *fdnum = 0; } } r_cons_set_interactive (false); if (!strcmp (str, "-")) { use_editor = true; str = r_file_temp ("dumpedit"); r_config_set (core->config, "scr.color", "false"); } if (fdn > 0) { pipefd = r_cons_pipe_open (str, fdn, ptr[1] == '>'); if (pipefd != -1) { if (!pipecolor) { r_config_set_i (core->config, "scr.color", 0); } ret = r_core_cmd_subst (core, cmd); r_cons_flush (); r_cons_pipe_close (pipefd); } } r_cons_set_last_interactive (); if (!pipecolor) { r_config_set_i (core->config, "scr.color", ocolor); } if (use_editor) { const char *editor = r_config_get (core->config, "cfg.editor"); if (editor && *editor) { r_sys_cmdf ("%s '%s'", editor, str); r_file_rm (str); } else { eprintf ("No cfg.editor configured\n"); } r_config_set_i (core->config, "scr.color", ocolor); free (str); } if (scr_html != -1) { r_config_set_i (core->config, "scr.html", scr_html); } if (scr_color != -1) { r_config_set_i (core->config, "scr.color", scr_color); } return ret; } next2: /* sub commands */ ptr = strchr (cmd, '`'); if (ptr) { int empty = 0; int oneline = 1; if (ptr[1] == '`') { memmove (ptr, ptr + 1, strlen (ptr)); oneline = 0; empty = 1; } ptr2 = strchr (ptr + 1, '`'); if (empty) { /* do nothing */ } else if (!ptr2) { eprintf ("parse: Missing backtick in expression.\n"); goto fail; } else { int value = core->num->value; *ptr = '\0'; *ptr2 = '\0'; if (ptr[1] == '!') { str = r_core_cmd_str_pipe (core, ptr + 1); } else { str = r_core_cmd_str (core, ptr + 1); } if (!str) { goto fail; } // ignore contents if first char is pipe or comment if (*str == '|' || *str == '*') { eprintf ("r_core_cmd_subst_i: invalid backticked command\n"); free (str); goto fail; } if (oneline && str) { for (i = 0; str[i]; i++) { if (str[i] == '\n') { str[i] = ' '; } } } str = r_str_append (str, ptr2 + 1); cmd = r_str_append (strdup (cmd), str); core->num->value = value; ret = r_core_cmd_subst (core, cmd); free (cmd); if (scr_html != -1) { r_config_set_i (core->config, "scr.html", scr_html); } free (str); return ret; } } // TODO must honor " and ` core->fixedblock = false; if (r_str_endswith (cmd, "~?") && cmd[2] == '\0') { r_cons_grep_help (); return true; } if (*cmd != '.') { r_cons_grep_parsecmd (cmd, quotestr); } /* temporary seek commands */ if (*cmd!= '(' && *cmd != '"') { ptr = strchr (cmd, '@'); if (ptr == cmd + 1 && *cmd == '?') { ptr = NULL; } } else { ptr = NULL; } core->tmpseek = ptr? true: false; int rc = 0; if (ptr) { char *f, *ptr2 = strchr (ptr + 1, '!'); ut64 addr = UT64_MAX; const char *tmpbits = NULL; const char *offstr = NULL; ut64 tmpbsz = core->blocksize; char *tmpeval = NULL; ut64 tmpoff = core->offset; char *tmpasm = NULL; int tmpfd = -1; int sz, len; ut8 *buf; *ptr = '\0'; for (ptr++; *ptr == ' '; ptr++) { //nothing to see here } if (*ptr && ptr[1] == ':') { /* do nothing here */ } else { ptr--; } arroba = (ptr[0] && ptr[1] && ptr[2])? strchr (ptr + 2, '@'): NULL; repeat_arroba: if (arroba) { *arroba = 0; } if (ptr[1] == '?') { helpCmdAt (core); } else if (ptr[0] && ptr[1] == ':' && ptr[2]) { usemyblock = true; switch (ptr[0]) { case 'f': // "@f:" // slurp file in block f = r_file_slurp (ptr + 2, &sz); if (f) { buf = malloc (sz); if (buf) { free (core->block); core->block = buf; core->blocksize = sz; memcpy (core->block, f, sz); } else { eprintf ("cannot alloc %d", sz); } free (f); } else { eprintf ("cannot open '%s'\n", ptr + 3); } break; case 'r': // "@r:" // regname if (ptr[1] == ':') { ut64 regval; char *mander = strdup (ptr + 2); char *sep = findSeparator (mander); if (sep) { char ch = *sep; *sep = 0; regval = r_debug_reg_get (core->dbg, mander); *sep = ch; char *numexpr = r_str_newf ("0x%"PFMT64x"%s", regval, sep); regval = r_num_math (core->num, numexpr); free (numexpr); } else { regval = r_debug_reg_get (core->dbg, ptr + 2); } r_core_seek (core, regval, 1); free (mander); } break; case 'b': // "@b:" // bits tmpbits = strdup (r_config_get (core->config, "asm.bits")); r_config_set_i (core->config, "asm.bits", r_num_math (core->num, ptr + 2)); break; case 'i': // "@i:" { ut64 addr = r_num_math (core->num, ptr + 2); if (addr) { r_core_cmdf (core, "so %s", ptr + 2); } } break; case 'e': // "@e:" tmpeval = parse_tmp_evals (core, ptr + 2); break; case 'x': // "@x:" // hexpairs if (ptr[1] == ':') { buf = malloc (strlen (ptr + 2) + 1); if (buf) { len = r_hex_str2bin (ptr + 2, buf); r_core_block_size (core, R_ABS(len)); memcpy (core->block, buf, core->blocksize); core->fixedblock = true; free (buf); } else { eprintf ("cannot allocate\n"); } } else { eprintf ("Invalid @x: syntax\n"); } break; case 'k': // "@k" { char *out = sdb_querys (core->sdb, NULL, 0, ptr + ((ptr[1])? 2: 1)); if (out) { r_core_seek (core, r_num_math (core->num, out), 1); free (out); } } break; case 'o': // "@o:3" if (ptr[1] == ':') { tmpfd = core->io->raised; r_io_raise (core->io, atoi (ptr + 2)); } break; case 'a': // "@a:" if (ptr[1] == ':') { char *q = strchr (ptr + 2, ':'); tmpasm = strdup (r_config_get (core->config, "asm.arch")); if (q) { *q++ = 0; tmpbits = r_config_get (core->config, "asm.bits"); r_config_set (core->config, "asm.bits", q); } r_config_set (core->config, "asm.arch", ptr + 2); // TODO: handle asm.bits } else { eprintf ("Usage: pd 10 @a:arm:32\n"); } break; case 's': // "@s:" len = strlen (ptr + 2); r_core_block_size (core, len); memcpy (core->block, ptr + 2, len); break; default: goto ignore; } *ptr = '@'; goto next_arroba; //ignore; //return ret; } ignore: ptr = r_str_trim_head (ptr + 1); ptr--; cmd = r_str_clean (cmd); if (ptr2) { if (strlen (ptr + 1) == 13 && strlen (ptr2 + 1) == 6 && !memcmp (ptr + 1, "0x", 2) && !memcmp (ptr2 + 1, "0x", 2)) { /* 0xXXXX:0xYYYY */ } else if (strlen (ptr + 1) == 9 && strlen (ptr2 + 1) == 4) { /* XXXX:YYYY */ } else { *ptr2 = '\0'; if (!ptr2[1]) { goto fail; } r_core_block_size ( core, r_num_math (core->num, ptr2 + 1)); } } offstr = r_str_trim_head (ptr + 1); addr = r_num_math (core->num, offstr); if (isalpha ((unsigned char)ptr[1]) && !addr) { if (!r_flag_get (core->flags, ptr + 1)) { eprintf ("Invalid address (%s)\n", ptr + 1); goto fail; } } else { char ch = *offstr; if (ch == '-' || ch == '+') { addr = core->offset + addr; } } next_arroba: if (arroba) { ptr = arroba; arroba = NULL; goto repeat_arroba; } if (ptr[1] == '@') { // TODO: remove temporally seek (should be done by cmd_foreach) if (ptr[2] == '@') { char *rule = ptr + 3; while (*rule && *rule == ' ') rule++; ret = r_core_cmd_foreach3 (core, cmd, rule); } else { ret = r_core_cmd_foreach (core, cmd, ptr + 2); } //ret = -1; /* do not run out-of-foreach cmd */ } else { bool tmpseek = false; const char *fromvars[] = { "anal.from", "diff.from", "graph.from", "io.buffer.from", "lines.from", "search.from", "zoom.from", NULL }; const char *tovars[] = { "anal.to", "diff.to", "graph.to", "io.buffer.to", "lines.to", "search.to", "zoom.to", NULL }; ut64 curfrom[R_ARRAY_SIZE (fromvars) - 1], curto[R_ARRAY_SIZE (tovars) - 1]; // @.. if (ptr[1] == '.' && ptr[2] == '.') { char *range = ptr + 3; char *p = strchr (range, ' '); if (!p) { eprintf ("Usage: / ABCD @..0x1000 0x3000\n"); free (tmpeval); free (tmpasm); goto fail; } *p = '\x00'; ut64 from = r_num_math (core->num, range); ut64 to = r_num_math (core->num, p + 1); // save current ranges for (i = 0; fromvars[i]; i++) { curfrom[i] = r_config_get_i (core->config, fromvars[i]); } for (i = 0; tovars[i]; i++) { curto[i] = r_config_get_i (core->config, tovars[i]); } // set new ranges for (i = 0; fromvars[i]; i++) { r_config_set_i (core->config, fromvars[i], from); } for (i = 0; tovars[i]; i++) { r_config_set_i (core->config, tovars[i], to); } tmpseek = true; } if (usemyblock) { if (addr != UT64_MAX) { core->offset = addr; } ret = r_cmd_call (core->rcmd, r_str_trim_head (cmd)); } else { if (addr != UT64_MAX) { if (!ptr[1] || r_core_seek (core, addr, 1)) { r_core_block_read (core); ret = r_cmd_call (core->rcmd, r_str_trim_head (cmd)); } else { ret = 0; } } } if (tmpseek) { // restore ranges for (i = 0; fromvars[i]; i++) { r_config_set_i (core->config, fromvars[i], curfrom[i]); } for (i = 0; tovars[i]; i++) { r_config_set_i (core->config, tovars[i], curto[i]); } } } if (ptr2) { *ptr2 = '!'; r_core_block_size (core, tmpbsz); } if (tmpasm) { r_config_set (core->config, "asm.arch", tmpasm); tmpasm = NULL; } if (tmpfd != -1) { r_io_raise (core->io, tmpfd); } if (tmpbits) { r_config_set (core->config, "asm.bits", tmpbits); tmpbits = NULL; } if (tmpeval) { r_core_cmd0 (core, tmpeval); R_FREE (tmpeval); } r_core_seek (core, tmpoff, 1); *ptr = '@'; rc = ret; goto beach; } rc = cmd? r_cmd_call (core->rcmd, r_str_trim_head (cmd)): false; beach: if (scr_html != -1) { r_cons_flush (); r_config_set_i (core->config, "scr.html", scr_html); } if (scr_color != -1) { r_config_set_i (core->config, "scr.color", scr_color); } core->fixedblock = false; return rc; fail: rc = -1; goto beach; }
4430
True
1