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-2021-40818 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://bugs.debian.org/993867', 'name': 'https://bugs.debian.org/993867', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/babelouest/glewlwyd/commit/0efd112bb62f566877750ad62ee828bff579b4e2', 'name': 'https://github.com/babelouest/glewlwyd/commit/0efd112bb62f566877750ad62ee828bff579b4e2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:glewlwyd_sso_server_project:glewlwyd_sso_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.5.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'scheme/webauthn.c in Glewlwyd SSO server through 2.5.3 has a buffer overflow during FIDO2 signature validation in webauthn registration.'}] | 2021-09-15T14:59Z | 2021-09-08T22:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | babelouest | 2021-06-14 19:40:56-04:00 | Fix fido2 signature validation bug | 0efd112bb62f566877750ad62ee828bff579b4e2 | False | babelouest/glewlwyd | Experimental Single Sign On server, OAuth2, Openid Connect, multiple factor authentication with, HOTP/TOTP, FIDO2, TLS Certificates, etc. extensible via plugins | 2016-11-30 04:26:49 | 2022-08-24 11:25:55 | https://babelouest.github.io/glewlwyd | babelouest | 394.0 | 84.0 | check_attestation_fido_u2f | check_attestation_fido_u2f( json_t * j_params , unsigned char * credential_id , size_t credential_id_len , unsigned char * cert_x , size_t cert_x_len , unsigned char * cert_y , size_t cert_y_len , cbor_item_t * att_stmt , unsigned char * rpid_hash , size_t rpid_hash_len , const unsigned char * client_data) | ['j_params', 'credential_id', 'credential_id_len', 'cert_x', 'cert_x_len', 'cert_y', 'cert_y_len', 'att_stmt', 'rpid_hash', 'rpid_hash_len', 'client_data'] | static json_t * check_attestation_fido_u2f(json_t * j_params, unsigned char * credential_id, size_t credential_id_len, unsigned char * cert_x, size_t cert_x_len, unsigned char * cert_y, size_t cert_y_len, cbor_item_t * att_stmt, unsigned char * rpid_hash, size_t rpid_hash_len, const unsigned char * client_data) {
json_t * j_error = json_array(), * j_return;
cbor_item_t * key = NULL, * x5c = NULL, * sig = NULL, * att_cert = NULL;
int i, ret;
char * message = NULL;
gnutls_pubkey_t pubkey = NULL;
gnutls_x509_crt_t cert = NULL;
gnutls_datum_t cert_dat, data, signature, cert_issued_by;
unsigned char data_signed[200], client_data_hash[32], cert_export[32], cert_export_b64[64];
size_t data_signed_offset = 0, client_data_hash_len = 32, cert_export_len = 32, cert_export_b64_len = 0;
if (j_error != NULL) {
do {
if (gnutls_x509_crt_init(&cert)) {
json_array_append_new(j_error, json_string("check_attestation_fido_u2f - Error gnutls_x509_crt_init"));
break;
}
if (gnutls_pubkey_init(&pubkey)) {
json_array_append_new(j_error, json_string("check_attestation_fido_u2f - Error gnutls_pubkey_init"));
break;
}
// Step 1
if (att_stmt == NULL || !cbor_isa_map(att_stmt) || cbor_map_size(att_stmt) != 2) {
json_array_append_new(j_error, json_string("CBOR map value 'attStmt' invalid format"));
break;
}
for (i=0; i<2; i++) {
key = cbor_map_handle(att_stmt)[i].key;
if (cbor_isa_string(key)) {
if (0 == o_strncmp((const char *)cbor_string_handle(key), "x5c", MIN(o_strlen("x5c"), cbor_string_length(key)))) {
x5c = cbor_map_handle(att_stmt)[i].value;
} else if (0 == o_strncmp((const char *)cbor_string_handle(key), "sig", MIN(o_strlen("sig"), cbor_string_length(key)))) {
sig = cbor_map_handle(att_stmt)[i].value;
} else {
message = msprintf("attStmt map element %d key is not valid: '%.*s'", i, cbor_string_length(key), cbor_string_handle(key));
json_array_append_new(j_error, json_string(message));
o_free(message);
break;
}
} else {
message = msprintf("attStmt map element %d key is not a string", i);
json_array_append_new(j_error, json_string(message));
o_free(message);
break;
}
}
if (x5c == NULL || !cbor_isa_array(x5c) || cbor_array_size(x5c) != 1) {
json_array_append_new(j_error, json_string("CBOR map value 'x5c' invalid format"));
break;
}
att_cert = cbor_array_get(x5c, 0);
cert_dat.data = cbor_bytestring_handle(att_cert);
cert_dat.size = cbor_bytestring_length(att_cert);
if ((ret = gnutls_x509_crt_import(cert, &cert_dat, GNUTLS_X509_FMT_DER)) < 0) {
json_array_append_new(j_error, json_string("Error importing x509 certificate"));
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_fido_u2f - Error gnutls_pcert_import_x509_raw: %d", ret);
break;
}
if (json_object_get(j_params, "root-ca-list") != json_null() && validate_certificate_from_root(j_params, cert, x5c) != G_OK) {
json_array_append_new(j_error, json_string("Unrecognized certificate authority"));
if (gnutls_x509_crt_get_issuer_dn2(cert, &cert_issued_by) >= 0) {
message = msprintf("Unrecognized certificate autohority: %.*s", cert_issued_by.size, cert_issued_by.data);
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_fido_u2f - %s", message);
o_free(message);
gnutls_free(cert_issued_by.data);
} else {
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_fido_u2f - Unrecognized certificate autohority (unable to get issuer dn)");
}
break;
}
if ((ret = gnutls_pubkey_import_x509(pubkey, cert, 0)) < 0) {
json_array_append_new(j_error, json_string("Error importing x509 certificate"));
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_fido_u2f - Error gnutls_pubkey_import_x509: %d", ret);
break;
}
if ((ret = gnutls_x509_crt_get_key_id(cert, GNUTLS_KEYID_USE_SHA256, cert_export, &cert_export_len)) < 0) {
json_array_append_new(j_error, json_string("Error exporting x509 certificate"));
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_fido_u2f - Error gnutls_x509_crt_get_key_id: %d", ret);
break;
}
if (!o_base64_encode(cert_export, cert_export_len, cert_export_b64, &cert_export_b64_len)) {
json_array_append_new(j_error, json_string("Internal error"));
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_fido_u2f - Error o_base64_encode cert_export");
break;
}
if (!generate_digest_raw(digest_SHA256, client_data, o_strlen((char *)client_data), client_data_hash, &client_data_hash_len)) {
json_array_append_new(j_error, json_string("Internal error"));
y_log_message(Y_LOG_LEVEL_ERROR, "check_attestation_fido_u2f - Error generate_digest_raw client_data");
break;
}
if (sig == NULL || !cbor_isa_bytestring(sig)) {
json_array_append_new(j_error, json_string("Error sig is not a bytestring"));
break;
}
// Build bytestring to verify signature
data_signed[0] = 0x0;
data_signed_offset = 1;
memcpy(data_signed+data_signed_offset, rpid_hash, rpid_hash_len);
data_signed_offset += rpid_hash_len;
memcpy(data_signed+data_signed_offset, client_data_hash, client_data_hash_len);
data_signed_offset+=client_data_hash_len;
memcpy(data_signed+data_signed_offset, credential_id, credential_id_len);
data_signed_offset+=credential_id_len;
data_signed[data_signed_offset] = 0x04;
data_signed_offset++;
memcpy(data_signed+data_signed_offset, cert_x, cert_x_len);
data_signed_offset+=cert_x_len;
memcpy(data_signed+data_signed_offset, cert_y, cert_y_len);
data_signed_offset+=cert_y_len;
// Let's verify sig over data_signed
data.data = data_signed;
data.size = data_signed_offset;
signature.data = cbor_bytestring_handle(sig);
signature.size = cbor_bytestring_length(sig);
if (gnutls_pubkey_verify_data2(pubkey, GNUTLS_SIGN_ECDSA_SHA256, 0, &data, &signature)) {
json_array_append_new(j_error, json_string("Invalid signature"));
}
} while (0);
if (json_array_size(j_error)) {
j_return = json_pack("{sisO}", "result", G_ERROR_PARAM, "error", j_error);
} else {
j_return = json_pack("{sis{ss%}}", "result", G_OK, "data", "certificate", cert_export_b64, cert_export_b64_len);
}
json_decref(j_error);
gnutls_pubkey_deinit(pubkey);
gnutls_x509_crt_deinit(cert);
if (att_cert != NULL) {
cbor_decref(&att_cert);
}
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "check_attestation_fido_u2f - Error allocating resources for j_error");
j_return = json_pack("{si}", "result", G_ERROR);
}
return j_return;
} | 1084 | True | 1 |
CVE-2021-45379 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/babelouest/glewlwyd/releases/tag/v2.6.1', 'name': 'https://github.com/babelouest/glewlwyd/releases/tag/v2.6.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/babelouest/glewlwyd/commit/125281f1c0d4b6a8b49f7e55a757205a2ef01fbe', 'name': 'https://github.com/babelouest/glewlwyd/commit/125281f1c0d4b6a8b49f7e55a757205a2ef01fbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:glewlwyd_project:glewlwyd:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0.0', 'versionEndExcluding': '2.6.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Glewlwyd 2.0.0, fixed in 2.6.1 is affected by an incorrect access control vulnerability. One user can attempt to log in as another user without its password.'}] | 2022-07-12T17:42Z | 2021-12-30T18:15Z | 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 | babelouest | 2021-12-15 09:49:03-05:00 | Fix update session when auth fail | 125281f1c0d4b6a8b49f7e55a757205a2ef01fbe | False | babelouest/glewlwyd | Experimental Single Sign On server, OAuth2, Openid Connect, multiple factor authentication with, HOTP/TOTP, FIDO2, TLS Certificates, etc. extensible via plugins | 2016-11-30 04:26:49 | 2022-08-24 11:25:55 | https://babelouest.github.io/glewlwyd | babelouest | 394.0 | 84.0 | callback_glewlwyd_user_auth | callback_glewlwyd_user_auth( const struct _u_request * request , struct _u_response * response , void * user_data) | ['request', 'response', 'user_data'] | int callback_glewlwyd_user_auth (const struct _u_request * request, struct _u_response * response, void * user_data) {
struct config_elements * config = (struct config_elements *)user_data;
json_t * j_param = ulfius_get_json_body_request(request, NULL), * j_result = NULL;
const char * ip_source = get_ip_source(request);
char * issued_for = get_client_hostname(request);
char * session_uid, expires[129];
time_t now;
struct tm ts;
time(&now);
now += GLEWLWYD_DEFAULT_SESSION_EXPIRATION_COOKIE;
gmtime_r(&now, &ts);
strftime(expires, 128, "%a, %d %b %Y %T %Z", &ts);
if (j_param != NULL) {
if (json_string_length(json_object_get(j_param, "username"))) {
if (json_object_get(j_param, "scheme_type") == NULL || 0 == o_strcmp(json_string_value(json_object_get(j_param, "scheme_type")), "password")) {
if (json_string_length(json_object_get(j_param, "password"))) {
j_result = auth_check_user_credentials(config, json_string_value(json_object_get(j_param, "username")), json_string_value(json_object_get(j_param, "password")));
if (check_result_value(j_result, G_OK)) {
if ((session_uid = get_session_id(config, request)) == NULL) {
session_uid = generate_session_id();
}
if (user_session_update(config, session_uid, u_map_get_case(request->map_header, "user-agent"), issued_for, json_string_value(json_object_get(j_param, "username")), NULL, 1) != G_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error user_session_update (1)");
response->status = 500;
} else {
ulfius_add_cookie_to_response(response, config->session_key, session_uid, expires, 0, config->cookie_domain, "/", config->cookie_secure, 0);
y_log_message(Y_LOG_LEVEL_INFO, "Event - User '%s' authenticated with password", json_string_value(json_object_get(j_param, "username")));
}
o_free(session_uid);
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_VALID, 1, NULL);
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_VALID_SCHEME, 1, "scheme_type", "password", NULL);
} else {
if (check_result_value(j_result, G_ERROR_UNAUTHORIZED)) {
y_log_message(Y_LOG_LEVEL_WARNING, "Security - Authorization invalid for username %s at IP Address %s", json_string_value(json_object_get(j_param, "username")), ip_source);
}
if ((session_uid = get_session_id(config, request)) != NULL && user_session_update(config, session_uid, u_map_get_case(request->map_header, "user-agent"), issued_for, json_string_value(json_object_get(j_param, "username")), NULL, 1) != G_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error user_session_update (2)");
}
o_free(session_uid);
response->status = 401;
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_INVALID, 1, NULL);
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_INVALID_SCHEME, 1, "scheme_type", "password", NULL);
}
json_decref(j_result);
} else if (json_object_get(j_param, "password") != NULL && !json_is_string(json_object_get(j_param, "password"))) {
ulfius_set_string_body_response(response, 400, "password must be a string");
} else {
session_uid = get_session_id(config, request);
j_result = get_users_for_session(config, session_uid);
if (check_result_value(j_result, G_OK)) {
// Refresh username to set as default
if (user_session_update(config, u_map_get(request->map_cookie, config->session_key), u_map_get_case(request->map_header, "user-agent"), issued_for, json_string_value(json_object_get(j_param, "username")), NULL, 0) != G_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error user_session_update (3)");
response->status = 500;
} else {
ulfius_add_cookie_to_response(response, config->session_key, session_uid, expires, 0, config->cookie_domain, "/", config->cookie_secure, 0);
}
} else if (check_result_value(j_result, G_ERROR_NOT_FOUND)) {
response->status = 401;
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error get_users_for_session");
response->status = 500;
}
o_free(session_uid);
json_decref(j_result);
}
} else {
if (json_string_length(json_object_get(j_param, "scheme_type")) && json_string_length(json_object_get(j_param, "scheme_name")) && json_is_object(json_object_get(j_param, "value"))) {
j_result = auth_check_user_scheme(config, json_string_value(json_object_get(j_param, "scheme_type")), json_string_value(json_object_get(j_param, "scheme_name")), json_string_value(json_object_get(j_param, "username")), json_object_get(j_param, "value"), request);
if (check_result_value(j_result, G_ERROR_PARAM)) {
ulfius_set_string_body_response(response, 400, "bad scheme response");
} else if (check_result_value(j_result, G_ERROR_UNAUTHORIZED)) {
y_log_message(Y_LOG_LEVEL_WARNING, "Security - Authorization invalid for username %s at IP Address %s", json_string_value(json_object_get(j_param, "username")), ip_source);
response->status = 401;
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_INVALID, 1, NULL);
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_INVALID_SCHEME, 1, "scheme_type", json_string_value(json_object_get(j_param, "scheme_type")), "scheme_name", json_string_value(json_object_get(j_param, "scheme_name")), NULL);
} else if (check_result_value(j_result, G_ERROR_NOT_FOUND)) {
response->status = 404;
} else if (check_result_value(j_result, G_OK)) {
if ((session_uid = get_session_id(config, request)) == NULL) {
session_uid = generate_session_id();
}
if (user_session_update(config, session_uid, u_map_get_case(request->map_header, "user-agent"), issued_for, json_string_value(json_object_get(j_param, "username")), json_string_value(json_object_get(j_param, "scheme_name")), 1) != G_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error user_session_update (4)");
response->status = 500;
} else {
ulfius_add_cookie_to_response(response, config->session_key, session_uid, expires, 0, config->cookie_domain, "/", config->cookie_secure, 0);
y_log_message(Y_LOG_LEVEL_INFO, "Event - User '%s' authenticated with scheme '%s/%s'", json_string_value(json_object_get(j_param, "username")), json_string_value(json_object_get(j_param, "scheme_type")), json_string_value(json_object_get(j_param, "scheme_name")));
}
o_free(session_uid);
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_VALID, 1, NULL);
glewlwyd_metrics_increment_counter_va(config, GLWD_METRICS_AUTH_USER_VALID_SCHEME, 1, "scheme_type", json_string_value(json_object_get(j_param, "scheme_type")), "scheme_name", json_string_value(json_object_get(j_param, "scheme_name")), NULL);
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error auth_check_user_scheme");
response->status = 500;
}
json_decref(j_result);
} else {
ulfius_set_string_body_response(response, 400, "scheme_type, scheme_name and value are mandatory");
}
}
} else {
if (json_string_length(json_object_get(j_param, "scheme_type")) && json_string_length(json_object_get(j_param, "scheme_name")) && json_is_object(json_object_get(j_param, "value"))) {
j_result = auth_check_identify_scheme(config, json_string_value(json_object_get(j_param, "scheme_type")), json_string_value(json_object_get(j_param, "scheme_name")), json_object_get(j_param, "value"), request);
if (check_result_value(j_result, G_ERROR_PARAM)) {
ulfius_set_string_body_response(response, 400, "bad scheme response");
} else if (check_result_value(j_result, G_ERROR_UNAUTHORIZED)) {
y_log_message(Y_LOG_LEVEL_WARNING, "Security - Authorization invalid for username <UNKNOWN> at IP Address %s", ip_source);
response->status = 401;
} else if (check_result_value(j_result, G_ERROR_NOT_FOUND)) {
response->status = 404;
} else if (check_result_value(j_result, G_OK)) {
if ((session_uid = get_session_id(config, request)) == NULL) {
session_uid = generate_session_id();
}
if (user_session_update(config, session_uid, u_map_get_case(request->map_header, "user-agent"), issued_for, json_string_value(json_object_get(j_result, "username")), json_string_value(json_object_get(j_param, "scheme_name")), 1) != G_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error user_session_update (4)");
response->status = 500;
} else {
ulfius_add_cookie_to_response(response, config->session_key, session_uid, expires, 0, config->cookie_domain, "/", config->cookie_secure, 0);
y_log_message(Y_LOG_LEVEL_INFO, "Event - User '%s' authenticated with scheme '%s/%s'", json_string_value(json_object_get(j_result, "username")), json_string_value(json_object_get(j_param, "scheme_type")), json_string_value(json_object_get(j_param, "scheme_name")));
}
o_free(session_uid);
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_glewlwyd_user_auth - Error auth_check_user_scheme");
response->status = 500;
}
json_decref(j_result);
} else {
ulfius_set_string_body_response(response, 400, "username is mandatory");
}
}
} else {
ulfius_set_string_body_response(response, 400, "Input parameters must be in JSON format");
}
json_decref(j_param);
o_free(issued_for);
return U_CALLBACK_CONTINUE;
} | 1513 | True | 1 |
|
CVE-2022-29967 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/babelouest/glewlwyd/commit/e3f7245c33897bf9b3a75acfcdb8b7b93974bf11', 'name': 'https://github.com/babelouest/glewlwyd/commit/e3f7245c33897bf9b3a75acfcdb8b7b93974bf11', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:glewlwyd_project:glewlwyd:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.6.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'static_compressed_inmemory_website_callback.c in Glewlwyd through 2.6.2 allows directory traversal.'}] | 2022-05-10T15:56Z | 2022-04-29T23:15Z | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Many file operations are intended to take place within a restricted directory. By using special elements such as ".." and "/" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the "../" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as "/usr/local/bin", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add ".txt" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.
| https://cwe.mitre.org/data/definitions/22.html | 0 | babelouest | 2022-04-29 07:26:44-04:00 | Fix file access check for directory traversal, and fix call for callback_static_file_uncompressed if header not set | e3f7245c33897bf9b3a75acfcdb8b7b93974bf11 | False | babelouest/glewlwyd | Experimental Single Sign On server, OAuth2, Openid Connect, multiple factor authentication with, HOTP/TOTP, FIDO2, TLS Certificates, etc. extensible via plugins | 2016-11-30 04:26:49 | 2022-08-24 11:25:55 | https://babelouest.github.io/glewlwyd | babelouest | 394.0 | 84.0 | callback_static_compressed_inmemory_website | callback_static_compressed_inmemory_website( const struct _u_request * request , struct _u_response * response , void * user_data) | ['request', 'response', 'user_data'] | int callback_static_compressed_inmemory_website (const struct _u_request * request, struct _u_response * response, void * user_data) {
struct _u_compressed_inmemory_website_config * config = (struct _u_compressed_inmemory_website_config *)user_data;
char ** accept_list = NULL;
int ret = U_CALLBACK_CONTINUE, compress_mode = U_COMPRESS_NONE, res;
z_stream defstream;
unsigned char * file_content, * file_content_orig = NULL;
size_t length, read_length, offset, data_zip_len = 0;
FILE * f;
char * file_requested, * file_path, * url_dup_save, * data_zip = NULL;
const char * content_type;
/*
* Comment this if statement if you don't access static files url from root dir, like /app
*/
if (request->callback_position > 0) {
return U_CALLBACK_IGNORE;
} else {
file_requested = o_strdup(request->http_url);
url_dup_save = file_requested;
file_requested += o_strlen((config->url_prefix));
while (file_requested[0] == '/') {
file_requested++;
}
if (strchr(file_requested, '#') != NULL) {
*strchr(file_requested, '#') = '\0';
}
if (strchr(file_requested, '?') != NULL) {
*strchr(file_requested, '?') = '\0';
}
if (file_requested == NULL || o_strnullempty(file_requested) || 0 == o_strcmp("/", file_requested)) {
o_free(url_dup_save);
url_dup_save = file_requested = o_strdup("index.html");
}
if (!u_map_has_key_case(response->map_header, U_CONTENT_HEADER)) {
if (split_string(u_map_get_case(request->map_header, U_ACCEPT_HEADER), ",", &accept_list)) {
if (config->allow_gzip && string_array_has_trimmed_value((const char **)accept_list, U_ACCEPT_GZIP)) {
compress_mode = U_COMPRESS_GZIP;
} else if (config->allow_deflate && string_array_has_trimmed_value((const char **)accept_list, U_ACCEPT_DEFLATE)) {
compress_mode = U_COMPRESS_DEFL;
}
if (compress_mode != U_COMPRESS_NONE) {
if (compress_mode == U_COMPRESS_GZIP && config->allow_cache_compressed && u_map_has_key(&config->gzip_files, file_requested)) {
ulfius_set_binary_body_response(response, 200, u_map_get(&config->gzip_files, file_requested), u_map_get_length(&config->gzip_files, file_requested));
u_map_put(response->map_header, U_CONTENT_HEADER, U_ACCEPT_GZIP);
content_type = u_map_get_case(&config->mime_types, get_filename_ext(file_requested));
if (content_type == NULL) {
content_type = u_map_get(&config->mime_types, "*");
}
u_map_put(response->map_header, "Content-Type", content_type);
u_map_copy_into(response->map_header, &config->map_header);
} else if (compress_mode == U_COMPRESS_DEFL && config->allow_cache_compressed && u_map_has_key(&config->deflate_files, file_requested)) {
ulfius_set_binary_body_response(response, 200, u_map_get(&config->deflate_files, file_requested), u_map_get_length(&config->deflate_files, file_requested));
u_map_put(response->map_header, U_CONTENT_HEADER, U_ACCEPT_DEFLATE);
content_type = u_map_get_case(&config->mime_types, get_filename_ext(file_requested));
if (content_type == NULL) {
content_type = u_map_get(&config->mime_types, "*");
}
u_map_put(response->map_header, "Content-Type", content_type);
u_map_copy_into(response->map_header, &config->map_header);
} else {
file_path = msprintf("%s/%s", ((struct _u_compressed_inmemory_website_config *)user_data)->files_path, file_requested);
if (!pthread_mutex_lock(&config->lock)) {
f = fopen (file_path, "rb");
if (f) {
content_type = u_map_get_case(&config->mime_types, get_filename_ext(file_requested));
if (content_type == NULL) {
content_type = u_map_get(&config->mime_types, "*");
y_log_message(Y_LOG_LEVEL_WARNING, "Static File Server - Unknown mime type for extension %s", get_filename_ext(file_requested));
}
if (!string_array_has_value((const char **)config->mime_types_compressed, content_type)) {
compress_mode = U_COMPRESS_NONE;
}
u_map_put(response->map_header, "Content-Type", content_type);
u_map_copy_into(response->map_header, &config->map_header);
fseek (f, 0, SEEK_END);
offset = length = ftell (f);
fseek (f, 0, SEEK_SET);
if (length) {
if ((file_content_orig = file_content = o_malloc(length)) != NULL && (data_zip = o_malloc((2*length)+20)) != NULL) {
defstream.zalloc = u_zalloc;
defstream.zfree = u_zfree;
defstream.opaque = Z_NULL;
defstream.avail_in = (uInt)length;
defstream.next_in = (Bytef *)file_content;
while ((read_length = fread(file_content, sizeof(char), offset, f))) {
file_content += read_length;
offset -= read_length;
}
if (compress_mode == U_COMPRESS_GZIP) {
if (deflateInit2(&defstream,
Z_DEFAULT_COMPRESSION,
Z_DEFLATED,
U_GZIP_WINDOW_BITS | U_GZIP_ENCODING,
8,
Z_DEFAULT_STRATEGY) != Z_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_static_compressed_inmemory_website - Error deflateInit (gzip)");
ret = U_CALLBACK_ERROR;
}
} else {
if (deflateInit(&defstream, Z_BEST_COMPRESSION) != Z_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_static_compressed_inmemory_website - Error deflateInit (deflate)");
ret = U_CALLBACK_ERROR;
}
}
if (ret == U_CALLBACK_CONTINUE) {
do {
if ((data_zip = o_realloc(data_zip, data_zip_len+_U_W_BLOCK_SIZE)) != NULL) {
defstream.avail_out = _U_W_BLOCK_SIZE;
defstream.next_out = ((Bytef *)data_zip)+data_zip_len;
switch ((res = deflate(&defstream, Z_FINISH))) {
case Z_OK:
case Z_STREAM_END:
case Z_BUF_ERROR:
break;
default:
y_log_message(Y_LOG_LEVEL_ERROR, "callback_static_compressed_inmemory_website - Error deflate %d", res);
ret = U_CALLBACK_ERROR;
break;
}
data_zip_len += _U_W_BLOCK_SIZE - defstream.avail_out;
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_static_compressed_inmemory_website - Error allocating resources for data_zip");
ret = U_CALLBACK_ERROR;
}
} while (U_CALLBACK_CONTINUE == ret && defstream.avail_out == 0);
if (ret == U_CALLBACK_CONTINUE) {
if (compress_mode == U_COMPRESS_GZIP) {
if (config->allow_cache_compressed) {
u_map_put_binary(&config->gzip_files, file_requested, data_zip, 0, defstream.total_out);
}
ulfius_set_binary_body_response(response, 200, u_map_get(&config->gzip_files, file_requested), u_map_get_length(&config->gzip_files, file_requested));
} else {
if (config->allow_cache_compressed) {
u_map_put_binary(&config->deflate_files, file_requested, data_zip, 0, defstream.total_out);
}
ulfius_set_binary_body_response(response, 200, u_map_get(&config->deflate_files, file_requested), u_map_get_length(&config->deflate_files, file_requested));
}
u_map_put(response->map_header, U_CONTENT_HEADER, compress_mode==U_COMPRESS_GZIP?U_ACCEPT_GZIP:U_ACCEPT_DEFLATE);
}
}
deflateEnd(&defstream);
o_free(data_zip);
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_static_compressed_inmemory_website - Error allocating resource for file_content or data_zip");
ret = U_CALLBACK_ERROR;
}
o_free(file_content_orig);
}
fclose(f);
} else {
if (((struct _u_compressed_inmemory_website_config *)user_data)->redirect_on_404 == NULL) {
ret = U_CALLBACK_IGNORE;
} else {
ulfius_add_header_to_response(response, "Location", ((struct _u_compressed_inmemory_website_config *)user_data)->redirect_on_404);
response->status = 302;
}
}
pthread_mutex_unlock(&config->lock);
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "callback_static_compressed_inmemory_website - Error pthread_lock_mutex");
ret = U_CALLBACK_ERROR;
}
o_free(file_path);
}
} else {
ret = callback_static_file_uncompressed(request, response, user_data);
}
free_string_array(accept_list);
}
}
o_free(url_dup_save);
}
return ret;
} | 1321 | True | 1 |
CVE-2022-29967 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/babelouest/glewlwyd/commit/e3f7245c33897bf9b3a75acfcdb8b7b93974bf11', 'name': 'https://github.com/babelouest/glewlwyd/commit/e3f7245c33897bf9b3a75acfcdb8b7b93974bf11', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:glewlwyd_project:glewlwyd:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.6.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'static_compressed_inmemory_website_callback.c in Glewlwyd through 2.6.2 allows directory traversal.'}] | 2022-05-10T15:56Z | 2022-04-29T23:15Z | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Many file operations are intended to take place within a restricted directory. By using special elements such as ".." and "/" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the "../" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as "/usr/local/bin", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add ".txt" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.
| https://cwe.mitre.org/data/definitions/22.html | 0 | babelouest | 2022-04-29 07:26:44-04:00 | Fix file access check for directory traversal, and fix call for callback_static_file_uncompressed if header not set | e3f7245c33897bf9b3a75acfcdb8b7b93974bf11 | False | babelouest/glewlwyd | Experimental Single Sign On server, OAuth2, Openid Connect, multiple factor authentication with, HOTP/TOTP, FIDO2, TLS Certificates, etc. extensible via plugins | 2016-11-30 04:26:49 | 2022-08-24 11:25:55 | https://babelouest.github.io/glewlwyd | babelouest | 394.0 | 84.0 | callback_static_file_uncompressed | callback_static_file_uncompressed( const struct _u_request * request , struct _u_response * response , void * user_data) | ['request', 'response', 'user_data'] | static int callback_static_file_uncompressed (const struct _u_request * request, struct _u_response * response, void * user_data) {
size_t length;
FILE * f;
char * file_requested, * file_path, * url_dup_save;
const char * content_type;
int ret = U_CALLBACK_CONTINUE;
if (user_data != NULL && ((struct _u_compressed_inmemory_website_config *)user_data)->files_path != NULL) {
file_requested = o_strdup(request->http_url);
url_dup_save = file_requested;
file_requested += o_strlen(((struct _u_compressed_inmemory_website_config *)user_data)->url_prefix);
while (file_requested[0] == '/') {
file_requested++;
}
if (strchr(file_requested, '#') != NULL) {
*strchr(file_requested, '#') = '\0';
}
if (strchr(file_requested, '?') != NULL) {
*strchr(file_requested, '?') = '\0';
}
if (file_requested == NULL || o_strnullempty(file_requested) || 0 == o_strcmp("/", file_requested)) {
o_free(url_dup_save);
url_dup_save = file_requested = o_strdup("index.html");
}
file_path = msprintf("%s/%s", ((struct _u_compressed_inmemory_website_config *)user_data)->files_path, file_requested);
f = fopen (file_path, "rb");
if (f) {
fseek (f, 0, SEEK_END);
length = ftell (f);
fseek (f, 0, SEEK_SET);
content_type = u_map_get_case(&((struct _u_compressed_inmemory_website_config *)user_data)->mime_types, get_filename_ext(file_requested));
if (content_type == NULL) {
content_type = u_map_get(&((struct _u_compressed_inmemory_website_config *)user_data)->mime_types, "*");
y_log_message(Y_LOG_LEVEL_WARNING, "Static File Server - Unknown mime type for extension %s", get_filename_ext(file_requested));
}
u_map_put(response->map_header, "Content-Type", content_type);
u_map_copy_into(response->map_header, &((struct _u_compressed_inmemory_website_config *)user_data)->map_header);
if (ulfius_set_stream_response(response, 200, callback_static_file_uncompressed_stream, callback_static_file_uncompressed_stream_free, length, CHUNK, f) != U_OK) {
y_log_message(Y_LOG_LEVEL_ERROR, "Static File Server - Error ulfius_set_stream_response");
}
} else {
if (((struct _u_compressed_inmemory_website_config *)user_data)->redirect_on_404 == NULL) {
ret = U_CALLBACK_IGNORE;
} else {
ulfius_add_header_to_response(response, "Location", ((struct _u_compressed_inmemory_website_config *)user_data)->redirect_on_404);
response->status = 302;
}
}
o_free(file_path);
o_free(url_dup_save);
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "Static File Server - Error, user_data is NULL or inconsistent");
ret = U_CALLBACK_ERROR;
}
return ret;
} | 451 | True | 1 |
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::AuthChecker::PassUserInfoOnSuccess | google::api_manager::AuthChecker::PassUserInfoOnSuccess() | [] | void AuthChecker::PassUserInfoOnSuccess() {
char *json_buf = auth::WriteUserInfoToJson(user_info_);
if (json_buf == nullptr) {
return;
}
char *base64_json_buf = auth::esp_base64_encode(
json_buf, strlen(json_buf), true, false, true /*padding*/);
context_->request()->AddHeaderToBackend(auth::kEndpointApiUserInfo,
base64_json_buf);
auth::esp_grpc_free(json_buf);
auth::esp_grpc_free(base64_json_buf);
TRACE(trace_span_) << "Authenticated.";
trace_span_.reset();
on_done_(Status::OK);
} | 100 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::CheckAuthTest::TestValidToken | google::api_manager::CheckAuthTest::TestValidToken( const std :: string & auth_token , const std :: string & user_info) | ['auth_token', 'user_info'] | void CheckAuthTest::TestValidToken(const std::string &auth_token,
const std::string &user_info) {
EXPECT_CALL(*raw_request_, FindHeader("x-goog-iap-jwt-assertion", _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = "";
return false;
}));
EXPECT_CALL(*raw_request_, FindHeader(kAuthHeader, _))
.WillOnce(Invoke([auth_token](const std::string &, std::string *token) {
*token = std::string(kBearer) + auth_token;
return true;
}));
EXPECT_CALL(*raw_request_, SetAuthToken(auth_token)).Times(1);
EXPECT_CALL(*raw_env_, DoRunHTTPRequest(_))
.Times(2)
.WillOnce(Invoke([](HTTPRequest *req) {
EXPECT_EQ(req->url(), kIssuer1OpenIdUrl);
std::string body(kOpenIdContent);
std::map<std::string, std::string> empty;
req->OnComplete(Status::OK, std::move(empty), std::move(body));
}))
.WillOnce(Invoke([](HTTPRequest *req) {
EXPECT_EQ(req->url(), kIssuer1PubkeyUrl);
std::string body(kPubkey);
std::map<std::string, std::string> empty;
req->OnComplete(Status::OK, std::move(empty), std::move(body));
}));
std::cout << "need be replaced: " << user_info << std::endl;
EXPECT_CALL(*raw_request_,
AddHeaderToBackend(kEndpointApiUserInfo, user_info))
.WillOnce(Return(utils::Status::OK));
CheckAuth(context_, [](Status status) { ASSERT_TRUE(status.ok()); });
} | 357 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::TEST_F | google::api_manager::TEST_F( CheckAuthTest , TestNoOpenId) | ['CheckAuthTest', 'TestNoOpenId'] | TEST_F(CheckAuthTest, TestNoOpenId) {
EXPECT_CALL(*raw_request_, FindHeader("x-goog-iap-jwt-assertion", _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = "";
return false;
}));
EXPECT_CALL(*raw_request_, FindHeader(kAuthHeader, _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = std::string(kBearer) + std::string(kTokenIssuer2);
return true;
}));
EXPECT_CALL(*raw_request_, SetAuthToken(kTokenIssuer2)).Times(1);
EXPECT_CALL(*raw_env_, DoRunHTTPRequest(_))
.WillOnce(Invoke([](HTTPRequest *req) {
EXPECT_EQ(req->url(), kIssuer2PubkeyUrl);
std::string body(kPubkey);
std::map<std::string, std::string> empty;
req->OnComplete(Status::OK, std::move(empty), std::move(body));
}));
EXPECT_CALL(*raw_request_,
AddHeaderToBackend(kEndpointApiUserInfo, kUserInfo_kSub_kIss2))
.WillOnce(Return(utils::Status::OK));
CheckAuth(context_, [](Status status) { ASSERT_TRUE(status.ok()); });
} | 257 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::TEST_F | google::api_manager::TEST_F( CheckAuthTest , TestOKAuth) | ['CheckAuthTest', 'TestOKAuth'] | TEST_F(CheckAuthTest, TestOKAuth) {
// Step 1. Check auth requires open ID discovery and fetching public key.
TestValidToken(kToken, kUserInfo_kSub2_kIss);
EXPECT_TRUE(Mock::VerifyAndClearExpectations(raw_request_));
EXPECT_TRUE(Mock::VerifyAndClearExpectations(raw_env_));
// Step 2. Check auth with the same auth token. This time the token is cached.
EXPECT_CALL(*raw_request_, FindHeader("x-goog-iap-jwt-assertion", _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = "";
return false;
}));
EXPECT_CALL(*raw_request_, FindHeader(kAuthHeader, _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = std::string(kBearer) + std::string(kToken);
return true;
}));
EXPECT_CALL(*raw_request_, SetAuthToken(kToken)).Times(1);
EXPECT_CALL(*raw_env_, DoRunHTTPRequest(_)).Times(0);
EXPECT_CALL(*raw_request_,
AddHeaderToBackend(kEndpointApiUserInfo, kUserInfo_kSub_kIss))
.WillOnce(Return(utils::Status::OK));
CheckAuth(context_, [](Status status) { ASSERT_TRUE(status.ok()); });
EXPECT_TRUE(Mock::VerifyAndClearExpectations(raw_request_));
EXPECT_TRUE(Mock::VerifyAndClearExpectations(raw_env_));
// Step 3. Check auth with a different token signed by the same issuer.
// In this case, the token is not in the cache, but key is cached.
EXPECT_CALL(*raw_request_, FindHeader("x-goog-iap-jwt-assertion", _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = "";
return false;
}));
EXPECT_CALL(*raw_request_, FindHeader(kAuthHeader, _))
.WillOnce(Invoke([](const std::string &, std::string *token) {
*token = std::string(kToken2);
return true;
}));
EXPECT_CALL(*raw_request_, SetAuthToken(kToken2)).Times(1);
EXPECT_CALL(*raw_env_, DoRunHTTPRequest(_)).Times(0);
EXPECT_CALL(*raw_request_,
AddHeaderToBackend(kEndpointApiUserInfo, kUserInfo_kSub2_kIss2))
.WillOnce(Return(utils::Status::OK));
CheckAuth(context_, [](Status status) { ASSERT_TRUE(status.ok()); });
} | 412 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::CheckServiceControl | google::api_manager::CheckServiceControl( std :: shared_ptr<context::RequestContext> context , std :: function<void(Status status)> continuation) | ['context', 'continuation'] | void CheckServiceControl(std::shared_ptr<context::RequestContext> context,
std::function<void(Status status)> continuation) {
std::shared_ptr<cloud_trace::CloudTraceSpan> trace_span(
CreateSpan(context->cloud_trace(), "CheckServiceControl"));
// If the method is not configured from the service config.
// or if not need to check service control, skip it.
if (!context->method()) {
if (context->GetRequestHTTPMethodWithOverride() == "OPTIONS") {
TRACE(trace_span) << "OPTIONS request is rejected";
continuation(Status(Code::PERMISSION_DENIED,
"The service does not allow CORS traffic.",
Status::SERVICE_CONTROL));
} else {
TRACE(trace_span) << "Method is not configured in the service config";
continuation(Status(Code::NOT_FOUND, "Method does not exist.",
Status::SERVICE_CONTROL));
}
return;
} else if (!context->service_context()->service_control() ||
context->method()->skip_service_control()) {
TRACE(trace_span) << "Service control check is not needed";
continuation(Status::OK);
return;
}
if (context->api_key().empty()) {
if (context->method()->allow_unregistered_calls()) {
// Not need to call Check.
TRACE(trace_span) << "Service control check is not needed";
continuation(Status::OK);
return;
}
TRACE(trace_span) << "Failed at checking caller identity.";
continuation(
Status(Code::UNAUTHENTICATED,
"Method doesn't allow unregistered callers (callers without "
"established identity). Please use API Key or other form of "
"API consumer identity to call this API.",
Status::SERVICE_CONTROL));
return;
}
service_control::CheckRequestInfo info;
context->FillCheckRequestInfo(&info);
context->service_context()->service_control()->Check(
info, trace_span.get(),
[context, continuation, trace_span](
Status status, const service_control::CheckResponseInfo &info) {
TRACE(trace_span) << "Check service control request returned with "
<< "status " << status.ToString();
// info is valid regardless status.
context->set_check_response_info(info);
// update consumer_project_id to service context
if (!info.consumer_project_id.empty()) {
context->request()->AddHeaderToBackend(kConsumerProjecId,
info.consumer_project_id);
}
continuation(status);
});
} | 353 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::context::RequestContext::AddInstanceIdentityToken | google::api_manager::context::RequestContext::AddInstanceIdentityToken() | [] | void RequestContext::AddInstanceIdentityToken() {
if (!method()) {
return;
}
const auto &audience = method()->backend_jwt_audience();
if (!audience.empty()) {
auto &token = service_context()
->global_context()
->GetInstanceIdentityToken(audience)
->GetAuthToken();
if (!token.empty()) {
std::string origin_auth_header;
if (request()->FindHeader(kAuthorizationHeader, &origin_auth_header)) {
Status status = request()->AddHeaderToBackend(
kXForwardedAuthorizationHeader, origin_auth_header);
if (!status.ok()) {
service_context()->env()->LogError(
"Failed to set X-Forwarded-Authorization header to backend.");
}
}
Status status = request()->AddHeaderToBackend(kAuthorizationHeader,
kBearerPrefix + token);
if (!status.ok()) {
service_context()->env()->LogError(
"Failed to set authorization header to backend.");
}
}
}
} | 173 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::context::RequestContext::SetApiKeyHeader | google::api_manager::context::RequestContext::SetApiKeyHeader() | [] | void RequestContext::SetApiKeyHeader() {
request_->AddHeaderToBackend(kDefaultApiKeyHeaderName, api_key_);
} | 16 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::context::RequestContext::StartBackendSpanAndSetTraceContext | google::api_manager::context::RequestContext::StartBackendSpanAndSetTraceContext() | [] | void RequestContext::StartBackendSpanAndSetTraceContext() {
backend_span_.reset(CreateSpan(cloud_trace_.get(), "Backend"));
// TODO: A better logic would be to send for GRPC backends the grpc-trace-bin
// header, and for http/https backends the X-Cloud-Trace-Context header.
std::string trace_context_header = cloud_trace()->ToTraceContextHeader(
backend_span_->trace_span()->span_id());
// Set trace context header to backend.
Status status = request()->AddHeaderToBackend(
cloud_trace()->header_type() == HeaderType::CLOUD_TRACE_CONTEXT
? kCloudTraceContextHeader
: kGRpcTraceContextHeader,
trace_context_header);
if (!status.ok()) {
service_context()->env()->LogError(
"Failed to set trace context header to backend.");
}
} | 97 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::RequestHandler::RequestHandler | google::api_manager::RequestHandler::RequestHandler( std :: shared_ptr<CheckWorkflow> check_workflow , std :: shared_ptr<context::ServiceContext> service_context , std :: unique_ptr<Request> request_data) | ['check_workflow', 'service_context', 'request_data'] | RequestHandler::RequestHandler(
std::shared_ptr<CheckWorkflow> check_workflow,
std::shared_ptr<context::ServiceContext> service_context,
std::unique_ptr<Request> request_data)
: context_(new context::RequestContext(service_context,
std::move(request_data))),
check_workflow_(check_workflow) {
// Remove x-endponts-api-userinfo from downstream client.
// It should be set by the last Endpoint proxy to prevent users spoofing.
std::string buffer;
if (context_->request()->FindHeader(
google::api_manager::auth::kEndpointApiUserInfo, &buffer)) {
context_->request()->AddHeaderToBackend(
google::api_manager::auth::kEndpointApiUserInfo, "");
}
} | 103 | True | 1 |
|
CVE-2021-41130 | False | False | False | False | AV:N/AC:M/Au:S/C:P/I:P/A:N | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | NONE | 4.9 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | LOW | LOW | NONE | 5.4 | MEDIUM | 2.8 | 2.5 | False | [{'url': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'name': 'https://github.com/cloudendpoints/esp/releases/tag/v1.58.0', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'name': 'https://cloud.google.com/endpoints/docs/openapi/authenticating-users-google-id', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'name': 'https://github.com/cloudendpoints/esp/security/advisories/GHSA-43wx-8qmj-9r9q', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'name': 'https://github.com/cloudendpoints/esp/commit/e310c4f91d229a072507f80c73811489b4cdff27', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-290'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:extensible_service_proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.58.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Extensible Service Proxy, a.k.a. ESP is a proxy which enables API management capabilities for JSON/REST or gRPC API services. ESPv1 can be configured to authenticate a JWT token. Its verified JWT claim is passed to the application by HTTP header "X-Endpoint-API-UserInfo", the application can use it to do authorization. But if there are two "X-Endpoint-API-UserInfo" headers from the client, ESPv1 only replaces the first one, the 2nd one will be passed to the application. An attacker can send two "X-Endpoint-API-UserInfo" headers, the second one with a fake JWT claim. Application may use the fake JWT claim to do the authorization. This impacts following ESPv1 usages: 1) Users have configured ESPv1 to do JWT authentication with Google ID Token as described in the referenced google endpoint document. 2) Users backend application is using the info in the "X-Endpoint-API-UserInfo" header to do the authorization. It has been fixed by v1.58.0. You need to patch it in the following ways: * If your docker image is using tag ":1", needs to re-start the container to pick up the new version. The tag ":1" will automatically point to the latest version. * If your docker image tag pings to a specific minor version, e.g. ":1.57". You need to update it to ":1.58" and re-start the container. There are no workaround for this issue.'}] | 2021-10-18T19:17Z | 2021-10-07T19:15Z | Authentication Bypass by Spoofing | This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks. | https://cwe.mitre.org/data/definitions/290.html | 0 | Shuo Yang | 2021-08-30 22:05:31-07:00 | Remove X-Endpoint-API-UserInfo for all header occurrences. (#845) | e310c4f91d229a072507f80c73811489b4cdff27 | False | cloudendpoints/esp | Extensible Service Proxy | 2016-05-31 22:43:02 | 2022-01-07 20:30:03 | https://cloud.google.com/endpoints/ | cloudendpoints | 272.0 | 71.0 | google::api_manager::nginx::NgxEspRequest::AddHeaderToBackend | google::api_manager::nginx::NgxEspRequest::AddHeaderToBackend( const std :: string & key , const std :: string & value) | ['key', 'value'] | utils::Status NgxEspRequest::AddHeaderToBackend(const std::string &key,
const std::string &value) {
ngx_table_elt_t *h = nullptr;
for (auto &h_in : r_->headers_in) {
if (key.size() == h_in.key.len &&
strncasecmp(key.c_str(), reinterpret_cast<const char *>(h_in.key.data),
h_in.key.len) == 0) {
h = &h_in;
break;
}
}
if (h == nullptr) {
h = reinterpret_cast<ngx_table_elt_t *>(
ngx_list_push(&r_->headers_in.headers));
if (h == nullptr) {
return utils::Status(Code::INTERNAL, "Out of memory");
}
h->lowcase_key =
reinterpret_cast<u_char *>(ngx_pcalloc(r_->pool, key.size()));
if (h->lowcase_key == nullptr) {
return utils::Status(Code::INTERNAL, "Out of memory");
}
h->hash = ngx_hash_strlow(
h->lowcase_key,
reinterpret_cast<u_char *>(const_cast<char *>(key.c_str())),
key.size());
}
if (ngx_str_copy_from_std(r_->pool, key, &h->key) != NGX_OK ||
ngx_str_copy_from_std(r_->pool, value, &h->value) != NGX_OK) {
return utils::Status(Code::INTERNAL, "Out of memory");
}
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r_->connection->log, 0,
"updates header to backend: \"%V: %V\"", &h->key, &h->value);
return utils::Status::OK;
} | 302 | True | 1 |
|
CVE-2021-41168 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:N/A:P | NETWORK | LOW | SINGLE | NONE | NONE | PARTIAL | 4.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6', 'name': 'https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/reddit/snudown/commit/1ac2c130b210539ee1e5d67a7bac93f9d8007c0e', 'name': 'https://github.com/reddit/snudown/commit/1ac2c130b210539ee1e5d67a7bac93f9d8007c0e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-327'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:reddit:snudown:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.7.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Snudown is a reddit-specific fork of the Sundown Markdown parser used by GitHub, with Python integration added. In affected versions snudown was found to be vulnerable to denial of service attacks to its reference table implementation. References written in markdown ` [reference_name]: https://www.example.com` are inserted into a hash table which was found to have a weak hash function, meaning that an attacker can reliably generate a large number of collisions for it. This makes the hash table vulnerable to a hash-collision DoS attack, a type of algorithmic complexity attack. Further the hash table allowed for duplicate entries resulting in long retrieval times. Proofs of concept and further discussion of the hash collision issue are discussed on the snudown GHSA(https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6). Users are advised to update to version 1.7.0.'}] | 2021-10-28T01:00Z | 2021-10-21T20:15Z | Use of a Broken or Risky Cryptographic Algorithm | The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information. | The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.
| https://cwe.mitre.org/data/definitions/327.html | 0 | Spencer Koch | 2021-10-13 09:22:44-05:00 | Hash-collision denial-of-service vulnerabilities (#87)
* Add case insensitive SipHash implementation
* Replace ref hash function with SipHash
* Add label to link_ref struct.
* Update find_link_ref to compare link labels as well as hashes
* Update add_link_ref to disallow duplicate entries.
* cast to char from uint8_t for strncasecmp
* update README markdown, remove TODO
* add py2 wheel generation
* fix: add logic for older glibc not having getrandom, impacting staging
Co-authored-by: Nicolaas <nweidema@usc.edu> | 1ac2c130b210539ee1e5d67a7bac93f9d8007c0e | False | reddit/snudown | reddit's markdown renderer. based on sundown. | 2011-10-14 18:31:19 | 2022-04-12 12:05:47 | reddit | 163.0 | 72.0 | add_link_ref | add_link_ref( struct link_ref ** references , const uint8_t * name , size_t name_size) | ['references', 'name', 'name_size'] | add_link_ref(
struct link_ref **references,
const uint8_t *name, size_t name_size)
{
struct link_ref *ref = calloc(1, sizeof(struct link_ref));
if (!ref)
return NULL;
ref->id = hash_link_ref(name, name_size);
ref->next = references[ref->id % REF_TABLE_SIZE];
references[ref->id % REF_TABLE_SIZE] = ref;
return ref;
} | 79 | True | 1 |
|
CVE-2021-41168 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:N/A:P | NETWORK | LOW | SINGLE | NONE | NONE | PARTIAL | 4.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6', 'name': 'https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/reddit/snudown/commit/1ac2c130b210539ee1e5d67a7bac93f9d8007c0e', 'name': 'https://github.com/reddit/snudown/commit/1ac2c130b210539ee1e5d67a7bac93f9d8007c0e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-327'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:reddit:snudown:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.7.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Snudown is a reddit-specific fork of the Sundown Markdown parser used by GitHub, with Python integration added. In affected versions snudown was found to be vulnerable to denial of service attacks to its reference table implementation. References written in markdown ` [reference_name]: https://www.example.com` are inserted into a hash table which was found to have a weak hash function, meaning that an attacker can reliably generate a large number of collisions for it. This makes the hash table vulnerable to a hash-collision DoS attack, a type of algorithmic complexity attack. Further the hash table allowed for duplicate entries resulting in long retrieval times. Proofs of concept and further discussion of the hash collision issue are discussed on the snudown GHSA(https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6). Users are advised to update to version 1.7.0.'}] | 2021-10-28T01:00Z | 2021-10-21T20:15Z | Use of a Broken or Risky Cryptographic Algorithm | The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information. | The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.
| https://cwe.mitre.org/data/definitions/327.html | 0 | Spencer Koch | 2021-10-13 09:22:44-05:00 | Hash-collision denial-of-service vulnerabilities (#87)
* Add case insensitive SipHash implementation
* Replace ref hash function with SipHash
* Add label to link_ref struct.
* Update find_link_ref to compare link labels as well as hashes
* Update add_link_ref to disallow duplicate entries.
* cast to char from uint8_t for strncasecmp
* update README markdown, remove TODO
* add py2 wheel generation
* fix: add logic for older glibc not having getrandom, impacting staging
Co-authored-by: Nicolaas <nweidema@usc.edu> | 1ac2c130b210539ee1e5d67a7bac93f9d8007c0e | False | reddit/snudown | reddit's markdown renderer. based on sundown. | 2011-10-14 18:31:19 | 2022-04-12 12:05:47 | reddit | 163.0 | 72.0 | find_link_ref | find_link_ref( struct link_ref ** references , uint8_t * name , size_t length) | ['references', 'name', 'length'] | find_link_ref(struct link_ref **references, uint8_t *name, size_t length)
{
unsigned int hash = hash_link_ref(name, length);
struct link_ref *ref = NULL;
ref = references[hash % REF_TABLE_SIZE];
while (ref != NULL) {
if (ref->id == hash)
return ref;
ref = ref->next;
}
return NULL;
} | 71 | True | 1 |
|
CVE-2021-41168 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:N/A:P | NETWORK | LOW | SINGLE | NONE | NONE | PARTIAL | 4.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6', 'name': 'https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/reddit/snudown/commit/1ac2c130b210539ee1e5d67a7bac93f9d8007c0e', 'name': 'https://github.com/reddit/snudown/commit/1ac2c130b210539ee1e5d67a7bac93f9d8007c0e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-327'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:reddit:snudown:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.7.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Snudown is a reddit-specific fork of the Sundown Markdown parser used by GitHub, with Python integration added. In affected versions snudown was found to be vulnerable to denial of service attacks to its reference table implementation. References written in markdown ` [reference_name]: https://www.example.com` are inserted into a hash table which was found to have a weak hash function, meaning that an attacker can reliably generate a large number of collisions for it. This makes the hash table vulnerable to a hash-collision DoS attack, a type of algorithmic complexity attack. Further the hash table allowed for duplicate entries resulting in long retrieval times. Proofs of concept and further discussion of the hash collision issue are discussed on the snudown GHSA(https://github.com/reddit/snudown/security/advisories/GHSA-6gvv-9q92-w5f6). Users are advised to update to version 1.7.0.'}] | 2021-10-28T01:00Z | 2021-10-21T20:15Z | Use of a Broken or Risky Cryptographic Algorithm | The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information. | The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.
| https://cwe.mitre.org/data/definitions/327.html | 0 | Spencer Koch | 2021-10-13 09:22:44-05:00 | Hash-collision denial-of-service vulnerabilities (#87)
* Add case insensitive SipHash implementation
* Replace ref hash function with SipHash
* Add label to link_ref struct.
* Update find_link_ref to compare link labels as well as hashes
* Update add_link_ref to disallow duplicate entries.
* cast to char from uint8_t for strncasecmp
* update README markdown, remove TODO
* add py2 wheel generation
* fix: add logic for older glibc not having getrandom, impacting staging
Co-authored-by: Nicolaas <nweidema@usc.edu> | 1ac2c130b210539ee1e5d67a7bac93f9d8007c0e | False | reddit/snudown | reddit's markdown renderer. based on sundown. | 2011-10-14 18:31:19 | 2022-04-12 12:05:47 | reddit | 163.0 | 72.0 | hash_link_ref | hash_link_ref( const uint8_t * link_ref , size_t length) | ['link_ref', 'length'] | hash_link_ref(const uint8_t *link_ref, size_t length)
{
size_t i;
unsigned int hash = 0;
for (i = 0; i < length; ++i)
hash = tolower(link_ref[i]) + (hash << 6) + (hash << 16) - hash;
return hash;
} | 63 | True | 1 |
|
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | audio_level_json | audio_level_json( struct list * levell , const char * userid_self , const char * clientid_self , char ** json_str , char ** anon_str) | ['levell', 'userid_self', 'clientid_self', 'json_str', 'anon_str'] | int audio_level_json(struct list *levell,
const char *userid_self, const char *clientid_self,
char **json_str, char **anon_str)
{
struct json_object *jobj;
struct json_object *jarr;
char uid_anon[ANON_ID_LEN];
char cid_anon[ANON_CLIENT_LEN];
struct mbuf *pmb = NULL;
int err = 0;
struct le *le;
if (!levell || !json_str)
return EINVAL;
jobj = jzon_alloc_object();
if (!jobj)
return ENOMEM;
jarr = jzon_alloc_array();
if (!jarr) {
err = ENOMEM;
goto out;
}
if (anon_str) {
pmb = mbuf_alloc(512);
mbuf_printf(pmb, "%zu levels: ", list_count(levell));
}
LIST_FOREACH(levell, le) {
struct audio_level *a = le->data;
struct json_object *ja;
const char *userid = a->userid;
const char *clientid = a->clientid;
if (a->is_self) {
if (userid_self)
userid = userid_self;
if (clientid_self)
clientid = clientid_self;
}
ja = jzon_alloc_object();
if (ja) {
jzon_add_str(ja, "userid", userid);
jzon_add_str(ja, "clientid", clientid);
jzon_add_int(ja, "audio_level",
(int32_t)a->aulevel_smooth);
jzon_add_int(ja, "audio_level_now",
(int32_t)a->aulevel);
}
json_object_array_add(jarr, ja);
/* add to info string */
if (pmb) {
anon_id(uid_anon, userid);
anon_client(cid_anon, clientid);
mbuf_printf(pmb, "{[%s.%s] audio_level: %d/%d}",
uid_anon, cid_anon,
a->aulevel_smooth, a->aulevel);
if (le != levell->tail)
mbuf_printf(pmb, ",");
}
}
json_object_object_add(jobj, "audio_levels", jarr);
if (pmb) {
pmb->pos = 0;
mbuf_strdup(pmb, anon_str, pmb->end);
mem_deref(pmb);
}
jzon_encode(json_str, jobj);
out:
mem_deref(jobj);
return err;
} | 373 | True | 1 |
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | ecall_answer | ecall_answer( struct ecall * ecall , enum icall_call_type call_type , bool audio_cbr) | ['ecall', 'call_type', 'audio_cbr'] | int ecall_answer(struct ecall *ecall, enum icall_call_type call_type,
bool audio_cbr)
{
int err = 0;
if (!ecall)
return EINVAL;
#ifdef ECALL_CBR_ALWAYS_ON
audio_cbr = true;
#endif
info("ecall(%p): answer on pending econn %p call_type=%d\n", ecall, ecall->econn, call_type);
if (!ecall->econn) {
warning("ecall: answer: econn does not exist!\n");
return ENOENT;
}
if (ECONN_PENDING_INCOMING != econn_current_state(ecall->econn)) {
info("ecall(%p): answer: invalid state (%s)\n", ecall,
econn_state_name(econn_current_state(ecall->econn)));
return EPROTO;
}
if (!ecall->flow) {
warning("ecall: answer: no mediaflow\n");
return EPROTO;
}
ecall->call_type = call_type;
IFLOW_CALL(ecall->flow, set_call_type, call_type);
ecall->audio_cbr = audio_cbr;
IFLOW_CALL(ecall->flow, set_audio_cbr, audio_cbr);
#if 0
if (ecall->props_local) {
const char *vstate_string =
call_type == ICALL_CALL_TYPE_VIDEO ? "true" : "false";
int err2 = econn_props_update(ecall->props_local, "videosend", vstate_string);
if (err2) {
warning("ecall(%p): econn_props_update(videosend)",
" failed (%m)\n", ecall, err2);
/* Non fatal, carry on */
}
}
#endif
err = generate_or_gather_answer(ecall, ecall->econn);
if (err) {
warning("ecall: answer: failed to gather_or_answer\n");
goto out;
}
ecall->answered = true;
ecall->audio_setup_time = -1;
ecall->call_estab_time = -1;
ecall->ts_answered = tmr_jiffies();
out:
return err;
} | 257 | True | 1 |
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | ecall_start | ecall_start( struct ecall * ecall , enum icall_call_type call_type , bool audio_cbr) | ['ecall', 'call_type', 'audio_cbr'] | int ecall_start(struct ecall *ecall, enum icall_call_type call_type,
bool audio_cbr)
{
int err;
info("ecall(%p): start\n", ecall);
if (!ecall)
return EINVAL;
#ifdef ECALL_CBR_ALWAYS_ON
audio_cbr = true;
#endif
if (ecall->econn) {
if (ECONN_PENDING_INCOMING == econn_current_state(ecall->econn)) {
return ecall_answer(ecall, call_type, audio_cbr);
}
else {
warning("ecall: start: already in progress (econn=%s)\n",
econn_state_name(econn_current_state(ecall->econn)));
return EALREADY;
}
}
#if 0
if (ecall->turnc == 0) {
warning("ecall: start: no TURN servers -- cannot start\n");
return EINTR;
}
#endif
ecall->call_type = call_type;
err = ecall_create_econn(ecall);
if (err) {
warning("ecall: start: create_econn failed: %m\n", err);
return err;
}
econn_set_state(ecall_get_econn(ecall), ECONN_PENDING_OUTGOING);
err = alloc_flow(ecall, ASYNC_OFFER, ecall->call_type, audio_cbr);
if (err) {
warning("ecall: start: alloc_flow failed: %m\n", err);
goto out;
}
IFLOW_CALL(ecall->flow, set_audio_cbr, audio_cbr);
if (ecall->props_local &&
(call_type == ICALL_CALL_TYPE_VIDEO
&& ecall->vstate == ICALL_VIDEO_STATE_STARTED)) {
const char *vstate_string = "true";
int err2 = econn_props_update(ecall->props_local,
"videosend", vstate_string);
if (err2) {
warning("ecall(%p): econn_props_update(videosend)",
" failed (%m)\n", ecall, err2);
/* Non fatal, carry on */
}
}
ecall->sdp.async = ASYNC_NONE;
err = generate_offer(ecall);
if (err) {
warning("ecall(%p): start: generate_offer"
" failed (%m)\n", ecall, err);
goto out;
}
ecall->ts_started = tmr_jiffies();
ecall->call_setup_time = -1;
out:
/* err handling */
return err;
} | 301 | True | 1 |
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | econn_message_encode | econn_message_encode( char ** strp , const struct econn_message * msg) | ['strp', 'msg'] | int econn_message_encode(char **strp, const struct econn_message *msg)
{
struct json_object *jobj = NULL;
char *str = NULL;
int err;
if (!strp || !msg)
return EINVAL;
err = jzon_creatf(&jobj, "sss",
"version", econn_proto_version,
"type", econn_msg_name(msg->msg_type),
"sessid", msg->sessid_sender);
if (err)
return err;
if (str_isset(msg->src_userid)) {
err = jzon_add_str(jobj, "src_userid", "%s", msg->src_userid);
if (err)
goto out;
}
if (str_isset(msg->src_clientid)) {
err = jzon_add_str(jobj, "src_clientid",
"%s", msg->src_clientid);
if (err)
goto out;
}
if (str_isset(msg->dest_userid)) {
err = jzon_add_str(jobj, "dest_userid",
"%s", msg->dest_userid);
if (err)
goto out;
}
if (str_isset(msg->dest_clientid)) {
err = jzon_add_str(jobj, "dest_clientid",
"%s", msg->dest_clientid);
if (err)
goto out;
}
err = jzon_add_bool(jobj, "resp", msg->resp);
if (err)
goto out;
switch (msg->msg_type) {
case ECONN_SETUP:
case ECONN_GROUP_SETUP:
case ECONN_UPDATE:
err = jzon_add_str(jobj, "sdp", "%s", msg->u.setup.sdp_msg);
if (err)
goto out;
/* props is optional for SETUP */
if (msg->u.setup.props) {
err = econn_props_encode(jobj, msg->u.setup.props);
if (err)
goto out;
}
if (msg->u.setup.url) {
err = jzon_add_str(jobj, "url", "%s", msg->u.setup.url);
if (err)
goto out;
}
break;
case ECONN_CANCEL:
break;
case ECONN_HANGUP:
break;
case ECONN_REJECT:
break;
case ECONN_PROPSYNC:
/* props is mandatory for PROPSYNC */
if (!msg->u.propsync.props) {
warning("propsync: missing props\n");
err = EINVAL;
goto out;
}
err = econn_props_encode(jobj, msg->u.propsync.props);
if (err)
goto out;
break;
case ECONN_GROUP_START:
/* props is optional for GROUPSTART */
if (msg->u.groupstart.props) {
err = econn_props_encode(jobj, msg->u.groupstart.props);
if (err)
goto out;
}
break;
case ECONN_GROUP_LEAVE:
case ECONN_GROUP_CHECK:
break;
case ECONN_CONF_CONN:
if (msg->u.confconn.turnc > 0) {
err = zapi_iceservers_encode(jobj,
msg->u.confconn.turnv,
msg->u.confconn.turnc);
if (err)
goto out;
}
jzon_add_bool(jobj, "update",
msg->u.confconn.update);
jzon_add_str(jobj, "tool",
msg->u.confconn.tool);
jzon_add_str(jobj, "toolver",
msg->u.confconn.toolver);
jzon_add_int(jobj, "status",
msg->u.confconn.status);
jzon_add_bool(jobj, "selective_audio",
msg->u.confconn.selective_audio);
jzon_add_bool(jobj, "selective_video",
msg->u.confconn.selective_video);
jzon_add_int(jobj, "vstreams",
msg->u.confconn.vstreams);
break;
case ECONN_CONF_START:
jzon_add_str(jobj, "sft_url", "%s", msg->u.confstart.sft_url);
jzon_add_base64(jobj, "secret",
msg->u.confstart.secret, msg->u.confstart.secretlen);
jzon_add_str(jobj, "timestamp", "%llu", msg->u.confstart.timestamp);
jzon_add_str(jobj, "seqno", "%u", msg->u.confstart.seqno);
/* props is optional for CONFSTART */
if (msg->u.confstart.props) {
err = econn_props_encode(jobj, msg->u.confstart.props);
if (err)
goto out;
}
break;
case ECONN_CONF_CHECK:
jzon_add_str(jobj, "sft_url", "%s", msg->u.confcheck.sft_url);
jzon_add_base64(jobj, "secret",
msg->u.confcheck.secret, msg->u.confcheck.secretlen);
jzon_add_str(jobj, "timestamp", "%llu", msg->u.confcheck.timestamp);
jzon_add_str(jobj, "seqno", "%u", msg->u.confcheck.seqno);
break;
case ECONN_CONF_END:
break;
case ECONN_CONF_PART:
jzon_add_bool(jobj, "should_start",
msg->u.confpart.should_start);
jzon_add_str(jobj, "timestamp", "%llu", msg->u.confpart.timestamp);
jzon_add_str(jobj, "seqno", "%u", msg->u.confpart.seqno);
jzon_add_base64(jobj, "entropy",
msg->u.confpart.entropy, msg->u.confpart.entropylen);
econn_parts_encode(jobj, &msg->u.confpart.partl);
break;
case ECONN_CONF_KEY:
econn_keys_encode(jobj, &msg->u.confkey.keyl);
break;
case ECONN_DEVPAIR_PUBLISH:
err = zapi_iceservers_encode(jobj,
msg->u.devpair_publish.turnv,
msg->u.devpair_publish.turnc);
if (err)
goto out;
err = jzon_add_str(jobj, "sdp",
"%s", msg->u.devpair_publish.sdp);
err |= jzon_add_str(jobj, "username",
"%s", msg->u.devpair_publish.username);
if (err)
goto out;
break;
case ECONN_DEVPAIR_ACCEPT:
err = jzon_add_str(jobj, "sdp",
"%s", msg->u.devpair_accept.sdp);
if (err)
goto out;
break;
case ECONN_ALERT:
err = jzon_add_int(jobj, "level", msg->u.alert.level);
err |= jzon_add_str(jobj, "descr", "%s", msg->u.alert.descr);
if (err)
goto out;
break;
case ECONN_PING:
break;
default:
warning("econn: dont know how to encode %d\n", msg->msg_type);
err = EBADMSG;
break;
}
if (err)
goto out;
err = jzon_encode(&str, jobj);
if (err)
goto out;
out:
mem_deref(jobj);
if (err)
mem_deref(str);
else
*strp = str;
return err;
} | 1151 | True | 1 |
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | wire::CbrDetectorRemote::Decrypt | wire::CbrDetectorRemote::Decrypt( cricket :: MediaType media_type , const std :: vector<uint32_t> & csrcs , rtc :: ArrayView<const uint8_t> additional_data , rtc :: ArrayView<const uint8_t> encrypted_frame , rtc :: ArrayView<uint8_t> frame) | ['media_type', 'csrcs', 'additional_data', 'encrypted_frame', 'frame'] | CbrDetectorRemote::Result CbrDetectorRemote::Decrypt(cricket::MediaType media_type,
const std::vector<uint32_t>& csrcs,
rtc::ArrayView<const uint8_t> additional_data,
rtc::ArrayView<const uint8_t> encrypted_frame,
rtc::ArrayView<uint8_t> frame)
{
const uint8_t *src = encrypted_frame.data();
uint8_t *dst = frame.data();
uint32_t data_len = encrypted_frame.size();
if (media_type == cricket::MEDIA_TYPE_AUDIO) {
if (data_len == frame_size && frame_size >= 40) {
frame_count++;
if (frame_count > 200 && !detected) {
info("CBR detector: remote cbr detected\n");
detected = true;
}
}
else {
frame_count = 0;
frame_size = data_len;
if (detected) {
info("CBR detector: remote cbr detected disabled\n");
detected = false;
}
}
}
memcpy(dst, src, data_len);
out:
return CbrDetectorRemote::Result(CbrDetectorRemote::Status::kOk, data_len);
} | 173 | True | 1 |
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | wcall_i_answer | wcall_i_answer( struct wcall * wcall , int call_type , int audio_cbr) | ['wcall', 'call_type', 'audio_cbr'] | int wcall_i_answer(struct wcall *wcall,
int call_type, int audio_cbr)
{
int err = 0;
bool cbr = audio_cbr != 0;
if (!wcall) {
warning("wcall; answer: no wcall\n");
return EINVAL;
}
call_type = (call_type == WCALL_CALL_TYPE_FORCED_AUDIO) ?
WCALL_CALL_TYPE_NORMAL : call_type;
info(APITAG "wcall(%p): answer calltype=%s\n",
wcall, wcall_call_type_name(call_type));
if (wcall->disable_audio)
wcall->disable_audio = false;
if (!wcall->icall) {
warning("wcall(%p): answer: no call object found\n", wcall);
return ENOTSUP;
}
set_state(wcall, WCALL_STATE_ANSWERED);
if (call_type == WCALL_CALL_TYPE_VIDEO) {
ICALL_CALL(wcall->icall,
set_video_send_state,
ICALL_VIDEO_STATE_STARTED);
}
else {
ICALL_CALL(wcall->icall,
set_video_send_state,
ICALL_VIDEO_STATE_STOPPED);
}
err = ICALL_CALLE(wcall->icall, answer,
call_type, cbr);
return err;
} | 156 | True | 1 |
CVE-2021-41193 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'name': 'https://github.com/wireapp/wire-avs/security/advisories/GHSA-2j6v-xpf3-xvrv', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'name': 'https://github.com/wireapp/wire-avs/commit/40d373ede795443ae6f2f756e9fb1f4f4ae90bbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wire:wire-audio_video_signaling:*:*:*:*:*:*:*:*', 'versionEndExcluding': '7.1.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wire-avs is the audio visual signaling (AVS) component of Wire, an open-source messenger. A remote format string vulnerability in versions prior to 7.1.12 allows an attacker to cause a denial of service or possibly execute arbitrary code. The issue has been fixed in wire-avs 7.1.12. There are currently no known workarounds.'}] | 2022-03-09T14:39Z | 2022-03-01T19:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | Chris Owen | 2021-09-07 13:07:15+02:00 | Import latest release-7.1 files from old repo | 40d373ede795443ae6f2f756e9fb1f4f4ae90bbe | False | wireapp/wire-avs | Audio Video Signaling (AVS) | 2016-03-10 09:19:37 | 2022-08-24 06:21:13 | https://wire.com | wireapp | 132.0 | 57.0 | prekey_handler | prekey_handler( const char * userid , const uint8_t * key , size_t key_len , uint16_t id , const char * clientid , bool last , void * arg) | ['userid', 'key', 'key_len', 'id', 'clientid', 'last', 'arg'] | static void prekey_handler(const char *userid,
const uint8_t *key, size_t key_len,
uint16_t id, const char *clientid,
bool last, void *arg)
{
struct session *sess;
char lclientid[64];
int err;
output("prekey_handler: %zu bytes, user:%s[%u] -> %s\n",
key_len, userid, id, clientid);
err = client_id_load(lclientid, sizeof(lclientid));
if (err) {
debug("my clientid not set -- cannot store prekeys\n");
return;
}
sess = cryptobox_session_find(g_cryptobox, userid, clientid, lclientid);
if (sess) {
output("prekey: session found\n");
}
else {
info("conv: adding key to cryptobox for clientid=%s\n",
clientid);
err = cryptobox_session_add_send(g_cryptobox, userid, clientid, lclientid,
key, key_len);
if (err) {
warning("cryptobox_session_add_send failed (%m)\n",
err);
}
}
} | 148 | True | 1 |
CVE-2021-41253 | 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://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'name': 'https://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'name': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'name': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'name': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-122'}, {'lang': 'en', 'value': 'CWE-457'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zyantific:zydis:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Zydis is an x86/x86-64 disassembler library. Users of Zydis versions v3.2.0 and older that use the string functions provided in `zycore` in order to append untrusted user data to the formatter buffer within their custom formatter hooks can run into heap buffer overflows. Older versions of Zydis failed to properly initialize the string object within the formatter buffer, forgetting to initialize a few fields, leaving their value to chance. This could then in turn cause zycore functions like `ZyanStringAppend` to make incorrect calculations for the new target size, resulting in heap memory corruption. This does not affect the regular uncustomized Zydis formatter, because Zydis internally doesn't use the string functions in zycore that act upon these fields. However, because the zycore string functions are the intended way to work with the formatter buffer for users of the library that wish to extend the formatter, we still consider this to be a vulnerability in Zydis. This bug is patched starting in version 3.2.1. As a workaround, users may refrain from using zycore string functions in their formatter hooks until updating to a patched version."}] | 2021-11-15T13:35Z | 2021-11-08T22:15Z | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | 0 | Joel Höner | 2021-10-24 14:36:42+02:00 | Fix struct initialization in formatter | 55dd08c210722aed81b38132f5fd4a04ec1943b5 | False | zyantific/zydis | Fast and lightweight x86/x86-64 disassembler and code generation library | 2014-10-24 21:05:43 | 2022-08-15 14:34:10 | https://zydis.re | zyantific | 2454.0 | 338.0 | ZydisFormatterBufferInit | ZydisFormatterBufferInit( ZydisFormatterBuffer * buffer , char * user_buffer , ZyanUSize length) | ['buffer', 'user_buffer', 'length'] | void ZydisFormatterBufferInit(ZydisFormatterBuffer* buffer, char* user_buffer,
ZyanUSize length)
{
ZYAN_ASSERT(buffer);
ZYAN_ASSERT(user_buffer);
ZYAN_ASSERT(length);
buffer->is_token_list = ZYAN_FALSE;
buffer->string.flags = ZYAN_STRING_HAS_FIXED_CAPACITY;
buffer->string.vector.allocator = ZYAN_NULL;
buffer->string.vector.element_size = sizeof(char);
buffer->string.vector.size = 1;
buffer->string.vector.capacity = length;
buffer->string.vector.data = user_buffer;
*user_buffer = '\0';
} | 102 | True | 1 |
|
CVE-2021-41253 | 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://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'name': 'https://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'name': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'name': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'name': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-122'}, {'lang': 'en', 'value': 'CWE-457'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zyantific:zydis:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Zydis is an x86/x86-64 disassembler library. Users of Zydis versions v3.2.0 and older that use the string functions provided in `zycore` in order to append untrusted user data to the formatter buffer within their custom formatter hooks can run into heap buffer overflows. Older versions of Zydis failed to properly initialize the string object within the formatter buffer, forgetting to initialize a few fields, leaving their value to chance. This could then in turn cause zycore functions like `ZyanStringAppend` to make incorrect calculations for the new target size, resulting in heap memory corruption. This does not affect the regular uncustomized Zydis formatter, because Zydis internally doesn't use the string functions in zycore that act upon these fields. However, because the zycore string functions are the intended way to work with the formatter buffer for users of the library that wish to extend the formatter, we still consider this to be a vulnerability in Zydis. This bug is patched starting in version 3.2.1. As a workaround, users may refrain from using zycore string functions in their formatter hooks until updating to a patched version."}] | 2021-11-15T13:35Z | 2021-11-08T22:15Z | Use of Uninitialized Variable | The code uses a variable that has not been initialized, leading to unpredictable or unintended results. | In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.
| https://cwe.mitre.org/data/definitions/457.html | 0 | Joel Höner | 2021-10-24 14:36:42+02:00 | Fix struct initialization in formatter | 55dd08c210722aed81b38132f5fd4a04ec1943b5 | False | zyantific/zydis | Fast and lightweight x86/x86-64 disassembler and code generation library | 2014-10-24 21:05:43 | 2022-08-15 14:34:10 | https://zydis.re | zyantific | 2454.0 | 338.0 | ZydisFormatterBufferInit | ZydisFormatterBufferInit( ZydisFormatterBuffer * buffer , char * user_buffer , ZyanUSize length) | ['buffer', 'user_buffer', 'length'] | void ZydisFormatterBufferInit(ZydisFormatterBuffer* buffer, char* user_buffer,
ZyanUSize length)
{
ZYAN_ASSERT(buffer);
ZYAN_ASSERT(user_buffer);
ZYAN_ASSERT(length);
buffer->is_token_list = ZYAN_FALSE;
buffer->string.flags = ZYAN_STRING_HAS_FIXED_CAPACITY;
buffer->string.vector.allocator = ZYAN_NULL;
buffer->string.vector.element_size = sizeof(char);
buffer->string.vector.size = 1;
buffer->string.vector.capacity = length;
buffer->string.vector.data = user_buffer;
*user_buffer = '\0';
} | 102 | True | 1 |
CVE-2021-41253 | 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://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'name': 'https://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'name': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'name': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'name': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-122'}, {'lang': 'en', 'value': 'CWE-457'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zyantific:zydis:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Zydis is an x86/x86-64 disassembler library. Users of Zydis versions v3.2.0 and older that use the string functions provided in `zycore` in order to append untrusted user data to the formatter buffer within their custom formatter hooks can run into heap buffer overflows. Older versions of Zydis failed to properly initialize the string object within the formatter buffer, forgetting to initialize a few fields, leaving their value to chance. This could then in turn cause zycore functions like `ZyanStringAppend` to make incorrect calculations for the new target size, resulting in heap memory corruption. This does not affect the regular uncustomized Zydis formatter, because Zydis internally doesn't use the string functions in zycore that act upon these fields. However, because the zycore string functions are the intended way to work with the formatter buffer for users of the library that wish to extend the formatter, we still consider this to be a vulnerability in Zydis. This bug is patched starting in version 3.2.1. As a workaround, users may refrain from using zycore string functions in their formatter hooks until updating to a patched version."}] | 2021-11-15T13:35Z | 2021-11-08T22:15Z | Heap-based Buffer Overflow | A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). | https://cwe.mitre.org/data/definitions/122.html | 0 | Joel Höner | 2021-10-24 14:36:42+02:00 | Fix struct initialization in formatter | 55dd08c210722aed81b38132f5fd4a04ec1943b5 | False | zyantific/zydis | Fast and lightweight x86/x86-64 disassembler and code generation library | 2014-10-24 21:05:43 | 2022-08-15 14:34:10 | https://zydis.re | zyantific | 2454.0 | 338.0 | ZydisFormatterBufferInitTokenized | ZydisFormatterBufferInitTokenized( ZydisFormatterBuffer * buffer , ZydisFormatterToken ** first_token , void * user_buffer , ZyanUSize length) | ['buffer', 'first_token', 'user_buffer', 'length'] | void ZydisFormatterBufferInitTokenized(ZydisFormatterBuffer* buffer,
ZydisFormatterToken** first_token, void* user_buffer, ZyanUSize length)
{
ZYAN_ASSERT(buffer);
ZYAN_ASSERT(first_token);
ZYAN_ASSERT(user_buffer);
ZYAN_ASSERT(length);
*first_token = user_buffer;
(*first_token)->type = ZYDIS_TOKEN_INVALID;
(*first_token)->next = 0;
user_buffer = (ZyanU8*)user_buffer + sizeof(ZydisFormatterToken);
length -= sizeof(ZydisFormatterToken);
buffer->is_token_list = ZYAN_TRUE;
buffer->capacity = length;
buffer->string.flags = ZYAN_STRING_HAS_FIXED_CAPACITY;
buffer->string.vector.allocator = ZYAN_NULL;
buffer->string.vector.element_size = sizeof(char);
buffer->string.vector.size = 1;
buffer->string.vector.capacity = length;
buffer->string.vector.data = user_buffer;
*(char*)user_buffer = '\0';
} | 164 | True | 1 |
|
CVE-2021-41253 | 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://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'name': 'https://huntr.dev/bounties/96b0a482-7041-45b1-9327-c6a4a8f32d3a', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'name': 'https://github.com/zyantific/zydis/commit/55dd08c210722aed81b38132f5fd4a04ec1943b5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'name': 'https://huntr.dev/bounties/d2536d7d-36ce-4723-928c-98d1ee039784', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'name': 'https://github.com/zyantific/zydis/security/advisories/GHSA-q42v-hv86-3m4g', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-122'}, {'lang': 'en', 'value': 'CWE-457'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zyantific:zydis:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Zydis is an x86/x86-64 disassembler library. Users of Zydis versions v3.2.0 and older that use the string functions provided in `zycore` in order to append untrusted user data to the formatter buffer within their custom formatter hooks can run into heap buffer overflows. Older versions of Zydis failed to properly initialize the string object within the formatter buffer, forgetting to initialize a few fields, leaving their value to chance. This could then in turn cause zycore functions like `ZyanStringAppend` to make incorrect calculations for the new target size, resulting in heap memory corruption. This does not affect the regular uncustomized Zydis formatter, because Zydis internally doesn't use the string functions in zycore that act upon these fields. However, because the zycore string functions are the intended way to work with the formatter buffer for users of the library that wish to extend the formatter, we still consider this to be a vulnerability in Zydis. This bug is patched starting in version 3.2.1. As a workaround, users may refrain from using zycore string functions in their formatter hooks until updating to a patched version."}] | 2021-11-15T13:35Z | 2021-11-08T22:15Z | Use of Uninitialized Variable | The code uses a variable that has not been initialized, leading to unpredictable or unintended results. | In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.
| https://cwe.mitre.org/data/definitions/457.html | 0 | Joel Höner | 2021-10-24 14:36:42+02:00 | Fix struct initialization in formatter | 55dd08c210722aed81b38132f5fd4a04ec1943b5 | False | zyantific/zydis | Fast and lightweight x86/x86-64 disassembler and code generation library | 2014-10-24 21:05:43 | 2022-08-15 14:34:10 | https://zydis.re | zyantific | 2454.0 | 338.0 | ZydisFormatterBufferInitTokenized | ZydisFormatterBufferInitTokenized( ZydisFormatterBuffer * buffer , ZydisFormatterToken ** first_token , void * user_buffer , ZyanUSize length) | ['buffer', 'first_token', 'user_buffer', 'length'] | void ZydisFormatterBufferInitTokenized(ZydisFormatterBuffer* buffer,
ZydisFormatterToken** first_token, void* user_buffer, ZyanUSize length)
{
ZYAN_ASSERT(buffer);
ZYAN_ASSERT(first_token);
ZYAN_ASSERT(user_buffer);
ZYAN_ASSERT(length);
*first_token = user_buffer;
(*first_token)->type = ZYDIS_TOKEN_INVALID;
(*first_token)->next = 0;
user_buffer = (ZyanU8*)user_buffer + sizeof(ZydisFormatterToken);
length -= sizeof(ZydisFormatterToken);
buffer->is_token_list = ZYAN_TRUE;
buffer->capacity = length;
buffer->string.flags = ZYAN_STRING_HAS_FIXED_CAPACITY;
buffer->string.vector.allocator = ZYAN_NULL;
buffer->string.vector.element_size = sizeof(char);
buffer->string.vector.size = 1;
buffer->string.vector.capacity = length;
buffer->string.vector.data = user_buffer;
*(char*)user_buffer = '\0';
} | 164 | True | 1 |
CVE-2021-41689 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/5c14bf53fb42ceca12bbcc0016e8704b1580920d', 'name': 'https://github.com/DCMTK/dcmtk/commit/5c14bf53fb42ceca12bbcc0016e8704b1580920d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle string copy properly. Sending specific requests to the dcmqrdb program, it would query its database and copy the result even if the result is null, which can incur a head-based overflow. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Michael Onken | 2021-09-15 09:04:12+02:00 | Fixed possible NULL pointer dereference.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and patch. | 5c14bf53fb42ceca12bbcc0016e8704b1580920d | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | DU_getStringDOElement | DU_getStringDOElement( DcmItem * obj , DcmTagKey t , char * s , size_t bufsize) | ['obj', 't', 's', 'bufsize'] | DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s, size_t bufsize)
{
DcmByteString *elem;
DcmStack stack;
OFCondition ec = EC_Normal;
char* aString;
ec = obj->search(t, stack);
elem = (DcmByteString*) stack.top();
if (ec == EC_Normal && elem != NULL) {
if (elem->getLength() == 0) {
s[0] = '\0';
} else {
ec = elem->getString(aString);
OFStandard::strlcpy(s, aString, bufsize);
}
}
return (ec == EC_Normal);
} | 118 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | ASC_destroyAssociation | ASC_destroyAssociation( T_ASC_Association ** association) | ['association'] | ASC_destroyAssociation(T_ASC_Association ** association)
{
OFCondition cond = EC_Normal;
/* don't worry if already destroyed */
if (association == NULL) return EC_Normal;
if (*association == NULL) return EC_Normal;
if ((*association)->DULassociation != NULL) {
ASC_dropAssociation(*association);
}
if ((*association)->params != NULL) {
cond = ASC_destroyAssociationParameters(&(*association)->params);
if (cond.bad()) return cond;
}
if ((*association)->sendPDVBuffer != NULL)
free((*association)->sendPDVBuffer);
free(*association);
*association = NULL;
return EC_Normal;
} | 123 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | ASC_destroyAssociation | ASC_destroyAssociation( T_ASC_Association ** association) | ['association'] | ASC_destroyAssociation(T_ASC_Association ** association)
{
OFCondition cond = EC_Normal;
/* don't worry if already destroyed */
if (association == NULL) return EC_Normal;
if (*association == NULL) return EC_Normal;
if ((*association)->DULassociation != NULL) {
ASC_dropAssociation(*association);
}
if ((*association)->params != NULL) {
cond = ASC_destroyAssociationParameters(&(*association)->params);
if (cond.bad()) return cond;
}
if ((*association)->sendPDVBuffer != NULL)
free((*association)->sendPDVBuffer);
free(*association);
*association = NULL;
return EC_Normal;
} | 123 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | ASC_destroyAssociation | ASC_destroyAssociation( T_ASC_Association ** association) | ['association'] | ASC_destroyAssociation(T_ASC_Association ** association)
{
OFCondition cond = EC_Normal;
/* don't worry if already destroyed */
if (association == NULL) return EC_Normal;
if (*association == NULL) return EC_Normal;
if ((*association)->DULassociation != NULL) {
ASC_dropAssociation(*association);
}
if ((*association)->params != NULL) {
cond = ASC_destroyAssociationParameters(&(*association)->params);
if (cond.bad()) return cond;
}
if ((*association)->sendPDVBuffer != NULL)
free((*association)->sendPDVBuffer);
free(*association);
*association = NULL;
return EC_Normal;
} | 123 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyPresentationContextList | destroyPresentationContextList( LST_HEAD ** lst) | ['lst'] | destroyPresentationContextList(LST_HEAD ** lst)
{
DUL_PRESENTATIONCONTEXT *pc;
DUL_TRANSFERSYNTAX *ts;
if ((lst == NULL) || (*lst == NULL))
return;
while ((pc = (DUL_PRESENTATIONCONTEXT*) LST_Dequeue(lst)) != NULL) {
if (pc->proposedTransferSyntax != NULL) {
while ((ts = (DUL_TRANSFERSYNTAX*) LST_Dequeue(&pc->proposedTransferSyntax)) != NULL) {
free(ts);
}
LST_Destroy(&pc->proposedTransferSyntax);
}
free(pc);
}
LST_Destroy(lst);
} | 107 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyPresentationContextList | destroyPresentationContextList( LST_HEAD ** lst) | ['lst'] | destroyPresentationContextList(LST_HEAD ** lst)
{
DUL_PRESENTATIONCONTEXT *pc;
DUL_TRANSFERSYNTAX *ts;
if ((lst == NULL) || (*lst == NULL))
return;
while ((pc = (DUL_PRESENTATIONCONTEXT*) LST_Dequeue(lst)) != NULL) {
if (pc->proposedTransferSyntax != NULL) {
while ((ts = (DUL_TRANSFERSYNTAX*) LST_Dequeue(&pc->proposedTransferSyntax)) != NULL) {
free(ts);
}
LST_Destroy(&pc->proposedTransferSyntax);
}
free(pc);
}
LST_Destroy(lst);
} | 107 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyPresentationContextList | destroyPresentationContextList( LST_HEAD ** lst) | ['lst'] | destroyPresentationContextList(LST_HEAD ** lst)
{
DUL_PRESENTATIONCONTEXT *pc;
DUL_TRANSFERSYNTAX *ts;
if ((lst == NULL) || (*lst == NULL))
return;
while ((pc = (DUL_PRESENTATIONCONTEXT*) LST_Dequeue(lst)) != NULL) {
if (pc->proposedTransferSyntax != NULL) {
while ((ts = (DUL_TRANSFERSYNTAX*) LST_Dequeue(&pc->proposedTransferSyntax)) != NULL) {
free(ts);
}
LST_Destroy(&pc->proposedTransferSyntax);
}
free(pc);
}
LST_Destroy(lst);
} | 107 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyPresentationContextList | destroyPresentationContextList( LST_HEAD ** l) | ['l'] | destroyPresentationContextList(LST_HEAD ** l)
{
PRV_PRESENTATIONCONTEXTITEM
* prvCtx;
DUL_SUBITEM
* subItem;
if (*l == NULL)
return;
prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l);
while (prvCtx != NULL) {
subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSyntaxList);
while (subItem != NULL) {
free(subItem);
subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSyntaxList);
}
LST_Destroy(&prvCtx->transferSyntaxList);
free(prvCtx);
prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l);
}
LST_Destroy(l);
} | 114 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyPresentationContextList | destroyPresentationContextList( LST_HEAD ** l) | ['l'] | destroyPresentationContextList(LST_HEAD ** l)
{
PRV_PRESENTATIONCONTEXTITEM
* prvCtx;
DUL_SUBITEM
* subItem;
if (*l == NULL)
return;
prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l);
while (prvCtx != NULL) {
subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSyntaxList);
while (subItem != NULL) {
free(subItem);
subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSyntaxList);
}
LST_Destroy(&prvCtx->transferSyntaxList);
free(prvCtx);
prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l);
}
LST_Destroy(l);
} | 114 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyPresentationContextList | destroyPresentationContextList( LST_HEAD ** l) | ['l'] | destroyPresentationContextList(LST_HEAD ** l)
{
PRV_PRESENTATIONCONTEXTITEM
* prvCtx;
DUL_SUBITEM
* subItem;
if (*l == NULL)
return;
prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l);
while (prvCtx != NULL) {
subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSyntaxList);
while (subItem != NULL) {
free(subItem);
subItem = (DUL_SUBITEM*)LST_Dequeue(&prvCtx->transferSyntaxList);
}
LST_Destroy(&prvCtx->transferSyntaxList);
free(prvCtx);
prvCtx = (PRV_PRESENTATIONCONTEXTITEM*)LST_Dequeue(l);
}
LST_Destroy(l);
} | 114 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyUserInformationLists | destroyUserInformationLists( DUL_USERINFO * userInfo) | ['userInfo'] | destroyUserInformationLists(DUL_USERINFO * userInfo)
{
PRV_SCUSCPROLE
* role;
role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList);
while (role != NULL) {
free(role);
role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList);
}
LST_Destroy(&userInfo->SCUSCPRoleList);
/* extended negotiation */
delete userInfo->extNegList; userInfo->extNegList = NULL;
/* user identity negotiation */
delete userInfo->usrIdent; userInfo->usrIdent = NULL;
} | 83 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyUserInformationLists | destroyUserInformationLists( DUL_USERINFO * userInfo) | ['userInfo'] | destroyUserInformationLists(DUL_USERINFO * userInfo)
{
PRV_SCUSCPROLE
* role;
role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList);
while (role != NULL) {
free(role);
role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList);
}
LST_Destroy(&userInfo->SCUSCPRoleList);
/* extended negotiation */
delete userInfo->extNegList; userInfo->extNegList = NULL;
/* user identity negotiation */
delete userInfo->usrIdent; userInfo->usrIdent = NULL;
} | 83 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | destroyUserInformationLists | destroyUserInformationLists( DUL_USERINFO * userInfo) | ['userInfo'] | destroyUserInformationLists(DUL_USERINFO * userInfo)
{
PRV_SCUSCPROLE
* role;
role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList);
while (role != NULL) {
free(role);
role = (PRV_SCUSCPROLE*)LST_Dequeue(&userInfo->SCUSCPRoleList);
}
LST_Destroy(&userInfo->SCUSCPRoleList);
/* extended negotiation */
delete userInfo->extNegList; userInfo->extNegList = NULL;
/* user identity negotiation */
delete userInfo->usrIdent; userInfo->usrIdent = NULL;
} | 83 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parseAssociate | parseAssociate( unsigned char * buf , unsigned long pduLength , PRV_ASSOCIATEPDU * assoc) | ['buf', 'pduLength', 'assoc'] | parseAssociate(unsigned char *buf, unsigned long pduLength,
PRV_ASSOCIATEPDU * assoc)
{
OFCondition cond = EC_Normal;
unsigned char
type;
unsigned long
itemLength;
PRV_PRESENTATIONCONTEXTITEM
* context;
(void) memset(assoc, 0, sizeof(*assoc));
if ((assoc->presentationContextList = LST_Create()) == NULL) return EC_MemoryExhausted;
if ((assoc->userInfo.SCUSCPRoleList = LST_Create()) == NULL) return EC_MemoryExhausted;
// Check if the PDU actually is long enough for the fields we read
if (pduLength < 2 + 2 + 16 + 16 + 32)
return makeLengthError("associate PDU", pduLength, 2 + 2 + 16 + 16 + 32);
assoc->type = *buf++;
assoc->rsv1 = *buf++;
EXTRACT_LONG_BIG(buf, assoc->length);
buf += 4;
EXTRACT_SHORT_BIG(buf, assoc->protocol);
buf += 2;
pduLength -= 2;
if ((assoc->protocol & DUL_PROTOCOL) == 0)
{
char buffer[256];
sprintf(buffer, "DUL Unsupported peer protocol %04x; expected %04x in %s", assoc->protocol, DUL_PROTOCOL, "parseAssociate");
return makeDcmnetCondition(DULC_UNSUPPORTEDPEERPROTOCOL, OF_error, buffer);
}
assoc->rsv2[0] = *buf++;
pduLength--;
assoc->rsv2[1] = *buf++;
pduLength--;
(void) strncpy(assoc->calledAPTitle, (char *) buf, 16);
assoc->calledAPTitle[16] = '\0';
trim_trailing_spaces(assoc->calledAPTitle);
buf += 16;
pduLength -= 16;
(void) strncpy(assoc->callingAPTitle, (char *) buf, 16);
assoc->callingAPTitle[16] = '\0';
trim_trailing_spaces(assoc->callingAPTitle);
buf += 16;
pduLength -= 16;
(void) memcpy(assoc->rsv3, buf, 32);
buf += 32;
pduLength -= 32;
if (DCM_dcmnetLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) {
const char *s;
DCMNET_DEBUG("Parsing an A-ASSOCIATE PDU");
if (assoc->type == DUL_TYPEASSOCIATERQ)
s = "A-ASSOCIATE RQ";
else if (assoc->type == DUL_TYPEASSOCIATEAC)
s = "A-ASSOCIATE AC";
else
s = "Unknown: Programming bug in parseAssociate";
/* If we hit the "Unknown type", there is a programming bug somewhere.
** This function is only supposed to parse A-ASSOCIATE PDUs and
** expects its input to have been properly screened.
*/
DCMNET_TRACE("PDU type: "
<< STD_NAMESPACE hex << ((unsigned int)assoc->type)
<< STD_NAMESPACE dec << " (" << s << "), PDU Length: " << assoc->length << OFendl
<< "DICOM Protocol: "
<< STD_NAMESPACE hex << assoc->protocol
<< STD_NAMESPACE dec << OFendl
<< "Called AP Title: " << assoc->calledAPTitle << OFendl
<< "Calling AP Title: " << assoc->callingAPTitle);
}
while ((cond.good()) && (pduLength > 0))
{
type = *buf;
DCMNET_TRACE("Parsing remaining " << pduLength << " bytes of A-ASSOCIATE PDU" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << ((unsigned int)type));
switch (type) {
case DUL_TYPEAPPLICATIONCONTEXT:
cond = parseSubItem(&assoc->applicationContext,
buf, &itemLength, pduLength);
if (cond.good())
{
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("Application Context item", pduLength, itemLength);
DCMNET_TRACE("Successfully parsed Application Context");
}
break;
case DUL_TYPEPRESENTATIONCONTEXTRQ:
case DUL_TYPEPRESENTATIONCONTEXTAC:
context = (PRV_PRESENTATIONCONTEXTITEM*)malloc(sizeof(PRV_PRESENTATIONCONTEXTITEM));
if (context == NULL) return EC_MemoryExhausted;
(void) memset(context, 0, sizeof(*context));
cond = parsePresentationContext(type, context, buf, &itemLength, pduLength);
if (cond.bad()) return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("Presentation Context item", pduLength, itemLength);
LST_Enqueue(&assoc->presentationContextList, (LST_NODE*)context);
DCMNET_TRACE("Successfully parsed Presentation Context");
break;
case DUL_TYPEUSERINFO:
// parse user info, which can contain several sub-items like User
// Identity Negotiation or SOP Class Extended Negotiation
cond = parseUserInfo(&assoc->userInfo, buf, &itemLength, assoc->type, pduLength);
if (cond.bad())
return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("User Information item", pduLength, itemLength);
DCMNET_TRACE("Successfully parsed User Information");
break;
default:
cond = parseDummy(buf, &itemLength, pduLength);
if (cond.bad())
return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("unknown item type", pduLength, itemLength);
break;
}
}
return cond;
} | 862 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parseAssociate | parseAssociate( unsigned char * buf , unsigned long pduLength , PRV_ASSOCIATEPDU * assoc) | ['buf', 'pduLength', 'assoc'] | parseAssociate(unsigned char *buf, unsigned long pduLength,
PRV_ASSOCIATEPDU * assoc)
{
OFCondition cond = EC_Normal;
unsigned char
type;
unsigned long
itemLength;
PRV_PRESENTATIONCONTEXTITEM
* context;
(void) memset(assoc, 0, sizeof(*assoc));
if ((assoc->presentationContextList = LST_Create()) == NULL) return EC_MemoryExhausted;
if ((assoc->userInfo.SCUSCPRoleList = LST_Create()) == NULL) return EC_MemoryExhausted;
// Check if the PDU actually is long enough for the fields we read
if (pduLength < 2 + 2 + 16 + 16 + 32)
return makeLengthError("associate PDU", pduLength, 2 + 2 + 16 + 16 + 32);
assoc->type = *buf++;
assoc->rsv1 = *buf++;
EXTRACT_LONG_BIG(buf, assoc->length);
buf += 4;
EXTRACT_SHORT_BIG(buf, assoc->protocol);
buf += 2;
pduLength -= 2;
if ((assoc->protocol & DUL_PROTOCOL) == 0)
{
char buffer[256];
sprintf(buffer, "DUL Unsupported peer protocol %04x; expected %04x in %s", assoc->protocol, DUL_PROTOCOL, "parseAssociate");
return makeDcmnetCondition(DULC_UNSUPPORTEDPEERPROTOCOL, OF_error, buffer);
}
assoc->rsv2[0] = *buf++;
pduLength--;
assoc->rsv2[1] = *buf++;
pduLength--;
(void) strncpy(assoc->calledAPTitle, (char *) buf, 16);
assoc->calledAPTitle[16] = '\0';
trim_trailing_spaces(assoc->calledAPTitle);
buf += 16;
pduLength -= 16;
(void) strncpy(assoc->callingAPTitle, (char *) buf, 16);
assoc->callingAPTitle[16] = '\0';
trim_trailing_spaces(assoc->callingAPTitle);
buf += 16;
pduLength -= 16;
(void) memcpy(assoc->rsv3, buf, 32);
buf += 32;
pduLength -= 32;
if (DCM_dcmnetLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) {
const char *s;
DCMNET_DEBUG("Parsing an A-ASSOCIATE PDU");
if (assoc->type == DUL_TYPEASSOCIATERQ)
s = "A-ASSOCIATE RQ";
else if (assoc->type == DUL_TYPEASSOCIATEAC)
s = "A-ASSOCIATE AC";
else
s = "Unknown: Programming bug in parseAssociate";
/* If we hit the "Unknown type", there is a programming bug somewhere.
** This function is only supposed to parse A-ASSOCIATE PDUs and
** expects its input to have been properly screened.
*/
DCMNET_TRACE("PDU type: "
<< STD_NAMESPACE hex << ((unsigned int)assoc->type)
<< STD_NAMESPACE dec << " (" << s << "), PDU Length: " << assoc->length << OFendl
<< "DICOM Protocol: "
<< STD_NAMESPACE hex << assoc->protocol
<< STD_NAMESPACE dec << OFendl
<< "Called AP Title: " << assoc->calledAPTitle << OFendl
<< "Calling AP Title: " << assoc->callingAPTitle);
}
while ((cond.good()) && (pduLength > 0))
{
type = *buf;
DCMNET_TRACE("Parsing remaining " << pduLength << " bytes of A-ASSOCIATE PDU" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << ((unsigned int)type));
switch (type) {
case DUL_TYPEAPPLICATIONCONTEXT:
cond = parseSubItem(&assoc->applicationContext,
buf, &itemLength, pduLength);
if (cond.good())
{
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("Application Context item", pduLength, itemLength);
DCMNET_TRACE("Successfully parsed Application Context");
}
break;
case DUL_TYPEPRESENTATIONCONTEXTRQ:
case DUL_TYPEPRESENTATIONCONTEXTAC:
context = (PRV_PRESENTATIONCONTEXTITEM*)malloc(sizeof(PRV_PRESENTATIONCONTEXTITEM));
if (context == NULL) return EC_MemoryExhausted;
(void) memset(context, 0, sizeof(*context));
cond = parsePresentationContext(type, context, buf, &itemLength, pduLength);
if (cond.bad()) return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("Presentation Context item", pduLength, itemLength);
LST_Enqueue(&assoc->presentationContextList, (LST_NODE*)context);
DCMNET_TRACE("Successfully parsed Presentation Context");
break;
case DUL_TYPEUSERINFO:
// parse user info, which can contain several sub-items like User
// Identity Negotiation or SOP Class Extended Negotiation
cond = parseUserInfo(&assoc->userInfo, buf, &itemLength, assoc->type, pduLength);
if (cond.bad())
return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("User Information item", pduLength, itemLength);
DCMNET_TRACE("Successfully parsed User Information");
break;
default:
cond = parseDummy(buf, &itemLength, pduLength);
if (cond.bad())
return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("unknown item type", pduLength, itemLength);
break;
}
}
return cond;
} | 862 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parseAssociate | parseAssociate( unsigned char * buf , unsigned long pduLength , PRV_ASSOCIATEPDU * assoc) | ['buf', 'pduLength', 'assoc'] | parseAssociate(unsigned char *buf, unsigned long pduLength,
PRV_ASSOCIATEPDU * assoc)
{
OFCondition cond = EC_Normal;
unsigned char
type;
unsigned long
itemLength;
PRV_PRESENTATIONCONTEXTITEM
* context;
(void) memset(assoc, 0, sizeof(*assoc));
if ((assoc->presentationContextList = LST_Create()) == NULL) return EC_MemoryExhausted;
if ((assoc->userInfo.SCUSCPRoleList = LST_Create()) == NULL) return EC_MemoryExhausted;
// Check if the PDU actually is long enough for the fields we read
if (pduLength < 2 + 2 + 16 + 16 + 32)
return makeLengthError("associate PDU", pduLength, 2 + 2 + 16 + 16 + 32);
assoc->type = *buf++;
assoc->rsv1 = *buf++;
EXTRACT_LONG_BIG(buf, assoc->length);
buf += 4;
EXTRACT_SHORT_BIG(buf, assoc->protocol);
buf += 2;
pduLength -= 2;
if ((assoc->protocol & DUL_PROTOCOL) == 0)
{
char buffer[256];
sprintf(buffer, "DUL Unsupported peer protocol %04x; expected %04x in %s", assoc->protocol, DUL_PROTOCOL, "parseAssociate");
return makeDcmnetCondition(DULC_UNSUPPORTEDPEERPROTOCOL, OF_error, buffer);
}
assoc->rsv2[0] = *buf++;
pduLength--;
assoc->rsv2[1] = *buf++;
pduLength--;
(void) strncpy(assoc->calledAPTitle, (char *) buf, 16);
assoc->calledAPTitle[16] = '\0';
trim_trailing_spaces(assoc->calledAPTitle);
buf += 16;
pduLength -= 16;
(void) strncpy(assoc->callingAPTitle, (char *) buf, 16);
assoc->callingAPTitle[16] = '\0';
trim_trailing_spaces(assoc->callingAPTitle);
buf += 16;
pduLength -= 16;
(void) memcpy(assoc->rsv3, buf, 32);
buf += 32;
pduLength -= 32;
if (DCM_dcmnetLogger.isEnabledFor(OFLogger::DEBUG_LOG_LEVEL)) {
const char *s;
DCMNET_DEBUG("Parsing an A-ASSOCIATE PDU");
if (assoc->type == DUL_TYPEASSOCIATERQ)
s = "A-ASSOCIATE RQ";
else if (assoc->type == DUL_TYPEASSOCIATEAC)
s = "A-ASSOCIATE AC";
else
s = "Unknown: Programming bug in parseAssociate";
/* If we hit the "Unknown type", there is a programming bug somewhere.
** This function is only supposed to parse A-ASSOCIATE PDUs and
** expects its input to have been properly screened.
*/
DCMNET_TRACE("PDU type: "
<< STD_NAMESPACE hex << ((unsigned int)assoc->type)
<< STD_NAMESPACE dec << " (" << s << "), PDU Length: " << assoc->length << OFendl
<< "DICOM Protocol: "
<< STD_NAMESPACE hex << assoc->protocol
<< STD_NAMESPACE dec << OFendl
<< "Called AP Title: " << assoc->calledAPTitle << OFendl
<< "Calling AP Title: " << assoc->callingAPTitle);
}
while ((cond.good()) && (pduLength > 0))
{
type = *buf;
DCMNET_TRACE("Parsing remaining " << pduLength << " bytes of A-ASSOCIATE PDU" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << ((unsigned int)type));
switch (type) {
case DUL_TYPEAPPLICATIONCONTEXT:
cond = parseSubItem(&assoc->applicationContext,
buf, &itemLength, pduLength);
if (cond.good())
{
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("Application Context item", pduLength, itemLength);
DCMNET_TRACE("Successfully parsed Application Context");
}
break;
case DUL_TYPEPRESENTATIONCONTEXTRQ:
case DUL_TYPEPRESENTATIONCONTEXTAC:
context = (PRV_PRESENTATIONCONTEXTITEM*)malloc(sizeof(PRV_PRESENTATIONCONTEXTITEM));
if (context == NULL) return EC_MemoryExhausted;
(void) memset(context, 0, sizeof(*context));
cond = parsePresentationContext(type, context, buf, &itemLength, pduLength);
if (cond.bad()) return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("Presentation Context item", pduLength, itemLength);
LST_Enqueue(&assoc->presentationContextList, (LST_NODE*)context);
DCMNET_TRACE("Successfully parsed Presentation Context");
break;
case DUL_TYPEUSERINFO:
// parse user info, which can contain several sub-items like User
// Identity Negotiation or SOP Class Extended Negotiation
cond = parseUserInfo(&assoc->userInfo, buf, &itemLength, assoc->type, pduLength);
if (cond.bad())
return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("User Information item", pduLength, itemLength);
DCMNET_TRACE("Successfully parsed User Information");
break;
default:
cond = parseDummy(buf, &itemLength, pduLength);
if (cond.bad())
return cond;
buf += itemLength;
if (!OFStandard::safeSubtract(pduLength, itemLength, pduLength))
return makeUnderflowError("unknown item type", pduLength, itemLength);
break;
}
}
return cond;
} | 862 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parsePresentationContext | parsePresentationContext( unsigned char type , PRV_PRESENTATIONCONTEXTITEM * context , unsigned char * buf , unsigned long * itemLength , unsigned long availData) | ['type', 'context', 'buf', 'itemLength', 'availData'] | parsePresentationContext(unsigned char type,
PRV_PRESENTATIONCONTEXTITEM * context, unsigned char *buf,
unsigned long *itemLength, unsigned long availData)
{
unsigned long
length;
unsigned long
presentationLength;
OFCondition cond = EC_Normal;
DUL_SUBITEM
* subItem;
// We need at least 8 bytes, anything smaller would be reading past the end
if (availData < 8)
return makeLengthError("presentation context", availData, 8);
if ((context->transferSyntaxList = LST_Create()) == NULL) return EC_MemoryExhausted;
*itemLength = 0;
context->type = *buf++;
context->rsv1 = *buf++;
EXTRACT_SHORT_BIG(buf, context->length);
buf += 2;
context->contextID = *buf++;
context->rsv2 = *buf++;
context->result = *buf++;
context->rsv3 = *buf++;
length = context->length;
*itemLength = 2 + 2 + length;
// Does the length field claim to be larger than the containing PDU?
if (availData - 4 < length || length < 4)
return makeLengthError("presentation context", availData, 4, length);
DCMNET_TRACE("Parsing Presentation Context: ("
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)context->type
<< STD_NAMESPACE dec << "), Length: " << (unsigned long)context->length << OFendl
<< "Presentation Context ID: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)context->contextID
<< STD_NAMESPACE dec);
presentationLength = length - 4;
if (!((type == DUL_TYPEPRESENTATIONCONTEXTAC) &&
(context->result != DUL_PRESENTATION_ACCEPT))) {
while (presentationLength > 0) {
DCMNET_TRACE("Parsing remaining " << presentationLength << " bytes of Presentation Context" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)*buf);
switch (*buf) {
case DUL_TYPEABSTRACTSYNTAX:
cond = parseSubItem(&context->abstractSyntax, buf, &length, presentationLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("Abstract Syntax", presentationLength, length);
DCMNET_TRACE("Successfully parsed Abstract Syntax");
break;
case DUL_TYPETRANSFERSYNTAX:
subItem = (DUL_SUBITEM*)malloc(sizeof(DUL_SUBITEM));
if (subItem == NULL) return EC_MemoryExhausted;
cond = parseSubItem(subItem, buf, &length, presentationLength);
if (cond.bad()) return cond;
LST_Enqueue(&context->transferSyntaxList, (LST_NODE*)subItem);
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("Transfer Syntax", presentationLength, length);
DCMNET_TRACE("Successfully parsed Transfer Syntax");
break;
default:
cond = parseDummy(buf, &length, presentationLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("unknown presentation context type", presentationLength, length);
break;
}
}
}
return EC_Normal;
} | 575 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parsePresentationContext | parsePresentationContext( unsigned char type , PRV_PRESENTATIONCONTEXTITEM * context , unsigned char * buf , unsigned long * itemLength , unsigned long availData) | ['type', 'context', 'buf', 'itemLength', 'availData'] | parsePresentationContext(unsigned char type,
PRV_PRESENTATIONCONTEXTITEM * context, unsigned char *buf,
unsigned long *itemLength, unsigned long availData)
{
unsigned long
length;
unsigned long
presentationLength;
OFCondition cond = EC_Normal;
DUL_SUBITEM
* subItem;
// We need at least 8 bytes, anything smaller would be reading past the end
if (availData < 8)
return makeLengthError("presentation context", availData, 8);
if ((context->transferSyntaxList = LST_Create()) == NULL) return EC_MemoryExhausted;
*itemLength = 0;
context->type = *buf++;
context->rsv1 = *buf++;
EXTRACT_SHORT_BIG(buf, context->length);
buf += 2;
context->contextID = *buf++;
context->rsv2 = *buf++;
context->result = *buf++;
context->rsv3 = *buf++;
length = context->length;
*itemLength = 2 + 2 + length;
// Does the length field claim to be larger than the containing PDU?
if (availData - 4 < length || length < 4)
return makeLengthError("presentation context", availData, 4, length);
DCMNET_TRACE("Parsing Presentation Context: ("
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)context->type
<< STD_NAMESPACE dec << "), Length: " << (unsigned long)context->length << OFendl
<< "Presentation Context ID: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)context->contextID
<< STD_NAMESPACE dec);
presentationLength = length - 4;
if (!((type == DUL_TYPEPRESENTATIONCONTEXTAC) &&
(context->result != DUL_PRESENTATION_ACCEPT))) {
while (presentationLength > 0) {
DCMNET_TRACE("Parsing remaining " << presentationLength << " bytes of Presentation Context" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)*buf);
switch (*buf) {
case DUL_TYPEABSTRACTSYNTAX:
cond = parseSubItem(&context->abstractSyntax, buf, &length, presentationLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("Abstract Syntax", presentationLength, length);
DCMNET_TRACE("Successfully parsed Abstract Syntax");
break;
case DUL_TYPETRANSFERSYNTAX:
subItem = (DUL_SUBITEM*)malloc(sizeof(DUL_SUBITEM));
if (subItem == NULL) return EC_MemoryExhausted;
cond = parseSubItem(subItem, buf, &length, presentationLength);
if (cond.bad()) return cond;
LST_Enqueue(&context->transferSyntaxList, (LST_NODE*)subItem);
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("Transfer Syntax", presentationLength, length);
DCMNET_TRACE("Successfully parsed Transfer Syntax");
break;
default:
cond = parseDummy(buf, &length, presentationLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("unknown presentation context type", presentationLength, length);
break;
}
}
}
return EC_Normal;
} | 575 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parsePresentationContext | parsePresentationContext( unsigned char type , PRV_PRESENTATIONCONTEXTITEM * context , unsigned char * buf , unsigned long * itemLength , unsigned long availData) | ['type', 'context', 'buf', 'itemLength', 'availData'] | parsePresentationContext(unsigned char type,
PRV_PRESENTATIONCONTEXTITEM * context, unsigned char *buf,
unsigned long *itemLength, unsigned long availData)
{
unsigned long
length;
unsigned long
presentationLength;
OFCondition cond = EC_Normal;
DUL_SUBITEM
* subItem;
// We need at least 8 bytes, anything smaller would be reading past the end
if (availData < 8)
return makeLengthError("presentation context", availData, 8);
if ((context->transferSyntaxList = LST_Create()) == NULL) return EC_MemoryExhausted;
*itemLength = 0;
context->type = *buf++;
context->rsv1 = *buf++;
EXTRACT_SHORT_BIG(buf, context->length);
buf += 2;
context->contextID = *buf++;
context->rsv2 = *buf++;
context->result = *buf++;
context->rsv3 = *buf++;
length = context->length;
*itemLength = 2 + 2 + length;
// Does the length field claim to be larger than the containing PDU?
if (availData - 4 < length || length < 4)
return makeLengthError("presentation context", availData, 4, length);
DCMNET_TRACE("Parsing Presentation Context: ("
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)context->type
<< STD_NAMESPACE dec << "), Length: " << (unsigned long)context->length << OFendl
<< "Presentation Context ID: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)context->contextID
<< STD_NAMESPACE dec);
presentationLength = length - 4;
if (!((type == DUL_TYPEPRESENTATIONCONTEXTAC) &&
(context->result != DUL_PRESENTATION_ACCEPT))) {
while (presentationLength > 0) {
DCMNET_TRACE("Parsing remaining " << presentationLength << " bytes of Presentation Context" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)*buf);
switch (*buf) {
case DUL_TYPEABSTRACTSYNTAX:
cond = parseSubItem(&context->abstractSyntax, buf, &length, presentationLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("Abstract Syntax", presentationLength, length);
DCMNET_TRACE("Successfully parsed Abstract Syntax");
break;
case DUL_TYPETRANSFERSYNTAX:
subItem = (DUL_SUBITEM*)malloc(sizeof(DUL_SUBITEM));
if (subItem == NULL) return EC_MemoryExhausted;
cond = parseSubItem(subItem, buf, &length, presentationLength);
if (cond.bad()) return cond;
LST_Enqueue(&context->transferSyntaxList, (LST_NODE*)subItem);
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("Transfer Syntax", presentationLength, length);
DCMNET_TRACE("Successfully parsed Transfer Syntax");
break;
default:
cond = parseDummy(buf, &length, presentationLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(presentationLength, length, presentationLength))
return makeUnderflowError("unknown presentation context type", presentationLength, length);
break;
}
}
}
return EC_Normal;
} | 575 | True | 1 |
CVE-2021-41687 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The program malloc a heap memory for parsing data, but does not free it when error in parsing. Sending specific requests to the dcmqrdb program incur the memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parseUserInfo | parseUserInfo( DUL_USERINFO * userInfo , unsigned char * buf , unsigned long * itemLength , unsigned char typeRQorAC , unsigned long availData) | ['userInfo', 'buf', 'itemLength', 'typeRQorAC', 'availData'] | parseUserInfo(DUL_USERINFO * userInfo,
unsigned char *buf,
unsigned long *itemLength,
unsigned char typeRQorAC,
unsigned long availData /* bytes left for in this PDU */)
{
unsigned short userLength;
unsigned long length;
OFCondition cond = EC_Normal;
PRV_SCUSCPROLE *role;
SOPClassExtendedNegotiationSubItem *extNeg = NULL;
UserIdentityNegotiationSubItem *usrIdent = NULL;
// minimum allowed size is 4 byte (case where the length of the user data is 0),
// else we read past the buffer end
if (availData < 4)
return makeLengthError("user info", availData, 4);
// skip item type (50H) field
userInfo->type = *buf++;
// skip unused ("reserved") field
userInfo->rsv1 = *buf++;
// get and remember announced length of user data
EXTRACT_SHORT_BIG(buf, userInfo->length);
// .. and skip over the two length field bytes
buf += 2;
// userLength contains announced length of full user item structure,
// will be used here to count down the available data later
userLength = userInfo->length;
// itemLength contains full length of the user item including the 4 bytes extra header (type, reserved + 2 for length)
*itemLength = userLength + 4;
// does this item claim to be larger than the available data?
if (availData < *itemLength)
return makeLengthError("user info", availData, 0, userLength);
DCMNET_TRACE("Parsing user info field ("
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)userInfo->type
<< STD_NAMESPACE dec << "), Length: " << (unsigned long)userInfo->length);
// parse through different types of user items as long as we have data
while (userLength > 0) {
DCMNET_TRACE("Parsing remaining " << (long)userLength << " bytes of User Information" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)*buf);
switch (*buf) {
case DUL_TYPEMAXLENGTH:
cond = parseMaxPDU(&userInfo->maxLength, buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("maximum length sub-item", userLength, length);
DCMNET_TRACE("Successfully parsed Maximum PDU Length");
break;
case DUL_TYPEIMPLEMENTATIONCLASSUID:
cond = parseSubItem(&userInfo->implementationClassUID,
buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("Implementation Class UID sub-item", userLength, length);
break;
case DUL_TYPEASYNCOPERATIONS:
cond = parseDummy(buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("asynchronous operation user item type", userLength, length);
break;
case DUL_TYPESCUSCPROLE:
role = (PRV_SCUSCPROLE*)malloc(sizeof(PRV_SCUSCPROLE));
if (role == NULL) return EC_MemoryExhausted;
cond = parseSCUSCPRole(role, buf, &length, userLength);
if (cond.bad()) return cond;
LST_Enqueue(&userInfo->SCUSCPRoleList, (LST_NODE*)role);
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("SCP/SCU Role Selection sub-item", userLength, length);
break;
case DUL_TYPEIMPLEMENTATIONVERSIONNAME:
cond = parseSubItem(&userInfo->implementationVersionName,
buf, &length, userLength);
if (cond.bad()) return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("Implementation Version Name structure", userLength, length);
break;
case DUL_TYPESOPCLASSEXTENDEDNEGOTIATION:
/* parse an extended negotiation sub-item */
extNeg = new SOPClassExtendedNegotiationSubItem;
if (extNeg == NULL) return EC_MemoryExhausted;
cond = parseExtNeg(extNeg, buf, &length, userLength);
if (cond.bad()) return cond;
if (userInfo->extNegList == NULL)
{
userInfo->extNegList = new SOPClassExtendedNegotiationSubItemList;
if (userInfo->extNegList == NULL) return EC_MemoryExhausted;
}
userInfo->extNegList->push_back(extNeg);
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("SOP Class Extended Negotiation sub-item", userLength, length);
break;
case DUL_TYPENEGOTIATIONOFUSERIDENTITY_REQ:
case DUL_TYPENEGOTIATIONOFUSERIDENTITY_ACK:
if (typeRQorAC == DUL_TYPEASSOCIATERQ)
usrIdent = new UserIdentityNegotiationSubItemRQ();
else // assume DUL_TYPEASSOCIATEAC
usrIdent = new UserIdentityNegotiationSubItemAC();
if (usrIdent == NULL) return EC_MemoryExhausted;
cond = usrIdent->parseFromBuffer(buf, length /*return value*/, userLength);
if (cond.bad())
{
delete usrIdent;
return cond;
}
userInfo->usrIdent = usrIdent;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("User Identity sub-item", userLength, length);
break;
default:
// we hit an unknown user item that is not defined in the standard
// or still unknown to DCMTK
cond = parseDummy(buf, &length /* returns bytes "handled" by parseDummy */, userLength /* data available in bytes for user item */);
if (cond.bad())
return cond;
// skip the bytes read
buf += length;
// subtract bytes of parsed data from available data bytes
if (OFstatic_cast(unsigned short, length) != length
|| !OFStandard::safeSubtract(userLength, OFstatic_cast(unsigned short, length), userLength))
return makeUnderflowError("unknown user item", userLength, length);
break;
}
}
return EC_Normal;
} | 913 | True | 1 |
CVE-2021-41688 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The object in the program is free but its address is still used in other locations. Sending specific requests to the dcmqrdb program will incur a double free. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:44Z | 2022-06-28T13:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parseUserInfo | parseUserInfo( DUL_USERINFO * userInfo , unsigned char * buf , unsigned long * itemLength , unsigned char typeRQorAC , unsigned long availData) | ['userInfo', 'buf', 'itemLength', 'typeRQorAC', 'availData'] | parseUserInfo(DUL_USERINFO * userInfo,
unsigned char *buf,
unsigned long *itemLength,
unsigned char typeRQorAC,
unsigned long availData /* bytes left for in this PDU */)
{
unsigned short userLength;
unsigned long length;
OFCondition cond = EC_Normal;
PRV_SCUSCPROLE *role;
SOPClassExtendedNegotiationSubItem *extNeg = NULL;
UserIdentityNegotiationSubItem *usrIdent = NULL;
// minimum allowed size is 4 byte (case where the length of the user data is 0),
// else we read past the buffer end
if (availData < 4)
return makeLengthError("user info", availData, 4);
// skip item type (50H) field
userInfo->type = *buf++;
// skip unused ("reserved") field
userInfo->rsv1 = *buf++;
// get and remember announced length of user data
EXTRACT_SHORT_BIG(buf, userInfo->length);
// .. and skip over the two length field bytes
buf += 2;
// userLength contains announced length of full user item structure,
// will be used here to count down the available data later
userLength = userInfo->length;
// itemLength contains full length of the user item including the 4 bytes extra header (type, reserved + 2 for length)
*itemLength = userLength + 4;
// does this item claim to be larger than the available data?
if (availData < *itemLength)
return makeLengthError("user info", availData, 0, userLength);
DCMNET_TRACE("Parsing user info field ("
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)userInfo->type
<< STD_NAMESPACE dec << "), Length: " << (unsigned long)userInfo->length);
// parse through different types of user items as long as we have data
while (userLength > 0) {
DCMNET_TRACE("Parsing remaining " << (long)userLength << " bytes of User Information" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)*buf);
switch (*buf) {
case DUL_TYPEMAXLENGTH:
cond = parseMaxPDU(&userInfo->maxLength, buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("maximum length sub-item", userLength, length);
DCMNET_TRACE("Successfully parsed Maximum PDU Length");
break;
case DUL_TYPEIMPLEMENTATIONCLASSUID:
cond = parseSubItem(&userInfo->implementationClassUID,
buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("Implementation Class UID sub-item", userLength, length);
break;
case DUL_TYPEASYNCOPERATIONS:
cond = parseDummy(buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("asynchronous operation user item type", userLength, length);
break;
case DUL_TYPESCUSCPROLE:
role = (PRV_SCUSCPROLE*)malloc(sizeof(PRV_SCUSCPROLE));
if (role == NULL) return EC_MemoryExhausted;
cond = parseSCUSCPRole(role, buf, &length, userLength);
if (cond.bad()) return cond;
LST_Enqueue(&userInfo->SCUSCPRoleList, (LST_NODE*)role);
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("SCP/SCU Role Selection sub-item", userLength, length);
break;
case DUL_TYPEIMPLEMENTATIONVERSIONNAME:
cond = parseSubItem(&userInfo->implementationVersionName,
buf, &length, userLength);
if (cond.bad()) return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("Implementation Version Name structure", userLength, length);
break;
case DUL_TYPESOPCLASSEXTENDEDNEGOTIATION:
/* parse an extended negotiation sub-item */
extNeg = new SOPClassExtendedNegotiationSubItem;
if (extNeg == NULL) return EC_MemoryExhausted;
cond = parseExtNeg(extNeg, buf, &length, userLength);
if (cond.bad()) return cond;
if (userInfo->extNegList == NULL)
{
userInfo->extNegList = new SOPClassExtendedNegotiationSubItemList;
if (userInfo->extNegList == NULL) return EC_MemoryExhausted;
}
userInfo->extNegList->push_back(extNeg);
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("SOP Class Extended Negotiation sub-item", userLength, length);
break;
case DUL_TYPENEGOTIATIONOFUSERIDENTITY_REQ:
case DUL_TYPENEGOTIATIONOFUSERIDENTITY_ACK:
if (typeRQorAC == DUL_TYPEASSOCIATERQ)
usrIdent = new UserIdentityNegotiationSubItemRQ();
else // assume DUL_TYPEASSOCIATEAC
usrIdent = new UserIdentityNegotiationSubItemAC();
if (usrIdent == NULL) return EC_MemoryExhausted;
cond = usrIdent->parseFromBuffer(buf, length /*return value*/, userLength);
if (cond.bad())
{
delete usrIdent;
return cond;
}
userInfo->usrIdent = usrIdent;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("User Identity sub-item", userLength, length);
break;
default:
// we hit an unknown user item that is not defined in the standard
// or still unknown to DCMTK
cond = parseDummy(buf, &length /* returns bytes "handled" by parseDummy */, userLength /* data available in bytes for user item */);
if (cond.bad())
return cond;
// skip the bytes read
buf += length;
// subtract bytes of parsed data from available data bytes
if (OFstatic_cast(unsigned short, length) != length
|| !OFStandard::safeSubtract(userLength, OFstatic_cast(unsigned short, length), userLength))
return makeUnderflowError("unknown user item", userLength, length);
break;
}
}
return EC_Normal;
} | 913 | True | 1 |
CVE-2021-41690 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/DCMTK/dcmtk', 'name': 'https://github.com/DCMTK/dcmtk', 'refsource': 'MISC', 'tags': ['Product', 'Third Party Advisory']}, {'url': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'name': 'https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:offis:dcmtk:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.6.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'DCMTK through 3.6.6 does not handle memory free properly. The malloced memory for storing all file information are recorded in a global variable LST and are not freed properly. Sending specific requests to the dcmqrdb program can incur a memory leak. An attacker can use it to launch a DoS attack.'}] | 2022-07-06T19:43Z | 2022-06-28T13:15Z | Missing Release of Memory after Effective Lifetime | The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. | This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions. In some languages, developers are responsible for tracking memory allocation and releasing the memory. If there are no more pointers or references to the memory, then it can no longer be tracked and identified for release.
| https://cwe.mitre.org/data/definitions/401.html | 0 | Michael Onken | 2021-10-02 00:29:56+02:00 | Fixed poss. NULL pointer dereference/double free.
Thanks to Jinsheng Ba <bajinsheng@u.nus.edu> for the report and some patches. | a9697dfeb672b0b9412c00c7d36d801e27ec85cb | False | DCMTK/dcmtk | Official DCMTK Github Mirror | 2017-09-09 08:35:42 | 2022-08-24 11:26:58 | https://git.dcmtk.org/ | DCMTK | 526.0 | 219.0 | parseUserInfo | parseUserInfo( DUL_USERINFO * userInfo , unsigned char * buf , unsigned long * itemLength , unsigned char typeRQorAC , unsigned long availData) | ['userInfo', 'buf', 'itemLength', 'typeRQorAC', 'availData'] | parseUserInfo(DUL_USERINFO * userInfo,
unsigned char *buf,
unsigned long *itemLength,
unsigned char typeRQorAC,
unsigned long availData /* bytes left for in this PDU */)
{
unsigned short userLength;
unsigned long length;
OFCondition cond = EC_Normal;
PRV_SCUSCPROLE *role;
SOPClassExtendedNegotiationSubItem *extNeg = NULL;
UserIdentityNegotiationSubItem *usrIdent = NULL;
// minimum allowed size is 4 byte (case where the length of the user data is 0),
// else we read past the buffer end
if (availData < 4)
return makeLengthError("user info", availData, 4);
// skip item type (50H) field
userInfo->type = *buf++;
// skip unused ("reserved") field
userInfo->rsv1 = *buf++;
// get and remember announced length of user data
EXTRACT_SHORT_BIG(buf, userInfo->length);
// .. and skip over the two length field bytes
buf += 2;
// userLength contains announced length of full user item structure,
// will be used here to count down the available data later
userLength = userInfo->length;
// itemLength contains full length of the user item including the 4 bytes extra header (type, reserved + 2 for length)
*itemLength = userLength + 4;
// does this item claim to be larger than the available data?
if (availData < *itemLength)
return makeLengthError("user info", availData, 0, userLength);
DCMNET_TRACE("Parsing user info field ("
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)userInfo->type
<< STD_NAMESPACE dec << "), Length: " << (unsigned long)userInfo->length);
// parse through different types of user items as long as we have data
while (userLength > 0) {
DCMNET_TRACE("Parsing remaining " << (long)userLength << " bytes of User Information" << OFendl
<< "Next item type: "
<< STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(2) << (unsigned int)*buf);
switch (*buf) {
case DUL_TYPEMAXLENGTH:
cond = parseMaxPDU(&userInfo->maxLength, buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("maximum length sub-item", userLength, length);
DCMNET_TRACE("Successfully parsed Maximum PDU Length");
break;
case DUL_TYPEIMPLEMENTATIONCLASSUID:
cond = parseSubItem(&userInfo->implementationClassUID,
buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("Implementation Class UID sub-item", userLength, length);
break;
case DUL_TYPEASYNCOPERATIONS:
cond = parseDummy(buf, &length, userLength);
if (cond.bad())
return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("asynchronous operation user item type", userLength, length);
break;
case DUL_TYPESCUSCPROLE:
role = (PRV_SCUSCPROLE*)malloc(sizeof(PRV_SCUSCPROLE));
if (role == NULL) return EC_MemoryExhausted;
cond = parseSCUSCPRole(role, buf, &length, userLength);
if (cond.bad()) return cond;
LST_Enqueue(&userInfo->SCUSCPRoleList, (LST_NODE*)role);
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("SCP/SCU Role Selection sub-item", userLength, length);
break;
case DUL_TYPEIMPLEMENTATIONVERSIONNAME:
cond = parseSubItem(&userInfo->implementationVersionName,
buf, &length, userLength);
if (cond.bad()) return cond;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("Implementation Version Name structure", userLength, length);
break;
case DUL_TYPESOPCLASSEXTENDEDNEGOTIATION:
/* parse an extended negotiation sub-item */
extNeg = new SOPClassExtendedNegotiationSubItem;
if (extNeg == NULL) return EC_MemoryExhausted;
cond = parseExtNeg(extNeg, buf, &length, userLength);
if (cond.bad()) return cond;
if (userInfo->extNegList == NULL)
{
userInfo->extNegList = new SOPClassExtendedNegotiationSubItemList;
if (userInfo->extNegList == NULL) return EC_MemoryExhausted;
}
userInfo->extNegList->push_back(extNeg);
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("SOP Class Extended Negotiation sub-item", userLength, length);
break;
case DUL_TYPENEGOTIATIONOFUSERIDENTITY_REQ:
case DUL_TYPENEGOTIATIONOFUSERIDENTITY_ACK:
if (typeRQorAC == DUL_TYPEASSOCIATERQ)
usrIdent = new UserIdentityNegotiationSubItemRQ();
else // assume DUL_TYPEASSOCIATEAC
usrIdent = new UserIdentityNegotiationSubItemAC();
if (usrIdent == NULL) return EC_MemoryExhausted;
cond = usrIdent->parseFromBuffer(buf, length /*return value*/, userLength);
if (cond.bad())
{
delete usrIdent;
return cond;
}
userInfo->usrIdent = usrIdent;
buf += length;
if (!OFStandard::safeSubtract(userLength, OFstatic_cast(short unsigned int, length), userLength))
return makeLengthError("User Identity sub-item", userLength, length);
break;
default:
// we hit an unknown user item that is not defined in the standard
// or still unknown to DCMTK
cond = parseDummy(buf, &length /* returns bytes "handled" by parseDummy */, userLength /* data available in bytes for user item */);
if (cond.bad())
return cond;
// skip the bytes read
buf += length;
// subtract bytes of parsed data from available data bytes
if (OFstatic_cast(unsigned short, length) != length
|| !OFStandard::safeSubtract(userLength, OFstatic_cast(unsigned short, length), userLength))
return makeUnderflowError("unknown user item", userLength, length);
break;
}
}
return EC_Normal;
} | 913 | True | 1 |
CVE-2021-4216 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=704834', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=704834', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/ArtifexSoftware/mupdf/commit/22c47acbd52949421f8c7cb46ea1556827d0fcbf', 'name': 'https://github.com/ArtifexSoftware/mupdf/commit/22c47acbd52949421f8c7cb46ea1556827d0fcbf', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': 'A Floating point exception (division-by-zero) flaw was found in Mupdf for zero width pages in muraster.c. It is fixed in Mupdf-1.20.0-rc1 upstream.'}] | 2022-08-26T17:17Z | 2022-08-26T16:15Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Sebastian Rasmussen | 2022-01-18 20:33:10+01:00 | Bug 704834: Fix division by zero for zero width pages in muraster. | 22c47acbd52949421f8c7cb46ea1556827d0fcbf | False | ArtifexSoftware/mupdf | mupdf mirror | 2015-06-24 10:41:35 | 2022-08-26 14:03:59 | http://www.mupdf.com/ | ArtifexSoftware | 614.0 | 186.0 | initialise_banding | initialise_banding( fz_context * ctx , render_details * render , int color) | ['ctx', 'render', 'color'] | initialise_banding(fz_context *ctx, render_details *render, int color)
{
size_t min_band_mem;
int bpp, h, w, reps;
render->colorspace = output_cs;
render->format = output_format;
#if GREY_FALLBACK != 0
if (color == 0)
{
if (render->colorspace == CS_RGB)
{
/* Fallback from PPM to PGM */
render->colorspace = CS_GRAY;
render->format = OUT_PGM;
}
else if (render->colorspace == CS_CMYK)
{
render->colorspace = CS_GRAY;
if (render->format == OUT_PKM)
render->format = OUT_PBM;
else
render->format = OUT_PGM;
}
}
#endif
switch (render->colorspace)
{
case CS_GRAY:
bpp = 1;
break;
case CS_RGB:
bpp = 2;
break;
default:
case CS_CMYK:
bpp = 3;
break;
}
w = render->ibounds.x1 - render->ibounds.x0;
min_band_mem = (size_t)bpp * w * min_band_height;
reps = (int)(max_band_memory / min_band_mem);
if (reps < 1)
reps = 1;
/* Adjust reps to even out the work between threads */
if (render->num_workers > 0)
{
int runs, num_bands;
h = render->ibounds.y1 - render->ibounds.y0;
num_bands = (h + min_band_height - 1) / min_band_height;
/* num_bands = number of min_band_height bands */
runs = (num_bands + reps-1) / reps;
/* runs = number of worker runs of reps min_band_height bands */
runs = ((runs + render->num_workers - 1) / render->num_workers) * render->num_workers;
/* runs = number of worker runs rounded up to make use of all our threads */
reps = (num_bands + runs - 1) / runs;
}
render->band_height_multiple = reps;
render->bands_rendered = 0;
if (output_format == OUT_PGM || output_format == OUT_PPM)
{
render->bander = fz_new_pnm_band_writer(ctx, out);
render->n = output_format == OUT_PGM ? 1 : 3;
}
else if (output_format == OUT_PAM)
{
render->bander = fz_new_pam_band_writer(ctx, out);
render->n = 4;
}
else if (output_format == OUT_PBM)
{
render->bander = fz_new_pbm_band_writer(ctx, out);
render->n = 1;
}
else if (output_format == OUT_PKM)
{
render->bander = fz_new_pkm_band_writer(ctx, out);
render->n = 4;
}
} | 402 | True | 1 |
CVE-2021-42341 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/OpenRC/openrc/issues/459', 'name': 'https://github.com/OpenRC/openrc/issues/459', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204', 'name': 'https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.gentoo.org/816900', 'name': 'https://bugs.gentoo.org/816900', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/pull/462', 'name': 'https://github.com/OpenRC/openrc/pull/462', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae', 'name': 'https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/issues/418', 'name': 'https://github.com/OpenRC/openrc/issues/418', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openrc_project:openrc:*:*:*:*:*:*:*:*', 'versionStartIncluding': '0.44.0', 'versionEndExcluding': '0.44.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "checkpath in OpenRC before 0.44.7 uses the direct output of strlen() to allocate strings, which does not account for the '\\0' byte at the end of the string. This results in memory corruption. CVE-2021-42341 was introduced in git commit 63db2d99e730547339d1bdd28e8437999c380cae, which was introduced as part of OpenRC 0.44.0 development."}] | 2021-10-20T19:03Z | 2021-10-14T05:15Z | Other | NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | William Hubbs | 2021-04-13 17:13:20-05:00 | checkpath: remove extra slashes from paths
This fixes #418. | 63db2d99e730547339d1bdd28e8437999c380cae | False | OpenRC/openrc | The OpenRC init system | 2013-04-13 23:21:59 | 2022-08-21 15:52:27 | OpenRC | 1029.0 | 188.0 | get_dirfd | get_dirfd( char * path , bool symlinks) | ['path', 'symlinks'] | static int get_dirfd(char *path, bool symlinks)
{
char *ch;
char *item;
char *linkpath = NULL;
char *path_dupe;
char *str;
int components = 0;
int dirfd;
int flags = 0;
int new_dirfd;
struct stat st;
ssize_t linksize;
if (!path || *path != '/')
eerrorx("%s: empty or relative path", applet);
dirfd = openat(dirfd, "/", O_RDONLY);
if (dirfd == -1)
eerrorx("%s: unable to open the root directory: %s",
applet, strerror(errno));
path_dupe = xstrdup(path);
ch = path_dupe;
while (*ch) {
if (*ch == '/')
components++;
ch++;
}
item = strtok(path_dupe, "/");
#ifdef O_PATH
flags |= O_PATH;
#endif
if (!symlinks)
flags |= O_NOFOLLOW;
flags |= O_RDONLY;
while (dirfd > 0 && item && components > 1) {
str = xstrdup(linkpath ? linkpath : item);
new_dirfd = openat(dirfd, str, flags);
if (new_dirfd == -1)
eerrorx("%s: %s: could not open %s: %s", applet, path, str,
strerror(errno));
if (fstat(new_dirfd, &st) == -1)
eerrorx("%s: %s: unable to stat %s: %s", applet, path, item,
strerror(errno));
if (S_ISLNK(st.st_mode) ) {
if (st.st_uid != 0)
eerrorx("%s: %s: symbolic link %s not owned by root",
applet, path, str);
linksize = st.st_size+1;
if (linkpath)
free(linkpath);
linkpath = xmalloc(linksize);
memset(linkpath, 0, linksize);
if (readlinkat(new_dirfd, "", linkpath, linksize) != st.st_size)
eerrorx("%s: symbolic link destination changed", applet);
/*
* now follow the symlink.
*/
close(new_dirfd);
} else {
close(dirfd);
dirfd = new_dirfd;
free(linkpath);
linkpath = NULL;
item = strtok(NULL, "/");
components--;
}
}
free(path_dupe);
if (linkpath) {
free(linkpath);
linkpath = NULL;
}
return dirfd;
} | 396 | True | 1 |
|
CVE-2021-42341 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/OpenRC/openrc/issues/459', 'name': 'https://github.com/OpenRC/openrc/issues/459', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204', 'name': 'https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.gentoo.org/816900', 'name': 'https://bugs.gentoo.org/816900', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/pull/462', 'name': 'https://github.com/OpenRC/openrc/pull/462', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae', 'name': 'https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/issues/418', 'name': 'https://github.com/OpenRC/openrc/issues/418', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openrc_project:openrc:*:*:*:*:*:*:*:*', 'versionStartIncluding': '0.44.0', 'versionEndExcluding': '0.44.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "checkpath in OpenRC before 0.44.7 uses the direct output of strlen() to allocate strings, which does not account for the '\\0' byte at the end of the string. This results in memory corruption. CVE-2021-42341 was introduced in git commit 63db2d99e730547339d1bdd28e8437999c380cae, which was introduced as part of OpenRC 0.44.0 development."}] | 2021-10-20T19:03Z | 2021-10-14T05:15Z | Other | NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | William Hubbs | 2021-04-13 17:13:20-05:00 | checkpath: remove extra slashes from paths
This fixes #418. | 63db2d99e730547339d1bdd28e8437999c380cae | False | OpenRC/openrc | The OpenRC init system | 2013-04-13 23:21:59 | 2022-08-21 15:52:27 | OpenRC | 1029.0 | 188.0 | main | main( int argc , char ** argv) | ['argc', 'argv'] | int main(int argc, char **argv)
{
int opt;
uid_t uid = geteuid();
gid_t gid = getgid();
mode_t mode = 0;
struct passwd *pw = NULL;
struct group *gr = NULL;
inode_t type = inode_unknown;
int retval = EXIT_SUCCESS;
bool trunc = false;
bool chowner = false;
bool symlinks = false;
bool writable = false;
bool selinux_on = false;
applet = basename_c(argv[0]);
while ((opt = getopt_long(argc, argv, getoptstring,
longopts, (int *) 0)) != -1)
{
switch (opt) {
case 'D':
trunc = true;
/* falls through */
case 'd':
type = inode_dir;
break;
case 'F':
trunc = true;
/* falls through */
case 'f':
type = inode_file;
break;
case 'p':
type = inode_fifo;
break;
case 'm':
if (parse_mode(&mode, optarg) != 0)
eerrorx("%s: invalid mode `%s'",
applet, optarg);
break;
case 'o':
chowner = true;
if (parse_owner(&pw, &gr, optarg) != 0)
eerrorx("%s: owner `%s' not found",
applet, optarg);
break;
case 's':
#ifndef O_PATH
symlinks = true;
#endif
break;
case 'W':
writable = true;
break;
case_RC_COMMON_GETOPT
}
}
if (optind >= argc)
usage(EXIT_FAILURE);
if (writable && type != inode_unknown)
eerrorx("%s: -W cannot be specified along with -d, -f or -p", applet);
if (pw) {
uid = pw->pw_uid;
gid = pw->pw_gid;
}
if (gr)
gid = gr->gr_gid;
if (selinux_util_open() == 1)
selinux_on = true;
while (optind < argc) {
if (writable)
exit(!is_writable(argv[optind]));
if (do_check(argv[optind], uid, gid, mode, type, trunc, chowner,
symlinks, selinux_on))
retval = EXIT_FAILURE;
optind++;
}
if (selinux_on)
selinux_util_close();
return retval;
} | 379 | True | 1 |
|
CVE-2021-42341 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/OpenRC/openrc/issues/459', 'name': 'https://github.com/OpenRC/openrc/issues/459', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204', 'name': 'https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.gentoo.org/816900', 'name': 'https://bugs.gentoo.org/816900', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/pull/462', 'name': 'https://github.com/OpenRC/openrc/pull/462', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae', 'name': 'https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/OpenRC/openrc/issues/418', 'name': 'https://github.com/OpenRC/openrc/issues/418', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openrc_project:openrc:*:*:*:*:*:*:*:*', 'versionStartIncluding': '0.44.0', 'versionEndExcluding': '0.44.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "checkpath in OpenRC before 0.44.7 uses the direct output of strlen() to allocate strings, which does not account for the '\\0' byte at the end of the string. This results in memory corruption. CVE-2021-42341 was introduced in git commit 63db2d99e730547339d1bdd28e8437999c380cae, which was introduced as part of OpenRC 0.44.0 development."}] | 2021-10-20T19:03Z | 2021-10-14T05:15Z | Other | NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Sam James | 2021-10-08 04:52:55+01:00 | checkpath: fix allocation size of path buffer
strlen's return value isn't enough to be used
directly for (x)malloc; it doesn't include
the null byte at the end of the string.
X-Gentoo-Bug: 816900
X-Gentoo-Bug-URL: https://bugs.gentoo.org/816900
Fixes: #459
Fixes: #462 | bb8334104baf4d5a4a442a8647fb9204738f2204 | False | OpenRC/openrc | The OpenRC init system | 2013-04-13 23:21:59 | 2022-08-21 15:52:27 | OpenRC | 1029.0 | 188.0 | clean_path | clean_path( char * path) | ['path'] | static char *clean_path(char *path)
{
char *ch;
char *ch2;
char *str;
str = xmalloc(strlen(path));
ch = path;
ch2 = str;
while (true) {
*ch2 = *ch;
ch++;
ch2++;
if (!*(ch-1))
break;
while (*(ch - 1) == '/' && *ch == '/')
ch++;
}
/* get rid of trailing / characters */
while ((ch = strrchr(str, '/'))) {
if (ch == str)
break;
if (!*(ch+1))
*ch = 0;
else
break;
}
return str;
} | 131 | True | 1 |
|
CVE-2021-42917 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/xbmc/xbmc/issues/20305', 'name': 'https://github.com/xbmc/xbmc/issues/20305', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/xbmc/xbmc/pull/20306', 'name': 'https://github.com/xbmc/xbmc/pull/20306', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/fuzzard/xbmc/commit/80c8138c09598e88b4ddb6dbb279fa193bbb3237', 'name': 'https://github.com/fuzzard/xbmc/commit/80c8138c09598e88b4ddb6dbb279fa193bbb3237', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/xbmc/xbmc/commit/48730b64494798705d46dfccc4029bd36d072df3', 'name': 'https://github.com/xbmc/xbmc/commit/48730b64494798705d46dfccc4029bd36d072df3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:kodi:kodi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '19.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer overflow vulnerability in Kodi xbmc up to 19.0, allows attackers to cause a denial of service due to improper length of values passed to istream.'}] | 2021-11-02T19:46Z | 2021-11-01T19:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | fuzzard | 2021-10-12 17:38:30+10:00 | [Playlist] dont use istream directly to a tinyxml structure
Turn istream into a std::string to handle large buffers (#20305) | 80c8138c09598e88b4ddb6dbb279fa193bbb3237 | False | fuzzard/xbmc | Kodi Main Repository - By using this code you agree with our policy and will follow the GPLv2 license as included | 2017-08-12 08:04:36 | 2022-08-28 04:24:21 | http://kodi.wiki/view/Official:Trademark_Policy | fuzzard | 11.0 | 1.0 | CPlayListASX::LoadData | CPlayListASX::LoadData( std :: istream & stream) | ['stream'] | bool CPlayListASX::LoadData(std::istream& stream)
{
CLog::Log(LOGINFO, "Parsing ASX");
if(stream.peek() == '[')
{
return LoadAsxIniInfo(stream);
}
else
{
CXBMCTinyXML xmlDoc;
stream >> xmlDoc;
if (xmlDoc.Error())
{
CLog::Log(LOGERROR, "Unable to parse ASX info Error: {}", xmlDoc.ErrorDesc());
return false;
}
TiXmlElement *pRootElement = xmlDoc.RootElement();
// lowercase every element
TiXmlNode *pNode = pRootElement;
TiXmlNode *pChild = NULL;
std::string value;
value = pNode->Value();
StringUtils::ToLower(value);
pNode->SetValue(value);
while(pNode)
{
pChild = pNode->IterateChildren(pChild);
if(pChild)
{
if (pChild->Type() == TiXmlNode::TINYXML_ELEMENT)
{
value = pChild->Value();
StringUtils::ToLower(value);
pChild->SetValue(value);
TiXmlAttribute* pAttr = pChild->ToElement()->FirstAttribute();
while(pAttr)
{
value = pAttr->Name();
StringUtils::ToLower(value);
pAttr->SetName(value);
pAttr = pAttr->Next();
}
}
pNode = pChild;
pChild = NULL;
continue;
}
pChild = pNode;
pNode = pNode->Parent();
}
std::string roottitle;
TiXmlElement *pElement = pRootElement->FirstChildElement();
while (pElement)
{
value = pElement->Value();
if (value == "title" && !pElement->NoChildren())
{
roottitle = pElement->FirstChild()->ValueStr();
}
else if (value == "entry")
{
std::string title(roottitle);
TiXmlElement *pRef = pElement->FirstChildElement("ref");
TiXmlElement *pTitle = pElement->FirstChildElement("title");
if(pTitle && !pTitle->NoChildren())
title = pTitle->FirstChild()->ValueStr();
while (pRef)
{ // multiple references may appear for one entry
// duration may exist on this level too
value = XMLUtils::GetAttribute(pRef, "href");
if (!value.empty())
{
if(title.empty())
title = value;
CLog::Log(LOGINFO, "Adding element {}, {}", title, value);
CFileItemPtr newItem(new CFileItem(title));
newItem->SetPath(value);
Add(newItem);
}
pRef = pRef->NextSiblingElement("ref");
}
}
else if (value == "entryref")
{
value = XMLUtils::GetAttribute(pElement, "href");
if (!value.empty())
{ // found an entryref, let's try loading that url
std::unique_ptr<CPlayList> playlist(CPlayListFactory::Create(value));
if (nullptr != playlist)
if (playlist->Load(value))
Add(*playlist);
}
}
pElement = pElement->NextSiblingElement();
}
}
return true;
} | 537 | True | 1 |
CVE-2021-44108 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A null pointer dereference in src/amf/namf-handler.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request to amf.'}] | 2022-04-13T15:18Z | 2022-04-05T02:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | on_header_value | on_header_value( multipart_parser * parser , const char * at , size_t length) | ['parser', 'at', 'length'] | static int on_header_value(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->header_field)
CASE(OGS_SBI_CONTENT_TYPE)
if (data->part[data->num_of_part].content_type)
ogs_free(data->part[data->num_of_part].content_type);
data->part[data->num_of_part].content_type =
ogs_strndup(at, length);
ogs_assert(data->part[data->num_of_part].content_type);
break;
CASE(OGS_SBI_CONTENT_ID)
if (data->part[data->num_of_part].content_id)
ogs_free(data->part[data->num_of_part].content_id);
data->part[data->num_of_part].content_id =
ogs_strndup(at, length);
ogs_assert(data->part[data->num_of_part].content_id);
break;
DEFAULT
ogs_error("Unknown header field [%s]", data->header_field);
END
}
return 0;
} | 197 | True | 1 |
CVE-2021-44109 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in lib/sbi/message.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request.'}] | 2022-04-13T14:56Z | 2022-04-05T02: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 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | on_header_value | on_header_value( multipart_parser * parser , const char * at , size_t length) | ['parser', 'at', 'length'] | static int on_header_value(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->header_field)
CASE(OGS_SBI_CONTENT_TYPE)
if (data->part[data->num_of_part].content_type)
ogs_free(data->part[data->num_of_part].content_type);
data->part[data->num_of_part].content_type =
ogs_strndup(at, length);
ogs_assert(data->part[data->num_of_part].content_type);
break;
CASE(OGS_SBI_CONTENT_ID)
if (data->part[data->num_of_part].content_id)
ogs_free(data->part[data->num_of_part].content_id);
data->part[data->num_of_part].content_id =
ogs_strndup(at, length);
ogs_assert(data->part[data->num_of_part].content_id);
break;
DEFAULT
ogs_error("Unknown header field [%s]", data->header_field);
END
}
return 0;
} | 197 | True | 1 |
CVE-2021-44108 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A null pointer dereference in src/amf/namf-handler.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request to amf.'}] | 2022-04-13T15:18Z | 2022-04-05T02:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | on_part_data | on_part_data( multipart_parser * parser , const char * at , size_t length) | ['parser', 'at', 'length'] | static int on_part_data(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->part[data->num_of_part].content_type)
CASE(OGS_SBI_CONTENT_JSON_TYPE)
CASE(OGS_SBI_CONTENT_5GNAS_TYPE)
CASE(OGS_SBI_CONTENT_NGAP_TYPE)
size_t offset = 0;
if (data->part[data->num_of_part].content == NULL) {
data->part[data->num_of_part].content_length = length;
data->part[data->num_of_part].content =
(char *)ogs_malloc(length + 1);
ogs_assert(data->part[data->num_of_part].content);
} else {
offset = data->part[data->num_of_part].content_length;
if ((data->part[data->num_of_part].content_length + length) >
OGS_HUGE_LEN) {
ogs_error("Overflow length [%d:%d]",
(int)data->part[data->num_of_part].content_length,
(int)length);
ogs_assert_if_reached();
return 0;
}
data->part[data->num_of_part].content_length += length;
data->part[data->num_of_part].content = (char *)ogs_realloc(
data->part[data->num_of_part].content,
data->part[data->num_of_part].content_length + 1);
ogs_assert(data->part[data->num_of_part].content);
}
memcpy(data->part[data->num_of_part].content + offset, at, length);
data->part[data->num_of_part].content[
data->part[data->num_of_part].content_length] = 0;
break;
DEFAULT
ogs_log_hexdump(OGS_LOG_FATAL, (unsigned char *)at, length);
ogs_error("Unknown content_type [%s]",
data->part[data->num_of_part].content_type);
END
}
return 0;
} | 362 | True | 1 |
CVE-2021-44109 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in lib/sbi/message.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request.'}] | 2022-04-13T14:56Z | 2022-04-05T02: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 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | on_part_data | on_part_data( multipart_parser * parser , const char * at , size_t length) | ['parser', 'at', 'length'] | static int on_part_data(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->part[data->num_of_part].content_type)
CASE(OGS_SBI_CONTENT_JSON_TYPE)
CASE(OGS_SBI_CONTENT_5GNAS_TYPE)
CASE(OGS_SBI_CONTENT_NGAP_TYPE)
size_t offset = 0;
if (data->part[data->num_of_part].content == NULL) {
data->part[data->num_of_part].content_length = length;
data->part[data->num_of_part].content =
(char *)ogs_malloc(length + 1);
ogs_assert(data->part[data->num_of_part].content);
} else {
offset = data->part[data->num_of_part].content_length;
if ((data->part[data->num_of_part].content_length + length) >
OGS_HUGE_LEN) {
ogs_error("Overflow length [%d:%d]",
(int)data->part[data->num_of_part].content_length,
(int)length);
ogs_assert_if_reached();
return 0;
}
data->part[data->num_of_part].content_length += length;
data->part[data->num_of_part].content = (char *)ogs_realloc(
data->part[data->num_of_part].content,
data->part[data->num_of_part].content_length + 1);
ogs_assert(data->part[data->num_of_part].content);
}
memcpy(data->part[data->num_of_part].content + offset, at, length);
data->part[data->num_of_part].content[
data->part[data->num_of_part].content_length] = 0;
break;
DEFAULT
ogs_log_hexdump(OGS_LOG_FATAL, (unsigned char *)at, length);
ogs_error("Unknown content_type [%s]",
data->part[data->num_of_part].content_type);
END
}
return 0;
} | 362 | True | 1 |
CVE-2021-44108 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A null pointer dereference in src/amf/namf-handler.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request to amf.'}] | 2022-04-13T15:18Z | 2022-04-05T02:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | on_part_data_end | on_part_data_end( multipart_parser * parser) | ['parser'] | static int on_part_data_end(multipart_parser *parser)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
data->num_of_part++;
return 0;
} | 39 | True | 1 |
CVE-2021-44109 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in lib/sbi/message.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request.'}] | 2022-04-13T14:56Z | 2022-04-05T02: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 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | on_part_data_end | on_part_data_end( multipart_parser * parser) | ['parser'] | static int on_part_data_end(multipart_parser *parser)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
data->num_of_part++;
return 0;
} | 39 | True | 1 |
CVE-2021-44108 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A null pointer dereference in src/amf/namf-handler.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request to amf.'}] | 2022-04-13T15:18Z | 2022-04-05T02:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | parse_json | parse_json( ogs_sbi_message_t * message , char * content_type , char * json) | ['message', 'content_type', 'json'] | static int parse_json(ogs_sbi_message_t *message,
char *content_type, char *json)
{
int rv = OGS_OK;
cJSON *item = NULL;
ogs_assert(message);
if (!json)
return OGS_OK;
if (!content_type) {
ogs_error("No Content-type");
return OGS_ERROR;
}
ogs_log_print(OGS_LOG_TRACE, "%s", json);
item = cJSON_Parse(json);
if (!item) {
ogs_error("JSON parse error");
return OGS_ERROR;
}
if (content_type &&
!strncmp(content_type, OGS_SBI_CONTENT_PROBLEM_TYPE,
strlen(OGS_SBI_CONTENT_PROBLEM_TYPE))) {
message->ProblemDetails = OpenAPI_problem_details_parseFromJSON(item);
} else if (content_type &&
!strncmp(content_type, OGS_SBI_CONTENT_PATCH_TYPE,
strlen(OGS_SBI_CONTENT_PATCH_TYPE))) {
if (item) {
OpenAPI_patch_item_t *patch_item = NULL;
cJSON *patchJSON = NULL;
message->PatchItemList = OpenAPI_list_create();
cJSON_ArrayForEach(patchJSON, item) {
if (!cJSON_IsObject(patchJSON)) {
rv = OGS_ERROR;
ogs_error("Unknown JSON");
goto cleanup;
}
patch_item = OpenAPI_patch_item_parseFromJSON(patchJSON);
OpenAPI_list_add(message->PatchItemList, patch_item);
}
}
} else {
SWITCH(message->h.service.name)
CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
message->NFProfile =
OpenAPI_nf_profile_parseFromJSON(item);
if (!message->NFProfile) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS)
message->SubscriptionData =
OpenAPI_subscription_data_parseFromJSON(item);
if (!message->SubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
message->NotificationData =
OpenAPI_notification_data_parseFromJSON(item);
if (!message->NotificationData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
message->SearchResult =
OpenAPI_search_result_parseFromJSON(item);
if (!message->SearchResult) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NAUSF_AUTH)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS)
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (message->res_status == 0) {
message->AuthenticationInfo =
OpenAPI_authentication_info_parseFromJSON(item);
if (!message->AuthenticationInfo) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->UeAuthenticationCtx =
OpenAPI_ue_authentication_ctx_parseFromJSON(item);
if (!message->UeAuthenticationCtx) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_HTTP_METHOD_PUT)
if (message->res_status == 0) {
message->ConfirmationData =
OpenAPI_confirmation_data_parseFromJSON(item);
if (!message->ConfirmationData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->ConfirmationDataResponse =
OpenAPI_confirmation_data_response_parseFromJSON(
item);
if (!message->ConfirmationDataResponse) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDM_UEAU)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA)
if (message->res_status == 0) {
message->AuthenticationInfoRequest =
OpenAPI_authentication_info_request_parseFromJSON(
item);
if (!message->AuthenticationInfoRequest) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->AuthenticationInfoResult =
OpenAPI_authentication_info_result_parseFromJSON(
item);
if (!message->AuthenticationInfoResult) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS)
message->AuthEvent = OpenAPI_auth_event_parseFromJSON(item);
if (!message->AuthEvent) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDM_UECM)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_REGISTRATIONS)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_AMF_3GPP_ACCESS)
message->Amf3GppAccessRegistration =
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
item);
if (!message->Amf3GppAccessRegistration) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDM_SDM)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
message->AccessAndMobilitySubscriptionData =
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(
item);
if (!message->AccessAndMobilitySubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
message->SmfSelectionSubscriptionData =
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
if (!message->SmfSelectionSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
message->UeContextInSmfData =
OpenAPI_ue_context_in_smf_data_parseFromJSON(item);
if (!message->UeContextInSmfData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
message->SessionManagementSubscriptionData =
OpenAPI_session_management_subscription_data_parseFromJSON(
item);
if (!message->SessionManagementSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDR_DR)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA)
SWITCH(message->h.resource.component[3])
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->AuthenticationSubscription =
OpenAPI_authentication_subscription_parseFromJSON(item);
if (!message->AuthenticationSubscription) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS)
message->AuthEvent =
OpenAPI_auth_event_parseFromJSON(item);
if (!message->AuthEvent) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[3]);
END
break;
CASE(OGS_SBI_RESOURCE_NAME_CONTEXT_DATA)
message->Amf3GppAccessRegistration =
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
item);
if (!message->Amf3GppAccessRegistration) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
SWITCH(message->h.resource.component[3])
CASE(OGS_SBI_RESOURCE_NAME_PROVISIONED_DATA)
SWITCH(message->h.resource.component[4])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
message->AccessAndMobilitySubscriptionData =
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(item);
if (!message->AccessAndMobilitySubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECTION_SUBSCRIPTION_DATA)
message->SmfSelectionSubscriptionData =
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
if (!message->SmfSelectionSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
message->UeContextInSmfData =
OpenAPI_ue_context_in_smf_data_parseFromJSON(
item);
if (!message->UeContextInSmfData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
message->SessionManagementSubscriptionData =
OpenAPI_session_management_subscription_data_parseFromJSON(item);
if (!message->SessionManagementSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[4]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[3]);
END
END
break;
CASE(OGS_SBI_RESOURCE_NAME_POLICY_DATA)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_UES)
SWITCH(message->h.resource.component[3])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
message->AmPolicyData =
OpenAPI_am_policy_data_parseFromJSON(item);
if (!message->AmPolicyData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
message->SmPolicyData =
OpenAPI_sm_policy_data_parseFromJSON(item);
if (!message->SmPolicyData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[3]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXTS)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_MODIFY)
if (message->res_status == 0) {
message->SmContextUpdateData =
OpenAPI_sm_context_update_data_parseFromJSON(item);
if (!message->SmContextUpdateData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->SmContextUpdatedData =
OpenAPI_sm_context_updated_data_parseFromJSON(item);
if (!message->SmContextUpdatedData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_BAD_REQUEST ||
message->res_status ==
OGS_SBI_HTTP_STATUS_FORBIDDEN ||
message->res_status ==
OGS_SBI_HTTP_STATUS_NOT_FOUND ||
message->res_status ==
OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR ||
message->res_status ==
OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE ||
message->res_status ==
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT) {
message->SmContextUpdateError =
OpenAPI_sm_context_update_error_parseFromJSON(item);
if (!message->SmContextUpdateError) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_RESOURCE_NAME_RELEASE)
if (message->res_status == 0) {
message->SmContextReleaseData =
OpenAPI_sm_context_release_data_parseFromJSON(item);
if (!message->SmContextReleaseData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_NO_CONTENT) {
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->SmContextReleasedData =
OpenAPI_sm_context_released_data_parseFromJSON(
item);
if (!message->SmContextReleasedData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
if (message->res_status == 0) {
message->SmContextCreateData =
OpenAPI_sm_context_create_data_parseFromJSON(item);
if (!message->SmContextCreateData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->SmContextCreatedData =
OpenAPI_sm_context_created_data_parseFromJSON(item);
if (!message->SmContextCreatedData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_BAD_REQUEST ||
message->res_status ==
OGS_SBI_HTTP_STATUS_FORBIDDEN ||
message->res_status ==
OGS_SBI_HTTP_STATUS_NOT_FOUND ||
message->res_status ==
OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR ||
message->res_status ==
OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE ||
message->res_status ==
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT) {
message->SmContextCreateError =
OpenAPI_sm_context_create_error_parseFromJSON(item);
if (!message->SmContextCreateError) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NAMF_COMM)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXTS)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES)
if (message->res_status == 0) {
message->N1N2MessageTransferReqData =
OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON(item);
if (!message->N1N2MessageTransferReqData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_OK ||
message->res_status ==
OGS_SBI_HTTP_STATUS_ACCEPTED) {
message->N1N2MessageTransferRspData =
OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON(item);
if (!message->N1N2MessageTransferRspData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NPCF_AM_POLICY_CONTROL)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_POLICIES)
if (message->res_status == 0) {
message->PolicyAssociationRequest =
OpenAPI_policy_association_request_parseFromJSON(
item);
if (!message->PolicyAssociationRequest) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_CREATED) {
message->PolicyAssociation =
OpenAPI_policy_association_parseFromJSON(item);
if (!message->PolicyAssociation) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_SM_POLICIES)
if (!message->h.resource.component[1]) {
if (message->res_status == 0) {
message->SmPolicyContextData =
OpenAPI_sm_policy_context_data_parseFromJSON(item);
if (!message->SmPolicyContextData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->SmPolicyDecision =
OpenAPI_sm_policy_decision_parseFromJSON(item);
if (!message->SmPolicyDecision) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
} else {
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_DELETE)
if (message->res_status == 0) {
message->SmPolicyDeleteData =
OpenAPI_sm_policy_delete_data_parseFromJSON(
item);
if (!message->SmPolicyDeleteData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_NETWORK_SLICE_INFORMATION)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->AuthorizedNetworkSliceInfo =
OpenAPI_authorized_network_slice_info_parseFromJSON(
item);
if (!message->AuthorizedNetworkSliceInfo) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_PCF_BINDINGS)
if (message->h.resource.component[1]) {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_PATCH)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->PcfBinding =
OpenAPI_pcf_binding_parseFromJSON(item);
if (!message->PcfBinding) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_HTTP_METHOD_DELETE)
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
break;
} else {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (message->res_status == 0 ||
message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->PcfBinding =
OpenAPI_pcf_binding_parseFromJSON(item);
if (!message->PcfBinding) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_HTTP_METHOD_GET)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->PcfBinding =
OpenAPI_pcf_binding_parseFromJSON(item);
if (!message->PcfBinding) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
break;
}
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NPCF_POLICYAUTHORIZATION)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_APP_SESSIONS)
if (message->h.resource.component[1]) {
if (message->h.resource.component[2]) {
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_DELETE)
/* Nothing */
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("JSON parse error");
END
} else {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_PATCH)
message->AppSessionContextUpdateDataPatch =
OpenAPI_app_session_context_update_data_patch_parseFromJSON(item);
if (!message->AppSessionContextUpdateDataPatch) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("JSON parse error");
END
}
} else {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (message->res_status == 0 ||
message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->AppSessionContext =
OpenAPI_app_session_context_parseFromJSON(item);
if (!message->AppSessionContext) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NAMF_CALLBACK)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS)
message->SmContextStatusNotification =
OpenAPI_sm_context_status_notification_parseFromJSON(item);
if (!message->SmContextStatusNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NSMF_CALLBACK)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_N1_N2_FAILURE_NOTIFY)
message->N1N2MsgTxfrFailureNotification =
OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON(
item);
if (!message->N1N2MsgTxfrFailureNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_POLICY_NOTIFY)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_UPDATE)
message->SmPolicyNotification =
OpenAPI_sm_policy_notification_parseFromJSON(item);
if (!message->SmPolicyNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_TERMINATE)
message->TerminationNotification =
OpenAPI_termination_notification_parseFromJSON(item);
if (!message->TerminationNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Not implemented API name [%s]",
message->h.service.name);
END
}
cleanup:
cJSON_Delete(item);
return rv;
} | 3542 | True | 1 |
CVE-2021-44109 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in lib/sbi/message.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request.'}] | 2022-04-13T14:56Z | 2022-04-05T02: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 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | parse_json | parse_json( ogs_sbi_message_t * message , char * content_type , char * json) | ['message', 'content_type', 'json'] | static int parse_json(ogs_sbi_message_t *message,
char *content_type, char *json)
{
int rv = OGS_OK;
cJSON *item = NULL;
ogs_assert(message);
if (!json)
return OGS_OK;
if (!content_type) {
ogs_error("No Content-type");
return OGS_ERROR;
}
ogs_log_print(OGS_LOG_TRACE, "%s", json);
item = cJSON_Parse(json);
if (!item) {
ogs_error("JSON parse error");
return OGS_ERROR;
}
if (content_type &&
!strncmp(content_type, OGS_SBI_CONTENT_PROBLEM_TYPE,
strlen(OGS_SBI_CONTENT_PROBLEM_TYPE))) {
message->ProblemDetails = OpenAPI_problem_details_parseFromJSON(item);
} else if (content_type &&
!strncmp(content_type, OGS_SBI_CONTENT_PATCH_TYPE,
strlen(OGS_SBI_CONTENT_PATCH_TYPE))) {
if (item) {
OpenAPI_patch_item_t *patch_item = NULL;
cJSON *patchJSON = NULL;
message->PatchItemList = OpenAPI_list_create();
cJSON_ArrayForEach(patchJSON, item) {
if (!cJSON_IsObject(patchJSON)) {
rv = OGS_ERROR;
ogs_error("Unknown JSON");
goto cleanup;
}
patch_item = OpenAPI_patch_item_parseFromJSON(patchJSON);
OpenAPI_list_add(message->PatchItemList, patch_item);
}
}
} else {
SWITCH(message->h.service.name)
CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
message->NFProfile =
OpenAPI_nf_profile_parseFromJSON(item);
if (!message->NFProfile) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS)
message->SubscriptionData =
OpenAPI_subscription_data_parseFromJSON(item);
if (!message->SubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
message->NotificationData =
OpenAPI_notification_data_parseFromJSON(item);
if (!message->NotificationData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
message->SearchResult =
OpenAPI_search_result_parseFromJSON(item);
if (!message->SearchResult) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NAUSF_AUTH)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_UE_AUTHENTICATIONS)
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (message->res_status == 0) {
message->AuthenticationInfo =
OpenAPI_authentication_info_parseFromJSON(item);
if (!message->AuthenticationInfo) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->UeAuthenticationCtx =
OpenAPI_ue_authentication_ctx_parseFromJSON(item);
if (!message->UeAuthenticationCtx) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_HTTP_METHOD_PUT)
if (message->res_status == 0) {
message->ConfirmationData =
OpenAPI_confirmation_data_parseFromJSON(item);
if (!message->ConfirmationData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->ConfirmationDataResponse =
OpenAPI_confirmation_data_response_parseFromJSON(
item);
if (!message->ConfirmationDataResponse) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDM_UEAU)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA)
if (message->res_status == 0) {
message->AuthenticationInfoRequest =
OpenAPI_authentication_info_request_parseFromJSON(
item);
if (!message->AuthenticationInfoRequest) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->AuthenticationInfoResult =
OpenAPI_authentication_info_result_parseFromJSON(
item);
if (!message->AuthenticationInfoResult) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS)
message->AuthEvent = OpenAPI_auth_event_parseFromJSON(item);
if (!message->AuthEvent) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDM_UECM)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_REGISTRATIONS)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_AMF_3GPP_ACCESS)
message->Amf3GppAccessRegistration =
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
item);
if (!message->Amf3GppAccessRegistration) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDM_SDM)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
message->AccessAndMobilitySubscriptionData =
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(
item);
if (!message->AccessAndMobilitySubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
message->SmfSelectionSubscriptionData =
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
if (!message->SmfSelectionSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
message->UeContextInSmfData =
OpenAPI_ue_context_in_smf_data_parseFromJSON(item);
if (!message->UeContextInSmfData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
message->SessionManagementSubscriptionData =
OpenAPI_session_management_subscription_data_parseFromJSON(
item);
if (!message->SessionManagementSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NUDR_DR)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_DATA)
SWITCH(message->h.resource.component[3])
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->AuthenticationSubscription =
OpenAPI_authentication_subscription_parseFromJSON(item);
if (!message->AuthenticationSubscription) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS)
message->AuthEvent =
OpenAPI_auth_event_parseFromJSON(item);
if (!message->AuthEvent) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[3]);
END
break;
CASE(OGS_SBI_RESOURCE_NAME_CONTEXT_DATA)
message->Amf3GppAccessRegistration =
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
item);
if (!message->Amf3GppAccessRegistration) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
SWITCH(message->h.resource.component[3])
CASE(OGS_SBI_RESOURCE_NAME_PROVISIONED_DATA)
SWITCH(message->h.resource.component[4])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
message->AccessAndMobilitySubscriptionData =
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(item);
if (!message->AccessAndMobilitySubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECTION_SUBSCRIPTION_DATA)
message->SmfSelectionSubscriptionData =
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
if (!message->SmfSelectionSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
message->UeContextInSmfData =
OpenAPI_ue_context_in_smf_data_parseFromJSON(
item);
if (!message->UeContextInSmfData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
message->SessionManagementSubscriptionData =
OpenAPI_session_management_subscription_data_parseFromJSON(item);
if (!message->SessionManagementSubscriptionData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[4]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[3]);
END
END
break;
CASE(OGS_SBI_RESOURCE_NAME_POLICY_DATA)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_UES)
SWITCH(message->h.resource.component[3])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
message->AmPolicyData =
OpenAPI_am_policy_data_parseFromJSON(item);
if (!message->AmPolicyData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
message->SmPolicyData =
OpenAPI_sm_policy_data_parseFromJSON(item);
if (!message->SmPolicyData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[3]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXTS)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_MODIFY)
if (message->res_status == 0) {
message->SmContextUpdateData =
OpenAPI_sm_context_update_data_parseFromJSON(item);
if (!message->SmContextUpdateData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->SmContextUpdatedData =
OpenAPI_sm_context_updated_data_parseFromJSON(item);
if (!message->SmContextUpdatedData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_BAD_REQUEST ||
message->res_status ==
OGS_SBI_HTTP_STATUS_FORBIDDEN ||
message->res_status ==
OGS_SBI_HTTP_STATUS_NOT_FOUND ||
message->res_status ==
OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR ||
message->res_status ==
OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE ||
message->res_status ==
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT) {
message->SmContextUpdateError =
OpenAPI_sm_context_update_error_parseFromJSON(item);
if (!message->SmContextUpdateError) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_RESOURCE_NAME_RELEASE)
if (message->res_status == 0) {
message->SmContextReleaseData =
OpenAPI_sm_context_release_data_parseFromJSON(item);
if (!message->SmContextReleaseData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_NO_CONTENT) {
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->SmContextReleasedData =
OpenAPI_sm_context_released_data_parseFromJSON(
item);
if (!message->SmContextReleasedData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
if (message->res_status == 0) {
message->SmContextCreateData =
OpenAPI_sm_context_create_data_parseFromJSON(item);
if (!message->SmContextCreateData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->SmContextCreatedData =
OpenAPI_sm_context_created_data_parseFromJSON(item);
if (!message->SmContextCreatedData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_BAD_REQUEST ||
message->res_status ==
OGS_SBI_HTTP_STATUS_FORBIDDEN ||
message->res_status ==
OGS_SBI_HTTP_STATUS_NOT_FOUND ||
message->res_status ==
OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR ||
message->res_status ==
OGS_SBI_HTTP_STATUS_SERVICE_UNAVAILABLE ||
message->res_status ==
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT) {
message->SmContextCreateError =
OpenAPI_sm_context_create_error_parseFromJSON(item);
if (!message->SmContextCreateError) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NAMF_COMM)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXTS)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES)
if (message->res_status == 0) {
message->N1N2MessageTransferReqData =
OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON(item);
if (!message->N1N2MessageTransferReqData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_OK ||
message->res_status ==
OGS_SBI_HTTP_STATUS_ACCEPTED) {
message->N1N2MessageTransferRspData =
OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON(item);
if (!message->N1N2MessageTransferRspData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NPCF_AM_POLICY_CONTROL)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_POLICIES)
if (message->res_status == 0) {
message->PolicyAssociationRequest =
OpenAPI_policy_association_request_parseFromJSON(
item);
if (!message->PolicyAssociationRequest) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_CREATED) {
message->PolicyAssociation =
OpenAPI_policy_association_parseFromJSON(item);
if (!message->PolicyAssociation) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_SM_POLICIES)
if (!message->h.resource.component[1]) {
if (message->res_status == 0) {
message->SmPolicyContextData =
OpenAPI_sm_policy_context_data_parseFromJSON(item);
if (!message->SmPolicyContextData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->SmPolicyDecision =
OpenAPI_sm_policy_decision_parseFromJSON(item);
if (!message->SmPolicyDecision) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
} else {
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_DELETE)
if (message->res_status == 0) {
message->SmPolicyDeleteData =
OpenAPI_sm_policy_delete_data_parseFromJSON(
item);
if (!message->SmPolicyDeleteData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_NETWORK_SLICE_INFORMATION)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->AuthorizedNetworkSliceInfo =
OpenAPI_authorized_network_slice_info_parseFromJSON(
item);
if (!message->AuthorizedNetworkSliceInfo) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_PCF_BINDINGS)
if (message->h.resource.component[1]) {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_PATCH)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->PcfBinding =
OpenAPI_pcf_binding_parseFromJSON(item);
if (!message->PcfBinding) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_HTTP_METHOD_DELETE)
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
break;
} else {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (message->res_status == 0 ||
message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->PcfBinding =
OpenAPI_pcf_binding_parseFromJSON(item);
if (!message->PcfBinding) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
CASE(OGS_SBI_HTTP_METHOD_GET)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->PcfBinding =
OpenAPI_pcf_binding_parseFromJSON(item);
if (!message->PcfBinding) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
break;
}
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NPCF_POLICYAUTHORIZATION)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_APP_SESSIONS)
if (message->h.resource.component[1]) {
if (message->h.resource.component[2]) {
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_DELETE)
/* Nothing */
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("JSON parse error");
END
} else {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_PATCH)
message->AppSessionContextUpdateDataPatch =
OpenAPI_app_session_context_update_data_patch_parseFromJSON(item);
if (!message->AppSessionContextUpdateDataPatch) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("JSON parse error");
END
}
} else {
SWITCH(message->h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (message->res_status == 0 ||
message->res_status ==
OGS_SBI_HTTP_STATUS_CREATED) {
message->AppSessionContext =
OpenAPI_app_session_context_parseFromJSON(item);
if (!message->AppSessionContext) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown method [%s]", message->h.method);
END
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NAMF_CALLBACK)
SWITCH(message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS)
message->SmContextStatusNotification =
OpenAPI_sm_context_status_notification_parseFromJSON(item);
if (!message->SmContextStatusNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[1]);
END
break;
CASE(OGS_SBI_SERVICE_NAME_NSMF_CALLBACK)
SWITCH(message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_N1_N2_FAILURE_NOTIFY)
message->N1N2MsgTxfrFailureNotification =
OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON(
item);
if (!message->N1N2MsgTxfrFailureNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SM_POLICY_NOTIFY)
SWITCH(message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_UPDATE)
message->SmPolicyNotification =
OpenAPI_sm_policy_notification_parseFromJSON(item);
if (!message->SmPolicyNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
CASE(OGS_SBI_RESOURCE_NAME_TERMINATE)
message->TerminationNotification =
OpenAPI_termination_notification_parseFromJSON(item);
if (!message->TerminationNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[2]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
message->h.resource.component[0]);
END
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Not implemented API name [%s]",
message->h.service.name);
END
}
cleanup:
cJSON_Delete(item);
return rv;
} | 3542 | True | 1 |
CVE-2021-44108 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A null pointer dereference in src/amf/namf-handler.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request to amf.'}] | 2022-04-13T15:18Z | 2022-04-05T02:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | parse_multipart | parse_multipart( ogs_sbi_message_t * message , ogs_sbi_http_message_t * http) | ['message', 'http'] | static int parse_multipart(
ogs_sbi_message_t *message, ogs_sbi_http_message_t *http)
{
char *boundary = NULL;
int i;
multipart_parser_settings settings;
multipart_parser_data_t data;
multipart_parser *parser = NULL;
ogs_assert(message);
ogs_assert(http);
memset(&settings, 0, sizeof(settings));
settings.on_header_field = &on_header_field;
settings.on_header_value = &on_header_value;
settings.on_part_data = &on_part_data;
settings.on_part_data_end = &on_part_data_end;
for (i = 0; i < http->content_length; i++) {
if (http->content[i] == '\r' && http->content[i+1] == '\n')
break;
}
if (i >= http->content_length) {
ogs_error("Invalid HTTP content [%d]", i);
ogs_log_hexdump(OGS_LOG_ERROR,
(unsigned char *)http->content, http->content_length);
return OGS_ERROR;
}
boundary = ogs_strndup(http->content, i);
ogs_assert(boundary);
parser = multipart_parser_init(boundary, &settings);
ogs_assert(parser);
memset(&data, 0, sizeof(data));
multipart_parser_set_data(parser, &data);
multipart_parser_execute(parser, http->content, http->content_length);
multipart_parser_free(parser);
ogs_free(boundary);
for (i = 0; i < data.num_of_part; i++) {
SWITCH(data.part[i].content_type)
CASE(OGS_SBI_CONTENT_JSON_TYPE)
parse_json(message,
data.part[i].content_type, data.part[i].content);
if (data.part[i].content_id)
ogs_free(data.part[i].content_id);
if (data.part[i].content_type)
ogs_free(data.part[i].content_type);
if (data.part[i].content)
ogs_free(data.part[i].content);
break;
CASE(OGS_SBI_CONTENT_5GNAS_TYPE)
CASE(OGS_SBI_CONTENT_NGAP_TYPE)
http->part[http->num_of_part].content_id =
data.part[i].content_id;
http->part[http->num_of_part].content_type =
data.part[i].content_type;
http->part[http->num_of_part].pkbuf =
ogs_pkbuf_alloc(NULL, data.part[i].content_length);
ogs_expect_or_return_val(
http->part[http->num_of_part].pkbuf, OGS_ERROR);
ogs_pkbuf_put_data(http->part[http->num_of_part].pkbuf,
data.part[i].content, data.part[i].content_length);
message->part[message->num_of_part].content_id =
http->part[http->num_of_part].content_id;
message->part[message->num_of_part].content_type =
http->part[http->num_of_part].content_type;
message->part[message->num_of_part].pkbuf =
ogs_pkbuf_copy(http->part[http->num_of_part].pkbuf);
ogs_expect_or_return_val(
message->part[message->num_of_part].pkbuf, OGS_ERROR);
http->num_of_part++;
message->num_of_part++;
if (data.part[i].content)
ogs_free(data.part[i].content);
break;
DEFAULT
ogs_error("Unknown content-type[%s]", data.part[i].content_type);
END
}
if (data.part[i].content_id)
ogs_free(data.part[i].content_id);
if (data.part[i].content_type)
ogs_free(data.part[i].content_type);
if (data.header_field)
ogs_free(data.header_field);
return OGS_OK;
} | 683 | True | 1 |
CVE-2021-44109 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in lib/sbi/message.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request.'}] | 2022-04-13T14:56Z | 2022-04-05T02: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 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | parse_multipart | parse_multipart( ogs_sbi_message_t * message , ogs_sbi_http_message_t * http) | ['message', 'http'] | static int parse_multipart(
ogs_sbi_message_t *message, ogs_sbi_http_message_t *http)
{
char *boundary = NULL;
int i;
multipart_parser_settings settings;
multipart_parser_data_t data;
multipart_parser *parser = NULL;
ogs_assert(message);
ogs_assert(http);
memset(&settings, 0, sizeof(settings));
settings.on_header_field = &on_header_field;
settings.on_header_value = &on_header_value;
settings.on_part_data = &on_part_data;
settings.on_part_data_end = &on_part_data_end;
for (i = 0; i < http->content_length; i++) {
if (http->content[i] == '\r' && http->content[i+1] == '\n')
break;
}
if (i >= http->content_length) {
ogs_error("Invalid HTTP content [%d]", i);
ogs_log_hexdump(OGS_LOG_ERROR,
(unsigned char *)http->content, http->content_length);
return OGS_ERROR;
}
boundary = ogs_strndup(http->content, i);
ogs_assert(boundary);
parser = multipart_parser_init(boundary, &settings);
ogs_assert(parser);
memset(&data, 0, sizeof(data));
multipart_parser_set_data(parser, &data);
multipart_parser_execute(parser, http->content, http->content_length);
multipart_parser_free(parser);
ogs_free(boundary);
for (i = 0; i < data.num_of_part; i++) {
SWITCH(data.part[i].content_type)
CASE(OGS_SBI_CONTENT_JSON_TYPE)
parse_json(message,
data.part[i].content_type, data.part[i].content);
if (data.part[i].content_id)
ogs_free(data.part[i].content_id);
if (data.part[i].content_type)
ogs_free(data.part[i].content_type);
if (data.part[i].content)
ogs_free(data.part[i].content);
break;
CASE(OGS_SBI_CONTENT_5GNAS_TYPE)
CASE(OGS_SBI_CONTENT_NGAP_TYPE)
http->part[http->num_of_part].content_id =
data.part[i].content_id;
http->part[http->num_of_part].content_type =
data.part[i].content_type;
http->part[http->num_of_part].pkbuf =
ogs_pkbuf_alloc(NULL, data.part[i].content_length);
ogs_expect_or_return_val(
http->part[http->num_of_part].pkbuf, OGS_ERROR);
ogs_pkbuf_put_data(http->part[http->num_of_part].pkbuf,
data.part[i].content, data.part[i].content_length);
message->part[message->num_of_part].content_id =
http->part[http->num_of_part].content_id;
message->part[message->num_of_part].content_type =
http->part[http->num_of_part].content_type;
message->part[message->num_of_part].pkbuf =
ogs_pkbuf_copy(http->part[http->num_of_part].pkbuf);
ogs_expect_or_return_val(
message->part[message->num_of_part].pkbuf, OGS_ERROR);
http->num_of_part++;
message->num_of_part++;
if (data.part[i].content)
ogs_free(data.part[i].content);
break;
DEFAULT
ogs_error("Unknown content-type[%s]", data.part[i].content_type);
END
}
if (data.part[i].content_id)
ogs_free(data.part[i].content_id);
if (data.part[i].content_type)
ogs_free(data.part[i].content_type);
if (data.header_field)
ogs_free(data.header_field);
return OGS_OK;
} | 683 | True | 1 |
CVE-2021-44108 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A null pointer dereference in src/amf/namf-handler.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request to amf.'}] | 2022-04-13T15:18Z | 2022-04-05T02:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | amf_namf_comm_handle_n1_n2_message_transfer | amf_namf_comm_handle_n1_n2_message_transfer( ogs_sbi_stream_t * stream , ogs_sbi_message_t * recvmsg) | ['stream', 'recvmsg'] | int amf_namf_comm_handle_n1_n2_message_transfer(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
{
int status;
amf_ue_t *amf_ue = NULL;
amf_sess_t *sess = NULL;
ogs_pkbuf_t *n1buf = NULL;
ogs_pkbuf_t *n2buf = NULL;
ogs_pkbuf_t *gmmbuf = NULL;
ogs_pkbuf_t *ngapbuf = NULL;
char *supi = NULL;
uint8_t pdu_session_id = OGS_NAS_PDU_SESSION_IDENTITY_UNASSIGNED;
ogs_sbi_message_t sendmsg;
ogs_sbi_response_t *response = NULL;
OpenAPI_n1_n2_message_transfer_req_data_t *N1N2MessageTransferReqData;
OpenAPI_n1_n2_message_transfer_rsp_data_t N1N2MessageTransferRspData;
OpenAPI_n1_message_container_t *n1MessageContainer = NULL;
OpenAPI_ref_to_binary_data_t *n1MessageContent = NULL;
OpenAPI_n2_info_container_t *n2InfoContainer = NULL;
OpenAPI_n2_sm_information_t *smInfo = NULL;
OpenAPI_n2_info_content_t *n2InfoContent = NULL;
OpenAPI_ref_to_binary_data_t *ngapData = NULL;
ogs_assert(stream);
ogs_assert(recvmsg);
N1N2MessageTransferReqData = recvmsg->N1N2MessageTransferReqData;
if (!N1N2MessageTransferReqData) {
ogs_error("No N1N2MessageTransferReqData");
return OGS_ERROR;
}
if (N1N2MessageTransferReqData->is_pdu_session_id == false) {
ogs_error("No PDU Session Identity");
return OGS_ERROR;
}
pdu_session_id = N1N2MessageTransferReqData->pdu_session_id;
supi = recvmsg->h.resource.component[1];
if (!supi) {
ogs_error("No SUPI");
return OGS_ERROR;
}
amf_ue = amf_ue_find_by_supi(supi);
if (!amf_ue) {
ogs_error("No UE context [%s]", supi);
return OGS_ERROR;
}
sess = amf_sess_find_by_psi(amf_ue, pdu_session_id);
if (!sess) {
ogs_error("[%s] No PDU Session Context [%d]",
amf_ue->supi, pdu_session_id);
return OGS_ERROR;
}
n1MessageContainer = N1N2MessageTransferReqData->n1_message_container;
if (n1MessageContainer) {
n1MessageContent = n1MessageContainer->n1_message_content;
if (!n1MessageContent || !n1MessageContent->content_id) {
ogs_error("No n1MessageContent");
return OGS_ERROR;
}
n1buf = ogs_sbi_find_part_by_content_id(
recvmsg, n1MessageContent->content_id);
if (!n1buf) {
ogs_error("[%s] No N1 SM Content", amf_ue->supi);
return OGS_ERROR;
}
/*
* NOTE : The pkbuf created in the SBI message will be removed
* from ogs_sbi_message_free(), so it must be copied.
*/
n1buf = ogs_pkbuf_copy(n1buf);
ogs_assert(n1buf);
}
n2InfoContainer = N1N2MessageTransferReqData->n2_info_container;
if (n2InfoContainer) {
smInfo = n2InfoContainer->sm_info;
if (!smInfo) {
ogs_error("No smInfo");
return OGS_ERROR;
}
n2InfoContent = smInfo->n2_info_content;
if (!n2InfoContent) {
ogs_error("No n2InfoContent");
return OGS_ERROR;
}
ngapData = n2InfoContent->ngap_data;
if (!ngapData || !ngapData->content_id) {
ogs_error("No ngapData");
return OGS_ERROR;
}
n2buf = ogs_sbi_find_part_by_content_id(
recvmsg, ngapData->content_id);
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
/*
* NOTE : The pkbuf created in the SBI message will be removed
* from ogs_sbi_message_free(), so it must be copied.
*/
n2buf = ogs_pkbuf_copy(n2buf);
ogs_assert(n2buf);
}
memset(&sendmsg, 0, sizeof(sendmsg));
status = OGS_SBI_HTTP_STATUS_OK;
memset(&N1N2MessageTransferRspData, 0, sizeof(N1N2MessageTransferRspData));
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_N1_N2_TRANSFER_INITIATED;
sendmsg.N1N2MessageTransferRspData = &N1N2MessageTransferRspData;
switch (n2InfoContent->ngap_ie_type) {
case OpenAPI_ngap_ie_type_PDU_RES_SETUP_REQ:
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (n1buf) {
gmmbuf = gmm_build_dl_nas_transport(sess,
OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, n1buf, 0, 0);
ogs_assert(gmmbuf);
}
if (gmmbuf) {
ran_ue_t *ran_ue = NULL;
/***********************************
* 4.3.2 PDU Session Establishment *
***********************************/
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
ogs_assert(ran_ue);
if (sess->pdu_session_establishment_accept) {
ogs_pkbuf_free(sess->pdu_session_establishment_accept);
sess->pdu_session_establishment_accept = NULL;
}
if (ran_ue->initial_context_setup_request_sent == true) {
ngapbuf = ngap_sess_build_pdu_session_resource_setup_request(
sess, gmmbuf, n2buf);
ogs_assert(ngapbuf);
} else {
ngapbuf = ngap_sess_build_initial_context_setup_request(
sess, gmmbuf, n2buf);
ogs_assert(ngapbuf);
ran_ue->initial_context_setup_request_sent = true;
}
if (SESSION_CONTEXT_IN_SMF(sess)) {
/*
* [1-CLIENT] /nsmf-pdusession/v1/sm-contexts
* [2-SERVER] /namf-comm/v1/ue-contexts/{supi}/n1-n2-messages
*
* If [2-SERVER] arrives after [1-CLIENT],
* sm-context-ref is created in [1-CLIENT].
* So, the PDU session establishment accpet can be transmitted.
*/
if (nas_5gs_send_to_gnb(amf_ue, ngapbuf) != OGS_OK)
ogs_error("nas_5gs_send_to_gnb() failed");
} else {
sess->pdu_session_establishment_accept = ngapbuf;
}
} else {
/*********************************************
* 4.2.3.3 Network Triggered Service Request *
*********************************************/
if (CM_IDLE(amf_ue)) {
ogs_sbi_server_t *server = NULL;
ogs_sbi_header_t header;
ogs_sbi_client_t *client = NULL;
ogs_sockaddr_t *addr = NULL;
if (!N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri) {
ogs_error("[%s:%d] No n1-n2-failure-notification-uri",
amf_ue->supi, sess->psi);
return OGS_ERROR;
}
addr = ogs_sbi_getaddr_from_uri(
N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri);
if (!addr) {
ogs_error("[%s:%d] Invalid URI [%s]",
amf_ue->supi, sess->psi,
N1N2MessageTransferReqData->
n1n2_failure_txf_notif_uri);
return OGS_ERROR;;
}
client = ogs_sbi_client_find(addr);
if (!client) {
client = ogs_sbi_client_add(addr);
ogs_assert(client);
}
OGS_SETUP_SBI_CLIENT(&sess->paging, client);
ogs_freeaddrinfo(addr);
status = OGS_SBI_HTTP_STATUS_ACCEPTED;
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_ATTEMPTING_TO_REACH_UE;
/* Location */
server = ogs_sbi_server_from_stream(stream);
ogs_assert(server);
memset(&header, 0, sizeof(header));
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_COMM;
header.api.version = (char *)OGS_SBI_API_V1;
header.resource.component[0] =
(char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXTS;
header.resource.component[1] = amf_ue->supi;
header.resource.component[2] =
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
header.resource.component[3] = sess->sm_context_ref;
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location,
N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri);
/* Store N2 Transfer message */
AMF_SESS_STORE_N2_TRANSFER(
sess, pdu_session_resource_setup_request, n2buf);
ogs_assert(OGS_OK == ngap_send_paging(amf_ue));
} else if (CM_CONNECTED(amf_ue)) {
ogs_assert(OGS_OK ==
ngap_send_pdu_resource_setup_request(sess, n2buf));
} else {
ogs_fatal("[%s] Invalid AMF-UE state", amf_ue->supi);
ogs_assert_if_reached();
}
}
break;
case OpenAPI_ngap_ie_type_PDU_RES_MOD_REQ:
if (!n1buf) {
ogs_error("[%s] No N1 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (CM_IDLE(amf_ue)) {
ogs_sbi_server_t *server = NULL;
ogs_sbi_header_t header;
status = OGS_SBI_HTTP_STATUS_ACCEPTED;
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_ATTEMPTING_TO_REACH_UE;
/* Location */
server = ogs_sbi_server_from_stream(stream);
ogs_assert(server);
memset(&header, 0, sizeof(header));
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_COMM;
header.api.version = (char *)OGS_SBI_API_V1;
header.resource.component[0] =
(char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXTS;
header.resource.component[1] = amf_ue->supi;
header.resource.component[2] =
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
header.resource.component[3] = sess->sm_context_ref;
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location, NULL);
/* Store 5GSM Message */
AMF_SESS_STORE_5GSM_MESSAGE(sess,
OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND,
n1buf, n2buf);
ogs_assert(OGS_OK == ngap_send_paging(amf_ue));
} else if (CM_CONNECTED(amf_ue)) {
gmmbuf = gmm_build_dl_nas_transport(sess,
OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, n1buf, 0, 0);
ogs_assert(gmmbuf);
ngapbuf = ngap_build_pdu_session_resource_modify_request(
sess, gmmbuf, n2buf);
ogs_assert(ngapbuf);
if (nas_5gs_send_to_gnb(amf_ue, ngapbuf) != OGS_OK)
ogs_error("nas_5gs_send_to_gnb() failed");
} else {
ogs_fatal("[%s] Invalid AMF-UE state", amf_ue->supi);
ogs_assert_if_reached();
}
break;
case OpenAPI_ngap_ie_type_PDU_RES_REL_CMD:
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (n1buf)
ogs_pkbuf_free(n1buf);
if (CM_IDLE(amf_ue)) {
if (n2buf)
ogs_pkbuf_free(n2buf);
if (N1N2MessageTransferReqData->is_skip_ind == true &&
N1N2MessageTransferReqData->skip_ind == true) {
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_N1_MSG_NOT_TRANSFERRED;
} else {
ogs_fatal("[%s] No skipInd", amf_ue->supi);
ogs_assert_if_reached();
}
} else if (CM_CONNECTED(amf_ue)) {
ngapbuf = ngap_build_pdu_session_resource_release_command(
sess, NULL, n2buf);
ogs_assert(ngapbuf);
if (nas_5gs_send_to_gnb(amf_ue, ngapbuf) != OGS_OK)
ogs_error("nas_5gs_send_to_gnb() failed");
} else {
ogs_fatal("[%s] Invalid AMF-UE state", amf_ue->supi);
ogs_assert_if_reached();
}
break;
default:
ogs_error("Not implemented ngap_ie_type[%d]",
n2InfoContent->ngap_ie_type);
ogs_assert_if_reached();
}
response = ogs_sbi_build_response(&sendmsg, status);
ogs_assert(response);
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
if (sendmsg.http.location)
ogs_free(sendmsg.http.location);
return OGS_OK;
} | 1534 | True | 1 |
CVE-2021-44109 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'name': 'https://github.com/open5gs/open5gs/commit/d919b2744cd05abae043490f0a3dd1946c1ccb8c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/open5gs/open5gs/issues/1247', 'name': 'https://github.com/open5gs/open5gs/issues/1247', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:open5gs:open5gs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in lib/sbi/message.c in Open5GS 2.3.6 and earlier allows remote attackers to Denial of Service via a crafted sbi request.'}] | 2022-04-13T14:56Z | 2022-04-05T02: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 | Sukchan Lee | 2021-11-17 08:09:16+09:00 | [AMF] fix the memory problem (#1247)
1. memory corruption
- Overflow num_of_part in SBI message
2. null pointer dereference
- n2InfoContent->ngap_ie_type | d919b2744cd05abae043490f0a3dd1946c1ccb8c | False | open5gs/open5gs | Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network (Release-16) | 2017-02-01 10:48:49 | 2022-08-27 09:44:43 | https://open5gs.org | open5gs | 935.0 | 415.0 | amf_namf_comm_handle_n1_n2_message_transfer | amf_namf_comm_handle_n1_n2_message_transfer( ogs_sbi_stream_t * stream , ogs_sbi_message_t * recvmsg) | ['stream', 'recvmsg'] | int amf_namf_comm_handle_n1_n2_message_transfer(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
{
int status;
amf_ue_t *amf_ue = NULL;
amf_sess_t *sess = NULL;
ogs_pkbuf_t *n1buf = NULL;
ogs_pkbuf_t *n2buf = NULL;
ogs_pkbuf_t *gmmbuf = NULL;
ogs_pkbuf_t *ngapbuf = NULL;
char *supi = NULL;
uint8_t pdu_session_id = OGS_NAS_PDU_SESSION_IDENTITY_UNASSIGNED;
ogs_sbi_message_t sendmsg;
ogs_sbi_response_t *response = NULL;
OpenAPI_n1_n2_message_transfer_req_data_t *N1N2MessageTransferReqData;
OpenAPI_n1_n2_message_transfer_rsp_data_t N1N2MessageTransferRspData;
OpenAPI_n1_message_container_t *n1MessageContainer = NULL;
OpenAPI_ref_to_binary_data_t *n1MessageContent = NULL;
OpenAPI_n2_info_container_t *n2InfoContainer = NULL;
OpenAPI_n2_sm_information_t *smInfo = NULL;
OpenAPI_n2_info_content_t *n2InfoContent = NULL;
OpenAPI_ref_to_binary_data_t *ngapData = NULL;
ogs_assert(stream);
ogs_assert(recvmsg);
N1N2MessageTransferReqData = recvmsg->N1N2MessageTransferReqData;
if (!N1N2MessageTransferReqData) {
ogs_error("No N1N2MessageTransferReqData");
return OGS_ERROR;
}
if (N1N2MessageTransferReqData->is_pdu_session_id == false) {
ogs_error("No PDU Session Identity");
return OGS_ERROR;
}
pdu_session_id = N1N2MessageTransferReqData->pdu_session_id;
supi = recvmsg->h.resource.component[1];
if (!supi) {
ogs_error("No SUPI");
return OGS_ERROR;
}
amf_ue = amf_ue_find_by_supi(supi);
if (!amf_ue) {
ogs_error("No UE context [%s]", supi);
return OGS_ERROR;
}
sess = amf_sess_find_by_psi(amf_ue, pdu_session_id);
if (!sess) {
ogs_error("[%s] No PDU Session Context [%d]",
amf_ue->supi, pdu_session_id);
return OGS_ERROR;
}
n1MessageContainer = N1N2MessageTransferReqData->n1_message_container;
if (n1MessageContainer) {
n1MessageContent = n1MessageContainer->n1_message_content;
if (!n1MessageContent || !n1MessageContent->content_id) {
ogs_error("No n1MessageContent");
return OGS_ERROR;
}
n1buf = ogs_sbi_find_part_by_content_id(
recvmsg, n1MessageContent->content_id);
if (!n1buf) {
ogs_error("[%s] No N1 SM Content", amf_ue->supi);
return OGS_ERROR;
}
/*
* NOTE : The pkbuf created in the SBI message will be removed
* from ogs_sbi_message_free(), so it must be copied.
*/
n1buf = ogs_pkbuf_copy(n1buf);
ogs_assert(n1buf);
}
n2InfoContainer = N1N2MessageTransferReqData->n2_info_container;
if (n2InfoContainer) {
smInfo = n2InfoContainer->sm_info;
if (!smInfo) {
ogs_error("No smInfo");
return OGS_ERROR;
}
n2InfoContent = smInfo->n2_info_content;
if (!n2InfoContent) {
ogs_error("No n2InfoContent");
return OGS_ERROR;
}
ngapData = n2InfoContent->ngap_data;
if (!ngapData || !ngapData->content_id) {
ogs_error("No ngapData");
return OGS_ERROR;
}
n2buf = ogs_sbi_find_part_by_content_id(
recvmsg, ngapData->content_id);
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
/*
* NOTE : The pkbuf created in the SBI message will be removed
* from ogs_sbi_message_free(), so it must be copied.
*/
n2buf = ogs_pkbuf_copy(n2buf);
ogs_assert(n2buf);
}
memset(&sendmsg, 0, sizeof(sendmsg));
status = OGS_SBI_HTTP_STATUS_OK;
memset(&N1N2MessageTransferRspData, 0, sizeof(N1N2MessageTransferRspData));
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_N1_N2_TRANSFER_INITIATED;
sendmsg.N1N2MessageTransferRspData = &N1N2MessageTransferRspData;
switch (n2InfoContent->ngap_ie_type) {
case OpenAPI_ngap_ie_type_PDU_RES_SETUP_REQ:
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (n1buf) {
gmmbuf = gmm_build_dl_nas_transport(sess,
OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, n1buf, 0, 0);
ogs_assert(gmmbuf);
}
if (gmmbuf) {
ran_ue_t *ran_ue = NULL;
/***********************************
* 4.3.2 PDU Session Establishment *
***********************************/
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
ogs_assert(ran_ue);
if (sess->pdu_session_establishment_accept) {
ogs_pkbuf_free(sess->pdu_session_establishment_accept);
sess->pdu_session_establishment_accept = NULL;
}
if (ran_ue->initial_context_setup_request_sent == true) {
ngapbuf = ngap_sess_build_pdu_session_resource_setup_request(
sess, gmmbuf, n2buf);
ogs_assert(ngapbuf);
} else {
ngapbuf = ngap_sess_build_initial_context_setup_request(
sess, gmmbuf, n2buf);
ogs_assert(ngapbuf);
ran_ue->initial_context_setup_request_sent = true;
}
if (SESSION_CONTEXT_IN_SMF(sess)) {
/*
* [1-CLIENT] /nsmf-pdusession/v1/sm-contexts
* [2-SERVER] /namf-comm/v1/ue-contexts/{supi}/n1-n2-messages
*
* If [2-SERVER] arrives after [1-CLIENT],
* sm-context-ref is created in [1-CLIENT].
* So, the PDU session establishment accpet can be transmitted.
*/
if (nas_5gs_send_to_gnb(amf_ue, ngapbuf) != OGS_OK)
ogs_error("nas_5gs_send_to_gnb() failed");
} else {
sess->pdu_session_establishment_accept = ngapbuf;
}
} else {
/*********************************************
* 4.2.3.3 Network Triggered Service Request *
*********************************************/
if (CM_IDLE(amf_ue)) {
ogs_sbi_server_t *server = NULL;
ogs_sbi_header_t header;
ogs_sbi_client_t *client = NULL;
ogs_sockaddr_t *addr = NULL;
if (!N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri) {
ogs_error("[%s:%d] No n1-n2-failure-notification-uri",
amf_ue->supi, sess->psi);
return OGS_ERROR;
}
addr = ogs_sbi_getaddr_from_uri(
N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri);
if (!addr) {
ogs_error("[%s:%d] Invalid URI [%s]",
amf_ue->supi, sess->psi,
N1N2MessageTransferReqData->
n1n2_failure_txf_notif_uri);
return OGS_ERROR;;
}
client = ogs_sbi_client_find(addr);
if (!client) {
client = ogs_sbi_client_add(addr);
ogs_assert(client);
}
OGS_SETUP_SBI_CLIENT(&sess->paging, client);
ogs_freeaddrinfo(addr);
status = OGS_SBI_HTTP_STATUS_ACCEPTED;
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_ATTEMPTING_TO_REACH_UE;
/* Location */
server = ogs_sbi_server_from_stream(stream);
ogs_assert(server);
memset(&header, 0, sizeof(header));
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_COMM;
header.api.version = (char *)OGS_SBI_API_V1;
header.resource.component[0] =
(char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXTS;
header.resource.component[1] = amf_ue->supi;
header.resource.component[2] =
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
header.resource.component[3] = sess->sm_context_ref;
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location,
N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri);
/* Store N2 Transfer message */
AMF_SESS_STORE_N2_TRANSFER(
sess, pdu_session_resource_setup_request, n2buf);
ogs_assert(OGS_OK == ngap_send_paging(amf_ue));
} else if (CM_CONNECTED(amf_ue)) {
ogs_assert(OGS_OK ==
ngap_send_pdu_resource_setup_request(sess, n2buf));
} else {
ogs_fatal("[%s] Invalid AMF-UE state", amf_ue->supi);
ogs_assert_if_reached();
}
}
break;
case OpenAPI_ngap_ie_type_PDU_RES_MOD_REQ:
if (!n1buf) {
ogs_error("[%s] No N1 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (CM_IDLE(amf_ue)) {
ogs_sbi_server_t *server = NULL;
ogs_sbi_header_t header;
status = OGS_SBI_HTTP_STATUS_ACCEPTED;
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_ATTEMPTING_TO_REACH_UE;
/* Location */
server = ogs_sbi_server_from_stream(stream);
ogs_assert(server);
memset(&header, 0, sizeof(header));
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_COMM;
header.api.version = (char *)OGS_SBI_API_V1;
header.resource.component[0] =
(char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXTS;
header.resource.component[1] = amf_ue->supi;
header.resource.component[2] =
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
header.resource.component[3] = sess->sm_context_ref;
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
/* Store Paging Info */
AMF_SESS_STORE_PAGING_INFO(
sess, sendmsg.http.location, NULL);
/* Store 5GSM Message */
AMF_SESS_STORE_5GSM_MESSAGE(sess,
OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND,
n1buf, n2buf);
ogs_assert(OGS_OK == ngap_send_paging(amf_ue));
} else if (CM_CONNECTED(amf_ue)) {
gmmbuf = gmm_build_dl_nas_transport(sess,
OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, n1buf, 0, 0);
ogs_assert(gmmbuf);
ngapbuf = ngap_build_pdu_session_resource_modify_request(
sess, gmmbuf, n2buf);
ogs_assert(ngapbuf);
if (nas_5gs_send_to_gnb(amf_ue, ngapbuf) != OGS_OK)
ogs_error("nas_5gs_send_to_gnb() failed");
} else {
ogs_fatal("[%s] Invalid AMF-UE state", amf_ue->supi);
ogs_assert_if_reached();
}
break;
case OpenAPI_ngap_ie_type_PDU_RES_REL_CMD:
if (!n2buf) {
ogs_error("[%s] No N2 SM Content", amf_ue->supi);
return OGS_ERROR;
}
if (n1buf)
ogs_pkbuf_free(n1buf);
if (CM_IDLE(amf_ue)) {
if (n2buf)
ogs_pkbuf_free(n2buf);
if (N1N2MessageTransferReqData->is_skip_ind == true &&
N1N2MessageTransferReqData->skip_ind == true) {
N1N2MessageTransferRspData.cause =
OpenAPI_n1_n2_message_transfer_cause_N1_MSG_NOT_TRANSFERRED;
} else {
ogs_fatal("[%s] No skipInd", amf_ue->supi);
ogs_assert_if_reached();
}
} else if (CM_CONNECTED(amf_ue)) {
ngapbuf = ngap_build_pdu_session_resource_release_command(
sess, NULL, n2buf);
ogs_assert(ngapbuf);
if (nas_5gs_send_to_gnb(amf_ue, ngapbuf) != OGS_OK)
ogs_error("nas_5gs_send_to_gnb() failed");
} else {
ogs_fatal("[%s] Invalid AMF-UE state", amf_ue->supi);
ogs_assert_if_reached();
}
break;
default:
ogs_error("Not implemented ngap_ie_type[%d]",
n2InfoContent->ngap_ie_type);
ogs_assert_if_reached();
}
response = ogs_sbi_build_response(&sendmsg, status);
ogs_assert(response);
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
if (sendmsg.http.location)
ogs_free(sendmsg.http.location);
return OGS_OK;
} | 1534 | True | 1 |
CVE-2021-44512 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:P/A:P | LOCAL | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 4.4 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/tmate-io/tmate-ssh-server/commit/1c020d1f5ca462f5b150b46a027aaa1bbe3c9596', 'name': 'https://github.com/tmate-io/tmate-ssh-server/commit/1c020d1f5ca462f5b150b46a027aaa1bbe3c9596', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2021/12/06/2', 'name': 'https://www.openwall.com/lists/oss-security/2021/12/06/2', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-732'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tmate:tmate-ssh-server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'World-writable permissions on the /tmp/tmate/sessions directory in tmate-ssh-server 2.3.0 allow a local attacker to compromise the integrity of session handling, or obtain the read-write session ID from a read-only session symlink in this directory.'}] | 2022-05-03T16:04Z | 2021-12-07T03:15Z | Incorrect Permission Assignment for Critical Resource | The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. | When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.
| https://cwe.mitre.org/data/definitions/732.html | 0 | Nicolas Viennot | 2021-10-16 16:01:12-04:00 | Harden /tmp/tmate directory
Suggested by Matthias Gerstner | 1c020d1f5ca462f5b150b46a027aaa1bbe3c9596 | False | tmate-io/tmate-ssh-server | tmate SSH server | 2013-06-09 23:58:55 | 2022-02-24 10:31:17 | https://tmate.io | tmate-io | 542.0 | 124.0 | main | main( int argc , char ** argv , char ** envp) | ['argc', 'argv', 'envp'] | int main(int argc, char **argv, char **envp)
{
int opt;
while ((opt = getopt(argc, argv, "b:h:k:p:q:w:z:xv")) != -1) {
switch (opt) {
case 'b':
tmate_settings->bind_addr = xstrdup(optarg);
break;
case 'h':
tmate_settings->tmate_host = xstrdup(optarg);
break;
case 'k':
tmate_settings->keys_dir = xstrdup(optarg);
break;
case 'p':
tmate_settings->ssh_port = atoi(optarg);
break;
case 'q':
tmate_settings->ssh_port_advertized = atoi(optarg);
break;
case 'w':
tmate_settings->websocket_hostname = xstrdup(optarg);
break;
case 'z':
tmate_settings->websocket_port = atoi(optarg);
break;
case 'x':
tmate_settings->use_proxy_protocol = true;
break;
case 'v':
tmate_settings->log_level++;
break;
default:
usage();
return 1;
}
}
init_logging(tmate_settings->log_level);
setup_locale();
if (!tmate_settings->tmate_host)
tmate_settings->tmate_host = get_full_hostname();
cmdline = *argv;
cmdline_end = *envp;
tmate_preload_trace_lib();
tmate_catch_sigsegv();
tmate_init_rand();
if ((mkdir(TMATE_WORKDIR, 0701) < 0 && errno != EEXIST) ||
(mkdir(TMATE_WORKDIR "/sessions", 0703) < 0 && errno != EEXIST) ||
(mkdir(TMATE_WORKDIR "/jail", 0700) < 0 && errno != EEXIST))
tmate_fatal("Cannot prepare session in " TMATE_WORKDIR);
/* The websocket server needs to access the /session dir to rename sockets */
if ((chmod(TMATE_WORKDIR, 0701) < 0) ||
(chmod(TMATE_WORKDIR "/sessions", 0703) < 0) ||
(chmod(TMATE_WORKDIR "/jail", 0700) < 0))
tmate_fatal("Cannot prepare session in " TMATE_WORKDIR);
tmate_ssh_server_main(tmate_session,
tmate_settings->keys_dir, tmate_settings->bind_addr, tmate_settings->ssh_port);
return 0;
} | 338 | True | 1 |
CVE-2021-44513 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:P/A:P | LOCAL | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 4.4 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/tmate-io/tmate-ssh-server/commit/1c020d1f5ca462f5b150b46a027aaa1bbe3c9596', 'name': 'https://github.com/tmate-io/tmate-ssh-server/commit/1c020d1f5ca462f5b150b46a027aaa1bbe3c9596', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2021/12/06/2', 'name': 'https://www.openwall.com/lists/oss-security/2021/12/06/2', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tmate:tmate-ssh-server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Insecure creation of temporary directories in tmate-ssh-server 2.3.0 allows a local attacker to compromise the integrity of session handling.'}] | 2021-12-08T14:27Z | 2021-12-07T03:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Nicolas Viennot | 2021-10-16 16:01:12-04:00 | Harden /tmp/tmate directory
Suggested by Matthias Gerstner | 1c020d1f5ca462f5b150b46a027aaa1bbe3c9596 | False | tmate-io/tmate-ssh-server | tmate SSH server | 2013-06-09 23:58:55 | 2022-02-24 10:31:17 | https://tmate.io | tmate-io | 542.0 | 124.0 | main | main( int argc , char ** argv , char ** envp) | ['argc', 'argv', 'envp'] | int main(int argc, char **argv, char **envp)
{
int opt;
while ((opt = getopt(argc, argv, "b:h:k:p:q:w:z:xv")) != -1) {
switch (opt) {
case 'b':
tmate_settings->bind_addr = xstrdup(optarg);
break;
case 'h':
tmate_settings->tmate_host = xstrdup(optarg);
break;
case 'k':
tmate_settings->keys_dir = xstrdup(optarg);
break;
case 'p':
tmate_settings->ssh_port = atoi(optarg);
break;
case 'q':
tmate_settings->ssh_port_advertized = atoi(optarg);
break;
case 'w':
tmate_settings->websocket_hostname = xstrdup(optarg);
break;
case 'z':
tmate_settings->websocket_port = atoi(optarg);
break;
case 'x':
tmate_settings->use_proxy_protocol = true;
break;
case 'v':
tmate_settings->log_level++;
break;
default:
usage();
return 1;
}
}
init_logging(tmate_settings->log_level);
setup_locale();
if (!tmate_settings->tmate_host)
tmate_settings->tmate_host = get_full_hostname();
cmdline = *argv;
cmdline_end = *envp;
tmate_preload_trace_lib();
tmate_catch_sigsegv();
tmate_init_rand();
if ((mkdir(TMATE_WORKDIR, 0701) < 0 && errno != EEXIST) ||
(mkdir(TMATE_WORKDIR "/sessions", 0703) < 0 && errno != EEXIST) ||
(mkdir(TMATE_WORKDIR "/jail", 0700) < 0 && errno != EEXIST))
tmate_fatal("Cannot prepare session in " TMATE_WORKDIR);
/* The websocket server needs to access the /session dir to rename sockets */
if ((chmod(TMATE_WORKDIR, 0701) < 0) ||
(chmod(TMATE_WORKDIR "/sessions", 0703) < 0) ||
(chmod(TMATE_WORKDIR "/jail", 0700) < 0))
tmate_fatal("Cannot prepare session in " TMATE_WORKDIR);
tmate_ssh_server_main(tmate_session,
tmate_settings->keys_dir, tmate_settings->bind_addr, tmate_settings->ssh_port);
return 0;
} | 338 | True | 1 |
CVE-2021-45930 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37025', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37025', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtsvg/commit/a3b753c2d077313fc9eb93af547051b956e383fc', 'name': 'https://github.com/qt/qtsvg/commit/a3b753c2d077313fc9eb93af547051b956e383fc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/qt/OSV-2021-1121.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/qt/OSV-2021-1121.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtsvg/commit/79bb9f51fa374106a612d17c9d98d35d807be670', 'name': 'https://github.com/qt/qtsvg/commit/79bb9f51fa374106a612d17c9d98d35d807be670', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtsvg/commit/36cfd9efb9b22b891adee9c48d30202289cfa620', 'name': 'https://github.com/qt/qtsvg/commit/36cfd9efb9b22b891adee9c48d30202289cfa620', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37306', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37306', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/V75XNX4GDB64N5BSOAN474RUXXS5OHRU/', 'name': 'FEDORA-2022-8e3fbc74e9', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/01/msg00020.html', 'name': '[debian-lts-announce] 20220123 [SECURITY] [DLA 2885-1] qtsvg-opensource-src security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/01/msg00022.html', 'name': '[debian-lts-announce] 20220124 [SECURITY] [DLA 2895-1] qt4-x11 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4GKOKVCSDZSOWWR3HOW5XUIUJC4MKQY5/', 'name': 'FEDORA-2022-56f583fd79', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GZIXNSX7FV733TWTTLY6FHSH3SCNQKKD/', 'name': 'FEDORA-2022-1e29b8997a', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:qt:qtsvg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0.0', 'versionEndIncluding': '5.15.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:qt:qtsvg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.2.1', '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': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Qt SVG in Qt 5.0.0 through 5.15.2 and 6.0.0 through 6.2.1 has an out-of-bounds write in QtPrivate::QCommonArrayOps<QPainterPath::Element>::growAppend (called from QPainterPath::addPath and QPathClipper::intersect).'}] | 2022-02-10T14:52Z | 2022-01-01T01: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 | Eirik Aavitsland | 2021-10-25 14:17:55+02:00 | Do stricter error checking when parsing path nodes
The SVG spec mandates that path parsing should terminate on the first
error encountered, and an error be reported. To improve the handling
of corrupt files, implement such error handling, and also limit the
number of QPainterPath elements to a reasonable range.
Fixes: QTBUG-96044
Pick-to: 6.2 5.15 5.12
Change-Id: Ic5e65d6b658516d6f1317c72de365c8c7ad81891
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io> | 36cfd9efb9b22b891adee9c48d30202289cfa620 | False | qt/qtsvg | Qt SVG | 2013-05-06 07:31:44 | 2022-08-26 01:39:39 | null | qt | 42.0 | 52.0 | createPathNode | createPathNode( QSvgNode * parent , const QXmlStreamAttributes & attributes , QSvgHandler *) | ['parent', 'attributes'] | static QSvgNode *createPathNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QStringView data = attributes.value(QLatin1String("d"));
QPainterPath qpath;
qpath.setFillRule(Qt::WindingFill);
//XXX do error handling
parsePathDataFast(data, qpath);
QSvgNode *path = new QSvgPath(parent, qpath);
return path;
} | 63 | True | 1 |
CVE-2021-45930 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37025', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37025', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtsvg/commit/a3b753c2d077313fc9eb93af547051b956e383fc', 'name': 'https://github.com/qt/qtsvg/commit/a3b753c2d077313fc9eb93af547051b956e383fc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/qt/OSV-2021-1121.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/qt/OSV-2021-1121.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtsvg/commit/79bb9f51fa374106a612d17c9d98d35d807be670', 'name': 'https://github.com/qt/qtsvg/commit/79bb9f51fa374106a612d17c9d98d35d807be670', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtsvg/commit/36cfd9efb9b22b891adee9c48d30202289cfa620', 'name': 'https://github.com/qt/qtsvg/commit/36cfd9efb9b22b891adee9c48d30202289cfa620', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37306', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37306', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/V75XNX4GDB64N5BSOAN474RUXXS5OHRU/', 'name': 'FEDORA-2022-8e3fbc74e9', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/01/msg00020.html', 'name': '[debian-lts-announce] 20220123 [SECURITY] [DLA 2885-1] qtsvg-opensource-src security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/01/msg00022.html', 'name': '[debian-lts-announce] 20220124 [SECURITY] [DLA 2895-1] qt4-x11 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4GKOKVCSDZSOWWR3HOW5XUIUJC4MKQY5/', 'name': 'FEDORA-2022-56f583fd79', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GZIXNSX7FV733TWTTLY6FHSH3SCNQKKD/', 'name': 'FEDORA-2022-1e29b8997a', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:qt:qtsvg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0.0', 'versionEndIncluding': '5.15.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:qt:qtsvg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.2.1', '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': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Qt SVG in Qt 5.0.0 through 5.15.2 and 6.0.0 through 6.2.1 has an out-of-bounds write in QtPrivate::QCommonArrayOps<QPainterPath::Element>::growAppend (called from QPainterPath::addPath and QPathClipper::intersect).'}] | 2022-02-10T14:52Z | 2022-01-01T01: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 | Eirik Aavitsland | 2021-10-25 14:17:55+02:00 | Do stricter error checking when parsing path nodes
The SVG spec mandates that path parsing should terminate on the first
error encountered, and an error be reported. To improve the handling
of corrupt files, implement such error handling, and also limit the
number of QPainterPath elements to a reasonable range.
Fixes: QTBUG-96044
Pick-to: 6.2 5.15 5.12
Change-Id: Ic5e65d6b658516d6f1317c72de365c8c7ad81891
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io> | 36cfd9efb9b22b891adee9c48d30202289cfa620 | False | qt/qtsvg | Qt SVG | 2013-05-06 07:31:44 | 2022-08-26 01:39:39 | null | qt | 42.0 | 52.0 | parsePathDataFast | parsePathDataFast( QStringView dataStr , QPainterPath & path) | ['dataStr', 'path'] | static bool parsePathDataFast(QStringView dataStr, QPainterPath &path)
{
qreal x0 = 0, y0 = 0; // starting point
qreal x = 0, y = 0; // current point
char lastMode = 0;
QPointF ctrlPt;
const QChar *str = dataStr.constData();
const QChar *end = str + dataStr.size();
while (str != end) {
while (str->isSpace() && (str + 1) != end)
++str;
QChar pathElem = *str;
++str;
QChar endc = *end;
*const_cast<QChar *>(end) = u'\0'; // parseNumbersArray requires 0-termination that QStringView cannot guarantee
const char *pattern = nullptr;
if (pathElem == QLatin1Char('a') || pathElem == QLatin1Char('A'))
pattern = "rrrffrr";
QVarLengthArray<qreal, 8> arg;
parseNumbersArray(str, arg, pattern);
*const_cast<QChar *>(end) = endc;
if (pathElem == QLatin1Char('z') || pathElem == QLatin1Char('Z'))
arg.append(0);//dummy
const qreal *num = arg.constData();
int count = arg.count();
while (count > 0) {
qreal offsetX = x; // correction offsets
qreal offsetY = y; // for relative commands
switch (pathElem.unicode()) {
case 'm': {
if (count < 2) {
num++;
count--;
break;
}
x = x0 = num[0] + offsetX;
y = y0 = num[1] + offsetY;
num += 2;
count -= 2;
path.moveTo(x0, y0);
// As per 1.2 spec 8.3.2 The "moveto" commands
// If a 'moveto' is followed by multiple pairs of coordinates without explicit commands,
// the subsequent pairs shall be treated as implicit 'lineto' commands.
pathElem = QLatin1Char('l');
}
break;
case 'M': {
if (count < 2) {
num++;
count--;
break;
}
x = x0 = num[0];
y = y0 = num[1];
num += 2;
count -= 2;
path.moveTo(x0, y0);
// As per 1.2 spec 8.3.2 The "moveto" commands
// If a 'moveto' is followed by multiple pairs of coordinates without explicit commands,
// the subsequent pairs shall be treated as implicit 'lineto' commands.
pathElem = QLatin1Char('L');
}
break;
case 'z':
case 'Z': {
x = x0;
y = y0;
count--; // skip dummy
num++;
path.closeSubpath();
}
break;
case 'l': {
if (count < 2) {
num++;
count--;
break;
}
x = num[0] + offsetX;
y = num[1] + offsetY;
num += 2;
count -= 2;
path.lineTo(x, y);
}
break;
case 'L': {
if (count < 2) {
num++;
count--;
break;
}
x = num[0];
y = num[1];
num += 2;
count -= 2;
path.lineTo(x, y);
}
break;
case 'h': {
x = num[0] + offsetX;
num++;
count--;
path.lineTo(x, y);
}
break;
case 'H': {
x = num[0];
num++;
count--;
path.lineTo(x, y);
}
break;
case 'v': {
y = num[0] + offsetY;
num++;
count--;
path.lineTo(x, y);
}
break;
case 'V': {
y = num[0];
num++;
count--;
path.lineTo(x, y);
}
break;
case 'c': {
if (count < 6) {
num += count;
count = 0;
break;
}
QPointF c1(num[0] + offsetX, num[1] + offsetY);
QPointF c2(num[2] + offsetX, num[3] + offsetY);
QPointF e(num[4] + offsetX, num[5] + offsetY);
num += 6;
count -= 6;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 'C': {
if (count < 6) {
num += count;
count = 0;
break;
}
QPointF c1(num[0], num[1]);
QPointF c2(num[2], num[3]);
QPointF e(num[4], num[5]);
num += 6;
count -= 6;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 's': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c1;
if (lastMode == 'c' || lastMode == 'C' ||
lastMode == 's' || lastMode == 'S')
c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c1 = QPointF(x, y);
QPointF c2(num[0] + offsetX, num[1] + offsetY);
QPointF e(num[2] + offsetX, num[3] + offsetY);
num += 4;
count -= 4;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 'S': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c1;
if (lastMode == 'c' || lastMode == 'C' ||
lastMode == 's' || lastMode == 'S')
c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c1 = QPointF(x, y);
QPointF c2(num[0], num[1]);
QPointF e(num[2], num[3]);
num += 4;
count -= 4;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 'q': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c(num[0] + offsetX, num[1] + offsetY);
QPointF e(num[2] + offsetX, num[3] + offsetY);
num += 4;
count -= 4;
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 'Q': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c(num[0], num[1]);
QPointF e(num[2], num[3]);
num += 4;
count -= 4;
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 't': {
if (count < 2) {
num += count;
count = 0;
break;
}
QPointF e(num[0] + offsetX, num[1] + offsetY);
num += 2;
count -= 2;
QPointF c;
if (lastMode == 'q' || lastMode == 'Q' ||
lastMode == 't' || lastMode == 'T')
c = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c = QPointF(x, y);
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 'T': {
if (count < 2) {
num += count;
count = 0;
break;
}
QPointF e(num[0], num[1]);
num += 2;
count -= 2;
QPointF c;
if (lastMode == 'q' || lastMode == 'Q' ||
lastMode == 't' || lastMode == 'T')
c = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c = QPointF(x, y);
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 'a': {
if (count < 7) {
num += count;
count = 0;
break;
}
qreal rx = (*num++);
qreal ry = (*num++);
qreal xAxisRotation = (*num++);
qreal largeArcFlag = (*num++);
qreal sweepFlag = (*num++);
qreal ex = (*num++) + offsetX;
qreal ey = (*num++) + offsetY;
count -= 7;
qreal curx = x;
qreal cury = y;
pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag),
int(sweepFlag), ex, ey, curx, cury);
x = ex;
y = ey;
}
break;
case 'A': {
if (count < 7) {
num += count;
count = 0;
break;
}
qreal rx = (*num++);
qreal ry = (*num++);
qreal xAxisRotation = (*num++);
qreal largeArcFlag = (*num++);
qreal sweepFlag = (*num++);
qreal ex = (*num++);
qreal ey = (*num++);
count -= 7;
qreal curx = x;
qreal cury = y;
pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag),
int(sweepFlag), ex, ey, curx, cury);
x = ex;
y = ey;
}
break;
default:
return false;
}
lastMode = pathElem.toLatin1();
}
}
return true;
} | 1921 | True | 1 |
CVE-2021-45932 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1188.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1188.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37866', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37866', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow (4 bytes) in MqttDecode_Publish (called from MqttClient_DecodePacket and MqttClient_HandlePacket).'}] | 2022-01-11T21:11Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-45933 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38237', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38237', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1211.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1211.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow (8 bytes) in MqttDecode_Publish (called from MqttClient_DecodePacket and MqttClient_HandlePacket).'}] | 2022-01-11T21:12Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-45934 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1204.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1204.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38146', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38146', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', '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:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow in MqttClient_DecodePacket (called from MqttClient_HandlePacket and MqttClient_WaitType).'}] | 2022-01-11T21:14Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-45936 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39053', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39053', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1348.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1348.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow in MqttDecode_Disconnect (called from MqttClient_DecodePacket and MqttClient_WaitType).'}] | 2022-01-11T21:16Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-45937 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1349.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1349.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39083', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39083', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow in MqttClient_DecodePacket (called from MqttClient_WaitType and MqttClient_Connect).'}] | 2022-01-11T21:17Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-45938 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1353.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1353.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39056', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39056', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', '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:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow in MqttClient_DecodePacket (called from MqttClient_WaitType and MqttClient_Unsubscribe).'}] | 2022-01-11T21:20Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-45939 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1361.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/wolfmqtt/OSV-2021-1361.yaml', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39103', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39103', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', 'name': 'https://github.com/wolfSSL/wolfMQTT/commit/84d4b53122e0fa0280c7872350b89d5777dabbb2', '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:wolfssl:wolfmqtt:1.9:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'wolfSSL wolfMQTT 1.9 has a heap-based buffer overflow in MqttClient_DecodePacket (called from MqttClient_WaitType and MqttClient_Subscribe).'}] | 2022-01-11T21:22Z | 2022-01-01T01: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 | Eric Blankenhorn | 2021-09-21 11:46:46-05:00 | Fix wolfmqtt-fuzzer: Null-dereference WRITE in MqttProps_Free | 84d4b53122e0fa0280c7872350b89d5777dabbb2 | False | wolfSSL/wolfMQTT | wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3. | 2015-10-26 16:58:13 | 2022-07-27 18:52:17 | https://www.wolfssl.com | wolfSSL | 418.0 | 144.0 | MqttClient_WaitType | MqttClient_WaitType( MqttClient * client , void * packet_obj , byte wait_type , word16 wait_packet_id , int timeout_ms) | ['client', 'packet_obj', 'wait_type', 'wait_packet_id', 'timeout_ms'] | static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
byte wait_type, word16 wait_packet_id, int timeout_ms)
{
int rc;
word16 packet_id;
MqttPacketType packet_type;
#ifdef WOLFMQTT_MULTITHREAD
MqttPendResp *pendResp;
int readLocked;
#endif
MqttMsgStat* mms_stat;
int waitMatchFound;
if (client == NULL || packet_obj == NULL) {
return MQTT_CODE_ERROR_BAD_ARG;
}
/* all packet type structures must have MqttMsgStat at top */
mms_stat = (MqttMsgStat*)packet_obj;
wait_again:
/* initialize variables */
packet_id = 0;
packet_type = MQTT_PACKET_TYPE_RESERVED;
#ifdef WOLFMQTT_MULTITHREAD
pendResp = NULL;
readLocked = 0;
#endif
waitMatchFound = 0;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Type %s (%d), ID %d",
MqttPacket_TypeDesc((MqttPacketType)wait_type),
wait_type, wait_packet_id);
#endif
switch ((int)*mms_stat)
{
case MQTT_MSG_BEGIN:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Lock recv socket mutex */
rc = wm_SemLock(&client->lockRecv);
if (rc != 0) {
PRINTF("MqttClient_WaitType: recv lock error!");
return rc;
}
readLocked = 1;
#endif
/* reset the packet state */
client->packet.stat = MQTT_PK_BEGIN;
}
FALL_THROUGH;
#ifdef WOLFMQTT_V5
case MQTT_MSG_AUTH:
#endif
case MQTT_MSG_WAIT:
{
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if packet type and id have already completed */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, (MqttPacketType)wait_type,
wait_packet_id, &pendResp)) {
if (pendResp->packetDone) {
/* pending response is already done, so return */
rc = pendResp->packet_ret;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp already Done %p: Rc %d", pendResp, rc);
#endif
MqttClient_RespList_Remove(client, pendResp);
wm_SemUnlock(&client->lockClient);
wm_SemUnlock(&client->lockRecv);
return rc;
}
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
*mms_stat = MQTT_MSG_WAIT;
/* Wait for packet */
rc = MqttPacket_Read(client, client->rx_buf, client->rx_buf_len,
timeout_ms);
/* handle failure */
if (rc <= 0) {
break;
}
/* capture length read */
client->packet.buf_len = rc;
/* Decode Packet - get type and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, NULL, &packet_id);
if (rc < 0) {
break;
}
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("Read Packet: Len %d, Type %d, ID %d",
client->packet.buf_len, packet_type, packet_id);
#endif
*mms_stat = MQTT_MSG_READ;
}
FALL_THROUGH;
case MQTT_MSG_READ:
case MQTT_MSG_READ_PAYLOAD:
{
MqttPacketType use_packet_type;
void* use_packet_obj;
#ifdef WOLFMQTT_MULTITHREAD
readLocked = 1; /* if in this state read is locked */
#endif
/* read payload state only happens for publish messages */
if (*mms_stat == MQTT_MSG_READ_PAYLOAD) {
packet_type = MQTT_PACKET_TYPE_PUBLISH;
}
/* Determine if we received data for this request */
if ((wait_type == MQTT_PACKET_TYPE_ANY ||
wait_type == packet_type ||
MqttIsPubRespPacket(packet_type) == MqttIsPubRespPacket(wait_type)) &&
(wait_packet_id == 0 || wait_packet_id == packet_id))
{
use_packet_obj = packet_obj;
waitMatchFound = 1;
}
else {
/* use generic packet object */
use_packet_obj = &client->msg;
}
use_packet_type = packet_type;
#ifdef WOLFMQTT_MULTITHREAD
/* Check to see if we have a pending response for this packet */
pendResp = NULL;
rc = wm_SemLock(&client->lockClient);
if (rc == 0) {
if (MqttClient_RespList_Find(client, packet_type, packet_id,
&pendResp)) {
/* we found packet match this incoming read packet */
pendResp->packetProcessing = 1;
use_packet_obj = pendResp->packet_obj;
use_packet_type = pendResp->packet_type;
/* req from another thread... not a match */
waitMatchFound = 0;
}
wm_SemUnlock(&client->lockClient);
}
else {
break; /* error */
}
#endif /* WOLFMQTT_MULTITHREAD */
/* Perform packet handling for publish callback and QoS */
rc = MqttClient_HandlePacket(client, use_packet_type,
use_packet_obj, timeout_ms);
#ifdef WOLFMQTT_NONBLOCK
if (rc == MQTT_CODE_CONTINUE) {
/* we have received some data, so keep the recv
mutex lock active and return */
return rc;
}
#endif
/* handle success case */
if (rc >= 0) {
rc = MQTT_CODE_SUCCESS;
}
#ifdef WOLFMQTT_MULTITHREAD
if (pendResp) {
/* Mark pending response entry done */
if (wm_SemLock(&client->lockClient) == 0) {
pendResp->packetDone = 1;
pendResp->packet_ret = rc;
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("PendResp Done %p", pendResp);
#endif
pendResp = NULL;
wm_SemUnlock(&client->lockClient);
}
}
#endif /* WOLFMQTT_MULTITHREAD */
break;
}
case MQTT_MSG_WRITE:
case MQTT_MSG_WRITE_PAYLOAD:
default:
{
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Invalid state %d!", *mms_stat);
#endif
rc = MQTT_CODE_ERROR_STAT;
break;
}
} /* switch (*mms_stat) */
#ifdef WOLFMQTT_NONBLOCK
if (rc != MQTT_CODE_CONTINUE)
#endif
{
/* reset state */
*mms_stat = MQTT_MSG_BEGIN;
}
#ifdef WOLFMQTT_MULTITHREAD
if (readLocked) {
wm_SemUnlock(&client->lockRecv);
}
#endif
if (rc < 0) {
#ifdef WOLFMQTT_DEBUG_CLIENT
PRINTF("MqttClient_WaitType: Failure: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
#endif
return rc;
}
if (!waitMatchFound) {
/* if we get here, then the we are still waiting for a packet */
goto wait_again;
}
return rc;
} | 708 | True | 1 |
CVE-2021-46225 | 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 | False | [{'url': 'https://github.com/LoicMarechal/libMeshb/commit/8cd68c54e0647c0030ae4506a225ad4a2655c316', 'name': 'https://github.com/LoicMarechal/libMeshb/commit/8cd68c54e0647c0030ae4506a225ad4a2655c316', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LoicMarechal/libMeshb/issues/21', 'name': 'https://github.com/LoicMarechal/libMeshb/issues/21', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmeshb_project:libmeshb:7.61:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in the GmfOpenMesh() function of libMeshb v7.61 allows attackers to cause a Denial of Service (DoS) via a crafted MESH file.'}] | 2022-01-15T02:18Z | 2022-01-12T20:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Loïc Maréchal | 2022-01-07 14:25:30+01:00 | Removed a potential buffer overflow crash in GmfOpenMesh and debugged the test_libmeshb_block_pipeline.f that crashed | 8cd68c54e0647c0030ae4506a225ad4a2655c316 | False | LoicMarechal/libMeshb | A library to handle the *.meshb file format. | 2016-05-27 11:52:33 | 2022-08-24 12:51:44 | LoicMarechal | 34.0 | 9.0 | GmfOpenMesh | GmfOpenMesh( const char * FilNam , int mod , ...) | ['FilNam', 'mod'] | int64_t GmfOpenMesh(const char *FilNam, int mod, ...)
{
int KwdCod, res, *PtrVer, *PtrDim, err;
int64_t MshIdx;
char str[ GmfStrSiz ];
va_list VarArg;
GmfMshSct *msh;
/*---------------------*/
/* MESH STRUCTURE INIT */
/*---------------------*/
if(!(msh = calloc(1, sizeof(GmfMshSct))))
return(0);
MshIdx = (int64_t)msh;
// Save the current stack environment for longjmp
if( (err = setjmp(msh->err)) != 0)
{
#ifdef GMFDEBUG
printf("libMeshb : mesh %p : error %d\n", msh, err);
#endif
if(msh->hdl != NULL)
fclose(msh->hdl);
if(msh->FilDes != 0)
#ifdef GMF_WINDOWS
_close(msh->FilDes);
#else
close(msh->FilDes);
#endif
free(msh);
return(0);
}
// Copy the FilNam into the structure
if(strlen(FilNam) + 7 >= GmfStrSiz)
longjmp(msh->err, -4);
strcpy(msh->FilNam, FilNam);
// Store the opening mod (read or write) and guess
// the filetype (binary or ascii) depending on the extension
msh->mod = mod;
msh->buf = (void *)msh->DblBuf;
msh->FltBuf = (void *)msh->DblBuf;
msh->IntBuf = (void *)msh->DblBuf;
if(strstr(msh->FilNam, ".meshb"))
msh->typ |= (Bin | MshFil);
else if(strstr(msh->FilNam, ".mesh"))
msh->typ |= (Asc | MshFil);
else if(strstr(msh->FilNam, ".solb"))
msh->typ |= (Bin | SolFil);
else if(strstr(msh->FilNam, ".sol"))
msh->typ |= (Asc | SolFil);
else
longjmp(msh->err, -5);
// Open the file in the required mod and initialize the mesh structure
if(msh->mod == GmfRead)
{
/*-----------------------*/
/* OPEN FILE FOR READING */
/*-----------------------*/
va_start(VarArg, mod);
PtrVer = va_arg(VarArg, int *);
PtrDim = va_arg(VarArg, int *);
va_end(VarArg);
// Read the endian coding tag, the mesh version
// and the mesh dimension (mandatory kwd)
if(msh->typ & Bin)
{
// Create the name string and open the file
#ifdef WITH_GMF_AIO
// [Bruno] added binary flag (necessary under Windows)
msh->FilDes = open(msh->FilNam, OPEN_READ_FLAGS, OPEN_READ_MODE);
if(msh->FilDes <= 0)
longjmp(msh->err, -6);
// Read the endian coding tag
if(read(msh->FilDes, &msh->cod, WrdSiz) != WrdSiz)
longjmp(msh->err, -7);
#else
// [Bruno] added binary flag (necessary under Windows)
if(!(msh->hdl = fopen(msh->FilNam, "rb")))
longjmp(msh->err, -8);
// Read the endian coding tag
safe_fread(&msh->cod, WrdSiz, 1, msh->hdl, msh->err);
#endif
// Read the mesh version and the mesh dimension (mandatory kwd)
if( (msh->cod != 1) && (msh->cod != 16777216) )
longjmp(msh->err, -9);
ScaWrd(msh, (unsigned char *)&msh->ver);
if( (msh->ver < 1) || (msh->ver > 4) )
longjmp(msh->err, -10);
if( (msh->ver >= 3) && (sizeof(int64_t) != 8) )
longjmp(msh->err, -11);
ScaWrd(msh, (unsigned char *)&KwdCod);
if(KwdCod != GmfDimension)
longjmp(msh->err, -12);
GetPos(msh);
ScaWrd(msh, (unsigned char *)&msh->dim);
}
else
{
// Create the name string and open the file
if(!(msh->hdl = fopen(msh->FilNam, "rb")))
longjmp(msh->err, -13);
do
{
res = fscanf(msh->hdl, "%s", str);
}while( (res != EOF) && strcmp(str, "MeshVersionFormatted") );
if(res == EOF)
longjmp(msh->err, -14);
safe_fscanf(msh->hdl, "%d", &msh->ver, msh->err);
if( (msh->ver < 1) || (msh->ver > 4) )
longjmp(msh->err, -15);
do
{
res = fscanf(msh->hdl, "%s", str);
}while( (res != EOF) && strcmp(str, "Dimension") );
if(res == EOF)
longjmp(msh->err, -16);
safe_fscanf(msh->hdl, "%d", &msh->dim, msh->err);
}
if( (msh->dim != 2) && (msh->dim != 3) )
longjmp(msh->err, -17);
(*PtrVer) = msh->ver;
(*PtrDim) = msh->dim;
// Set default real numbers size
if(msh->ver == 1)
msh->FltSiz = 32;
else
msh->FltSiz = 64;
/*------------*/
/* KW READING */
/*------------*/
// Read the list of kw present in the file
if(!ScaKwdTab(msh))
return(0);
return(MshIdx);
}
else if(msh->mod == GmfWrite)
{
/*-----------------------*/
/* OPEN FILE FOR WRITING */
/*-----------------------*/
msh->cod = 1;
// Check if the user provided a valid version number and dimension
va_start(VarArg, mod);
msh->ver = va_arg(VarArg, int);
msh->dim = va_arg(VarArg, int);
va_end(VarArg);
if( (msh->ver < 1) || (msh->ver > 4) )
longjmp(msh->err, -18);
if( (msh->ver >= 3) && (sizeof(int64_t) != 8) )
longjmp(msh->err, -19);
if( (msh->dim != 2) && (msh->dim != 3) )
longjmp(msh->err, -20);
// Set default real numbers size
if(msh->ver == 1)
msh->FltSiz = 32;
else
msh->FltSiz = 64;
// Create the mesh file
if(msh->typ & Bin)
{
/*
* [Bruno] replaced previous call to creat():
* with a call to open(), because Windows needs the
* binary flag to be specified.
*/
#ifdef WITH_GMF_AIO
msh->FilDes = open(msh->FilNam, OPEN_WRITE_FLAGS, OPEN_WRITE_MODE);
if(msh->FilDes <= 0)
longjmp(msh->err, -21);
#else
if(!(msh->hdl = fopen(msh->FilNam, "wb")))
longjmp(msh->err, -22);
#endif
}
else if(!(msh->hdl = fopen(msh->FilNam, "wb")))
longjmp(msh->err, -23);
/*------------*/
/* KW WRITING */
/*------------*/
// Write the mesh version and dimension
if(msh->typ & Asc)
{
fprintf(msh->hdl, "%s %d\n\n",
GmfKwdFmt[ GmfVersionFormatted ][0], msh->ver);
fprintf(msh->hdl, "%s %d\n",
GmfKwdFmt[ GmfDimension ][0], msh->dim);
}
else
{
RecWrd(msh, (unsigned char *)&msh->cod);
RecWrd(msh, (unsigned char *)&msh->ver);
GmfSetKwd(MshIdx, GmfDimension, 0);
RecWrd(msh, (unsigned char *)&msh->dim);
}
return(MshIdx);
}
else
{
free(msh);
return(0);
}
} | 1285 | True | 1 |
|
CVE-2021-46225 | 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 | False | [{'url': 'https://github.com/LoicMarechal/libMeshb/commit/8cd68c54e0647c0030ae4506a225ad4a2655c316', 'name': 'https://github.com/LoicMarechal/libMeshb/commit/8cd68c54e0647c0030ae4506a225ad4a2655c316', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LoicMarechal/libMeshb/issues/21', 'name': 'https://github.com/LoicMarechal/libMeshb/issues/21', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmeshb_project:libmeshb:7.61:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A buffer overflow in the GmfOpenMesh() function of libMeshb v7.61 allows attackers to cause a Denial of Service (DoS) via a crafted MESH file.'}] | 2022-01-15T02:18Z | 2022-01-12T20:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Loïc Maréchal | 2022-01-07 14:25:30+01:00 | Removed a potential buffer overflow crash in GmfOpenMesh and debugged the test_libmeshb_block_pipeline.f that crashed | 8cd68c54e0647c0030ae4506a225ad4a2655c316 | False | LoicMarechal/libMeshb | A library to handle the *.meshb file format. | 2016-05-27 11:52:33 | 2022-08-24 12:51:44 | LoicMarechal | 34.0 | 9.0 | ScaKwdTab | ScaKwdTab( GmfMshSct * msh) | ['msh'] | static int ScaKwdTab(GmfMshSct *msh)
{
int KwdCod, c;
int64_t NexPos, EndPos, LstPos;
char str[ GmfStrSiz ];
if(msh->typ & Asc)
{
// Scan each string in the file until the end
while(fscanf(msh->hdl, "%s", str) != EOF)
{
// Fast test in order to reject quickly the numeric values
if(isalpha(str[0]))
{
// Search which kwd code this string is associated with, then get its
// header and save the curent position in file (just before the data)
for(KwdCod=1; KwdCod<= GmfMaxKwd; KwdCod++)
if(!strcmp(str, GmfKwdFmt[ KwdCod ][0]))
{
ScaKwdHdr(msh, KwdCod);
break;
}
}
else if(str[0] == '#')
while((c = fgetc(msh->hdl)) != '\n' && c != EOF);
}
}
else
{
// Get file size
EndPos = GetFilSiz(msh);
LstPos = -1;
// Jump through kwd positions in the file
do
{
// Get the kwd code and the next kwd position
ScaWrd(msh, ( char *)&KwdCod);
NexPos = GetPos(msh);
// Make sure the flow does not move beyond the file size
if(NexPos > EndPos)
longjmp(msh->err, -24);
// And check that it does not move back
if(NexPos && (NexPos <= LstPos))
longjmp(msh->err, -30);
LstPos = NexPos;
// Check if this kwd belongs to this mesh version
if( (KwdCod >= 1) && (KwdCod <= GmfMaxKwd) )
ScaKwdHdr(msh, KwdCod);
// Go to the next kwd
if(NexPos && !(SetFilPos(msh, NexPos)))
longjmp(msh->err, -25);
}while(NexPos && (KwdCod != GmfEnd));
}
return(1);
} | 273 | True | 1 |
|
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-14 23:22:09+01:00 | Added verification that image has been set in SPECTRA.cc and check on the validity of the requested tile resolution in JTL.cc. Fixes a couple of the crash conditions reported in https://github.com/ruven/iipsrv/issues/223 | 4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | JTL::send | JTL::send( Session * session , int resolution , int tile) | ['session', 'resolution', 'tile'] | void JTL::send( Session* session, int resolution, int tile ){
Timer function_timer;
if( session->loglevel >= 3 ) (*session->logfile) << "JTL handler reached" << endl;
// Make sure we have set our image
this->session = session;
checkImage();
// Time this command
if( session->loglevel >= 2 ) command_timer.start();
// If we have requested a rotation, remap the tile index to rotated coordinates
if( (int)((session->view)->getRotation()) % 360 == 90 ){
}
else if( (int)((session->view)->getRotation()) % 360 == 270 ){
}
else if( (int)((session->view)->getRotation()) % 360 == 180 ){
int num_res = (*session->image)->getNumResolutions();
unsigned int im_width = (*session->image)->image_widths[num_res-resolution-1];
unsigned int im_height = (*session->image)->image_heights[num_res-resolution-1];
unsigned int tw = (*session->image)->getTileWidth();
// unsigned int th = (*session->image)->getTileHeight();
int ntiles = (int) ceil( (double)im_width/tw ) * (int) ceil( (double)im_height/tw );
tile = ntiles - tile - 1;
}
// Sanity check
if( (resolution<0) || (tile<0) ){
ostringstream error;
error << "JTL :: Invalid resolution/tile number: " << resolution << "," << tile;
throw error.str();
}
// Determine which output encoding to use
CompressionType ct = session->view->output_format;
Compressor *compressor;
if( session->view->output_format == JPEG ) compressor = session->jpeg;
#ifdef HAVE_PNG
else if( session->view->output_format == PNG ) compressor = session->png;
#endif
else compressor = session->jpeg;
TileManager tilemanager( session->tileCache, *session->image, session->watermark, compressor, session->logfile, session->loglevel );
// First calculate histogram if we have asked for either binarization,
// histogram equalization or contrast stretching
if( session->view->requireHistogram() && (*session->image)->histogram.size()==0 ){
if( session->loglevel >= 4 ) function_timer.start();
// Retrieve an uncompressed version of our smallest tile
// which should be sufficient for calculating the histogram
RawTile thumbnail = tilemanager.getTile( 0, 0, 0, session->view->yangle, session->view->getLayers(), UNCOMPRESSED );
// Calculate histogram
(*session->image)->histogram =
session->processor->histogram( thumbnail, (*session->image)->max, (*session->image)->min );
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Calculated histogram in "
<< function_timer.getTime() << " microseconds" << endl;
}
// Insert the histogram into our image cache
const string key = (*session->image)->getImagePath();
imageCacheMapType::iterator i = session->imageCache->find(key);
if( i != session->imageCache->end() ) (i->second).histogram = (*session->image)->histogram;
}
// Request uncompressed tile if raw pixel data is required for processing
if( (*session->image)->getNumBitsPerPixel() > 8 || (*session->image)->getColourSpace() == CIELAB
|| (*session->image)->getNumChannels() == 2 || (*session->image)->getNumChannels() > 3
|| ( (session->view->colourspace==GREYSCALE || session->view->colourspace==BINARY) && (*session->image)->getNumChannels()==3 &&
(*session->image)->getNumBitsPerPixel()==8 )
|| session->view->floatProcessing() || session->view->equalization
|| session->view->getRotation() != 0.0 || session->view->flip != 0
) ct = UNCOMPRESSED;
// Set the physical output resolution for this particular view and zoom level
int num_res = (*session->image)->getNumResolutions();
unsigned int im_width = (*session->image)->image_widths[num_res-resolution-1];
unsigned int im_height = (*session->image)->image_heights[num_res-resolution-1];
float dpi_x = (*session->image)->dpi_x * (float) im_width / (float) (*session->image)->getImageWidth();
float dpi_y = (*session->image)->dpi_y * (float) im_height / (float) (*session->image)->getImageHeight();
compressor->setResolution( dpi_x, dpi_y, (*session->image)->dpi_units );
if( session->loglevel >= 5 ){
*(session->logfile) << "JTL :: Setting physical resolution of tile to " << dpi_x << " x " << dpi_y
<< ( ((*session->image)->dpi_units==1) ? " pixels/inch" : " pixels/cm" ) << endl;
}
// Embed ICC profile
if( session->view->embedICC() && ((*session->image)->getMetadata("icc").size()>0) ){
if( session->loglevel >= 3 ){
*(session->logfile) << "JTL :: Embedding ICC profile with size "
<< (*session->image)->getMetadata("icc").size() << " bytes" << endl;
}
compressor->setICCProfile( (*session->image)->getMetadata("icc") );
}
RawTile rawtile = tilemanager.getTile( resolution, tile, session->view->xangle,
session->view->yangle, session->view->getLayers(), ct );
int len = rawtile.dataLength;
if( session->loglevel >= 2 ){
*(session->logfile) << "JTL :: Tile size: " << rawtile.width << " x " << rawtile.height << endl
<< "JTL :: Channels per sample: " << rawtile.channels << endl
<< "JTL :: Bits per channel: " << rawtile.bpc << endl
<< "JTL :: Data size is " << len << " bytes" << endl;
}
// Convert CIELAB to sRGB
if( (*session->image)->getColourSpace() == CIELAB ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Converting from CIELAB->sRGB";
function_timer.start();
}
session->processor->LAB2sRGB( rawtile );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Only use our float pipeline if necessary
if( rawtile.bpc > 8 || session->view->floatProcessing() ){
// Make a copy of our max and min as we may change these
vector <float> min = (*session->image)->min;
vector <float> max = (*session->image)->max;
// Change our image max and min if we have asked for a contrast stretch
if( session->view->contrast == -1 ){
// Find first non-zero bin in histogram
unsigned int n0 = 0;
while( (*session->image)->histogram[n0] == 0 ) ++n0;
// Find highest bin
unsigned int n1 = (*session->image)->histogram.size() - 1;
while( (*session->image)->histogram[n1] == 0 ) --n1;
// Histogram has been calculated using 8 bits, so scale up to native bit depth
if( rawtile.bpc > 8 && rawtile.sampleType == FIXEDPOINT ){
n0 = n0 << (rawtile.bpc-8);
n1 = n1 << (rawtile.bpc-8);
}
min.assign( rawtile.bpc, (float)n0 );
max.assign( rawtile.bpc, (float)n1 );
// Reset our contrast
session->view->contrast = 1.0;
if( session->loglevel >= 5 ){
*(session->logfile) << "JTL :: Applying contrast stretch for image range of "
<< n0 << " - " << n1 << endl;
}
}
// Apply normalization and float conversion
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Normalizing and converting to float";
function_timer.start();
}
session->processor->normalize( rawtile, max, min );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
// Apply hill shading if requested
if( session->view->shaded ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Applying hill-shading";
function_timer.start();
}
session->processor->shade( rawtile, session->view->shade[0], session->view->shade[1] );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Apply color twist if requested
if( session->view->ctw.size() ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Applying color twist";
function_timer.start();
}
session->processor->twist( rawtile, session->view->ctw );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Apply any gamma or log transform
if( session->view->gamma != 1.0 ){
float gamma = session->view->gamma;
if( session->loglevel >= 4 ) function_timer.start();
// Check whether we have asked for logarithm
if( gamma == -1 ) session->processor->log( rawtile );
else session->processor->gamma( rawtile, gamma );
if( session->loglevel >= 4 ){
if( gamma == -1 ) *(session->logfile) << "JTL :: Applying logarithm transform in ";
else *(session->logfile) << "JTL :: Applying gamma of " << gamma << " in ";
*(session->logfile) << function_timer.getTime() << " microseconds" << endl;
}
}
// Apply inversion if requested
if( session->view->inverted ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Applying inversion";
function_timer.start();
}
session->processor->inv( rawtile );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Apply color mapping if requested
if( session->view->cmapped ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Applying color map";
function_timer.start();
}
session->processor->cmap( rawtile, session->view->cmap );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Apply any contrast adjustments and/or clip to 8bit from 16 or 32 bit
float contrast = session->view->contrast;
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Applying contrast of " << contrast << " and converting to 8 bit";
function_timer.start();
}
session->processor->contrast( rawtile, contrast );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Reduce to 1 or 3 bands if we have an alpha channel or a multi-band image and have requested a JPEG tile
// For PNG, strip extra bands if we have more than 4 present
if( ( (session->view->output_format == JPEG) && (rawtile.channels == 2 || rawtile.channels > 3) ) ||
( (session->view->output_format == PNG) && (rawtile.channels > 4) ) ){
unsigned int bands = (rawtile.channels==2) ? 1 : 3;
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Flattening channels to " << bands;
function_timer.start();
}
session->processor->flatten( rawtile, bands );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Convert to greyscale if requested
if( (*session->image)->getColourSpace() == sRGB && session->view->colourspace == GREYSCALE ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Converting to greyscale";
function_timer.start();
}
session->processor->greyscale( rawtile );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Convert to binary (bi-level) if requested
if( (*session->image)->getColourSpace() != BINARY && session->view->colourspace == BINARY ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Converting to binary with threshold ";
function_timer.start();
}
unsigned int threshold = session->processor->threshold( (*session->image)->histogram );
session->processor->binary( rawtile, threshold );
if( session->loglevel >= 4 ){
*(session->logfile) << threshold << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Apply histogram equalization
if( session->view->equalization ){
if( session->loglevel >= 4 ) function_timer.start();
// Perform histogram equalization
session->processor->equalize( rawtile, (*session->image)->histogram );
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Applying histogram equalization in "
<< function_timer.getTime() << " microseconds" << endl;
}
}
// Apply flip
if( session->view->flip != 0 ){
Timer flip_timer;
if( session->loglevel >= 5 ){
flip_timer.start();
}
session->processor->flip( rawtile, session->view->flip );
if( session->loglevel >= 5 ){
*(session->logfile) << "JTL :: Flipping image ";
if( session->view->flip == 1 ) *(session->logfile) << "horizontally";
else *(session->logfile) << "vertically";
*(session->logfile) << " in " << flip_timer.getTime() << " microseconds" << endl;
}
}
// Apply rotation - can apply this safely after gamma and contrast adjustment
if( session->view->getRotation() != 0.0 ){
float rotation = session->view->getRotation();
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Rotating image by " << rotation << " degrees";
function_timer.start();
}
session->processor->rotate( rawtile, rotation );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds" << endl;
}
}
// Compress to requested output format
if( rawtile.compressionType == UNCOMPRESSED ){
if( session->loglevel >= 4 ){
*(session->logfile) << "JTL :: Encoding UNCOMPRESSED tile";
function_timer.start();
}
len = compressor->Compress( rawtile );
if( session->loglevel >= 4 ){
*(session->logfile) << " in " << function_timer.getTime() << " microseconds to "
<< rawtile.dataLength << " bytes" << endl;
}
}
#ifndef DEBUG
// Send HTTP header
stringstream header;
header << session->response->createHTTPHeader( compressor->getMimeType(), (*session->image)->getTimestamp(), len );
if( session->out->putStr( (const char*) header.str().c_str(), header.tellp() ) == -1 ){
if( session->loglevel >= 1 ){
*(session->logfile) << "JTL :: Error writing HTTP header" << endl;
}
}
#endif
if( session->out->putStr( static_cast<const char*>(rawtile.data), len ) != len ){
if( session->loglevel >= 1 ){
*(session->logfile) << "JTL :: Error writing JPEG tile" << endl;
}
}
if( session->out->flush() == -1 ) {
if( session->loglevel >= 1 ){
*(session->logfile) << "JTL :: Error flushing JPEG tile" << endl;
}
}
// Inform our response object that we have sent something to the client
session->response->setImageSent();
// Total JTL response time
if( session->loglevel >= 2 ){
*(session->logfile) << "JTL :: Total command time " << command_timer.getTime() << " microseconds" << endl;
}
} | 2992 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-14 23:22:09+01:00 | Added verification that image has been set in SPECTRA.cc and check on the validity of the requested tile resolution in JTL.cc. Fixes a couple of the crash conditions reported in https://github.com/ruven/iipsrv/issues/223 | 4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | SPECTRA::run | SPECTRA::run( Session * session , const std :: string & argument) | ['session', 'argument'] | void SPECTRA::run( Session* session, const std::string& argument ){
/* The argument should consist of 2 comma separated values:
1) resolution
2) tile number
3) pixel index in x direction
4) pixel index in y direction
*/
if( session->loglevel >= 3 ) (*session->logfile) << "SPECTRA handler reached" << endl;
int resolution, tile, x, y;
// Time this command
if( session->loglevel >= 2 ) command_timer.start();
// Parse the argument list
string arg = argument;
int delimitter = arg.find( "," );
resolution = atoi( arg.substr(0,delimitter).c_str() );
arg = arg.substr( delimitter + 1, arg.length() );
delimitter = arg.find( "," );
tile = atoi( arg.substr(0,delimitter).c_str() );
arg = arg.substr( delimitter + 1, arg.length() );
delimitter = arg.find( "," );
x = atoi( arg.substr(0,delimitter).c_str() );
arg = arg.substr( delimitter + 1, arg.length() );
delimitter = arg.find( "," );
y = atoi( arg.substr(0,arg.length()).c_str() );
if( session->loglevel >= 5 ){
(*session->logfile) << "SPECTRA :: resolution: " << resolution
<< ", tile: " << tile
<< ", x: " << x
<< ", y: " << y << endl;
}
// Make sure our x,y coordinates are within the tile dimensions
if( x < 0 || x >= (int)(*session->image)->getTileWidth() ||
y < 0 || y >= (int)(*session->image)->getTileHeight() ){
throw invalid_argument( "SPECTRA :: Error: x,y coordinates outside of tile boundaries" );
}
TileManager tilemanager( session->tileCache, *session->image, session->watermark, session->jpeg, session->logfile, session->loglevel );
// Use our horizontal views function to get a list of available spectral images
list <int> views = (*session->image)->getHorizontalViewsList();
list <int> :: const_iterator i;
// Our list of spectral reflectance values for the requested point
list <float> spectrum;
#ifndef DEBUG
// Output our HTTP header
stringstream header;
header << session->response->createHTTPHeader( "xml", (*session->image)->getTimestamp() );
session->out->putStr( (const char*) header.str().c_str(), header.tellp() );
session->out->flush();
#endif
session->out->putS( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
session->out->putS( "<spectra>\n" );
session->out->flush();
for( i = views.begin(); i != views.end(); i++ ){
int n = *i;
RawTile rawtile = tilemanager.getTile( resolution, tile, n, session->view->yangle, session->view->getLayers(), UNCOMPRESSED );
// Make sure our x,y coordinates are within the tile dimensions
if( x >= (int)rawtile.width || y >= (int)rawtile.height ){
if( session->loglevel >= 1 ){
(*session->logfile) << "SPECTRA :: Error: x,y coordinates outside of tile boundaries" << endl;
}
break;
}
unsigned int tw = (*session->image)->getTileWidth();
unsigned int index = y*tw + x;
void *ptr;
float reflectance = 0.0;
if( session->loglevel >= 5 ) (*session->logfile) << "SPECTRA :: " << rawtile.bpc << " bits per channel data" << endl;
// Handle depending on bit depth
if( rawtile.bpc == 8 ){
ptr = (unsigned char*) (rawtile.data);
reflectance = static_cast<float>((float)((unsigned char*)ptr)[index]) / 255.0;
}
else if( rawtile.bpc == 16 ){
ptr = (unsigned short*) (rawtile.data);
reflectance = static_cast<float>((float)((unsigned short*)ptr)[index]) / 65535.0;
}
else if( rawtile.bpc == 32 ){
if( rawtile.sampleType == FIXEDPOINT ) {
ptr = (unsigned int*) rawtile.data;
reflectance = static_cast<float>((float)((unsigned int*)ptr)[index]);
}
else {
ptr = (float*) rawtile.data;
reflectance = static_cast<float>((float)((float*)ptr)[index]);
}
}
spectrum.push_front( reflectance );
string metadata = (*session->image)->getMetadata( "subject" );
char tmp[1024];
snprintf( tmp, 1024, "\t<point>\n\t\t<wavelength>%d</wavelength>\n\t\t<reflectance>%f</reflectance>\n\t</point>\n", n, reflectance );
session->out->putS( tmp );
session->out->flush();
if( session->loglevel >= 3 ) (*session->logfile) << "SPECTRA :: Band: " << n << ", reflectance: " << reflectance << endl;
}
session->out->putS( "</spectra>" );
if( session->out->flush() == -1 ) {
if( session->loglevel >= 1 ){
*(session->logfile) << "SPECTRA :: Error flushing XML" << endl;
}
}
// Inform our response object that we have sent something to the client
session->response->setImageSent();
// Total SPECTRA response time
if( session->loglevel >= 2 ){
*(session->logfile) << "SPECTRA :: Total command time " << command_timer.getTime() << " microseconds" << endl;
}
} | 1010 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-16 14:34:07+01:00 | - Modified TileManager.cc to verify that malloc() has correctly allocated memory.
- Updated numerical types to std::size_t in RawTile.h, TileManager.cc, KakaduImage.cc, OpenJPEG.cc and Transforms.cc when allocating memory via new to avoid integer overflow - fixes remaining problems identified in https://github.com/ruven/iipsrv/issues/223. | 882925b295a80ec992063deffc2a3b0d803c3195 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | KakaduImage::getRegion | KakaduImage::getRegion( int seq , int ang , unsigned int res , int layers , int x , int y , unsigned int w , unsigned int h) | ['seq', 'ang', 'res', 'layers', 'x', 'y', 'w', 'h'] | RawTile KakaduImage::getRegion( int seq, int ang, unsigned int res, int layers, int x, int y, unsigned int w, unsigned int h )
{
// Scale up our output bit depth to the nearest factor of 8
unsigned int obpc = bpc;
if( bpc <= 16 && bpc > 8 ) obpc = 16;
else if( bpc <= 8 ) obpc = 8;
#ifdef DEBUG
Timer timer;
timer.start();
#endif
RawTile rawtile( 0, res, seq, ang, w, h, channels, obpc );
if( obpc == 16 ) rawtile.data = new unsigned short[w*h*channels];
else if( obpc == 8 ) rawtile.data = new unsigned char[w*h*channels];
else throw file_error( "Kakadu :: Unsupported number of bits" );
rawtile.dataLength = w*h*channels*(obpc/8);
rawtile.filename = getImagePath();
rawtile.timestamp = timestamp;
process( res, layers, x, y, w, h, rawtile.data );
#ifdef DEBUG
logfile << "Kakadu :: getRegion() :: " << timer.getTime() << " microseconds" << endl;
#endif
return rawtile;
} | 213 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-16 14:34:07+01:00 | - Modified TileManager.cc to verify that malloc() has correctly allocated memory.
- Updated numerical types to std::size_t in RawTile.h, TileManager.cc, KakaduImage.cc, OpenJPEG.cc and Transforms.cc when allocating memory via new to avoid integer overflow - fixes remaining problems identified in https://github.com/ruven/iipsrv/issues/223. | 882925b295a80ec992063deffc2a3b0d803c3195 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | OpenJPEGImage::getRegion | OpenJPEGImage::getRegion( int ha , int va , unsigned int res , int layers , int x , int y , unsigned int w , unsigned int h) | ['ha', 'va', 'res', 'layers', 'x', 'y', 'w', 'h'] | RawTile OpenJPEGImage::getRegion( int ha, int va, unsigned int res, int layers, int x, int y, unsigned int w, unsigned int h ){
// Scale up our output bit depth to the nearest factor of 8
unsigned int obpc = bpc;
if( bpc <= 16 && bpc > 8 ) obpc = 16;
else if( bpc <= 8 ) obpc = 8;
#ifdef DEBUG
Timer timer;
timer.start();
#endif
RawTile rawtile( 0, res, ha, va, w, h, channels, obpc );
if( obpc == 16 ) rawtile.data = new unsigned short[w * h * channels];
else if( obpc == 8 ) rawtile.data = new unsigned char[w * h * channels];
else throw file_error( "OpenJPEG :: Unsupported number of bits" );
rawtile.dataLength = w*h*channels*(obpc/8);
rawtile.filename = getImagePath();
rawtile.timestamp = timestamp;
process( res, layers, x, y, w, h, rawtile.data );
#ifdef DEBUG
logfile << "OpenJPEG :: getRegion() :: " << timer.getTime() << " microseconds" << endl;
#endif
return rawtile;
} | 213 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-16 14:34:07+01:00 | - Modified TileManager.cc to verify that malloc() has correctly allocated memory.
- Updated numerical types to std::size_t in RawTile.h, TileManager.cc, KakaduImage.cc, OpenJPEG.cc and Transforms.cc when allocating memory via new to avoid integer overflow - fixes remaining problems identified in https://github.com/ruven/iipsrv/issues/223. | 882925b295a80ec992063deffc2a3b0d803c3195 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | TileManager::crop | TileManager::crop( RawTile * ttt) | ['ttt'] | void TileManager::crop( RawTile *ttt ){
int tw = image->getTileWidth();
int th = image->getTileHeight();
if( loglevel >= 5 ){
*logfile << "TileManager :: Edge tile: Base size: " << tw << "x" << th
<< ": This tile: " << ttt->width << "x" << ttt->height
<< endl;
}
// Create a new buffer, fill it with the old data, then copy
// back the cropped part into the RawTile buffer
int len = tw * th * ttt->channels * (ttt->bpc/8);
unsigned char* buffer = (unsigned char*) malloc( len );
unsigned char* src_ptr = (unsigned char*) memcpy( buffer, ttt->data, len );
unsigned char* dst_ptr = (unsigned char*) ttt->data;
// Copy one scanline at a time
len = ttt->width * ttt->channels * (ttt->bpc/8);
for( unsigned int i=0; i<ttt->height; i++ ){
memcpy( dst_ptr, src_ptr, len );
dst_ptr += len;
src_ptr += tw * ttt->channels * (ttt->bpc/8);
}
free( buffer );
// Reset the data length
len = ttt->width * ttt->height * ttt->channels * (ttt->bpc/8);
ttt->dataLength = len;
ttt->padded = false;
} | 244 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-16 14:34:07+01:00 | - Modified TileManager.cc to verify that malloc() has correctly allocated memory.
- Updated numerical types to std::size_t in RawTile.h, TileManager.cc, KakaduImage.cc, OpenJPEG.cc and Transforms.cc when allocating memory via new to avoid integer overflow - fixes remaining problems identified in https://github.com/ruven/iipsrv/issues/223. | 882925b295a80ec992063deffc2a3b0d803c3195 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | TileManager::getRegion | TileManager::getRegion( unsigned int res , int seq , int ang , int layers , unsigned int x , unsigned int y , unsigned int width , unsigned int height) | ['res', 'seq', 'ang', 'layers', 'x', 'y', 'width', 'height'] | RawTile TileManager::getRegion( unsigned int res, int seq, int ang, int layers, unsigned int x, unsigned int y, unsigned int width, unsigned int height ){
// If our image type can directly handle region compositing, simply return that
if( image->regionDecoding() ){
if( loglevel >= 3 ){
*logfile << "TileManager getRegion :: requesting region directly from image" << endl;
}
return image->getRegion( seq, ang, res, layers, x, y, width, height );
}
// Otherwise do the compositing ourselves
// The tile size of the source tile
unsigned int src_tile_width = image->getTileWidth();
unsigned int src_tile_height = image->getTileHeight();
// The tile size of the destination tile
unsigned int dst_tile_width = src_tile_width;
unsigned int dst_tile_height = src_tile_height;
// The basic tile size ie. not the current tile
unsigned int basic_tile_width = src_tile_width;
unsigned int basic_tile_height = src_tile_height;
int num_res = image->getNumResolutions();
unsigned int im_width = image->image_widths[num_res-res-1];
unsigned int im_height = image->image_heights[num_res-res-1];
unsigned int rem_x = im_width % src_tile_width;
unsigned int rem_y = im_height % src_tile_height;
// The number of tiles in each direction
unsigned int ntlx = (im_width / src_tile_width) + (rem_x == 0 ? 0 : 1);
unsigned int ntly = (im_height / src_tile_height) + (rem_y == 0 ? 0 : 1);
// Start and end tiles and pixel offsets
unsigned int startx, endx, starty, endy, xoffset, yoffset;
if( ! ( x==0 && y==0 && width==im_width && height==im_height ) ){
// Calculate the start tiles
startx = (unsigned int) ( x / src_tile_width );
starty = (unsigned int) ( y / src_tile_height );
xoffset = x % src_tile_width;
yoffset = y % src_tile_height;
endx = (unsigned int) ceil( (float)(width + x) / (float)src_tile_width );
endy = (unsigned int) ceil( (float)(height + y) / (float)src_tile_height );
if( loglevel >= 3 ){
*logfile << "TileManager getRegion :: Total tiles in image: " << ntlx << "x" << ntly << " tiles" << endl
<< "TileManager getRegion :: Tile start: " << startx << "," << starty << " with offset: "
<< xoffset << "," << yoffset << endl
<< "TileManager getRegion :: Tile end: " << endx-1 << "," << endy-1 << endl;
}
}
else{
startx = starty = xoffset = yoffset = 0;
endx = ntlx;
endy = ntly;
}
unsigned int channels = image->getNumChannels();
unsigned int bpc = image->getNumBitsPerPixel();
SampleType sampleType = image->getSampleType();
// Assume 1 bit data has been unpacked to 8 bits per channel
if( bpc == 1 ) bpc = 8;
// Create an empty tile with the correct dimensions
RawTile region( 0, res, seq, ang, width, height, channels, bpc );
region.dataLength = width * height * channels * (bpc/8);
region.sampleType = sampleType;
// Allocate memory for the region
if( bpc == 8 ) region.data = new unsigned char[width*height*channels];
else if( bpc == 16 ) region.data = new unsigned short[width*height*channels];
else if( bpc == 32 && sampleType == FIXEDPOINT ) region.data = new int[width*height*channels];
else if( bpc == 32 && sampleType == FLOATINGPOINT ) region.data = new float[width*height*channels];
unsigned int current_height = 0;
// Decode the image strip by strip
for( unsigned int i=starty; i<endy; i++ ){
unsigned int buffer_index = 0;
// Keep track of the current pixel boundary horizontally. ie. only up
// to the beginning of the current tile boundary.
unsigned int current_width = 0;
for( unsigned int j=startx; j<endx; j++ ){
// Time the tile retrieval
if( loglevel >= 3 ) tile_timer.start();
// Get an uncompressed tile
RawTile rawtile = this->getTile( res, (i*ntlx) + j, seq, ang, layers, UNCOMPRESSED );
if( loglevel >= 5 ){
*logfile << "TileManager getRegion :: Tile access time " << tile_timer.getTime() << " microseconds for tile "
<< (i*ntlx) + j << " at resolution " << res << endl;
}
// Only print this out once per image
if( (loglevel >= 5) && (i==starty) && (j==starty) ){
*logfile << "TileManager getRegion :: Tile data is " << rawtile.channels << " channels, "
<< rawtile.bpc << " bits per channel" << endl;
}
// Set the tile width and height to be that of the source tile - Use the rawtile data
// because if we take a tile from cache the image pointer will not necessarily be pointing
// to the the current tile
src_tile_width = rawtile.width;
src_tile_height = rawtile.height;
dst_tile_width = src_tile_width;
dst_tile_height = src_tile_height;
// Variables for the pixel offset within the current tile
unsigned int xf = 0;
unsigned int yf = 0;
// If our viewport has been set, we need to modify our start
// and end points on the source image
if( !( x==0 && y==0 && width==im_width && height==im_height ) ){
unsigned int remainder; // Remaining pixels in the final row or column
if( j == startx ){
// Calculate the width used in the current tile
// If there is only 1 tile, the width is just the view width
if( j < endx - 1 ) dst_tile_width = src_tile_width - xoffset;
else dst_tile_width = width;
xf = xoffset;
}
else if( j == endx-1 ){
// If this is the final row, calculate the remaining number of pixels
remainder = (width+x) % basic_tile_width;
if( remainder != 0 ) dst_tile_width = remainder;
}
if( i == starty ){
// Calculate the height used in the current row of tiles
// If there is only 1 row the height is just the view height
if( i < endy - 1 ) dst_tile_height = src_tile_height - yoffset;
else dst_tile_height = height;
yf = yoffset;
}
else if( i == endy-1 ){
// If this is the final row, calculate the remaining number of pixels
remainder = (height+y) % basic_tile_height;
if( remainder != 0 ) dst_tile_height = remainder;
}
if( loglevel >= 5 ){
*logfile << "TileManager getRegion :: destination tile width: " << dst_tile_width
<< ", tile height: " << dst_tile_height << endl;
}
}
// Copy our tile data into the appropriate part of the strip memory
// one whole tile width at a time
for( unsigned int k=0; k<dst_tile_height; k++ ){
buffer_index = (current_width*channels) + (k*width*channels) + (current_height*width*channels);
unsigned int inx = ((k+yf)*rawtile.width*channels) + (xf*channels);
// Simply copy the line of data across
if( bpc == 8 ){
unsigned char* ptr = (unsigned char*) rawtile.data;
unsigned char* buf = (unsigned char*) region.data;
memcpy( &buf[buffer_index], &ptr[inx], dst_tile_width*channels );
}
else if( bpc == 16 ){
unsigned short* ptr = (unsigned short*) rawtile.data;
unsigned short* buf = (unsigned short*) region.data;
memcpy( &buf[buffer_index], &ptr[inx], dst_tile_width*channels*2 );
}
else if( bpc == 32 && sampleType == FIXEDPOINT ){
unsigned int* ptr = (unsigned int*) rawtile.data;
unsigned int* buf = (unsigned int*) region.data;
memcpy( &buf[buffer_index], &ptr[inx], dst_tile_width*channels*4 );
}
else if( bpc == 32 && sampleType == FLOATINGPOINT ){
float* ptr = (float*) rawtile.data;
float* buf = (float*) region.data;
memcpy( &buf[buffer_index], &ptr[inx], dst_tile_width*channels*4 );
}
}
current_width += dst_tile_width;
}
current_height += dst_tile_height;
}
return region;
} | 1309 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-16 14:34:07+01:00 | - Modified TileManager.cc to verify that malloc() has correctly allocated memory.
- Updated numerical types to std::size_t in RawTile.h, TileManager.cc, KakaduImage.cc, OpenJPEG.cc and Transforms.cc when allocating memory via new to avoid integer overflow - fixes remaining problems identified in https://github.com/ruven/iipsrv/issues/223. | 882925b295a80ec992063deffc2a3b0d803c3195 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | Transform::interpolate_bilinear | Transform::interpolate_bilinear( RawTile & in , unsigned int resampled_width , unsigned int resampled_height) | ['in', 'resampled_width', 'resampled_height'] | void Transform::interpolate_bilinear( RawTile& in, unsigned int resampled_width, unsigned int resampled_height ){
// Pointer to input buffer
unsigned char *input = (unsigned char*) in.data;
int channels = in.channels;
unsigned int width = in.width;
unsigned int height = in.height;
// Define a max index position on the input buffer
unsigned long max = ( (width*height) - 1 ) * channels;
// Create new buffer and pointer for our output - make sure we have enough digits via unsigned long long
unsigned char *output = new unsigned char[(unsigned long long)resampled_width*resampled_height*channels];
// Calculate our scale
float xscale = (float)(width) / (float)resampled_width;
float yscale = (float)(height) / (float)resampled_height;
// Do not parallelize for small images (256x256 pixels) as this can be slower that single threaded
#if defined(__ICC) || defined(__INTEL_COMPILER)
#pragma ivdep
#elif defined(_OPENMP)
#pragma omp parallel for if( resampled_width*resampled_height > PARALLEL_THRESHOLD )
#endif
for( unsigned int j=0; j<resampled_height; j++ ){
// Index to the current pyramid resolution's top left pixel
int jj = (int) floor( j*yscale );
// Calculate some weights - do this in the highest loop possible
float jscale = j*yscale;
float c = (float)(jj+1) - jscale;
float d = jscale - (float)jj;
for( unsigned int i=0; i<resampled_width; i++ ){
// Index to the current pyramid resolution's top left pixel
int ii = (int) floor( i*xscale );
// Calculate the indices of the 4 surrounding pixels
unsigned long p11, p12, p21, p22;
unsigned long jj_w = jj*width;
p11 = (unsigned long) ( channels * ( ii + jj_w ) );
p12 = (unsigned long) ( channels * ( ii + (jj_w+width) ) );
p21 = (unsigned long) ( channels * ( (ii+1) + jj_w ) );
p22 = (unsigned long) ( channels * ( (ii+1) + (jj_w+width) ) );
// Make sure we don't stray outside our input buffer boundary
// - replicate at the edge
p12 = (p12<=max)? p12 : max;
p21 = (p21<=max)? p21 : max;
p22 = (p22<=max)? p22 : max;
// Calculate the rest of our weights
float iscale = i*xscale;
float a = (float)(ii+1) - iscale;
float b = iscale - (float)ii;
// Output buffer index
unsigned long long resampled_index = (unsigned long long)( (j*resampled_width + i) * channels );
for( int k=0; k<channels; k++ ){
float tx = input[p11+k]*a + input[p21+k]*b;
float ty = input[p12+k]*a + input[p22+k]*b;
unsigned char r = (unsigned char)( c*tx + d*ty );
output[resampled_index+k] = r;
}
}
}
// Delete original buffer
delete[] (unsigned char*) input;
// Correctly set our Rawtile info
in.width = resampled_width;
in.height = resampled_height;
in.dataLength = resampled_width * resampled_height * channels * (in.bpc/8);
in.data = output;
} | 531 | True | 1 |
CVE-2021-46389 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'name': 'https://github.com/ruven/iipsrv/commit/4ed59265fbbd636dc2fbbf325f8ea37ed300a6d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'name': 'https://github.com/ruven/iipsrv/commit/882925b295a80ec992063deffc2a3b0d803c3195', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:high_resolution_streaming_image_server_project:high_resolution_streaming_image_server:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-01-14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'IIPImage High Resolution Streaming Image Server prior to commit 882925b295a80ec992063deffc2a3b0d803c3195 is affected by an integer overflow in iipsrv.fcgi through malformed HTTP query parameters.'}] | 2022-02-10T21:02Z | 2022-02-07T14:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | ruven | 2022-01-16 14:34:07+01:00 | - Modified TileManager.cc to verify that malloc() has correctly allocated memory.
- Updated numerical types to std::size_t in RawTile.h, TileManager.cc, KakaduImage.cc, OpenJPEG.cc and Transforms.cc when allocating memory via new to avoid integer overflow - fixes remaining problems identified in https://github.com/ruven/iipsrv/issues/223. | 882925b295a80ec992063deffc2a3b0d803c3195 | False | ruven/iipsrv | iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images. | 2012-09-19 13:48:28 | 2022-08-26 16:47:00 | https://iipimage.sourceforge.io | ruven | 241.0 | 108.0 | Transform::interpolate_nearestneighbour | Transform::interpolate_nearestneighbour( RawTile & in , unsigned int resampled_width , unsigned int resampled_height) | ['in', 'resampled_width', 'resampled_height'] | void Transform::interpolate_nearestneighbour( RawTile& in, unsigned int resampled_width, unsigned int resampled_height ){
// Pointer to input buffer
unsigned char *input = (unsigned char*) in.data;
int channels = in.channels;
unsigned int width = in.width;
unsigned int height = in.height;
// Pointer to output buffer
unsigned char *output;
// Create new buffer if size is larger than input size
bool new_buffer = false;
if( resampled_width*resampled_height > in.width*in.height ){
new_buffer = true;
output = new unsigned char[(unsigned long long)resampled_width*resampled_height*in.channels];
}
else output = (unsigned char*) in.data;
// Calculate our scale
float xscale = (float)width / (float)resampled_width;
float yscale = (float)height / (float)resampled_height;
for( unsigned int j=0; j<resampled_height; j++ ){
for( unsigned int i=0; i<resampled_width; i++ ){
// Indexes in the current pyramid resolution and resampled spaces
// Make sure to limit our input index to the image surface
unsigned long ii = (unsigned int) floorf(i*xscale);
unsigned long jj = (unsigned int) floorf(j*yscale);
unsigned long pyramid_index = (unsigned int) channels * ( ii + jj*width );
unsigned long long resampled_index = (unsigned long long)(i + j*resampled_width)*channels;
for( int k=0; k<in.channels; k++ ){
output[resampled_index+k] = input[pyramid_index+k];
}
}
}
// Delete original buffer
if( new_buffer ) delete[] (unsigned char*) input;
// Correctly set our Rawtile info
in.width = resampled_width;
in.height = resampled_height;
in.dataLength = resampled_width * resampled_height * channels * (in.bpc/8);
in.data = output;
} | 327 | True | 1 |
CVE-2021-46463 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a40a85ff239497c6458c7dbef18f6a2736fe992', 'name': 'https://github.com/nginx/njs/commit/6a40a85ff239497c6458c7dbef18f6a2736fe992', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/447', 'name': 'https://github.com/nginx/njs/issues/447', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-843'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.7.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.1, used in NGINX, was discovered to contain a control flow hijack caused by a Type Confusion vulnerability in njs_promise_perform_then().'}] | 2022-03-24T14:31Z | 2022-02-14T22:15Z | Access of Resource Using Incompatible Type ('Type Confusion') | The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. |
When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.
| https://cwe.mitre.org/data/definitions/843.html | 0 | Dmitry Volyntsev | 2022-01-19 13:12:09+00:00 | Fixed type confusion bug while resolving promises.
Previously, the internal function njs_promise_perform_then() which
implements PerformPromiseThen() expects its first argument to always be
a promise instance. This assertion might be invalid because the
functions corresponding to Promise.prototype.then() and
Promise.resolve() incorrectly verified their arguments.
Specifically, the functions recognized their first argument as promise
if it was an object which was an Promise or had Promise object in its
prototype chain. The later condition is not correct because internal
slots are not inherited according to the spec.
This closes #447 issue in Github. | 6a40a85ff239497c6458c7dbef18f6a2736fe992 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_promise_prototype_then | njs_promise_prototype_then( njs_vm_t * vm , njs_value_t * args , njs_uint_t nargs , njs_index_t unused) | ['vm', 'args', 'nargs', 'unused'] | njs_promise_prototype_then(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
njs_int_t ret;
njs_value_t *promise, *fulfilled, *rejected, constructor;
njs_object_t *object;
njs_function_t *function;
njs_promise_capability_t *capability;
promise = njs_argument(args, 0);
if (njs_slow_path(!njs_is_object(promise))) {
goto failed;
}
object = njs_object_proto_lookup(njs_object(promise), NJS_PROMISE,
njs_object_t);
if (njs_slow_path(object == NULL)) {
goto failed;
}
function = njs_promise_create_function(vm, sizeof(njs_promise_context_t));
function->u.native = njs_promise_constructor;
njs_set_function(&constructor, function);
ret = njs_value_species_constructor(vm, promise, &constructor,
&constructor);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
capability = njs_promise_new_capability(vm, &constructor);
if (njs_slow_path(capability == NULL)) {
return NJS_ERROR;
}
fulfilled = njs_arg(args, nargs, 1);
rejected = njs_arg(args, nargs, 2);
return njs_promise_perform_then(vm, promise, fulfilled, rejected,
capability);
failed:
njs_type_error(vm, "required a promise object");
return NJS_ERROR;
} | 227 | True | 1 |
|
CVE-2021-46463 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a40a85ff239497c6458c7dbef18f6a2736fe992', 'name': 'https://github.com/nginx/njs/commit/6a40a85ff239497c6458c7dbef18f6a2736fe992', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/447', 'name': 'https://github.com/nginx/njs/issues/447', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-843'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.7.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.1, used in NGINX, was discovered to contain a control flow hijack caused by a Type Confusion vulnerability in njs_promise_perform_then().'}] | 2022-03-24T14:31Z | 2022-02-14T22:15Z | Access of Resource Using Incompatible Type ('Type Confusion') | The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. |
When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.
| https://cwe.mitre.org/data/definitions/843.html | 0 | Dmitry Volyntsev | 2022-01-19 13:12:09+00:00 | Fixed type confusion bug while resolving promises.
Previously, the internal function njs_promise_perform_then() which
implements PerformPromiseThen() expects its first argument to always be
a promise instance. This assertion might be invalid because the
functions corresponding to Promise.prototype.then() and
Promise.resolve() incorrectly verified their arguments.
Specifically, the functions recognized their first argument as promise
if it was an object which was an Promise or had Promise object in its
prototype chain. The later condition is not correct because internal
slots are not inherited according to the spec.
This closes #447 issue in Github. | 6a40a85ff239497c6458c7dbef18f6a2736fe992 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_promise_resolve | njs_promise_resolve( njs_vm_t * vm , njs_value_t * constructor , njs_value_t * x) | ['vm', 'constructor', 'x'] | njs_promise_resolve(njs_vm_t *vm, njs_value_t *constructor, njs_value_t *x)
{
njs_int_t ret;
njs_value_t value;
njs_object_t *object;
njs_promise_capability_t *capability;
static const njs_value_t string_constructor = njs_string("constructor");
if (njs_is_object(x)) {
object = njs_object_proto_lookup(njs_object(x), NJS_PROMISE,
njs_object_t);
if (object != NULL) {
ret = njs_value_property(vm, x, njs_value_arg(&string_constructor),
&value);
if (njs_slow_path(ret == NJS_ERROR)) {
return NULL;
}
if (njs_values_same(&value, constructor)) {
return njs_promise(x);
}
}
}
capability = njs_promise_new_capability(vm, constructor);
if (njs_slow_path(capability == NULL)) {
return NULL;
}
ret = njs_function_call(vm, njs_function(&capability->resolve),
&njs_value_undefined, x, 1, &value);
if (njs_slow_path(ret != NJS_OK)) {
return NULL;
}
return njs_promise(&capability->promise);
} | 192 | True | 1 |
|
CVE-2021-46462 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/nginx/njs/issues/449', 'name': 'https://github.com/nginx/njs/issues/449', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/commit/39e8fa1b7db1680654527f8fa0e9ee93b334ecba', 'name': 'https://github.com/nginx/njs/commit/39e8fa1b7db1680654527f8fa0e9ee93b334ecba', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.7.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.1, used in NGINX, was discovered to contain a segmentation violation via njs_object_set_prototype in /src/njs_object.c.'}] | 2022-03-24T14:33Z | 2022-02-14T22:15Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Dmitry Volyntsev | 2022-01-19 14:03:49+00:00 | Fixed Function.prototype.apply() with slow arrays.
Previously, the function had two issues:
* array->start was referenced without checking for fast array flag
* the created arguments list was not sanity-checked for its length,
which can be very large.
The fix is to remove micro-optimization for arrays and introduce limit
size for arguments list.
This closes #449 issue in Github. | 39e8fa1b7db1680654527f8fa0e9ee93b334ecba | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_function_prototype_apply | njs_function_prototype_apply( njs_vm_t * vm , njs_value_t * args , njs_uint_t nargs , njs_index_t unused) | ['vm', 'args', 'nargs', 'unused'] | njs_function_prototype_apply(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
int64_t i, length;
njs_int_t ret;
njs_frame_t *frame;
njs_value_t *this, *arr_like;
njs_array_t *arr;
njs_function_t *func;
if (!njs_is_function(njs_argument(args, 0))) {
njs_type_error(vm, "\"this\" argument is not a function");
return NJS_ERROR;
}
func = njs_function(njs_argument(args, 0));
this = njs_arg(args, nargs, 1);
arr_like = njs_arg(args, nargs, 2);
if (njs_is_null_or_undefined(arr_like)) {
length = 0;
goto activate;
} else if (njs_is_array(arr_like)) {
arr = arr_like->data.u.array;
args = arr->start;
length = arr->length;
goto activate;
} else if (njs_slow_path(!njs_is_object(arr_like))) {
njs_type_error(vm, "second argument is not an array-like object");
return NJS_ERROR;
}
ret = njs_object_length(vm, arr_like, &length);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
arr = njs_array_alloc(vm, 1, length, NJS_ARRAY_SPARE);
if (njs_slow_path(arr == NULL)) {
return NJS_ERROR;
}
args = arr->start;
for (i = 0; i < length; i++) {
ret = njs_value_property_i64(vm, arr_like, i, &args[i]);
if (njs_slow_path(ret == NJS_ERROR)) {
return ret;
}
}
activate:
/* Skip the "apply" method frame. */
vm->top_frame->skip = 1;
frame = (njs_frame_t *) vm->top_frame;
ret = njs_function_frame(vm, func, this, args, length, 0);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
ret = njs_function_frame_invoke(vm, frame->native.retval);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
return NJS_DECLINED;
} | 365 | True | 1 |
|
CVE-2022-25139 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'name': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/451', 'name': 'https://github.com/nginx/njs/issues/451', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.0, used in NGINX, was discovered to contain a heap use-after-free in njs_await_fulfilled.'}] | 2022-03-24T14:35Z | 2022-02-14T22: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 | Dmitry Volyntsev | 2022-01-21 14:31:30+00:00 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with consecutive recursive calls which results in
use-after-free.
This closes #451 issue on Github. | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_async_function_frame_invoke | njs_async_function_frame_invoke( njs_vm_t * vm , njs_value_t * retval) | ['vm', 'retval'] | njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval)
{
njs_int_t ret;
njs_value_t ctor;
njs_native_frame_t *frame;
njs_promise_capability_t *capability;
frame = vm->top_frame;
frame->retval = retval;
njs_set_function(&ctor, &vm->constructors[NJS_OBJ_TYPE_PROMISE]);
capability = njs_promise_new_capability(vm, &ctor);
if (njs_slow_path(capability == NULL)) {
return NJS_ERROR;
}
frame->function->context = capability;
ret = njs_function_lambda_call(vm);
if (ret == NJS_OK) {
ret = njs_function_call(vm, njs_function(&capability->resolve),
&njs_value_undefined, retval, 1, &vm->retval);
} else if (ret == NJS_AGAIN) {
ret = NJS_OK;
} else if (ret == NJS_ERROR) {
if (njs_is_memory_error(vm, &vm->retval)) {
return NJS_ERROR;
}
ret = njs_function_call(vm, njs_function(&capability->reject),
&njs_value_undefined, &vm->retval, 1,
&vm->retval);
}
*retval = capability->promise;
return ret;
} | 205 | True | 1 |
|
CVE-2022-25139 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'name': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/451', 'name': 'https://github.com/nginx/njs/issues/451', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.0, used in NGINX, was discovered to contain a heap use-after-free in njs_await_fulfilled.'}] | 2022-03-24T14:35Z | 2022-02-14T22: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 | Dmitry Volyntsev | 2022-01-21 14:31:30+00:00 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with consecutive recursive calls which results in
use-after-free.
This closes #451 issue on Github. | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_await_fulfilled | njs_await_fulfilled( njs_vm_t * vm , njs_value_t * args , njs_uint_t nargs , njs_index_t unused) | ['vm', 'args', 'nargs', 'unused'] | njs_await_fulfilled(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
njs_int_t ret;
njs_value_t **cur_local, **cur_closures, **cur_temp, *value;
njs_frame_t *frame, *async_frame;
njs_function_t *function;
njs_async_ctx_t *ctx;
njs_native_frame_t *top, *async;
ctx = vm->top_frame->function->context;
value = njs_arg(args, nargs, 1);
if (njs_is_error(value)) {
goto failed;
}
async_frame = ctx->await;
async = &async_frame->native;
async->previous = vm->top_frame;
function = async->function;
cur_local = vm->levels[NJS_LEVEL_LOCAL];
cur_closures = vm->levels[NJS_LEVEL_CLOSURE];
cur_temp = vm->levels[NJS_LEVEL_TEMP];
top = vm->top_frame;
frame = vm->active_frame;
vm->levels[NJS_LEVEL_LOCAL] = async->local;
vm->levels[NJS_LEVEL_CLOSURE] = njs_function_closures(async->function);
vm->levels[NJS_LEVEL_TEMP] = async->temp;
vm->top_frame = async;
vm->active_frame = async_frame;
*njs_scope_value(vm, ctx->index) = *value;
vm->retval = *value;
vm->top_frame->retval = &vm->retval;
function->context = ctx->capability;
function->await = ctx;
ret = njs_vmcode_interpreter(vm, ctx->pc);
function->context = NULL;
function->await = NULL;
vm->levels[NJS_LEVEL_LOCAL] = cur_local;
vm->levels[NJS_LEVEL_CLOSURE] = cur_closures;
vm->levels[NJS_LEVEL_TEMP] = cur_temp;
vm->top_frame = top;
vm->active_frame = frame;
if (ret == NJS_OK) {
ret = njs_function_call(vm, njs_function(&ctx->capability->resolve),
&njs_value_undefined, &vm->retval, 1, &vm->retval);
njs_async_context_free(vm, ctx);
} else if (ret == NJS_AGAIN) {
ret = NJS_OK;
} else if (ret == NJS_ERROR) {
if (njs_is_memory_error(vm, &vm->retval)) {
return NJS_ERROR;
}
value = &vm->retval;
goto failed;
}
return ret;
failed:
(void) njs_function_call(vm, njs_function(&ctx->capability->reject),
&njs_value_undefined, value, 1, &vm->retval);
njs_async_context_free(vm, ctx);
return NJS_ERROR;
} | 451 | True | 1 |
|
CVE-2022-25139 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'name': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/451', 'name': 'https://github.com/nginx/njs/issues/451', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.0, used in NGINX, was discovered to contain a heap use-after-free in njs_await_fulfilled.'}] | 2022-03-24T14:35Z | 2022-02-14T22: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 | Dmitry Volyntsev | 2022-01-21 14:31:30+00:00 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with consecutive recursive calls which results in
use-after-free.
This closes #451 issue on Github. | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_function_frame_invoke | njs_function_frame_invoke( njs_vm_t * vm , njs_value_t * retval) | ['vm', 'retval'] | njs_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval)
{
njs_native_frame_t *frame;
frame = vm->top_frame;
frame->retval = retval;
if (njs_function_object_type(vm, frame->function)
== NJS_OBJ_TYPE_ASYNC_FUNCTION)
{
return njs_async_function_frame_invoke(vm, retval);
}
if (frame->native) {
return njs_function_native_call(vm);
} else {
return njs_function_lambda_call(vm);
}
} | 74 | True | 1 |
|
CVE-2022-25139 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'name': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/451', 'name': 'https://github.com/nginx/njs/issues/451', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.0, used in NGINX, was discovered to contain a heap use-after-free in njs_await_fulfilled.'}] | 2022-03-24T14:35Z | 2022-02-14T22: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 | Dmitry Volyntsev | 2022-01-21 14:31:30+00:00 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with consecutive recursive calls which results in
use-after-free.
This closes #451 issue on Github. | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_function_lambda_call | njs_function_lambda_call( njs_vm_t * vm) | ['vm'] | njs_function_lambda_call(njs_vm_t *vm)
{
uint32_t n;
njs_int_t ret;
njs_frame_t *frame;
njs_value_t *args, **local, *value;
njs_value_t **cur_local, **cur_closures, **cur_temp;
njs_function_t *function;
njs_declaration_t *declr;
njs_function_lambda_t *lambda;
frame = (njs_frame_t *) vm->top_frame;
function = frame->native.function;
if (function->global && !function->closure_copied) {
ret = njs_function_capture_global_closures(vm, function);
if (njs_slow_path(ret != NJS_OK)) {
return NJS_ERROR;
}
}
lambda = function->u.lambda;
args = vm->top_frame->arguments;
local = vm->top_frame->local + function->args_offset;
/* Move all arguments. */
for (n = 0; n < function->args_count; n++) {
if (!njs_is_valid(args)) {
njs_set_undefined(args);
}
*local++ = args++;
}
/* Store current level. */
cur_local = vm->levels[NJS_LEVEL_LOCAL];
cur_closures = vm->levels[NJS_LEVEL_CLOSURE];
cur_temp = vm->levels[NJS_LEVEL_TEMP];
/* Replace current level. */
vm->levels[NJS_LEVEL_LOCAL] = vm->top_frame->local;
vm->levels[NJS_LEVEL_CLOSURE] = njs_function_closures(function);
vm->levels[NJS_LEVEL_TEMP] = frame->native.temp;
if (lambda->rest_parameters) {
ret = njs_function_rest_parameters_init(vm, &frame->native);
if (njs_slow_path(ret != NJS_OK)) {
return NJS_ERROR;
}
}
/* Self */
if (lambda->self != NJS_INDEX_NONE) {
value = njs_scope_value(vm, lambda->self);
if (!njs_is_valid(value)) {
njs_set_function(value, function);
}
}
vm->active_frame = frame;
/* Closures */
n = lambda->ndeclarations;
while (n != 0) {
n--;
declr = &lambda->declarations[n];
value = njs_scope_value(vm, declr->index);
*value = *declr->value;
function = njs_function_value_copy(vm, value);
if (njs_slow_path(function == NULL)) {
return NJS_ERROR;
}
ret = njs_function_capture_closure(vm, function, function->u.lambda);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
}
ret = njs_vmcode_interpreter(vm, lambda->start);
/* Restore current level. */
vm->levels[NJS_LEVEL_LOCAL] = cur_local;
vm->levels[NJS_LEVEL_CLOSURE] = cur_closures;
vm->levels[NJS_LEVEL_TEMP] = cur_temp;
return ret;
} | 453 | True | 1 |
|
CVE-2022-25139 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'name': 'https://github.com/nginx/njs/commit/6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/451', 'name': 'https://github.com/nginx/njs/issues/451', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'name': 'https://security.netapp.com/advisory/ntap-20220303-0007/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'njs through 0.7.0, used in NGINX, was discovered to contain a heap use-after-free in njs_await_fulfilled.'}] | 2022-03-24T14:35Z | 2022-02-14T22: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 | Dmitry Volyntsev | 2022-01-21 14:31:30+00:00 | Fixed recursive async function calls.
Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution context. As a result, function->context is
overwritten with consecutive recursive calls which results in
use-after-free.
This closes #451 issue on Github. | 6a07c2156a07ef307b6dcf3c2ca8571a5f1af7a6 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_vm_start | njs_vm_start( njs_vm_t * vm) | ['vm'] | njs_vm_start(njs_vm_t *vm)
{
njs_int_t ret;
ret = njs_module_load(vm);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
ret = njs_vmcode_interpreter(vm, vm->start);
return (ret == NJS_ERROR) ? NJS_ERROR : NJS_OK;
} | 54 | True | 1 |
|
CVE-2022-27008 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/nginx/njs/issues/471', 'name': 'https://github.com/nginx/njs/issues/471', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/commit/e673ae41a998d1391bd562edb2ed6d49db7cc716', 'name': 'https://github.com/nginx/njs/commit/e673ae41a998d1391bd562edb2ed6d49db7cc716', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220519-0008/', 'name': 'https://security.netapp.com/advisory/ntap-20220519-0008/', 'refsource': 'CONFIRM', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'nginx njs 0.7.2 is vulnerable to Buffer Overflow. Type confused in Array.prototype.concat() when a slow array appended element is fast array.'}] | 2022-05-19T20:15Z | 2022-04-14T15:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Dmitry Volyntsev | 2022-02-21 16:52:47+00:00 | Fixed Array.prototype.concat() when "this" is a slow array.
Previously, when the current appended element is fast array the "this"
array was expected to always be a fast array also. This may not be the
case when the previous appended element was not fast thus converting
the "this" array to a slow form.
Previous fix introduced in 2c1382bab643 (0.7.2) was not complete, the
correct fix is to never assume "this" is fast, whereas njs_array_add()
may only be called with fast arrays.
This closes #471 issue in Github. | e673ae41a998d1391bd562edb2ed6d49db7cc716 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_array_prototype_concat | njs_array_prototype_concat( njs_vm_t * vm , njs_value_t * args , njs_uint_t nargs , njs_index_t unused) | ['vm', 'args', 'nargs', 'unused'] | njs_array_prototype_concat(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
double idx;
int64_t k, len, length;
njs_int_t ret;
njs_uint_t i;
njs_value_t this, retval, *e;
njs_array_t *array, *keys;
ret = njs_value_to_object(vm, &args[0]);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
/* TODO: ArraySpeciesCreate(). */
array = njs_array_alloc(vm, 0, 0, NJS_ARRAY_SPARE);
if (njs_slow_path(array == NULL)) {
return NJS_ERROR;
}
njs_set_array(&this, array);
len = 0;
length = 0;
for (i = 0; i < nargs; i++) {
e = njs_argument(args, i);
ret = njs_is_concat_spreadable(vm, e);
if (njs_slow_path(ret == NJS_ERROR)) {
return NJS_ERROR;
}
if (ret == NJS_OK) {
ret = njs_object_length(vm, e, &len);
if (njs_slow_path(ret == NJS_ERROR)) {
return ret;
}
if (njs_slow_path((length + len) > NJS_MAX_LENGTH)) {
njs_type_error(vm, "Invalid length");
return NJS_ERROR;
}
if (njs_is_fast_array(e) || njs_fast_object(len)) {
for (k = 0; k < len; k++, length++) {
ret = njs_value_property_i64(vm, e, k, &retval);
if (njs_slow_path(ret != NJS_OK)) {
if (ret == NJS_ERROR) {
return NJS_ERROR;
}
njs_set_invalid(&retval);
}
ret = njs_array_add(vm, array, &retval);
if (njs_slow_path(ret != NJS_OK)) {
return NJS_ERROR;
}
}
continue;
}
keys = njs_array_indices(vm, e);
if (njs_slow_path(keys == NULL)) {
return NJS_ERROR;
}
for (k = 0; k < keys->length; k++) {
ret = njs_value_property(vm, e, &keys->start[k], &retval);
if (njs_slow_path(ret == NJS_ERROR)) {
return ret;
}
if (ret == NJS_OK) {
idx = njs_string_to_index(&keys->start[k]) + length;
ret = njs_value_property_i64_set(vm, &this, idx, &retval);
if (njs_slow_path(ret == NJS_ERROR)) {
njs_array_destroy(vm, keys);
return ret;
}
}
}
njs_array_destroy(vm, keys);
length += len;
continue;
}
if (njs_slow_path((length + len) >= NJS_MAX_LENGTH)) {
njs_type_error(vm, "Invalid length");
return NJS_ERROR;
}
ret = njs_value_property_i64_set(vm, &this, length, e);
if (njs_slow_path(ret == NJS_ERROR)) {
return ret;
}
length++;
}
ret = njs_object_length_set(vm, &this, length);
if (njs_slow_path(ret != NJS_OK)) {
return NJS_ERROR;
}
vm->retval = this;
return NJS_OK;
} | 564 | True | 1 |
|
CVE-2022-29369 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/nginx/njs/commit/222d6fdcf0c6485ec8e175f3a7b70d650c234b4e', 'name': 'https://github.com/nginx/njs/commit/222d6fdcf0c6485ec8e175f3a7b70d650c234b4e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/467', 'name': 'https://github.com/nginx/njs/issues/467', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-754'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Nginx NJS v0.7.2 was discovered to contain a segmentation violation via njs_lvlhsh_bucket_find at njs_lvlhsh.c.'}] | 2022-05-23T15:24Z | 2022-05-12T19:15Z | Improper Check for Unusual or Exceptional Conditions | The software does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software. |
The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.
| https://cwe.mitre.org/data/definitions/754.html | 0 | Dmitry Volyntsev | 2022-03-28 16:22:17+00:00 | Fixed njs_vmcode_interpreter() when "toString" conversion fails.
Previously, while interpreting a user function, njs_vmcode_interpreter()
might return prematurely when an error happens. This is not correct
because the current frame has to be unwound (or exception caught)
first.
The fix is exit through only 5 appropriate exit points to ensure
proper unwinding.
This closes #467 issue on Github. | 222d6fdcf0c6485ec8e175f3a7b70d650c234b4e | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_vmcode_interpreter | njs_vmcode_interpreter( njs_vm_t * vm , u_char * pc , void * promise_cap , void * async_ctx) | ['vm', 'pc', 'promise_cap', 'async_ctx'] | njs_vmcode_interpreter(njs_vm_t *vm, u_char *pc, void *promise_cap,
void *async_ctx)
{
u_char *catch;
double num, exponent;
int32_t i32;
uint32_t u32;
njs_str_t string;
njs_uint_t hint;
njs_bool_t valid, lambda_call;
njs_value_t *retval, *value1, *value2;
njs_value_t *src, *s1, *s2, dst;
njs_value_t *function, name;
njs_value_t numeric1, numeric2, primitive1, primitive2;
njs_frame_t *frame;
njs_jump_off_t ret;
njs_vmcode_await_t *await;
njs_native_frame_t *previous, *native;
njs_property_next_t *next;
njs_vmcode_import_t *import;
njs_vmcode_finally_t *finally;
njs_vmcode_generic_t *vmcode;
njs_vmcode_variable_t *var;
njs_vmcode_move_arg_t *move_arg;
njs_vmcode_prop_get_t *get;
njs_vmcode_prop_set_t *set;
njs_vmcode_operation_t op;
njs_vmcode_prop_next_t *pnext;
njs_vmcode_test_jump_t *test_jump;
njs_vmcode_equal_jump_t *equal;
njs_vmcode_try_return_t *try_return;
njs_vmcode_method_frame_t *method_frame;
njs_vmcode_function_copy_t *fcopy;
njs_vmcode_prop_accessor_t *accessor;
njs_vmcode_try_trampoline_t *try_trampoline;
njs_vmcode_function_frame_t *function_frame;
#ifdef NJS_OPCODE_DEBUG
njs_vmcode_debug(vm, pc, "ENTER");
#endif
next:
for ( ;; ) {
vmcode = (njs_vmcode_generic_t *) pc;
/*
* The first operand is passed as is in value2 to
* NJS_VMCODE_JUMP,
* NJS_VMCODE_IF_TRUE_JUMP,
* NJS_VMCODE_IF_FALSE_JUMP,
* NJS_VMCODE_FUNCTION_FRAME,
* NJS_VMCODE_FUNCTION_CALL,
* NJS_VMCODE_RETURN,
* NJS_VMCODE_TRY_START,
* NJS_VMCODE_TRY_CONTINUE,
* NJS_VMCODE_TRY_BREAK,
* NJS_VMCODE_TRY_END,
* NJS_VMCODE_CATCH,
* NJS_VMCODE_THROW,
* NJS_VMCODE_STOP.
*/
value2 = (njs_value_t *) vmcode->operand1;
value1 = NULL;
switch (vmcode->code.operands) {
case NJS_VMCODE_3OPERANDS:
njs_vmcode_operand(vm, vmcode->operand3, value2);
/* Fall through. */
case NJS_VMCODE_2OPERANDS:
njs_vmcode_operand(vm, vmcode->operand2, value1);
}
op = vmcode->code.operation;
/*
* On success an operation returns size of the bytecode,
* a jump offset or zero after the call or return operations.
* Jumps can return a negative offset. Compilers can generate
* (ret < 0 && ret >= NJS_PREEMPT)
* as a single unsigned comparision.
*/
#ifdef NJS_OPCODE_DEBUG
njs_disassemble(pc, NULL, 1, NULL);
#endif
if (op > NJS_VMCODE_NORET) {
if (op == NJS_VMCODE_MOVE) {
njs_vmcode_operand(vm, vmcode->operand1, retval);
*retval = *value1;
pc += sizeof(njs_vmcode_move_t);
goto next;
}
if (op == NJS_VMCODE_PROPERTY_GET) {
get = (njs_vmcode_prop_get_t *) pc;
njs_vmcode_operand(vm, get->value, retval);
ret = njs_value_property(vm, value1, value2, retval);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
pc += sizeof(njs_vmcode_prop_get_t);
goto next;
}
switch (op) {
case NJS_VMCODE_INCREMENT:
case NJS_VMCODE_POST_INCREMENT:
case NJS_VMCODE_DECREMENT:
case NJS_VMCODE_POST_DECREMENT:
if (njs_slow_path(!njs_is_numeric(value2))) {
ret = njs_value_to_numeric(vm, value2, &numeric1);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
num = njs_number(&numeric1);
} else {
num = njs_number(value2);
}
njs_set_number(value1,
num + (1 - 2 * ((op - NJS_VMCODE_INCREMENT) >> 1)));
njs_vmcode_operand(vm, vmcode->operand1, retval);
if (op & 1) {
njs_set_number(retval, num);
} else {
*retval = *value1;
}
pc += sizeof(njs_vmcode_3addr_t);
goto next;
case NJS_VMCODE_GLOBAL_GET:
get = (njs_vmcode_prop_get_t *) pc;
njs_vmcode_operand(vm, get->value, retval);
ret = njs_value_property(vm, value1, value2, retval);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
pc += sizeof(njs_vmcode_prop_get_t);
if (ret == NJS_OK) {
pc += sizeof(njs_vmcode_error_t);
}
goto next;
/*
* njs_vmcode_try_return() saves a return value to use it later by
* njs_vmcode_finally(), and jumps to the nearest try_break block.
*/
case NJS_VMCODE_TRY_RETURN:
njs_vmcode_operand(vm, vmcode->operand1, retval);
*retval = *value1;
try_return = (njs_vmcode_try_return_t *) pc;
pc += try_return->offset;
goto next;
case NJS_VMCODE_LESS:
case NJS_VMCODE_GREATER:
case NJS_VMCODE_LESS_OR_EQUAL:
case NJS_VMCODE_GREATER_OR_EQUAL:
case NJS_VMCODE_ADDITION:
if (njs_slow_path(!njs_is_primitive(value1))) {
hint = (op == NJS_VMCODE_ADDITION) && njs_is_date(value1);
ret = njs_value_to_primitive(vm, &primitive1, value1, hint);
if (ret != NJS_OK) {
goto error;
}
value1 = &primitive1;
}
if (njs_slow_path(!njs_is_primitive(value2))) {
hint = (op == NJS_VMCODE_ADDITION) && njs_is_date(value2);
ret = njs_value_to_primitive(vm, &primitive2, value2, hint);
if (ret != NJS_OK) {
goto error;
}
value2 = &primitive2;
}
if (njs_slow_path(njs_is_symbol(value1)
|| njs_is_symbol(value2)))
{
njs_symbol_conversion_failed(vm,
(op == NJS_VMCODE_ADDITION) &&
(njs_is_string(value1) || njs_is_string(value2)));
goto error;
}
njs_vmcode_operand(vm, vmcode->operand1, retval);
if (op == NJS_VMCODE_ADDITION) {
if (njs_fast_path(njs_is_numeric(value1)
&& njs_is_numeric(value2)))
{
njs_set_number(retval, njs_number(value1)
+ njs_number(value2));
pc += sizeof(njs_vmcode_3addr_t);
goto next;
}
if (njs_is_string(value1)) {
s1 = value1;
s2 = &dst;
src = value2;
} else {
s1 = &dst;
s2 = value2;
src = value1;
}
ret = njs_primitive_value_to_string(vm, &dst, src);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
ret = njs_string_concat(vm, s1, s2);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
*retval = vm->retval;
pc += ret;
goto next;
}
if ((uint8_t) (op - NJS_VMCODE_GREATER) < 2) {
/* NJS_VMCODE_GREATER, NJS_VMCODE_LESS_OR_EQUAL */
src = value1;
value1 = value2;
value2 = src;
}
ret = njs_primitive_values_compare(vm, value1, value2);
if (op < NJS_VMCODE_LESS_OR_EQUAL) {
ret = ret > 0;
} else {
ret = ret == 0;
}
njs_set_boolean(retval, ret);
pc += sizeof(njs_vmcode_3addr_t);
goto next;
case NJS_VMCODE_EQUAL:
case NJS_VMCODE_NOT_EQUAL:
ret = njs_values_equal(vm, value1, value2);
if (njs_slow_path(ret < 0)) {
goto error;
}
ret ^= op - NJS_VMCODE_EQUAL;
njs_vmcode_operand(vm, vmcode->operand1, retval);
njs_set_boolean(retval, ret);
pc += sizeof(njs_vmcode_3addr_t);
goto next;
case NJS_VMCODE_SUBSTRACTION:
case NJS_VMCODE_MULTIPLICATION:
case NJS_VMCODE_EXPONENTIATION:
case NJS_VMCODE_DIVISION:
case NJS_VMCODE_REMAINDER:
case NJS_VMCODE_BITWISE_AND:
case NJS_VMCODE_BITWISE_OR:
case NJS_VMCODE_BITWISE_XOR:
case NJS_VMCODE_LEFT_SHIFT:
case NJS_VMCODE_RIGHT_SHIFT:
case NJS_VMCODE_UNSIGNED_RIGHT_SHIFT:
if (njs_slow_path(!njs_is_numeric(value1))) {
ret = njs_value_to_numeric(vm, value1, &numeric1);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
value1 = &numeric1;
}
if (njs_slow_path(!njs_is_numeric(value2))) {
ret = njs_value_to_numeric(vm, value2, &numeric2);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
value2 = &numeric2;
}
num = njs_number(value1);
njs_vmcode_operand(vm, vmcode->operand1, retval);
pc += sizeof(njs_vmcode_3addr_t);
switch (op) {
case NJS_VMCODE_SUBSTRACTION:
num -= njs_number(value2);
break;
case NJS_VMCODE_MULTIPLICATION:
num *= njs_number(value2);
break;
case NJS_VMCODE_EXPONENTIATION:
exponent = njs_number(value2);
/*
* According to ES7:
* 1. If exponent is NaN, the result should be NaN;
* 2. The result of +/-1 ** +/-Infinity should be NaN.
*/
valid = njs_expect(1, fabs(num) != 1
|| (!isnan(exponent)
&& !isinf(exponent)));
num = valid ? pow(num, exponent) : NAN;
break;
case NJS_VMCODE_DIVISION:
num /= njs_number(value2);
break;
case NJS_VMCODE_REMAINDER:
num = fmod(num, njs_number(value2));
break;
case NJS_VMCODE_BITWISE_AND:
case NJS_VMCODE_BITWISE_OR:
case NJS_VMCODE_BITWISE_XOR:
i32 = njs_number_to_int32(njs_number(value2));
switch (op) {
case NJS_VMCODE_BITWISE_AND:
i32 &= njs_number_to_int32(num);
break;
case NJS_VMCODE_BITWISE_OR:
i32 |= njs_number_to_int32(num);
break;
case NJS_VMCODE_BITWISE_XOR:
i32 ^= njs_number_to_int32(num);
break;
}
njs_set_int32(retval, i32);
goto next;
default:
u32 = njs_number_to_uint32(njs_number(value2)) & 0x1f;
switch (op) {
case NJS_VMCODE_LEFT_SHIFT:
case NJS_VMCODE_RIGHT_SHIFT:
i32 = njs_number_to_int32(num);
if (op == NJS_VMCODE_LEFT_SHIFT) {
/* Shifting of negative numbers is undefined. */
i32 = (uint32_t) i32 << u32;
} else {
i32 >>= u32;
}
njs_set_int32(retval, i32);
break;
default: /* NJS_VMCODE_UNSIGNED_RIGHT_SHIFT */
njs_set_uint32(retval,
njs_number_to_uint32(num) >> u32);
}
goto next;
}
njs_set_number(retval, num);
goto next;
case NJS_VMCODE_OBJECT_COPY:
ret = njs_vmcode_object_copy(vm, value1, value2);
break;
case NJS_VMCODE_TEMPLATE_LITERAL:
ret = njs_vmcode_template_literal(vm, value1, value2);
break;
case NJS_VMCODE_PROPERTY_IN:
ret = njs_vmcode_property_in(vm, value1, value2);
break;
case NJS_VMCODE_PROPERTY_DELETE:
ret = njs_value_property_delete(vm, value1, value2, NULL);
if (njs_fast_path(ret != NJS_ERROR)) {
vm->retval = njs_value_true;
ret = sizeof(njs_vmcode_3addr_t);
}
break;
case NJS_VMCODE_PROPERTY_FOREACH:
ret = njs_vmcode_property_foreach(vm, value1, value2, pc);
break;
case NJS_VMCODE_STRICT_EQUAL:
case NJS_VMCODE_STRICT_NOT_EQUAL:
ret = njs_values_strict_equal(value1, value2);
ret ^= op - NJS_VMCODE_STRICT_EQUAL;
njs_vmcode_operand(vm, vmcode->operand1, retval);
njs_set_boolean(retval, ret);
pc += sizeof(njs_vmcode_3addr_t);
goto next;
case NJS_VMCODE_TEST_IF_TRUE:
case NJS_VMCODE_TEST_IF_FALSE:
case NJS_VMCODE_COALESCE:
if (op == NJS_VMCODE_COALESCE) {
ret = !njs_is_null_or_undefined(value1);
} else {
ret = njs_is_true(value1);
ret ^= op - NJS_VMCODE_TEST_IF_TRUE;
}
if (ret) {
test_jump = (njs_vmcode_test_jump_t *) pc;
ret = test_jump->offset;
} else {
ret = sizeof(njs_vmcode_3addr_t);
}
njs_vmcode_operand(vm, vmcode->operand1, retval);
*retval = *value1;
pc += ret;
goto next;
case NJS_VMCODE_UNARY_PLUS:
case NJS_VMCODE_UNARY_NEGATION:
case NJS_VMCODE_BITWISE_NOT:
if (njs_slow_path(!njs_is_numeric(value1))) {
ret = njs_value_to_numeric(vm, value1, &numeric1);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
value1 = &numeric1;
}
num = njs_number(value1);
njs_vmcode_operand(vm, vmcode->operand1, retval);
switch (op) {
case NJS_VMCODE_UNARY_NEGATION:
num = -num;
/* Fall through. */
case NJS_VMCODE_UNARY_PLUS:
njs_set_number(retval, num);
break;
case NJS_VMCODE_BITWISE_NOT:
njs_set_int32(retval, ~njs_number_to_uint32(num));
}
pc += sizeof(njs_vmcode_2addr_t);
goto next;
case NJS_VMCODE_LOGICAL_NOT:
njs_vmcode_operand(vm, vmcode->operand1, retval);
njs_set_boolean(retval, !njs_is_true(value1));
pc += sizeof(njs_vmcode_2addr_t);
goto next;
case NJS_VMCODE_OBJECT:
ret = njs_vmcode_object(vm);
break;
case NJS_VMCODE_ARRAY:
ret = njs_vmcode_array(vm, pc);
break;
case NJS_VMCODE_FUNCTION:
ret = njs_vmcode_function(vm, pc);
break;
case NJS_VMCODE_REGEXP:
ret = njs_vmcode_regexp(vm, pc);
break;
case NJS_VMCODE_INSTANCE_OF:
ret = njs_vmcode_instance_of(vm, value1, value2);
break;
case NJS_VMCODE_TYPEOF:
ret = njs_vmcode_typeof(vm, value1, value2);
break;
case NJS_VMCODE_VOID:
njs_set_undefined(&vm->retval);
ret = sizeof(njs_vmcode_2addr_t);
break;
case NJS_VMCODE_DELETE:
njs_release(vm, value1);
vm->retval = njs_value_true;
ret = sizeof(njs_vmcode_2addr_t);
break;
case NJS_VMCODE_DEBUGGER:
ret = njs_vmcode_debugger(vm);
break;
default:
njs_internal_error(vm, "%d has retval", op);
goto error;
}
if (njs_slow_path(ret < 0 && ret >= NJS_PREEMPT)) {
break;
}
njs_vmcode_operand(vm, vmcode->operand1, retval);
njs_release(vm, retval);
*retval = vm->retval;
} else {
switch (op) {
case NJS_VMCODE_MOVE_ARG:
move_arg = (njs_vmcode_move_arg_t *) pc;
native = vm->top_frame;
hint = move_arg->dst;
value1 = &native->arguments_offset[hint];
njs_vmcode_operand(vm, move_arg->src, value2);
*value1 = *value2;
ret = sizeof(njs_vmcode_move_arg_t);
break;
case NJS_VMCODE_STOP:
njs_vmcode_operand(vm, (njs_index_t) value2, value2);
vm->retval = *value2;
#ifdef NJS_OPCODE_DEBUG
njs_vmcode_debug(vm, pc, "EXIT STOP");
#endif
return NJS_OK;
case NJS_VMCODE_JUMP:
ret = (njs_jump_off_t) value2;
break;
case NJS_VMCODE_PROPERTY_SET:
set = (njs_vmcode_prop_set_t *) pc;
njs_vmcode_operand(vm, set->value, retval);
ret = njs_value_property_set(vm, value1, value2, retval);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
ret = sizeof(njs_vmcode_prop_set_t);
break;
case NJS_VMCODE_PROPERTY_ACCESSOR:
accessor = (njs_vmcode_prop_accessor_t *) pc;
njs_vmcode_operand(vm, accessor->value, function);
ret = njs_value_to_key(vm, &name, value2);
if (njs_slow_path(ret != NJS_OK)) {
njs_internal_error(vm, "failed conversion of type \"%s\" "
"to string while property define",
njs_type_string(value2->type));
goto error;
}
ret = njs_object_prop_define(vm, value1, &name, function,
accessor->type);
if (njs_slow_path(ret != NJS_OK)) {
return NJS_ERROR;
}
ret = sizeof(njs_vmcode_prop_accessor_t);
break;
case NJS_VMCODE_IF_TRUE_JUMP:
case NJS_VMCODE_IF_FALSE_JUMP:
ret = njs_is_true(value1);
ret ^= op - NJS_VMCODE_IF_TRUE_JUMP;
ret = ret ? (njs_jump_off_t) value2
: (njs_jump_off_t) sizeof(njs_vmcode_cond_jump_t);
break;
case NJS_VMCODE_IF_EQUAL_JUMP:
if (njs_values_strict_equal(value1, value2)) {
equal = (njs_vmcode_equal_jump_t *) pc;
ret = equal->offset;
} else {
ret = sizeof(njs_vmcode_3addr_t);
}
break;
case NJS_VMCODE_PROPERTY_INIT:
set = (njs_vmcode_prop_set_t *) pc;
njs_vmcode_operand(vm, set->value, retval);
ret = njs_vmcode_property_init(vm, value1, value2, retval);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
break;
case NJS_VMCODE_RETURN:
njs_vmcode_operand(vm, (njs_index_t) value2, value2);
#ifdef NJS_OPCODE_DEBUG
njs_vmcode_debug(vm, pc, "EXIT RETURN");
#endif
return njs_vmcode_return(vm, NULL, value2);
case NJS_VMCODE_FUNCTION_COPY:
fcopy = (njs_vmcode_function_copy_t *) pc;
ret = njs_vmcode_function_copy(vm, fcopy->function,
fcopy->retval);
break;
case NJS_VMCODE_FUNCTION_FRAME:
function_frame = (njs_vmcode_function_frame_t *) pc;
/* TODO: external object instead of void this. */
ret = njs_function_frame_create(vm, value1,
&njs_value_undefined,
(uintptr_t) value2,
function_frame->ctor);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
ret = sizeof(njs_vmcode_function_frame_t);
break;
case NJS_VMCODE_METHOD_FRAME:
method_frame = (njs_vmcode_method_frame_t *) pc;
ret = njs_value_property(vm, value1, value2, &dst);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
if (njs_slow_path(!njs_is_function(&dst))) {
ret = njs_value_to_key(vm, value2, value2);
if (njs_slow_path(ret != NJS_OK)) {
return NJS_ERROR;
}
njs_key_string_get(vm, value2, &string);
njs_type_error(vm,
"(intermediate value)[\"%V\"] is not a function",
&string);
goto error;
}
ret = njs_function_frame_create(vm, &dst, value1,
method_frame->nargs,
method_frame->ctor);
if (njs_slow_path(ret != NJS_OK)) {
goto error;
}
ret = sizeof(njs_vmcode_method_frame_t);
break;
case NJS_VMCODE_FUNCTION_CALL:
vm->active_frame->native.pc = pc;
njs_vmcode_operand(vm, (njs_index_t) value2, value2);
ret = njs_function_frame_invoke(vm, value2);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
ret = sizeof(njs_vmcode_function_call_t);
break;
case NJS_VMCODE_PROPERTY_NEXT:
pnext = (njs_vmcode_prop_next_t *) pc;
retval = njs_scope_value(vm, pnext->retval);
next = value2->data.u.next;
if (next->index < next->array->length) {
*retval = next->array->start[next->index++];
ret = pnext->offset;
break;
}
njs_mp_free(vm->mem_pool, next);
ret = sizeof(njs_vmcode_prop_next_t);
break;
case NJS_VMCODE_ARGUMENTS:
ret = njs_vmcode_arguments(vm, pc);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
break;
case NJS_VMCODE_PROTO_INIT:
set = (njs_vmcode_prop_set_t *) pc;
njs_vmcode_operand(vm, set->value, retval);
ret = njs_vmcode_proto_init(vm, value1, value2, retval);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
break;
case NJS_VMCODE_IMPORT:
import = (njs_vmcode_import_t *) pc;
retval = njs_scope_value(vm, import->retval);
ret = njs_vmcode_import(vm, import->module, retval);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
break;
case NJS_VMCODE_AWAIT:
await = (njs_vmcode_await_t *) pc;
#ifdef NJS_OPCODE_DEBUG
njs_vmcode_debug(vm, pc, "EXIT AWAIT");
#endif
return njs_vmcode_await(vm, await, promise_cap, async_ctx);
case NJS_VMCODE_TRY_START:
ret = njs_vmcode_try_start(vm, value1, value2, pc);
if (njs_slow_path(ret == NJS_ERROR)) {
goto error;
}
break;
case NJS_VMCODE_THROW:
njs_vmcode_operand(vm, (njs_index_t) value2, value2);
vm->retval = *value2;
goto error;
case NJS_VMCODE_TRY_BREAK:
try_trampoline = (njs_vmcode_try_trampoline_t *) pc;
value1 = njs_scope_value(vm, try_trampoline->exit_value);
ret = njs_vmcode_try_break(vm, value1, value2);
break;
case NJS_VMCODE_TRY_CONTINUE:
try_trampoline = (njs_vmcode_try_trampoline_t *) pc;
value1 = njs_scope_value(vm, try_trampoline->exit_value);
ret = njs_vmcode_try_continue(vm, value1, value2);
break;
case NJS_VMCODE_TRY_END:
ret = njs_vmcode_try_end(vm, value1, value2);
break;
/*
* njs_vmcode_catch() is set on the start of a "catch" block to
* store exception and to remove a "try" block if there is no
* "finally" block or to update a catch address to the start of
* a "finally" block.
* njs_vmcode_catch() is set on the start of a "finally" block
* to store uncaught exception and to remove a "try" block.
*/
case NJS_VMCODE_CATCH:
*value1 = vm->retval;
if ((njs_jump_off_t) value2 == sizeof(njs_vmcode_catch_t)) {
ret = njs_vmcode_try_end(vm, value1, value2);
} else {
frame = (njs_frame_t *) vm->top_frame;
frame->exception.catch = pc + (njs_jump_off_t) value2;
ret = sizeof(njs_vmcode_catch_t);
}
break;
case NJS_VMCODE_FINALLY:
finally = (njs_vmcode_finally_t *) pc;
value1 = njs_scope_value(vm, finally->exit_value);
ret = njs_vmcode_finally(vm, value1, value2, pc);
switch (ret) {
case NJS_OK:
#ifdef NJS_OPCODE_DEBUG
njs_vmcode_debug(vm, pc, "EXIT FINALLY");
#endif
return NJS_OK;
case NJS_ERROR:
goto error;
}
break;
case NJS_VMCODE_LET:
var = (njs_vmcode_variable_t *) pc;
value1 = njs_scope_value(vm, var->dst);
if (njs_is_valid(value1)) {
value1 = njs_mp_alloc(vm->mem_pool, sizeof(njs_value_t));
if (njs_slow_path(value1 == NULL)) {
return NJS_ERROR;
}
njs_scope_value_set(vm, var->dst, value1);
}
njs_set_undefined(value1);
ret = sizeof(njs_vmcode_variable_t);
break;
case NJS_VMCODE_LET_UPDATE:
var = (njs_vmcode_variable_t *) pc;
value2 = njs_scope_value(vm, var->dst);
value1 = njs_mp_alloc(vm->mem_pool, sizeof(njs_value_t));
if (njs_slow_path(value1 == NULL)) {
return NJS_ERROR;
}
*value1 = *value2;
njs_scope_value_set(vm, var->dst, value1);
ret = sizeof(njs_vmcode_variable_t);
break;
case NJS_VMCODE_INITIALIZATION_TEST:
var = (njs_vmcode_variable_t *) pc;
value1 = njs_scope_value(vm, var->dst);
if (njs_is_valid(value1)) {
ret = sizeof(njs_vmcode_variable_t);
break;
}
/* Fall through. */
case NJS_VMCODE_NOT_INITIALIZED:
njs_reference_error(vm, "cannot access variable "
"before initialization");
goto error;
case NJS_VMCODE_ERROR:
njs_vmcode_error(vm, pc);
goto error;
case NJS_VMCODE_ASSIGNMENT_ERROR:
njs_type_error(vm, "assignment to constant variable");
goto error;
default:
njs_internal_error(vm, "%d has NO retval", op);
goto error;
}
}
pc += ret;
}
error:
if (njs_is_error(&vm->retval)) {
vm->active_frame->native.pc = pc;
(void) njs_error_stack_attach(vm, &vm->retval);
}
for ( ;; ) {
native = vm->top_frame;
if (!native->native) {
frame = (njs_frame_t *) native;
catch = frame->exception.catch;
if (catch != NULL) {
pc = catch;
goto next;
}
}
previous = native->previous;
if (previous == NULL) {
break;
}
lambda_call = (native == &vm->active_frame->native);
njs_vm_scopes_restore(vm, native, previous);
if (native->size != 0) {
vm->stack_size -= native->size;
njs_mp_free(vm->mem_pool, native);
}
if (lambda_call) {
break;
}
}
#ifdef NJS_OPCODE_DEBUG
njs_vmcode_debug(vm, pc, "EXIT ERROR");
#endif
return NJS_ERROR;
} | 3822 | True | 1 |
|
CVE-2022-29379 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/nginx/njs/issues/493', 'name': 'https://github.com/nginx/njs/issues/493', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/491', 'name': 'https://github.com/nginx/njs/issues/491', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/commit/ab1702c7af9959366a5ddc4a75b4357d4e9ebdc1', 'name': 'https://github.com/nginx/njs/commit/ab1702c7af9959366a5ddc4a75b4357d4e9ebdc1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:0.7.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': '** DISPUTED ** Nginx NJS v0.7.3 was discovered to contain a stack overflow in the function njs_default_module_loader at /src/njs/src/njs_module.c. NOTE: multiple third parties dispute this report, e.g., the behavior is only found in unreleased development code that was not part of the 0.7.2, 0.7.3, or 0.7.4 release.'}] | 2022-06-03T13:58Z | 2022-05-25T13: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 | Dmitry Volyntsev | 2022-04-11 15:55:14-07:00 | Fixed typo while calculating module path length.
The issue was introduced in 77c398f26d7e (not released yet). | ab1702c7af9959366a5ddc4a75b4357d4e9ebdc1 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_module_path | njs_module_path( njs_vm_t * vm , const njs_str_t * dir , njs_module_info_t * info) | ['vm', 'dir', 'info'] | njs_module_path(njs_vm_t *vm, const njs_str_t *dir, njs_module_info_t *info)
{
char *p;
size_t length;
njs_bool_t trail;
char src[NJS_MAX_PATH + 1];
trail = 0;
length = info->name.length;
if (dir != NULL) {
length = dir->length;
if (length == 0) {
return NJS_DECLINED;
}
trail = (dir->start[dir->length - 1] != '/');
if (trail) {
length++;
}
}
if (njs_slow_path(length > NJS_MAX_PATH)) {
return NJS_ERROR;
}
p = &src[0];
if (dir != NULL) {
p = (char *) njs_cpymem(p, dir->start, dir->length);
if (trail) {
*p++ = '/';
}
}
p = (char *) njs_cpymem(p, info->name.start, info->name.length);
*p = '\0';
p = realpath(&src[0], &info->path[0]);
if (p == NULL) {
return NJS_DECLINED;
}
info->fd = open(&info->path[0], O_RDONLY);
if (info->fd < 0) {
return NJS_DECLINED;
}
info->file.start = (u_char *) &info->path[0];
info->file.length = njs_strlen(info->file.start);
return NJS_OK;
} | 283 | True | 1 |
|
CVE-2022-29780 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:N/A:P | LOCAL | LOW | NONE | NONE | NONE | PARTIAL | 2.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/nginx/njs/issues/486', 'name': 'https://github.com/nginx/njs/issues/486', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/commit/8b39afdad9a0761e0a5d4af1a762bd9a6daef572', 'name': 'https://github.com/nginx/njs/commit/8b39afdad9a0761e0a5d4af1a762bd9a6daef572', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nginx:njs:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Nginx NJS v0.7.2 was discovered to contain a segmentation violation in the function njs_array_prototype_sort at src/njs_array.c.'}] | 2022-06-09T21:00Z | 2022-06-02T14:15Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Dmitry Volyntsev | 2022-04-22 17:02:28-07:00 | Fixed Array.prototype.sort() when arr size is changed in a comparator.
This fixed #468 issue on Github. | 8b39afdad9a0761e0a5d4af1a762bd9a6daef572 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_array_prototype_sort | njs_array_prototype_sort( njs_vm_t * vm , njs_value_t * args , njs_uint_t nargs , njs_index_t unused) | ['vm', 'args', 'nargs', 'unused'] | njs_array_prototype_sort(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t unused)
{
int64_t i, und, len, nlen, length;
njs_int_t ret, fast_path;
njs_array_t *array;
njs_value_t *this, *comparefn, *start, *strings;
njs_array_sort_ctx_t ctx;
njs_array_sort_slot_t *p, *end, *slots, *nslots;
comparefn = njs_arg(args, nargs, 1);
if (njs_is_defined(comparefn)) {
if (njs_slow_path(!njs_is_function(comparefn))) {
njs_type_error(vm, "comparefn must be callable or undefined");
return NJS_ERROR;
}
ctx.function = njs_function(comparefn);
} else {
ctx.function = NULL;
}
this = njs_argument(args, 0);
ret = njs_value_to_object(vm, this);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
ret = njs_value_length(vm, this, &length);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
if (njs_slow_path(length < 2)) {
vm->retval = *this;
return NJS_OK;
}
slots = NULL;
ctx.vm = vm;
ctx.strings.separate = 0;
ctx.strings.pointer = 0;
ctx.exception = 0;
fast_path = njs_is_fast_array(this);
if (njs_fast_path(fast_path)) {
array = njs_array(this);
start = array->start;
slots = njs_mp_alloc(vm->mem_pool,
sizeof(njs_array_sort_slot_t) * length);
if (njs_slow_path(slots == NULL)) {
return NJS_ERROR;
}
und = 0;
p = slots;
for (i = 0; i < length; i++) {
if (njs_slow_path(!njs_is_valid(&start[i]))) {
fast_path = 0;
njs_mp_free(vm->mem_pool, slots);
slots = NULL;
goto slow_path;
}
if (njs_slow_path(njs_is_undefined(&start[i]))) {
und++;
continue;
}
p->value = start[i];
p->pos = i;
p->str = NULL;
p++;
}
len = p - slots;
} else {
slow_path:
und = 0;
p = NULL;
end = NULL;
for (i = 0; i < length; i++) {
if (p >= end) {
nlen = njs_min(njs_max((p - slots) * 2, 8), length);
nslots = njs_mp_alloc(vm->mem_pool,
sizeof(njs_array_sort_slot_t) * nlen);
if (njs_slow_path(nslots == NULL)) {
njs_memory_error(vm);
return NJS_ERROR;
}
if (slots != NULL) {
p = (void *) njs_cpymem(nslots, slots,
sizeof(njs_array_sort_slot_t) * (p - slots));
njs_mp_free(vm->mem_pool, slots);
} else {
p = nslots;
}
slots = nslots;
end = slots + nlen;
}
ret = njs_value_property_i64(vm, this, i, &p->value);
if (njs_slow_path(ret == NJS_ERROR)) {
ret = NJS_ERROR;
goto exception;
}
if (ret == NJS_DECLINED) {
continue;
}
if (njs_is_undefined(&p->value)) {
und++;
continue;
}
p->pos = i;
p->str = NULL;
p++;
}
len = p - slots;
}
strings = njs_arr_init(vm->mem_pool, &ctx.strings, NULL, len + 1,
sizeof(njs_value_t));
if (njs_slow_path(strings == NULL)) {
ret = NJS_ERROR;
goto exception;
}
njs_qsort(slots, len, sizeof(njs_array_sort_slot_t), njs_array_compare,
&ctx);
if (ctx.exception) {
ret = NJS_ERROR;
goto exception;
}
if (njs_fast_path(fast_path)) {
array = njs_array(this);
start = array->start;
for (i = 0; i < len; i++) {
start[i] = slots[i].value;
}
for (i = len; und-- > 0; i++) {
start[i] = njs_value_undefined;
}
} else {
for (i = 0; i < len; i++) {
if (slots[i].pos != i) {
ret = njs_value_property_i64_set(vm, this, i, &slots[i].value);
if (njs_slow_path(ret == NJS_ERROR)) {
goto exception;
}
}
}
for (i = len; und-- > 0; i++) {
ret = njs_value_property_i64_set(vm, this, i,
njs_value_arg(&njs_value_undefined));
if (njs_slow_path(ret == NJS_ERROR)) {
goto exception;
}
}
for (; i < length; i++) {
ret = njs_value_property_i64_delete(vm, this, i, NULL);
if (njs_slow_path(ret == NJS_ERROR)) {
goto exception;
}
}
}
vm->retval = *this;
ret = NJS_OK;
exception:
if (slots != NULL) {
njs_mp_free(vm->mem_pool, slots);
}
njs_arr_destroy(&ctx.strings);
return ret;
} | 982 | True | 1 |