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-22549 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/google/asylo/commit/ecfcd0008b6f8f63c6fa3cc1b62fcd4a52f2c0ad', 'name': 'https://github.com/google/asylo/commit/ecfcd0008b6f8f63c6fa3cc1b62fcd4a52f2c0ad', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:asylo:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.6.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An attacker can modify the address to point to trusted memory to overwrite arbitrary trusted memory. It is recommended to update past 0.6.2 or git commit https://github.com/google/asylo/commit/53ed5d8fd8118ced1466e509606dd2f473707a5c'}] | 2021-06-22T15:10Z | 2021-06-08T14:15Z | Exposure of Resource to Wrong Sphere | The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. |
Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
In either case, the end result is that a resource has been exposed to the wrong party.
| https://cwe.mitre.org/data/definitions/668.html | 0 | Chong Cai | 2021-03-12 10:43:12-08:00 | Store untrusted input to enclave variable
The untrusted input pointer should be stored to trusted variable before
checking to avoid unexpected modifications after checking.
PiperOrigin-RevId: 362553830
Change-Id: I743f9bd3487de60269e247d74f2188f2ffc06d01 | ecfcd0008b6f8f63c6fa3cc1b62fcd4a52f2c0ad | False | google/asylo | An open and flexible framework for developing enclave applications | 2018-04-25 16:43:56 | 2022-04-12 20:00:07 | https://asylo.dev | google | 915.0 | 125.0 | asylo::primitives::TrustedPrimitives::UntrustedCall | asylo::primitives::TrustedPrimitives::UntrustedCall( uint64_t untrusted_selector , MessageWriter * input , MessageReader * output) | ['untrusted_selector', 'input', 'output'] | PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector,
MessageWriter *input,
MessageReader *output) {
int ret;
UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance();
SgxParams *const sgx_params =
reinterpret_cast<SgxParams *>(untrusted_cache->Malloc(sizeof(SgxParams)));
if (!TrustedPrimitives::IsOutsideEnclave(sgx_params, sizeof(SgxParams))) {
TrustedPrimitives::BestEffortAbort(
"UntrustedCall: sgx_param should be in untrusted memory");
}
Cleanup clean_up(
[sgx_params, untrusted_cache] { untrusted_cache->Free(sgx_params); });
sgx_params->input_size = 0;
sgx_params->input = nullptr;
if (input) {
sgx_params->input_size = input->MessageSize();
if (sgx_params->input_size > 0) {
// Allocate and copy data to |input_buffer|.
sgx_params->input = untrusted_cache->Malloc(sgx_params->input_size);
if (!TrustedPrimitives::IsOutsideEnclave(sgx_params->input,
sgx_params->input_size)) {
TrustedPrimitives::BestEffortAbort(
"UntrustedCall: sgx_param input should be in untrusted memory");
}
input->Serialize(const_cast<void *>(sgx_params->input));
}
}
sgx_params->output_size = 0;
sgx_params->output = nullptr;
CHECK_OCALL(
ocall_dispatch_untrusted_call(&ret, untrusted_selector, sgx_params));
if (sgx_params->input) {
untrusted_cache->Free(const_cast<void *>(sgx_params->input));
}
if (!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,
sgx_params->output_size)) {
TrustedPrimitives::BestEffortAbort(
"UntrustedCall: sgx_param output should be in untrusted memory");
}
if (sgx_params->output) {
// For the results obtained in |output_buffer|, copy them to |output|
// before freeing the buffer.
output->Deserialize(sgx_params->output, sgx_params->output_size);
TrustedPrimitives::UntrustedLocalFree(sgx_params->output);
}
return PrimitiveStatus::OkStatus();
} | 298 | True | 1 |
CVE-2021-22548 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/google/asylo/commit/53ed5d8fd8118ced1466e509606dd2f473707a5c', 'name': 'https://github.com/google/asylo/commit/53ed5d8fd8118ced1466e509606dd2f473707a5c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:google:asylo:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.6.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An attacker can change the pointer to untrusted memory to point to trusted memory region which causes copying trusted memory to trusted memory, if the latter is later copied out, it allows for reading of memory regions from the trusted region. It is recommended to update past 0.6.2 or git commit https://github.com/google/asylo/commit/53ed5d8fd8118ced1466e509606dd2f473707a5c'}] | 2021-06-17T16:09Z | 2021-06-08T14: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 | Chong Cai | 2021-03-29 13:17:26-07:00 | Store untrusted output pointer in enclave
Validate the pointer after it's stored in enclave to avoid unexpected
modifications after it's validated.
PiperOrigin-RevId: 365648810
Change-Id: I3079128040c142e86bab8255b07d03562a6fcb61 | 53ed5d8fd8118ced1466e509606dd2f473707a5c | False | google/asylo | An open and flexible framework for developing enclave applications | 2018-04-25 16:43:56 | 2022-04-12 20:00:07 | https://asylo.dev | google | 915.0 | 125.0 | asylo::primitives::TrustedPrimitives::UntrustedCall | asylo::primitives::TrustedPrimitives::UntrustedCall( uint64_t untrusted_selector , MessageWriter * input , MessageReader * output) | ['untrusted_selector', 'input', 'output'] | PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector,
MessageWriter *input,
MessageReader *output) {
int ret;
UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance();
SgxParams *const sgx_params =
reinterpret_cast<SgxParams *>(untrusted_cache->Malloc(sizeof(SgxParams)));
if (!TrustedPrimitives::IsOutsideEnclave(sgx_params, sizeof(SgxParams))) {
TrustedPrimitives::BestEffortAbort(
"UntrustedCall: sgx_param should be in untrusted memory");
}
Cleanup clean_up(
[sgx_params, untrusted_cache] { untrusted_cache->Free(sgx_params); });
sgx_params->input_size = 0;
sgx_params->input = nullptr;
if (input) {
sgx_params->input_size = input->MessageSize();
if (sgx_params->input_size > 0) {
// Allocate and copy data to |input_buffer|.
sgx_params->input = untrusted_cache->Malloc(sgx_params->input_size);
const void *input_pointer = sgx_params->input;
uint64_t input_size = sgx_params->input_size;
if (!TrustedPrimitives::IsOutsideEnclave(input_pointer, input_size)) {
TrustedPrimitives::BestEffortAbort(
"UntrustedCall: sgx_param input should be in untrusted memory");
}
input->Serialize(const_cast<void *>(input_pointer));
}
}
sgx_params->output_size = 0;
sgx_params->output = nullptr;
CHECK_OCALL(
ocall_dispatch_untrusted_call(&ret, untrusted_selector, sgx_params));
if (sgx_params->input) {
untrusted_cache->Free(const_cast<void *>(sgx_params->input));
}
if (!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,
sgx_params->output_size)) {
TrustedPrimitives::BestEffortAbort(
"UntrustedCall: sgx_param output should be in untrusted memory");
}
if (sgx_params->output) {
// For the results obtained in |output_buffer|, copy them to |output|
// before freeing the buffer.
output->Deserialize(sgx_params->output, sgx_params->output_size);
TrustedPrimitives::UntrustedLocalFree(sgx_params->output);
}
return PrimitiveStatus::OkStatus();
} | 308 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | add_offer_options | add_offer_options( uint8_t * option_start_address) | ['option_start_address'] | static void add_offer_options(uint8_t *option_start_address)
{
uint8_t *temp_option_addr;
/* add DHCP options 1.
The subnet mask option specifies the client's subnet mask */
temp_option_addr = fill_one_option_content(option_start_address,
DHCP_OPTION_CODE_SUBNET_MASK, DHCP_OPTION_LENGTH_FOUR,
(void *)&dhcps_local_mask);
/* add DHCP options 3 (i.e router(gateway)). The time server option
specifies a list of RFC 868 [6] time servers available to the client. */
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_ROUTER, DHCP_OPTION_LENGTH_FOUR,
(void *)&dhcps_local_address);
/* add DHCP options 6 (i.e DNS).
The option specifies a list of DNS servers available to the client. */
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_DNS_SERVER, DHCP_OPTION_LENGTH_FOUR,
(void *)&dhcps_local_address);
/* add DHCP options 51.
This option is used to request a lease time for the IP address. */
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_LEASE_TIME, DHCP_OPTION_LENGTH_FOUR,
(void *)&dhcp_option_lease_time);
/* add DHCP options 54.
The identifier is the IP address of the selected server. */
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_SERVER_ID, DHCP_OPTION_LENGTH_FOUR,
(void *)&dhcps_local_address);
/* add DHCP options 28.
This option specifies the broadcast address in use on client's subnet.*/
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_BROADCAST_ADDRESS, DHCP_OPTION_LENGTH_FOUR,
(void *)&dhcps_subnet_broadcast);
/* add DHCP options 26.
This option specifies the Maximum transmission unit to use */
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_INTERFACE_MTU, DHCP_OPTION_LENGTH_TWO,
(void *) &dhcp_option_interface_mtu);//dhcp_option_interface_mtu_576);
/* add DHCP options 31.
This option specifies whether or not the client should solicit routers */
temp_option_addr = fill_one_option_content(temp_option_addr,
DHCP_OPTION_CODE_PERFORM_ROUTER_DISCOVERY, DHCP_OPTION_LENGTH_ONE,
NULL);
*temp_option_addr++ = DHCP_OPTION_CODE_END;
} | 157 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | dhcps_deinit | dhcps_deinit( void) | ['void'] | void dhcps_deinit(void)
{
if (dhcps_pcb != NULL) {
udp_remove(dhcps_pcb);
dhcps_pcb = NULL;
}
if (dhcps_ip_table_semaphore != NULL) {
vSemaphoreDelete(dhcps_ip_table_semaphore);
dhcps_ip_table_semaphore = NULL;
}
} | 40 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | dhcps_handle_state_machine_change | dhcps_handle_state_machine_change( uint8_t option_message_type) | ['option_message_type'] | uint8_t dhcps_handle_state_machine_change(uint8_t option_message_type)
{
switch (option_message_type) {
case DHCP_MESSAGE_TYPE_DECLINE:
#if (debug_dhcps)
printf("\r\nget message DHCP_MESSAGE_TYPE_DECLINE\n");
#endif
dhcp_server_state_machine = DHCP_SERVER_STATE_IDLE;
break;
case DHCP_MESSAGE_TYPE_DISCOVER:
#if (debug_dhcps)
printf("\r\nget message DHCP_MESSAGE_TYPE_DISCOVER\n");
#endif
if (dhcp_server_state_machine == DHCP_SERVER_STATE_IDLE) {
dhcp_server_state_machine = DHCP_SERVER_STATE_OFFER;
}
break;
case DHCP_MESSAGE_TYPE_REQUEST:
#if (debug_dhcps)
printf("\r\n[%d]get message DHCP_MESSAGE_TYPE_REQUEST\n", xTaskGetTickCount());
#endif
#if (!IS_USE_FIXED_IP)
#if (debug_dhcps)
printf("\r\ndhcp_server_state_machine=%d", dhcp_server_state_machine);
printf("\r\ndhcps_allocated_client_address=%d.%d.%d.%d",
ip4_addr1(&dhcps_allocated_client_address),
ip4_addr2(&dhcps_allocated_client_address),
ip4_addr3(&dhcps_allocated_client_address),
ip4_addr4(&dhcps_allocated_client_address));
printf("\r\nclient_request_ip=%d.%d.%d.%d\n",
ip4_addr1(&client_request_ip),
ip4_addr2(&client_request_ip),
ip4_addr3(&client_request_ip),
ip4_addr4(&client_request_ip));
#endif
if (dhcp_server_state_machine == DHCP_SERVER_STATE_OFFER) {
if (ip4_addr4(&dhcps_allocated_client_address) != 0) {
if (memcmp((void *)&dhcps_allocated_client_address, (void *)&client_request_ip, 4) == 0) {
dhcp_server_state_machine = DHCP_SERVER_STATE_ACK;
} else {
dhcp_server_state_machine = DHCP_SERVER_STATE_NAK;
}
} else {
dhcp_server_state_machine = DHCP_SERVER_STATE_NAK;
}
} else if(dhcp_server_state_machine == DHCP_SERVER_STATE_IDLE){
uint8_t ip_addr4 = check_client_request_ip(&client_request_ip, client_addr);
if(ip_addr4 > 0){
IP4_ADDR(&dhcps_allocated_client_address, (ip4_addr1(&dhcps_network_id)),
ip4_addr2(&dhcps_network_id), ip4_addr3(&dhcps_network_id), ip_addr4);
dhcp_server_state_machine = DHCP_SERVER_STATE_ACK;
}else{
dhcp_server_state_machine = DHCP_SERVER_STATE_NAK;
}
} else {
dhcp_server_state_machine = DHCP_SERVER_STATE_NAK;
}
#else
if (!(dhcp_server_state_machine == DHCP_SERVER_STATE_ACK ||
dhcp_server_state_machine == DHCP_SERVER_STATE_NAK)) {
dhcp_server_state_machine = DHCP_SERVER_STATE_NAK;
}
#endif
break;
case DHCP_MESSAGE_TYPE_RELEASE:
printf("get message DHCP_MESSAGE_TYPE_RELEASE\n");
dhcp_server_state_machine = DHCP_SERVER_STATE_IDLE;
break;
}
return dhcp_server_state_machine;
} | 301 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | dhcps_initialize_message | dhcps_initialize_message( struct dhcp_msg * dhcp_message_repository) | ['dhcp_message_repository'] | static void dhcps_initialize_message(struct dhcp_msg *dhcp_message_repository)
{
dhcp_message_repository->op = DHCP_MESSAGE_OP_REPLY;
dhcp_message_repository->htype = DHCP_MESSAGE_HTYPE;
dhcp_message_repository->hlen = DHCP_MESSAGE_HLEN;
dhcp_message_repository->hops = 0;
memcpy((char *)dhcp_recorded_xid, (char *) dhcp_message_repository->xid,
sizeof(dhcp_message_repository->xid));
dhcp_message_repository->secs = 0;
dhcp_message_repository->flags = htons(BOOTP_BROADCAST);
memcpy((char *)dhcp_message_repository->yiaddr,
(char *)&dhcps_allocated_client_address,
sizeof(dhcp_message_repository->yiaddr));
memset((char *)dhcp_message_repository->ciaddr, 0,
sizeof(dhcp_message_repository->ciaddr));
memset((char *)dhcp_message_repository->siaddr, 0,
sizeof(dhcp_message_repository->siaddr));
memset((char *)dhcp_message_repository->giaddr, 0,
sizeof(dhcp_message_repository->giaddr));
memset((char *)dhcp_message_repository->sname, 0,
sizeof(dhcp_message_repository->sname));
memset((char *)dhcp_message_repository->file, 0,
sizeof(dhcp_message_repository->file));
memset((char *)dhcp_message_repository->options, 0,
dhcp_message_total_options_lenth);
memcpy((char *)dhcp_message_repository->options, (char *)dhcp_magic_cookie,
sizeof(dhcp_magic_cookie));
} | 234 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | dhcps_receive_udp_packet_handler | dhcps_receive_udp_packet_handler( void * arg , struct udp_pcb * udp_pcb , struct pbuf * udp_packet_buffer , struct ip_addr * sender_addr , uint16_t sender_port) | ['arg', 'udp_pcb', 'udp_packet_buffer', 'sender_addr', 'sender_port'] | static void dhcps_receive_udp_packet_handler(void *arg, struct udp_pcb *udp_pcb,
struct pbuf *udp_packet_buffer, struct ip_addr *sender_addr, uint16_t sender_port)
{
int16_t total_length_of_packet_buffer;
struct pbuf *merged_packet_buffer = NULL;
dhcp_message_repository = (struct dhcp_msg *)udp_packet_buffer->payload;
if (udp_packet_buffer == NULL) {
printf("\n\r Error!!!! System doesn't allocate any buffer \n\r");
return;
}
if (sender_port == DHCP_CLIENT_PORT) {
total_length_of_packet_buffer = udp_packet_buffer->tot_len;
if (udp_packet_buffer->next != NULL) {
merged_packet_buffer = pbuf_coalesce(udp_packet_buffer,
PBUF_TRANSPORT);
if (merged_packet_buffer->tot_len !=
total_length_of_packet_buffer) {
pbuf_free(udp_packet_buffer);
return;
}
}
switch (dhcps_check_msg_and_handle_options(udp_packet_buffer)) {
case DHCP_SERVER_STATE_OFFER:
#if (debug_dhcps)
printf("%s DHCP_SERVER_STATE_OFFER\n",__func__);
#endif
dhcps_send_offer(udp_packet_buffer);
break;
case DHCP_SERVER_STATE_ACK:
#if (debug_dhcps)
printf("%s DHCP_SERVER_STATE_ACK\n",__func__);
#endif
dhcps_send_ack(udp_packet_buffer);
#if (!IS_USE_FIXED_IP)
mark_ip_in_table((uint8_t)ip4_addr4(&dhcps_allocated_client_address));
#ifdef CONFIG_DHCPS_KEPT_CLIENT_INFO
save_client_addr(&dhcps_allocated_client_address, client_addr);
memset(&client_request_ip, 0, sizeof(client_request_ip));
memset(&client_addr, 0, sizeof(client_addr));
memset(&dhcps_allocated_client_address, 0, sizeof(dhcps_allocated_client_address));
#if (debug_dhcps)
dump_client_table();
#endif
#endif
#endif
dhcp_server_state_machine = DHCP_SERVER_STATE_IDLE;
break;
case DHCP_SERVER_STATE_NAK:
#if (debug_dhcps)
printf("%s DHCP_SERVER_STATE_NAK\n",__func__);
#endif
dhcps_send_nak(udp_packet_buffer);
dhcp_server_state_machine = DHCP_SERVER_STATE_IDLE;
break;
case DHCP_OPTION_CODE_END:
#if (debug_dhcps)
printf("%s DHCP_OPTION_CODE_END\n",__func__);
#endif
break;
}
}
/* free the UDP connection, so we can accept new clients */
udp_disconnect(udp_pcb);
/* Free the packet buffer */
if (merged_packet_buffer != NULL)
pbuf_free(merged_packet_buffer);
else
pbuf_free(udp_packet_buffer);
} | 277 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | dhcps_send_ack | dhcps_send_ack( struct pbuf * packet_buffer) | ['packet_buffer'] | static void dhcps_send_ack(struct pbuf *packet_buffer)
{
dhcp_message_repository = (struct dhcp_msg *)packet_buffer->payload;
dhcps_initialize_message(dhcp_message_repository);
add_offer_options(add_msg_type(&dhcp_message_repository->options[4],
DHCP_MESSAGE_TYPE_ACK));
udp_sendto_if(dhcps_pcb, packet_buffer,
&dhcps_send_broadcast_address, DHCP_CLIENT_PORT, dhcps_netif);
} | 55 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | dhcps_send_offer | dhcps_send_offer( struct pbuf * packet_buffer) | ['packet_buffer'] | static void dhcps_send_offer(struct pbuf *packet_buffer)
{
uint8_t temp_ip = 0;
dhcp_message_repository = (struct dhcp_msg *)packet_buffer->payload;
#if (!IS_USE_FIXED_IP)
temp_ip = check_client_request_ip(&client_request_ip, client_addr);
/* create new client ip */
if(temp_ip == 0)
temp_ip = search_next_ip();
#if (debug_dhcps)
printf("\r\n temp_ip = %d",temp_ip);
#endif
if (temp_ip == 0) {
#if 0
memset(&ip_table, 0, sizeof(struct table));
mark_ip_in_table((uint8_t)ip4_addr4(&dhcps_local_address));
printf("\r\n reset ip table!!\r\n");
#endif
printf("\r\n No useable ip!!!!\r\n");
}
printf("\n\r[%d]DHCP assign ip = %d.%d.%d.%d\n", xTaskGetTickCount(), ip4_addr1(&dhcps_network_id),ip4_addr2(&dhcps_network_id),ip4_addr3(&dhcps_network_id),temp_ip);
IP4_ADDR(&dhcps_allocated_client_address, (ip4_addr1(&dhcps_network_id)),
ip4_addr2(&dhcps_network_id), ip4_addr3(&dhcps_network_id), temp_ip);
#endif
dhcps_initialize_message(dhcp_message_repository);
add_offer_options(add_msg_type(&dhcp_message_repository->options[4],
DHCP_MESSAGE_TYPE_OFFER));
udp_sendto_if(dhcps_pcb, packet_buffer,
&dhcps_send_broadcast_address, DHCP_CLIENT_PORT, dhcps_netif);
} | 190 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | mark_ip_in_table | mark_ip_in_table( uint8_t d) | ['d'] | static void mark_ip_in_table(uint8_t d)
{
#if (debug_dhcps)
printf("\r\nmark ip %d\r\n",d);
#endif
xSemaphoreTake(dhcps_ip_table_semaphore, portMAX_DELAY);
if (0 < d && d <= 32) {
ip_table.ip_range[0] = MARK_RANGE1_IP_BIT(ip_table, d);
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[0] = 0x%x\r\n",ip_table.ip_range[0]);
#endif
} else if (32 < d && d <= 64) {
ip_table.ip_range[1] = MARK_RANGE2_IP_BIT(ip_table, (d - 32));
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[1] = 0x%x\r\n",ip_table.ip_range[1]);
#endif
} else if (64 < d && d <= 96) {
ip_table.ip_range[2] = MARK_RANGE3_IP_BIT(ip_table, (d - 64));
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[2] = 0x%x\r\n",ip_table.ip_range[2]);
#endif
} else if (96 < d && d <= 128) {
ip_table.ip_range[3] = MARK_RANGE4_IP_BIT(ip_table, (d - 96));
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[3] = 0x%x\r\n",ip_table.ip_range[3]);
#endif
} else if(128 < d && d <= 160) {
ip_table.ip_range[4] = MARK_RANGE5_IP_BIT(ip_table, d);
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[4] = 0x%x\r\n",ip_table.ip_range[4]);
#endif
} else if (160 < d && d <= 192) {
ip_table.ip_range[5] = MARK_RANGE6_IP_BIT(ip_table, (d - 160));
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[5] = 0x%x\r\n",ip_table.ip_range[5]);
#endif
} else if (192 < d && d <= 224) {
ip_table.ip_range[6] = MARK_RANGE7_IP_BIT(ip_table, (d - 192));
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[6] = 0x%x\r\n",ip_table.ip_range[6]);
#endif
} else if (224 < d) {
ip_table.ip_range[7] = MARK_RANGE8_IP_BIT(ip_table, (d - 224));
#if (debug_dhcps)
printf("\r\n ip_table.ip_range[7] = 0x%x\r\n",ip_table.ip_range[7]);
#endif
} else {
printf("\r\n Request ip over the range(1-128) \r\n");
}
xSemaphoreGive(dhcps_ip_table_semaphore);
} | 365 | True | 1 |
CVE-2022-29859 | 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/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'name': 'https://github.com/ambiot/amb1_sdk/commit/4b73f58f32914d0081d79a79e53a3215c8c1ea56', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'name': 'https://www.amebaiot.com/zh/security_bulletin/cve-2022-29859/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:amb1_sdk_project:amb1_sdk:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-03-11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'component/common/network/dhcp/dhcps.c in ambiot amb1_sdk (aka SDK for Ameba1) before 2022-03-11 mishandles data structures for DHCP packet data.'}] | 2022-06-15T19:15Z | 2022-04-27T23: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 | galex.fang | 2022-03-11 14:41:08+08:00 | [dhcps] update dhcps | 4b73f58f32914d0081d79a79e53a3215c8c1ea56 | False | ambiot/amb1_sdk | SDK for Ameba1 | 2019-10-24 08:10:43 | 2022-07-22 07:36:54 | null | ambiot | 8.0 | 6.0 | save_client_addr | save_client_addr( struct ip_addr * client_ip , uint8_t * hwaddr) | ['client_ip', 'hwaddr'] | static void save_client_addr(struct ip_addr *client_ip, uint8_t *hwaddr)
{
uint8_t d = (uint8_t)ip4_addr4(client_ip);
xSemaphoreTake(dhcps_ip_table_semaphore, portMAX_DELAY);
memcpy(ip_table.client_mac[d], hwaddr, 6);
#if (debug_dhcps)
printf("\r\n%s: ip %d.%d.%d.%d, hwaddr %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", __func__,
ip4_addr1(client_ip), ip4_addr2(client_ip), ip4_addr3(client_ip), ip4_addr4(client_ip),
hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
#endif
xSemaphoreGive(dhcps_ip_table_semaphore);
} | 107 | True | 1 |
CVE-2020-9432 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_host in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:32Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_email) | ['openssl_x509_check_email'] | static LUA_FUNCTION(openssl_x509_check_email)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *email = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_email(cert, email, strlen(email), 0));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 74 | True | 1 |
CVE-2020-9433 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_email in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:32Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_email) | ['openssl_x509_check_email'] | static LUA_FUNCTION(openssl_x509_check_email)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *email = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_email(cert, email, strlen(email), 0));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 74 | True | 1 |
CVE-2020-9434 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_ip_asc in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:26Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_email) | ['openssl_x509_check_email'] | static LUA_FUNCTION(openssl_x509_check_email)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *email = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_email(cert, email, strlen(email), 0));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 74 | True | 1 |
CVE-2020-9432 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_host in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:32Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_host) | ['openssl_x509_check_host'] | static LUA_FUNCTION(openssl_x509_check_host)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *hostname = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_host(cert, hostname, strlen(hostname), 0, NULL));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 76 | True | 1 |
CVE-2020-9433 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_email in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:32Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_host) | ['openssl_x509_check_host'] | static LUA_FUNCTION(openssl_x509_check_host)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *hostname = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_host(cert, hostname, strlen(hostname), 0, NULL));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 76 | True | 1 |
CVE-2020-9434 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_ip_asc in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:26Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_host) | ['openssl_x509_check_host'] | static LUA_FUNCTION(openssl_x509_check_host)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *hostname = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_host(cert, hostname, strlen(hostname), 0, NULL));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 76 | True | 1 |
CVE-2020-9432 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_host in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:32Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_ip_asc) | ['openssl_x509_check_ip_asc'] | static LUA_FUNCTION(openssl_x509_check_ip_asc)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *ip_asc = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_ip_asc(cert, ip_asc, 0));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 69 | True | 1 |
CVE-2020-9433 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_email in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:32Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_ip_asc) | ['openssl_x509_check_ip_asc'] | static LUA_FUNCTION(openssl_x509_check_ip_asc)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *ip_asc = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_ip_asc(cert, ip_asc, 0));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 69 | True | 1 |
CVE-2020-9434 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'name': 'https://github.com/zhaozg/lua-openssl/commit/a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:lua-openssl_project:lua-openssl:0.7.7-1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'openssl_x509_check_ip_asc in lua-openssl 0.7.7-1 mishandles X.509 certificate validation because it uses lua_pushboolean for certain non-boolean return values.'}] | 2020-02-28T16:26Z | 2020-02-27T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | zhaozg | 2020-02-27 21:53:15+08:00 | fix security: GSL-2020-026 | a6dc186dd4b6b9e329a93cca3e7e3cfccfdf3cca | False | zhaozg/lua-openssl | Openssl binding for Lua | 2011-07-02 11:15:48 | 2022-08-26 12:17:34 | https://zhaozg.github.io/lua-openssl/index.html | zhaozg | 239.0 | 108.0 | LUA_FUNCTION | LUA_FUNCTION( openssl_x509_check_ip_asc) | ['openssl_x509_check_ip_asc'] | static LUA_FUNCTION(openssl_x509_check_ip_asc)
{
X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509");
if (lua_isstring(L, 2))
{
const char *ip_asc = lua_tostring(L, 2);
lua_pushboolean(L, X509_check_ip_asc(cert, ip_asc, 0));
}
else
{
lua_pushboolean(L, 0);
}
return 1;
} | 69 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | parse_socket_error | parse_socket_error( CLI * c , const char * text) | ['c', 'text'] | NOEXPORT int parse_socket_error(CLI *c, const char *text) {
switch(get_last_socket_error()) {
/* http://tangentsoft.net/wskfaq/articles/bsd-compatibility.html */
case 0: /* close on read, or close on write on WIN32 */
#ifndef USE_WIN32
case EPIPE: /* close on write on Unix */
#endif
case S_ECONNABORTED:
s_log(LOG_INFO, "%s: Socket is closed", text);
return 0;
case S_EINTR:
s_log(LOG_DEBUG, "%s: Interrupted by a signal: retrying", text);
return 1;
case S_EWOULDBLOCK:
s_log(LOG_NOTICE, "%s: Would block: retrying", text);
s_poll_sleep(1, 0); /* Microsoft bug KB177346 */
return 1;
#if S_EAGAIN!=S_EWOULDBLOCK
case S_EAGAIN:
s_log(LOG_DEBUG,
"%s: Temporary lack of resources: retrying", text);
return 1;
#endif
#ifdef USE_WIN32
case S_ECONNRESET:
/* dying "exec" processes on Win32 cause reset instead of close */
if(c->opt->exec_name) {
s_log(LOG_INFO, "%s: Socket is closed (exec)", text);
return 0;
}
/* fall through */
#endif
default:
sockerror(text);
throw_exception(c, 1);
return -1; /* some C compilers require a return value */
}
} | 137 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | transfer | transfer( CLI * c) | ['c'] | NOEXPORT void transfer(CLI *c) {
int timeout; /* s_poll_wait timeout in seconds */
int pending; /* either processed on unprocessed TLS data */
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
int has_pending=0, prev_has_pending;
#endif
int watchdog=0; /* a counter to detect an infinite loop */
ssize_t num;
int err;
/* logical channels (not file descriptors!) open for read or write */
int sock_open_rd=1, sock_open_wr=1;
/* awaited conditions on TLS file descriptors */
int shutdown_wants_read=0, shutdown_wants_write=0;
int read_wants_read=0, read_wants_write=0;
int write_wants_read=0, write_wants_write=0;
/* actual conditions on file descriptors */
int sock_can_rd, sock_can_wr, ssl_can_rd, ssl_can_wr;
#ifdef USE_WIN32
unsigned long bytes;
#else
int bytes;
#endif
c->sock_ptr=c->ssl_ptr=0;
do { /* main loop of client data transfer */
/****************************** initialize *_wants_* */
read_wants_read|=!(SSL_get_shutdown(c->ssl)&SSL_RECEIVED_SHUTDOWN)
&& c->ssl_ptr<BUFFSIZE && !read_wants_write;
write_wants_write|=!(SSL_get_shutdown(c->ssl)&SSL_SENT_SHUTDOWN)
&& c->sock_ptr && !write_wants_read;
/****************************** setup c->fds structure */
s_poll_init(c->fds, 0); /* initialize the structure */
/* for plain socket open data strem = open file descriptor */
/* make sure to add each open socket to receive exceptions! */
if(sock_open_rd) /* only poll if the read file descriptor is open */
s_poll_add(c->fds, c->sock_rfd->fd, c->sock_ptr<BUFFSIZE, 0);
if(sock_open_wr) /* only poll if the write file descriptor is open */
s_poll_add(c->fds, c->sock_wfd->fd, 0, c->ssl_ptr>0);
/* poll TLS file descriptors unless TLS shutdown was completed */
if(SSL_get_shutdown(c->ssl)!=
(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) {
s_poll_add(c->fds, c->ssl_rfd->fd,
read_wants_read || write_wants_read || shutdown_wants_read, 0);
s_poll_add(c->fds, c->ssl_wfd->fd, 0,
read_wants_write || write_wants_write || shutdown_wants_write);
}
/****************************** wait for an event */
pending=SSL_pending(c->ssl);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
/* only attempt to process SSL_has_pending() data once */
prev_has_pending=has_pending;
has_pending=SSL_has_pending(c->ssl);
pending=pending || (has_pending && !prev_has_pending);
#endif
if(read_wants_read && pending) {
timeout=0; /* process any buffered data without delay */
} else if((sock_open_rd && /* both peers open */
!(SSL_get_shutdown(c->ssl)&SSL_RECEIVED_SHUTDOWN)) ||
c->ssl_ptr /* data buffered to write to socket */ ||
c->sock_ptr /* data buffered to write to TLS */) {
timeout=c->opt->timeout_idle;
} else {
timeout=c->opt->timeout_close;
}
err=s_poll_wait(c->fds, timeout, 0);
switch(err) {
case -1:
sockerror("transfer: s_poll_wait");
throw_exception(c, 1);
case 0: /* timeout */
if(read_wants_read && pending)
break;
if((sock_open_rd &&
!(SSL_get_shutdown(c->ssl)&SSL_RECEIVED_SHUTDOWN)) ||
c->ssl_ptr || c->sock_ptr) {
s_log(LOG_INFO, "transfer: s_poll_wait:"
" TIMEOUTidle exceeded: sending reset");
s_poll_dump(c->fds, LOG_DEBUG);
throw_exception(c, 1);
}
/* already closing connection */
s_log(LOG_ERR, "transfer: s_poll_wait:"
" TIMEOUTclose exceeded: closing");
s_poll_dump(c->fds, LOG_DEBUG);
return; /* OK */
}
/****************************** retrieve results from c->fds */
sock_can_rd=s_poll_canread(c->fds, c->sock_rfd->fd);
sock_can_wr=s_poll_canwrite(c->fds, c->sock_wfd->fd);
ssl_can_rd=s_poll_canread(c->fds, c->ssl_rfd->fd);
ssl_can_wr=s_poll_canwrite(c->fds, c->ssl_wfd->fd);
/****************************** identify exceptions */
if(c->sock_rfd->fd==c->sock_wfd->fd) {
if((sock_can_rd || sock_can_wr) &&
s_poll_err(c->fds, c->sock_rfd->fd)) {
err=get_socket_error(c->sock_rfd->fd);
if(err)
log_error(LOG_INFO, err, "socket fd");
}
} else {
if(sock_can_rd && s_poll_err(c->fds, c->sock_rfd->fd)) {
err=get_socket_error(c->sock_rfd->fd);
if(err)
log_error(LOG_INFO, err, "socket rfd");
}
if(sock_can_wr && s_poll_err(c->fds, c->sock_wfd->fd)) {
err=get_socket_error(c->sock_wfd->fd);
if(err)
log_error(LOG_INFO, err, "socket wfd");
}
}
if(c->ssl_rfd->fd==c->ssl_wfd->fd) {
if((ssl_can_rd || ssl_can_wr) &&
s_poll_err(c->fds, c->ssl_rfd->fd)) {
err=get_socket_error(c->ssl_rfd->fd);
if(err)
log_error(LOG_INFO, err, "TLS fd");
}
} else {
if(ssl_can_rd && s_poll_err(c->fds, c->ssl_rfd->fd)) {
err=get_socket_error(c->ssl_rfd->fd);
if(err)
log_error(LOG_INFO, err, "TLS rfd");
}
if(c->ssl_rfd->fd!=c->ssl_wfd->fd &&
ssl_can_wr && s_poll_err(c->fds, c->ssl_wfd->fd)) {
err=get_socket_error(c->ssl_wfd->fd);
if(err)
log_error(LOG_INFO, err, "TLS wfd");
}
}
/****************************** hangups without read or write */
if(!(sock_can_rd || sock_can_wr || ssl_can_rd || ssl_can_wr)) {
if(s_poll_hup(c->fds, c->sock_rfd->fd) ||
s_poll_hup(c->fds, c->sock_wfd->fd)) {
if(c->ssl_ptr) {
s_log(LOG_ERR,
"Socket closed (HUP) with %ld unsent byte(s)",
(long)c->ssl_ptr);
throw_exception(c, 1); /* reset the sockets */
}
s_log(LOG_INFO, "Socket closed (HUP)");
sock_open_rd=sock_open_wr=0;
} else if(s_poll_hup(c->fds, c->ssl_rfd->fd) ||
s_poll_hup(c->fds, c->ssl_wfd->fd)) {
if(c->sock_ptr) {
s_log(LOG_ERR,
"TLS socket closed (HUP) with %ld unsent byte(s)",
(long)c->sock_ptr);
throw_exception(c, 1); /* reset the sockets */
}
s_log(LOG_INFO, "TLS socket closed (HUP)");
SSL_set_shutdown(c->ssl,
SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
}
}
if(c->reneg_state==RENEG_DETECTED && !c->opt->option.renegotiation) {
s_log(LOG_ERR, "Aborting due to renegotiation request");
throw_exception(c, 1);
}
/****************************** send TLS close_notify alert */
if(shutdown_wants_read || shutdown_wants_write) {
num=SSL_shutdown(c->ssl); /* send close_notify alert */
if(num<0) /* -1 - not completed */
err=SSL_get_error(c->ssl, (int)num);
else /* 0 or 1 - success */
err=SSL_ERROR_NONE;
switch(err) {
case SSL_ERROR_NONE: /* the shutdown was successfully completed */
s_log(LOG_INFO, "SSL_shutdown successfully sent close_notify alert");
shutdown_wants_read=shutdown_wants_write=0;
break;
case SSL_ERROR_SYSCALL: /* socket error */
if(parse_socket_error(c, "SSL_shutdown"))
break; /* a non-critical error: retry */
SSL_set_shutdown(c->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
shutdown_wants_read=shutdown_wants_write=0;
break;
case SSL_ERROR_ZERO_RETURN: /* connection closed */
SSL_set_shutdown(c->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
shutdown_wants_read=shutdown_wants_write=0;
break;
case SSL_ERROR_WANT_WRITE:
s_log(LOG_DEBUG, "SSL_shutdown returned WANT_WRITE: retrying");
shutdown_wants_read=0;
shutdown_wants_write=1;
break;
case SSL_ERROR_WANT_READ:
s_log(LOG_DEBUG, "SSL_shutdown returned WANT_READ: retrying");
shutdown_wants_read=1;
shutdown_wants_write=0;
break;
case SSL_ERROR_SSL: /* TLS error */
sslerror("SSL_shutdown");
throw_exception(c, 1);
default:
s_log(LOG_ERR, "SSL_shutdown/SSL_get_error returned %d", err);
throw_exception(c, 1);
}
}
/****************************** write to socket */
if(sock_open_wr && sock_can_wr) {
num=writesocket(c->sock_wfd->fd, c->ssl_buff, c->ssl_ptr);
switch(num) {
case -1: /* error */
if(parse_socket_error(c, "writesocket"))
break; /* a non-critical error: retry */
sock_open_rd=sock_open_wr=0;
break;
case 0: /* nothing was written: ignore */
s_log(LOG_DEBUG, "writesocket returned 0");
break; /* do not reset the watchdog */
default:
memmove(c->ssl_buff, c->ssl_buff+num, c->ssl_ptr-(size_t)num);
c->ssl_ptr-=(size_t)num;
memset(c->ssl_buff+c->ssl_ptr, 0, (size_t)num); /* paranoia */
c->sock_bytes+=(size_t)num;
watchdog=0; /* reset the watchdog */
}
}
/****************************** read from socket */
if(sock_open_rd && sock_can_rd) {
num=readsocket(c->sock_rfd->fd,
c->sock_buff+c->sock_ptr, BUFFSIZE-c->sock_ptr);
switch(num) {
case -1:
if(parse_socket_error(c, "readsocket"))
break; /* a non-critical error: retry */
sock_open_rd=sock_open_wr=0;
break;
case 0: /* close */
s_log(LOG_INFO, "Read socket closed (readsocket)");
sock_open_rd=0;
break; /* do not reset the watchdog */
default:
c->sock_ptr+=(size_t)num;
watchdog=0; /* reset the watchdog */
}
}
/****************************** update *_wants_* based on new *_ptr */
/* this update is also required for SSL_pending() to be used */
read_wants_read|=!(SSL_get_shutdown(c->ssl)&SSL_RECEIVED_SHUTDOWN)
&& c->ssl_ptr<BUFFSIZE && !read_wants_write;
write_wants_write|=!(SSL_get_shutdown(c->ssl)&SSL_SENT_SHUTDOWN)
&& c->sock_ptr && !write_wants_read;
/****************************** write to TLS */
if((write_wants_read && ssl_can_rd) ||
(write_wants_write && ssl_can_wr)) {
write_wants_read=0;
write_wants_write=0;
num=SSL_write(c->ssl, c->sock_buff, (int)(c->sock_ptr));
switch(err=SSL_get_error(c->ssl, (int)num)) {
case SSL_ERROR_NONE:
if(num==0) { /* nothing was written: ignore */
s_log(LOG_DEBUG, "SSL_write returned 0");
break; /* do not reset the watchdog */
}
memmove(c->sock_buff, c->sock_buff+num,
c->sock_ptr-(size_t)num);
c->sock_ptr-=(size_t)num;
memset(c->sock_buff+c->sock_ptr, 0, (size_t)num); /* paranoia */
c->ssl_bytes+=(size_t)num;
watchdog=0; /* reset the watchdog */
break;
case SSL_ERROR_WANT_WRITE: /* buffered data? */
s_log(LOG_DEBUG, "SSL_write returned WANT_WRITE: retrying");
write_wants_write=1;
break;
case SSL_ERROR_WANT_READ:
s_log(LOG_DEBUG, "SSL_write returned WANT_READ: retrying");
write_wants_read=1;
break;
case SSL_ERROR_WANT_X509_LOOKUP:
s_log(LOG_DEBUG,
"SSL_write returned WANT_X509_LOOKUP: retrying");
break;
case SSL_ERROR_SYSCALL: /* socket error */
if(num && parse_socket_error(c, "SSL_write"))
break; /* a non-critical error: retry */
/* EOF -> buggy (e.g. Microsoft) peer:
* TLS socket closed without close_notify alert */
if(c->sock_ptr) { /* TODO: what about buffered data? */
s_log(LOG_ERR,
"TLS socket closed (SSL_write) with %ld unsent byte(s)",
(long)c->sock_ptr);
throw_exception(c, 1); /* reset the sockets */
}
s_log(LOG_INFO, "TLS socket closed (SSL_write)");
SSL_set_shutdown(c->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
break;
case SSL_ERROR_ZERO_RETURN: /* close_notify alert received */
s_log(LOG_INFO, "TLS closed (SSL_write)");
if(SSL_version(c->ssl)==SSL2_VERSION)
SSL_set_shutdown(c->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
break;
case SSL_ERROR_SSL:
sslerror("SSL_write");
throw_exception(c, 1);
default:
s_log(LOG_ERR, "SSL_write/SSL_get_error returned %d", err);
throw_exception(c, 1);
}
}
/****************************** read from TLS */
if((read_wants_read && (ssl_can_rd || pending)) ||
/* it may be possible to read some pending data after
* writesocket() above made some room in c->ssl_buff */
(read_wants_write && ssl_can_wr)) {
read_wants_read=0;
read_wants_write=0;
num=SSL_read(c->ssl, c->ssl_buff+c->ssl_ptr, (int)(BUFFSIZE-c->ssl_ptr));
switch(err=SSL_get_error(c->ssl, (int)num)) {
case SSL_ERROR_NONE:
if(num==0) { /* nothing was read: ignore */
s_log(LOG_DEBUG, "SSL_read returned 0");
break; /* do not reset the watchdog */
}
c->ssl_ptr+=(size_t)num;
watchdog=0; /* reset the watchdog */
break;
case SSL_ERROR_WANT_WRITE:
s_log(LOG_DEBUG, "SSL_read returned WANT_WRITE: retrying");
read_wants_write=1;
break;
case SSL_ERROR_WANT_READ: /* happens quite often */
#if 0
s_log(LOG_DEBUG, "SSL_read returned WANT_READ: retrying");
#endif
read_wants_read=1;
break;
case SSL_ERROR_WANT_X509_LOOKUP:
s_log(LOG_DEBUG,
"SSL_read returned WANT_X509_LOOKUP: retrying");
break;
case SSL_ERROR_SYSCALL:
if(num && parse_socket_error(c, "SSL_read"))
break; /* a non-critical error: retry */
/* EOF -> buggy (e.g. Microsoft) peer:
* TLS socket closed without close_notify alert */
if(c->sock_ptr || write_wants_write) {
s_log(LOG_ERR,
"TLS socket closed (SSL_read) with %ld unsent byte(s)",
(long)c->sock_ptr);
throw_exception(c, 1); /* reset the sockets */
}
s_log(LOG_INFO, "TLS socket closed (SSL_read)");
SSL_set_shutdown(c->ssl,
SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
break;
case SSL_ERROR_ZERO_RETURN: /* close_notify alert received */
s_log(LOG_INFO, "TLS closed (SSL_read)");
if(SSL_version(c->ssl)==SSL2_VERSION)
SSL_set_shutdown(c->ssl,
SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
break;
case SSL_ERROR_SSL:
sslerror("SSL_read");
throw_exception(c, 1);
default:
s_log(LOG_ERR, "SSL_read/SSL_get_error returned %d", err);
throw_exception(c, 1);
}
}
/****************************** check for hangup conditions */
/* http://marc.info/?l=linux-man&m=128002066306087 */
/* readsocket() must be the last sock_rfd operation before FIONREAD */
if(sock_open_rd && s_poll_rdhup(c->fds, c->sock_rfd->fd) &&
(ioctlsocket(c->sock_rfd->fd, FIONREAD, &bytes) || !bytes)) {
s_log(LOG_INFO, "Read socket closed (read hangup)");
sock_open_rd=0;
}
if(sock_open_wr && s_poll_hup(c->fds, c->sock_wfd->fd)) {
if(c->ssl_ptr) {
s_log(LOG_ERR,
"Write socket closed (write hangup) with %ld unsent byte(s)",
(long)c->ssl_ptr);
throw_exception(c, 1); /* reset the sockets */
}
s_log(LOG_INFO, "Write socket closed (write hangup)");
sock_open_wr=0;
}
/* SSL_read() must be the last ssl_rfd operation before FIONREAD */
if(!(SSL_get_shutdown(c->ssl)&SSL_RECEIVED_SHUTDOWN) &&
s_poll_rdhup(c->fds, c->ssl_rfd->fd) &&
(ioctlsocket(c->ssl_rfd->fd, FIONREAD, &bytes) || !bytes)) {
/* hangup -> buggy (e.g. Microsoft) peer:
* TLS socket closed without close_notify alert */
s_log(LOG_INFO, "TLS socket closed (read hangup)");
SSL_set_shutdown(c->ssl,
SSL_get_shutdown(c->ssl)|SSL_RECEIVED_SHUTDOWN);
}
if(!(SSL_get_shutdown(c->ssl)&SSL_SENT_SHUTDOWN) &&
s_poll_hup(c->fds, c->ssl_wfd->fd)) {
if(c->sock_ptr || write_wants_write) {
s_log(LOG_ERR,
"TLS socket closed (write hangup) with %ld unsent byte(s)",
(long)c->sock_ptr);
throw_exception(c, 1); /* reset the sockets */
}
s_log(LOG_INFO, "TLS socket closed (write hangup)");
SSL_set_shutdown(c->ssl,
SSL_get_shutdown(c->ssl)|SSL_SENT_SHUTDOWN);
}
/****************************** check write shutdown conditions */
if(sock_open_wr && SSL_get_shutdown(c->ssl)&SSL_RECEIVED_SHUTDOWN &&
!c->ssl_ptr) {
sock_open_wr=0; /* no further write allowed */
if(!c->sock_wfd->is_socket) {
s_log(LOG_DEBUG, "Closing the file descriptor");
sock_open_rd=0; /* file descriptor is ready to be closed */
} else if(!shutdown(c->sock_wfd->fd, SHUT_WR)) { /* send TCP FIN */
s_log(LOG_DEBUG, "Sent socket write shutdown");
} else {
s_log(LOG_DEBUG, "Failed to send socket write shutdown");
sock_open_rd=0; /* file descriptor is ready to be closed */
}
}
if(!(SSL_get_shutdown(c->ssl)&SSL_SENT_SHUTDOWN) && !sock_open_rd &&
!c->sock_ptr && !write_wants_write) {
if(SSL_version(c->ssl)!=SSL2_VERSION) {
s_log(LOG_DEBUG, "Sending close_notify alert");
shutdown_wants_write=1;
} else { /* no alerts in SSLv2, including the close_notify alert */
s_log(LOG_DEBUG, "Closing SSLv2 socket");
if(c->ssl_rfd->is_socket)
shutdown(c->ssl_rfd->fd, SHUT_RD); /* notify the kernel */
if(c->ssl_wfd->is_socket)
shutdown(c->ssl_wfd->fd, SHUT_WR); /* send TCP FIN */
/* notify the OpenSSL library */
SSL_set_shutdown(c->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
}
}
/****************************** check watchdog */
if(++watchdog>100) { /* loop executes without transferring any data */
s_log(LOG_ERR,
"transfer() loop executes not transferring any data");
s_log(LOG_ERR,
"please report the problem to Michal.Trojnara@stunnel.org");
stunnel_info(LOG_ERR);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
s_log(LOG_ERR, "protocol=%s, SSL_pending=%d, SSL_has_pending=%d",
SSL_get_version(c->ssl),
SSL_pending(c->ssl), SSL_has_pending(c->ssl));
#else
s_log(LOG_ERR, "protocol=%s, SSL_pending=%d",
SSL_get_version(c->ssl), SSL_pending(c->ssl));
#endif
s_log(LOG_ERR, "sock_open_rd=%s, sock_open_wr=%s",
sock_open_rd ? "Y" : "n", sock_open_wr ? "Y" : "n");
s_log(LOG_ERR, "SSL_RECEIVED_SHUTDOWN=%s, SSL_SENT_SHUTDOWN=%s",
(SSL_get_shutdown(c->ssl) & SSL_RECEIVED_SHUTDOWN) ? "Y" : "n",
(SSL_get_shutdown(c->ssl) & SSL_SENT_SHUTDOWN) ? "Y" : "n");
s_log(LOG_ERR, "sock_can_rd=%s, sock_can_wr=%s",
sock_can_rd ? "Y" : "n", sock_can_wr ? "Y" : "n");
s_log(LOG_ERR, "ssl_can_rd=%s, ssl_can_wr=%s",
ssl_can_rd ? "Y" : "n", ssl_can_wr ? "Y" : "n");
s_log(LOG_ERR, "read_wants_read=%s, read_wants_write=%s",
read_wants_read ? "Y" : "n", read_wants_write ? "Y" : "n");
s_log(LOG_ERR, "write_wants_read=%s, write_wants_write=%s",
write_wants_read ? "Y" : "n", write_wants_write ? "Y" : "n");
s_log(LOG_ERR, "shutdown_wants_read=%s, shutdown_wants_write=%s",
shutdown_wants_read ? "Y" : "n",
shutdown_wants_write ? "Y" : "n");
s_log(LOG_ERR, "socket input buffer: %ld byte(s), "
"TLS input buffer: %ld byte(s)",
(long)c->sock_ptr, (long)c->ssl_ptr);
throw_exception(c, 1);
}
} while(sock_open_wr || !(SSL_get_shutdown(c->ssl)&SSL_SENT_SHUTDOWN) ||
shutdown_wants_read || shutdown_wants_write);
} | 2851 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | context_init | context_init( SERVICE_OPTIONS * section) | ['section'] | int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
/* create TLS context */
#if OPENSSL_VERSION_NUMBER>=0x10100000L
if(section->option.client)
section->ctx=SSL_CTX_new(TLS_client_method());
else /* server mode */
section->ctx=SSL_CTX_new(TLS_server_method());
if(!SSL_CTX_set_min_proto_version(section->ctx,
section->min_proto_version)) {
s_log(LOG_ERR, "Failed to set the minimum protocol version 0x%X",
section->min_proto_version);
return 1; /* FAILED */
}
if(!SSL_CTX_set_max_proto_version(section->ctx,
section->max_proto_version)) {
s_log(LOG_ERR, "Failed to set the maximum protocol version 0x%X",
section->max_proto_version);
return 1; /* FAILED */
}
#else /* OPENSSL_VERSION_NUMBER<0x10100000L */
if(section->option.client)
section->ctx=SSL_CTX_new(section->client_method);
else /* server mode */
section->ctx=SSL_CTX_new(section->server_method);
#endif /* OPENSSL_VERSION_NUMBER<0x10100000L */
if(!section->ctx) {
sslerror("SSL_CTX_new");
return 1; /* FAILED */
}
/* for callbacks */
if(!SSL_CTX_set_ex_data(section->ctx, index_ssl_ctx_opt, section)) {
sslerror("SSL_CTX_set_ex_data");
return 1; /* FAILED */
}
current_section=section; /* setup current section for callbacks */
/* ciphers */
if(section->cipher_list) {
s_log(LOG_DEBUG, "Ciphers: %s", section->cipher_list);
if(!SSL_CTX_set_cipher_list(section->ctx, section->cipher_list)) {
sslerror("SSL_CTX_set_cipher_list");
return 1; /* FAILED */
}
}
#ifndef OPENSSL_NO_TLS1_3
/* ciphersuites */
if(section->ciphersuites) {
s_log(LOG_DEBUG, "TLSv1.3 ciphersuites: %s", section->ciphersuites);
if(!SSL_CTX_set_ciphersuites(section->ctx, section->ciphersuites)) {
sslerror("SSL_CTX_set_ciphersuites");
return 1; /* FAILED */
}
}
#endif /* TLS 1.3 */
/* TLS options: configure the stunnel defaults first */
SSL_CTX_set_options(section->ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3);
#ifdef SSL_OP_NO_COMPRESSION
/* we implemented a better way to disable compression if needed */
SSL_CTX_clear_options(section->ctx, SSL_OP_NO_COMPRESSION);
#endif /* SSL_OP_NO_COMPRESSION */
/* TLS options: configure the user-specified values */
SSL_CTX_set_options(section->ctx,
(SSL_OPTIONS_TYPE)(section->ssl_options_set));
#if OPENSSL_VERSION_NUMBER>=0x009080dfL
SSL_CTX_clear_options(section->ctx,
(SSL_OPTIONS_TYPE)(section->ssl_options_clear));
#endif /* OpenSSL 0.9.8m or later */
/* TLS options: log the configured values */
#if OPENSSL_VERSION_NUMBER>=0x009080dfL
s_log(LOG_DEBUG, "TLS options: 0x%08lX (+0x%08lX, -0x%08lX)",
SSL_CTX_get_options(section->ctx),
section->ssl_options_set, section->ssl_options_clear);
#else /* OpenSSL older than 0.9.8m */
s_log(LOG_DEBUG, "TLS options: 0x%08lX (+0x%08lX)",
SSL_CTX_get_options(section->ctx), section->ssl_options_set);
#endif /* OpenSSL 0.9.8m or later */
/* initialize OpenSSL CONF options */
if(conf_init(section))
return 1; /* FAILED */
/* mode */
#ifdef SSL_MODE_RELEASE_BUFFERS
SSL_CTX_set_mode(section->ctx,
SSL_MODE_ENABLE_PARTIAL_WRITE |
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER |
SSL_MODE_RELEASE_BUFFERS);
#else
SSL_CTX_set_mode(section->ctx,
SSL_MODE_ENABLE_PARTIAL_WRITE |
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
#endif
/* setup session tickets */
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
SSL_CTX_set_session_ticket_cb(section->ctx, generate_session_ticket_cb,
decrypt_session_ticket_cb, NULL);
#endif /* OpenSSL 1.1.1 or later */
#if OPENSSL_VERSION_NUMBER>=0x10000000L
if((section->ticket_key)&&(section->ticket_mac))
SSL_CTX_set_tlsext_ticket_key_cb(section->ctx, ssl_tlsext_ticket_key_cb);
#endif /* OpenSSL 1.0.0 or later */
/* setup session cache */
if(!section->option.client) {
unsigned servname_len=(unsigned)strlen(section->servname);
if(servname_len>SSL_MAX_SSL_SESSION_ID_LENGTH)
servname_len=SSL_MAX_SSL_SESSION_ID_LENGTH;
if(!SSL_CTX_set_session_id_context(section->ctx,
(unsigned char *)section->servname, servname_len)) {
sslerror("SSL_CTX_set_session_id_context");
return 1; /* FAILED */
}
}
SSL_CTX_set_session_cache_mode(section->ctx,
SSL_SESS_CACHE_BOTH | SSL_SESS_CACHE_NO_INTERNAL_STORE);
SSL_CTX_sess_set_cache_size(section->ctx, section->session_size);
SSL_CTX_set_timeout(section->ctx, section->session_timeout);
SSL_CTX_sess_set_new_cb(section->ctx, sess_new_cb);
SSL_CTX_sess_set_get_cb(section->ctx, sess_get_cb);
SSL_CTX_sess_set_remove_cb(section->ctx, sess_remove_cb);
/* set info callback */
SSL_CTX_set_info_callback(section->ctx, info_callback);
/* load certificate and private key to be verified by the peer server */
if(auth_init(section))
return 1; /* FAILED */
/* initialize verification of the peer server certificate */
if(verify_init(section))
return 1; /* FAILED */
/* initialize the DH/ECDH key agreement in the server mode */
if(!section->option.client) {
#ifndef OPENSSL_NO_TLSEXT
SSL_CTX_set_tlsext_servername_callback(section->ctx, servername_cb);
#endif /* OPENSSL_NO_TLSEXT */
#ifndef OPENSSL_NO_DH
dh_init(section); /* ignore the result (errors are not critical) */
#endif /* OPENSSL_NO_DH */
#ifndef OPENSSL_NO_ECDH
ecdh_init(section); /* ignore the result (errors are not critical) */
#endif /* OPENSSL_NO_ECDH */
}
return 0; /* OK */
} | 610 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | dh_init | dh_init( SERVICE_OPTIONS * section) | ['section'] | NOEXPORT int dh_init(SERVICE_OPTIONS *section) {
DH *dh=NULL;
int i, n;
char description[128];
STACK_OF(SSL_CIPHER) *ciphers;
section->option.dh_temp_params=0; /* disable by default */
/* check if DH is actually enabled for this section */
ciphers=SSL_CTX_get_ciphers(section->ctx);
if(!ciphers)
return 1; /* ERROR (unlikely) */
n=sk_SSL_CIPHER_num(ciphers);
for(i=0; i<n; ++i) {
*description='\0';
SSL_CIPHER_description(sk_SSL_CIPHER_value(ciphers, i),
description, sizeof description);
/* s_log(LOG_INFO, "Ciphersuite: %s", description); */
if(strstr(description, " Kx=DH")) {
s_log(LOG_INFO, "DH initialization needed for %s",
SSL_CIPHER_get_name(sk_SSL_CIPHER_value(ciphers, i)));
break;
}
}
if(i==n) { /* no DH ciphers found */
s_log(LOG_INFO, "DH initialization not needed");
return 0; /* OK */
}
s_log(LOG_DEBUG, "DH initialization");
#ifndef OPENSSL_NO_ENGINE
if(!section->engine) /* cert is a file and not an identifier */
#endif
dh=dh_read(section->cert);
if(dh) {
SSL_CTX_set_tmp_dh(section->ctx, dh);
s_log(LOG_INFO, "%d-bit DH parameters loaded", 8*DH_size(dh));
DH_free(dh);
return 0; /* OK */
}
CRYPTO_THREAD_read_lock(stunnel_locks[LOCK_DH]);
SSL_CTX_set_tmp_dh(section->ctx, dh_params);
CRYPTO_THREAD_unlock(stunnel_locks[LOCK_DH]);
dh_temp_params=1; /* generate temporary DH parameters in cron */
section->option.dh_temp_params=1; /* update this section in cron */
s_log(LOG_INFO, "Using dynamic DH parameters");
return 0; /* OK */
} | 254 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | ssl_tlsext_ticket_key_cb | ssl_tlsext_ticket_key_cb( SSL * ssl , unsigned char * key_name , unsigned char * iv , EVP_CIPHER_CTX * ctx , HMAC_CTX * hctx , int enc) | ['ssl', 'key_name', 'iv', 'ctx', 'hctx', 'enc'] | NOEXPORT int ssl_tlsext_ticket_key_cb(SSL *ssl, unsigned char *key_name,
unsigned char *iv, EVP_CIPHER_CTX *ctx, HMAC_CTX *hctx, int enc) {
CLI *c;
const EVP_CIPHER *cipher;
int iv_len;
(void)key_name; /* squash the unused parameter warning */
s_log(LOG_DEBUG, "Session ticket processing callback");
c=SSL_get_ex_data(ssl, index_ssl_cli);
if(!HMAC_Init_ex(hctx, (const unsigned char *)(c->opt->ticket_mac->key_val),
c->opt->ticket_mac->key_len, EVP_sha256(), NULL)) {
s_log(LOG_ERR, "HMAC_Init_ex failed");
return -1;
}
if(c->opt->ticket_key->key_len == 16)
cipher = EVP_aes_128_cbc();
else /* c->opt->ticket_key->key_len == 32 */
cipher = EVP_aes_256_cbc();
if(enc) { /* create new session */
/* EVP_CIPHER_iv_length() returns 16 for either cipher EVP_aes_128_cbc() or EVP_aes_256_cbc() */
iv_len = EVP_CIPHER_iv_length(cipher);
if(RAND_bytes(iv, iv_len) <= 0) { /* RAND_bytes error */
s_log(LOG_ERR, "RAND_bytes failed");
return -1;
}
if(!EVP_EncryptInit_ex(ctx, cipher, NULL,
(const unsigned char *)(c->opt->ticket_key->key_val), iv)) {
s_log(LOG_ERR, "EVP_EncryptInit_ex failed");
return -1;
}
} else /* retrieve session */
if(!EVP_DecryptInit_ex(ctx, cipher, NULL,
(const unsigned char *)(c->opt->ticket_key->key_val), iv)) {
s_log(LOG_ERR, "EVP_DecryptInit_ex failed");
return -1;
}
/* By default, in TLSv1.2 and below, a new session ticket */
/* is not issued on a successful resumption. */
/* In TLSv1.3 the default behaviour is to always issue a new ticket on resumption. */
/* This behaviour can NOT be changed if this ticket key callback is in use! */
if(strcmp(SSL_get_version(c->ssl), "TLSv1.3"))
return 1; /* new session ticket is not issued */
else
return 2; /* session ticket should be replaced */
} | 283 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | get_dh2048 | get_dh2048( void) | ['void'] | DH *get_dh2048(void)
{
static unsigned char dhp_2048[] = {
0xD5, 0x75, 0xF1, 0x23, 0xC1, 0x81, 0x4B, 0x44, 0x23, 0xBE,
0x97, 0x81, 0x7A, 0xDA, 0x97, 0x1F, 0x1F, 0x0D, 0xD5, 0xEC,
0xC5, 0x5F, 0x86, 0x42, 0x7F, 0x38, 0xA3, 0x95, 0xEE, 0xA0,
0x52, 0x2C, 0xB7, 0x20, 0x29, 0xC1, 0xC7, 0xE6, 0x8E, 0x6F,
0xE5, 0xC1, 0x0D, 0xDD, 0x8A, 0xEF, 0x8D, 0xE7, 0xA8, 0x63,
0xB4, 0xF7, 0x58, 0x32, 0x0E, 0x24, 0xAC, 0x30, 0x94, 0xF5,
0xC7, 0x02, 0x81, 0x1B, 0xC7, 0x68, 0xE5, 0x71, 0xD7, 0x1E,
0x3D, 0xE4, 0x2E, 0x2F, 0xC0, 0x0A, 0xED, 0x34, 0xAC, 0xC0,
0x1F, 0x0A, 0x56, 0xA4, 0x12, 0x02, 0xFD, 0x68, 0xD2, 0x4D,
0x5E, 0x0A, 0x5D, 0x78, 0xE3, 0xA0, 0x85, 0x75, 0xD2, 0xA9,
0xC1, 0xF2, 0xAD, 0x65, 0x11, 0xDE, 0xE8, 0x05, 0x68, 0x36,
0x4C, 0x92, 0x99, 0x21, 0xB9, 0x69, 0xD0, 0x6F, 0xD8, 0xA3,
0xEA, 0x35, 0x13, 0x93, 0xDC, 0x1B, 0x13, 0x16, 0xB2, 0x15,
0x8E, 0x10, 0x22, 0xCE, 0x01, 0x1F, 0x1C, 0x09, 0x86, 0xD5,
0xE7, 0xCB, 0xCF, 0xFA, 0xED, 0x2F, 0xE2, 0x3A, 0x65, 0x14,
0xC9, 0xFA, 0x70, 0x99, 0xF7, 0xE0, 0x30, 0xBF, 0x7F, 0xEA,
0x84, 0x14, 0x8A, 0x51, 0xC9, 0xE9, 0x85, 0x73, 0x7F, 0xA1,
0xB0, 0xC3, 0x33, 0x9A, 0xAB, 0x69, 0x4E, 0x75, 0xFB, 0x12,
0xB0, 0x9E, 0xB1, 0xD9, 0xD1, 0xB9, 0x32, 0x1D, 0xC6, 0xD9,
0x2C, 0xAA, 0xB0, 0xC5, 0x3E, 0x69, 0x56, 0xA2, 0xB3, 0xA2,
0x81, 0xCA, 0x9D, 0x77, 0xBB, 0x52, 0x44, 0xA2, 0xED, 0xE0,
0xF0, 0x2A, 0x81, 0x85, 0x90, 0xB6, 0x04, 0x60, 0xEB, 0x09,
0x72, 0x08, 0x44, 0xAF, 0x28, 0xF5, 0x15, 0x34, 0x87, 0x5C,
0x8A, 0xB4, 0x5B, 0x15, 0x6A, 0xAD, 0x27, 0x4E, 0xA0, 0xDE,
0x99, 0x22, 0xCF, 0xAB, 0x4C, 0xFD, 0x75, 0x10, 0x5D, 0xFF,
0xE8, 0x81, 0x50, 0xC4, 0xC0, 0x4B
};
static unsigned char dhg_2048[] = {
0x02
};
DH *dh = DH_new();
BIGNUM *p, *g;
if (dh == NULL)
return NULL;
p = BN_bin2bn(dhp_2048, sizeof(dhp_2048), NULL);
g = BN_bin2bn(dhg_2048, sizeof(dhg_2048), NULL);
if (p == NULL || g == NULL
|| !DH_set0_pqg(dh, p, NULL, g)) {
DH_free(dh);
BN_free(p);
BN_free(g);
return NULL;
}
return dh;
} | 635 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | log_flush | log_flush( LOG_MODE new_mode) | ['new_mode'] | void log_flush(LOG_MODE new_mode) {
CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_LOG_MODE]);
/* prevent changing LOG_MODE_CONFIGURED to LOG_MODE_ERROR
* once stderr file descriptor is closed */
if(log_mode!=LOG_MODE_CONFIGURED || new_mode!=LOG_MODE_ERROR)
log_mode=new_mode;
/* emit the buffered logs (unless we just started buffering) */
if(new_mode!=LOG_MODE_BUFFER) {
/* log_raw() will use the new value of log_mode */
CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_LOG_BUFFER]);
while(head) {
struct LIST *tmp=head;
head=head->next;
log_raw(tmp->opt, tmp->level, tmp->stamp, tmp->id, tmp->text);
str_free(tmp);
}
head=tail=NULL;
CRYPTO_THREAD_unlock(stunnel_locks[LOCK_LOG_BUFFER]);
}
CRYPTO_THREAD_unlock(stunnel_locks[LOCK_LOG_MODE]);
} | 114 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | init_section | init_section( int eof , SERVICE_OPTIONS ** section_ptr) | ['eof', 'section_ptr'] | NOEXPORT int init_section(int eof, SERVICE_OPTIONS **section_ptr) {
char *errstr;
#ifndef USE_WIN32
(*section_ptr)->option.log_stderr=new_global_options.option.log_stderr;
#endif /* USE_WIN32 */
if(*section_ptr==&new_service_options) {
/* end of global options or inetd mode -> initialize globals */
errstr=parse_global_option(CMD_INITIALIZE, NULL, NULL);
if(errstr) {
s_log(LOG_ERR, "Global options: %s", errstr);
return 1;
}
}
if(*section_ptr!=&new_service_options || eof) {
/* end service section or inetd mode -> initialize service */
if(*section_ptr==&new_service_options)
s_log(LOG_INFO, "Initializing inetd mode configuration");
else
s_log(LOG_INFO, "Initializing service [%s]",
(*section_ptr)->servname);
errstr=parse_service_option(CMD_INITIALIZE, section_ptr, NULL, NULL);
if(errstr) {
if(*section_ptr==&new_service_options)
s_log(LOG_ERR, "Inetd mode: %s", errstr);
else
s_log(LOG_ERR, "Service [%s]: %s",
(*section_ptr)->servname, errstr);
return 1;
}
}
return 0;
} | 170 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | options_cmdline | options_cmdline( char * arg1 , char * arg2) | ['arg1', 'arg2'] | int options_cmdline(char *arg1, char *arg2) {
char *name;
CONF_TYPE type;
#ifdef USE_WIN32
(void)arg2; /* squash the unused parameter warning */
#endif
if(!arg1) {
name=
#ifdef CONFDIR
CONFDIR
#ifdef USE_WIN32
"\\"
#else
"/"
#endif
#endif
"stunnel.conf";
type=CONF_FILE;
} else if(!strcasecmp(arg1, "-help")) {
parse_global_option(CMD_PRINT_HELP, NULL, NULL);
parse_service_option(CMD_PRINT_HELP, NULL, NULL, NULL);
log_flush(LOG_MODE_INFO);
return 2;
} else if(!strcasecmp(arg1, "-version")) {
parse_global_option(CMD_PRINT_DEFAULTS, NULL, NULL);
parse_service_option(CMD_PRINT_DEFAULTS, NULL, NULL, NULL);
log_flush(LOG_MODE_INFO);
return 2;
} else if(!strcasecmp(arg1, "-sockets")) {
socket_options_print();
log_flush(LOG_MODE_INFO);
return 2;
} else if(!strcasecmp(arg1, "-options")) {
print_ssl_options();
log_flush(LOG_MODE_INFO);
return 2;
} else
#ifndef USE_WIN32
if(!strcasecmp(arg1, "-fd")) {
if(!arg2) {
s_log(LOG_ERR, "No file descriptor specified");
print_syntax();
return 1;
}
name=arg2;
type=CONF_FD;
} else
#endif
{
name=arg1;
type=CONF_FILE;
}
if(type==CONF_FILE) {
#ifdef HAVE_REALPATH
char *real_path=NULL;
#ifdef MAXPATHLEN
/* a workaround for pre-POSIX.1-2008 4.4BSD and Solaris */
real_path=malloc(MAXPATHLEN);
#endif
real_path=realpath(name, real_path);
if(!real_path) {
s_log(LOG_ERR, "Invalid configuration file name \"%s\"", name);
ioerror("realpath");
return 1;
}
configuration_file=str_dup(real_path);
free(real_path);
#else
configuration_file=str_dup(name);
#endif
#ifndef USE_WIN32
} else if(type==CONF_FD) {
configuration_file=str_dup(name);
#endif
}
return options_parse(type);
} | 322 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | options_defaults | options_defaults() | [] | void options_defaults() {
SERVICE_OPTIONS *service;
/* initialize globals *before* opening the config file */
memset(&new_global_options, 0, sizeof(GLOBAL_OPTIONS));
memset(&new_service_options, 0, sizeof(SERVICE_OPTIONS));
new_service_options.next=NULL;
parse_global_option(CMD_SET_DEFAULTS, NULL, NULL);
service=&new_service_options;
parse_service_option(CMD_SET_DEFAULTS, &service, NULL, NULL);
} | 67 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | options_file | options_file( char * path , CONF_TYPE type , SERVICE_OPTIONS ** section_ptr) | ['path', 'type', 'section_ptr'] | NOEXPORT int options_file(char *path, CONF_TYPE type,
SERVICE_OPTIONS **section_ptr) {
DISK_FILE *df;
char line_text[CONFLINELEN], *errstr;
char config_line[CONFLINELEN], *config_opt, *config_arg;
int i, line_number=0;
#ifndef USE_WIN32
int fd;
char *tmp_str;
#endif
s_log(LOG_NOTICE, "Reading configuration from %s %s",
type==CONF_FD ? "descriptor" : "file", path);
#ifndef USE_WIN32
if(type==CONF_FD) { /* file descriptor */
fd=(int)strtol(path, &tmp_str, 10);
if(tmp_str==path || *tmp_str) { /* not a number */
s_log(LOG_ERR, "Invalid file descriptor number");
print_syntax();
return 1;
}
df=file_fdopen(fd);
} else
#endif
df=file_open(path, FILE_MODE_READ);
if(!df) {
s_log(LOG_ERR, "Cannot open configuration file");
if(type!=CONF_RELOAD)
print_syntax();
return 1;
}
while(file_getline(df, line_text, CONFLINELEN)>=0) {
memcpy(config_line, line_text, CONFLINELEN);
++line_number;
config_opt=config_line;
if(line_number==1) {
if(config_opt[0]==(char)0xef &&
config_opt[1]==(char)0xbb &&
config_opt[2]==(char)0xbf) {
s_log(LOG_NOTICE, "UTF-8 byte order mark detected");
config_opt+=3;
} else {
s_log(LOG_NOTICE, "UTF-8 byte order mark not detected");
}
}
while(isspace((unsigned char)*config_opt))
++config_opt; /* remove initial whitespaces */
for(i=(int)strlen(config_opt)-1; i>=0 && isspace((unsigned char)config_opt[i]); --i)
config_opt[i]='\0'; /* remove trailing whitespaces */
if(config_opt[0]=='\0' || config_opt[0]=='#' || config_opt[0]==';') /* empty or comment */
continue;
if(config_opt[0]=='[' && config_opt[strlen(config_opt)-1]==']') { /* new section */
if(init_section(0, section_ptr)) {
file_close(df);
return 1;
}
/* append a new SERVICE_OPTIONS structure to the list */
{
SERVICE_OPTIONS *new_section;
new_section=str_alloc_detached(sizeof(SERVICE_OPTIONS));
new_section->next=NULL;
(*section_ptr)->next=new_section;
*section_ptr=new_section;
}
/* initialize the newly allocated section */
++config_opt;
config_opt[strlen(config_opt)-1]='\0';
(*section_ptr)->servname=str_dup_detached(config_opt);
(*section_ptr)->session=NULL;
parse_service_option(CMD_SET_COPY, section_ptr, NULL, NULL);
continue;
}
config_arg=strchr(config_line, '=');
if(!config_arg) {
s_log(LOG_ERR, "%s:%d: \"%s\": No '=' found",
path, line_number, line_text);
file_close(df);
return 1;
}
*config_arg++='\0'; /* split into option name and argument value */
for(i=(int)strlen(config_opt)-1; i>=0 && isspace((unsigned char)config_opt[i]); --i)
config_opt[i]='\0'; /* remove trailing whitespaces */
while(isspace((unsigned char)*config_arg))
++config_arg; /* remove initial whitespaces */
errstr=option_not_found;
/* try global options first (e.g. for 'debug') */
if(!new_service_options.next)
errstr=parse_global_option(CMD_SET_VALUE, config_opt, config_arg);
if(errstr==option_not_found)
errstr=parse_service_option(CMD_SET_VALUE, section_ptr, config_opt, config_arg);
if(errstr) {
s_log(LOG_ERR, "%s:%d: \"%s\": %s",
path, line_number, line_text, errstr);
file_close(df);
return 1;
}
}
file_close(df);
return 0;
} | 640 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | options_free | options_free() | [] | void options_free() {
parse_global_option(CMD_FREE, NULL, NULL);
} | 14 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | options_parse | options_parse( CONF_TYPE type) | ['type'] | int options_parse(CONF_TYPE type) {
SERVICE_OPTIONS *section;
options_defaults();
section=&new_service_options;
if(options_file(configuration_file, type, §ion))
return 1;
if(init_section(1, §ion))
return 1;
s_log(LOG_NOTICE, "Configuration successful");
return 0;
} | 58 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | parse_global_option | parse_global_option( CMD cmd , char * opt , char * arg) | ['cmd', 'opt', 'arg'] | NOEXPORT char *parse_global_option(CMD cmd, char *opt, char *arg) {
void *tmp;
if(cmd==CMD_PRINT_DEFAULTS || cmd==CMD_PRINT_HELP) {
s_log(LOG_NOTICE, " ");
s_log(LOG_NOTICE, "Global options:");
}
/* chroot */
#ifdef HAVE_CHROOT
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.chroot_dir=NULL;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
tmp=global_options.chroot_dir;
global_options.chroot_dir=NULL;
str_free(tmp);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "chroot"))
break;
new_global_options.chroot_dir=str_dup(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = directory to chroot stunnel process", "chroot");
break;
}
#endif /* HAVE_CHROOT */
/* compression */
#ifndef OPENSSL_NO_COMP
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.compression=COMP_NONE;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "compression"))
break;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* only allow compression with OpenSSL 0.9.8 or later
* with OpenSSL #1468 zlib memory leak fixed */
if(OpenSSL_version_num()<0x00908051L) /* 0.9.8e-beta1 */
return "Compression unsupported due to a memory leak";
#endif /* OpenSSL version < 1.1.0 */
if(!strcasecmp(arg, "deflate"))
new_global_options.compression=COMP_DEFLATE;
else if(!strcasecmp(arg, "zlib"))
new_global_options.compression=COMP_ZLIB;
else
return "Specified compression type is not available";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = compression type",
"compression");
break;
}
#endif /* !defined(OPENSSL_NO_COMP) */
/* EGD */
switch(cmd) {
case CMD_SET_DEFAULTS:
#ifdef EGD_SOCKET
new_global_options.egd_sock=EGD_SOCKET;
#else
new_global_options.egd_sock=NULL;
#endif
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
tmp=global_options.egd_sock;
global_options.egd_sock=NULL;
str_free(tmp);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "EGD"))
break;
new_global_options.egd_sock=str_dup(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
#ifdef EGD_SOCKET
s_log(LOG_NOTICE, "%-22s = %s", "EGD", EGD_SOCKET);
#endif
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = path to Entropy Gathering Daemon socket", "EGD");
break;
}
#ifndef OPENSSL_NO_ENGINE
/* engine */
switch(cmd) {
case CMD_SET_DEFAULTS:
engine_reset_list();
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
/* FIXME: investigate if we can free it */
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "engine"))
break;
if(!strcasecmp(arg, "auto"))
return engine_auto();
else
return engine_open(arg);
case CMD_INITIALIZE:
engine_init();
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = auto|engine_id",
"engine");
break;
}
/* engineCtrl */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "engineCtrl"))
break;
{
char *tmp_str=strchr(arg, ':');
if(tmp_str)
*tmp_str++='\0';
return engine_ctrl(arg, tmp_str);
}
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = cmd[:arg]",
"engineCtrl");
break;
}
/* engineDefault */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "engineDefault"))
break;
return engine_default(arg);
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = TASK_LIST",
"engineDefault");
break;
}
#endif /* !defined(OPENSSL_NO_ENGINE) */
/* fips */
switch(cmd) {
case CMD_SET_DEFAULTS:
#ifdef USE_FIPS
new_global_options.option.fips=0;
#endif /* USE_FIPS */
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "fips"))
break;
#ifdef USE_FIPS
if(!strcasecmp(arg, "yes"))
new_global_options.option.fips=1;
else if(!strcasecmp(arg, "no"))
new_global_options.option.fips=0;
else
return "The argument needs to be either 'yes' or 'no'";
#else
if(strcasecmp(arg, "no"))
return "FIPS support is not available";
#endif /* USE_FIPS */
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
#ifdef USE_FIPS
s_log(LOG_NOTICE, "%-22s = yes|no FIPS 140-2 mode",
"fips");
#endif /* USE_FIPS */
break;
}
/* foreground */
#ifndef USE_WIN32
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.option.foreground=0;
new_global_options.option.log_stderr=0;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "foreground"))
break;
if(!strcasecmp(arg, "yes")) {
new_global_options.option.foreground=1;
new_global_options.option.log_stderr=1;
} else if(!strcasecmp(arg, "quiet")) {
new_global_options.option.foreground=1;
new_global_options.option.log_stderr=0;
} else if(!strcasecmp(arg, "no")) {
new_global_options.option.foreground=0;
new_global_options.option.log_stderr=0;
} else
return "The argument needs to be either 'yes', 'quiet' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|quiet|no foreground mode (don't fork, log to stderr)",
"foreground");
break;
}
#endif
#ifdef ICON_IMAGE
/* iconActive */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.icon[ICON_ACTIVE]=load_icon_default(ICON_ACTIVE);
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
/* FIXME: investigate if we can free it */
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "iconActive"))
break;
if(!(new_global_options.icon[ICON_ACTIVE]=load_icon_file(arg)))
return "Failed to load the specified icon";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = icon when connections are established", "iconActive");
break;
}
/* iconError */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.icon[ICON_ERROR]=load_icon_default(ICON_ERROR);
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
/* FIXME: investigate if we can free it */
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "iconError"))
break;
if(!(new_global_options.icon[ICON_ERROR]=load_icon_file(arg)))
return "Failed to load the specified icon";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = icon for invalid configuration file", "iconError");
break;
}
/* iconIdle */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.icon[ICON_IDLE]=load_icon_default(ICON_IDLE);
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
/* FIXME: investigate if we can free it */
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "iconIdle"))
break;
if(!(new_global_options.icon[ICON_IDLE]=load_icon_file(arg)))
return "Failed to load the specified icon";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = icon when no connections were established", "iconIdle");
break;
}
#endif /* ICON_IMAGE */
/* log */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.log_file_mode=FILE_MODE_APPEND;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "log"))
break;
if(!strcasecmp(arg, "append"))
new_global_options.log_file_mode=FILE_MODE_APPEND;
else if(!strcasecmp(arg, "overwrite"))
new_global_options.log_file_mode=FILE_MODE_OVERWRITE;
else
return "The argument needs to be either 'append' or 'overwrite'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = append|overwrite log file",
"log");
break;
}
/* output */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.output_file=NULL;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
tmp=global_options.output_file;
global_options.output_file=NULL;
str_free(tmp);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "output"))
break;
new_global_options.output_file=str_dup(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
#ifndef USE_WIN32
if(!new_global_options.option.foreground /* daemonize() used */ &&
new_global_options.output_file /* log file enabled */ &&
new_global_options.output_file[0]!='/' /* relative path */)
return "Log file must include full path name";
#endif
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = file to append log messages", "output");
break;
}
/* pid */
#ifndef USE_WIN32
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.pidfile=NULL; /* do not create a pid file */
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
tmp=global_options.pidfile;
global_options.pidfile=NULL;
str_free(tmp);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "pid"))
break;
if(arg[0]) /* is argument not empty? */
new_global_options.pidfile=str_dup(arg);
else
new_global_options.pidfile=NULL; /* empty -> do not create a pid file */
return NULL; /* OK */
case CMD_INITIALIZE:
if(!new_global_options.option.foreground /* daemonize() used */ &&
new_global_options.pidfile /* pid file enabled */ &&
new_global_options.pidfile[0]!='/' /* relative path */)
return "Pid file must include full path name";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = pid file", "pid");
break;
}
#endif
/* RNDbytes */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.random_bytes=RANDOM_BYTES;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "RNDbytes"))
break;
{
char *tmp_str;
new_global_options.random_bytes=(long)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal number of bytes to read from random seed files";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %d", "RNDbytes", RANDOM_BYTES);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = bytes to read from random seed files", "RNDbytes");
break;
}
/* RNDfile */
switch(cmd) {
case CMD_SET_DEFAULTS:
#ifdef RANDOM_FILE
new_global_options.rand_file=str_dup(RANDOM_FILE);
#else
new_global_options.rand_file=NULL;
#endif
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
tmp=global_options.rand_file;
global_options.rand_file=NULL;
str_free(tmp);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "RNDfile"))
break;
new_global_options.rand_file=str_dup(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
#ifdef RANDOM_FILE
s_log(LOG_NOTICE, "%-22s = %s", "RNDfile", RANDOM_FILE);
#endif
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = path to file with random seed data", "RNDfile");
break;
}
/* RNDoverwrite */
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.option.rand_write=1;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "RNDoverwrite"))
break;
if(!strcasecmp(arg, "yes"))
new_global_options.option.rand_write=1;
else if(!strcasecmp(arg, "no"))
new_global_options.option.rand_write=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = yes", "RNDoverwrite");
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no overwrite seed datafiles with new random data",
"RNDoverwrite");
break;
}
/* syslog */
#ifndef USE_WIN32
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.option.log_syslog=1;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "syslog"))
break;
if(!strcasecmp(arg, "yes"))
new_global_options.option.log_syslog=1;
else if(!strcasecmp(arg, "no"))
new_global_options.option.log_syslog=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no send logging messages to syslog",
"syslog");
break;
}
#endif
/* taskbar */
#ifdef USE_WIN32
switch(cmd) {
case CMD_SET_DEFAULTS:
new_global_options.option.taskbar=1;
break;
case CMD_SET_COPY: /* not used for global options */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "taskbar"))
break;
if(!strcasecmp(arg, "yes"))
new_global_options.option.taskbar=1;
else if(!strcasecmp(arg, "no"))
new_global_options.option.taskbar=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = yes", "taskbar");
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no enable the taskbar icon", "taskbar");
break;
}
#endif
/* final checks */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY:
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
return option_not_found;
case CMD_INITIALIZE:
/* FIPS needs to be initialized as early as possible */
if(ssl_configure(&new_global_options)) /* configure global TLS settings */
return "Failed to initialize TLS";
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
break;
}
return NULL; /* OK */
} | 2173 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | parse_service_option | parse_service_option( CMD cmd , SERVICE_OPTIONS ** section_ptr , char * opt , char * arg) | ['cmd', 'section_ptr', 'opt', 'arg'] | NOEXPORT char *parse_service_option(CMD cmd, SERVICE_OPTIONS **section_ptr,
char *opt, char *arg) {
SERVICE_OPTIONS *section;
int endpoints=0;
#ifndef USE_WIN32
struct group *gr;
struct passwd *pw;
#endif
section=section_ptr ? *section_ptr : NULL;
if(cmd==CMD_SET_DEFAULTS || cmd==CMD_SET_COPY) {
section->ref=1;
} else if(cmd==CMD_FREE) {
if(section==&service_options || section==&new_service_options)
s_log(LOG_DEBUG, "Deallocating section defaults");
else
s_log(LOG_DEBUG, "Deallocating section [%s]", section->servname);
} else if(cmd==CMD_PRINT_DEFAULTS || cmd==CMD_PRINT_HELP) {
s_log(LOG_NOTICE, " ");
s_log(LOG_NOTICE, "Service-level options:");
}
/* accept */
switch(cmd) {
case CMD_SET_DEFAULTS:
addrlist_clear(§ion->local_addr, 1);
section->local_fd=NULL;
break;
case CMD_SET_COPY:
addrlist_clear(§ion->local_addr, 1);
section->local_fd=NULL;
name_list_dup(§ion->local_addr.names,
new_service_options.local_addr.names);
break;
case CMD_FREE:
name_list_free(section->local_addr.names);
str_free(section->local_addr.addr);
str_free(section->local_fd);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "accept"))
break;
section->option.accept=1;
name_list_append(§ion->local_addr.names, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->local_addr.names) {
unsigned i;
if(!addrlist_resolve(§ion->local_addr))
return "Cannot resolve accept target";
section->local_fd=str_alloc_detached(section->local_addr.num*sizeof(SOCKET));
for(i=0; i<section->local_addr.num; ++i)
section->local_fd[i]=INVALID_SOCKET;
++endpoints;
}
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = [host:]port accept connections on specified host:port",
"accept");
break;
}
/* CApath */
switch(cmd) {
case CMD_SET_DEFAULTS:
#if 0
section->ca_dir=(char *)X509_get_default_cert_dir();
#endif
section->ca_dir=NULL;
break;
case CMD_SET_COPY:
section->ca_dir=str_dup_detached(new_service_options.ca_dir);
break;
case CMD_FREE:
str_free(section->ca_dir);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "CApath"))
break;
str_free(section->ca_dir);
if(arg[0]) /* not empty */
section->ca_dir=str_dup_detached(arg);
else
section->ca_dir=NULL;
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
#if 0
s_log(LOG_NOTICE, "%-22s = %s", "CApath",
section->ca_dir ? section->ca_dir : "(none)");
#endif
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = CA certificate directory for 'verify' option",
"CApath");
break;
}
/* CAfile */
switch(cmd) {
case CMD_SET_DEFAULTS:
#if 0
section->ca_file=(char *)X509_get_default_certfile();
#endif
section->ca_file=NULL;
break;
case CMD_SET_COPY:
section->ca_file=str_dup_detached(new_service_options.ca_file);
break;
case CMD_FREE:
str_free(section->ca_file);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "CAfile"))
break;
str_free(section->ca_file);
if(arg[0]) /* not empty */
section->ca_file=str_dup_detached(arg);
else
section->ca_file=NULL;
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
#if 0
s_log(LOG_NOTICE, "%-22s = %s", "CAfile",
section->ca_file ? section->ca_file : "(none)");
#endif
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = CA certificate file for 'verify' option",
"CAfile");
break;
}
/* cert */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->cert=NULL;
break;
case CMD_SET_COPY:
section->cert=str_dup_detached(new_service_options.cert);
break;
case CMD_FREE:
str_free(section->cert);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "cert"))
break;
str_free(section->cert);
section->cert=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
#ifndef OPENSSL_NO_PSK
if(section->psk_keys)
break;
#endif /* !defined(OPENSSL_NO_PSK) */
#ifndef OPENSSL_NO_ENGINE
if(section->engine)
break;
#endif /* !defined(OPENSSL_NO_ENGINE) */
if(!section->option.client && !section->cert)
return "TLS server needs a certificate";
break;
case CMD_PRINT_DEFAULTS:
break; /* no default certificate */
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = certificate chain", "cert");
break;
}
#if OPENSSL_VERSION_NUMBER>=0x10002000L
/* checkEmail */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->check_email=NULL;
break;
case CMD_SET_COPY:
name_list_dup(§ion->check_email,
new_service_options.check_email);
break;
case CMD_FREE:
name_list_free(section->check_email);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "checkEmail"))
break;
name_list_append(§ion->check_email, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->check_email && !section->option.verify_chain && !section->option.verify_peer)
return "Either \"verifyChain\" or \"verifyPeer\" has to be enabled";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = peer certificate email address",
"checkEmail");
break;
}
/* checkHost */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->check_host=NULL;
break;
case CMD_SET_COPY:
name_list_dup(§ion->check_host,
new_service_options.check_host);
break;
case CMD_FREE:
name_list_free(section->check_host);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "checkHost"))
break;
name_list_append(§ion->check_host, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->check_host && !section->option.verify_chain && !section->option.verify_peer)
return "Either \"verifyChain\" or \"verifyPeer\" has to be enabled";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = peer certificate host name pattern",
"checkHost");
break;
}
/* checkIP */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->check_ip=NULL;
break;
case CMD_SET_COPY:
name_list_dup(§ion->check_ip,
new_service_options.check_ip);
break;
case CMD_FREE:
name_list_free(section->check_ip);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "checkIP"))
break;
name_list_append(§ion->check_ip, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->check_ip && !section->option.verify_chain && !section->option.verify_peer)
return "Either \"verifyChain\" or \"verifyPeer\" has to be enabled";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = peer certificate IP address",
"checkIP");
break;
}
#endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
/* ciphers */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->cipher_list=NULL;
break;
case CMD_SET_COPY:
section->cipher_list=str_dup_detached(new_service_options.cipher_list);
break;
case CMD_FREE:
str_free(section->cipher_list);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "ciphers"))
break;
str_free(section->cipher_list);
section->cipher_list=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(!section->cipher_list) {
/* this is only executed for global options, because
* section->cipher_list is no longer NULL in sections */
#ifdef USE_FIPS
if(new_global_options.option.fips)
section->cipher_list=str_dup_detached("FIPS");
else
#endif /* USE_FIPS */
section->cipher_list=str_dup_detached(stunnel_cipher_list);
}
break;
case CMD_PRINT_DEFAULTS:
#ifdef USE_FIPS
s_log(LOG_NOTICE, "%-22s = %s %s", "ciphers",
"FIPS", "(with \"fips = yes\")");
s_log(LOG_NOTICE, "%-22s = %s %s", "ciphers",
stunnel_cipher_list, "(with \"fips = no\")");
#else
s_log(LOG_NOTICE, "%-22s = %s", "ciphers", stunnel_cipher_list);
#endif /* USE_FIPS */
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = permitted ciphers for TLS 1.2 or older", "ciphers");
break;
}
#ifndef OPENSSL_NO_TLS1_3
/* ciphersuites */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->ciphersuites=NULL;
break;
case CMD_SET_COPY:
section->ciphersuites=str_dup_detached(new_service_options.ciphersuites);
break;
case CMD_FREE:
str_free(section->ciphersuites);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "ciphersuites"))
break;
str_free(section->ciphersuites);
section->ciphersuites=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(!section->ciphersuites) {
/* this is only executed for global options, because
* section->ciphersuites is no longer NULL in sections */
section->ciphersuites=str_dup_detached(stunnel_ciphersuites);
}
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %s %s", "ciphersuites", stunnel_ciphersuites, "(with TLSv1.3)");
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = permitted ciphersuites for TLS 1.3", "ciphersuites");
break;
}
#endif /* TLS 1.3 */
/* client */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.client=0;
break;
case CMD_SET_COPY:
section->option.client=new_service_options.option.client;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "client"))
break;
if(!strcasecmp(arg, "yes"))
section->option.client=1;
else if(!strcasecmp(arg, "no"))
section->option.client=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no client mode (remote service uses TLS)",
"client");
break;
}
#if OPENSSL_VERSION_NUMBER>=0x10002000L
/* config */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->config=NULL;
break;
case CMD_SET_COPY:
name_list_dup(§ion->config, new_service_options.config);
break;
case CMD_FREE:
name_list_free(section->config);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "config"))
break;
name_list_append(§ion->config, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = command[:parameter] to execute",
"config");
break;
}
#endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
/* connect */
switch(cmd) {
case CMD_SET_DEFAULTS:
addrlist_clear(§ion->connect_addr, 0);
section->connect_session=NULL;
break;
case CMD_SET_COPY:
addrlist_clear(§ion->connect_addr, 0);
section->connect_session=NULL;
name_list_dup(§ion->connect_addr.names,
new_service_options.connect_addr.names);
break;
case CMD_FREE:
name_list_free(section->connect_addr.names);
str_free(section->connect_addr.addr);
str_free(section->connect_session);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "connect"))
break;
name_list_append(§ion->connect_addr.names, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->connect_addr.names) {
if(!section->option.delayed_lookup &&
!addrlist_resolve(§ion->connect_addr)) {
s_log(LOG_INFO,
"Cannot resolve connect target - delaying DNS lookup");
section->connect_addr.num=0;
section->redirect_addr.num=0;
section->option.delayed_lookup=1;
}
if(section->option.client)
section->connect_session=
str_alloc_detached(section->connect_addr.num*sizeof(SSL_SESSION *));
++endpoints;
}
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = [host:]port to connect",
"connect");
break;
}
/* CRLpath */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->crl_dir=NULL;
break;
case CMD_SET_COPY:
section->crl_dir=str_dup_detached(new_service_options.crl_dir);
break;
case CMD_FREE:
str_free(section->crl_dir);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "CRLpath"))
break;
str_free(section->crl_dir);
if(arg[0]) /* not empty */
section->crl_dir=str_dup_detached(arg);
else
section->crl_dir=NULL;
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = CRL directory", "CRLpath");
break;
}
/* CRLfile */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->crl_file=NULL;
break;
case CMD_SET_COPY:
section->crl_file=str_dup_detached(new_service_options.crl_file);
break;
case CMD_FREE:
str_free(section->crl_file);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "CRLfile"))
break;
str_free(section->crl_file);
if(arg[0]) /* not empty */
section->crl_file=str_dup_detached(arg);
else
section->crl_file=NULL;
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = CRL file", "CRLfile");
break;
}
#ifndef OPENSSL_NO_ECDH
/* curves */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->curves=str_dup_detached(DEFAULT_CURVES);
break;
case CMD_SET_COPY:
section->curves=str_dup_detached(new_service_options.curves);
break;
case CMD_FREE:
str_free(section->curves);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "curves") && strcasecmp(opt, "curve"))
break;
str_free(section->curves);
section->curves=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %s", "curves", DEFAULT_CURVES);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = ECDH curve names", "curves");
break;
}
#endif /* !defined(OPENSSL_NO_ECDH) */
/* debug */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->log_level=LOG_NOTICE;
#if !defined (USE_WIN32) && !defined (__vms)
new_global_options.log_facility=LOG_DAEMON;
#endif
break;
case CMD_SET_COPY:
section->log_level=new_service_options.log_level;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "debug"))
break;
return parse_debug_level(arg, section);
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
#if !defined (USE_WIN32) && !defined (__vms)
s_log(LOG_NOTICE, "%-22s = %s", "debug", "daemon.notice");
#else
s_log(LOG_NOTICE, "%-22s = %s", "debug", "notice");
#endif
break;
case CMD_PRINT_HELP:
#if !defined (USE_WIN32) && !defined (__vms)
s_log(LOG_NOTICE, "%-22s = [facility].level (e.g. daemon.info)", "debug");
#else
s_log(LOG_NOTICE, "%-22s = level (e.g. info)", "debug");
#endif
break;
}
/* delay */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.delayed_lookup=0;
break;
case CMD_SET_COPY:
section->option.delayed_lookup=new_service_options.option.delayed_lookup;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "delay"))
break;
if(!strcasecmp(arg, "yes"))
section->option.delayed_lookup=1;
else if(!strcasecmp(arg, "no"))
section->option.delayed_lookup=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE,
"%-22s = yes|no delay DNS lookup for 'connect' option",
"delay");
break;
}
#ifndef OPENSSL_NO_ENGINE
/* engineId */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY:
section->engine=new_service_options.engine;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "engineId"))
break;
section->engine=engine_get_by_id(arg);
if(!section->engine)
return "Engine ID not found";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = ID of engine to read the key from",
"engineId");
break;
}
/* engineNum */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY:
section->engine=new_service_options.engine;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "engineNum"))
break;
{
char *tmp_str;
int tmp_int=(int)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal engine number";
section->engine=engine_get_by_num(tmp_int-1);
}
if(!section->engine)
return "Illegal engine number";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = number of engine to read the key from",
"engineNum");
break;
}
#endif /* !defined(OPENSSL_NO_ENGINE) */
/* exec */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->exec_name=NULL;
break;
case CMD_SET_COPY:
section->exec_name=str_dup_detached(new_service_options.exec_name);
break;
case CMD_FREE:
str_free(section->exec_name);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "exec"))
break;
str_free(section->exec_name);
section->exec_name=str_dup_detached(arg);
#ifdef USE_WIN32
section->exec_args=str_dup_detached(arg);
#else
if(!section->exec_args) {
section->exec_args=str_alloc_detached(2*sizeof(char *));
section->exec_args[0]=str_dup_detached(section->exec_name);
section->exec_args[1]=NULL; /* null-terminate */
}
#endif
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->exec_name)
++endpoints;
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = file execute local inetd-type program",
"exec");
break;
}
/* execArgs */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->exec_args=NULL;
break;
case CMD_SET_COPY:
#ifdef USE_WIN32
section->exec_args=str_dup_detached(new_service_options.exec_args);
#else
section->exec_args=arg_dup(new_service_options.exec_args);
#endif
break;
case CMD_FREE:
#ifdef USE_WIN32
str_free(section->exec_args);
#else
arg_free(section->exec_args);
#endif
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "execArgs"))
break;
#ifdef USE_WIN32
str_free(section->exec_args);
section->exec_args=str_dup_detached(arg);
#else
arg_free(section->exec_args);
section->exec_args=arg_alloc(arg);
#endif
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = arguments for 'exec' (including $0)",
"execArgs");
break;
}
/* failover */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->failover=FAILOVER_PRIO;
section->rr=0;
break;
case CMD_SET_COPY:
section->failover=new_service_options.failover;
section->rr=new_service_options.rr;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "failover"))
break;
if(!strcasecmp(arg, "rr"))
section->failover=FAILOVER_RR;
else if(!strcasecmp(arg, "prio"))
section->failover=FAILOVER_PRIO;
else
return "The argument needs to be either 'rr' or 'prio'";
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->option.delayed_lookup)
section->failover=FAILOVER_PRIO;
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = rr|prio failover strategy",
"failover");
break;
}
/* ident */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->username=NULL;
break;
case CMD_SET_COPY:
section->username=str_dup_detached(new_service_options.username);
break;
case CMD_FREE:
str_free(section->username);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "ident"))
break;
str_free(section->username);
section->username=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = username for IDENT (RFC 1413) checking", "ident");
break;
}
/* include */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY:
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "include"))
break;
return include_config(arg, section_ptr);
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = directory with configuration file snippets",
"include");
break;
}
/* key */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->key=NULL;
break;
case CMD_SET_COPY:
section->key=str_dup_detached(new_service_options.key);
break;
case CMD_FREE:
str_free(section->key);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "key"))
break;
str_free(section->key);
section->key=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->cert && !section->key)
section->key=str_dup_detached(section->cert);
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = certificate private key", "key");
break;
}
/* libwrap */
#ifdef USE_LIBWRAP
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.libwrap=0; /* disable libwrap by default */
break;
case CMD_SET_COPY:
section->option.libwrap=new_service_options.option.libwrap;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "libwrap"))
break;
if(!strcasecmp(arg, "yes"))
section->option.libwrap=1;
else if(!strcasecmp(arg, "no"))
section->option.libwrap=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no use /etc/hosts.allow and /etc/hosts.deny",
"libwrap");
break;
}
#endif /* USE_LIBWRAP */
/* local */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.local=0;
break;
case CMD_SET_COPY:
section->option.local=new_service_options.option.local;
memcpy(§ion->source_addr, &new_service_options.source_addr,
sizeof(SOCKADDR_UNION));
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "local"))
break;
if(!hostport2addr(§ion->source_addr, arg, "0", 1))
return "Failed to resolve local address";
section->option.local=1;
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = IP address to be used as source for remote"
" connections", "local");
break;
}
/* logId */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->log_id=LOG_ID_SEQUENTIAL;
break;
case CMD_SET_COPY:
section->log_id=new_service_options.log_id;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "logId"))
break;
if(!strcasecmp(arg, "sequential"))
section->log_id=LOG_ID_SEQUENTIAL;
else if(!strcasecmp(arg, "unique"))
section->log_id=LOG_ID_UNIQUE;
else if(!strcasecmp(arg, "thread"))
section->log_id=LOG_ID_THREAD;
else if(!strcasecmp(arg, "process"))
section->log_id=LOG_ID_PROCESS;
else
return "Invalid connection identifier type";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %s", "logId", "sequential");
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = connection identifier type",
"logId");
break;
}
#ifndef OPENSSL_NO_OCSP
/* OCSP */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->ocsp_url=NULL;
break;
case CMD_SET_COPY:
section->ocsp_url=str_dup_detached(new_service_options.ocsp_url);
break;
case CMD_FREE:
str_free(section->ocsp_url);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "ocsp"))
break;
str_free(section->ocsp_url);
section->ocsp_url=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = OCSP responder URL", "OCSP");
break;
}
/* OCSPaia */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.aia=0; /* disable AIA by default */
break;
case CMD_SET_COPY:
section->option.aia=new_service_options.option.aia;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "OCSPaia"))
break;
if(!strcasecmp(arg, "yes"))
section->option.aia=1;
else if(!strcasecmp(arg, "no"))
section->option.aia=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE,
"%-22s = yes|no check the AIA responders from certificates",
"OCSPaia");
break;
}
/* OCSPflag */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->ocsp_flags=0;
break;
case CMD_SET_COPY:
section->ocsp_flags=new_service_options.ocsp_flags;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "OCSPflag"))
break;
{
unsigned long tmp_ulong=parse_ocsp_flag(arg);
if(!tmp_ulong)
return "Illegal OCSP flag";
section->ocsp_flags|=tmp_ulong;
}
return NULL;
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = OCSP responder flags", "OCSPflag");
break;
}
/* OCSPnonce */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.nonce=0; /* disable OCSP nonce by default */
break;
case CMD_SET_COPY:
section->option.nonce=new_service_options.option.nonce;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "OCSPnonce"))
break;
if(!strcasecmp(arg, "yes"))
section->option.nonce=1;
else if(!strcasecmp(arg, "no"))
section->option.nonce=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE,
"%-22s = yes|no send and verify the OCSP nonce extension",
"OCSPnonce");
break;
}
#endif /* !defined(OPENSSL_NO_OCSP) */
/* options */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->ssl_options_set=0;
#if OPENSSL_VERSION_NUMBER>=0x009080dfL
section->ssl_options_clear=0;
#endif /* OpenSSL 0.9.8m or later */
break;
case CMD_SET_COPY:
section->ssl_options_set=new_service_options.ssl_options_set;
#if OPENSSL_VERSION_NUMBER>=0x009080dfL
section->ssl_options_clear=new_service_options.ssl_options_clear;
#endif /* OpenSSL 0.9.8m or later */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "options"))
break;
#if OPENSSL_VERSION_NUMBER>=0x009080dfL
if(*arg=='-') {
long unsigned tmp=parse_ssl_option(arg+1);
if(tmp==INVALID_SSL_OPTION)
return "Illegal TLS option";
section->ssl_options_clear|=tmp;
return NULL; /* OK */
}
#endif /* OpenSSL 0.9.8m or later */
{
long unsigned tmp=parse_ssl_option(arg);
if(tmp==INVALID_SSL_OPTION)
return "Illegal TLS option";
section->ssl_options_set|=tmp;
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %s", "options", "NO_SSLv2");
s_log(LOG_NOTICE, "%-22s = %s", "options", "NO_SSLv3");
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = TLS option to set/reset", "options");
break;
}
/* protocol */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->protocol=NULL;
break;
case CMD_SET_COPY:
section->protocol=str_dup_detached(new_service_options.protocol);
break;
case CMD_FREE:
str_free(section->protocol);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "protocol"))
break;
str_free(section->protocol);
section->protocol=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
/* PROTOCOL_CHECK also initializes:
section->option.connect_before_ssl
section->option.protocol_endpoint */
{
char *tmp_str=protocol(NULL, section, PROTOCOL_CHECK);
if(tmp_str)
return tmp_str;
}
endpoints+=section->option.protocol_endpoint;
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = protocol to negotiate before TLS initialization",
"protocol");
s_log(LOG_NOTICE, "%25scurrently supported: cifs, connect, imap,", "");
s_log(LOG_NOTICE, "%25s nntp, pgsql, pop3, proxy, smtp, socks", "");
break;
}
/* protocolAuthentication */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->protocol_authentication=str_dup_detached("basic");
break;
case CMD_SET_COPY:
section->protocol_authentication=
str_dup_detached(new_service_options.protocol_authentication);
break;
case CMD_FREE:
str_free(section->protocol_authentication);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "protocolAuthentication"))
break;
str_free(section->protocol_authentication);
section->protocol_authentication=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = authentication type for protocol negotiations",
"protocolAuthentication");
break;
}
/* protocolDomain */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->protocol_domain=NULL;
break;
case CMD_SET_COPY:
section->protocol_domain=
str_dup_detached(new_service_options.protocol_domain);
break;
case CMD_FREE:
str_free(section->protocol_domain);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "protocolDomain"))
break;
str_free(section->protocol_domain);
section->protocol_domain=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = domain for protocol negotiations",
"protocolDomain");
break;
}
/* protocolHost */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->protocol_host=NULL;
break;
case CMD_SET_COPY:
section->protocol_host=
str_dup_detached(new_service_options.protocol_host);
break;
case CMD_FREE:
str_free(section->protocol_host);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "protocolHost"))
break;
str_free(section->protocol_host);
section->protocol_host=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = host:port for protocol negotiations",
"protocolHost");
break;
}
/* protocolPassword */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->protocol_password=NULL;
break;
case CMD_SET_COPY:
section->protocol_password=
str_dup_detached(new_service_options.protocol_password);
break;
case CMD_FREE:
str_free(section->protocol_password);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "protocolPassword"))
break;
str_free(section->protocol_password);
section->protocol_password=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = password for protocol negotiations",
"protocolPassword");
break;
}
/* protocolUsername */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->protocol_username=NULL;
break;
case CMD_SET_COPY:
section->protocol_username=
str_dup_detached(new_service_options.protocol_username);
break;
case CMD_FREE:
str_free(section->protocol_username);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "protocolUsername"))
break;
str_free(section->protocol_username);
section->protocol_username=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = username for protocol negotiations",
"protocolUsername");
break;
}
#ifndef OPENSSL_NO_PSK
/* PSKidentity */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->psk_identity=NULL;
section->psk_selected=NULL;
section->psk_sorted.val=NULL;
section->psk_sorted.num=0;
break;
case CMD_SET_COPY:
section->psk_identity=
str_dup_detached(new_service_options.psk_identity);
break;
case CMD_FREE:
str_free(section->psk_identity);
str_free(section->psk_sorted.val);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "PSKidentity"))
break;
str_free(section->psk_identity);
section->psk_identity=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(!section->psk_keys) /* PSK not configured */
break;
psk_sort(§ion->psk_sorted, section->psk_keys);
if(section->option.client) {
if(section->psk_identity) {
section->psk_selected=
psk_find(§ion->psk_sorted, section->psk_identity);
if(!section->psk_selected)
return "No key found for the specified PSK identity";
} else { /* take the first specified identity as default */
section->psk_selected=section->psk_keys;
}
} else {
if(section->psk_identity)
s_log(LOG_NOTICE,
"PSK identity is ignored in the server mode");
}
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = identity for PSK authentication",
"PSKidentity");
break;
}
/* PSKsecrets */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->psk_keys=NULL;
break;
case CMD_SET_COPY:
section->psk_keys=psk_dup(new_service_options.psk_keys);
break;
case CMD_FREE:
psk_free(section->psk_keys);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "PSKsecrets"))
break;
section->psk_keys=psk_read(arg);
if(!section->psk_keys)
return "Failed to read PSK secrets";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = secrets for PSK authentication",
"PSKsecrets");
break;
}
#endif /* !defined(OPENSSL_NO_PSK) */
/* pty */
#ifndef USE_WIN32
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.pty=0;
break;
case CMD_SET_COPY:
section->option.pty=new_service_options.option.pty;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "pty"))
break;
if(!strcasecmp(arg, "yes"))
section->option.pty=1;
else if(!strcasecmp(arg, "no"))
section->option.pty=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no allocate pseudo terminal for 'exec' option",
"pty");
break;
}
#endif
/* redirect */
switch(cmd) {
case CMD_SET_DEFAULTS:
addrlist_clear(§ion->redirect_addr, 0);
break;
case CMD_SET_COPY:
addrlist_clear(§ion->redirect_addr, 0);
name_list_dup(§ion->redirect_addr.names,
new_service_options.redirect_addr.names);
break;
case CMD_FREE:
name_list_free(section->redirect_addr.names);
str_free(section->redirect_addr.addr);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "redirect"))
break;
name_list_append(§ion->redirect_addr.names, arg);
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->redirect_addr.names) {
if(section->option.client)
return "\"redirect\" is unsupported in client sections";
if(section->option.connect_before_ssl)
return "\"redirect\" is incompatible with the specified protocol negotiation";
if(!section->option.delayed_lookup &&
!addrlist_resolve(§ion->redirect_addr)) {
s_log(LOG_INFO,
"Cannot resolve redirect target - delaying DNS lookup");
section->connect_addr.num=0;
section->redirect_addr.num=0;
section->option.delayed_lookup=1;
}
if(!section->option.verify_chain && !section->option.verify_peer)
return "Either \"verifyChain\" or \"verifyPeer\" has to be enabled for \"redirect\" to work";
}
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE,
"%-22s = [host:]port to redirect on authentication failures",
"redirect");
break;
}
/* renegotiation */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.renegotiation=1;
break;
case CMD_SET_COPY:
section->option.renegotiation=new_service_options.option.renegotiation;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "renegotiation"))
break;
if(!strcasecmp(arg, "yes"))
section->option.renegotiation=1;
else if(!strcasecmp(arg, "no"))
section->option.renegotiation=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no support renegotiation",
"renegotiation");
break;
}
/* requireCert */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.require_cert=0;
break;
case CMD_SET_COPY:
section->option.require_cert=new_service_options.option.require_cert;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "requireCert"))
break;
if(!strcasecmp(arg, "yes")) {
section->option.request_cert=1;
section->option.require_cert=1;
} else if(!strcasecmp(arg, "no")) {
section->option.require_cert=0;
} else {
return "The argument needs to be either 'yes' or 'no'";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no require client certificate",
"requireCert");
break;
}
/* reset */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.reset=1; /* enabled by default */
break;
case CMD_SET_COPY:
section->option.reset=new_service_options.option.reset;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "reset"))
break;
if(!strcasecmp(arg, "yes"))
section->option.reset=1;
else if(!strcasecmp(arg, "no"))
section->option.reset=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no send TCP RST on error",
"reset");
break;
}
/* retry */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.retry=0;
break;
case CMD_SET_COPY:
section->option.retry=new_service_options.option.retry;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "retry"))
break;
if(!strcasecmp(arg, "yes"))
section->option.retry=1;
else if(!strcasecmp(arg, "no"))
section->option.retry=0;
else
return "The argument needs to be either 'yes' or 'no'";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no retry connect+exec section",
"retry");
break;
}
#ifndef USE_WIN32
/* service */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->servname=str_dup_detached("stunnel");
break;
case CMD_SET_COPY:
/* servname is *not* copied from the global section */
break;
case CMD_FREE:
/* deallocation is performed at the end CMD_FREE */
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "service"))
break;
str_free(section->servname);
section->servname=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = service name", "service");
break;
}
#endif
#ifndef USE_WIN32
/* setgid */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->gid=0;
break;
case CMD_SET_COPY:
section->gid=new_service_options.gid;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "setgid"))
break;
gr=getgrnam(arg);
if(gr) {
section->gid=gr->gr_gid;
return NULL; /* OK */
}
{
char *tmp_str;
section->gid=(gid_t)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal GID";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = groupname for setgid()", "setgid");
break;
}
#endif
#ifndef USE_WIN32
/* setuid */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->uid=0;
break;
case CMD_SET_COPY:
section->uid=new_service_options.uid;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "setuid"))
break;
pw=getpwnam(arg);
if(pw) {
section->uid=pw->pw_uid;
return NULL; /* OK */
}
{
char *tmp_str;
section->uid=(uid_t)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal UID";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = username for setuid()", "setuid");
break;
}
#endif
/* sessionCacheSize */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->session_size=1000L;
break;
case CMD_SET_COPY:
section->session_size=new_service_options.session_size;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sessionCacheSize"))
break;
{
char *tmp_str;
section->session_size=strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal session cache size";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %ld", "sessionCacheSize", 1000L);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = session cache size", "sessionCacheSize");
break;
}
/* sessionCacheTimeout */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->session_timeout=300L;
break;
case CMD_SET_COPY:
section->session_timeout=new_service_options.session_timeout;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sessionCacheTimeout") && strcasecmp(opt, "session"))
break;
{
char *tmp_str;
section->session_timeout=strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal session cache timeout";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %ld seconds", "sessionCacheTimeout", 300L);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = session cache timeout (in seconds)",
"sessionCacheTimeout");
break;
}
/* sessiond */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.sessiond=0;
memset(§ion->sessiond_addr, 0, sizeof(SOCKADDR_UNION));
section->sessiond_addr.in.sin_family=AF_INET;
break;
case CMD_SET_COPY:
section->option.sessiond=new_service_options.option.sessiond;
memcpy(§ion->sessiond_addr, &new_service_options.sessiond_addr,
sizeof(SOCKADDR_UNION));
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sessiond"))
break;
section->option.sessiond=1;
#ifdef SSL_OP_NO_TICKET
/* disable RFC4507 support introduced in OpenSSL 0.9.8f */
/* this prevents session callbacks from being executed */
section->ssl_options_set|=SSL_OP_NO_TICKET;
#endif
if(!name2addr(§ion->sessiond_addr, arg, 0))
return "Failed to resolve sessiond server address";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = [host:]port use sessiond at host:port",
"sessiond");
break;
}
#ifndef OPENSSL_NO_TLSEXT
/* sni */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->servername_list_head=NULL;
section->servername_list_tail=NULL;
break;
case CMD_SET_COPY:
section->sni=
str_dup_detached(new_service_options.sni);
break;
case CMD_FREE:
str_free(section->sni);
sni_free(section);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sni"))
break;
str_free(section->sni);
section->sni=str_dup_detached(arg);
return NULL; /* OK */
case CMD_INITIALIZE:
{
char *tmp_str=sni_init(section);
if(tmp_str)
return tmp_str;
}
if(!section->option.client && section->sni)
++endpoints;
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = master_service:host_name for an SNI virtual service",
"sni");
break;
}
#endif /* !defined(OPENSSL_NO_TLSEXT) */
/* socket */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->sock_opts=socket_options_init();
break;
case CMD_SET_COPY:
section->sock_opts=socket_options_dup(new_service_options.sock_opts);
break;
case CMD_FREE:
socket_options_free(section->sock_opts);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "socket"))
break;
if(socket_option_parse(section->sock_opts, arg))
return "Illegal socket option";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = a|l|r:option=value[:value]", "socket");
s_log(LOG_NOTICE, "%25sset an option on accept/local/remote socket", "");
break;
}
#if OPENSSL_VERSION_NUMBER>=0x10100000L
/* sslVersion */
switch(cmd) {
case CMD_SET_DEFAULTS:
/* handled in sslVersionMax and sslVersionMin */
break;
case CMD_SET_COPY:
/* handled in sslVersionMax and sslVersionMin */
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sslVersion"))
break;
section->max_proto_version=
section->min_proto_version=str_to_proto_version(arg);
if(section->max_proto_version==-1)
return "Invalid protocol version";
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->max_proto_version && section->min_proto_version &&
section->max_proto_version<section->min_proto_version)
return "Invalid protocol version range";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = all"
"|SSLv3|TLSv1|TLSv1.1|TLSv1.2"
#ifdef TLS1_3_VERSION
"|TLSv1.3"
#endif
" TLS version", "sslVersion");
break;
}
/* sslVersionMax */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->max_proto_version=0; /* highest supported */
break;
case CMD_SET_COPY:
section->max_proto_version=new_service_options.max_proto_version;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sslVersionMax"))
break;
section->max_proto_version=str_to_proto_version(arg);
if(section->max_proto_version==-1)
return "Invalid protocol version";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = all"
"|SSLv3|TLSv1|TLSv1.1|TLSv1.2"
#ifdef TLS1_3_VERSION
"|TLSv1.3"
#endif
" TLS version", "sslVersionMax");
break;
}
/* sslVersionMin */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->min_proto_version=TLS1_VERSION;
break;
case CMD_SET_COPY:
section->min_proto_version=new_service_options.min_proto_version;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sslVersionMin"))
break;
section->min_proto_version=str_to_proto_version(arg);
if(section->min_proto_version==-1)
return "Invalid protocol version";
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = all"
"|SSLv3|TLSv1|TLSv1.1|TLSv1.2"
#ifdef TLS1_3_VERSION
"|TLSv1.3"
#endif
" TLS version", "sslVersionMin");
break;
}
#else /* OPENSSL_VERSION_NUMBER<0x10100000L */
/* sslVersion */
switch(cmd) {
case CMD_SET_DEFAULTS:
tls_methods_set(section, NULL);
break;
case CMD_SET_COPY:
section->client_method=new_service_options.client_method;
section->server_method=new_service_options.server_method;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "sslVersion"))
break;
return tls_methods_set(section, arg);
case CMD_INITIALIZE:
{
char *tmp_str=tls_methods_check(section);
if(tmp_str)
return tmp_str;
}
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = all"
"|SSLv2|SSLv3|TLSv1"
#if OPENSSL_VERSION_NUMBER>=0x10001000L
"|TLSv1.1|TLSv1.2"
#endif /* OPENSSL_VERSION_NUMBER>=0x10001000L */
" TLS method", "sslVersion");
break;
}
#endif /* OPENSSL_VERSION_NUMBER<0x10100000L */
#ifndef USE_FORK
/* stack */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->stack_size=DEFAULT_STACK_SIZE;
break;
case CMD_SET_COPY:
section->stack_size=new_service_options.stack_size;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "stack"))
break;
{
char *tmp_str;
section->stack_size=(size_t)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal thread stack size";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %d bytes", "stack", DEFAULT_STACK_SIZE);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = thread stack size (in bytes)", "stack");
break;
}
#endif
#if OPENSSL_VERSION_NUMBER>=0x10000000L
/* ticketKeySecret */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->ticket_key=NULL;
break;
case CMD_SET_COPY:
section->ticket_key=key_dup(new_service_options.ticket_key);
break;
case CMD_FREE:
key_free(section->ticket_key);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "ticketKeySecret"))
break;
section->ticket_key=key_read(arg, "ticketKeySecret");
if(!section->ticket_key)
return "Failed to read ticketKeySecret";
return NULL; /* OK */
case CMD_INITIALIZE:
if(!section->ticket_key) /* ticketKeySecret not configured */
break;
if(section->option.client){
s_log(LOG_NOTICE,
"ticketKeySecret is ignored in the client mode");
break;
}
if(section->ticket_key && !section->ticket_mac)
return "\"ticketKeySecret\" and \"ticketMacSecret\" must be set together";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = secret key for encryption/decryption TLSv1.3 tickets",
"ticketKeySecret");
break;
}
/* ticketMacSecret */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->ticket_mac=NULL;
break;
case CMD_SET_COPY:
section->ticket_mac=key_dup(new_service_options.ticket_mac);
break;
case CMD_FREE:
key_free(section->ticket_mac);
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "ticketMacSecret"))
break;
section->ticket_mac=key_read(arg, "ticketMacSecret");
if(!section->ticket_mac)
return "Failed to read ticketMacSecret";
return NULL; /* OK */
case CMD_INITIALIZE:
if(!section->ticket_mac) /* ticketMacSecret not configured */
break;
if(section->option.client){
s_log(LOG_NOTICE,
"ticketMacSecret is ignored in the client mode");
break;
}
if(section->ticket_mac && !section->ticket_key)
return "\"ticketKeySecret\" and \"ticketMacSecret\" must be set together";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = key for HMAC operations on TLSv1.3 tickets",
"ticketMacSecret");
break;
}
#endif /* OpenSSL 1.0.0 or later */
/* TIMEOUTbusy */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->timeout_busy=300; /* 5 minutes */
break;
case CMD_SET_COPY:
section->timeout_busy=new_service_options.timeout_busy;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "TIMEOUTbusy"))
break;
{
char *tmp_str;
section->timeout_busy=(int)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal busy timeout";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %d seconds", "TIMEOUTbusy", 300);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = seconds to wait for expected data", "TIMEOUTbusy");
break;
}
/* TIMEOUTclose */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->timeout_close=60; /* 1 minute */
break;
case CMD_SET_COPY:
section->timeout_close=new_service_options.timeout_close;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "TIMEOUTclose"))
break;
{
char *tmp_str;
section->timeout_close=(int)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal close timeout";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %d seconds", "TIMEOUTclose", 60);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = seconds to wait for close_notify",
"TIMEOUTclose");
break;
}
/* TIMEOUTconnect */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->timeout_connect=10; /* 10 seconds */
break;
case CMD_SET_COPY:
section->timeout_connect=new_service_options.timeout_connect;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "TIMEOUTconnect"))
break;
{
char *tmp_str;
section->timeout_connect=(int)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal connect timeout";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %d seconds", "TIMEOUTconnect", 10);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = seconds to connect remote host", "TIMEOUTconnect");
break;
}
/* TIMEOUTidle */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->timeout_idle=43200; /* 12 hours */
break;
case CMD_SET_COPY:
section->timeout_idle=new_service_options.timeout_idle;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "TIMEOUTidle"))
break;
{
char *tmp_str;
section->timeout_idle=(int)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str) /* not a number */
return "Illegal idle timeout";
return NULL; /* OK */
}
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = %d seconds", "TIMEOUTidle", 43200);
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = seconds to keep an idle connection", "TIMEOUTidle");
break;
}
/* transparent */
#ifndef USE_WIN32
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.transparent_src=0;
section->option.transparent_dst=0;
break;
case CMD_SET_COPY:
section->option.transparent_src=new_service_options.option.transparent_src;
section->option.transparent_dst=new_service_options.option.transparent_dst;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "transparent"))
break;
if(!strcasecmp(arg, "none") || !strcasecmp(arg, "no")) {
section->option.transparent_src=0;
section->option.transparent_dst=0;
} else if(!strcasecmp(arg, "source") || !strcasecmp(arg, "yes")) {
section->option.transparent_src=1;
section->option.transparent_dst=0;
} else if(!strcasecmp(arg, "destination")) {
section->option.transparent_src=0;
section->option.transparent_dst=1;
} else if(!strcasecmp(arg, "both")) {
section->option.transparent_src=1;
section->option.transparent_dst=1;
} else
return "Selected transparent proxy mode is not available";
return NULL; /* OK */
case CMD_INITIALIZE:
if(section->option.transparent_dst)
++endpoints;
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE,
"%-22s = none|source|destination|both transparent proxy mode",
"transparent");
break;
}
#endif
/* verify */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.request_cert=0;
break;
case CMD_SET_COPY:
section->option.request_cert=new_service_options.option.request_cert;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "verify"))
break;
{
char *tmp_str;
int tmp_int=(int)strtol(arg, &tmp_str, 10);
if(tmp_str==arg || *tmp_str || tmp_int<0 || tmp_int>4)
return "Bad verify level";
section->option.request_cert=1;
section->option.require_cert=(tmp_int>=2);
section->option.verify_chain=(tmp_int>=1 && tmp_int<=3);
section->option.verify_peer=(tmp_int>=3);
}
return NULL; /* OK */
case CMD_INITIALIZE:
if((section->option.verify_chain || section->option.verify_peer) &&
!section->ca_file && !section->ca_dir)
return "Either \"CAfile\" or \"CApath\" has to be configured";
break;
case CMD_PRINT_DEFAULTS:
s_log(LOG_NOTICE, "%-22s = none", "verify");
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE,
"%-22s = level of peer certificate verification", "verify");
s_log(LOG_NOTICE,
"%25slevel 0 - request and ignore peer cert", "");
s_log(LOG_NOTICE,
"%25slevel 1 - only validate peer cert if present", "");
s_log(LOG_NOTICE,
"%25slevel 2 - always require a valid peer cert", "");
s_log(LOG_NOTICE,
"%25slevel 3 - verify peer with locally installed cert", "");
s_log(LOG_NOTICE,
"%25slevel 4 - ignore CA chain and only verify peer cert", "");
break;
}
/* verifyChain */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.verify_chain=0;
break;
case CMD_SET_COPY:
section->option.verify_chain=new_service_options.option.verify_chain;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "verifyChain"))
break;
if(!strcasecmp(arg, "yes")) {
section->option.request_cert=1;
section->option.require_cert=1;
section->option.verify_chain=1;
} else if(!strcasecmp(arg, "no")) {
section->option.verify_chain=0;
} else {
return "The argument needs to be either 'yes' or 'no'";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no verify certificate chain",
"verifyChain");
break;
}
/* verifyPeer */
switch(cmd) {
case CMD_SET_DEFAULTS:
section->option.verify_peer=0;
break;
case CMD_SET_COPY:
section->option.verify_peer=new_service_options.option.verify_peer;
break;
case CMD_FREE:
break;
case CMD_SET_VALUE:
if(strcasecmp(opt, "verifyPeer"))
break;
if(!strcasecmp(arg, "yes")) {
section->option.request_cert=1;
section->option.require_cert=1;
section->option.verify_peer=1;
} else if(!strcasecmp(arg, "no")) {
section->option.verify_peer=0;
} else {
return "The argument needs to be either 'yes' or 'no'";
}
return NULL; /* OK */
case CMD_INITIALIZE:
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
s_log(LOG_NOTICE, "%-22s = yes|no verify peer certificate",
"verifyPeer");
break;
}
/* final checks */
switch(cmd) {
case CMD_SET_DEFAULTS:
break;
case CMD_SET_COPY:
break;
case CMD_FREE:
str_free(section->chain);
if(section->session)
SSL_SESSION_free(section->session);
if(section->ctx)
SSL_CTX_free(section->ctx);
str_free(section->servname);
if(section==&service_options)
memset(section, 0, sizeof(SERVICE_OPTIONS));
else
str_free(section);
break;
case CMD_SET_VALUE:
return option_not_found;
case CMD_INITIALIZE:
if(section!=&new_service_options) { /* daemon mode checks */
if(endpoints!=2)
return "Each service must define two endpoints";
} else { /* inetd mode checks */
if(section->option.accept)
return "'accept' option is only allowed in a [section]";
/* no need to check for section->sni in inetd mode,
as it requires valid sections to be set */
if(endpoints!=1)
return "Inetd mode must define one endpoint";
}
#ifdef SSL_OP_NO_TICKET
/* disable RFC4507 support introduced in OpenSSL 0.9.8f */
/* OpenSSL 1.1.1 is required to serialize application data
* into session tickets */
/* server mode sections need it for the "redirect" option
* and connect address session persistence */
if(OpenSSL_version_num()<0x10101000L &&
!section->option.client &&
!section->option.connect_before_ssl)
section->ssl_options_set|=SSL_OP_NO_TICKET;
#endif /* SSL_OP_NO_TICKET */
if(context_init(section)) /* initialize TLS context */
return "Failed to initialize TLS context";
break;
case CMD_PRINT_DEFAULTS:
break;
case CMD_PRINT_HELP:
break;
}
return NULL; /* OK */
} | 9679 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | base64 | base64( int encode , const char * in , int len) | ['encode', 'in', 'len'] | NOEXPORT char *base64(int encode, const char *in, int len) {
BIO *bio, *b64;
char *out;
int n;
b64=BIO_new(BIO_f_base64());
if(!b64)
return NULL;
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
bio=BIO_new(BIO_s_mem());
if(!bio) {
str_free(b64);
return NULL;
}
if(encode)
bio=BIO_push(b64, bio);
BIO_write(bio, in, len);
(void)BIO_flush(bio); /* ignore the error if any */
if(encode) {
bio=BIO_pop(bio);
BIO_free(b64);
} else {
bio=BIO_push(b64, bio);
}
n=BIO_pending(bio);
/* 32 bytes as a safety precaution for passing decoded data to crypt_DES */
/* n+1 to get null-terminated string on encode */
out=str_alloc(n<32?32:(size_t)n+1);
n=BIO_read(bio, out, n);
if(n<0) {
BIO_free_all(bio);
str_free(out);
return NULL;
}
BIO_free_all(bio);
return out;
} | 202 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | DH_set0_pqg | DH_set0_pqg( DH * dh , BIGNUM * p , BIGNUM * q , BIGNUM * g) | ['dh', 'p', 'q', 'g'] | int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
if(!p || !g) /* q is optional */
return 0;
BN_free(dh->p);
BN_free(dh->q);
BN_free(dh->g);
dh->p = p;
dh->q = q;
dh->g = g;
if(q)
dh->length = BN_num_bits(q);
return 1;
} | 86 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | ssl_init | ssl_init( void) | ['void'] | int ssl_init(void) { /* init TLS before parsing configuration file */
#if OPENSSL_VERSION_NUMBER>=0x10100000L
OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_LOAD_CONFIG, NULL);
#else
OPENSSL_config(NULL);
SSL_load_error_strings();
SSL_library_init();
#endif
index_ssl_cli=SSL_get_ex_new_index(0,
"CLI pointer", NULL, NULL, NULL);
index_ssl_ctx_opt=SSL_CTX_get_ex_new_index(0,
"SERVICE_OPTIONS pointer", NULL, NULL, NULL);
index_session_authenticated=SSL_SESSION_get_ex_new_index(0,
"session authenticated", NULL, NULL, NULL);
index_session_connect_address=SSL_SESSION_get_ex_new_index(0,
"session connect address", NULL, cb_dup_addr, cb_free_addr);
if(index_ssl_cli<0 || index_ssl_ctx_opt<0 ||
index_session_authenticated<0 ||
index_session_connect_address<0) {
s_log(LOG_ERR, "Application specific data initialization failed");
return 1;
}
#ifndef OPENSSL_NO_ENGINE
ENGINE_load_builtin_engines();
#endif
#ifndef OPENSSL_NO_DH
dh_params=get_dh2048();
if(!dh_params) {
s_log(LOG_ERR, "Failed to get default DH parameters");
return 1;
}
#endif /* OPENSSL_NO_DH */
return 0;
} | 150 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | bind_ports | bind_ports( void) | ['void'] | int bind_ports(void) {
SERVICE_OPTIONS *opt;
int listening_section;
#ifdef USE_LIBWRAP
/* execute after options_cmdline() to know service_options.next,
* but as early as possible to avoid leaking file descriptors */
/* retry on each bind_ports() in case stunnel.conf was reloaded
without "libwrap = no" */
libwrap_init();
#endif /* USE_LIBWRAP */
s_poll_init(fds, 1);
/* allow clean unbind_ports() even though
bind_ports() was not fully performed */
for(opt=service_options.next; opt; opt=opt->next) {
unsigned i;
for(i=0; i<opt->local_addr.num; ++i)
opt->local_fd[i]=INVALID_SOCKET;
}
listening_section=0;
for(opt=service_options.next; opt; opt=opt->next) {
opt->bound_ports=0;
if(opt->local_addr.num) { /* ports to bind for this service */
unsigned i;
s_log(LOG_DEBUG, "Binding service [%s]", opt->servname);
for(i=0; i<opt->local_addr.num; ++i) {
SOCKET fd;
fd=bind_port(opt, listening_section, i);
opt->local_fd[i]=fd;
if(fd!=INVALID_SOCKET) {
s_poll_add(fds, fd, 1, 0);
++opt->bound_ports;
}
}
if(!opt->bound_ports) {
s_log(LOG_ERR, "Binding service [%s] failed", opt->servname);
return 1;
}
++listening_section;
} else if(opt->exec_name && opt->connect_addr.names) {
s_log(LOG_DEBUG, "Skipped exec+connect service [%s]", opt->servname);
#ifndef OPENSSL_NO_TLSEXT
} else if(!opt->option.client && opt->sni) {
s_log(LOG_DEBUG, "Skipped SNI slave service [%s]", opt->servname);
#endif
} else { /* each service must define two endpoints */
s_log(LOG_ERR, "Invalid service [%s]", opt->servname);
return 1;
}
}
if(listening_section<systemd_fds) {
s_log(LOG_ERR,
"Too many listening file descriptors received from systemd, got %d",
systemd_fds);
return 1;
}
return 0; /* OK */
} | 308 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | main_cleanup | main_cleanup() | [] | void main_cleanup() {
#ifdef USE_OS_THREADS
CLI *c;
unsigned i, threads;
THREAD_ID *thread_list;
CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_THREAD_LIST]);
threads=0;
for(c=thread_head; c; c=c->thread_next) /* count client threads */
threads++;
thread_list=str_alloc((threads+1)*sizeof(THREAD_ID));
i=0;
for(c=thread_head; c; c=c->thread_next) { /* copy client threads */
thread_list[i++]=c->thread_id;
s_log(LOG_DEBUG, "Terminating a thread for [%s]", c->opt->servname);
}
if(cron_thread_id) { /* append cron_thread_id if used */
thread_list[threads++]=cron_thread_id;
s_log(LOG_DEBUG, "Terminating the cron thread");
}
CRYPTO_THREAD_unlock(stunnel_locks[LOCK_THREAD_LIST]);
if(threads) {
s_log(LOG_NOTICE, "Terminating %u service thread(s)", threads);
writesocket(terminate_pipe[1], "", 1);
for(i=0; i<threads; ++i) { /* join client threads */
#ifdef USE_PTHREAD
if(pthread_join(thread_list[i], NULL))
s_log(LOG_ERR, "pthread_join() failed");
#endif
#ifdef USE_WIN32
if(WaitForSingleObject(thread_list[i], INFINITE)==WAIT_FAILED)
ioerror("WaitForSingleObject");
if(!CloseHandle(thread_list[i]))
ioerror("CloseHandle");
#endif
}
s_log(LOG_NOTICE, "Service threads terminated");
}
str_free(thread_list);
#endif /* USE_OS_THREADS */
unbind_ports();
s_poll_free(fds);
fds=NULL;
#if 0
str_stats(); /* main thread allocation tracking */
#endif
log_flush(LOG_MODE_ERROR);
log_close(SINK_SYSLOG|SINK_OUTFILE);
} | 272 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | main_configure | main_configure( char * arg1 , char * arg2) | ['arg1', 'arg2'] | int main_configure(char *arg1, char *arg2) {
int cmdline_status;
cmdline_status=options_cmdline(arg1, arg2);
if(cmdline_status) /* cannot proceed */
return cmdline_status;
options_apply();
str_canary_init(); /* needs prng initialization from options_cmdline */
/* log_open(SINK_SYSLOG) must be called before change_root()
* to be able to access /dev/log socket */
log_open(SINK_SYSLOG);
if(bind_ports())
return 1;
#ifdef HAVE_CHROOT
/* change_root() must be called before drop_privileges()
* since chroot() needs root privileges */
if(change_root())
return 1;
#endif /* HAVE_CHROOT */
if(drop_privileges(1))
return 1;
/* log_open(SINK_OUTFILE) must be called after drop_privileges()
* or logfile rotation won't be possible */
if(log_open(SINK_OUTFILE))
return 1;
#ifndef USE_FORK
num_clients=0; /* the first valid config */
#endif
/* log_flush(LOG_MODE_CONFIGURED) must be called before daemonize()
* since daemonize() invalidates stderr */
log_flush(LOG_MODE_CONFIGURED);
return 0;
} | 94 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | main_init | main_init() | [] | void main_init() { /* one-time initialization */
#ifdef USE_SYSTEMD
int i;
systemd_fds=sd_listen_fds(1);
if(systemd_fds<0)
fatal("systemd initialization failed");
listen_fds_start=SD_LISTEN_FDS_START;
/* set non-blocking mode on systemd file descriptors */
for(i=0; i<systemd_fds; ++i)
set_nonblock(listen_fds_start+i, 1);
#else
systemd_fds=0; /* no descriptors received */
listen_fds_start=3; /* the value is not really important */
#endif
/* basic initialization contains essential functions required for logging
* subsystem to function properly, thus all errors here are fatal */
if(ssl_init()) /* initialize TLS library */
fatal("TLS initialization failed");
if(sthreads_init()) /* initialize critical sections & TLS callbacks */
fatal("Threads initialization failed");
options_defaults();
options_apply();
#ifndef USE_FORK
get_limits(); /* required by setup_fd() */
#endif
fds=s_poll_alloc();
if(pipe_init(signal_pipe, "signal_pipe"))
fatal("Signal pipe initialization failed: "
"check your personal firewall");
if(pipe_init(terminate_pipe, "terminate_pipe"))
fatal("Terminate pipe initialization failed: "
"check your personal firewall");
stunnel_info(LOG_NOTICE);
if(systemd_fds>0)
s_log(LOG_INFO, "Systemd socket activation: %d descriptors received",
systemd_fds);
} | 150 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | reload_config | reload_config() | [] | NOEXPORT void reload_config() {
static int delay=10; /* 10ms */
#ifdef HAVE_CHROOT
struct stat sb;
#endif /* HAVE_CHROOT */
if(options_parse(CONF_RELOAD)) {
s_log(LOG_ERR, "Failed to reload the configuration file");
return;
}
unbind_ports();
log_flush(LOG_MODE_BUFFER);
#ifdef HAVE_CHROOT
/* we don't close SINK_SYSLOG if chroot is enabled and
* there is no /dev/log inside it, which could allow
* openlog(3) to reopen the syslog socket later */
if(global_options.chroot_dir && stat("/dev/log", &sb))
log_close(SINK_OUTFILE);
else
#endif /* HAVE_CHROOT */
log_close(SINK_SYSLOG|SINK_OUTFILE);
/* there is no race condition here:
* client threads are not allowed to use global options */
options_free();
options_apply();
/* we hope that a sane openlog(3) implementation won't
* attempt to reopen /dev/log if it's already open */
log_open(SINK_SYSLOG|SINK_OUTFILE);
log_flush(LOG_MODE_CONFIGURED);
ui_config_reloaded();
/* we use "|" instead of "||" to attempt initialization of both subsystems */
if(bind_ports() | exec_connect_start()) {
s_poll_sleep(delay/1000, delay%1000); /* sleep to avoid log trashing */
signal_post(SIGNAL_RELOAD_CONFIG); /* retry */
delay*=2;
if(delay > 10000) /* 10s */
delay=10000;
} else {
delay=10; /* 10ms */
}
} | 143 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | unbind_ports | unbind_ports( void) | ['void'] | void unbind_ports(void) {
SERVICE_OPTIONS *opt;
s_poll_init(fds, 1);
CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_SECTIONS]);
opt=service_options.next;
service_options.next=NULL;
service_free(&service_options);
while(opt) {
unsigned i;
s_log(LOG_DEBUG, "Unbinding service [%s]", opt->servname);
for(i=0; i<opt->local_addr.num; ++i)
unbind_port(opt, i);
/* exec+connect service */
if(opt->exec_name && opt->connect_addr.names) {
/* create exec+connect services */
/* FIXME: this is just a crude workaround */
/* is it better to kill the service? */
/* FIXME: this won't work with FORK threads */
opt->option.retry=0;
}
/* purge session cache of the old SSL_CTX object */
/* this workaround won't be needed anymore after */
/* delayed deallocation calls SSL_CTX_free() */
if(opt->ctx)
SSL_CTX_flush_sessions(opt->ctx,
(long)time(NULL)+opt->session_timeout+1);
s_log(LOG_DEBUG, "Service [%s] closed", opt->servname);
{
SERVICE_OPTIONS *garbage=opt;
opt=opt->next;
garbage->next=NULL;
service_free(garbage);
}
}
CRYPTO_THREAD_unlock(stunnel_locks[LOCK_SECTIONS]);
} | 180 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | daemon_thread | daemon_thread( void * arg) | ['arg'] | NOEXPORT unsigned __stdcall daemon_thread(void *arg) {
(void)arg; /* squash the unused parameter warning */
tls_alloc(NULL, NULL, "main"); /* new thread-local storage */
main_init();
SetEvent(main_initialized); /* unlock the GUI thread */
/* get a valid configuration */
while(main_configure(cmdline.config_file, NULL)) {
if(cmdline.config_file && *cmdline.config_file=='-')
cmdline.config_file=NULL; /* don't retry commandline switches */
unbind_ports(); /* in case initialization failed after bind_ports() */
log_flush(LOG_MODE_ERROR); /* otherwise logs are buffered */
PostMessage(hwnd, WM_INVALID_CONFIG, 0, 0); /* display error */
WaitForSingleObject(config_ready, INFINITE);
}
PostMessage(hwnd, WM_VALID_CONFIG, 0, 0);
/* start the main loop */
daemon_loop();
main_cleanup();
_endthreadex(0); /* SIGNAL_TERMINATE received */
return 0;
} | 117 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | tray_update | tray_update( const int num) | ['num'] | NOEXPORT void tray_update(const int num) {
NOTIFYICONDATA nid;
static ICON_TYPE previous_icon=ICON_NONE;
ICON_TYPE current_icon;
LPTSTR tip;
if(!global_options.option.taskbar) { /* currently disabled */
tray_delete(); /* remove the taskbark icon if exists */
return;
}
if(!tray_menu_handle) /* initialize taskbar */
tray_menu_handle=LoadMenu(ghInst, MAKEINTRESOURCE(IDM_TRAYMENU));
if(!tray_menu_handle) {
ioerror("LoadMenu");
return;
}
if(cmdline.service)
EnableMenuItem(tray_menu_handle, IDM_EDIT_CONFIG, MF_GRAYED);
ZeroMemory(&nid, sizeof nid);
nid.cbSize=sizeof nid;
nid.uID=1; /* application-defined icon ID */
nid.uFlags=NIF_MESSAGE|NIF_TIP;
nid.uCallbackMessage=WM_SYSTRAY; /* notification message */
nid.hWnd=hwnd; /* window to receive notifications */
if(num<0) {
tip=str_tprintf(TEXT("Server is down"));
current_icon=ICON_ERROR;
} else if(num>0) {
tip=str_tprintf(TEXT("%d active session(s)"), num);
current_icon=ICON_ACTIVE;
} else {
tip=str_tprintf(TEXT("Server is idle"));
current_icon=ICON_IDLE;
}
_tcsncpy(nid.szTip, tip, 63);
nid.szTip[63]=TEXT('\0');
str_free(tip);
nid.hIcon=global_options.icon[current_icon];
if(current_icon!=previous_icon) {
nid.uFlags|=NIF_ICON;
previous_icon=current_icon;
}
if(Shell_NotifyIcon(NIM_MODIFY, &nid)) /* modify tooltip */
return; /* OK: taskbar icon exists */
/* tooltip update failed - try to create the icon */
nid.uFlags|=NIF_ICON;
Shell_NotifyIcon(NIM_ADD, &nid);
} | 275 | True | 1 |
CVE-2021-20230 | 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://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1925226', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'name': 'https://github.com/mtrojnar/stunnel/commit/ebad9ddc4efb2635f37174c9d800d06206f1edf9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-02', 'name': 'GLSA-202105-02', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:stunnel:stunnel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.57', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in stunnel before 5.57, where it improperly validates client certificates when it is configured to use both redirect and verifyChain options. This flaw allows an attacker with a certificate signed by a Certificate Authority, which is not the one accepted by the stunnel server, to access the tunneled service instead of being redirected to the address specified in the redirect option. The highest threat from this vulnerability is to confidentiality.'}] | 2022-06-01T18:05Z | 2021-02-23T17:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | Michał Trojnara | 2020-10-11 20:02:12+02:00 | stunnel-5.57 | ebad9ddc4efb2635f37174c9d800d06206f1edf9 | False | mtrojnar/stunnel | Public repository based on official releases | 2015-07-29 15:30:21 | 2022-07-17 18:30:40 | https://www.stunnel.org/ | mtrojnar | 167.0 | 65.0 | verify_callback | verify_callback( int preverify_ok , X509_STORE_CTX * callback_ctx) | ['preverify_ok', 'callback_ctx'] | NOEXPORT int verify_callback(int preverify_ok, X509_STORE_CTX *callback_ctx) {
/* our verify callback function */
SSL *ssl;
CLI *c;
/* retrieve application specific data */
ssl=X509_STORE_CTX_get_ex_data(callback_ctx,
SSL_get_ex_data_X509_STORE_CTX_idx());
c=SSL_get_ex_data(ssl, index_ssl_cli);
if(!c->opt->option.verify_chain && !c->opt->option.verify_peer) {
s_log(LOG_INFO, "Certificate verification disabled");
return 1; /* accept */
}
if(verify_checks(c, preverify_ok, callback_ctx)) {
SSL_SESSION *sess=SSL_get1_session(c->ssl);
if(sess) {
int ok=SSL_SESSION_set_ex_data(sess, index_session_authenticated,
(void *)(-1));
SSL_SESSION_free(sess);
if(!ok) {
sslerror("SSL_SESSION_set_ex_data");
return 0; /* reject */
}
}
return 1; /* accept */
}
if(c->opt->option.client || c->opt->protocol)
return 0; /* reject */
if(c->opt->redirect_addr.names)
return 1; /* accept */
return 0; /* reject */
} | 178 | True | 1 |
CVE-2022-33105 | 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/redis/redis/pull/10829', 'name': 'https://github.com/redis/redis/pull/10829', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/redis/redis/commit/4a7a4e42db8ff757cdf3f4a824f66426036034ef', 'name': 'https://github.com/redis/redis/commit/4a7a4e42db8ff757cdf3f4a824f66426036034ef', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/redis/redis/pull/10753', 'name': 'https://github.com/redis/redis/pull/10753', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://raw.githubusercontent.com/redis/redis/7.0.1/00-RELEASENOTES', 'name': 'https://raw.githubusercontent.com/redis/redis/7.0.1/00-RELEASENOTES', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20220729-0005/', 'name': 'https://security.netapp.com/advisory/ntap-20220729-0005/', 'refsource': 'CONFIRM', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-401'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redis:redis:7.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Redis v7.0 was discovered to contain a memory leak via the component streamGetEdgeID.'}] | 2022-07-29T20:15Z | 2022-06-23T17: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 | Yuuoniy | 2022-05-22 17:15:26+08:00 | Fix memory leak in streamGetEdgeID (#10753)
si is initialized by streamIteratorStart(), we should call
streamIteratorStop() on it when done.
regression introduced in #9127 (redis 7.0) | 4a7a4e42db8ff757cdf3f4a824f66426036034ef | False | redis/redis | Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps. | 2009-03-21 22:32:25 | 2022-08-27 21:51:59 | http://redis.io | redis | 56505.0 | 21667.0 | streamGetEdgeID | streamGetEdgeID( stream * s , int first , int skip_tombstones , streamID * edge_id) | ['s', 'first', 'skip_tombstones', 'edge_id'] | void streamGetEdgeID(stream *s, int first, int skip_tombstones, streamID *edge_id)
{
streamIterator si;
int64_t numfields;
streamIteratorStart(&si,s,NULL,NULL,!first);
si.skip_tombstones = skip_tombstones;
int found = streamIteratorGetID(&si,edge_id,&numfields);
if (!found) {
streamID min_id = {0, 0}, max_id = {UINT64_MAX, UINT64_MAX};
*edge_id = first ? max_id : min_id;
}
} | 92 | True | 1 |
CVE-2021-21335 | 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/stnoonan/spnego-http-auth-nginx-module/security/advisories/GHSA-ww8q-72rx-hc54', 'name': 'https://github.com/stnoonan/spnego-http-auth-nginx-module/security/advisories/GHSA-ww8q-72rx-hc54', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/stnoonan/spnego-http-auth-nginx-module/releases/tag/v1.1.1', 'name': 'https://github.com/stnoonan/spnego-http-auth-nginx-module/releases/tag/v1.1.1', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/stnoonan/spnego-http-auth-nginx-module/commit/a06f9efca373e25328b1c53639a48decd0854570', 'name': 'https://github.com/stnoonan/spnego-http-auth-nginx-module/commit/a06f9efca373e25328b1c53639a48decd0854570', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:spnego_http_authentication_module_project:spnego_http_authentication_module:*:*:*:*:*:nginx:*:*', 'versionEndExcluding': '1.1.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In the SPNEGO HTTP Authentication Module for nginx (spnego-http-auth-nginx-module) before version 1.1.1 basic Authentication can be bypassed using a malformed username. This affects users of spnego-http-auth-nginx-module that have enabled basic authentication. This is fixed in version 1.1.1 of spnego-http-auth-nginx-module. As a workaround, one may disable basic authentication.'}] | 2021-03-12T14:21Z | 2021-03-08T21: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 | Sean Timothy Noonan | 2021-02-26 10:31:41+00:00 | Check basic auth result against != NGX_OK rather than == NGX_DECLINED
This corrects the error handling case when ngx_http_auth_spnego_basic is called with a bad configuration or bad username. These cases return NGX_ERROR, which allowed basic auth to proceed.
Thanks to Prakapovich Pavel aka Flyguy.by for pointing this out. | a06f9efca373e25328b1c53639a48decd0854570 | False | stnoonan/spnego-http-auth-nginx-module | SPNEGO HTTP Authentication Module for nginx | 2012-09-26 14:40:15 | 2022-02-14 17:38:20 | stnoonan | 254.0 | 102.0 | ngx_http_auth_spnego_handler | ngx_http_auth_spnego_handler( ngx_http_request_t * r) | ['r'] | ngx_http_auth_spnego_handler(
ngx_http_request_t * r)
{
ngx_int_t ret = NGX_DECLINED;
ngx_http_auth_spnego_ctx_t *ctx;
ngx_http_auth_spnego_loc_conf_t *alcf;
alcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_spnego_module);
if (alcf->protect == 0) {
return NGX_DECLINED;
}
ctx = ngx_http_get_module_ctx(r, ngx_http_auth_spnego_module);
if (NULL == ctx) {
ctx = ngx_palloc(r->pool, sizeof(ngx_http_auth_spnego_ctx_t));
if (NULL == ctx) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
ctx->token.len = 0;
ctx->token.data = NULL;
ctx->head = 0;
ctx->ret = NGX_HTTP_UNAUTHORIZED;
ngx_http_set_ctx(r, ctx, ngx_http_auth_spnego_module);
}
spnego_debug3("SSO auth handling IN: token.len=%d, head=%d, ret=%d",
ctx->token.len, ctx->head, ctx->ret);
if (ctx->token.len && ctx->head) {
spnego_debug1("Found token and head, returning %d", ctx->ret);
return ctx->ret;
}
if (NULL != r->headers_in.user.data) {
spnego_debug0("User header set");
return NGX_OK;
}
spnego_debug0("Begin auth");
if (alcf->allow_basic) {
spnego_debug0("Detect basic auth");
ret = ngx_http_auth_basic_user(r);
if (NGX_OK == ret) {
spnego_debug0("Basic auth credentials supplied by client");
/* If basic auth is enabled and basic creds are supplied
* attempt basic auth. If we attempt basic auth, we do
* not fall through to real SPNEGO */
if (NGX_DECLINED == ngx_http_auth_spnego_basic(r, ctx, alcf)) {
spnego_debug0("Basic auth failed");
if (NGX_ERROR == ngx_http_auth_spnego_headers_basic_only(r, ctx, alcf)) {
spnego_debug0("Error setting headers");
return (ctx->ret = NGX_HTTP_INTERNAL_SERVER_ERROR);
}
return (ctx->ret = NGX_HTTP_UNAUTHORIZED);
}
if (!ngx_spnego_authorized_principal(r, &r->headers_in.user, alcf)) {
spnego_debug0("User not authorized");
return (ctx->ret = NGX_HTTP_FORBIDDEN);
}
spnego_debug0("Basic auth succeeded");
return (ctx->ret = NGX_OK);
}
}
/* Basic auth either disabled or not supplied by client */
spnego_debug0("Detect SPNEGO token");
ret = ngx_http_auth_spnego_token(r, ctx);
if (NGX_OK == ret) {
spnego_debug0("Client sent a reasonable Negotiate header");
ret = ngx_http_auth_spnego_auth_user_gss(r, ctx, alcf);
if (NGX_ERROR == ret) {
spnego_debug0("GSSAPI failed");
return (ctx->ret = NGX_HTTP_INTERNAL_SERVER_ERROR);
}
/* There are chances that client knows about Negotiate
* but doesn't support GSSAPI. We could attempt to fall
* back to basic here... */
if (NGX_DECLINED == ret) {
spnego_debug0("GSSAPI failed");
if(!alcf->allow_basic) {
return (ctx->ret = NGX_HTTP_FORBIDDEN);
}
if (NGX_ERROR == ngx_http_auth_spnego_headers_basic_only(r, ctx, alcf)) {
spnego_debug0("Error setting headers");
return (ctx->ret = NGX_HTTP_INTERNAL_SERVER_ERROR);
}
return (ctx->ret = NGX_HTTP_UNAUTHORIZED);
}
if (!ngx_spnego_authorized_principal(r, &r->headers_in.user, alcf)) {
spnego_debug0("User not authorized");
return (ctx->ret = NGX_HTTP_FORBIDDEN);
}
spnego_debug0("GSSAPI auth succeeded");
}
ngx_str_t *token_out_b64 = NULL;
switch(ret) {
case NGX_DECLINED: /* DECLINED, but not yet FORBIDDEN */
ctx->ret = NGX_HTTP_UNAUTHORIZED;
break;
case NGX_OK:
ctx->ret = NGX_OK;
token_out_b64 = &ctx->token_out_b64;
break;
case NGX_ERROR:
default:
ctx->ret = NGX_HTTP_INTERNAL_SERVER_ERROR;
break;
}
if (NGX_ERROR == ngx_http_auth_spnego_headers(r, ctx, token_out_b64, alcf)) {
spnego_debug0("Error setting headers");
ctx->ret = NGX_HTTP_INTERNAL_SERVER_ERROR;
}
spnego_debug3("SSO auth handling OUT: token.len=%d, head=%d, ret=%d",
ctx->token.len, ctx->head, ctx->ret);
return ctx->ret;
} | 607 | True | 1 |
||
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::DeleteRunner::DeleteRunner | ivm::DeleteRunner::DeleteRunner( ReferenceHandle & that , Local<Value> key_handle) | ['that', 'key_handle'] | DeleteRunner(ReferenceHandle& that, Local<Value> key_handle) :
key{ExternalCopy::CopyIfPrimitive(key_handle)},
context{that.context},
reference{that.reference} {
that.CheckDisposed();
if (!key) {
throw RuntimeTypeError("Invalid `key`");
}
} | 57 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::DeleteRunner::Phase2 | ivm::DeleteRunner::Phase2() | [] | void Phase2() final {
Local<Context> context_handle = Deref(context);
Context::Scope context_scope{context_handle};
Local<Object> object = Local<Object>::Cast(Deref(reference));
result = Unmaybe(object->Delete(context_handle, key->CopyInto()));
} | 62 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::DeleteRunner::Phase3 | ivm::DeleteRunner::Phase3() | [] | auto Phase3() -> Local<Value> final {
return Boolean::New(Isolate::GetCurrent(), result);
} | 25 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::GetRunner::GetRunner | ivm::GetRunner::GetRunner( const ReferenceHandle & that , Local<Value> key_handle , MaybeLocal<Object> maybe_options , bool inherit) | ['that', 'key_handle', 'maybe_options', 'inherit'] | GetRunner(
const ReferenceHandle& that,
Local<Value> key_handle,
MaybeLocal<Object> maybe_options,
bool inherit
) :
context{that.context},
reference{that.reference},
options{maybe_options, inherit ?
TransferOptions::Type::DeepReference : TransferOptions::Type::Reference},
inherit{inherit} {
that.CheckDisposed();
key = ExternalCopy::CopyIfPrimitive(key_handle);
if (!key) {
throw RuntimeTypeError("Invalid `key`");
}
} | 90 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::GetRunner::Phase2 | ivm::GetRunner::Phase2() | [] | void Phase2() final {
Local<Context> context_handle = Deref(context);
Context::Scope context_scope{context_handle};
Local<Value> key_inner = key->CopyInto();
Local<Object> object = Local<Object>::Cast(Deref(reference));
bool allow = [&]() {
if (!inherit) {
if (key_inner->IsName()) {
return Unmaybe(object->HasRealNamedProperty(context_handle, key_inner.As<Name>()));
} else if (key_inner->IsNumber()) {
return Unmaybe(object->HasRealIndexedProperty(context_handle, HandleCast<uint32_t>(key_inner)));
} else {
return false;
}
}
return true;
}();
Local<Value> value = allow ?
Unmaybe(object->Get(context_handle, key_inner)) :
Undefined(Isolate::GetCurrent()).As<Value>();
ret = TransferOut(value, options);
} | 190 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::ReferenceHandle::Get | ivm::ReferenceHandle::Get( Local<Value> key_handle , MaybeLocal<Object> maybe_options) | ['key_handle', 'maybe_options'] | auto ReferenceHandle::Get(Local<Value> key_handle, MaybeLocal<Object> maybe_options) -> Local<Value> {
return ThreePhaseTask::Run<async, GetRunner>(*isolate, *this, key_handle, maybe_options, inherit);
} | 46 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::ReferenceHandle::New | ivm::ReferenceHandle::New( Local<Value> value , MaybeLocal<Object> options) | ['value', 'options'] | auto ReferenceHandle::New(Local<Value> value, MaybeLocal<Object> options) -> unique_ptr<ReferenceHandle> {
auto inherit = ReadOption<bool>(options, StringTable::Get().inheritUnsafe, false);
return std::make_unique<ReferenceHandle>(value, inherit);
} | 57 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::SetRunner::Phase2 | ivm::SetRunner::Phase2() | [] | void Phase2() final {
Local<Context> context_handle = Deref(context);
Context::Scope context_scope{context_handle};
Local<Value> key_inner = key->CopyInto();
Local<Object> object = Local<Object>::Cast(Deref(reference));
// Delete key before transferring in, potentially freeing up some v8 heap
Unmaybe(object->Delete(context_handle, key_inner));
Local<Value> val_inner = val->TransferIn();
did_set = Unmaybe(object->Set(context_handle, key_inner, val_inner));
} | 96 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::SetRunner::Phase3 | ivm::SetRunner::Phase3() | [] | auto Phase3() -> Local<Value> final {
return Boolean::New(Isolate::GetCurrent(), did_set);
} | 25 | True | 1 |
|
CVE-2021-21413 | False | False | False | False | AV:A/AC:L/Au:N/C:P/I:P/A:P | ADJACENT_NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 5.8 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | ADJACENT_NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 9.6 | CRITICAL | 2.8 | 6.0 | False | [{'url': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'name': 'https://github.com/laverdet/isolated-vm/commit/2646e6c1558bac66285daeab54c7d490ed332b15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'name': 'https://github.com/laverdet/isolated-vm/security/advisories/GHSA-mmhj-4w6j-76h7', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'name': 'https://github.com/laverdet/isolated-vm/blob/main/CHANGELOG.md#v400', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'name': 'https://github.com/laverdet/isolated-vm/commit/27151bfecc260e96714443613880e3b2e6596704', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-913'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:isolated-vm_project:isolated-vm:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '4.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes."}] | 2021-04-07T14:56Z | 2021-03-30T23:15Z | Improper Control of Dynamically-Managed Code Resources | The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. | Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.
| https://cwe.mitre.org/data/definitions/913.html | 0 | Marcel Laverdet | 2021-03-20 14:40:07-05:00 | Don't invoke accessors or proxies via Reference functions | 2646e6c1558bac66285daeab54c7d490ed332b15 | False | laverdet/isolated-vm | Secure & isolated JS environments for nodejs | 2017-05-20 05:08:47 | 2022-05-18 17:39:16 | laverdet | 1269.0 | 93.0 | ivm::SetRunner::SetRunner | ivm::SetRunner::SetRunner( ReferenceHandle & that , Local<Value> key_handle , Local<Value> val_handle , MaybeLocal<Object> maybe_options) | ['that', 'key_handle', 'val_handle', 'maybe_options'] | SetRunner(
ReferenceHandle& that,
Local<Value> key_handle,
Local<Value> val_handle,
MaybeLocal<Object> maybe_options
) :
key{ExternalCopy::CopyIfPrimitive(key_handle)},
val{TransferOut(val_handle, TransferOptions{maybe_options})},
context{that.context},
reference{that.reference} {
that.CheckDisposed();
if (!key) {
throw RuntimeTypeError("Invalid `key`");
}
} | 82 | True | 1 |
|
CVE-2021-23180 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://ubuntu.com/security/CVE-2021-23180', 'name': 'https://ubuntu.com/security/CVE-2021-23180', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967041', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967041', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/418', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/418', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/19c582fb32eac74b57e155cffbb529377a9e751a', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/19c582fb32eac74b57e155cffbb529377a9e751a', '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:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12 and before. Null pointer dereference in file_extension(),in file.c may lead to execute arbitrary code and denial of service.'}] | 2022-03-10T19:27Z | 2022-03-02T23: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 R Sweet | 2021-01-26 08:02:32-05:00 | Fix a crash bug with malformed URIs (Issue #418) | 19c582fb32eac74b57e155cffbb529377a9e751a | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | file_extension | file_extension( const char * s) | ['s'] | file_extension(const char *s) /* I - Filename or URL */
{
const char *extension; /* Pointer to directory separator */
static char buf[1024]; /* Buffer for files with targets */
if (s == NULL)
return (NULL);
else if (!strncmp(s, "data:image/bmp;", 15))
return ("bmp");
else if (!strncmp(s, "data:image/gif;", 15))
return ("gif");
else if (!strncmp(s, "data:image/jpeg;", 16))
return ("jpg");
else if (!strncmp(s, "data:image/png;", 15))
return ("png");
else if ((extension = strrchr(s, '/')) != NULL)
extension ++;
else if ((extension = strrchr(s, '\\')) != NULL)
extension ++;
else
extension = s;
if ((extension = strrchr(extension, '.')) == NULL)
return ("");
else
extension ++;
if (strchr(extension, '#') == NULL)
return (extension);
strlcpy(buf, extension, sizeof(buf));
*(char *)strchr(buf, '#') = '\0';
return (buf);
} | 218 | True | 1 |
CVE-2021-26259 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/417', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/417', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/0ddab26a542c74770317b622e985c52430092ba5', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/0ddab26a542c74770317b622e985c52430092ba5', '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:htmldoc_project:htmldoc:1.9.12:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12. Heap buffer overflow in render_table_row(),in ps-pdf.cxx may lead to arbitrary code execution and denial of service.'}] | 2022-03-10T02:19Z | 2022-03-03T23: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 | Michael R Sweet | 2021-04-01 08:14:29-04:00 | Fix a crash bug with bogus table attributes (Issue #417) | 0ddab26a542c74770317b622e985c52430092ba5 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | parse_table | parse_table( tree_t * t , float left , float right , float bottom , float top , float * x , float * y , int * page , int needspace) | ['t', 'left', 'right', 'bottom', 'top', 'x', 'y', 'page', 'needspace'] | parse_table(tree_t *t, // I - Tree to parse
float left, // I - Left margin
float right, // I - Printable width
float bottom, // I - Bottom margin
float top, // I - Printable top
float *x, // IO - X position
float *y, // IO - Y position
int *page, // IO - Page #
int needspace) // I - Need whitespace?
{
int col,
row,
header_row = -1,
tcol,
colspan,
rowspan,
alloc_rows,
regular_cols;
hdtable_t table;
float col_width,
col_min,
col_pref,
col_height,
cellspacing,
width,
pref_width,
span_width,
regular_width,
actual_width,
table_width,
min_width,
temp_width,
header_height = 0.0,
table_y,
temp_bottom,
temp_top;
int temp_page, table_page;
uchar *var,
*height_var, // Row HEIGHT variable
*header_height_var = NULL;
tree_t *temprow,
*tempcol,
*tempnext,
***cells,
*caption; // Caption for bottom, if any
float temp_height; // Temporary holder
uchar *bgcolor;
float bgrgb[3];
const char *htmldoc_debug; // HTMLDOC_DEBUG env var
DEBUG_puts("\n\nTABLE");
DEBUG_printf(("parse_table(t=%p, left=%.1f, right=%.1f, x=%.1f, y=%.1f, page=%d\n",
(void *)t, left, right, *x, *y, *page));
if (t->child == NULL)
return; /* Empty table... */
memset(&table, 0, sizeof(table));
/*
* Check debug mode...
*/
if ((htmldoc_debug = getenv("HTMLDOC_DEBUG")) != NULL &&
(strstr(htmldoc_debug, "table") || strstr(htmldoc_debug, "all")))
table.debug = 1;
else
table.debug = 0;
/*
* Figure out the # of rows, columns, and the desired widths...
*/
cells = NULL;
if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
table_width = (float)(atof((char *)var) * (right - left) / 100.0f);
else
table_width = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWidth);
}
else
table_width = right - left;
if ((var = htmlGetVariable(t, (uchar *)"HEIGHT")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
table.height = (float)(atof((char *)var) * (top - bottom) / 100.0f);
else
table.height = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWidth);
}
else
table.height = -1.0f;
DEBUG_printf(("table_width = %.1f\n", table_width));
if ((var = htmlGetVariable(t, (uchar *)"CELLPADDING")) != NULL)
table.cellpadding = atoi((char *)var);
else
table.cellpadding = 1.0f;
if ((var = htmlGetVariable(t, (uchar *)"CELLSPACING")) != NULL)
cellspacing = atoi((char *)var);
else
cellspacing = 0.0f;
if ((var = htmlGetVariable(t, (uchar *)"BORDER")) != NULL)
{
if ((table.border = (float)atof((char *)var)) == 0.0 && var[0] != '0')
table.border = 1.0f;
table.cellpadding += table.border;
}
else
table.border = 0.0f;
if (table.debug && table.border == 0.0f)
table.border = 0.01f;
table.border_rgb[0] = t->red / 255.0f;
table.border_rgb[1] = t->green / 255.0f;
table.border_rgb[2] = t->blue / 255.0f;
if ((var = htmlGetVariable(t, (uchar *)"BORDERCOLOR")) != NULL)
get_color(var, table.border_rgb, 0);
if (table.border == 0.0f && table.cellpadding > 0.0f)
{
/*
* Ah, the strange table formatting nightmare that is HTML.
* Netscape and MSIE assign an invisible border width of 1
* pixel if no border is specified...
*/
table.cellpadding += 1.0f;
}
table.border_size = table.border - 1.0f;
cellspacing *= PagePrintWidth / _htmlBrowserWidth;
table.cellpadding *= PagePrintWidth / _htmlBrowserWidth;
table.border *= PagePrintWidth / _htmlBrowserWidth;
table.border_size *= PagePrintWidth / _htmlBrowserWidth;
DEBUG_printf(("border = %.1f, cellpadding = %.1f\n", table.border, table.cellpadding));
temp_bottom = bottom - table.cellpadding;
temp_top = top + table.cellpadding;
for (temprow = t->child, table.num_cols = 0, table.num_rows = 0, alloc_rows = 0, caption = NULL;
temprow != NULL;
temprow = tempnext)
{
tempnext = temprow->next;
if (temprow->markup == MARKUP_CAPTION)
{
if ((var = htmlGetVariable(temprow, (uchar *)"ALIGN")) == NULL ||
strcasecmp((char *)var, "bottom"))
{
/*
* Show caption at top...
*/
parse_paragraph(temprow, left, right, bottom, top, x, y, page, needspace);
needspace = 1;
}
else
{
/*
* Flag caption for bottom of table...
*/
caption = temprow;
}
}
else if (temprow->markup == MARKUP_TR ||
((temprow->markup == MARKUP_TBODY || temprow->markup == MARKUP_THEAD ||
temprow->markup == MARKUP_TFOOT) && temprow->child != NULL))
{
if (temprow->markup == MARKUP_THEAD)
header_row = table.num_rows;
// Descend into table body as needed...
if (temprow->markup == MARKUP_TBODY || temprow->markup == MARKUP_THEAD ||
temprow->markup == MARKUP_TFOOT)
temprow = temprow->child;
// Figure out the next row...
if ((tempnext = temprow->next) == NULL)
if (temprow->parent->markup == MARKUP_TBODY ||
temprow->parent->markup == MARKUP_THEAD ||
temprow->parent->markup == MARKUP_TFOOT)
tempnext = temprow->parent->next;
// Allocate memory for the table as needed...
if (table.num_rows >= alloc_rows)
{
alloc_rows += ALLOC_ROWS;
if (alloc_rows == ALLOC_ROWS)
cells = (tree_t ***)malloc(sizeof(tree_t **) * (size_t)alloc_rows);
else
cells = (tree_t ***)realloc(cells, sizeof(tree_t **) * (size_t)alloc_rows);
if (cells == (tree_t ***)0)
{
progress_error(HD_ERROR_OUT_OF_MEMORY,
"Unable to allocate memory for table!");
return;
}
}
if ((cells[table.num_rows] = (tree_t **)calloc(sizeof(tree_t *), MAX_COLUMNS)) == NULL)
{
progress_error(HD_ERROR_OUT_OF_MEMORY,
"Unable to allocate memory for table!");
free(cells);
return;
}
#ifdef DEBUG
printf("BEFORE row %d: num_cols = %d\n", table.num_rows, table.num_cols);
if (table.num_rows)
for (col = 0; col < table.num_cols; col ++)
printf(" col %d: row_spans[] = %d\n", col, table.row_spans[col]);
#endif // DEBUG
// Figure out the starting column...
if (table.num_rows)
{
for (col = 0, rowspan = 9999; col < table.num_cols; col ++)
if (table.row_spans[col] < rowspan)
rowspan = table.row_spans[col];
for (col = 0; col < table.num_cols; col ++)
table.row_spans[col] -= rowspan;
for (col = 0; table.row_spans[col] && col < table.num_cols; col ++)
cells[table.num_rows][col] = cells[table.num_rows - 1][col];
}
else
col = 0;
for (tempcol = temprow->child;
tempcol != NULL && col < MAX_COLUMNS;
tempcol = tempcol->next)
{
if (tempcol->markup == MARKUP_TH && table.num_rows == 0)
header_row = table.num_rows;
if (tempcol->markup == MARKUP_TD || tempcol->markup == MARKUP_TH)
{
// Handle colspan and rowspan stuff...
if ((var = htmlGetVariable(tempcol, (uchar *)"COLSPAN")) != NULL)
colspan = atoi((char *)var);
else
colspan = 1;
if ((var = htmlGetVariable(tempcol, (uchar *)"ROWSPAN")) != NULL)
{
table.row_spans[col] = atoi((char *)var);
if (table.row_spans[col] == 1)
table.row_spans[col] = 0;
for (tcol = 1; tcol < colspan; tcol ++)
table.row_spans[col + tcol] = table.row_spans[col];
}
// Compute the cell size...
col_width = get_cell_size(tempcol, 0.0f, table_width, &col_min, &col_pref, &col_height);
if ((var = htmlGetVariable(tempcol, (uchar *)"WIDTH")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
{
col_width -= 2.0 * table.cellpadding - cellspacing;
if (colspan <= 1)
table.col_percent[col] = 1;
}
else
{
col_width -= 2.0 * table.cellpadding;
}
}
else
col_width = 0.0f;
tempcol->height = col_height;
DEBUG_printf(("%d,%d: colsp=%d, rowsp=%d, width=%.1f, minw=%.1f, prefw=%.1f, minh=%.1f\n", col, table.num_rows, colspan, table.row_spans[col], col_width, col_min, col_pref, col_height));
// Add widths to columns...
if (colspan > 1)
{
if (colspan > table.col_spans[col])
table.col_spans[col] = colspan;
if (col_width > table.col_swidths[col])
table.col_swidths[col] = col_width;
if (col_min > table.col_smins[col])
table.col_smins[col] = col_min;
temp_width = col_width / colspan;
for (int i = 0; i < colspan; i ++)
{
if (temp_width > table.col_widths[col + i])
table.col_widths[col + i] = temp_width;
}
}
else
{
if (col_width > 0.0f)
table.col_fixed[col] = 1;
if (col_width > table.col_widths[col])
table.col_widths[col] = col_width;
if (col_pref > table.col_prefs[col])
table.col_prefs[col] = col_pref;
if (col_min > table.col_mins[col])
table.col_mins[col] = col_min;
}
while (colspan > 0 && col < MAX_COLUMNS)
{
cells[table.num_rows][col] = tempcol;
col ++;
colspan --;
}
while (table.row_spans[col] && col < table.num_cols)
{
cells[table.num_rows][col] = cells[table.num_rows - 1][col];
col ++;
}
}
}
DEBUG_printf(("header_row=%d\n", header_row));
if (col > table.num_cols)
table.num_cols = col;
#ifdef DEBUG
printf("AFTER row %d: num_cols = %d\n", table.num_rows, table.num_cols);
for (col = 0; col < table.num_cols; col ++)
printf(" col %d: row_spans[] = %d\n", col, table.row_spans[col]);
#endif // DEBUG
table.num_rows ++;
for (col = 0; col < table.num_cols; col ++)
if (table.row_spans[col])
table.row_spans[col] --;
}
}
/*
* OK, some people apparently create HTML tables with no columns or
* rows... If this happened, return immediately...
*/
if (table.num_cols == 0)
return;
/*
* Now figure out the width of the table...
*/
if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
width = (float)(atof((char *)var) * (right - left) / 100.0f);
else
width = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWidth);
}
else
{
for (col = 0, width = 0.0; col < table.num_cols; col ++)
width += table.col_prefs[col];
width += (2 * table.cellpadding + cellspacing) * table.num_cols - cellspacing;
if (width > (right - left))
width = right - left;
}
/*
* Compute the width of each column based on the printable width.
*/
DEBUG_printf(("\nTABLE: %dx%d\n\n", table.num_cols, table.num_rows));
actual_width = (2 * table.cellpadding + cellspacing) * table.num_cols -
cellspacing;
regular_width = (width - actual_width) / table.num_cols;
DEBUG_printf((" width = %.1f, actual_width = %.1f, regular_width = %.1f\n\n",
width, actual_width, regular_width));
DEBUG_puts(" Col Width Min Pref Fixed? Percent?");
DEBUG_puts(" --- ------ ------ ------ ------ --------");
#ifdef DEBUG
for (col = 0; col < table.num_cols; col ++)
printf(" %-3d %-6.1f %-6.1f %-6.1f %-6s %s\n", col, table.col_widths[col], table.col_mins[col], table.col_prefs[col], table.col_fixed[col] ? "YES" : "NO", table.col_percent[col] ? "YES" : "NO");
puts("");
#endif /* DEBUG */
/*
* The first pass just handles columns with a specified width...
*/
DEBUG_puts("PASS 1: fixed width handling\n");
for (col = 0, regular_cols = 0; col < table.num_cols; col ++)
if (table.col_widths[col] > 0.0f)
{
if (table.col_mins[col] > table.col_widths[col])
{
DEBUG_printf((" updating column %d to width=%.1f\n", col, table.col_mins[col]));
table.col_widths[col] = table.col_mins[col];
}
actual_width += table.col_widths[col];
}
else
{
regular_cols ++;
actual_width += table.col_mins[col];
}
DEBUG_printf((" actual_width = %.1f, regular_cols = %d\n\n", actual_width,regular_cols));
/*
* Pass two uses the "preferred" width whenever possible, and the
* minimum otherwise...
*/
DEBUG_puts("PASS 2: preferred width handling\n");
for (col = 0, pref_width = 0.0f; col < table.num_cols; col ++)
if (table.col_widths[col] == 0.0f)
pref_width += table.col_prefs[col] - table.col_mins[col];
DEBUG_printf((" pref_width = %.1f\n", pref_width));
if (pref_width > 0.0f)
{
if ((regular_width = (width - actual_width) / pref_width) < 0.0f)
regular_width = 0.0f;
else if (regular_width > 1.0f)
regular_width = 1.0f;
DEBUG_printf((" regular_width = %.1f\n", regular_width));
for (col = 0; col < table.num_cols; col ++)
if (table.col_widths[col] == 0.0f)
{
pref_width = (table.col_prefs[col] - table.col_mins[col]) * regular_width;
if ((actual_width + pref_width) > width)
{
if (col == (table.num_cols - 1) && (width - actual_width) >= table.col_mins[col])
table.col_widths[col] = width - actual_width;
else
table.col_widths[col] = table.col_mins[col];
}
else
table.col_widths[col] = pref_width + table.col_mins[col];
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
actual_width += table.col_widths[col] - table.col_mins[col];
}
}
else
{
/*
* Assign min widths for all cells...
*/
for (col = 0; col < table.num_cols; col ++)
if (table.col_widths[col] == 0.0f)
table.col_widths[col] = table.col_mins[col];
}
DEBUG_printf((" actual_width = %.1f\n\n", actual_width));
/*
* Pass three enforces any hard or minimum widths for COLSPAN'd
* columns...
*/
DEBUG_puts("PASS 3: colspan handling\n\n");
for (col = 0; col < table.num_cols; col ++)
{
DEBUG_printf((" col %d, colspan %d\n", col, table.col_spans[col]));
if (table.col_spans[col] > 1)
{
for (colspan = 0, span_width = 0.0f; colspan < table.col_spans[col]; colspan ++)
span_width += table.col_widths[col + colspan];
pref_width = 0.0f;
if (span_width < table.col_swidths[col])
pref_width = table.col_swidths[col];
if (span_width < table.col_smins[col] && pref_width < table.col_smins[col])
pref_width = table.col_smins[col];
for (colspan = 0; colspan < table.col_spans[col]; colspan ++)
if (table.col_fixed[col + colspan])
{
span_width -= table.col_widths[col + colspan];
pref_width -= table.col_widths[col + colspan];
}
DEBUG_printf((" col_swidths=%.1f, col_smins=%.1f, span_width=%.1f, pref_width=%.1f\n", table.col_swidths[col], table.col_smins[col], span_width, pref_width));
if (pref_width > 0.0f && pref_width > span_width)
{
if (span_width >= 1.0f)
{
// Expand cells proportionately...
regular_width = pref_width / span_width;
for (colspan = 0; colspan < table.col_spans[col]; colspan ++)
if (!table.col_fixed[col + colspan])
{
actual_width -= table.col_widths[col + colspan];
table.col_widths[col + colspan] *= regular_width;
actual_width += table.col_widths[col + colspan];
DEBUG_printf((" col_widths[%d] = %.1f\n", col + colspan, table.col_widths[col + colspan]));
}
}
else
{
// Divide the space up equally between columns, since the
// colspan area is always by itself... (this hack brought
// to you by Yahoo! and their single cell tables with
// colspan=2 :)
regular_width = pref_width / table.col_spans[col];
for (colspan = 0; colspan < table.col_spans[col]; colspan ++)
{
actual_width += regular_width;
table.col_widths[col + colspan] += regular_width;
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
}
}
}
}
}
DEBUG_printf((" actual_width = %.1f\n\n", actual_width));
/*
* Pass four divides up the remaining space amongst the columns...
*/
DEBUG_puts("PASS 4: divide remaining space, if any...\n");
if (width > actual_width)
{
for (col = 0, colspan = 0; col < table.num_cols; col ++)
if (!table.col_fixed[col] || table.col_percent[col])
colspan ++;
if (colspan > 0)
{
regular_width = (width - actual_width) / table.num_cols;
for (col = 0; col < table.num_cols; col ++)
if (!table.col_fixed[col])
{
table.col_widths[col] += regular_width;
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
}
}
}
else
width = actual_width;
DEBUG_puts("");
/*
* The final pass is only run if the width > table_width...
*/
DEBUG_puts("PASS 5: Squeeze table as needed...");
if (width > table_width)
{
/*
* Squeeze the table to fit the requested width or the printable width
* as determined at the beginning...
*/
for (col = 0, min_width = -cellspacing; col < table.num_cols; col ++)
min_width += table.col_mins[col] + 2 * table.cellpadding + cellspacing;
DEBUG_printf((" table_width = %.1f, width = %.1f, min_width = %.1f\n", table_width, width, min_width));
temp_width = table_width - min_width;
if (temp_width < 0.0f)
temp_width = 0.0f;
width -= min_width;
if (width < 1.0f)
width = 1.0f;
for (col = 0; col < table.num_cols; col ++)
{
table.col_widths[col] = table.col_mins[col] + temp_width * (table.col_widths[col] - table.col_mins[col]) / width;
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
}
for (col = 0, width = -cellspacing; col < table.num_cols; col ++)
width += table.col_widths[col] + 2 * table.cellpadding + cellspacing;
DEBUG_printf((" new width = %.1f, max width = %.1f\n", width, right - left));
}
if ((width - right + left) > 0.001f && OverflowErrors)
progress_error(HD_ERROR_CONTENT_TOO_LARGE, "Table on page %d too wide - truncation or overlapping may occur!", *page + 1);
DEBUG_puts("");
DEBUG_printf(("Final table width = %.1f, alignment = %d\n", width, t->halignment));
switch (t->halignment)
{
case ALIGN_LEFT :
*x = left + table.cellpadding;
break;
case ALIGN_CENTER :
*x = left + 0.5f * (right - left - width) + table.cellpadding;
break;
case ALIGN_RIGHT :
*x = right - width + table.cellpadding;
break;
}
for (col = 0; col < table.num_cols; col ++)
{
table.col_lefts[col] = *x;
table.col_rights[col] = *x + table.col_widths[col];
*x = table.col_rights[col] + 2 * table.cellpadding + cellspacing;
DEBUG_printf(("left[%d] = %.1f, right[%d] = %.1f\n", col, table.col_lefts[col], col, table.col_rights[col]));
}
/*
* Now render the whole table...
*/
if (*y < top && needspace)
*y -= _htmlSpacings[SIZE_P];
if (table.debug)
{
check_pages(*page);
render_t *r;
char table_text[255];
snprintf(table_text, sizeof(table_text), "t=%p", (void *)t);
r = new_render(*page, RENDER_TEXT, left, *y,
get_width((uchar *)table_text, TYPE_COURIER, STYLE_NORMAL, 3),
_htmlSizes[3], table_text);
r->data.text.typeface = TYPE_COURIER;
r->data.text.style = STYLE_NORMAL;
r->data.text.size = (float)_htmlSizes[3];
}
table_page = *page;
table_y = *y;
for (row = 0; row < table.num_rows; row ++)
{
height_var = NULL;
if (cells[row][0] != NULL)
{
/*
* Do page comments...
*/
if (cells[row][0]->parent->prev != NULL &&
cells[row][0]->parent->prev->markup == MARKUP_COMMENT)
parse_comment(cells[row][0]->parent->prev, &left, &right, &temp_bottom, &temp_top, x, y, page, NULL, 0);
/*
* Get height...
*/
if ((height_var = htmlGetVariable(cells[row][0]->parent, (uchar *)"HEIGHT")) == NULL)
for (col = 0; col < table.num_cols; col ++)
if (htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN") == NULL)
if ((height_var = htmlGetVariable(cells[row][col], (uchar *)"HEIGHT")) != NULL)
break;
}
if (height_var != NULL && row == header_row)
header_height_var = height_var;
if (cells[row][0] != NULL && height_var != NULL)
{
// Row height specified; make sure it'll fit...
if (height_var[strlen((char *)height_var) - 1] == '%')
temp_height = (float)(atof((char *)height_var) * 0.01f * (PagePrintLength - 2 * table.cellpadding));
else
temp_height = (float)(atof((char *)height_var) * PagePrintWidth / _htmlBrowserWidth);
if (table.height > 0.0f && temp_height > table.height)
temp_height = table.height;
temp_height -= 2 * table.cellpadding;
}
else
{
// Use min height computed from get_cell_size()...
for (col = 0, temp_height = (float)_htmlSpacings[SIZE_P];
col < table.num_cols;
col ++)
if (cells[row][col] != NULL &&
cells[row][col]->height > temp_height &&
!htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN"))
temp_height = cells[row][col]->height;
if (table.height > 0.0)
{
// Table height specified; make sure it'll fit...
if (temp_height > table.height)
temp_height = table.height;
temp_height -= 2 * table.cellpadding;
}
else if (temp_height > (PageLength / 8.0) && height_var == NULL)
temp_height = PageLength / 8.0;
}
DEBUG_printf(("BEFORE row = %d, temp_height = %.1f, *y = %.1f, *page = %d\n",
row, temp_height, *y, *page));
if (*y < (bottom + 2 * table.cellpadding + temp_height) &&
temp_height <= (top - bottom - 2 * table.cellpadding))
{
DEBUG_puts("NEW PAGE");
*y = top - header_height;
(*page) ++;
if (Verbosity)
progress_show("Formatting page %d", *page);
if (row > 0 && header_row >= 0)
{
// Render header row...
render_table_row(table, cells, header_row, header_height_var, left, right, bottom, top, x, y, page);
}
}
float start_y = *y;
temp_page = *page;
render_table_row(table, cells, row, height_var, left, right, bottom, top, x, y, page);
if (header_row >= 0 && row == header_row)
{
header_height = *y - start_y;
top += header_height;
}
else if (temp_page != *page && header_row >= 0)
{
// Render header row on new page(s)...
do
{
float temp_y = top - header_height;
temp_page ++;
render_table_row(table, cells, header_row, header_height_var, left, right, bottom, top, x, &temp_y, &temp_page);
}
while (temp_page < *page);
}
if (row < (table.num_rows - 1))
(*y) -= cellspacing;
DEBUG_printf(("END row = %d, *y = %.1f, *page = %d\n", row, *y, *page));
}
top -= header_height;
/*
* Handle table background color...
*/
if ((bgcolor = htmlGetVariable(t, (uchar *)"BGCOLOR")) != NULL)
{
memcpy(bgrgb, background_color, sizeof(bgrgb));
get_color(bgcolor, bgrgb, 0);
table.border_left = table.col_lefts[0] - table.cellpadding;
width = table.col_rights[table.num_cols - 1] - table.col_lefts[0] + 2 * table.cellpadding;
if (table_page != *page)
{
// Draw background on multiple pages...
// Bottom of first page...
new_render(table_page, RENDER_BOX, table.border_left, bottom,
width, table_y - bottom, bgrgb,
pages[table_page].start);
// Intervening pages...
for (temp_page = table_page + 1; temp_page < *page; temp_page ++)
{
new_render(temp_page, RENDER_BOX, table.border_left, bottom,
width, top - bottom, bgrgb, pages[temp_page].start);
}
// Top of last page...
check_pages(*page);
new_render(*page, RENDER_BOX, table.border_left, *y,
width, top - *y, bgrgb, pages[*page].start);
}
else
{
// Draw background in row...
new_render(table_page, RENDER_BOX, table.border_left, *y,
width, table_y - *y, bgrgb, pages[table_page].start);
}
}
*x = left;
if (caption)
{
/*
* Show caption at bottom...
*/
parse_paragraph(caption, left, right, bottom, top, x, y, page, needspace);
needspace = 1;
}
/*
* Free memory for the table...
*/
if (table.num_rows > 0)
{
for (row = 0; row < table.num_rows; row ++)
free(cells[row]);
free(cells);
}
} | 4959 | True | 1 |
CVE-2021-23206 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://ubuntu.com/security/CVE-2021-23206', 'name': 'https://ubuntu.com/security/CVE-2021-23206', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/416', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/416', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ba61a3ece382389ae4482c7027af8b32e8ab4cc8', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ba61a3ece382389ae4482c7027af8b32e8ab4cc8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967028', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967028', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12 and prior. A stack buffer overflow in parse_table() in ps-pdf.cxx may lead to execute arbitrary code and denial of service.'}] | 2022-03-10T20:13Z | 2022-03-02T23: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 | Michael R Sweet | 2021-04-01 08:21:57-04:00 | Fix crash bugs with bogus table attributes (Issue #416) | ba61a3ece382389ae4482c7027af8b32e8ab4cc8 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | parse_table | parse_table( tree_t * t , float left , float right , float bottom , float top , float * x , float * y , int * page , int needspace) | ['t', 'left', 'right', 'bottom', 'top', 'x', 'y', 'page', 'needspace'] | parse_table(tree_t *t, // I - Tree to parse
float left, // I - Left margin
float right, // I - Printable width
float bottom, // I - Bottom margin
float top, // I - Printable top
float *x, // IO - X position
float *y, // IO - Y position
int *page, // IO - Page #
int needspace) // I - Need whitespace?
{
int col,
row,
header_row = -1,
tcol,
colspan,
rowspan,
alloc_rows,
regular_cols;
hdtable_t table;
float col_width,
col_min,
col_pref,
col_height,
cellspacing,
width,
pref_width,
span_width,
regular_width,
actual_width,
table_width,
min_width,
temp_width,
header_height = 0.0,
table_y,
temp_bottom,
temp_top;
int temp_page, table_page;
uchar *var,
*height_var, // Row HEIGHT variable
*header_height_var = NULL;
tree_t *temprow,
*tempcol,
*tempnext,
***cells,
*caption; // Caption for bottom, if any
float temp_height; // Temporary holder
uchar *bgcolor;
float bgrgb[3];
const char *htmldoc_debug; // HTMLDOC_DEBUG env var
DEBUG_puts("\n\nTABLE");
DEBUG_printf(("parse_table(t=%p, left=%.1f, right=%.1f, x=%.1f, y=%.1f, page=%d\n",
(void *)t, left, right, *x, *y, *page));
if (t->child == NULL)
return; /* Empty table... */
memset(&table, 0, sizeof(table));
/*
* Check debug mode...
*/
if ((htmldoc_debug = getenv("HTMLDOC_DEBUG")) != NULL &&
(strstr(htmldoc_debug, "table") || strstr(htmldoc_debug, "all")))
table.debug = 1;
else
table.debug = 0;
/*
* Figure out the # of rows, columns, and the desired widths...
*/
cells = NULL;
if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
table_width = (float)(atof((char *)var) * (right - left) / 100.0f);
else
table_width = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWidth);
if (table_width < 0.0f || table_width > PagePrintWidth)
table_width = right - left;
}
else
table_width = right - left;
if ((var = htmlGetVariable(t, (uchar *)"HEIGHT")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
table.height = (float)(atof((char *)var) * (top - bottom) / 100.0f);
else
table.height = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWidth);
}
else
table.height = -1.0f;
DEBUG_printf(("table_width = %.1f\n", table_width));
if ((var = htmlGetVariable(t, (uchar *)"CELLPADDING")) != NULL)
{
if ((table.cellpadding = atoi((char *)var)) < 0.0f)
table.cellpadding = 0.0f;
else if (table.cellpadding > 20.0f)
table.cellpadding = 20.0f;
}
else
table.cellpadding = 1.0f;
if ((var = htmlGetVariable(t, (uchar *)"CELLSPACING")) != NULL)
{
if ((cellspacing = atoi((char *)var)) < 0.0f)
cellspacing = 0.0f;
else if (cellspacing > 20.0f)
cellspacing = 20.0f;
}
else
cellspacing = 0.0f;
if ((var = htmlGetVariable(t, (uchar *)"BORDER")) != NULL)
{
if ((table.border = (float)atof((char *)var)) <= 0.0 && var[0] != '0')
table.border = 1.0f;
else if (table.border > 20.0f)
table.border = 20.0f;
table.cellpadding += table.border;
}
else
table.border = 0.0f;
if (table.debug && table.border == 0.0f)
table.border = 0.01f;
table.border_rgb[0] = t->red / 255.0f;
table.border_rgb[1] = t->green / 255.0f;
table.border_rgb[2] = t->blue / 255.0f;
if ((var = htmlGetVariable(t, (uchar *)"BORDERCOLOR")) != NULL)
get_color(var, table.border_rgb, 0);
if (table.border == 0.0f && table.cellpadding > 0.0f)
{
/*
* Ah, the strange table formatting nightmare that is HTML.
* Netscape and MSIE assign an invisible border width of 1
* pixel if no border is specified...
*/
table.cellpadding += 1.0f;
}
table.border_size = table.border - 1.0f;
cellspacing *= PagePrintWidth / _htmlBrowserWidth;
table.cellpadding *= PagePrintWidth / _htmlBrowserWidth;
table.border *= PagePrintWidth / _htmlBrowserWidth;
table.border_size *= PagePrintWidth / _htmlBrowserWidth;
DEBUG_printf(("border = %.1f, cellpadding = %.1f\n", table.border, table.cellpadding));
temp_bottom = bottom - table.cellpadding;
temp_top = top + table.cellpadding;
for (temprow = t->child, table.num_cols = 0, table.num_rows = 0, alloc_rows = 0, caption = NULL;
temprow != NULL;
temprow = tempnext)
{
tempnext = temprow->next;
if (temprow->markup == MARKUP_CAPTION)
{
if ((var = htmlGetVariable(temprow, (uchar *)"ALIGN")) == NULL ||
strcasecmp((char *)var, "bottom"))
{
/*
* Show caption at top...
*/
parse_paragraph(temprow, left, right, bottom, top, x, y, page, needspace);
needspace = 1;
}
else
{
/*
* Flag caption for bottom of table...
*/
caption = temprow;
}
}
else if (temprow->markup == MARKUP_TR ||
((temprow->markup == MARKUP_TBODY || temprow->markup == MARKUP_THEAD ||
temprow->markup == MARKUP_TFOOT) && temprow->child != NULL))
{
if (temprow->markup == MARKUP_THEAD)
header_row = table.num_rows;
// Descend into table body as needed...
if (temprow->markup == MARKUP_TBODY || temprow->markup == MARKUP_THEAD ||
temprow->markup == MARKUP_TFOOT)
temprow = temprow->child;
// Figure out the next row...
if ((tempnext = temprow->next) == NULL)
if (temprow->parent->markup == MARKUP_TBODY ||
temprow->parent->markup == MARKUP_THEAD ||
temprow->parent->markup == MARKUP_TFOOT)
tempnext = temprow->parent->next;
// Allocate memory for the table as needed...
if (table.num_rows >= alloc_rows)
{
alloc_rows += ALLOC_ROWS;
if (alloc_rows == ALLOC_ROWS)
cells = (tree_t ***)malloc(sizeof(tree_t **) * (size_t)alloc_rows);
else
cells = (tree_t ***)realloc(cells, sizeof(tree_t **) * (size_t)alloc_rows);
if (cells == (tree_t ***)0)
{
progress_error(HD_ERROR_OUT_OF_MEMORY,
"Unable to allocate memory for table!");
return;
}
}
if ((cells[table.num_rows] = (tree_t **)calloc(sizeof(tree_t *), MAX_COLUMNS)) == NULL)
{
progress_error(HD_ERROR_OUT_OF_MEMORY,
"Unable to allocate memory for table!");
free(cells);
return;
}
#ifdef DEBUG
printf("BEFORE row %d: num_cols = %d\n", table.num_rows, table.num_cols);
if (table.num_rows)
for (col = 0; col < table.num_cols; col ++)
printf(" col %d: row_spans[] = %d\n", col, table.row_spans[col]);
#endif // DEBUG
// Figure out the starting column...
if (table.num_rows)
{
for (col = 0, rowspan = 9999; col < table.num_cols; col ++)
if (table.row_spans[col] < rowspan)
rowspan = table.row_spans[col];
for (col = 0; col < table.num_cols; col ++)
table.row_spans[col] -= rowspan;
for (col = 0; table.row_spans[col] && col < table.num_cols; col ++)
cells[table.num_rows][col] = cells[table.num_rows - 1][col];
}
else
col = 0;
for (tempcol = temprow->child;
tempcol != NULL && col < MAX_COLUMNS;
tempcol = tempcol->next)
{
if (tempcol->markup == MARKUP_TH && table.num_rows == 0)
header_row = table.num_rows;
if (tempcol->markup == MARKUP_TD || tempcol->markup == MARKUP_TH)
{
// Handle colspan and rowspan stuff...
if ((var = htmlGetVariable(tempcol, (uchar *)"COLSPAN")) != NULL)
colspan = atoi((char *)var);
else
colspan = 1;
if ((var = htmlGetVariable(tempcol, (uchar *)"ROWSPAN")) != NULL)
{
table.row_spans[col] = atoi((char *)var);
if (table.row_spans[col] == 1)
table.row_spans[col] = 0;
for (tcol = 1; tcol < colspan; tcol ++)
table.row_spans[col + tcol] = table.row_spans[col];
}
// Compute the cell size...
col_width = get_cell_size(tempcol, 0.0f, table_width, &col_min, &col_pref, &col_height);
if ((var = htmlGetVariable(tempcol, (uchar *)"WIDTH")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
{
col_width -= 2.0 * table.cellpadding - cellspacing;
if (colspan <= 1)
table.col_percent[col] = 1;
}
else
{
col_width -= 2.0 * table.cellpadding;
}
}
else
col_width = 0.0f;
tempcol->height = col_height;
DEBUG_printf(("%d,%d: colsp=%d, rowsp=%d, width=%.1f, minw=%.1f, prefw=%.1f, minh=%.1f\n", col, table.num_rows, colspan, table.row_spans[col], col_width, col_min, col_pref, col_height));
// Add widths to columns...
if (colspan > 1)
{
if (colspan > table.col_spans[col])
table.col_spans[col] = colspan;
if (col_width > table.col_swidths[col])
table.col_swidths[col] = col_width;
if (col_min > table.col_smins[col])
table.col_smins[col] = col_min;
temp_width = col_width / colspan;
for (int i = 0; i < colspan; i ++)
{
if (temp_width > table.col_widths[col + i])
table.col_widths[col + i] = temp_width;
}
}
else
{
if (col_width > 0.0f)
table.col_fixed[col] = 1;
if (col_width > table.col_widths[col])
table.col_widths[col] = col_width;
if (col_pref > table.col_prefs[col])
table.col_prefs[col] = col_pref;
if (col_min > table.col_mins[col])
table.col_mins[col] = col_min;
}
while (colspan > 0 && col < MAX_COLUMNS)
{
cells[table.num_rows][col] = tempcol;
col ++;
colspan --;
}
while (table.row_spans[col] && col < table.num_cols)
{
cells[table.num_rows][col] = cells[table.num_rows - 1][col];
col ++;
}
}
}
DEBUG_printf(("header_row=%d\n", header_row));
if (col > table.num_cols)
table.num_cols = col;
#ifdef DEBUG
printf("AFTER row %d: num_cols = %d\n", table.num_rows, table.num_cols);
for (col = 0; col < table.num_cols; col ++)
printf(" col %d: row_spans[] = %d\n", col, table.row_spans[col]);
#endif // DEBUG
table.num_rows ++;
for (col = 0; col < table.num_cols; col ++)
if (table.row_spans[col])
table.row_spans[col] --;
}
}
/*
* OK, some people apparently create HTML tables with no columns or
* rows... If this happened, return immediately...
*/
if (table.num_cols == 0)
return;
/*
* Now figure out the width of the table...
*/
if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL)
{
if (var[strlen((char *)var) - 1] == '%')
width = (float)(atof((char *)var) * (right - left) / 100.0f);
else
width = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWidth);
}
else
{
for (col = 0, width = 0.0; col < table.num_cols; col ++)
width += table.col_prefs[col];
width += (2 * table.cellpadding + cellspacing) * table.num_cols - cellspacing;
if (width > (right - left))
width = right - left;
}
/*
* Compute the width of each column based on the printable width.
*/
DEBUG_printf(("\nTABLE: %dx%d\n\n", table.num_cols, table.num_rows));
actual_width = (2 * table.cellpadding + cellspacing) * table.num_cols -
cellspacing;
regular_width = (width - actual_width) / table.num_cols;
DEBUG_printf((" width = %.1f, actual_width = %.1f, regular_width = %.1f\n\n",
width, actual_width, regular_width));
DEBUG_puts(" Col Width Min Pref Fixed? Percent?");
DEBUG_puts(" --- ------ ------ ------ ------ --------");
#ifdef DEBUG
for (col = 0; col < table.num_cols; col ++)
printf(" %-3d %-6.1f %-6.1f %-6.1f %-6s %s\n", col, table.col_widths[col], table.col_mins[col], table.col_prefs[col], table.col_fixed[col] ? "YES" : "NO", table.col_percent[col] ? "YES" : "NO");
puts("");
#endif /* DEBUG */
/*
* The first pass just handles columns with a specified width...
*/
DEBUG_puts("PASS 1: fixed width handling\n");
for (col = 0, regular_cols = 0; col < table.num_cols; col ++)
if (table.col_widths[col] > 0.0f)
{
if (table.col_mins[col] > table.col_widths[col])
{
DEBUG_printf((" updating column %d to width=%.1f\n", col, table.col_mins[col]));
table.col_widths[col] = table.col_mins[col];
}
actual_width += table.col_widths[col];
}
else
{
regular_cols ++;
actual_width += table.col_mins[col];
}
DEBUG_printf((" actual_width = %.1f, regular_cols = %d\n\n", actual_width,regular_cols));
/*
* Pass two uses the "preferred" width whenever possible, and the
* minimum otherwise...
*/
DEBUG_puts("PASS 2: preferred width handling\n");
for (col = 0, pref_width = 0.0f; col < table.num_cols; col ++)
if (table.col_widths[col] == 0.0f)
pref_width += table.col_prefs[col] - table.col_mins[col];
DEBUG_printf((" pref_width = %.1f\n", pref_width));
if (pref_width > 0.0f)
{
if ((regular_width = (width - actual_width) / pref_width) < 0.0f)
regular_width = 0.0f;
else if (regular_width > 1.0f)
regular_width = 1.0f;
DEBUG_printf((" regular_width = %.1f\n", regular_width));
for (col = 0; col < table.num_cols; col ++)
if (table.col_widths[col] == 0.0f)
{
pref_width = (table.col_prefs[col] - table.col_mins[col]) * regular_width;
if ((actual_width + pref_width) > width)
{
if (col == (table.num_cols - 1) && (width - actual_width) >= table.col_mins[col])
table.col_widths[col] = width - actual_width;
else
table.col_widths[col] = table.col_mins[col];
}
else
table.col_widths[col] = pref_width + table.col_mins[col];
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
actual_width += table.col_widths[col] - table.col_mins[col];
}
}
else
{
/*
* Assign min widths for all cells...
*/
for (col = 0; col < table.num_cols; col ++)
if (table.col_widths[col] == 0.0f)
table.col_widths[col] = table.col_mins[col];
}
DEBUG_printf((" actual_width = %.1f\n\n", actual_width));
/*
* Pass three enforces any hard or minimum widths for COLSPAN'd
* columns...
*/
DEBUG_puts("PASS 3: colspan handling\n\n");
for (col = 0; col < table.num_cols; col ++)
{
DEBUG_printf((" col %d, colspan %d\n", col, table.col_spans[col]));
if (table.col_spans[col] > 1)
{
for (colspan = 0, span_width = 0.0f; colspan < table.col_spans[col]; colspan ++)
span_width += table.col_widths[col + colspan];
pref_width = 0.0f;
if (span_width < table.col_swidths[col])
pref_width = table.col_swidths[col];
if (span_width < table.col_smins[col] && pref_width < table.col_smins[col])
pref_width = table.col_smins[col];
for (colspan = 0; colspan < table.col_spans[col]; colspan ++)
if (table.col_fixed[col + colspan])
{
span_width -= table.col_widths[col + colspan];
pref_width -= table.col_widths[col + colspan];
}
DEBUG_printf((" col_swidths=%.1f, col_smins=%.1f, span_width=%.1f, pref_width=%.1f\n", table.col_swidths[col], table.col_smins[col], span_width, pref_width));
if (pref_width > 0.0f && pref_width > span_width)
{
if (span_width >= 1.0f)
{
// Expand cells proportionately...
regular_width = pref_width / span_width;
for (colspan = 0; colspan < table.col_spans[col]; colspan ++)
if (!table.col_fixed[col + colspan])
{
actual_width -= table.col_widths[col + colspan];
table.col_widths[col + colspan] *= regular_width;
actual_width += table.col_widths[col + colspan];
DEBUG_printf((" col_widths[%d] = %.1f\n", col + colspan, table.col_widths[col + colspan]));
}
}
else
{
// Divide the space up equally between columns, since the
// colspan area is always by itself... (this hack brought
// to you by Yahoo! and their single cell tables with
// colspan=2 :)
regular_width = pref_width / table.col_spans[col];
for (colspan = 0; colspan < table.col_spans[col]; colspan ++)
{
actual_width += regular_width;
table.col_widths[col + colspan] += regular_width;
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
}
}
}
}
}
DEBUG_printf((" actual_width = %.1f\n\n", actual_width));
/*
* Pass four divides up the remaining space amongst the columns...
*/
DEBUG_puts("PASS 4: divide remaining space, if any...\n");
if (width > actual_width)
{
for (col = 0, colspan = 0; col < table.num_cols; col ++)
if (!table.col_fixed[col] || table.col_percent[col])
colspan ++;
if (colspan > 0)
{
regular_width = (width - actual_width) / table.num_cols;
for (col = 0; col < table.num_cols; col ++)
if (!table.col_fixed[col])
{
table.col_widths[col] += regular_width;
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
}
}
}
else
width = actual_width;
DEBUG_puts("");
/*
* The final pass is only run if the width > table_width...
*/
DEBUG_puts("PASS 5: Squeeze table as needed...");
if (width > table_width)
{
/*
* Squeeze the table to fit the requested width or the printable width
* as determined at the beginning...
*/
for (col = 0, min_width = -cellspacing; col < table.num_cols; col ++)
min_width += table.col_mins[col] + 2 * table.cellpadding + cellspacing;
DEBUG_printf((" table_width = %.1f, width = %.1f, min_width = %.1f\n", table_width, width, min_width));
temp_width = table_width - min_width;
if (temp_width < 0.0f)
temp_width = 0.0f;
width -= min_width;
if (width < 1.0f)
width = 1.0f;
for (col = 0; col < table.num_cols; col ++)
{
table.col_widths[col] = table.col_mins[col] + temp_width * (table.col_widths[col] - table.col_mins[col]) / width;
DEBUG_printf((" col_widths[%d] = %.1f\n", col, table.col_widths[col]));
}
for (col = 0, width = -cellspacing; col < table.num_cols; col ++)
width += table.col_widths[col] + 2 * table.cellpadding + cellspacing;
DEBUG_printf((" new width = %.1f, max width = %.1f\n", width, right - left));
}
if ((width - right + left) > 0.001f && OverflowErrors)
progress_error(HD_ERROR_CONTENT_TOO_LARGE, "Table on page %d too wide - truncation or overlapping may occur!", *page + 1);
DEBUG_puts("");
DEBUG_printf(("Final table width = %.1f, alignment = %d\n", width, t->halignment));
switch (t->halignment)
{
case ALIGN_LEFT :
*x = left + table.cellpadding;
break;
case ALIGN_CENTER :
*x = left + 0.5f * (right - left - width) + table.cellpadding;
break;
case ALIGN_RIGHT :
*x = right - width + table.cellpadding;
break;
}
for (col = 0; col < table.num_cols; col ++)
{
table.col_lefts[col] = *x;
table.col_rights[col] = *x + table.col_widths[col];
*x = table.col_rights[col] + 2 * table.cellpadding + cellspacing;
DEBUG_printf(("left[%d] = %.1f, right[%d] = %.1f\n", col, table.col_lefts[col], col, table.col_rights[col]));
}
/*
* Now render the whole table...
*/
if (*y < top && needspace)
*y -= _htmlSpacings[SIZE_P];
if (table.debug)
{
check_pages(*page);
render_t *r;
char table_text[255];
snprintf(table_text, sizeof(table_text), "t=%p", (void *)t);
r = new_render(*page, RENDER_TEXT, left, *y,
get_width((uchar *)table_text, TYPE_COURIER, STYLE_NORMAL, 3),
_htmlSizes[3], table_text);
r->data.text.typeface = TYPE_COURIER;
r->data.text.style = STYLE_NORMAL;
r->data.text.size = (float)_htmlSizes[3];
}
table_page = *page;
table_y = *y;
for (row = 0; row < table.num_rows; row ++)
{
height_var = NULL;
if (cells[row][0] != NULL)
{
/*
* Do page comments...
*/
if (cells[row][0]->parent->prev != NULL &&
cells[row][0]->parent->prev->markup == MARKUP_COMMENT)
parse_comment(cells[row][0]->parent->prev, &left, &right, &temp_bottom, &temp_top, x, y, page, NULL, 0);
/*
* Get height...
*/
if ((height_var = htmlGetVariable(cells[row][0]->parent, (uchar *)"HEIGHT")) == NULL)
for (col = 0; col < table.num_cols; col ++)
if (htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN") == NULL)
if ((height_var = htmlGetVariable(cells[row][col], (uchar *)"HEIGHT")) != NULL)
break;
}
if (height_var != NULL && row == header_row)
header_height_var = height_var;
if (cells[row][0] != NULL && height_var != NULL)
{
// Row height specified; make sure it'll fit...
if (height_var[strlen((char *)height_var) - 1] == '%')
temp_height = (float)(atof((char *)height_var) * 0.01f * (PagePrintLength - 2 * table.cellpadding));
else
temp_height = (float)(atof((char *)height_var) * PagePrintWidth / _htmlBrowserWidth);
if (table.height > 0.0f && temp_height > table.height)
temp_height = table.height;
temp_height -= 2 * table.cellpadding;
}
else
{
// Use min height computed from get_cell_size()...
for (col = 0, temp_height = (float)_htmlSpacings[SIZE_P];
col < table.num_cols;
col ++)
if (cells[row][col] != NULL &&
cells[row][col]->height > temp_height &&
!htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN"))
temp_height = cells[row][col]->height;
if (table.height > 0.0)
{
// Table height specified; make sure it'll fit...
if (temp_height > table.height)
temp_height = table.height;
temp_height -= 2 * table.cellpadding;
}
else if (temp_height > (PageLength / 8.0) && height_var == NULL)
temp_height = PageLength / 8.0;
}
DEBUG_printf(("BEFORE row = %d, temp_height = %.1f, *y = %.1f, *page = %d\n",
row, temp_height, *y, *page));
if (*y < (bottom + 2 * table.cellpadding + temp_height) &&
temp_height <= (top - bottom - 2 * table.cellpadding))
{
DEBUG_puts("NEW PAGE");
*y = top - header_height;
(*page) ++;
if (Verbosity)
progress_show("Formatting page %d", *page);
if (row > 0 && header_row >= 0)
{
// Render header row...
render_table_row(table, cells, header_row, header_height_var, left, right, bottom, top, x, y, page);
}
}
float start_y = *y;
temp_page = *page;
render_table_row(table, cells, row, height_var, left, right, bottom, top, x, y, page);
if (header_row >= 0 && row == header_row)
{
header_height = *y - start_y;
top += header_height;
}
else if (temp_page != *page && header_row >= 0)
{
// Render header row on new page(s)...
do
{
float temp_y = top - header_height;
temp_page ++;
render_table_row(table, cells, header_row, header_height_var, left, right, bottom, top, x, &temp_y, &temp_page);
}
while (temp_page < *page);
}
if (row < (table.num_rows - 1))
(*y) -= cellspacing;
DEBUG_printf(("END row = %d, *y = %.1f, *page = %d\n", row, *y, *page));
}
top -= header_height;
/*
* Handle table background color...
*/
if ((bgcolor = htmlGetVariable(t, (uchar *)"BGCOLOR")) != NULL)
{
memcpy(bgrgb, background_color, sizeof(bgrgb));
get_color(bgcolor, bgrgb, 0);
table.border_left = table.col_lefts[0] - table.cellpadding;
width = table.col_rights[table.num_cols - 1] - table.col_lefts[0] + 2 * table.cellpadding;
if (table_page != *page)
{
// Draw background on multiple pages...
// Bottom of first page...
new_render(table_page, RENDER_BOX, table.border_left, bottom,
width, table_y - bottom, bgrgb,
pages[table_page].start);
// Intervening pages...
for (temp_page = table_page + 1; temp_page < *page; temp_page ++)
{
new_render(temp_page, RENDER_BOX, table.border_left, bottom,
width, top - bottom, bgrgb, pages[temp_page].start);
}
// Top of last page...
check_pages(*page);
new_render(*page, RENDER_BOX, table.border_left, *y,
width, top - *y, bgrgb, pages[*page].start);
}
else
{
// Draw background in row...
new_render(table_page, RENDER_BOX, table.border_left, *y,
width, table_y - *y, bgrgb, pages[table_page].start);
}
}
*x = left;
if (caption)
{
/*
* Show caption at bottom...
*/
parse_paragraph(caption, left, right, bottom, top, x, y, page, needspace);
needspace = 1;
}
/*
* Free memory for the table...
*/
if (table.num_rows > 0)
{
for (row = 0; row < table.num_rows; row ++)
free(cells[row]);
free(cells);
}
} | 5064 | True | 1 |
CVE-2021-23206 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://ubuntu.com/security/CVE-2021-23206', 'name': 'https://ubuntu.com/security/CVE-2021-23206', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/416', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/416', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ba61a3ece382389ae4482c7027af8b32e8ab4cc8', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ba61a3ece382389ae4482c7027af8b32e8ab4cc8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967028', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967028', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12 and prior. A stack buffer overflow in parse_table() in ps-pdf.cxx may lead to execute arbitrary code and denial of service.'}] | 2022-03-10T20:13Z | 2022-03-02T23: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 | Michael R Sweet | 2021-04-01 08:21:57-04:00 | Fix crash bugs with bogus table attributes (Issue #416) | ba61a3ece382389ae4482c7027af8b32e8ab4cc8 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | render_table_row | render_table_row( hdtable_t & table , tree_t ** * cells , int row , uchar * height_var , float left , float right , float bottom , float top , float * x , float * y , int * page) | ['table', 'cells', 'row', 'height_var', 'left', 'right', 'bottom', 'top', 'x', 'y', 'page'] | render_table_row(hdtable_t &table,
tree_t ***cells,
int row,
uchar *height_var,
float left, // I - Left margin
float right, // I - Printable width
float bottom, // I - Bottom margin
float top, // I - Printable top
float *x,
float *y,
int *page)
{
int col,
tcol,
colspan,
rowspan,
tempspace;
float width,
temp_y;
int temp_page;
uchar *var;
int do_valign; // True if we should do vertical alignment of cells
int row_page;
float row_y,
row_starty,
row_height, // Total height of the row
temp_height; // Temporary holder
uchar *bgcolor;
float bgrgb[3];
do_valign = 1;
row_height = 0.0f;
row_page = *page;
row_y = *y - table.cellpadding;
row_starty = row_y;
DEBUG_printf(("BEFORE row_y = %.1f, *y = %.1f, row_page = %d\n",
row_y, *y, row_page));
for (col = 0, rowspan = 9999; col < table.num_cols; col += colspan)
{
if (table.row_spans[col] == 0)
{
if ((var = htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN")) != NULL)
table.row_spans[col] = atoi((char *)var);
if (table.row_spans[col] == 1)
table.row_spans[col] = 0;
if (table.row_spans[col] > (table.num_rows - row))
table.row_spans[col] = table.num_rows - row;
table.span_heights[col] = 0.0f;
}
if (table.row_spans[col] < rowspan)
rowspan = table.row_spans[col];
for (colspan = 1; (col + colspan) < table.num_cols; colspan ++)
if (cells[row][col] != cells[row][col + colspan])
break;
}
if (!rowspan)
rowspan = 1;
for (col = 0; col < table.num_cols;)
{
for (colspan = 1; (col + colspan) < table.num_cols; colspan ++)
if (cells[row][col] != cells[row][col + colspan])
break;
colspan --;
DEBUG_printf((" col = %d, colspan = %d, left = %.1f, right = %.1f, cell = %p\n", col, colspan, table.col_lefts[col], table.col_rights[col + colspan], (void *)cells[row][col]));
*x = table.col_lefts[col];
temp_y = *y - table.cellpadding;
temp_page = *page;
tempspace = 0;
if (row == 0 || cells[row][col] != cells[row - 1][col])
{
check_pages(*page);
if (cells[row][col] == NULL)
bgcolor = NULL;
else if ((bgcolor = htmlGetVariable(cells[row][col], (uchar *)"BGCOLOR")) != NULL)
{
memcpy(bgrgb, background_color, sizeof(bgrgb));
get_color(bgcolor, bgrgb, 0);
width = table.col_rights[col + colspan] - table.col_lefts[col] + 2 * table.cellpadding;
table.border_left = table.col_lefts[col] - table.cellpadding;
table.cell_bg[col] = new_render(*page, RENDER_BOX, table.border_left, row_y, width + table.border, 0.0, bgrgb);
}
else
{
table.cell_bg[col] = NULL;
new_render(*page, RENDER_TEXT, -1.0f, -1.0f, 0.0, 0.0, (void *)"");
}
DEBUG_printf(("cell_bg[%d] = %p, pages[%d].end = %p\n", col, (void *)table.cell_bg[col], *page, (void *)pages[*page].end));
table.cell_start[col] = pages[*page].end;
table.cell_page[col] = temp_page;
table.cell_y[col] = temp_y;
if (table.debug)
{
check_pages(*page);
render_t *r;
char table_text[255];
snprintf(table_text, sizeof(table_text), "cell=%p [%d,%d]",
(void *)cells[row][col], row, col);
r = new_render(temp_page, RENDER_TEXT, *x, temp_y,
get_width((uchar *)table_text, TYPE_COURIER, STYLE_NORMAL, 1),
_htmlSizes[1], table_text);
r->data.text.typeface = TYPE_COURIER;
r->data.text.style = STYLE_NORMAL;
r->data.text.size = (float)_htmlSizes[1];
}
if (cells[row][col] != NULL && cells[row][col]->child != NULL)
{
DEBUG_printf((" parsing cell %d,%d; width = %.1f\n", row, col, table.col_rights[col + colspan] - table.col_lefts[col]));
bottom += table.cellpadding;
top -= table.cellpadding;
parse_doc(cells[row][col]->child, table.col_lefts + col, table.col_rights + col + colspan, &bottom, &top, x, &temp_y, &temp_page, NULL, &tempspace);
bottom -= table.cellpadding;
top += table.cellpadding;
}
table.cell_endpage[col] = temp_page;
table.cell_endy[col] = temp_y;
table.cell_height[col] = *y - table.cellpadding - temp_y;
table.cell_end[col] = pages[*page].end;
if (table.cell_start[col] == NULL)
table.cell_start[col] = pages[*page].start;
DEBUG_printf(("row = %d, col = %d, y = %.1f, cell_y = %.1f, cell_height = %.1f\n", row, col, *y - table.cellpadding, temp_y, table.cell_height[col]));
DEBUG_printf(("cell_start[%d] = %p, cell_end[%d] = %p\n", col, (void *)table.cell_start[col], col, (void *)table.cell_end[col]));
}
if (table.row_spans[col] == 0 &&
table.cell_page[col] == table.cell_endpage[col] &&
table.cell_height[col] > row_height)
row_height = table.cell_height[col];
if (table.row_spans[col] <= rowspan)
{
if (table.cell_page[col] != table.cell_endpage[col])
do_valign = 0;
if (table.cell_endpage[col] > row_page)
{
row_page = table.cell_endpage[col];
row_y = table.cell_endy[col];
}
else if (table.cell_endy[col] < row_y && table.cell_endpage[col] == row_page)
row_y = table.cell_endy[col];
}
DEBUG_printf(("**** col = %d, row = %d, row_y = %.1f, row_page = %d\n", col, row, row_y, row_page));
for (col ++; colspan > 0; colspan --, col ++)
{
table.cell_start[col] = NULL;
table.cell_page[col] = table.cell_page[col - 1];
table.cell_y[col] = table.cell_y[col - 1];
table.cell_end[col] = NULL;
table.cell_endpage[col] = table.cell_endpage[col - 1];
table.cell_endy[col] = table.cell_endy[col - 1];
table.cell_height[col] = table.cell_height[col - 1];
}
}
DEBUG_printf(("row = %d, row_y = %.1f, row_height = %.1f\n", row, row_y, row_height));
for (col = 0; col < table.num_cols; col += colspan)
{
for (colspan = 1; (col + colspan) < table.num_cols; colspan ++)
if (cells[row][col] != cells[row][col + colspan])
break;
if (table.row_spans[col])
table.span_heights[col] += row_height;
DEBUG_printf(("col = %d, cell_y = %.1f, cell_page = %d, cell_endpage = %d, row_spans = %d, span_heights = %.1f, cell_height = %.1f\n", col, table.cell_y[col], table.cell_page[col], table.cell_endpage[col], table.row_spans[col], table.span_heights[col], table.cell_height[col]));
}
for (col = 0; col < table.num_cols; col += colspan)
{
for (colspan = 1; (col + colspan) < table.num_cols; colspan ++)
if (cells[row][col] != cells[row][col + colspan])
break;
if (table.row_spans[col] == rowspan &&
table.cell_page[col] == table.cell_endpage[col] &&
table.cell_height[col] > table.span_heights[col])
{
temp_height = table.cell_height[col] - table.span_heights[col];
row_height += temp_height;
DEBUG_printf(("Adjusting row-span height by %.1f, new row_height = %.1f\n", temp_height, row_height));
for (tcol = 0; tcol < table.num_cols; tcol ++)
if (table.row_spans[tcol])
{
table.span_heights[tcol] += temp_height;
DEBUG_printf(("col = %d, span_heights = %.1f\n", tcol, table.span_heights[tcol]));
}
}
}
DEBUG_printf(("AFTER row = %d, row_page = %d, row_y = %.1f, row_height = %.1f, *y = %.1f, do_valign = %d\n", row, row_page, row_y, row_height, *y, do_valign));
/*
* Do the vertical alignment
*/
if (do_valign)
{
height_var = NULL;
if (cells[row][0] != NULL)
{
if ((height_var = htmlGetVariable(cells[row][0]->parent, (uchar *)"HEIGHT")) == NULL)
for (col = 0; col < table.num_cols; col ++)
if (htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN") == NULL)
if ((height_var = htmlGetVariable(cells[row][col], (uchar *)"HEIGHT")) != NULL)
break;
}
if (height_var != NULL)
{
// Hardcode the row height...
if (height_var[strlen((char *)height_var) - 1] == '%')
temp_height = (float)(atof((char *)height_var) * 0.01f * PagePrintLength);
else
temp_height = (float)(atof((char *)height_var) * PagePrintWidth / _htmlBrowserWidth);
if (table.height > 0 && temp_height > table.height)
temp_height = table.height;
temp_height -= 2 * table.cellpadding;
if (temp_height > row_height)
{
// Only enforce the height if it is > the actual row height.
row_height = temp_height;
row_y = *y - temp_height;
}
}
for (col = 0; col < table.num_cols; col += colspan + 1)
{
render_t *p;
float delta_y;
for (colspan = 1; (col + colspan) < table.num_cols; colspan ++)
if (cells[row][col] != cells[row][col + colspan])
break;
colspan --;
if (table.cell_start[col] == NULL || table.row_spans[col] > rowspan ||
cells[row][col] == NULL || cells[row][col]->child == NULL)
continue;
if (table.row_spans[col] == 1)
{
int tcol;
float span_height = 0.0f;
for (tcol = 0; tcol < table.num_cols; tcol ++)
{
if (table.row_spans[col] == 1 && table.span_heights[col] > span_height)
span_height = table.span_heights[col];
}
switch (cells[row][col]->valignment)
{
case ALIGN_MIDDLE :
// delta_y = (table.span_heights[col] - table.cell_height[col]) * 0.5f;
delta_y = (span_height - table.cell_height[col]) * 0.5f;
break;
case ALIGN_BOTTOM :
// delta_y = table.span_heights[col] - table.cell_height[col];
delta_y = span_height - table.cell_height[col];
break;
default :
delta_y = 0.0f;
break;
}
}
else if (table.row_spans[col])
{
delta_y = 0.0f;
}
else
{
switch (cells[row][col]->valignment)
{
case ALIGN_MIDDLE :
delta_y = (row_height - table.cell_height[col]) * 0.5f;
break;
case ALIGN_BOTTOM :
delta_y = row_height - table.cell_height[col];
break;
default :
delta_y = 0.0f;
break;
}
}
DEBUG_printf(("row = %d, col = %d, valign = %d, rowspans = %d, cell_height = %.1f, span_heights = %.1f, delta_y = %.1f\n", row, col, cells[row][col]->valignment, table.row_spans[col], table.cell_height[col], table.span_heights[col], delta_y));
if (delta_y > 0.0f)
{
if (table.cell_start[col] == table.cell_end[col])
p = table.cell_start[col];
else
p = table.cell_start[col]->next;
for (; p != NULL; p = p->next)
{
DEBUG_printf(("aligning %p (%s), y was %.1f, now %.1f\n",
(void *)p, p->data.text.buffer, p->y, p->y - delta_y));
p->y -= delta_y;
if (p == table.cell_end[col])
break;
}
}
#ifdef DEBUG
else
{
if (table.cell_start[col] == table.cell_end[col])
p = table.cell_start[col];
else
p = table.cell_start[col]->next;
for (; p != NULL; p = p->next)
{
printf("NOT aligning %p (%s)\n", (void *)p, p->data.text.buffer);
if (p == table.cell_end[col])
break;
}
}
#endif /* DEBUG */
}
}
// Update all current columns with ROWSPAN <= rowspan to use the same
// end page and row...
for (col = 0, temp_page = -1, temp_y = 99999999; col < table.num_cols; col ++)
if (table.row_spans[col] <= rowspan &&
cells[row][col] != NULL && cells[row][col]->child != NULL)
{
if (table.cell_endpage[col] > temp_page)
{
temp_page = table.cell_endpage[col];
temp_y = table.cell_endy[col];
}
else if (table.cell_endpage[col] == temp_page && table.cell_endy[col] < temp_y)
temp_y = table.cell_endy[col];
}
for (col = 0; col < table.num_cols; col ++)
if (table.row_spans[col] <= rowspan &&
cells[row][col] != NULL && cells[row][col]->child != NULL)
{
table.cell_endpage[col] = temp_page;
table.cell_endy[col] = temp_y;
}
row_y -= table.cellpadding;
table.border_left = table.col_lefts[0] - table.cellpadding;
width = table.col_rights[table.num_cols - 1] - table.col_lefts[0] + 2 * table.cellpadding;
for (bgcolor = NULL, col = 0; col < table.num_cols; col ++)
if (table.row_spans[col] <= rowspan &&
cells[row][col] &&
!htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN") &&
(bgcolor = htmlGetVariable(cells[row][col]->parent,
(uchar *)"BGCOLOR")) != NULL)
break;
if (bgcolor)
{
memcpy(bgrgb, background_color, sizeof(bgrgb));
get_color(bgcolor, bgrgb, 0);
if (row_page > *page)
{
// Draw background on multiple pages...
// Bottom of first page...
new_render(*page, RENDER_BOX, table.border_left, bottom,
width, row_starty - bottom + table.cellpadding, bgrgb,
pages[*page].start);
// Intervening pages...
for (temp_page = *page + 1; temp_page < row_page; temp_page ++)
{
new_render(temp_page, RENDER_BOX, table.border_left, bottom,
width, top - bottom, bgrgb, pages[temp_page].start);
}
// Top of last page...
check_pages(*page);
new_render(row_page, RENDER_BOX, table.border_left, row_y,
width, top - row_y, bgrgb,
pages[row_page].start);
}
else
{
// Draw background in row...
new_render(row_page, RENDER_BOX, table.border_left, row_y,
width, row_height + 2 * table.cellpadding, bgrgb,
pages[row_page].start);
}
}
for (col = 0; col < table.num_cols; col += colspan + 1)
{
for (colspan = 0; (col + colspan) < table.num_cols; colspan ++)
if (cells[row][col] != cells[row][col + colspan])
break;
else if (table.row_spans[col + colspan] > 0)
{
DEBUG_printf(("row = %d, col = %d, decrementing row_spans (%d) to %d...\n", row,
col, table.row_spans[col + colspan],
table.row_spans[col + colspan] - rowspan));
table.row_spans[col + colspan] -= rowspan;
}
colspan --;
width = table.col_rights[col + colspan] - table.col_lefts[col] +
2 * table.cellpadding;
if (cells[row][col] == NULL || cells[row][col]->child == NULL ||
table.row_spans[col] > 0)
continue;
DEBUG_printf(("DRAWING BORDER+BACKGROUND: col=%d, row=%d, cell_page=%d, cell_y=%.1f\n"
" cell_endpage=%d, cell_endy=%.1f\n",
col, row, table.cell_page[col], table.cell_y[col],
table.cell_endpage[col], table.cell_endy[col]));
if ((bgcolor = htmlGetVariable(cells[row][col],
(uchar *)"BGCOLOR")) != NULL)
{
memcpy(bgrgb, background_color, sizeof(bgrgb));
get_color(bgcolor, bgrgb, 0);
}
table.border_left = table.col_lefts[col] - table.cellpadding;
if (table.cell_page[col] != table.cell_endpage[col])
{
/*
* Crossing a page boundary...
*/
if (table.border > 0)
{
/*
* +---+---+---+
* | | | |
*/
// Top
new_render(table.cell_page[col], RENDER_BOX, table.border_left,
table.cell_y[col] + table.cellpadding,
width + table.border, table.border, table.border_rgb);
// Left
new_render(table.cell_page[col], RENDER_BOX, table.border_left, bottom,
table.border, table.cell_y[col] - bottom + table.cellpadding + table.border, table.border_rgb);
// Right
new_render(table.cell_page[col], RENDER_BOX,
table.border_left + width, bottom,
table.border, table.cell_y[col] - bottom + table.cellpadding + table.border, table.border_rgb);
}
if (bgcolor != NULL)
{
table.cell_bg[col]->y = bottom;
table.cell_bg[col]->height = table.cell_y[col] - bottom + table.cellpadding + table.border;
}
for (temp_page = table.cell_page[col] + 1; temp_page < table.cell_endpage[col]; temp_page ++)
{
/*
* | | | |
* | | | |
*/
if (table.border > 0.0f)
{
// Left
new_render(temp_page, RENDER_BOX, table.border_left, bottom,
table.border, top - bottom, table.border_rgb);
// Right
new_render(temp_page, RENDER_BOX,
table.border_left + width, bottom,
table.border, top - bottom, table.border_rgb);
}
if (bgcolor != NULL)
new_render(temp_page, RENDER_BOX, table.border_left, bottom,
width + table.border, top - bottom, bgrgb,
pages[temp_page].start);
}
if (table.border > 0.0f)
{
/*
* | | | |
* +---+---+---+
*/
// Left
new_render(table.cell_endpage[col], RENDER_BOX, table.border_left, row_y,
table.border, top - row_y, table.border_rgb);
// Right
new_render(table.cell_endpage[col], RENDER_BOX,
table.border_left + width, row_y,
table.border, top - row_y, table.border_rgb);
// Bottom
new_render(table.cell_endpage[col], RENDER_BOX, table.border_left, row_y,
width + table.border, table.border, table.border_rgb);
}
if (bgcolor != NULL)
{
check_pages(table.cell_endpage[col]);
new_render(table.cell_endpage[col], RENDER_BOX, table.border_left, row_y,
width + table.border, top - row_y, bgrgb,
pages[table.cell_endpage[col]].start);
}
}
else
{
/*
* +---+---+---+
* | | | |
* +---+---+---+
*/
if (table.border > 0.0f)
{
// Top
new_render(table.cell_page[col], RENDER_BOX, table.border_left,
table.cell_y[col] + table.cellpadding,
width + table.border, table.border, table.border_rgb);
// Left
new_render(table.cell_page[col], RENDER_BOX, table.border_left, row_y,
table.border, table.cell_y[col] - row_y + table.cellpadding + table.border, table.border_rgb);
// Right
new_render(table.cell_page[col], RENDER_BOX,
table.border_left + width, row_y,
table.border, table.cell_y[col] - row_y + table.cellpadding + table.border, table.border_rgb);
// Bottom
new_render(table.cell_page[col], RENDER_BOX, table.border_left, row_y,
width + table.border, table.border, table.border_rgb);
}
if (bgcolor != NULL)
{
table.cell_bg[col]->y = row_y;
table.cell_bg[col]->height = table.cell_y[col] - row_y + table.cellpadding + table.border;
}
}
}
*page = row_page;
*y = row_y;
} | 4057 | True | 1 |
CVE-2021-23158 | 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/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967018', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967018', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/414', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/414', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.12:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.'}] | 2022-03-22T17:02Z | 2022-03-16T15: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 R Sweet | 2021-04-01 09:37:58-04:00 | Fix JPEG error handling (Issue #415) | 369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | file_rlookup | file_rlookup( const char * filename) | ['filename'] | file_rlookup(const char *filename) /* I - Filename */
{
int i; /* Looping var */
cache_t *wc; /* Current cache file */
for (i = web_files, wc = web_cache; i > 0; i --, wc ++)
if (!strcmp(wc->name, filename))
return (wc->url);
return (filename);
} | 60 | True | 1 |
CVE-2021-23191 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://ubuntu.com/security/CVE-2021-23191', 'name': 'https://ubuntu.com/security/CVE-2021-23191', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/415', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/415', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967022', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967022', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A security issue was found in htmldoc v1.9.12 and before. A NULL pointer dereference in the function image_load_jpeg() in image.cxx may result in denial of service.'}] | 2022-03-10T19:31Z | 2022-03-02T23: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 R Sweet | 2021-04-01 09:37:58-04:00 | Fix JPEG error handling (Issue #415) | 369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | file_rlookup | file_rlookup( const char * filename) | ['filename'] | file_rlookup(const char *filename) /* I - Filename */
{
int i; /* Looping var */
cache_t *wc; /* Current cache file */
for (i = web_files, wc = web_cache; i > 0; i --, wc ++)
if (!strcmp(wc->name, filename))
return (wc->url);
return (filename);
} | 60 | True | 1 |
CVE-2021-23158 | 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/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967018', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967018', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/414', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/414', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.12:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.'}] | 2022-03-22T17:02Z | 2022-03-16T15: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 R Sweet | 2021-04-01 09:37:58-04:00 | Fix JPEG error handling (Issue #415) | 369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | image_load_jpeg | image_load_jpeg( image_t * img , FILE * fp , int gray , int load_data) | ['img', 'fp', 'gray', 'load_data'] | image_load_jpeg(image_t *img, /* I - Image pointer */
FILE *fp, /* I - File to load from */
int gray, /* I - 0 = color, 1 = grayscale */
int load_data)/* I - 1 = load image data, 0 = just info */
{
struct jpeg_decompress_struct cinfo; /* Decompressor info */
struct jpeg_error_mgr jerr; /* Error handler info */
JSAMPROW row; /* Sample row pointer */
jpeg_std_error(&jerr);
jerr.error_exit = jpeg_error_handler;
cinfo.err = &jerr;
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, fp);
jpeg_read_header(&cinfo, (boolean)1);
cinfo.quantize_colors = FALSE;
if (gray || cinfo.num_components == 1)
{
cinfo.out_color_space = JCS_GRAYSCALE;
cinfo.out_color_components = 1;
cinfo.output_components = 1;
}
else if (cinfo.num_components != 3)
{
jpeg_destroy_decompress(&cinfo);
progress_error(HD_ERROR_BAD_FORMAT,
"CMYK JPEG files are not supported! (%s)",
file_rlookup(img->filename));
return (-1);
}
else
{
cinfo.out_color_space = JCS_RGB;
cinfo.out_color_components = 3;
cinfo.output_components = 3;
}
jpeg_calc_output_dimensions(&cinfo);
img->width = (int)cinfo.output_width;
img->height = (int)cinfo.output_height;
img->depth = (int)cinfo.output_components;
if (!load_data)
{
jpeg_destroy_decompress(&cinfo);
return (0);
}
img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img->depth));
if (img->pixels == NULL)
{
jpeg_destroy_decompress(&cinfo);
return (-1);
}
jpeg_start_decompress(&cinfo);
while (cinfo.output_scanline < cinfo.output_height)
{
row = (JSAMPROW)(img->pixels + (size_t)cinfo.output_scanline * (size_t)cinfo.output_width * (size_t)cinfo.output_components);
jpeg_read_scanlines(&cinfo, &row, (JDIMENSION)1);
}
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
return (0);
} | 355 | True | 1 |
CVE-2021-23191 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://ubuntu.com/security/CVE-2021-23191', 'name': 'https://ubuntu.com/security/CVE-2021-23191', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/415', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/415', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967022', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967022', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A security issue was found in htmldoc v1.9.12 and before. A NULL pointer dereference in the function image_load_jpeg() in image.cxx may result in denial of service.'}] | 2022-03-10T19:31Z | 2022-03-02T23: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 R Sweet | 2021-04-01 09:37:58-04:00 | Fix JPEG error handling (Issue #415) | 369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | image_load_jpeg | image_load_jpeg( image_t * img , FILE * fp , int gray , int load_data) | ['img', 'fp', 'gray', 'load_data'] | image_load_jpeg(image_t *img, /* I - Image pointer */
FILE *fp, /* I - File to load from */
int gray, /* I - 0 = color, 1 = grayscale */
int load_data)/* I - 1 = load image data, 0 = just info */
{
struct jpeg_decompress_struct cinfo; /* Decompressor info */
struct jpeg_error_mgr jerr; /* Error handler info */
JSAMPROW row; /* Sample row pointer */
jpeg_std_error(&jerr);
jerr.error_exit = jpeg_error_handler;
cinfo.err = &jerr;
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, fp);
jpeg_read_header(&cinfo, (boolean)1);
cinfo.quantize_colors = FALSE;
if (gray || cinfo.num_components == 1)
{
cinfo.out_color_space = JCS_GRAYSCALE;
cinfo.out_color_components = 1;
cinfo.output_components = 1;
}
else if (cinfo.num_components != 3)
{
jpeg_destroy_decompress(&cinfo);
progress_error(HD_ERROR_BAD_FORMAT,
"CMYK JPEG files are not supported! (%s)",
file_rlookup(img->filename));
return (-1);
}
else
{
cinfo.out_color_space = JCS_RGB;
cinfo.out_color_components = 3;
cinfo.output_components = 3;
}
jpeg_calc_output_dimensions(&cinfo);
img->width = (int)cinfo.output_width;
img->height = (int)cinfo.output_height;
img->depth = (int)cinfo.output_components;
if (!load_data)
{
jpeg_destroy_decompress(&cinfo);
return (0);
}
img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img->depth));
if (img->pixels == NULL)
{
jpeg_destroy_decompress(&cinfo);
return (-1);
}
jpeg_start_decompress(&cinfo);
while (cinfo.output_scanline < cinfo.output_height)
{
row = (JSAMPROW)(img->pixels + (size_t)cinfo.output_scanline * (size_t)cinfo.output_width * (size_t)cinfo.output_components);
jpeg_read_scanlines(&cinfo, &row, (JDIMENSION)1);
}
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
return (0);
} | 355 | True | 1 |
CVE-2021-23158 | 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/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967018', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967018', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/414', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/414', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.12:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.'}] | 2022-03-22T17:02Z | 2022-03-16T15: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 R Sweet | 2021-04-01 09:37:58-04:00 | Fix JPEG error handling (Issue #415) | 369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | jpeg_error_handler | jpeg_error_handler( j_common_ptr) | ['j_common_ptr'] | jpeg_error_handler(j_common_ptr)
{
return;
} | 8 | True | 1 |
CVE-2021-23191 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://ubuntu.com/security/CVE-2021-23191', 'name': 'https://ubuntu.com/security/CVE-2021-23191', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/415', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/415', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967022', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967022', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A security issue was found in htmldoc v1.9.12 and before. A NULL pointer dereference in the function image_load_jpeg() in image.cxx may result in denial of service.'}] | 2022-03-10T19:31Z | 2022-03-02T23: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 R Sweet | 2021-04-01 09:37:58-04:00 | Fix JPEG error handling (Issue #415) | 369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | jpeg_error_handler | jpeg_error_handler( j_common_ptr) | ['j_common_ptr'] | jpeg_error_handler(j_common_ptr)
{
return;
} | 8 | True | 1 |
CVE-2021-23165 | False | False | False | False | AV:N/AC:L/Au:N/C:C/I:C/A:C | NETWORK | LOW | NONE | COMPLETE | COMPLETE | COMPLETE | 10.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/michaelrsweet/htmldoc/commit/6e8a95561988500b5b5ae4861b3b0cbf4fba517f', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/6e8a95561988500b5b5ae4861b3b0cbf4fba517f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967014', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1967014', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/413', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/413', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/6e8a95561988500b5b5ae4861b3b0cbf4fba517f.patch', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/6e8a95561988500b5b5ae4861b3b0cbf4fba517f.patch', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.9.12', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.12:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in htmldoc before v1.9.12. Heap buffer overflow in pspdf_prepare_outpages(), in ps-pdf.cxx may lead to execute arbitrary code and denial of service.'}] | 2022-03-22T17:01Z | 2022-03-16T15: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 | Michael R Sweet | 2021-04-01 09:47:56-04:00 | Fix a number-up crash bug (Issue #413) | 6e8a95561988500b5b5ae4861b3b0cbf4fba517f | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | pspdf_prepare_outpages | pspdf_prepare_outpages() | [] | pspdf_prepare_outpages()
{
int c, i, j; /* Looping vars */
int nup; /* Current number-up value */
page_t *page; /* Current page */
outpage_t *outpage; /* Current output page */
// Allocate an output page array...
outpages = (outpage_t *)malloc(sizeof(outpage_t) * num_pages);
memset(outpages, -1, sizeof(outpage_t) * num_pages);
num_outpages = 0;
outpage = outpages;
// Handle the title page, as needed...
if (TitlePage)
{
for (i = 0, j = 0, nup = -1, page = pages;
i < chapter_starts[1];
i ++, page ++)
{
if (nup != page->nup)
{
if (j)
{
// Break the current output page...
outpage ++;
num_outpages ++;
}
nup = page->nup;
j = 0;
}
if (!j)
outpage->nup = nup;
pspdf_transform_page(num_outpages, j, i);
j ++;
if (j >= nup)
{
j = 0;
outpage ++;
num_outpages ++;
}
}
if (j)
{
// Break the current output page...
outpage ++;
num_outpages ++;
}
}
// Loop through each chapter, adding pages as needed...
if (OutputType == OUTPUT_BOOK && TocLevels > 0)
c = 0;
else
c = 1;
for (; c <= TocDocCount; c ++)
{
if (chapter_starts[c] < 0)
continue;
chapter_outstarts[c] = num_outpages;
for (i = chapter_starts[c], j = 0, nup = -1, page = pages + i;
i <= chapter_ends[c];
i ++, page ++)
{
if (nup != page->nup)
{
if (j)
{
// Break the current output page...
outpage ++;
num_outpages ++;
}
nup = page->nup;
j = 0;
}
if (!j)
outpage->nup = nup;
pspdf_transform_page(num_outpages, j, i);
j ++;
if (j >= nup)
{
j = 0;
outpage ++;
num_outpages ++;
}
}
if (j)
{
// Break the current output page...
outpage ++;
num_outpages ++;
}
chapter_outends[c] = num_outpages;
}
#ifdef DEBUG
for (c = 0; c <= TocDocCount; c ++)
printf("chapter_outstarts[%d] = %d, chapter_outends[%d] = %d\n",
c, chapter_outstarts[c], c, chapter_outends[c]);
printf("num_outpages = %d\n", (int)num_outpages);
for (i = 0, outpage = outpages; i < (int)num_outpages; i ++, outpage ++)
{
printf("outpage[%d]:\tnup=%d, pages=[", i, outpage->nup);
for (j = 0; j < outpage->nup; j ++)
printf(" %d", outpage->pages[j]);
puts(" ]");
page = pages + outpage->pages[0];
printf("\t\twidth = %d, length = %d\n", page->width, page->length);
}
for (c = 0; c <= TocDocCount; c ++)
printf("chapter_starts[%d] = %d, chapter_ends[%d] = %d\n",
c, chapter_starts[c], c, chapter_ends[c]);
for (i = 0; i < (int)num_pages; i ++)
printf("pages[%d]->outpage = %d\n", i, pages[i].outpage);
for (i = 0; i < (int)num_headings; i ++)
printf("heading_pages[%d] = %d\n", i, heading_pages[i]);
for (i = 0; i < (int)num_links; i ++)
printf("links[%d].name = \"%s\", page = %d\n", i,
links[i].name, links[i].page);
#endif // DEBUG
} | 628 | True | 1 |
CVE-2022-34033 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.15:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.15 was discovered to contain a heap overflow via (write_header) /htmldoc/htmldoc/html.cxx:273.'}] | 2022-07-27T17:43Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:37:23-04:00 | Fix a crash bug with empty titles (Issue #425) | a0014be47d614220db111b360fb6170ef6f3937e | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | htmlGetText | htmlGetText( tree_t * t) | ['t'] | htmlGetText(tree_t *t) /* I - Tree to pick */
{
uchar *s, // String
*s2, // New string
*tdata = NULL, // Temporary string data
*talloc = NULL; // Allocated string data
size_t slen, // Length of string
tlen; // Length of node string
// Loop through all of the nodes in the tree and collect text...
slen = 0;
s = NULL;
while (t != NULL)
{
if (t->child)
tdata = talloc = htmlGetText(t->child);
else
tdata = t->data;
if (tdata != NULL)
{
// Add the text to this string...
tlen = strlen((char *)tdata);
if (s)
s2 = (uchar *)realloc(s, 1 + slen + tlen);
else
s2 = (uchar *)malloc(1 + tlen);
if (!s2)
break;
s = s2;
memcpy((char *)s + slen, (char *)tdata, tlen);
slen += tlen;
if (talloc)
{
free(talloc);
talloc = NULL;
}
}
t = t->next;
}
if (slen)
s[slen] = '\0';
if (talloc)
free(talloc);
return (s);
} | 204 | True | 1 |
CVE-2022-34035 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.12 and below was discovered to contain a heap overflow via e_node htmldoc/htmldoc/html.cxx:588.'}] | 2022-07-27T17:54Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:37:23-04:00 | Fix a crash bug with empty titles (Issue #425) | a0014be47d614220db111b360fb6170ef6f3937e | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | htmlGetText | htmlGetText( tree_t * t) | ['t'] | htmlGetText(tree_t *t) /* I - Tree to pick */
{
uchar *s, // String
*s2, // New string
*tdata = NULL, // Temporary string data
*talloc = NULL; // Allocated string data
size_t slen, // Length of string
tlen; // Length of node string
// Loop through all of the nodes in the tree and collect text...
slen = 0;
s = NULL;
while (t != NULL)
{
if (t->child)
tdata = talloc = htmlGetText(t->child);
else
tdata = t->data;
if (tdata != NULL)
{
// Add the text to this string...
tlen = strlen((char *)tdata);
if (s)
s2 = (uchar *)realloc(s, 1 + slen + tlen);
else
s2 = (uchar *)malloc(1 + tlen);
if (!s2)
break;
s = s2;
memcpy((char *)s + slen, (char *)tdata, tlen);
slen += tlen;
if (talloc)
{
free(talloc);
talloc = NULL;
}
}
t = t->next;
}
if (slen)
s[slen] = '\0';
if (talloc)
free(talloc);
return (s);
} | 204 | True | 1 |
CVE-2022-34033 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.15:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.15 was discovered to contain a heap overflow via (write_header) /htmldoc/htmldoc/html.cxx:273.'}] | 2022-07-27T17:43Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:37:23-04:00 | Fix a crash bug with empty titles (Issue #425) | a0014be47d614220db111b360fb6170ef6f3937e | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | show_tree | show_tree( tree_t * t , int indent) | ['t', 'indent'] | show_tree(tree_t *t, /* I - Parent node */
int indent) /* I - Indentation */
{
while (t)
{
if (t->markup == MARKUP_NONE)
printf("%*s\"%s\"\n", indent, "", t->data);
else
printf("%*s%s\n", indent, "", _htmlMarkups[t->markup]);
if (t->child)
show_tree(t->child, indent + 2);
t = t->next;
}
} | 78 | True | 1 |
CVE-2022-34035 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.12 and below was discovered to contain a heap overflow via e_node htmldoc/htmldoc/html.cxx:588.'}] | 2022-07-27T17:54Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:37:23-04:00 | Fix a crash bug with empty titles (Issue #425) | a0014be47d614220db111b360fb6170ef6f3937e | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | show_tree | show_tree( tree_t * t , int indent) | ['t', 'indent'] | show_tree(tree_t *t, /* I - Parent node */
int indent) /* I - Indentation */
{
while (t)
{
if (t->markup == MARKUP_NONE)
printf("%*s\"%s\"\n", indent, "", t->data);
else
printf("%*s%s\n", indent, "", _htmlMarkups[t->markup]);
if (t->child)
show_tree(t->child, indent + 2);
t = t->next;
}
} | 78 | True | 1 |
CVE-2022-34033 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.15:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.15 was discovered to contain a heap overflow via (write_header) /htmldoc/htmldoc/html.cxx:273.'}] | 2022-07-27T17:43Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:42:42-04:00 | Fix a crash bug with bogus text (Issue #426) | ee778252faebb721afba5a081dd6ad7eaf20eef3 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | write_node | write_node( FILE * out , tree_t * t , int col) | ['out', 't', 'col'] | write_node(FILE *out, /* I - Output file */
tree_t *t, /* I - Document tree node */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr, /* Pointer to output string */
*entity, /* Entity string */
*src, /* Source image */
*realsrc, /* Real source image */
newsrc[1024]; /* New source image filename */
if (out == NULL)
return (0);
switch (t->markup)
{
case MARKUP_NONE :
if (t->data == NULL)
break;
if (t->preformatted)
{
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
if (t->data[strlen((char *)t->data) - 1] == '\n')
col = 0;
else
col += strlen((char *)t->data);
}
else
{
if ((col + (int)strlen((char *)t->data)) > 72 && col > 0)
{
putc('\n', out);
col = 0;
}
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
col += strlen((char *)t->data);
if (col > 72)
{
putc('\n', out);
col = 0;
}
}
break;
case MARKUP_COMMENT :
case MARKUP_UNKNOWN :
fputs("\n<!--", out);
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
fputs("-->\n", out);
col = 0;
break;
case MARKUP_AREA :
case MARKUP_BODY :
case MARKUP_DOCTYPE :
case MARKUP_ERROR :
case MARKUP_FILE :
case MARKUP_HEAD :
case MARKUP_HTML :
case MARKUP_MAP :
case MARKUP_META :
case MARKUP_TITLE :
break;
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_H7 :
case MARKUP_H8 :
case MARKUP_H9 :
case MARKUP_H10 :
case MARKUP_H11 :
case MARKUP_H12 :
case MARKUP_H13 :
case MARKUP_H14 :
case MARKUP_H15 :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TR :
case MARKUP_UL :
if (col > 0)
{
putc('\n', out);
col = 0;
}
default :
if (t->markup == MARKUP_IMG && OutputFiles &&
(src = htmlGetVariable(t, (uchar *)"SRC")) != NULL &&
(realsrc = htmlGetVariable(t, (uchar *)"REALSRC")) != NULL)
{
/*
* Update and copy local images...
*/
if (file_method((char *)src) == NULL &&
src[0] != '/' && src[0] != '\\' &&
(!isalpha(src[0]) || src[1] != ':'))
{
image_copy((char *)src, (char *)realsrc, OutputPath);
strlcpy((char *)newsrc, file_basename((char *)src), sizeof(newsrc));
htmlSetVariable(t, (uchar *)"SRC", newsrc);
}
}
if (t->markup != MARKUP_EMBED)
{
col += fprintf(out, "<%s", _htmlMarkups[t->markup]);
for (i = 0; i < t->nvars; i ++)
{
if (strcasecmp((char *)t->vars[i].name, "BREAK") == 0 &&
t->markup == MARKUP_HR)
continue;
if (strcasecmp((char *)t->vars[i].name, "REALSRC") == 0 &&
t->markup == MARKUP_IMG)
continue;
if (strncasecmp((char *)t->vars[i].name, "_HD_", 4) == 0)
continue;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
if (col > 0)
{
putc(' ', out);
col ++;
}
if (t->vars[i].value == NULL)
col += fprintf(out, "%s", t->vars[i].name);
else
{
col += fprintf(out, "%s=\"", t->vars[i].name);
for (ptr = t->vars[i].value; *ptr; ptr ++)
{
entity = iso8859(*ptr);
fputs((char *)entity, out);
col += strlen((char *)entity);
}
putc('\"', out);
col ++;
}
}
putc('>', out);
col ++;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
}
break;
}
return (col);
} | 913 | True | 1 |
CVE-2022-34035 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.12 and below was discovered to contain a heap overflow via e_node htmldoc/htmldoc/html.cxx:588.'}] | 2022-07-27T17:54Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:42:42-04:00 | Fix a crash bug with bogus text (Issue #426) | ee778252faebb721afba5a081dd6ad7eaf20eef3 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | write_node | write_node( FILE * out , tree_t * t , int col) | ['out', 't', 'col'] | write_node(FILE *out, /* I - Output file */
tree_t *t, /* I - Document tree node */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr, /* Pointer to output string */
*entity, /* Entity string */
*src, /* Source image */
*realsrc, /* Real source image */
newsrc[1024]; /* New source image filename */
if (out == NULL)
return (0);
switch (t->markup)
{
case MARKUP_NONE :
if (t->data == NULL)
break;
if (t->preformatted)
{
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
if (t->data[strlen((char *)t->data) - 1] == '\n')
col = 0;
else
col += strlen((char *)t->data);
}
else
{
if ((col + (int)strlen((char *)t->data)) > 72 && col > 0)
{
putc('\n', out);
col = 0;
}
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
col += strlen((char *)t->data);
if (col > 72)
{
putc('\n', out);
col = 0;
}
}
break;
case MARKUP_COMMENT :
case MARKUP_UNKNOWN :
fputs("\n<!--", out);
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
fputs("-->\n", out);
col = 0;
break;
case MARKUP_AREA :
case MARKUP_BODY :
case MARKUP_DOCTYPE :
case MARKUP_ERROR :
case MARKUP_FILE :
case MARKUP_HEAD :
case MARKUP_HTML :
case MARKUP_MAP :
case MARKUP_META :
case MARKUP_TITLE :
break;
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_H7 :
case MARKUP_H8 :
case MARKUP_H9 :
case MARKUP_H10 :
case MARKUP_H11 :
case MARKUP_H12 :
case MARKUP_H13 :
case MARKUP_H14 :
case MARKUP_H15 :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TR :
case MARKUP_UL :
if (col > 0)
{
putc('\n', out);
col = 0;
}
default :
if (t->markup == MARKUP_IMG && OutputFiles &&
(src = htmlGetVariable(t, (uchar *)"SRC")) != NULL &&
(realsrc = htmlGetVariable(t, (uchar *)"REALSRC")) != NULL)
{
/*
* Update and copy local images...
*/
if (file_method((char *)src) == NULL &&
src[0] != '/' && src[0] != '\\' &&
(!isalpha(src[0]) || src[1] != ':'))
{
image_copy((char *)src, (char *)realsrc, OutputPath);
strlcpy((char *)newsrc, file_basename((char *)src), sizeof(newsrc));
htmlSetVariable(t, (uchar *)"SRC", newsrc);
}
}
if (t->markup != MARKUP_EMBED)
{
col += fprintf(out, "<%s", _htmlMarkups[t->markup]);
for (i = 0; i < t->nvars; i ++)
{
if (strcasecmp((char *)t->vars[i].name, "BREAK") == 0 &&
t->markup == MARKUP_HR)
continue;
if (strcasecmp((char *)t->vars[i].name, "REALSRC") == 0 &&
t->markup == MARKUP_IMG)
continue;
if (strncasecmp((char *)t->vars[i].name, "_HD_", 4) == 0)
continue;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
if (col > 0)
{
putc(' ', out);
col ++;
}
if (t->vars[i].value == NULL)
col += fprintf(out, "%s", t->vars[i].name);
else
{
col += fprintf(out, "%s=\"", t->vars[i].name);
for (ptr = t->vars[i].value; *ptr; ptr ++)
{
entity = iso8859(*ptr);
fputs((char *)entity, out);
col += strlen((char *)entity);
}
putc('\"', out);
col ++;
}
}
putc('>', out);
col ++;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
}
break;
}
return (col);
} | 913 | True | 1 |
CVE-2022-34033 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.15:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.15 was discovered to contain a heap overflow via (write_header) /htmldoc/htmldoc/html.cxx:273.'}] | 2022-07-27T17:43Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:42:42-04:00 | Fix a crash bug with bogus text (Issue #426) | ee778252faebb721afba5a081dd6ad7eaf20eef3 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | write_file | write_file( tree_t * t , FILE * fp , int col) | ['t', 'fp', 'col'] | write_file(tree_t *t, /* I - Tree entry */
FILE *fp, /* I - File to write to */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr; /* Character pointer */
while (t != NULL)
{
if (t->markup == MARKUP_NONE)
{
if (t->preformatted)
{
for (ptr = t->data; *ptr != '\0'; ptr ++)
fputs((char *)iso8859(*ptr), fp);
if (t->data[strlen((char *)t->data) - 1] == '\n')
col = 0;
else
col += strlen((char *)t->data);
}
else
{
if ((col + (int)strlen((char *)t->data)) > 72 && col > 0)
{
putc('\n', fp);
col = 0;
}
for (ptr = t->data; *ptr != '\0'; ptr ++)
fputs((char *)iso8859(*ptr), fp);
col += strlen((char *)t->data);
if (col > 72)
{
putc('\n', fp);
col = 0;
}
}
}
else if (t->markup == MARKUP_COMMENT)
fprintf(fp, "\n<!--%s-->\n", t->data);
else if (t->markup > 0)
{
switch (t->markup)
{
case MARKUP_AREA :
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_COMMENT :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_HEAD :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_MAP :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TITLE :
case MARKUP_TR :
case MARKUP_UL :
case MARKUP_DIR :
case MARKUP_MENU :
if (col > 0)
{
putc('\n', fp);
col = 0;
}
default :
break;
}
col += fprintf(fp, "<%s", _htmlMarkups[t->markup]);
for (i = 0; i < t->nvars; i ++)
{
if (col > 72 && !t->preformatted)
{
putc('\n', fp);
col = 0;
}
if (col > 0)
{
putc(' ', fp);
col ++;
}
if (t->vars[i].value == NULL)
col += fprintf(fp, "%s", t->vars[i].name);
else if (strchr((char *)t->vars[i].value, '\"') != NULL)
col += fprintf(fp, "%s=\'%s\'", t->vars[i].name, t->vars[i].value);
else
col += fprintf(fp, "%s=\"%s\"", t->vars[i].name, t->vars[i].value);
}
putc('>', fp);
col ++;
if (col > 72 && !t->preformatted)
{
putc('\n', fp);
col = 0;
}
if (t->child != NULL)
{
col = write_file(t->child, fp, col);
if (col > 72 && !t->preformatted)
{
putc('\n', fp);
col = 0;
}
col += fprintf(fp, "</%s>", _htmlMarkups[t->markup]);
switch (t->markup)
{
case MARKUP_AREA :
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_COMMENT :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_HEAD :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_MAP :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TITLE :
case MARKUP_TR :
case MARKUP_UL :
case MARKUP_DIR :
case MARKUP_MENU :
putc('\n', fp);
col = 0;
default :
break;
}
}
}
t = t->next;
}
return (col);
} | 757 | True | 1 |
CVE-2022-34035 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.12 and below was discovered to contain a heap overflow via e_node htmldoc/htmldoc/html.cxx:588.'}] | 2022-07-27T17:54Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:42:42-04:00 | Fix a crash bug with bogus text (Issue #426) | ee778252faebb721afba5a081dd6ad7eaf20eef3 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | write_file | write_file( tree_t * t , FILE * fp , int col) | ['t', 'fp', 'col'] | write_file(tree_t *t, /* I - Tree entry */
FILE *fp, /* I - File to write to */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr; /* Character pointer */
while (t != NULL)
{
if (t->markup == MARKUP_NONE)
{
if (t->preformatted)
{
for (ptr = t->data; *ptr != '\0'; ptr ++)
fputs((char *)iso8859(*ptr), fp);
if (t->data[strlen((char *)t->data) - 1] == '\n')
col = 0;
else
col += strlen((char *)t->data);
}
else
{
if ((col + (int)strlen((char *)t->data)) > 72 && col > 0)
{
putc('\n', fp);
col = 0;
}
for (ptr = t->data; *ptr != '\0'; ptr ++)
fputs((char *)iso8859(*ptr), fp);
col += strlen((char *)t->data);
if (col > 72)
{
putc('\n', fp);
col = 0;
}
}
}
else if (t->markup == MARKUP_COMMENT)
fprintf(fp, "\n<!--%s-->\n", t->data);
else if (t->markup > 0)
{
switch (t->markup)
{
case MARKUP_AREA :
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_COMMENT :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_HEAD :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_MAP :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TITLE :
case MARKUP_TR :
case MARKUP_UL :
case MARKUP_DIR :
case MARKUP_MENU :
if (col > 0)
{
putc('\n', fp);
col = 0;
}
default :
break;
}
col += fprintf(fp, "<%s", _htmlMarkups[t->markup]);
for (i = 0; i < t->nvars; i ++)
{
if (col > 72 && !t->preformatted)
{
putc('\n', fp);
col = 0;
}
if (col > 0)
{
putc(' ', fp);
col ++;
}
if (t->vars[i].value == NULL)
col += fprintf(fp, "%s", t->vars[i].name);
else if (strchr((char *)t->vars[i].value, '\"') != NULL)
col += fprintf(fp, "%s=\'%s\'", t->vars[i].name, t->vars[i].value);
else
col += fprintf(fp, "%s=\"%s\"", t->vars[i].name, t->vars[i].value);
}
putc('>', fp);
col ++;
if (col > 72 && !t->preformatted)
{
putc('\n', fp);
col = 0;
}
if (t->child != NULL)
{
col = write_file(t->child, fp, col);
if (col > 72 && !t->preformatted)
{
putc('\n', fp);
col = 0;
}
col += fprintf(fp, "</%s>", _htmlMarkups[t->markup]);
switch (t->markup)
{
case MARKUP_AREA :
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_COMMENT :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_HEAD :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_MAP :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TITLE :
case MARKUP_TR :
case MARKUP_UL :
case MARKUP_DIR :
case MARKUP_MENU :
putc('\n', fp);
col = 0;
default :
break;
}
}
}
t = t->next;
}
return (col);
} | 757 | True | 1 |
CVE-2022-34033 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/425', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.15:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.15 was discovered to contain a heap overflow via (write_header) /htmldoc/htmldoc/html.cxx:273.'}] | 2022-07-27T17:43Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:42:42-04:00 | Fix a crash bug with bogus text (Issue #426) | ee778252faebb721afba5a081dd6ad7eaf20eef3 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | write_node | write_node( FILE * out , tree_t * t , int col) | ['out', 't', 'col'] | write_node(FILE *out, /* I - Output file */
tree_t *t, /* I - Document tree node */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr, /* Pointer to output string */
*entity, /* Entity string */
*src, /* Source image */
*realsrc, /* Real source image */
newsrc[1024]; /* New source image filename */
if (out == NULL)
return (0);
switch (t->markup)
{
case MARKUP_NONE :
if (t->data == NULL)
break;
if (t->preformatted)
{
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
if (t->data[strlen((char *)t->data) - 1] == '\n')
col = 0;
else
col += strlen((char *)t->data);
}
else
{
if ((col + (int)strlen((char *)t->data)) > 72 && col > 0)
{
putc('\n', out);
col = 0;
}
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
col += strlen((char *)t->data);
if (col > 72)
{
putc('\n', out);
col = 0;
}
}
break;
case MARKUP_COMMENT :
case MARKUP_UNKNOWN :
fputs("\n<!--", out);
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
fputs("-->\n", out);
col = 0;
break;
case MARKUP_AREA :
case MARKUP_BODY :
case MARKUP_DOCTYPE :
case MARKUP_ERROR :
case MARKUP_FILE :
case MARKUP_HEAD :
case MARKUP_HTML :
case MARKUP_MAP :
case MARKUP_META :
case MARKUP_TITLE :
break;
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_H7 :
case MARKUP_H8 :
case MARKUP_H9 :
case MARKUP_H10 :
case MARKUP_H11 :
case MARKUP_H12 :
case MARKUP_H13 :
case MARKUP_H14 :
case MARKUP_H15 :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TR :
case MARKUP_UL :
if (col > 0)
{
putc('\n', out);
col = 0;
}
default :
if (t->markup == MARKUP_IMG &&
(src = htmlGetVariable(t, (uchar *)"SRC")) != NULL &&
(realsrc = htmlGetVariable(t, (uchar *)"REALSRC")) != NULL)
{
/*
* Update local images...
*/
if (file_method((char *)src) == NULL &&
src[0] != '/' && src[0] != '\\' &&
(!isalpha(src[0]) || src[1] != ':'))
{
image_copy((char *)src, (char *)realsrc, OutputPath);
strlcpy((char *)newsrc, file_basename((char *)src), sizeof(newsrc));
htmlSetVariable(t, (uchar *)"SRC", newsrc);
}
}
if (t->markup != MARKUP_EMBED)
{
col += fprintf(out, "<%s", _htmlMarkups[t->markup]);
for (i = 0; i < t->nvars; i ++)
{
if (strcasecmp((char *)t->vars[i].name, "BREAK") == 0 &&
t->markup == MARKUP_HR)
continue;
if (strcasecmp((char *)t->vars[i].name, "REALSRC") == 0 &&
t->markup == MARKUP_IMG)
continue;
if (strncasecmp((char *)t->vars[i].name, "_HD_", 4) == 0)
continue;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
if (col > 0)
{
putc(' ', out);
col ++;
}
if (t->vars[i].value == NULL)
col += fprintf(out, "%s", t->vars[i].name);
else
{
col += fprintf(out, "%s=\"", t->vars[i].name);
for (ptr = t->vars[i].value; *ptr; ptr ++)
{
entity = iso8859(*ptr);
fputs((char *)entity, out);
col += strlen((char *)entity);
}
putc('\"', out);
col ++;
}
}
putc('>', out);
col ++;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
}
break;
}
return (col);
} | 911 | True | 1 |
CVE-2022-34035 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | nan | [{'url': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/426', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/ee778252faebb721afba5a081dd6ad7eaf20eef3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/a0014be47d614220db111b360fb6170ef6f3937e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.9.12', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'HTMLDoc v1.9.12 and below was discovered to contain a heap overflow via e_node htmldoc/htmldoc/html.cxx:588.'}] | 2022-07-27T17:54Z | 2022-07-18T21: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 | Michael R Sweet | 2021-05-07 06:42:42-04:00 | Fix a crash bug with bogus text (Issue #426) | ee778252faebb721afba5a081dd6ad7eaf20eef3 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | write_node | write_node( FILE * out , tree_t * t , int col) | ['out', 't', 'col'] | write_node(FILE *out, /* I - Output file */
tree_t *t, /* I - Document tree node */
int col) /* I - Current column */
{
int i; /* Looping var */
uchar *ptr, /* Pointer to output string */
*entity, /* Entity string */
*src, /* Source image */
*realsrc, /* Real source image */
newsrc[1024]; /* New source image filename */
if (out == NULL)
return (0);
switch (t->markup)
{
case MARKUP_NONE :
if (t->data == NULL)
break;
if (t->preformatted)
{
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
if (t->data[strlen((char *)t->data) - 1] == '\n')
col = 0;
else
col += strlen((char *)t->data);
}
else
{
if ((col + (int)strlen((char *)t->data)) > 72 && col > 0)
{
putc('\n', out);
col = 0;
}
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
col += strlen((char *)t->data);
if (col > 72)
{
putc('\n', out);
col = 0;
}
}
break;
case MARKUP_COMMENT :
case MARKUP_UNKNOWN :
fputs("\n<!--", out);
for (ptr = t->data; *ptr; ptr ++)
fputs((char *)iso8859(*ptr), out);
fputs("-->\n", out);
col = 0;
break;
case MARKUP_AREA :
case MARKUP_BODY :
case MARKUP_DOCTYPE :
case MARKUP_ERROR :
case MARKUP_FILE :
case MARKUP_HEAD :
case MARKUP_HTML :
case MARKUP_MAP :
case MARKUP_META :
case MARKUP_TITLE :
break;
case MARKUP_BR :
case MARKUP_CENTER :
case MARKUP_DD :
case MARKUP_DL :
case MARKUP_DT :
case MARKUP_H1 :
case MARKUP_H2 :
case MARKUP_H3 :
case MARKUP_H4 :
case MARKUP_H5 :
case MARKUP_H6 :
case MARKUP_H7 :
case MARKUP_H8 :
case MARKUP_H9 :
case MARKUP_H10 :
case MARKUP_H11 :
case MARKUP_H12 :
case MARKUP_H13 :
case MARKUP_H14 :
case MARKUP_H15 :
case MARKUP_HR :
case MARKUP_LI :
case MARKUP_OL :
case MARKUP_P :
case MARKUP_PRE :
case MARKUP_TABLE :
case MARKUP_TR :
case MARKUP_UL :
if (col > 0)
{
putc('\n', out);
col = 0;
}
default :
if (t->markup == MARKUP_IMG &&
(src = htmlGetVariable(t, (uchar *)"SRC")) != NULL &&
(realsrc = htmlGetVariable(t, (uchar *)"REALSRC")) != NULL)
{
/*
* Update local images...
*/
if (file_method((char *)src) == NULL &&
src[0] != '/' && src[0] != '\\' &&
(!isalpha(src[0]) || src[1] != ':'))
{
image_copy((char *)src, (char *)realsrc, OutputPath);
strlcpy((char *)newsrc, file_basename((char *)src), sizeof(newsrc));
htmlSetVariable(t, (uchar *)"SRC", newsrc);
}
}
if (t->markup != MARKUP_EMBED)
{
col += fprintf(out, "<%s", _htmlMarkups[t->markup]);
for (i = 0; i < t->nvars; i ++)
{
if (strcasecmp((char *)t->vars[i].name, "BREAK") == 0 &&
t->markup == MARKUP_HR)
continue;
if (strcasecmp((char *)t->vars[i].name, "REALSRC") == 0 &&
t->markup == MARKUP_IMG)
continue;
if (strncasecmp((char *)t->vars[i].name, "_HD_", 4) == 0)
continue;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
if (col > 0)
{
putc(' ', out);
col ++;
}
if (t->vars[i].value == NULL)
col += fprintf(out, "%s", t->vars[i].name);
else
{
col += fprintf(out, "%s=\"", t->vars[i].name);
for (ptr = t->vars[i].value; *ptr; ptr ++)
{
entity = iso8859(*ptr);
fputs((char *)entity, out);
col += strlen((char *)entity);
}
putc('\"', out);
col ++;
}
}
putc('>', out);
col ++;
if (col > 72 && !t->preformatted)
{
putc('\n', out);
col = 0;
}
}
break;
}
return (col);
} | 911 | True | 1 |
CVE-2021-40985 | 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/michaelrsweet/htmldoc/commit/f12b9666e582a8e7b70f11b28e5ffc49ad625d43', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/f12b9666e582a8e7b70f11b28e5ffc49ad625d43', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/444', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/444', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/02/msg00022.html', 'name': '[debian-lts-announce] 20220226 [SECURITY] [DLA 2928-1] htmldoc security update', 'refsource': 'MLIST', '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:htmldoc_project:htmldoc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.9.12', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.'}] | 2022-04-01T15:18Z | 2021-11-03T17: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 | Michael R Sweet | 2021-09-11 18:12:33-04:00 | Fix BMP crash bug (Issue #444) | f12b9666e582a8e7b70f11b28e5ffc49ad625d43 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | image_load_bmp | image_load_bmp( image_t * img , FILE * fp , int gray , int load_data) | ['img', 'fp', 'gray', 'load_data'] | image_load_bmp(image_t *img, /* I - Image to load into */
FILE *fp, /* I - File to read from */
int gray, /* I - Grayscale image? */
int load_data)/* I - 1 = load image data, 0 = just info */
{
int info_size, /* Size of info header */
depth, /* Depth of image (bits) */
compression, /* Type of compression */
colors_used, /* Number of colors used */
x, y, /* Looping vars */
color, /* Color of RLE pixel */
count, /* Number of times to repeat */
temp, /* Temporary color */
align; /* Alignment bytes */
uchar bit, /* Bit in image */
byte; /* Byte in image */
uchar *ptr; /* Pointer into pixels */
uchar colormap[256][4];/* Colormap */
// Get the header...
getc(fp); /* Skip "BM" sync chars */
getc(fp);
read_dword(fp); /* Skip size */
read_word(fp); /* Skip reserved stuff */
read_word(fp);
read_dword(fp);
// Then the bitmap information...
info_size = (int)read_dword(fp);
img->width = read_long(fp);
img->height = read_long(fp);
read_word(fp);
depth = read_word(fp);
compression = (int)read_dword(fp);
read_dword(fp);
read_long(fp);
read_long(fp);
colors_used = (int)read_dword(fp);
read_dword(fp);
if (info_size > 40)
for (info_size -= 40; info_size > 0; info_size --)
getc(fp);
// Get colormap...
if (colors_used == 0 && depth <= 8)
colors_used = 1 << depth;
fread(colormap, (size_t)colors_used, 4, fp);
// Setup image and buffers...
img->depth = gray ? 1 : 3;
// If this image is indexed and we are writing an encrypted PDF file, bump the use count so
// we create an image object (Acrobat 6 bug workaround)
if (depth <= 8 && Encryption)
img->use ++;
// Return now if we only need the dimensions...
if (!load_data)
return (0);
img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img->depth));
if (img->pixels == NULL)
return (-1);
if (gray && depth <= 8)
{
// Convert colormap to grayscale...
for (color = colors_used - 1; color >= 0; color --)
colormap[color][0] = (colormap[color][2] * 31 +
colormap[color][1] * 61 +
colormap[color][0] * 8) / 100;
}
// Read the image data...
color = 0;
count = 0;
align = 0;
byte = 0;
temp = 0;
for (y = img->height - 1; y >= 0; y --)
{
ptr = img->pixels + y * img->width * img->depth;
switch (depth)
{
case 1 : /* Bitmap */
for (x = img->width, bit = 128; x > 0; x --)
{
if (bit == 128)
byte = (uchar)getc(fp);
if (byte & bit)
{
if (!gray)
{
*ptr++ = colormap[1][2];
*ptr++ = colormap[1][1];
}
*ptr++ = colormap[1][0];
}
else
{
if (!gray)
{
*ptr++ = colormap[0][2];
*ptr++ = colormap[0][1];
}
*ptr++ = colormap[0][0];
}
if (bit > 1)
bit >>= 1;
else
bit = 128;
}
/*
* Read remaining bytes to align to 32 bits...
*/
for (temp = (img->width + 7) / 8; temp & 3; temp ++)
getc(fp);
break;
case 4 : /* 16-color */
for (x = img->width, bit = 0xf0; x > 0; x --)
{
/*
* Get a new count as needed...
*/
if (compression != BI_RLE4 && count == 0)
{
count = 2;
color = -1;
}
if (count == 0)
{
while (align > 0)
{
align --;
getc(fp);
}
if ((count = getc(fp)) == 0)
{
if ((count = getc(fp)) == 0)
{
/*
* End of line...
*/
x ++;
continue;
}
else if (count == 1)
{
/*
* End of image...
*/
break;
}
else if (count == 2)
{
/*
* Delta...
*/
count = getc(fp) * getc(fp) * img->width;
color = 0;
}
else
{
/*
* Absolute...
*/
color = -1;
align = ((4 - (count & 3)) / 2) & 1;
}
}
else
color = getc(fp);
}
/*
* Get a new color as needed...
*/
count --;
if (bit == 0xf0)
{
if (color < 0)
temp = getc(fp);
else
temp = color;
/*
* Copy the color value...
*/
if (!gray)
{
*ptr++ = colormap[temp >> 4][2];
*ptr++ = colormap[temp >> 4][1];
}
*ptr++ = colormap[temp >> 4][0];
bit = 0x0f;
}
else
{
/*
* Copy the color value...
*/
if (!gray)
{
*ptr++ = colormap[temp & 15][2];
*ptr++ = colormap[temp & 15][1];
}
*ptr++ = colormap[temp & 15][0];
bit = 0xf0;
}
}
break;
case 8 : /* 256-color */
for (x = img->width; x > 0; x --)
{
/*
* Get a new count as needed...
*/
if (compression != BI_RLE8)
{
count = 1;
color = -1;
}
if (count == 0)
{
while (align > 0)
{
align --;
getc(fp);
}
if ((count = getc(fp)) == 0)
{
if ((count = getc(fp)) == 0)
{
/*
* End of line...
*/
x ++;
continue;
}
else if (count == 1)
{
/*
* End of image...
*/
break;
}
else if (count == 2)
{
/*
* Delta...
*/
count = getc(fp) * getc(fp) * img->width;
color = 0;
}
else
{
/*
* Absolute...
*/
color = -1;
align = (2 - (count & 1)) & 1;
}
}
else
color = getc(fp);
}
/*
* Get a new color as needed...
*/
if (color < 0)
temp = getc(fp);
else
temp = color;
count --;
/*
* Copy the color value...
*/
if (!gray)
{
*ptr++ = colormap[temp][2];
*ptr++ = colormap[temp][1];
}
*ptr++ = colormap[temp][0];
}
break;
case 24 : /* 24-bit RGB */
if (gray)
{
for (x = img->width; x > 0; x --)
{
temp = getc(fp) * 8;
temp += getc(fp) * 61;
temp += getc(fp) * 31;
*ptr++ = (uchar)(temp / 100);
}
}
else
{
for (x = img->width; x > 0; x --, ptr += 3)
{
ptr[2] = (uchar)getc(fp);
ptr[1] = (uchar)getc(fp);
ptr[0] = (uchar)getc(fp);
}
}
/*
* Read remaining bytes to align to 32 bits...
*/
for (temp = img->width * 3; temp & 3; temp ++)
getc(fp);
break;
}
}
return (0);
} | 1316 | True | 1 |
CVE-2022-0534 | 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/michaelrsweet/htmldoc/commit/312f0f9c12f26fbe015cd0e6cefa40e4b99017d9', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/312f0f9c12f26fbe015cd0e6cefa40e4b99017d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/463', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/463', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/02/msg00022.html', 'name': '[debian-lts-announce] 20220226 [SECURITY] [DLA 2928-1] htmldoc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.15:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A vulnerability was found in htmldoc version 1.9.15 where the stack out-of-bounds read takes place in gif_get_code() and occurs when opening a malicious GIF file, which can result in a crash (segmentation fault).'}] | 2022-03-30T19:11Z | 2022-02-09T23:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Michael R Sweet | 2022-01-07 18:21:53-05:00 | Block GIF images with a code size > 12 (Issue #463) | 312f0f9c12f26fbe015cd0e6cefa40e4b99017d9 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | gif_read_lzw | gif_read_lzw( FILE * fp , int first_time , int input_code_size) | ['fp', 'first_time', 'input_code_size'] | gif_read_lzw(FILE *fp, /* I - File to read from */
int first_time, /* I - 1 = first time, 0 = not first time */
int input_code_size) /* I - Code size in bits */
{
int i, /* Looping var */
code, /* Current code */
incode; /* Input code */
static short fresh = 0, /* 1 = empty buffers */
code_size = 0, /* Current code size */
set_code_size = 0, /* Initial code size set */
max_code = 0, /* Maximum code used */
max_code_size = 0, /* Maximum code size */
firstcode = 0, /* First code read */
oldcode = 0, /* Last code read */
clear_code = 0, /* Clear code for LZW input */
end_code = 0, /* End code for LZW input */
table[2][4096], /* String table */
stack[8192], /* Output stack */
*sp = stack; /* Current stack pointer */
if (first_time)
{
/*
* Setup LZW state...
*/
set_code_size = (short)input_code_size;
code_size = set_code_size + 1;
clear_code = (short)(1 << set_code_size);
end_code = clear_code + 1;
max_code_size = 2 * clear_code;
max_code = clear_code + 2;
/*
* Initialize input buffers...
*/
gif_get_code(fp, 0, 1);
/*
* Wipe the decompressor table...
*/
fresh = 1;
for (i = 0; i < clear_code; i ++)
{
table[0][i] = 0;
table[1][i] = (short)i;
}
for (; i < 4096; i ++)
table[0][i] = table[1][0] = 0;
sp = stack;
return (0);
}
else if (fresh)
{
fresh = 0;
do
firstcode = oldcode = (short)gif_get_code(fp, code_size, 0);
while (firstcode == clear_code);
return (firstcode);
}
if (sp > stack)
return (*--sp);
while ((code = gif_get_code (fp, code_size, 0)) >= 0)
{
if (code == clear_code)
{
for (i = 0; i < clear_code; i ++)
{
table[0][i] = 0;
table[1][i] = (short)i;
}
for (; i < 4096; i ++)
table[0][i] = table[1][i] = 0;
code_size = set_code_size + 1;
max_code_size = 2 * clear_code;
max_code = clear_code + 2;
sp = stack;
firstcode = oldcode = (short)gif_get_code(fp, code_size, 0);
return (firstcode);
}
else if (code == end_code)
{
uchar buf[260];
if (!gif_eof)
while (gif_get_block(fp, buf) > 0);
return (-2);
}
incode = code;
if (code >= max_code)
{
*sp++ = firstcode;
code = oldcode;
}
while (code >= clear_code)
{
*sp++ = table[1][code];
if (code == table[0][code])
return (255);
code = table[0][code];
}
*sp++ = firstcode = table[1][code];
code = max_code;
if (code < 4096)
{
table[0][code] = oldcode;
table[1][code] = firstcode;
max_code ++;
if (max_code >= max_code_size && max_code_size < 4096)
{
max_code_size *= 2;
code_size ++;
}
}
oldcode = (short)incode;
if (sp > stack)
return (*--sp);
}
return (code);
} | 604 | True | 1 |
CVE-2022-27114 | 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/michaelrsweet/htmldoc/commit/31f780487e5ddc426888638786cdc47631687275', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/31f780487e5ddc426888638786cdc47631687275', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/471', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/471', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00014.html', 'name': '[debian-lts-announce] 20220513 [SECURITY] [DLA 3004-1] htmldoc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.16:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "There is a vulnerability in htmldoc 1.9.16. In image_load_jpeg function image.cxx when it calls malloc,'img->width' and 'img->height' they are large enough to cause an integer overflow. So, the malloc function may return a heap blosmaller than the expected size, and it will cause a buffer overflow/Address boundary error in the jpeg_read_scanlines function."}] | 2022-05-17T16:33Z | 2022-05-09T17: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 | Michael R Sweet | 2022-03-10 15:29:36-05:00 | Fix a potential integer overflow bug in the JPEG and PNG loaders (Issue #471)
All images are now limited to 4GiB of memory usage (37837x37837 pixels). | 31f780487e5ddc426888638786cdc47631687275 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | image_load_bmp | image_load_bmp( image_t * img , FILE * fp , int gray , int load_data) | ['img', 'fp', 'gray', 'load_data'] | image_load_bmp(image_t *img, /* I - Image to load into */
FILE *fp, /* I - File to read from */
int gray, /* I - Grayscale image? */
int load_data)/* I - 1 = load image data, 0 = just info */
{
int info_size, /* Size of info header */
depth, /* Depth of image (bits) */
compression, /* Type of compression */
colors_used, /* Number of colors used */
x, y, /* Looping vars */
color, /* Color of RLE pixel */
count, /* Number of times to repeat */
temp, /* Temporary color */
align; /* Alignment bytes */
uchar bit, /* Bit in image */
byte; /* Byte in image */
uchar *ptr; /* Pointer into pixels */
uchar colormap[256][4];/* Colormap */
// Get the header...
getc(fp); /* Skip "BM" sync chars */
getc(fp);
read_dword(fp); /* Skip size */
read_word(fp); /* Skip reserved stuff */
read_word(fp);
read_dword(fp);
// Then the bitmap information...
info_size = (int)read_dword(fp);
img->width = read_long(fp);
img->height = read_long(fp);
read_word(fp);
depth = read_word(fp);
compression = (int)read_dword(fp);
read_dword(fp);
read_long(fp);
read_long(fp);
colors_used = (int)read_dword(fp);
read_dword(fp);
if (img->width <= 0 || img->width > 8192 || img->height <= 0 || img->height > 8192 || info_size < 0)
return (-1);
if (info_size > 40)
{
for (info_size -= 40; info_size > 0; info_size --)
getc(fp);
}
// Get colormap...
if (colors_used == 0 && depth <= 8)
colors_used = 1 << depth;
else if (colors_used < 0 || colors_used > 256)
return (-1);
fread(colormap, (size_t)colors_used, 4, fp);
// Setup image and buffers...
img->depth = gray ? 1 : 3;
// If this image is indexed and we are writing an encrypted PDF file, bump the use count so
// we create an image object (Acrobat 6 bug workaround)
if (depth <= 8 && Encryption)
img->use ++;
// Return now if we only need the dimensions...
if (!load_data)
return (0);
img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img->depth));
if (img->pixels == NULL)
return (-1);
if (gray && depth <= 8)
{
// Convert colormap to grayscale...
for (color = colors_used - 1; color >= 0; color --)
colormap[color][0] = (colormap[color][2] * 31 +
colormap[color][1] * 61 +
colormap[color][0] * 8) / 100;
}
// Read the image data...
color = 0;
count = 0;
align = 0;
byte = 0;
temp = 0;
for (y = img->height - 1; y >= 0; y --)
{
ptr = img->pixels + y * img->width * img->depth;
switch (depth)
{
case 1 : /* Bitmap */
for (x = img->width, bit = 128; x > 0; x --)
{
if (bit == 128)
byte = (uchar)getc(fp);
if (byte & bit)
{
if (!gray)
{
*ptr++ = colormap[1][2];
*ptr++ = colormap[1][1];
}
*ptr++ = colormap[1][0];
}
else
{
if (!gray)
{
*ptr++ = colormap[0][2];
*ptr++ = colormap[0][1];
}
*ptr++ = colormap[0][0];
}
if (bit > 1)
bit >>= 1;
else
bit = 128;
}
/*
* Read remaining bytes to align to 32 bits...
*/
for (temp = (img->width + 7) / 8; temp & 3; temp ++)
getc(fp);
break;
case 4 : /* 16-color */
for (x = img->width, bit = 0xf0; x > 0; x --)
{
/*
* Get a new count as needed...
*/
if (compression != BI_RLE4 && count == 0)
{
count = 2;
color = -1;
}
if (count == 0)
{
while (align > 0)
{
align --;
getc(fp);
}
if ((count = getc(fp)) == 0)
{
if ((count = getc(fp)) == 0)
{
/*
* End of line...
*/
x ++;
continue;
}
else if (count == 1)
{
/*
* End of image...
*/
break;
}
else if (count == 2)
{
/*
* Delta...
*/
count = getc(fp) * getc(fp) * img->width;
color = 0;
}
else
{
/*
* Absolute...
*/
color = -1;
align = ((4 - (count & 3)) / 2) & 1;
}
}
else
color = getc(fp);
}
/*
* Get a new color as needed...
*/
count --;
if (bit == 0xf0)
{
if (color < 0)
temp = getc(fp) & 255;
else
temp = color;
/*
* Copy the color value...
*/
if (!gray)
{
*ptr++ = colormap[temp >> 4][2];
*ptr++ = colormap[temp >> 4][1];
}
*ptr++ = colormap[temp >> 4][0];
bit = 0x0f;
}
else
{
/*
* Copy the color value...
*/
if (!gray)
{
*ptr++ = colormap[temp & 15][2];
*ptr++ = colormap[temp & 15][1];
}
*ptr++ = colormap[temp & 15][0];
bit = 0xf0;
}
}
break;
case 8 : /* 256-color */
for (x = img->width; x > 0; x --)
{
/*
* Get a new count as needed...
*/
if (compression != BI_RLE8)
{
count = 1;
color = -1;
}
if (count == 0)
{
while (align > 0)
{
align --;
getc(fp);
}
if ((count = getc(fp)) == 0)
{
if ((count = getc(fp)) == 0)
{
/*
* End of line...
*/
x ++;
continue;
}
else if (count == 1)
{
/*
* End of image...
*/
break;
}
else if (count == 2)
{
/*
* Delta...
*/
count = getc(fp) * getc(fp) * img->width;
color = 0;
}
else
{
/*
* Absolute...
*/
color = -1;
align = (2 - (count & 1)) & 1;
}
}
else
color = getc(fp);
}
/*
* Get a new color as needed...
*/
if (color < 0)
temp = getc(fp) & 255;
else
temp = color;
count --;
/*
* Copy the color value...
*/
if (!gray)
{
*ptr++ = colormap[temp][2];
*ptr++ = colormap[temp][1];
}
*ptr++ = colormap[temp][0];
}
break;
case 24 : /* 24-bit RGB */
if (gray)
{
for (x = img->width; x > 0; x --)
{
temp = getc(fp) * 8;
temp += getc(fp) * 61;
temp += getc(fp) * 31;
*ptr++ = (uchar)(temp / 100);
}
}
else
{
for (x = img->width; x > 0; x --, ptr += 3)
{
ptr[2] = (uchar)getc(fp);
ptr[1] = (uchar)getc(fp);
ptr[0] = (uchar)getc(fp);
}
}
/*
* Read remaining bytes to align to 32 bits...
*/
for (temp = img->width * 3; temp & 3; temp ++)
getc(fp);
break;
}
}
return (0);
} | 1375 | True | 1 |
CVE-2022-27114 | 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/michaelrsweet/htmldoc/commit/31f780487e5ddc426888638786cdc47631687275', 'name': 'https://github.com/michaelrsweet/htmldoc/commit/31f780487e5ddc426888638786cdc47631687275', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelrsweet/htmldoc/issues/471', 'name': 'https://github.com/michaelrsweet/htmldoc/issues/471', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00014.html', 'name': '[debian-lts-announce] 20220513 [SECURITY] [DLA 3004-1] htmldoc security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:htmldoc_project:htmldoc:1.9.16:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "There is a vulnerability in htmldoc 1.9.16. In image_load_jpeg function image.cxx when it calls malloc,'img->width' and 'img->height' they are large enough to cause an integer overflow. So, the malloc function may return a heap blosmaller than the expected size, and it will cause a buffer overflow/Address boundary error in the jpeg_read_scanlines function."}] | 2022-05-17T16:33Z | 2022-05-09T17: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 | Michael R Sweet | 2022-03-10 15:29:36-05:00 | Fix a potential integer overflow bug in the JPEG and PNG loaders (Issue #471)
All images are now limited to 4GiB of memory usage (37837x37837 pixels). | 31f780487e5ddc426888638786cdc47631687275 | False | michaelrsweet/htmldoc | HTML Conversion Software | 2017-02-25 01:25:32 | 2022-08-18 12:21:35 | https://www.msweet.org/htmldoc | michaelrsweet | 153.0 | 39.0 | image_load_gif | image_load_gif( image_t * img , FILE * fp , int gray , int load_data) | ['img', 'fp', 'gray', 'load_data'] | image_load_gif(image_t *img, /* I - Image pointer */
FILE *fp, /* I - File to load from */
int gray, /* I - 0 = color, 1 = grayscale */
int load_data)/* I - 1 = load image data, 0 = just info */
{
uchar buf[1024]; /* Input buffer */
gif_cmap_t cmap; /* Colormap */
int ncolors, /* Bits per pixel */
transparent; /* Transparent color index */
/*
* Read the header; we already know it is a GIF file...
*/
fread(buf, 13, 1, fp);
img->width = (buf[7] << 8) | buf[6];
img->height = (buf[9] << 8) | buf[8];
ncolors = 2 << (buf[10] & 0x07);
if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767)
return (-1);
// If we are writing an encrypted PDF file, bump the use count so we create
// an image object (Acrobat 6 bug workaround)
if (Encryption)
img->use ++;
if (buf[10] & GIF_COLORMAP)
if (gif_read_cmap(fp, ncolors, cmap, &gray))
return (-1);
transparent = -1;
while (1)
{
switch (getc(fp))
{
case ';' : /* End of image */
return (-1); /* Early end of file */
case '!' : /* Extension record */
buf[0] = (uchar)getc(fp);
if (buf[0] == 0xf9) /* Graphic Control Extension */
{
gif_get_block(fp, buf);
if (buf[0] & 1) /* Get transparent color index */
transparent = buf[3];
}
while (gif_get_block(fp, buf) != 0);
break;
case ',' : /* Image data */
fread(buf, 9, 1, fp);
if (buf[8] & GIF_COLORMAP)
{
ncolors = 2 << (buf[8] & 0x07);
if (gif_read_cmap(fp, ncolors, cmap, &gray))
return (-1);
}
img->width = (buf[5] << 8) | buf[4];
img->height = (buf[7] << 8) | buf[6];
img->depth = gray ? 1 : 3;
if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->height > 32767)
return (-1);
if (transparent >= 0)
{
/*
* Map transparent color to background color...
*/
if (BodyColor[0])
{
float rgb[3]; /* RGB color */
get_color((uchar *)BodyColor, rgb);
cmap[transparent][0] = (uchar)(rgb[0] * 255.0f + 0.5f);
cmap[transparent][1] = (uchar)(rgb[1] * 255.0f + 0.5f);
cmap[transparent][2] = (uchar)(rgb[2] * 255.0f + 0.5f);
}
else
{
cmap[transparent][0] = 255;
cmap[transparent][1] = 255;
cmap[transparent][2] = 255;
}
/*
* Allocate a mask image...
*/
image_need_mask(img);
}
if (!load_data)
return (0);
img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img->depth));
if (img->pixels == NULL)
return (-1);
return (gif_read_image(fp, img, cmap, buf[8] & GIF_INTERLACE, transparent));
}
}
} | 620 | True | 1 |
CVE-2021-23520 | 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://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388607', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://snyk.io/research/zip-slip-vulnerability', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:juce:juce:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The package juce-framework/juce before 6.1.5 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) via the ZipFile::uncompressEntry function in juce_ZipFile.cpp. This vulnerability is triggered when the archive is extracted upon calling uncompressTo() on a ZipFile object.'}] | 2022-02-04T20:33Z | 2022-01-31T11: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 | attila | 2022-01-10 17:40:32+01:00 | ZipFile: Add path checks to uncompressEntry() | 2e874e80cba0152201aff6a4d0dc407997d10a7f | False | juce-framework/JUCE | JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins. | 2012-03-31 11:19:43 | 2022-08-28 02:07:13 | https://juce.com | juce-framework | 4418.0 | 1316.0 | juce::TemporaryFile::deleteTemporaryFile | juce::TemporaryFile::deleteTemporaryFile() const | [] | bool TemporaryFile::deleteTemporaryFile() const
{
// Have a few attempts at deleting the file before giving up..
for (int i = 5; --i >= 0;)
{
if (temporaryFile.deleteFile())
return true;
Thread::sleep (50);
}
return false;
}
| 44 | True | 1 |
CVE-2021-23521 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388608', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388608', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'name': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:juce:juce:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package juce-framework/JUCE before 6.1.5. This vulnerability is triggered when a malicious archive is crafted with an entry containing a symbolic link. When extracted, the symbolic link is followed outside of the target dir allowing writing arbitrary files on the target host. In some cases, this can allow an attacker to execute arbitrary code. The vulnerable code is in the ZipFile::uncompressEntry function in juce_ZipFile.cpp and is executed when the archive is extracted upon calling uncompressTo() on a ZipFile object.'}] | 2022-02-07T18:32Z | 2022-01-31T11:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | attila | 2022-01-10 17:40:32+01:00 | ZipFile: Add path checks to uncompressEntry() | 2e874e80cba0152201aff6a4d0dc407997d10a7f | False | juce-framework/JUCE | JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins. | 2012-03-31 11:19:43 | 2022-08-28 02:07:13 | https://juce.com | juce-framework | 4418.0 | 1316.0 | juce::TemporaryFile::deleteTemporaryFile | juce::TemporaryFile::deleteTemporaryFile() const | [] | bool TemporaryFile::deleteTemporaryFile() const
{
// Have a few attempts at deleting the file before giving up..
for (int i = 5; --i >= 0;)
{
if (temporaryFile.deleteFile())
return true;
Thread::sleep (50);
}
return false;
}
| 44 | True | 1 |
|
CVE-2021-23520 | 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://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388607', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://snyk.io/research/zip-slip-vulnerability', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:juce:juce:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The package juce-framework/juce before 6.1.5 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) via the ZipFile::uncompressEntry function in juce_ZipFile.cpp. This vulnerability is triggered when the archive is extracted upon calling uncompressTo() on a ZipFile object.'}] | 2022-02-04T20:33Z | 2022-01-31T11: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 | attila | 2022-01-10 17:40:32+01:00 | ZipFile: Add path checks to uncompressEntry() | 2e874e80cba0152201aff6a4d0dc407997d10a7f | False | juce-framework/JUCE | JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins. | 2012-03-31 11:19:43 | 2022-08-28 02:07:13 | https://juce.com | juce-framework | 4418.0 | 1316.0 | juce::ZIPTests::runTest | juce::ZIPTests::runTest() | [] | void runTest() override
{
beginTest ("ZIP");
ZipFile::Builder builder;
StringArray entryNames { "first", "second", "third" };
HashMap<String, MemoryBlock> blocks;
for (auto& entryName : entryNames)
{
auto& block = blocks.getReference (entryName);
MemoryOutputStream mo (block, false);
mo << entryName;
mo.flush();
builder.addEntry (new MemoryInputStream (block, false), 9, entryName, Time::getCurrentTime());
}
MemoryBlock data;
MemoryOutputStream mo (data, false);
builder.writeToStream (mo, nullptr);
MemoryInputStream mi (data, false);
ZipFile zip (mi);
expectEquals (zip.getNumEntries(), entryNames.size());
for (auto& entryName : entryNames)
{
auto* entry = zip.getEntry (entryName);
std::unique_ptr<InputStream> input (zip.createStreamForEntry (*entry));
expectEquals (input->readEntireStreamAsString(), entryName);
}
}
| 195 | True | 1 |
CVE-2021-23521 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388608', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388608', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'name': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:juce:juce:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package juce-framework/JUCE before 6.1.5. This vulnerability is triggered when a malicious archive is crafted with an entry containing a symbolic link. When extracted, the symbolic link is followed outside of the target dir allowing writing arbitrary files on the target host. In some cases, this can allow an attacker to execute arbitrary code. The vulnerable code is in the ZipFile::uncompressEntry function in juce_ZipFile.cpp and is executed when the archive is extracted upon calling uncompressTo() on a ZipFile object.'}] | 2022-02-07T18:32Z | 2022-01-31T11:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | attila | 2022-01-10 17:40:32+01:00 | ZipFile: Add path checks to uncompressEntry() | 2e874e80cba0152201aff6a4d0dc407997d10a7f | False | juce-framework/JUCE | JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins. | 2012-03-31 11:19:43 | 2022-08-28 02:07:13 | https://juce.com | juce-framework | 4418.0 | 1316.0 | juce::ZIPTests::runTest | juce::ZIPTests::runTest() | [] | void runTest() override
{
beginTest ("ZIP");
ZipFile::Builder builder;
StringArray entryNames { "first", "second", "third" };
HashMap<String, MemoryBlock> blocks;
for (auto& entryName : entryNames)
{
auto& block = blocks.getReference (entryName);
MemoryOutputStream mo (block, false);
mo << entryName;
mo.flush();
builder.addEntry (new MemoryInputStream (block, false), 9, entryName, Time::getCurrentTime());
}
MemoryBlock data;
MemoryOutputStream mo (data, false);
builder.writeToStream (mo, nullptr);
MemoryInputStream mi (data, false);
ZipFile zip (mi);
expectEquals (zip.getNumEntries(), entryNames.size());
for (auto& entryName : entryNames)
{
auto* entry = zip.getEntry (entryName);
std::unique_ptr<InputStream> input (zip.createStreamForEntry (*entry));
expectEquals (input->readEntireStreamAsString(), entryName);
}
}
| 195 | True | 1 |
|
CVE-2021-23520 | 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://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388607', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://snyk.io/research/zip-slip-vulnerability', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:juce:juce:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The package juce-framework/juce before 6.1.5 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) via the ZipFile::uncompressEntry function in juce_ZipFile.cpp. This vulnerability is triggered when the archive is extracted upon calling uncompressTo() on a ZipFile object.'}] | 2022-02-04T20:33Z | 2022-01-31T11: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 | attila | 2022-01-10 17:40:32+01:00 | ZipFile: Add path checks to uncompressEntry() | 2e874e80cba0152201aff6a4d0dc407997d10a7f | False | juce-framework/JUCE | JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins. | 2012-03-31 11:19:43 | 2022-08-28 02:07:13 | https://juce.com | juce-framework | 4418.0 | 1316.0 | juce::ZipFile::uncompressEntry | juce::ZipFile::uncompressEntry( int index , const File & targetDirectory , bool shouldOverwriteFiles) | ['index', 'targetDirectory', 'shouldOverwriteFiles'] | Result ZipFile::uncompressEntry (int index, const File& targetDirectory, bool shouldOverwriteFiles)
{
auto* zei = entries.getUnchecked (index);
#if JUCE_WINDOWS
auto entryPath = zei->entry.filename;
#else
auto entryPath = zei->entry.filename.replaceCharacter ('\\', '/');
#endif
if (entryPath.isEmpty())
return Result::ok();
auto targetFile = targetDirectory.getChildFile (entryPath);
if (entryPath.endsWithChar ('/') || entryPath.endsWithChar ('\\'))
return targetFile.createDirectory(); // (entry is a directory, not a file)
std::unique_ptr<InputStream> in (createStreamForEntry (index));
if (in == nullptr)
return Result::fail ("Failed to open the zip file for reading");
if (targetFile.exists())
{
if (! shouldOverwriteFiles)
return Result::ok();
if (! targetFile.deleteFile())
return Result::fail ("Failed to write to target file: " + targetFile.getFullPathName());
}
if (! targetFile.getParentDirectory().createDirectory())
return Result::fail ("Failed to create target folder: " + targetFile.getParentDirectory().getFullPathName());
if (zei->entry.isSymbolicLink)
{
String originalFilePath (in->readEntireStreamAsString()
.replaceCharacter (L'/', File::getSeparatorChar()));
if (! File::createSymbolicLink (targetFile, originalFilePath, true))
return Result::fail ("Failed to create symbolic link: " + originalFilePath);
}
else
{
FileOutputStream out (targetFile);
if (out.failedToOpen())
return Result::fail ("Failed to write to target file: " + targetFile.getFullPathName());
out << *in;
}
targetFile.setCreationTime (zei->entry.fileTime);
targetFile.setLastModificationTime (zei->entry.fileTime);
targetFile.setLastAccessTime (zei->entry.fileTime);
return Result::ok();
}
| 338 | True | 1 |
CVE-2021-23521 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388608', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-JUCEFRAMEWORKJUCE-2388608', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'name': 'https://github.com/juce-framework/JUCE/commit/2e874e80cba0152201aff6a4d0dc407997d10a7f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:juce:juce:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package juce-framework/JUCE before 6.1.5. This vulnerability is triggered when a malicious archive is crafted with an entry containing a symbolic link. When extracted, the symbolic link is followed outside of the target dir allowing writing arbitrary files on the target host. In some cases, this can allow an attacker to execute arbitrary code. The vulnerable code is in the ZipFile::uncompressEntry function in juce_ZipFile.cpp and is executed when the archive is extracted upon calling uncompressTo() on a ZipFile object.'}] | 2022-02-07T18:32Z | 2022-01-31T11:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | attila | 2022-01-10 17:40:32+01:00 | ZipFile: Add path checks to uncompressEntry() | 2e874e80cba0152201aff6a4d0dc407997d10a7f | False | juce-framework/JUCE | JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins. | 2012-03-31 11:19:43 | 2022-08-28 02:07:13 | https://juce.com | juce-framework | 4418.0 | 1316.0 | juce::ZipFile::uncompressEntry | juce::ZipFile::uncompressEntry( int index , const File & targetDirectory , bool shouldOverwriteFiles) | ['index', 'targetDirectory', 'shouldOverwriteFiles'] | Result ZipFile::uncompressEntry (int index, const File& targetDirectory, bool shouldOverwriteFiles)
{
auto* zei = entries.getUnchecked (index);
#if JUCE_WINDOWS
auto entryPath = zei->entry.filename;
#else
auto entryPath = zei->entry.filename.replaceCharacter ('\\', '/');
#endif
if (entryPath.isEmpty())
return Result::ok();
auto targetFile = targetDirectory.getChildFile (entryPath);
if (entryPath.endsWithChar ('/') || entryPath.endsWithChar ('\\'))
return targetFile.createDirectory(); // (entry is a directory, not a file)
std::unique_ptr<InputStream> in (createStreamForEntry (index));
if (in == nullptr)
return Result::fail ("Failed to open the zip file for reading");
if (targetFile.exists())
{
if (! shouldOverwriteFiles)
return Result::ok();
if (! targetFile.deleteFile())
return Result::fail ("Failed to write to target file: " + targetFile.getFullPathName());
}
if (! targetFile.getParentDirectory().createDirectory())
return Result::fail ("Failed to create target folder: " + targetFile.getParentDirectory().getFullPathName());
if (zei->entry.isSymbolicLink)
{
String originalFilePath (in->readEntireStreamAsString()
.replaceCharacter (L'/', File::getSeparatorChar()));
if (! File::createSymbolicLink (targetFile, originalFilePath, true))
return Result::fail ("Failed to create symbolic link: " + originalFilePath);
}
else
{
FileOutputStream out (targetFile);
if (out.failedToOpen())
return Result::fail ("Failed to write to target file: " + targetFile.getFullPathName());
out << *in;
}
targetFile.setCreationTime (zei->entry.fileTime);
targetFile.setLastModificationTime (zei->entry.fileTime);
targetFile.setLastAccessTime (zei->entry.fileTime);
return Result::ok();
}
| 338 | True | 1 |
|
CVE-2021-24029 | 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/facebookincubator/mvfst/commit/a67083ff4b8dcbb7ee2839da6338032030d712b0', 'name': 'https://github.com/facebookincubator/mvfst/commit/a67083ff4b8dcbb7ee2839da6338032030d712b0', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.facebook.com/security/advisories/cve-2021-24029', 'name': 'https://www.facebook.com/security/advisories/cve-2021-24029', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-617'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:proxygen:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2021.03.15.00', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:mvfst:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2021-03-13', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A packet of death scenario is possible in mvfst via a specially crafted message during a QUIC session, which causes a crash via a failed assertion. Per QUIC specification, this particular message should be treated as a connection error. This issue affects mvfst versions prior to commit a67083ff4b8dcbb7ee2839da6338032030d712b0 and proxygen versions prior to v2021.03.15.00.'}] | 2021-03-23T16:34Z | 2021-03-15T22:15Z | Reachable Assertion | The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary. |
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service.
For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
| https://cwe.mitre.org/data/definitions/617.html | 0 | Yang Chi | 2021-02-23 16:40:17-08:00 | Close connection if we derive an extra 1-rtt write cipher
Summary: Fixes CVE-2021-24029
Reviewed By: mjoras, lnicco
Differential Revision: D26613890
fbshipit-source-id: 19bb2be2c731808144e1a074ece313fba11f1945 | a67083ff4b8dcbb7ee2839da6338032030d712b0 | False | facebookincubator/mvfst | An implementation of the QUIC transport protocol. | 2018-04-09 22:49:15 | 2022-08-27 06:16:35 | null | facebookincubator | 1182.0 | 180.0 | quic::updateHandshakeState | quic::updateHandshakeState( QuicServerConnectionState & conn) | ['conn'] | void updateHandshakeState(QuicServerConnectionState& conn) {
// Zero RTT read cipher is available after chlo is processed with the
// condition that early data attempt is accepted.
auto handshakeLayer = conn.serverHandshakeLayer;
auto zeroRttReadCipher = handshakeLayer->getZeroRttReadCipher();
auto zeroRttHeaderCipher = handshakeLayer->getZeroRttReadHeaderCipher();
// One RTT write cipher is available at Fizz layer after chlo is processed.
// However, the cipher is only exported to QUIC if early data attempt is
// accepted. Otherwise, the cipher will be available after cfin is
// processed.
auto oneRttWriteCipher = handshakeLayer->getOneRttWriteCipher();
// One RTT read cipher is available after cfin is processed.
auto oneRttReadCipher = handshakeLayer->getOneRttReadCipher();
auto oneRttWriteHeaderCipher = handshakeLayer->getOneRttWriteHeaderCipher();
auto oneRttReadHeaderCipher = handshakeLayer->getOneRttReadHeaderCipher();
if (zeroRttReadCipher) {
if (conn.qLogger) {
conn.qLogger->addTransportStateUpdate(kDerivedZeroRttReadCipher);
}
QUIC_TRACE(fst_trace, conn, "derived 0-rtt read cipher");
conn.readCodec->setZeroRttReadCipher(std::move(zeroRttReadCipher));
}
if (zeroRttHeaderCipher) {
conn.readCodec->setZeroRttHeaderCipher(std::move(zeroRttHeaderCipher));
}
if (oneRttWriteHeaderCipher) {
conn.oneRttWriteHeaderCipher = std::move(oneRttWriteHeaderCipher);
}
if (oneRttReadHeaderCipher) {
conn.readCodec->setOneRttHeaderCipher(std::move(oneRttReadHeaderCipher));
}
if (oneRttWriteCipher) {
if (conn.qLogger) {
conn.qLogger->addTransportStateUpdate(kDerivedOneRttWriteCipher);
}
QUIC_TRACE(fst_trace, conn, "derived 1-rtt write cipher");
CHECK(!conn.oneRttWriteCipher.get());
conn.oneRttWriteCipher = std::move(oneRttWriteCipher);
updatePacingOnKeyEstablished(conn);
// We negotiate the transport parameters whenever we have the 1-RTT write
// keys available.
auto clientParams = handshakeLayer->getClientTransportParams();
if (!clientParams) {
throw QuicTransportException(
"No client transport params",
TransportErrorCode::TRANSPORT_PARAMETER_ERROR);
}
processClientInitialParams(conn, std::move(*clientParams));
}
if (oneRttReadCipher) {
if (conn.qLogger) {
conn.qLogger->addTransportStateUpdate(kDerivedOneRttReadCipher);
}
QUIC_TRACE(fst_trace, conn, "derived 1-rtt read cipher");
// Clear limit because CFIN is received at this point
conn.writableBytesLimit = folly::none;
conn.readCodec->setOneRttReadCipher(std::move(oneRttReadCipher));
}
auto handshakeReadCipher = handshakeLayer->getHandshakeReadCipher();
auto handshakeReadHeaderCipher =
handshakeLayer->getHandshakeReadHeaderCipher();
if (handshakeReadCipher) {
CHECK(handshakeReadHeaderCipher);
conn.readCodec->setHandshakeReadCipher(std::move(handshakeReadCipher));
conn.readCodec->setHandshakeHeaderCipher(
std::move(handshakeReadHeaderCipher));
}
if (handshakeLayer->isHandshakeDone()) {
CHECK(conn.oneRttWriteCipher);
if (conn.version != QuicVersion::MVFST_D24 && !conn.sentHandshakeDone) {
sendSimpleFrame(conn, HandshakeDoneFrame());
conn.sentHandshakeDone = true;
}
}
} | 431 | True | 1 |
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | arangodb::AuthenticationFeature::AuthenticationFeature | arangodb::AuthenticationFeature::AuthenticationFeature( application_features :: ApplicationServer & server) | ['server'] | AuthenticationFeature::AuthenticationFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "Authentication"),
_userManager(nullptr),
_authCache(nullptr),
_authenticationUnixSockets(true),
_authenticationSystemOnly(true),
_localAuthentication(true),
_active(true),
_authenticationTimeout(0.0) {
setOptional(false);
startsAfter<application_features::BasicFeaturePhaseServer>();
#ifdef USE_ENTERPRISE
startsAfter<LdapFeature>();
#endif
} | 77 | True | 1 |
|
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | arangodb::AuthenticationFeature::collectOptions | arangodb::AuthenticationFeature::collectOptions( std :: shared_ptr<ProgramOptions> options) | ['options'] | void AuthenticationFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOldOption("server.disable-authentication",
"server.authentication");
options->addOldOption("server.disable-authentication-unix-sockets",
"server.authentication-unix-sockets");
options->addOldOption("server.authenticate-system-only",
"server.authentication-system-only");
options->addOldOption("server.allow-method-override",
"http.allow-method-override");
options->addOldOption("server.hide-product-header",
"http.hide-product-header");
options->addOldOption("server.keep-alive-timeout", "http.keep-alive-timeout");
options->addOldOption("server.default-api-compatibility", "");
options->addOldOption("no-server", "server.rest-server");
options->addOption("--server.authentication",
"enable authentication for ALL client requests",
new BooleanParameter(&_active));
options->addOption(
"--server.authentication-timeout",
"timeout for the authentication cache in seconds (0 = indefinitely)",
new DoubleParameter(&_authenticationTimeout));
options->addOption("--server.local-authentication",
"enable authentication using the local user database",
new BooleanParameter(&_localAuthentication));
options->addOption(
"--server.authentication-system-only",
"use HTTP authentication only for requests to /_api and /_admin",
new BooleanParameter(&_authenticationSystemOnly));
#ifdef ARANGODB_HAVE_DOMAIN_SOCKETS
options->addOption("--server.authentication-unix-sockets",
"authentication for requests via UNIX domain sockets",
new BooleanParameter(&_authenticationUnixSockets));
#endif
// Maybe deprecate this option in devel
options
->addOption("--server.jwt-secret",
"secret to use when doing jwt authentication",
new StringParameter(&_jwtSecretProgramOption))
.setDeprecatedIn(30322)
.setDeprecatedIn(30402);
options->addOption(
"--server.jwt-secret-keyfile",
"file containing jwt secret to use when doing jwt authentication.",
new StringParameter(&_jwtSecretKeyfileProgramOption));
options->addOption(
"--server.jwt-secret-folder",
"folder containing one or more jwt secret files to use for jwt "
"authentication. Files are sorted alphabetically: First secret "
"is used for signing + verifying JWT tokens. The latter secrets "
"are only used for verifying.",
new StringParameter(&_jwtSecretFolderProgramOption),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Enterprise))
.setIntroducedIn(30700);
} | 247 | True | 1 |
|
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | RestAuthHandler::RestAuthHandler | RestAuthHandler::RestAuthHandler( application_features :: ApplicationServer & server , GeneralRequest * request , GeneralResponse * response) | ['server', 'request', 'response'] | RestAuthHandler::RestAuthHandler(application_features::ApplicationServer& server,
GeneralRequest* request, GeneralResponse* response)
: RestVocbaseBaseHandler(server, request, response),
_validFor(60 * 60 * 24 * 30) {} | 40 | True | 1 |
|
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | RestAuthHandler::execute | RestAuthHandler::execute() | [] | RestStatus RestAuthHandler::execute() {
auto const type = _request->requestType();
if (type != rest::RequestType::POST) {
generateError(rest::ResponseCode::METHOD_NOT_ALLOWED, TRI_ERROR_HTTP_METHOD_NOT_ALLOWED);
return RestStatus::DONE;
}
bool parseSuccess = false;
VPackSlice slice = this->parseVPackBody(parseSuccess);
if (!parseSuccess) { // error already set
return RestStatus::DONE;
}
if (!slice.isObject()) {
return badRequest();
}
VPackSlice usernameSlice = slice.get("username");
VPackSlice passwordSlice = slice.get("password");
if (!usernameSlice.isString() || !passwordSlice.isString()) {
return badRequest();
}
_username = usernameSlice.copyString();
std::string const password = passwordSlice.copyString();
auth::UserManager* um = AuthenticationFeature::instance()->userManager();
if (um == nullptr) {
std::string msg = "This server does not support users";
LOG_TOPIC("2e7d4", ERR, Logger::AUTHENTICATION) << msg;
generateError(rest::ResponseCode::UNAUTHORIZED, TRI_ERROR_HTTP_UNAUTHORIZED, msg);
} else if (um->checkPassword(_username, password)) {
VPackBuilder resultBuilder;
{
VPackObjectBuilder b(&resultBuilder);
std::string jwt = generateJwt(_username, password);
resultBuilder.add("jwt", VPackValue(jwt));
}
_isValid = true;
generateDocument(resultBuilder.slice(), true, &VPackOptions::Defaults);
} else {
// mop: rfc 2616 10.4.2 (if credentials wrong 401)
generateError(rest::ResponseCode::UNAUTHORIZED, TRI_ERROR_HTTP_UNAUTHORIZED,
"Wrong credentials");
}
return RestStatus::DONE;
} | 300 | True | 1 |
|
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | RestAuthHandler::generateJwt | RestAuthHandler::generateJwt( std :: string const & username , std :: string const & password) | ['username', 'password'] | std::string RestAuthHandler::generateJwt(std::string const& username,
std::string const& password) {
AuthenticationFeature* af = AuthenticationFeature::instance();
TRI_ASSERT(af != nullptr);
return fuerte::jwt::generateUserToken(af->tokenCache().jwtSecret(), username, _validFor);
} | 59 | True | 1 |
|
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | RestAuthHandler::shutdownExecute | RestAuthHandler::shutdownExecute( bool isFinalized) | ['isFinalized'] | void RestAuthHandler::shutdownExecute(bool isFinalized) noexcept {
try {
if (_isValid) {
events::LoggedIn(*_request, _username);
} else {
events::CredentialsBad(*_request, _username);
}
} catch (...) {
}
RestVocbaseBaseHandler::shutdownExecute(isFinalized);
} | 55 | True | 1 |
|
CVE-2021-25940 | False | False | False | True | AV:N/AC:M/Au:S/C:P/I:P/A:P | NETWORK | MEDIUM | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.0 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.0 | HIGH | 2.1 | 5.9 | False | [{'url': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'name': 'https://github.com/arangodb/arangodb/commit/e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25940', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-613'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.6', 'versionEndIncluding': '3.8.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.6 through v3.8.3 are vulnerable to Insufficient Session Expiration. When a user’s password is changed by the administrator, the session isn’t invalidated, allowing a malicious user to still be logged in and perform arbitrary actions within the system.'}] | 2021-11-17T18:52Z | 2021-11-16T10:15Z | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | 0 | Jan | 2021-07-01 11:36:14+02:00 | Revive startup parameter `--server.session-timeout` (#14118)
Co-authored-by: Tobias Gödderz <tobias@arangodb.com> | e9c6ee9dcca7b9b4fbcd02a0b323d205bee838d3 | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | arangodb::ServerFeature::collectOptions | arangodb::ServerFeature::collectOptions( std :: shared_ptr<ProgramOptions> options) | ['options'] | void ServerFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOption("--console", "start a JavaScript emergency console",
new BooleanParameter(&_console));
options->addSection("server", "server features");
options->addOption("--server.rest-server", "start a rest-server",
new BooleanParameter(&_restServer),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
options->addOption("--server.validate-utf8-strings", "perform UTF-8 string validation for incoming JSON and VelocyPack data",
new BooleanParameter(&_validateUtf8Strings),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden)).setIntroducedIn(30700);
options->addOption("--javascript.script", "run scripts and exit",
new VectorParameter<StringParameter>(&_scripts));
#if _WIN32
options->addOption("--console.code-page",
"Windows code page to use; defaults to UTF8",
new UInt16Parameter(&_codePage),
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Hidden));
#endif
// add several obsoleted options here
options->addSection("vst", "VelocyStream protocol", "", true, true);
options->addObsoleteOption("--vst.maxsize", "maximal size (in bytes) "
"for a VelocyPack chunk", true);
options->addObsoleteOption(
"--server.session-timeout",
"timeout of web interface server sessions (in seconds)", true);
// add obsolete MMFiles WAL options (obsoleted in 3.7)
options->addSection("wal", "WAL of the MMFiles engine", "", true, true);
options->addObsoleteOption("--wal.allow-oversize-entries",
"allow entries that are bigger than '--wal.logfile-size'", false);
options->addObsoleteOption("--wal.use-mlock",
"mlock WAL logfiles in memory (may require elevated privileges or limits)", false);
options->addObsoleteOption("--wal.directory", "logfile directory", true);
options->addObsoleteOption("--wal.historic-logfiles", "maximum number of historic logfiles to keep after collection", true);
options->addObsoleteOption("--wal.ignore-logfile-errors",
"ignore logfile errors. this will read recoverable data from corrupted logfiles but ignore any unrecoverable data", false);
options->addObsoleteOption("--wal.ignore-recovery-errors", "continue recovery even if re-applying operations fails", false);
options->addObsoleteOption("--wal.flush-timeout", "flush timeout (in milliseconds)", true);
options->addObsoleteOption("--wal.logfile-size", "size of each logfile (in bytes)", true);
options->addObsoleteOption("--wal.open-logfiles", "maximum number of parallel open logfiles", true);
options->addObsoleteOption("--wal.reserve-logfiles", "maximum number of reserve logfiles to maintain", true);
options->addObsoleteOption("--wal.slots", "number of logfile slots to use", true);
options->addObsoleteOption("--wal.sync-interval", "interval for automatic, non-requested disk syncs (in milliseconds)", true);
options->addObsoleteOption("--wal.throttle-when-pending",
"throttle writes when at least this many operations are waiting for collection (set to 0 to deactivate write-throttling)", true);
options->addObsoleteOption("--wal.throttle-wait", "maximum wait time per operation when write-throttled (in milliseconds)", true);
} | 363 | True | 1 |
|
CVE-2021-25939 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:P/A:N | NETWORK | LOW | SINGLE | NONE | PARTIAL | NONE | 4.0 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:N | NETWORK | LOW | HIGH | NONE | UNCHANGED | NONE | LOW | NONE | 2.7 | LOW | 1.2 | 1.4 | False | [{'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25939', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25939', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/arangodb/arangodb/commit/d9b7f019d2435f107b19a59190bf9cc27d5f34dd', 'name': 'https://github.com/arangodb/arangodb/commit/d9b7f019d2435f107b19a59190bf9cc27d5f34dd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/arangodb/arangodb/commit/d7b35a6884c6b2802d34d79fb2a79fb2c9ec2175', 'name': 'https://github.com/arangodb/arangodb/commit/d7b35a6884c6b2802d34d79fb2a79fb2c9ec2175', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-918'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndIncluding': '3.8.5.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:3.9.0:alpha1:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.0 through v3.9.0-alpha.1 have a feature which allows downloading a Foxx service from a publicly available URL. This feature does not enforce proper filtering of requests performed internally, which can be abused by a highly-privileged attacker to perform blind SSRF and send internal requests to localhost.'}] | 2022-02-11T20:49Z | 2022-02-09T13:15Z | Server-Side Request Forgery (SSRF) | The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination. | By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.
| https://cwe.mitre.org/data/definitions/918.html | 0 | Jan | 2021-12-14 11:24:01+01:00 | [APM-78] Disable installation from remote URL (#15292) | d9b7f019d2435f107b19a59190bf9cc27d5f34dd | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | ServerSecurityFeature::ServerSecurityFeature | ServerSecurityFeature::ServerSecurityFeature( application_features :: ApplicationServer & server) | ['server'] | ServerSecurityFeature::ServerSecurityFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "ServerSecurity"),
_enableFoxxApi(true),
_enableFoxxStore(true),
_hardenedRestApi(false) {
setOptional(false);
startsAfter<application_features::GreetingsFeaturePhase>();
} | 48 | True | 1 |
CVE-2021-25939 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:P/A:N | NETWORK | LOW | SINGLE | NONE | PARTIAL | NONE | 4.0 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:N | NETWORK | LOW | HIGH | NONE | UNCHANGED | NONE | LOW | NONE | 2.7 | LOW | 1.2 | 1.4 | False | [{'url': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25939', 'name': 'https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25939', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/arangodb/arangodb/commit/d9b7f019d2435f107b19a59190bf9cc27d5f34dd', 'name': 'https://github.com/arangodb/arangodb/commit/d9b7f019d2435f107b19a59190bf9cc27d5f34dd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/arangodb/arangodb/commit/d7b35a6884c6b2802d34d79fb2a79fb2c9ec2175', 'name': 'https://github.com/arangodb/arangodb/commit/d7b35a6884c6b2802d34d79fb2a79fb2c9ec2175', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-918'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndIncluding': '3.8.5.1', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:arangodb:arangodb:3.9.0:alpha1:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ArangoDB, versions v3.7.0 through v3.9.0-alpha.1 have a feature which allows downloading a Foxx service from a publicly available URL. This feature does not enforce proper filtering of requests performed internally, which can be abused by a highly-privileged attacker to perform blind SSRF and send internal requests to localhost.'}] | 2022-02-11T20:49Z | 2022-02-09T13:15Z | Server-Side Request Forgery (SSRF) | The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination. | By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.
| https://cwe.mitre.org/data/definitions/918.html | 0 | Jan | 2021-12-14 11:24:01+01:00 | [APM-78] Disable installation from remote URL (#15292) | d9b7f019d2435f107b19a59190bf9cc27d5f34dd | False | arangodb/arangodb | 🥑 ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions. | 2011-10-26 06:42:00 | 2022-08-27 07:22:08 | https://www.arangodb.com | arangodb | 12517.0 | 779.0 | ServerSecurityFeature::collectOptions | ServerSecurityFeature::collectOptions( std :: shared_ptr<ProgramOptions> options) | ['options'] | void ServerSecurityFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOption("--server.harden",
"lock down REST APIs that reveal version information or server "
"internals for non-admin users",
new BooleanParameter(&_hardenedRestApi))
.setIntroducedIn(30500);
options->addOption("--foxx.api", "enables Foxx management REST APIs",
new BooleanParameter(&_enableFoxxApi),
arangodb::options::makeFlags(
arangodb::options::Flags::DefaultNoComponents,
arangodb::options::Flags::OnCoordinator,
arangodb::options::Flags::OnSingle))
.setIntroducedIn(30500);
options->addOption("--foxx.store", "enables Foxx store in web interface",
new BooleanParameter(&_enableFoxxStore),
arangodb::options::makeFlags(
arangodb::options::Flags::DefaultNoComponents,
arangodb::options::Flags::OnCoordinator,
arangodb::options::Flags::OnSingle))
.setIntroducedIn(30500);
} | 140 | True | 1 |
Subsets and Splits