cve_id
stringlengths 13
16
| obtain_all_privilege
stringclasses 3
values | obtain_user_privilege
stringclasses 2
values | obtain_other_privilege
stringclasses 2
values | user_interaction_required
stringclasses 3
values | cvss2_vector_string
stringclasses 106
values | cvss2_access_vector
stringclasses 4
values | cvss2_access_complexity
stringclasses 4
values | cvss2_authentication
stringclasses 3
values | cvss2_confidentiality_impact
stringclasses 4
values | cvss2_integrity_impact
stringclasses 4
values | cvss2_availability_impact
stringclasses 4
values | cvss2_base_score
stringclasses 50
values | cvss3_vector_string
stringclasses 226
values | cvss3_attack_vector
stringclasses 5
values | cvss3_attack_complexity
stringclasses 3
values | cvss3_privileges_required
stringclasses 4
values | cvss3_user_interaction
stringclasses 3
values | cvss3_scope
stringclasses 3
values | cvss3_confidentiality_impact
stringclasses 4
values | cvss3_integrity_impact
stringclasses 4
values | cvss3_availability_impact
stringclasses 4
values | cvss3_base_score
stringclasses 55
values | cvss3_base_severity
stringclasses 5
values | exploitability_score
stringclasses 22
values | impact_score
stringclasses 15
values | ac_insuf_info
stringclasses 3
values | reference_json
stringlengths 221
23.3k
| problemtype_json
stringclasses 200
values | severity
stringclasses 4
values | cve_nodes
stringlengths 2
33.1k
| cve_description
stringlengths 64
1.99k
| cve_last_modified_date
stringlengths 17
17
| cve_published_date
stringlengths 17
17
| cwe_name
stringclasses 125
values | cwe_description
stringclasses 124
values | cwe_extended_description
stringclasses 95
values | cwe_url
stringclasses 124
values | cwe_is_category
int64 0
1
| commit_author
stringlengths 0
34
| commit_author_date
stringlengths 25
25
| commit_msg
stringlengths 0
13.3k
| commit_hash
stringlengths 40
40
| commit_is_merge
stringclasses 1
value | repo_name
stringclasses 467
values | repo_description
stringclasses 459
values | repo_date_created
stringclasses 467
values | repo_date_last_push
stringclasses 467
values | repo_homepage
stringclasses 294
values | repo_owner
stringclasses 470
values | repo_stars
stringclasses 406
values | repo_forks
stringclasses 352
values | function_name
stringlengths 3
120
| function_signature
stringlengths 6
640
| function_parameters
stringlengths 2
302
| function
stringlengths 12
114k
| function_token_count
stringlengths 1
5
| function_before_change
stringclasses 1
value | labels
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2022-31307 | 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/nginx/njs/commit/eafe4c7a326b163612f10861392622b5da5b1792', 'name': 'https://github.com/nginx/njs/commit/eafe4c7a326b163612f10861392622b5da5b1792', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/482', 'name': 'https://github.com/nginx/njs/issues/482', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:f5:njs:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Nginx NJS v0.7.2 was discovered to contain a segmentation violation in the function njs_string_offset at src/njs_string.c.'}] | 2022-07-08T16:51Z | 2022-06-21T13:15Z | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. |
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for freeing the memory.
In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.
| https://cwe.mitre.org/data/definitions/416.html | 0 | Dmitry Volyntsev | 2022-04-27 16:31:00-07:00 | Fixed Array.prototype.lastIndexOf() with unicode string as "this".
Previously, when lastIndexOf() was called with unicode string as "this"
argument and a negative "fromIndex" argument null-pointer dererence
might occur because njs_string_offset() was called with invalid index
value whereas njs_string_offset() should always be called with valid
index argument.
The fix is to verify that from index is valid.
This closes #482 issue on Github. | eafe4c7a326b163612f10861392622b5da5b1792 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_object_iterate_reverse | njs_object_iterate_reverse( njs_vm_t * vm , njs_iterator_args_t * args , njs_iterator_handler_t handler) | ['vm', 'args', 'handler'] | njs_object_iterate_reverse(njs_vm_t *vm, njs_iterator_args_t *args,
njs_iterator_handler_t handler)
{
double idx;
int64_t i, from, to, length;
njs_int_t ret;
njs_array_t *array, *keys;
njs_value_t *entry, *value, prop, character, string_obj;
const u_char *p, *end, *pos;
njs_string_prop_t string_prop;
njs_object_value_t *object;
value = args->value;
from = args->from;
to = args->to;
if (njs_is_array(value)) {
array = njs_array(value);
from += 1;
while (from-- > to) {
if (njs_slow_path(!array->object.fast_array)) {
goto process_object;
}
if (njs_fast_path(from < array->length
&& njs_is_valid(&array->start[from])))
{
ret = handler(vm, args, &array->start[from], from);
} else {
entry = njs_value_arg(&njs_value_invalid);
ret = njs_value_property_i64(vm, value, from, &prop);
if (njs_slow_path(ret != NJS_DECLINED)) {
if (ret == NJS_ERROR) {
return NJS_ERROR;
}
entry = ∝
}
ret = handler(vm, args, entry, from);
}
if (njs_slow_path(ret != NJS_OK)) {
if (ret == NJS_DONE) {
return NJS_DONE;
}
return NJS_ERROR;
}
}
return NJS_OK;
}
if (njs_is_string(value) || njs_is_object_string(value)) {
if (njs_is_string(value)) {
object = njs_object_value_alloc(vm, NJS_OBJ_TYPE_STRING, 0, value);
if (njs_slow_path(object == NULL)) {
return NJS_ERROR;
}
njs_set_object_value(&string_obj, object);
args->value = &string_obj;
}
else {
value = njs_object_value(value);
}
length = njs_string_prop(&string_prop, value);
end = string_prop.start + string_prop.size;
if ((size_t) length == string_prop.size) {
/* Byte or ASCII string. */
p = string_prop.start + from;
i = from + 1;
while (i-- > to) {
/* This cannot fail. */
(void) njs_string_new(vm, &character, p, 1, 1);
ret = handler(vm, args, &character, i);
if (njs_slow_path(ret != NJS_OK)) {
if (ret == NJS_DONE) {
return NJS_DONE;
}
return NJS_ERROR;
}
p--;
}
} else {
/* UTF-8 string. */
p = njs_string_offset(string_prop.start, end, from);
p = njs_utf8_next(p, end);
i = from + 1;
while (i-- > to) {
pos = njs_utf8_prev(p);
/* This cannot fail. */
(void) njs_string_new(vm, &character, pos, p - pos , 1);
ret = handler(vm, args, &character, i);
if (njs_slow_path(ret != NJS_OK)) {
if (ret == NJS_DONE) {
return NJS_DONE;
}
return NJS_ERROR;
}
p = pos;
}
}
return NJS_OK;
}
if (!njs_is_object(value)) {
return NJS_OK;
}
process_object:
if (!njs_fast_object(from - to)) {
keys = njs_array_indices(vm, value);
if (njs_slow_path(keys == NULL)) {
return NJS_ERROR;
}
i = keys->length;
while (i > 0) {
idx = njs_string_to_index(&keys->start[--i]);
if (idx < to || idx > from) {
continue;
}
ret = njs_iterator_object_handler(vm, handler, args,
&keys->start[i], idx);
if (njs_slow_path(ret != NJS_OK)) {
njs_array_destroy(vm, keys);
return ret;
}
}
njs_array_destroy(vm, keys);
return NJS_OK;
}
i = from + 1;
while (i-- > to) {
ret = njs_iterator_object_handler(vm, handler, args, NULL, i);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
}
return NJS_OK;
} | 761 | True | 1 |
|
CVE-2022-30503 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:N/A:P | LOCAL | LOW | NONE | NONE | NONE | PARTIAL | 2.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/nginx/njs/commit/5c6130a2a0b4c41ab415f6b8992aa323636338b9', 'name': 'https://github.com/nginx/njs/commit/5c6130a2a0b4c41ab415f6b8992aa323636338b9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/nginx/njs/issues/478', 'name': 'https://github.com/nginx/njs/issues/478', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nginx:njs:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Nginx NJS v0.7.2 was discovered to contain a segmentation violation in the function njs_set_number at src/njs_value.h.'}] | 2022-06-10T18:56Z | 2022-06-02T14:15Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Dmitry Volyntsev | 2022-05-06 18:55:35-07:00 | Fixed Array.prototype.fill() for typed-arrays.
This closes #478 issue on Github. | 5c6130a2a0b4c41ab415f6b8992aa323636338b9 | False | nginx/njs | An official read-only mirror of http://hg.nginx.org/njs/ which is updated hourly. | 2015-09-24 02:03:58 | 2022-08-26 00:50:07 | nginx | 606.0 | 86.0 | njs_typed_array_set_value | njs_typed_array_set_value( njs_vm_t * vm , njs_typed_array_t * array , uint32_t index , njs_value_t * setval) | ['vm', 'array', 'index', 'setval'] | njs_typed_array_set_value(njs_vm_t *vm, njs_typed_array_t *array,
uint32_t index, njs_value_t *setval)
{
double num;
njs_int_t ret;
njs_array_buffer_t *buffer;
ret = njs_value_to_number(vm, setval, &num);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
buffer = njs_typed_array_writable(vm, array);
if (njs_slow_path(buffer == NULL)) {
return NJS_ERROR;
}
njs_typed_array_prop_set(vm, array, index, num);
njs_set_number(setval, num);
return NJS_OK;
} | 99 | True | 1 |
|
CVE-2022-1253 | 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://huntr.dev/bounties/1-other-strukturag/libde265', 'name': 'https://huntr.dev/bounties/1-other-strukturag/libde265', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/strukturag/libde265/commit/8e89fe0e175d2870c39486fdd09250b230ec10b8', 'name': 'https://github.com/strukturag/libde265/commit/8e89fe0e175d2870c39486fdd09250b230ec10b8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:struktur:libde265:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Heap-based Buffer Overflow in GitHub repository strukturag/libde265 prior to and including 1.0.8. The fix is established in commit 8e89fe0e175d2870c39486fdd09250b230ec10b8 but does not yet belong to an official release.'}] | 2022-04-14T17:52Z | 2022-04-06T12: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 | Dirk Farin | 2022-04-05 09:52:57+02:00 | error on out-of-range cpb_cnt_minus1 (oss-fuzz issue 27590) | 8e89fe0e175d2870c39486fdd09250b230ec10b8 | False | strukturag/libde265 | Open h.265 video codec implementation. | 2013-08-26 16:36:42 | 2022-07-12 20:30:04 | null | strukturag | 1361.0 | 398.0 | seq_parameter_set::read | seq_parameter_set::read( error_queue * errqueue , bitreader * br) | ['errqueue', 'br'] | de265_error seq_parameter_set::read(error_queue* errqueue, bitreader* br)
{
int vlc;
video_parameter_set_id = get_bits(br,4);
sps_max_sub_layers = get_bits(br,3) +1;
if (sps_max_sub_layers>7) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
sps_temporal_id_nesting_flag = get_bits(br,1);
profile_tier_level_.read(br, sps_max_sub_layers);
READ_VLC(seq_parameter_set_id, uvlc);
if (seq_parameter_set_id >= DE265_MAX_SPS_SETS) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
// --- decode chroma type ---
READ_VLC(chroma_format_idc, uvlc);
if (chroma_format_idc == 3) {
separate_colour_plane_flag = get_bits(br,1);
}
else {
separate_colour_plane_flag = 0;
}
if (chroma_format_idc<0 ||
chroma_format_idc>3) {
errqueue->add_warning(DE265_WARNING_INVALID_CHROMA_FORMAT, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
// --- picture size ---
READ_VLC(pic_width_in_luma_samples, uvlc);
READ_VLC(pic_height_in_luma_samples, uvlc);
if (pic_width_in_luma_samples == 0 ||
pic_height_in_luma_samples == 0) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
if (pic_width_in_luma_samples > MAX_PICTURE_WIDTH ||
pic_height_in_luma_samples> MAX_PICTURE_HEIGHT) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
conformance_window_flag = get_bits(br,1);
if (conformance_window_flag) {
READ_VLC(conf_win_left_offset, uvlc);
READ_VLC(conf_win_right_offset, uvlc);
READ_VLC(conf_win_top_offset, uvlc);
READ_VLC(conf_win_bottom_offset,uvlc);
}
else {
conf_win_left_offset = 0;
conf_win_right_offset = 0;
conf_win_top_offset = 0;
conf_win_bottom_offset= 0;
}
READ_VLC_OFFSET(bit_depth_luma, uvlc, 8);
READ_VLC_OFFSET(bit_depth_chroma,uvlc, 8);
if (bit_depth_luma > 16 ||
bit_depth_chroma > 16) {
errqueue->add_warning(DE265_WARNING_SPS_HEADER_INVALID, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
READ_VLC_OFFSET(log2_max_pic_order_cnt_lsb, uvlc, 4);
if (log2_max_pic_order_cnt_lsb<4 ||
log2_max_pic_order_cnt_lsb>16) {
errqueue->add_warning(DE265_WARNING_SPS_HEADER_INVALID, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
MaxPicOrderCntLsb = 1<<(log2_max_pic_order_cnt_lsb);
// --- sub_layer_ordering_info ---
sps_sub_layer_ordering_info_present_flag = get_bits(br,1);
int firstLayer = (sps_sub_layer_ordering_info_present_flag ?
0 : sps_max_sub_layers-1 );
for (int i=firstLayer ; i <= sps_max_sub_layers-1; i++ ) {
// sps_max_dec_pic_buffering[i]
vlc=get_uvlc(br);
if (vlc == UVLC_ERROR ||
vlc+1 > MAX_NUM_REF_PICS) {
errqueue->add_warning(DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
sps_max_dec_pic_buffering[i] = vlc+1;
// sps_max_num_reorder_pics[i]
READ_VLC(sps_max_num_reorder_pics[i], uvlc);
// sps_max_latency_increase[i]
READ_VLC(sps_max_latency_increase_plus1[i], uvlc);
SpsMaxLatencyPictures[i] = (sps_max_num_reorder_pics[i] +
sps_max_latency_increase_plus1[i]-1);
}
// copy info to all layers if only specified once
if (sps_sub_layer_ordering_info_present_flag) {
int ref = sps_max_sub_layers-1;
assert(ref<7);
for (int i=0 ; i < sps_max_sub_layers-1; i++ ) {
sps_max_dec_pic_buffering[i] = sps_max_dec_pic_buffering[ref];
sps_max_num_reorder_pics[i] = sps_max_num_reorder_pics[ref];
sps_max_latency_increase_plus1[i] = sps_max_latency_increase_plus1[ref];
}
}
READ_VLC_OFFSET(log2_min_luma_coding_block_size, uvlc, 3);
READ_VLC (log2_diff_max_min_luma_coding_block_size, uvlc);
READ_VLC_OFFSET(log2_min_transform_block_size, uvlc, 2);
READ_VLC(log2_diff_max_min_transform_block_size, uvlc);
READ_VLC(max_transform_hierarchy_depth_inter, uvlc);
READ_VLC(max_transform_hierarchy_depth_intra, uvlc);
if (log2_min_luma_coding_block_size > 6) { return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; }
if (log2_min_luma_coding_block_size + log2_diff_max_min_luma_coding_block_size > 6) { return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; }
if (log2_min_transform_block_size > 5) { return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; }
if (log2_min_transform_block_size + log2_diff_max_min_transform_block_size > 5) { return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; }
scaling_list_enable_flag = get_bits(br,1);
if (scaling_list_enable_flag) {
sps_scaling_list_data_present_flag = get_bits(br,1);
if (sps_scaling_list_data_present_flag) {
de265_error err;
if ((err=read_scaling_list(br,this, &scaling_list, false)) != DE265_OK) {
return err;
}
}
else {
set_default_scaling_lists(&scaling_list);
}
}
amp_enabled_flag = get_bits(br,1);
sample_adaptive_offset_enabled_flag = get_bits(br,1);
pcm_enabled_flag = get_bits(br,1);
if (pcm_enabled_flag) {
pcm_sample_bit_depth_luma = get_bits(br,4)+1;
pcm_sample_bit_depth_chroma = get_bits(br,4)+1;
READ_VLC_OFFSET(log2_min_pcm_luma_coding_block_size, uvlc, 3);
READ_VLC(log2_diff_max_min_pcm_luma_coding_block_size, uvlc);
pcm_loop_filter_disable_flag = get_bits(br,1);
if (pcm_sample_bit_depth_luma > bit_depth_luma) {
errqueue->add_warning(DE265_WARNING_PCM_BITDEPTH_TOO_LARGE, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
if (pcm_sample_bit_depth_chroma > bit_depth_chroma) {
errqueue->add_warning(DE265_WARNING_PCM_BITDEPTH_TOO_LARGE, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
}
else {
pcm_sample_bit_depth_luma = 0;
pcm_sample_bit_depth_chroma = 0;
log2_min_pcm_luma_coding_block_size = 0;
log2_diff_max_min_pcm_luma_coding_block_size = 0;
pcm_loop_filter_disable_flag = 0;
}
int num_short_term_ref_pic_sets;
READ_VLC(num_short_term_ref_pic_sets, uvlc);
if (num_short_term_ref_pic_sets < 0 ||
num_short_term_ref_pic_sets > 64) {
errqueue->add_warning(DE265_WARNING_NUMBER_OF_SHORT_TERM_REF_PIC_SETS_OUT_OF_RANGE, false);
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
// --- allocate reference pic set ---
// we do not allocate the ref-pic-set for the slice header here, but in the slice header itself
ref_pic_sets.resize(num_short_term_ref_pic_sets);
for (int i = 0; i < num_short_term_ref_pic_sets; i++) {
bool success = read_short_term_ref_pic_set(errqueue,this,br,
&ref_pic_sets[i], i,
ref_pic_sets,
false);
if (!success) {
return DE265_WARNING_SPS_HEADER_INVALID;
}
// dump_short_term_ref_pic_set(&(*ref_pic_sets)[i], fh);
}
long_term_ref_pics_present_flag = get_bits(br,1);
if (long_term_ref_pics_present_flag) {
READ_VLC(num_long_term_ref_pics_sps, uvlc);
if (num_long_term_ref_pics_sps > MAX_NUM_LT_REF_PICS_SPS) {
return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE;
}
for (int i = 0; i < num_long_term_ref_pics_sps; i++ ) {
lt_ref_pic_poc_lsb_sps[i] = get_bits(br, log2_max_pic_order_cnt_lsb);
used_by_curr_pic_lt_sps_flag[i] = get_bits(br,1);
}
}
else {
num_long_term_ref_pics_sps = 0; // NOTE: missing definition in standard !
}
sps_temporal_mvp_enabled_flag = get_bits(br,1);
strong_intra_smoothing_enable_flag = get_bits(br,1);
vui_parameters_present_flag = get_bits(br,1);
if (vui_parameters_present_flag) {
vui.read(errqueue, br, this);
}
sps_extension_present_flag = get_bits(br,1);
if (sps_extension_present_flag) {
sps_range_extension_flag = get_bits(br,1);
sps_multilayer_extension_flag = get_bits(br,1);
sps_extension_6bits = get_bits(br,6);
}
else {
sps_range_extension_flag = 0;
}
if (sps_range_extension_flag) {
de265_error err = range_extension.read(errqueue, br);
if (err != DE265_OK) { return err; }
}
/*
sps_extension_flag = get_bits(br,1);
if (sps_extension_flag) {
assert(false);
}
*/
de265_error err = compute_derived_values();
if (err != DE265_OK) { return err; }
sps_read = true;
return DE265_OK;
} | 1140 | True | 1 |
CVE-2022-1289 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://github.com/tildearrow/furnace/issues/325#issuecomment-1094139655', 'name': 'https://github.com/tildearrow/furnace/issues/325#issuecomment-1094139655', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/tildearrow/furnace/commit/0eb02422d5161767e9983bdaa5c429762d3477ce', 'name': 'https://github.com/tildearrow/furnace/commit/0eb02422d5161767e9983bdaa5c429762d3477ce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://vuldb.com/?id.196755', 'name': 'https://vuldb.com/?id.196755', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:tidearrow:furnace:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022-04-09', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A denial of service vulnerability was found in tildearrow Furnace. It has been classified as problematic. This is due to an incomplete fix of CVE-2022-1211. It is possible to initiate the attack remotely but it requires user interaction. The issue got fixed with the patch 0eb02422d5161767e9983bdaa5c429762d3477ce.'}] | 2022-04-18T15:13Z | 2022-04-10T16: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 | tildearrow | 2022-04-09 18:25:38-05:00 | fix possible pattern crash
issue #325 | 0eb02422d5161767e9983bdaa5c429762d3477ce | False | tildearrow/furnace | a multi-system chiptune tracker compatible with DefleMask modules | 2021-05-13 08:37:26 | 2022-08-28 01:51:01 | tildearrow | 403.0 | 57.0 | FurnaceGUI::patternRow | FurnaceGUI::patternRow( int i , bool isPlaying , float lineHeight , int chans , int ord , const DivPattern ** patCache) | ['i', 'isPlaying', 'lineHeight', 'chans', 'ord', 'patCache'] | inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int chans, int ord, const DivPattern** patCache) {
static char id[32];
bool selectedRow=(i>=sel1.y && i<=sel2.y);
ImGui::TableNextRow(0,lineHeight);
ImGui::TableNextColumn();
float cursorPosY=ImGui::GetCursorPos().y-ImGui::GetScrollY();
// check if the row is visible
if (cursorPosY<-lineHeight || cursorPosY>ImGui::GetWindowSize().y) {
return;
}
// check if we are in range
if (ord<0 || ord>=e->song.ordersLen) {
return;
}
if (i<0 || i>=e->song.patLen) {
return;
}
bool isPushing=false;
ImVec4 activeColor=uiColors[GUI_COLOR_PATTERN_ACTIVE];
ImVec4 inactiveColor=uiColors[GUI_COLOR_PATTERN_INACTIVE];
ImVec4 rowIndexColor=uiColors[GUI_COLOR_PATTERN_ROW_INDEX];
if (e->song.hilightB>0 && !(i%e->song.hilightB)) {
activeColor=uiColors[GUI_COLOR_PATTERN_ACTIVE_HI2];
inactiveColor=uiColors[GUI_COLOR_PATTERN_INACTIVE_HI2];
rowIndexColor=uiColors[GUI_COLOR_PATTERN_ROW_INDEX_HI2];
} else if (e->song.hilightA>0 && !(i%e->song.hilightA)) {
activeColor=uiColors[GUI_COLOR_PATTERN_ACTIVE_HI1];
inactiveColor=uiColors[GUI_COLOR_PATTERN_INACTIVE_HI1];
rowIndexColor=uiColors[GUI_COLOR_PATTERN_ROW_INDEX_HI1];
}
// check overflow highlight
if (settings.overflowHighlight) {
if (edit && cursor.y==i) {
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_EDITING]));
} else if (isPlaying && oldRow==i) {
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PLAY_HEAD]));
} else if (e->song.hilightB>0 && !(i%e->song.hilightB)) {
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_2]));
} else if (e->song.hilightA>0 && !(i%e->song.hilightA)) {
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_1]));
}
} else {
isPushing=true;
if (edit && cursor.y==i) {
ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_EDITING]));
} else if (isPlaying && oldRow==i) {
ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PLAY_HEAD]));
} else if (e->song.hilightB>0 && !(i%e->song.hilightB)) {
ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_2]));
} else if (e->song.hilightA>0 && !(i%e->song.hilightA)) {
ImGui::PushStyleColor(ImGuiCol_Header,ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_1]));
} else {
isPushing=false;
}
}
// row number
if (settings.patRowsBase==1) {
ImGui::TextColored(rowIndexColor," %.2X ",i);
} else {
ImGui::TextColored(rowIndexColor,"%3d ",i);
}
// for each column
for (int j=0; j<chans; j++) {
// check if channel is not hidden
if (!e->song.chanShow[j]) {
patChanX[j]=ImGui::GetCursorPosX();
continue;
}
int chanVolMax=e->getMaxVolumeChan(j);
if (chanVolMax<1) chanVolMax=1;
const DivPattern* pat=patCache[j];
ImGui::TableNextColumn();
patChanX[j]=ImGui::GetCursorPosX();
// selection highlight flags
int sel1XSum=sel1.xCoarse*32+sel1.xFine;
int sel2XSum=sel2.xCoarse*32+sel2.xFine;
int j32=j*32;
bool selectedNote=selectedRow && (j32>=sel1XSum && j32<=sel2XSum);
bool selectedIns=selectedRow && (j32+1>=sel1XSum && j32+1<=sel2XSum);
bool selectedVol=selectedRow && (j32+2>=sel1XSum && j32+2<=sel2XSum);
bool cursorNote=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==0);
bool cursorIns=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==1);
bool cursorVol=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==2);
// note
sprintf(id,"%s##PN_%d_%d",noteName(pat->data[i][0],pat->data[i][1]),i,j);
if (pat->data[i][0]==0 && pat->data[i][1]==0) {
ImGui::PushStyleColor(ImGuiCol_Text,inactiveColor);
} else {
ImGui::PushStyleColor(ImGuiCol_Text,activeColor);
}
if (cursorNote) {
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,threeChars);
demandX=ImGui::GetCursorPosX();
ImGui::PopStyleColor(3);
} else {
if (selectedNote) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
ImGui::Selectable(id,isPushing || selectedNote,ImGuiSelectableFlags_NoPadWithHalfSpacing,threeChars);
if (selectedNote) ImGui::PopStyleColor();
}
if (ImGui::IsItemClicked()) {
startSelection(j,0,i);
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
updateSelection(j,0,i);
}
ImGui::PopStyleColor();
// the following is only visible when the channel is not collapsed
if (!e->song.chanCollapse[j]) {
// instrument
if (pat->data[i][2]==-1) {
ImGui::PushStyleColor(ImGuiCol_Text,inactiveColor);
sprintf(id,"..##PI_%d_%d",i,j);
} else {
if (pat->data[i][2]<0 || pat->data[i][2]>=e->song.insLen) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_INS_ERROR]);
} else {
DivInstrumentType t=e->song.ins[pat->data[i][2]]->type;
if (t!=DIV_INS_AMIGA && t!=e->getPreferInsType(j)) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_INS_WARN]);
} else {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_INS]);
}
}
sprintf(id,"%.2X##PI_%d_%d",pat->data[i][2],i,j);
}
ImGui::SameLine(0.0f,0.0f);
if (cursorIns) {
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
demandX=ImGui::GetCursorPosX();
ImGui::PopStyleColor(3);
} else {
if (selectedIns) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
ImGui::Selectable(id,isPushing || selectedIns,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
if (selectedIns) ImGui::PopStyleColor();
}
if (ImGui::IsItemClicked()) {
startSelection(j,1,i);
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
updateSelection(j,1,i);
}
ImGui::PopStyleColor();
// volume
if (pat->data[i][3]==-1) {
sprintf(id,"..##PV_%d_%d",i,j);
ImGui::PushStyleColor(ImGuiCol_Text,inactiveColor);
} else {
int volColor=(pat->data[i][3]*127)/chanVolMax;
if (volColor>127) volColor=127;
if (volColor<0) volColor=0;
sprintf(id,"%.2X##PV_%d_%d",pat->data[i][3],i,j);
ImGui::PushStyleColor(ImGuiCol_Text,volColors[volColor]);
}
ImGui::SameLine(0.0f,0.0f);
if (cursorVol) {
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
demandX=ImGui::GetCursorPosX();
ImGui::PopStyleColor(3);
} else {
if (selectedVol) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
ImGui::Selectable(id,isPushing || selectedVol,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
if (selectedVol) ImGui::PopStyleColor();
}
if (ImGui::IsItemClicked()) {
startSelection(j,2,i);
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
updateSelection(j,2,i);
}
ImGui::PopStyleColor();
// effects
for (int k=0; k<e->song.pat[j].effectRows; k++) {
int index=4+(k<<1);
bool selectedEffect=selectedRow && (j32+index-1>=sel1XSum && j32+index-1<=sel2XSum);
bool selectedEffectVal=selectedRow && (j32+index>=sel1XSum && j32+index<=sel2XSum);
bool cursorEffect=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==index-1);
bool cursorEffectVal=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==index);
// effect
if (pat->data[i][index]==-1) {
sprintf(id,"..##PE%d_%d_%d",k,i,j);
ImGui::PushStyleColor(ImGuiCol_Text,inactiveColor);
} else {
sprintf(id,"%.2X##PE%d_%d_%d",pat->data[i][index],k,i,j);
if (pat->data[i][index]<0x10) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[pat->data[i][index]]]);
} else if (pat->data[i][index]<0x20) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY]);
} else if (pat->data[i][index]<0x30) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY]);
} else if (pat->data[i][index]<0x48) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY]);
} else if (pat->data[i][index]<0x90) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
} else if (pat->data[i][index]<0xa0) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_MISC]);
} else if (pat->data[i][index]<0xc0) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
} else if (pat->data[i][index]<0xd0) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SPEED]);
} else if (pat->data[i][index]<0xe0) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
} else {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[extFxColors[pat->data[i][index]-0xe0]]);
}
}
ImGui::SameLine(0.0f,0.0f);
if (cursorEffect) {
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
demandX=ImGui::GetCursorPosX();
ImGui::PopStyleColor(3);
} else {
if (selectedEffect) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
ImGui::Selectable(id,isPushing || selectedEffect,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
if (selectedEffect) ImGui::PopStyleColor();
}
if (ImGui::IsItemClicked()) {
startSelection(j,index-1,i);
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
updateSelection(j,index-1,i);
}
// effect value
if (pat->data[i][index+1]==-1) {
sprintf(id,"..##PF%d_%d_%d",k,i,j);
} else {
sprintf(id,"%.2X##PF%d_%d_%d",pat->data[i][index+1],k,i,j);
}
ImGui::SameLine(0.0f,0.0f);
if (cursorEffectVal) {
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
demandX=ImGui::GetCursorPosX();
ImGui::PopStyleColor(3);
} else {
if (selectedEffectVal) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
ImGui::Selectable(id,isPushing || selectedEffectVal,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
if (selectedEffectVal) ImGui::PopStyleColor();
}
if (ImGui::IsItemClicked()) {
startSelection(j,index,i);
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) {
updateSelection(j,index,i);
}
ImGui::PopStyleColor();
}
}
}
if (isPushing) {
ImGui::PopStyleColor();
}
ImGui::TableNextColumn();
patChanX[chans]=ImGui::GetCursorPosX();
} | 2645 | True | 1 |
|
CVE-2022-2301 | 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/hpjansson/chafa/commit/56fabfa18a6880b4cb66047fa6557920078048d9', 'name': 'https://github.com/hpjansson/chafa/commit/56fabfa18a6880b4cb66047fa6557920078048d9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/f6b9114b-671d-4948-b946-ffe5c9aeb816', 'name': 'https://huntr.dev/bounties/f6b9114b-671d-4948-b946-ffe5c9aeb816', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:chafa_project:chafa:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.10.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository hpjansson/chafa prior to 1.10.3.'}] | 2022-07-12T16:13Z | 2022-07-04T11: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 | Hans Petter Jansson | 2022-05-02 00:37:35+02:00 | XwdLoader: Fix buffer over-read and improve general robustness
This commit fixes a buffer over-read that could occur due to g_ntohl()
evaluating its argument more than once if at least one of the following
is true:
* Build target is not x86.
* __OPTIMIZE__ is not set during compilation (e.g. -O0 was used).
It also improves robustness more generally and fixes an issue where the
wrong field was being used to calculate the color map size, causing some
image files that were otherwise fine to be rejected.
Reported by @JieyongMa via huntr.dev. | 56fabfa18a6880b4cb66047fa6557920078048d9 | False | hpjansson/chafa | 📺🗿 Terminal graphics for the 21st century. | 2018-04-24 19:57:55 | 2022-08-18 09:59:50 | https://hpjansson.org/chafa/ | hpjansson | 1426.0 | 33.0 | load_header | load_header( XwdLoader * loader) | ['loader'] | load_header (XwdLoader *loader) // gconstpointer in, gsize in_max_len, XwdHeader *header_out)
{
XwdHeader *h = &loader->header;
XwdHeader in;
const guint32 *p = (const guint32 *) ∈
if (!file_mapping_taste (loader->mapping, &in, 0, sizeof (in)))
return FALSE;
h->header_size = g_ntohl (*(p++));
h->file_version = g_ntohl (*(p++));
h->pixmap_format = g_ntohl (*(p++));
h->pixmap_depth = g_ntohl (*(p++));
h->pixmap_width = g_ntohl (*(p++));
h->pixmap_height = g_ntohl (*(p++));
h->x_offset = g_ntohl (*(p++));
h->byte_order = g_ntohl (*(p++));
h->bitmap_unit = g_ntohl (*(p++));
h->bitmap_bit_order = g_ntohl (*(p++));
h->bitmap_pad = g_ntohl (*(p++));
h->bits_per_pixel = g_ntohl (*(p++));
h->bytes_per_line = g_ntohl (*(p++));
h->visual_class = g_ntohl (*(p++));
h->red_mask = g_ntohl (*(p++));
h->green_mask = g_ntohl (*(p++));
h->blue_mask = g_ntohl (*(p++));
h->bits_per_rgb = g_ntohl (*(p++));
h->color_map_entries = g_ntohl (*(p++));
h->n_colors = g_ntohl (*(p++));
h->window_width = g_ntohl (*(p++));
h->window_height = g_ntohl (*(p++));
h->window_x = g_ntohl (*(p++));
h->window_y = g_ntohl (*(p++));
h->window_border_width = g_ntohl (*(p++));
/* Only support the most common/useful subset of XWD files out there;
* namely, that corresponding to screen dumps from modern X.Org servers. */
ASSERT_HEADER (h->header_size >= sizeof (XwdHeader));
ASSERT_HEADER (h->file_version == 7);
ASSERT_HEADER (h->pixmap_depth == 24);
/* Xvfb sets bits_per_rgb to 8, but 'convert' uses 24 for the same image data. One
* of them is likely misunderstanding. Let's be lenient and accept either. */
ASSERT_HEADER (h->bits_per_rgb == 8 || h->bits_per_rgb == 24);
ASSERT_HEADER (h->bytes_per_line >= h->pixmap_width * (h->bits_per_pixel / 8));
ASSERT_HEADER (compute_pixel_type (loader) < CHAFA_PIXEL_MAX);
loader->file_data = file_mapping_get_data (loader->mapping, &loader->file_data_len);
if (!loader->file_data)
return FALSE;
ASSERT_HEADER (loader->file_data_len >= h->header_size
+ h->n_colors * sizeof (XwdColor)
+ h->pixmap_height * h->bytes_per_line);
loader->image_data = (const guint8 *) loader->file_data
+ h->header_size + h->n_colors * sizeof (XwdColor);
return TRUE;
} | 538 | True | 1 |
CVE-2022-1586 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/', 'name': 'FEDORA-2022-e56085ba31', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a,', 'name': 'https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a,', 'refsource': 'MISC', 'tags': ['Broken Link']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077976,', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077976,', 'refsource': 'MISC', 'tags': ['Broken Link', 'Patch']}, {'url': 'https://github.com/PCRE2Project/pcre2/commit/d4fa336fbcc388f89095b184ba6d99422cfc676c', 'name': 'https://github.com/PCRE2Project/pcre2/commit/d4fa336fbcc388f89095b184ba6d99422cfc676c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/', 'name': 'FEDORA-2022-a3edad0ab6', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/', 'name': 'FEDORA-2022-9c9691d058', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/', 'name': 'FEDORA-2022-19f4c34184', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pcre:pcre2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.40', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An out-of-bounds read vulnerability was discovered in the PCRE2 library in the compile_xclass_matchingpath() function of the pcre2_jit_compile.c file. This involves a unicode property matching issue in JIT-compiled regular expressions. The issue occurs because the character was not fully read in case-less matching within JIT.'}] | 2022-06-02T14:15Z | 2022-05-16T21: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 | Zoltan Herczeg | 2022-03-23 07:53:25+00:00 | Fixed a unicode properrty matching issue in JIT | 50a51cb7e67268e6ad417eb07c9de9bfea5cc55a | False | PCRE2Project/pcre2 | PCRE2 development is now based here. | 2021-08-20 11:18:29 | 2022-08-19 07:56:03 | PCRE2Project | 308.0 | 70.0 | compile_xclass_matchingpath | compile_xclass_matchingpath( compiler_common * common , PCRE2_SPTR cc , jump_list ** backtracks) | ['common', 'cc', 'backtracks'] | static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks)
{
DEFINE_COMPILER;
jump_list *found = NULL;
jump_list **list = (cc[0] & XCL_NOT) == 0 ? &found : backtracks;
sljit_uw c, charoffset, max = 256, min = READ_CHAR_MAX;
struct sljit_jump *jump = NULL;
PCRE2_SPTR ccbegin;
int compares, invertcmp, numberofcmps;
#if defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16)
BOOL utf = common->utf;
#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == [8|16] */
#ifdef SUPPORT_UNICODE
sljit_u32 unicode_status = 0;
int typereg = TMP1;
const sljit_u32 *other_cases;
sljit_uw typeoffset;
#endif /* SUPPORT_UNICODE */
/* Scanning the necessary info. */
cc++;
ccbegin = cc;
compares = 0;
if (cc[-1] & XCL_MAP)
{
min = 0;
cc += 32 / sizeof(PCRE2_UCHAR);
}
while (*cc != XCL_END)
{
compares++;
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
if (c > max) max = c;
if (c < min) min = c;
#ifdef SUPPORT_UNICODE
unicode_status |= XCLASS_SAVE_CHAR;
#endif /* SUPPORT_UNICODE */
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
if (c < min) min = c;
GETCHARINCTEST(c, cc);
if (c > max) max = c;
#ifdef SUPPORT_UNICODE
unicode_status |= XCLASS_SAVE_CHAR;
#endif /* SUPPORT_UNICODE */
}
#ifdef SUPPORT_UNICODE
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_CLIST)
{
other_cases = PRIV(ucd_caseless_sets) + cc[1];
while (*other_cases != NOTACHAR)
{
if (*other_cases > max) max = *other_cases;
if (*other_cases < min) min = *other_cases;
other_cases++;
}
}
else
{
max = READ_CHAR_MAX;
min = 0;
}
switch(*cc)
{
case PT_ANY:
/* Any either accepts everything or ignored. */
if (cc[-1] == XCL_PROP)
{
compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE);
if (list == backtracks)
add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
return;
}
break;
case PT_LAMP:
case PT_GC:
case PT_PC:
case PT_ALNUM:
unicode_status |= XCLASS_HAS_TYPE;
break;
case PT_SCX:
unicode_status |= XCLASS_HAS_SCRIPT_EXTENSION;
if (cc[-1] == XCL_NOTPROP)
{
unicode_status |= XCLASS_SCRIPT_EXTENSION_NOTPROP;
break;
}
compares++;
/* Fall through */
case PT_SC:
unicode_status |= XCLASS_HAS_SCRIPT;
break;
case PT_SPACE:
case PT_PXSPACE:
case PT_WORD:
case PT_PXGRAPH:
case PT_PXPRINT:
case PT_PXPUNCT:
unicode_status |= XCLASS_SAVE_CHAR | XCLASS_HAS_TYPE;
break;
case PT_CLIST:
case PT_UCNC:
unicode_status |= XCLASS_SAVE_CHAR;
break;
case PT_BOOL:
unicode_status |= XCLASS_HAS_BOOL;
break;
case PT_BIDICL:
unicode_status |= XCLASS_HAS_BIDICL;
break;
default:
SLJIT_UNREACHABLE();
break;
}
cc += 2;
}
#endif /* SUPPORT_UNICODE */
}
SLJIT_ASSERT(compares > 0);
/* We are not necessary in utf mode even in 8 bit mode. */
cc = ccbegin;
if ((cc[-1] & XCL_NOT) != 0)
read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR);
else
{
#ifdef SUPPORT_UNICODE
read_char(common, min, max, (unicode_status & XCLASS_NEEDS_UCD) ? backtracks : NULL, 0);
#else /* !SUPPORT_UNICODE */
read_char(common, min, max, NULL, 0);
#endif /* SUPPORT_UNICODE */
}
if ((cc[-1] & XCL_HASPROP) == 0)
{
if ((cc[-1] & XCL_MAP) != 0)
{
jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, &found))
{
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0);
add_jump(compiler, &found, JUMP(SLJIT_NOT_ZERO));
}
add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
JUMPHERE(jump);
cc += 32 / sizeof(PCRE2_UCHAR);
}
else
{
OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, min);
add_jump(compiler, (cc[-1] & XCL_NOT) == 0 ? backtracks : &found, CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, max - min));
}
}
else if ((cc[-1] & XCL_MAP) != 0)
{
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
#ifdef SUPPORT_UNICODE
unicode_status |= XCLASS_CHAR_SAVED;
#endif /* SUPPORT_UNICODE */
if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list))
{
#if PCRE2_CODE_UNIT_WIDTH == 8
jump = NULL;
if (common->utf)
#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0);
add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO));
#if PCRE2_CODE_UNIT_WIDTH == 8
if (common->utf)
#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
JUMPHERE(jump);
}
OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
cc += 32 / sizeof(PCRE2_UCHAR);
}
#ifdef SUPPORT_UNICODE
if (unicode_status & XCLASS_NEEDS_UCD)
{
if ((unicode_status & (XCLASS_SAVE_CHAR | XCLASS_CHAR_SAVED)) == XCLASS_SAVE_CHAR)
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
#if PCRE2_CODE_UNIT_WIDTH == 32
if (!common->utf)
{
jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR);
JUMPHERE(jump);
}
#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */
OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2));
OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1);
OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 3);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2);
OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
ccbegin = cc;
if (unicode_status & XCLASS_HAS_BIDICL)
{
OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, scriptx_bidiclass));
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BIDICLASS_SHIFT);
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_BIDICL)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
if (cc[-1] == XCL_NOTPROP)
invertcmp ^= 0x1;
jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]);
add_jump(compiler, compares > 0 ? list : backtracks, jump);
}
cc += 2;
}
}
cc = ccbegin;
}
if (unicode_status & XCLASS_HAS_BOOL)
{
OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, bprops));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BPROPS_MASK);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2);
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_BOOL)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
if (cc[-1] == XCL_NOTPROP)
invertcmp ^= 0x1;
OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), (sljit_sw)(PRIV(ucd_boolprop_sets) + (cc[1] >> 5)), SLJIT_IMM, (sljit_sw)1 << (cc[1] & 0x1f));
add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp));
}
cc += 2;
}
}
cc = ccbegin;
}
if (unicode_status & XCLASS_HAS_SCRIPT)
{
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
switch (*cc)
{
case PT_SCX:
if (cc[-1] == XCL_NOTPROP)
break;
/* Fall through */
case PT_SC:
compares--;
invertcmp = (compares == 0 && list != backtracks);
if (cc[-1] == XCL_NOTPROP)
invertcmp ^= 0x1;
add_jump(compiler, compares > 0 ? list : backtracks, CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]));
}
cc += 2;
}
}
cc = ccbegin;
}
if (unicode_status & XCLASS_HAS_SCRIPT_EXTENSION)
{
OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, scriptx_bidiclass));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_SCRIPTX_MASK);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2);
if (unicode_status & XCLASS_SCRIPT_EXTENSION_NOTPROP)
{
if (unicode_status & XCLASS_HAS_TYPE)
{
if (unicode_status & XCLASS_SAVE_CHAR)
{
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, TMP2, 0);
unicode_status |= XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0;
}
else
{
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP2, 0);
unicode_status |= XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR;
}
}
OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
}
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_SCX)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
jump = NULL;
if (cc[-1] == XCL_NOTPROP)
{
jump = CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, (int)cc[1]);
if (invertcmp)
{
add_jump(compiler, backtracks, jump);
jump = NULL;
}
invertcmp ^= 0x1;
}
OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), (sljit_sw)(PRIV(ucd_script_sets) + (cc[1] >> 5)), SLJIT_IMM, (sljit_sw)1 << (cc[1] & 0x1f));
add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp));
if (jump != NULL)
JUMPHERE(jump);
}
cc += 2;
}
}
if (unicode_status & XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0)
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
else if (unicode_status & XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR)
OP1(SLJIT_MOV, TMP2, 0, RETURN_ADDR, 0);
cc = ccbegin;
}
if (unicode_status & XCLASS_SAVE_CHAR)
OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
if (unicode_status & XCLASS_HAS_TYPE)
{
if (unicode_status & XCLASS_SAVE_CHAR)
typereg = RETURN_ADDR;
OP1(SLJIT_MOV_U8, typereg, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
}
}
#endif /* SUPPORT_UNICODE */
/* Generating code. */
charoffset = 0;
numberofcmps = 0;
#ifdef SUPPORT_UNICODE
typeoffset = 0;
#endif /* SUPPORT_UNICODE */
while (*cc != XCL_END)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
jump = NULL;
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE))
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
numberofcmps++;
}
else if (numberofcmps > 0)
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
numberofcmps = 0;
}
else
{
jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
numberofcmps = 0;
}
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
SET_CHAR_OFFSET(c);
GETCHARINCTEST(c, cc);
if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE))
{
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
numberofcmps++;
}
else if (numberofcmps > 0)
{
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
numberofcmps = 0;
}
else
{
jump = CMP(SLJIT_LESS_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
numberofcmps = 0;
}
}
#ifdef SUPPORT_UNICODE
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
if (*cc == XCL_NOTPROP)
invertcmp ^= 0x1;
cc++;
switch(*cc)
{
case PT_ANY:
if (!invertcmp)
jump = JUMP(SLJIT_JUMP);
break;
case PT_LAMP:
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Lu - typeoffset);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Ll - typeoffset);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Lt - typeoffset);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_GC:
c = PRIV(ucp_typerange)[(int)cc[1] * 2];
SET_TYPE_OFFSET(c);
jump = CMP(SLJIT_LESS_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, PRIV(ucp_typerange)[(int)cc[1] * 2 + 1] - c);
break;
case PT_PC:
jump = CMP(SLJIT_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, (int)cc[1] - typeoffset);
break;
case PT_SC:
case PT_SCX:
case PT_BOOL:
case PT_BIDICL:
compares++;
/* Do nothing. */
break;
case PT_SPACE:
case PT_PXSPACE:
SET_CHAR_OFFSET(9);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0xd - 0x9);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x85 - 0x9);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e - 0x9);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
SET_TYPE_OFFSET(ucp_Zl);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Zl);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_WORD:
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_UNDERSCORE - charoffset));
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
/* Fall through. */
case PT_ALNUM:
SET_TYPE_OFFSET(ucp_Ll);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
OP_FLAGS((*cc == PT_ALNUM) ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Nd);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_No - ucp_Nd);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_CLIST:
other_cases = PRIV(ucd_caseless_sets) + cc[1];
/* At least three characters are required.
Otherwise this case would be handled by the normal code path. */
SLJIT_ASSERT(other_cases[0] != NOTACHAR && other_cases[1] != NOTACHAR && other_cases[2] != NOTACHAR);
SLJIT_ASSERT(other_cases[0] < other_cases[1] && other_cases[1] < other_cases[2]);
/* Optimizing character pairs, if their difference is power of 2. */
if (is_powerof2(other_cases[1] ^ other_cases[0]))
{
if (charoffset == 0)
OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
else
{
OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset);
OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
}
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, other_cases[1]);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
other_cases += 2;
}
else if (is_powerof2(other_cases[2] ^ other_cases[1]))
{
if (charoffset == 0)
OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, other_cases[2] ^ other_cases[1]);
else
{
OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset);
OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
}
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, other_cases[2]);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(other_cases[0] - charoffset));
OP_FLAGS(SLJIT_OR | ((other_cases[3] == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL);
other_cases += 3;
}
else
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
}
while (*other_cases != NOTACHAR)
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
OP_FLAGS(SLJIT_OR | ((*other_cases == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL);
}
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_UCNC:
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_DOLLAR_SIGN - charoffset));
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_COMMERCIAL_AT - charoffset));
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_GRAVE_ACCENT - charoffset));
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
SET_CHAR_OFFSET(0xa0);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(0xd7ff - charoffset));
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
OP2U(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000 - 0);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_GREATER_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_PXGRAPH:
/* C and Z groups are the farthest two groups. */
SET_TYPE_OFFSET(ucp_Ll);
OP2U(SLJIT_SUB | SLJIT_SET_GREATER, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER);
jump = CMP(SLJIT_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
/* In case of ucp_Cf, we overwrite the result. */
SET_CHAR_OFFSET(0x2066);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e - 0x2066);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
JUMPHERE(jump);
jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
break;
case PT_PXPRINT:
/* C and Z groups are the farthest two groups. */
SET_TYPE_OFFSET(ucp_Ll);
OP2U(SLJIT_SUB | SLJIT_SET_GREATER, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER);
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Ll);
OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_NOT_EQUAL);
jump = CMP(SLJIT_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
/* In case of ucp_Cf, we overwrite the result. */
SET_CHAR_OFFSET(0x2066);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
JUMPHERE(jump);
jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
break;
case PT_PXPUNCT:
SET_TYPE_OFFSET(ucp_Sc);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_So - ucp_Sc);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x7f);
OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Pc);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_Ps - ucp_Pc);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
default:
SLJIT_UNREACHABLE();
break;
}
cc += 2;
}
#endif /* SUPPORT_UNICODE */
if (jump != NULL)
add_jump(compiler, compares > 0 ? list : backtracks, jump);
}
if (found != NULL)
set_jumps(found, LABEL());
} | 4617 | True | 1 |
|
CVE-2022-1586 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/', 'name': 'FEDORA-2022-e56085ba31', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a,', 'name': 'https://github.com/PCRE2Project/pcre2/commit/50a51cb7e67268e6ad417eb07c9de9bfea5cc55a,', 'refsource': 'MISC', 'tags': ['Broken Link']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077976,', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077976,', 'refsource': 'MISC', 'tags': ['Broken Link', 'Patch']}, {'url': 'https://github.com/PCRE2Project/pcre2/commit/d4fa336fbcc388f89095b184ba6d99422cfc676c', 'name': 'https://github.com/PCRE2Project/pcre2/commit/d4fa336fbcc388f89095b184ba6d99422cfc676c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/', 'name': 'FEDORA-2022-a3edad0ab6', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/', 'name': 'FEDORA-2022-9c9691d058', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/', 'name': 'FEDORA-2022-19f4c34184', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pcre:pcre2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.40', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An out-of-bounds read vulnerability was discovered in the PCRE2 library in the compile_xclass_matchingpath() function of the pcre2_jit_compile.c file. This involves a unicode property matching issue in JIT-compiled regular expressions. The issue occurs because the character was not fully read in case-less matching within JIT.'}] | 2022-06-02T14:15Z | 2022-05-16T21: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 | Zoltan Herczeg | 2022-03-24 05:34:42+00:00 | Fix incorrect value reading in JIT. | d4fa336fbcc388f89095b184ba6d99422cfc676c | False | PCRE2Project/pcre2 | PCRE2 development is now based here. | 2021-08-20 11:18:29 | 2022-08-19 07:56:03 | PCRE2Project | 308.0 | 70.0 | compile_xclass_matchingpath | compile_xclass_matchingpath( compiler_common * common , PCRE2_SPTR cc , jump_list ** backtracks) | ['common', 'cc', 'backtracks'] | static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks)
{
DEFINE_COMPILER;
jump_list *found = NULL;
jump_list **list = (cc[0] & XCL_NOT) == 0 ? &found : backtracks;
sljit_uw c, charoffset, max = 256, min = READ_CHAR_MAX;
struct sljit_jump *jump = NULL;
PCRE2_SPTR ccbegin;
int compares, invertcmp, numberofcmps;
#if defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16)
BOOL utf = common->utf;
#endif /* SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH == [8|16] */
#ifdef SUPPORT_UNICODE
sljit_u32 unicode_status = 0;
int typereg = TMP1;
const sljit_u32 *other_cases;
sljit_uw typeoffset;
#endif /* SUPPORT_UNICODE */
/* Scanning the necessary info. */
cc++;
ccbegin = cc;
compares = 0;
if (cc[-1] & XCL_MAP)
{
min = 0;
cc += 32 / sizeof(PCRE2_UCHAR);
}
while (*cc != XCL_END)
{
compares++;
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
if (c > max) max = c;
if (c < min) min = c;
#ifdef SUPPORT_UNICODE
unicode_status |= XCLASS_SAVE_CHAR;
#endif /* SUPPORT_UNICODE */
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
if (c < min) min = c;
GETCHARINCTEST(c, cc);
if (c > max) max = c;
#ifdef SUPPORT_UNICODE
unicode_status |= XCLASS_SAVE_CHAR;
#endif /* SUPPORT_UNICODE */
}
#ifdef SUPPORT_UNICODE
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_CLIST && *cc == XCL_PROP)
{
other_cases = PRIV(ucd_caseless_sets) + cc[1];
while (*other_cases != NOTACHAR)
{
if (*other_cases > max) max = *other_cases;
if (*other_cases < min) min = *other_cases;
other_cases++;
}
}
else
{
max = READ_CHAR_MAX;
min = 0;
}
switch(*cc)
{
case PT_ANY:
/* Any either accepts everything or ignored. */
if (cc[-1] == XCL_PROP)
{
compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE);
if (list == backtracks)
add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
return;
}
break;
case PT_LAMP:
case PT_GC:
case PT_PC:
case PT_ALNUM:
unicode_status |= XCLASS_HAS_TYPE;
break;
case PT_SCX:
unicode_status |= XCLASS_HAS_SCRIPT_EXTENSION;
if (cc[-1] == XCL_NOTPROP)
{
unicode_status |= XCLASS_SCRIPT_EXTENSION_NOTPROP;
break;
}
compares++;
/* Fall through */
case PT_SC:
unicode_status |= XCLASS_HAS_SCRIPT;
break;
case PT_SPACE:
case PT_PXSPACE:
case PT_WORD:
case PT_PXGRAPH:
case PT_PXPRINT:
case PT_PXPUNCT:
unicode_status |= XCLASS_SAVE_CHAR | XCLASS_HAS_TYPE;
break;
case PT_CLIST:
case PT_UCNC:
unicode_status |= XCLASS_SAVE_CHAR;
break;
case PT_BOOL:
unicode_status |= XCLASS_HAS_BOOL;
break;
case PT_BIDICL:
unicode_status |= XCLASS_HAS_BIDICL;
break;
default:
SLJIT_UNREACHABLE();
break;
}
cc += 2;
}
#endif /* SUPPORT_UNICODE */
}
SLJIT_ASSERT(compares > 0);
/* We are not necessary in utf mode even in 8 bit mode. */
cc = ccbegin;
if ((cc[-1] & XCL_NOT) != 0)
read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR);
else
{
#ifdef SUPPORT_UNICODE
read_char(common, min, max, (unicode_status & XCLASS_NEEDS_UCD) ? backtracks : NULL, 0);
#else /* !SUPPORT_UNICODE */
read_char(common, min, max, NULL, 0);
#endif /* SUPPORT_UNICODE */
}
if ((cc[-1] & XCL_HASPROP) == 0)
{
if ((cc[-1] & XCL_MAP) != 0)
{
jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, &found))
{
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0);
add_jump(compiler, &found, JUMP(SLJIT_NOT_ZERO));
}
add_jump(compiler, backtracks, JUMP(SLJIT_JUMP));
JUMPHERE(jump);
cc += 32 / sizeof(PCRE2_UCHAR);
}
else
{
OP2(SLJIT_SUB, TMP2, 0, TMP1, 0, SLJIT_IMM, min);
add_jump(compiler, (cc[-1] & XCL_NOT) == 0 ? backtracks : &found, CMP(SLJIT_GREATER, TMP2, 0, SLJIT_IMM, max - min));
}
}
else if ((cc[-1] & XCL_MAP) != 0)
{
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
#ifdef SUPPORT_UNICODE
unicode_status |= XCLASS_CHAR_SAVED;
#endif /* SUPPORT_UNICODE */
if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list))
{
#if PCRE2_CODE_UNIT_WIDTH == 8
jump = NULL;
if (common->utf)
#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
OP2U(SLJIT_AND | SLJIT_SET_Z, TMP1, 0, TMP2, 0);
add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO));
#if PCRE2_CODE_UNIT_WIDTH == 8
if (common->utf)
#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
JUMPHERE(jump);
}
OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
cc += 32 / sizeof(PCRE2_UCHAR);
}
#ifdef SUPPORT_UNICODE
if (unicode_status & XCLASS_NEEDS_UCD)
{
if ((unicode_status & (XCLASS_SAVE_CHAR | XCLASS_CHAR_SAVED)) == XCLASS_SAVE_CHAR)
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP1, 0);
#if PCRE2_CODE_UNIT_WIDTH == 32
if (!common->utf)
{
jump = CMP(SLJIT_LESS, TMP1, 0, SLJIT_IMM, MAX_UTF_CODE_POINT + 1);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, UNASSIGNED_UTF_CHAR);
JUMPHERE(jump);
}
#endif /* PCRE2_CODE_UNIT_WIDTH == 32 */
OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1);
OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)PRIV(ucd_stage2));
OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1);
OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 3);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2);
OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
ccbegin = cc;
if (unicode_status & XCLASS_HAS_BIDICL)
{
OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, scriptx_bidiclass));
OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BIDICLASS_SHIFT);
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_BIDICL)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
if (cc[-1] == XCL_NOTPROP)
invertcmp ^= 0x1;
jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]);
add_jump(compiler, compares > 0 ? list : backtracks, jump);
}
cc += 2;
}
}
cc = ccbegin;
}
if (unicode_status & XCLASS_HAS_BOOL)
{
OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, bprops));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BPROPS_MASK);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2);
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_BOOL)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
if (cc[-1] == XCL_NOTPROP)
invertcmp ^= 0x1;
OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), (sljit_sw)(PRIV(ucd_boolprop_sets) + (cc[1] >> 5)), SLJIT_IMM, (sljit_sw)1 << (cc[1] & 0x1f));
add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp));
}
cc += 2;
}
}
cc = ccbegin;
}
if (unicode_status & XCLASS_HAS_SCRIPT)
{
OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
switch (*cc)
{
case PT_SCX:
if (cc[-1] == XCL_NOTPROP)
break;
/* Fall through */
case PT_SC:
compares--;
invertcmp = (compares == 0 && list != backtracks);
if (cc[-1] == XCL_NOTPROP)
invertcmp ^= 0x1;
add_jump(compiler, compares > 0 ? list : backtracks, CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]));
}
cc += 2;
}
}
cc = ccbegin;
}
if (unicode_status & XCLASS_HAS_SCRIPT_EXTENSION)
{
OP1(SLJIT_MOV_U16, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, scriptx_bidiclass));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_SCRIPTX_MASK);
OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 2);
if (unicode_status & XCLASS_SCRIPT_EXTENSION_NOTPROP)
{
if (unicode_status & XCLASS_HAS_TYPE)
{
if (unicode_status & XCLASS_SAVE_CHAR)
{
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS0, TMP2, 0);
unicode_status |= XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0;
}
else
{
OP1(SLJIT_MOV, RETURN_ADDR, 0, TMP2, 0);
unicode_status |= XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR;
}
}
OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
}
while (*cc != XCL_END)
{
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
GETCHARINCTEST(c, cc);
}
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
if (*cc == PT_SCX)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
jump = NULL;
if (cc[-1] == XCL_NOTPROP)
{
jump = CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, (int)cc[1]);
if (invertcmp)
{
add_jump(compiler, backtracks, jump);
jump = NULL;
}
invertcmp ^= 0x1;
}
OP2U(SLJIT_AND32 | SLJIT_SET_Z, SLJIT_MEM1(TMP1), (sljit_sw)(PRIV(ucd_script_sets) + (cc[1] >> 5)), SLJIT_IMM, (sljit_sw)1 << (cc[1] & 0x1f));
add_jump(compiler, compares > 0 ? list : backtracks, JUMP(SLJIT_NOT_ZERO ^ invertcmp));
if (jump != NULL)
JUMPHERE(jump);
}
cc += 2;
}
}
if (unicode_status & XCLASS_SCRIPT_EXTENSION_RESTORE_LOCALS0)
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
else if (unicode_status & XCLASS_SCRIPT_EXTENSION_RESTORE_RETURN_ADDR)
OP1(SLJIT_MOV, TMP2, 0, RETURN_ADDR, 0);
cc = ccbegin;
}
if (unicode_status & XCLASS_SAVE_CHAR)
OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0);
if (unicode_status & XCLASS_HAS_TYPE)
{
if (unicode_status & XCLASS_SAVE_CHAR)
typereg = RETURN_ADDR;
OP1(SLJIT_MOV_U8, typereg, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
}
}
#endif /* SUPPORT_UNICODE */
/* Generating code. */
charoffset = 0;
numberofcmps = 0;
#ifdef SUPPORT_UNICODE
typeoffset = 0;
#endif /* SUPPORT_UNICODE */
while (*cc != XCL_END)
{
compares--;
invertcmp = (compares == 0 && list != backtracks);
jump = NULL;
if (*cc == XCL_SINGLE)
{
cc ++;
GETCHARINCTEST(c, cc);
if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE))
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
numberofcmps++;
}
else if (numberofcmps > 0)
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
numberofcmps = 0;
}
else
{
jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
numberofcmps = 0;
}
}
else if (*cc == XCL_RANGE)
{
cc ++;
GETCHARINCTEST(c, cc);
SET_CHAR_OFFSET(c);
GETCHARINCTEST(c, cc);
if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE))
{
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(numberofcmps == 0 ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
numberofcmps++;
}
else if (numberofcmps > 0)
{
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
numberofcmps = 0;
}
else
{
jump = CMP(SLJIT_LESS_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (sljit_sw)(c - charoffset));
numberofcmps = 0;
}
}
#ifdef SUPPORT_UNICODE
else
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
if (*cc == XCL_NOTPROP)
invertcmp ^= 0x1;
cc++;
switch(*cc)
{
case PT_ANY:
if (!invertcmp)
jump = JUMP(SLJIT_JUMP);
break;
case PT_LAMP:
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Lu - typeoffset);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Ll - typeoffset);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Lt - typeoffset);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_GC:
c = PRIV(ucp_typerange)[(int)cc[1] * 2];
SET_TYPE_OFFSET(c);
jump = CMP(SLJIT_LESS_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, PRIV(ucp_typerange)[(int)cc[1] * 2 + 1] - c);
break;
case PT_PC:
jump = CMP(SLJIT_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, (int)cc[1] - typeoffset);
break;
case PT_SC:
case PT_SCX:
case PT_BOOL:
case PT_BIDICL:
compares++;
/* Do nothing. */
break;
case PT_SPACE:
case PT_PXSPACE:
SET_CHAR_OFFSET(9);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0xd - 0x9);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x85 - 0x9);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e - 0x9);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
SET_TYPE_OFFSET(ucp_Zl);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Zl);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_WORD:
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_UNDERSCORE - charoffset));
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
/* Fall through. */
case PT_ALNUM:
SET_TYPE_OFFSET(ucp_Ll);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_Lu - ucp_Ll);
OP_FLAGS((*cc == PT_ALNUM) ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Nd);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_No - ucp_Nd);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_CLIST:
other_cases = PRIV(ucd_caseless_sets) + cc[1];
/* At least three characters are required.
Otherwise this case would be handled by the normal code path. */
SLJIT_ASSERT(other_cases[0] != NOTACHAR && other_cases[1] != NOTACHAR && other_cases[2] != NOTACHAR);
SLJIT_ASSERT(other_cases[0] < other_cases[1] && other_cases[1] < other_cases[2]);
/* Optimizing character pairs, if their difference is power of 2. */
if (is_powerof2(other_cases[1] ^ other_cases[0]))
{
if (charoffset == 0)
OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
else
{
OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset);
OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
}
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, other_cases[1]);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
other_cases += 2;
}
else if (is_powerof2(other_cases[2] ^ other_cases[1]))
{
if (charoffset == 0)
OP2(SLJIT_OR, TMP2, 0, TMP1, 0, SLJIT_IMM, other_cases[2] ^ other_cases[1]);
else
{
OP2(SLJIT_ADD, TMP2, 0, TMP1, 0, SLJIT_IMM, (sljit_sw)charoffset);
OP2(SLJIT_OR, TMP2, 0, TMP2, 0, SLJIT_IMM, other_cases[1] ^ other_cases[0]);
}
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, other_cases[2]);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(other_cases[0] - charoffset));
OP_FLAGS(SLJIT_OR | ((other_cases[3] == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL);
other_cases += 3;
}
else
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
}
while (*other_cases != NOTACHAR)
{
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(*other_cases++ - charoffset));
OP_FLAGS(SLJIT_OR | ((*other_cases == NOTACHAR) ? SLJIT_SET_Z : 0), TMP2, 0, SLJIT_EQUAL);
}
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_UCNC:
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_DOLLAR_SIGN - charoffset));
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_COMMERCIAL_AT - charoffset));
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (sljit_sw)(CHAR_GRAVE_ACCENT - charoffset));
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
SET_CHAR_OFFSET(0xa0);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, (sljit_sw)(0xd7ff - charoffset));
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
OP2U(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, TMP1, 0, SLJIT_IMM, 0xe000 - 0);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_GREATER_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
case PT_PXGRAPH:
/* C and Z groups are the farthest two groups. */
SET_TYPE_OFFSET(ucp_Ll);
OP2U(SLJIT_SUB | SLJIT_SET_GREATER, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER);
jump = CMP(SLJIT_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
/* In case of ucp_Cf, we overwrite the result. */
SET_CHAR_OFFSET(0x2066);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x180e - 0x2066);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
JUMPHERE(jump);
jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
break;
case PT_PXPRINT:
/* C and Z groups are the farthest two groups. */
SET_TYPE_OFFSET(ucp_Ll);
OP2U(SLJIT_SUB | SLJIT_SET_GREATER, typereg, 0, SLJIT_IMM, ucp_So - ucp_Ll);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_GREATER);
OP2U(SLJIT_SUB | SLJIT_SET_Z, typereg, 0, SLJIT_IMM, ucp_Zs - ucp_Ll);
OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_NOT_EQUAL);
jump = CMP(SLJIT_NOT_EQUAL, typereg, 0, SLJIT_IMM, ucp_Cf - ucp_Ll);
/* In case of ucp_Cf, we overwrite the result. */
SET_CHAR_OFFSET(0x2066);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x2069 - 0x2066);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, 0x061c - 0x2066);
OP_FLAGS(SLJIT_OR, TMP2, 0, SLJIT_EQUAL);
JUMPHERE(jump);
jump = CMP(SLJIT_ZERO ^ invertcmp, TMP2, 0, SLJIT_IMM, 0);
break;
case PT_PXPUNCT:
SET_TYPE_OFFSET(ucp_Sc);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_So - ucp_Sc);
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, TMP1, 0, SLJIT_IMM, 0x7f);
OP_FLAGS(SLJIT_AND, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Pc);
OP2U(SLJIT_SUB | SLJIT_SET_LESS_EQUAL, typereg, 0, SLJIT_IMM, ucp_Ps - ucp_Pc);
OP_FLAGS(SLJIT_OR | SLJIT_SET_Z, TMP2, 0, SLJIT_LESS_EQUAL);
jump = JUMP(SLJIT_NOT_ZERO ^ invertcmp);
break;
default:
SLJIT_UNREACHABLE();
break;
}
cc += 2;
}
#endif /* SUPPORT_UNICODE */
if (jump != NULL)
add_jump(compiler, compares > 0 ? list : backtracks, jump);
}
if (found != NULL)
set_jumps(found, LABEL());
} | 4622 | True | 1 |
|
CVE-2022-1587 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0', 'name': 'https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/', 'name': 'FEDORA-2022-e56085ba31', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077983,', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077983,', 'refsource': 'MISC', 'tags': ['Broken Link']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/', 'name': 'FEDORA-2022-a3edad0ab6', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/', 'name': 'FEDORA-2022-9c9691d058', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/', 'name': 'FEDORA-2022-19f4c34184', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pcre:pcre2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.40', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An out-of-bounds read vulnerability was discovered in the PCRE2 library in the get_recurse_data_length() function of the pcre2_jit_compile.c file. This issue affects recursions in JIT-compiled regular expressions caused by duplicate data transfers.'}] | 2022-06-02T14:15Z | 2022-05-16T21: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 | Zoltan Herczeg | 2022-03-26 07:55:50+00:00 | Fixed an issue affecting recursions in JIT | 03654e751e7f0700693526b67dfcadda6b42c9d0 | False | PCRE2Project/pcre2 | PCRE2 development is now based here. | 2021-08-20 11:18:29 | 2022-08-19 07:56:03 | PCRE2Project | 308.0 | 70.0 | copy_recurse_data | copy_recurse_data( compiler_common * common , PCRE2_SPTR cc , PCRE2_SPTR ccend , int type , int stackptr , int stacktop , BOOL has_quit) | ['common', 'cc', 'ccend', 'type', 'stackptr', 'stacktop', 'has_quit'] | static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
int type, int stackptr, int stacktop, BOOL has_quit)
{
delayed_mem_copy_status status;
PCRE2_SPTR alternative;
sljit_sw private_srcw[2];
sljit_sw shared_srcw[3];
sljit_sw kept_shared_srcw[2];
int private_count, shared_count, kept_shared_count;
int from_sp, base_reg, offset, i;
BOOL setsom_found = FALSE;
BOOL setmark_found = FALSE;
BOOL capture_last_found = FALSE;
BOOL control_head_found = FALSE;
#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
SLJIT_ASSERT(common->control_head_ptr != 0);
control_head_found = TRUE;
#endif
switch (type)
{
case recurse_copy_from_global:
from_sp = TRUE;
base_reg = STACK_TOP;
break;
case recurse_copy_private_to_global:
case recurse_copy_shared_to_global:
case recurse_copy_kept_shared_to_global:
from_sp = FALSE;
base_reg = STACK_TOP;
break;
default:
SLJIT_ASSERT(type == recurse_swap_global);
from_sp = FALSE;
base_reg = TMP2;
break;
}
stackptr = STACK(stackptr);
stacktop = STACK(stacktop);
status.tmp_regs[0] = TMP1;
status.saved_tmp_regs[0] = TMP1;
if (base_reg != TMP2)
{
status.tmp_regs[1] = TMP2;
status.saved_tmp_regs[1] = TMP2;
}
else
{
status.saved_tmp_regs[1] = RETURN_ADDR;
if (HAS_VIRTUAL_REGISTERS)
status.tmp_regs[1] = STR_PTR;
else
status.tmp_regs[1] = RETURN_ADDR;
}
status.saved_tmp_regs[2] = TMP3;
if (HAS_VIRTUAL_REGISTERS)
status.tmp_regs[2] = STR_END;
else
status.tmp_regs[2] = TMP3;
delayed_mem_copy_init(&status, common);
if (type != recurse_copy_shared_to_global && type != recurse_copy_kept_shared_to_global)
{
SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_private_to_global || type == recurse_swap_global);
if (!from_sp)
delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->recursive_head_ptr);
if (from_sp || type == recurse_swap_global)
delayed_mem_copy_move(&status, SLJIT_SP, common->recursive_head_ptr, base_reg, stackptr);
}
stackptr += sizeof(sljit_sw);
#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
if (type != recurse_copy_shared_to_global)
{
if (!from_sp)
delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->control_head_ptr);
if (from_sp || type == recurse_swap_global)
delayed_mem_copy_move(&status, SLJIT_SP, common->control_head_ptr, base_reg, stackptr);
}
stackptr += sizeof(sljit_sw);
#endif
while (cc < ccend)
{
private_count = 0;
shared_count = 0;
kept_shared_count = 0;
switch(*cc)
{
case OP_SET_SOM:
SLJIT_ASSERT(common->has_set_som);
if (has_quit && !setsom_found)
{
kept_shared_srcw[0] = OVECTOR(0);
kept_shared_count = 1;
setsom_found = TRUE;
}
cc += 1;
break;
case OP_RECURSE:
if (has_quit)
{
if (common->has_set_som && !setsom_found)
{
kept_shared_srcw[0] = OVECTOR(0);
kept_shared_count = 1;
setsom_found = TRUE;
}
if (common->mark_ptr != 0 && !setmark_found)
{
kept_shared_srcw[kept_shared_count] = common->mark_ptr;
kept_shared_count++;
setmark_found = TRUE;
}
}
if (common->capture_last_ptr != 0 && !capture_last_found)
{
shared_srcw[0] = common->capture_last_ptr;
shared_count = 1;
capture_last_found = TRUE;
}
cc += 1 + LINK_SIZE;
break;
case OP_KET:
if (PRIVATE_DATA(cc) != 0)
{
private_count = 1;
private_srcw[0] = PRIVATE_DATA(cc);
SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
cc += PRIVATE_DATA(cc + 1);
}
cc += 1 + LINK_SIZE;
break;
case OP_ASSERT:
case OP_ASSERT_NOT:
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ASSERT_NA:
case OP_ASSERTBACK_NA:
case OP_ONCE:
case OP_SCRIPT_RUN:
case OP_BRAPOS:
case OP_SBRA:
case OP_SBRAPOS:
case OP_SCOND:
private_count = 1;
private_srcw[0] = PRIVATE_DATA(cc);
cc += 1 + LINK_SIZE;
break;
case OP_CBRA:
case OP_SCBRA:
offset = (GET2(cc, 1 + LINK_SIZE)) << 1;
shared_srcw[0] = OVECTOR(offset);
shared_srcw[1] = OVECTOR(offset + 1);
shared_count = 2;
if (common->capture_last_ptr != 0 && !capture_last_found)
{
shared_srcw[2] = common->capture_last_ptr;
shared_count = 3;
capture_last_found = TRUE;
}
if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
{
private_count = 1;
private_srcw[0] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
}
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
case OP_CBRAPOS:
case OP_SCBRAPOS:
offset = (GET2(cc, 1 + LINK_SIZE)) << 1;
shared_srcw[0] = OVECTOR(offset);
shared_srcw[1] = OVECTOR(offset + 1);
shared_count = 2;
if (common->capture_last_ptr != 0 && !capture_last_found)
{
shared_srcw[2] = common->capture_last_ptr;
shared_count = 3;
capture_last_found = TRUE;
}
private_count = 2;
private_srcw[0] = PRIVATE_DATA(cc);
private_srcw[1] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
case OP_COND:
/* Might be a hidden SCOND. */
alternative = cc + GET(cc, 1);
if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
{
private_count = 1;
private_srcw[0] = PRIVATE_DATA(cc);
}
cc += 1 + LINK_SIZE;
break;
CASE_ITERATOR_PRIVATE_DATA_1
if (PRIVATE_DATA(cc))
{
private_count = 1;
private_srcw[0] = PRIVATE_DATA(cc);
}
cc += 2;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
break;
CASE_ITERATOR_PRIVATE_DATA_2A
if (PRIVATE_DATA(cc))
{
private_count = 2;
private_srcw[0] = PRIVATE_DATA(cc);
private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw);
}
cc += 2;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
break;
CASE_ITERATOR_PRIVATE_DATA_2B
if (PRIVATE_DATA(cc))
{
private_count = 2;
private_srcw[0] = PRIVATE_DATA(cc);
private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw);
}
cc += 2 + IMM2_SIZE;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_1
if (PRIVATE_DATA(cc))
{
private_count = 1;
private_srcw[0] = PRIVATE_DATA(cc);
}
cc += 1;
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_2A
if (PRIVATE_DATA(cc))
{
private_count = 2;
private_srcw[0] = PRIVATE_DATA(cc);
private_srcw[1] = private_srcw[0] + sizeof(sljit_sw);
}
cc += 1;
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_2B
if (PRIVATE_DATA(cc))
{
private_count = 2;
private_srcw[0] = PRIVATE_DATA(cc);
private_srcw[1] = private_srcw[0] + sizeof(sljit_sw);
}
cc += 1 + IMM2_SIZE;
break;
case OP_CLASS:
case OP_NCLASS:
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
case OP_XCLASS:
i = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#else
i = 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#endif
if (PRIVATE_DATA(cc) != 0)
switch(get_class_iterator_size(cc + i))
{
case 1:
private_count = 1;
private_srcw[0] = PRIVATE_DATA(cc);
break;
case 2:
private_count = 2;
private_srcw[0] = PRIVATE_DATA(cc);
private_srcw[1] = private_srcw[0] + sizeof(sljit_sw);
break;
default:
SLJIT_UNREACHABLE();
break;
}
cc += i;
break;
case OP_MARK:
case OP_COMMIT_ARG:
case OP_PRUNE_ARG:
case OP_THEN_ARG:
SLJIT_ASSERT(common->mark_ptr != 0);
if (has_quit && !setmark_found)
{
kept_shared_srcw[0] = common->mark_ptr;
kept_shared_count = 1;
setmark_found = TRUE;
}
if (common->control_head_ptr != 0 && !control_head_found)
{
private_srcw[0] = common->control_head_ptr;
private_count = 1;
control_head_found = TRUE;
}
cc += 1 + 2 + cc[1];
break;
case OP_THEN:
SLJIT_ASSERT(common->control_head_ptr != 0);
if (!control_head_found)
{
private_srcw[0] = common->control_head_ptr;
private_count = 1;
control_head_found = TRUE;
}
cc++;
break;
default:
cc = next_opcode(common, cc);
SLJIT_ASSERT(cc != NULL);
break;
}
if (type != recurse_copy_shared_to_global && type != recurse_copy_kept_shared_to_global)
{
SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_private_to_global || type == recurse_swap_global);
for (i = 0; i < private_count; i++)
{
SLJIT_ASSERT(private_srcw[i] != 0);
if (!from_sp)
delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, private_srcw[i]);
if (from_sp || type == recurse_swap_global)
delayed_mem_copy_move(&status, SLJIT_SP, private_srcw[i], base_reg, stackptr);
stackptr += sizeof(sljit_sw);
}
}
else
stackptr += sizeof(sljit_sw) * private_count;
if (type != recurse_copy_private_to_global && type != recurse_copy_kept_shared_to_global)
{
SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_shared_to_global || type == recurse_swap_global);
for (i = 0; i < shared_count; i++)
{
SLJIT_ASSERT(shared_srcw[i] != 0);
if (!from_sp)
delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, shared_srcw[i]);
if (from_sp || type == recurse_swap_global)
delayed_mem_copy_move(&status, SLJIT_SP, shared_srcw[i], base_reg, stackptr);
stackptr += sizeof(sljit_sw);
}
}
else
stackptr += sizeof(sljit_sw) * shared_count;
if (type != recurse_copy_private_to_global && type != recurse_swap_global)
{
SLJIT_ASSERT(type == recurse_copy_from_global || type == recurse_copy_shared_to_global || type == recurse_copy_kept_shared_to_global);
for (i = 0; i < kept_shared_count; i++)
{
SLJIT_ASSERT(kept_shared_srcw[i] != 0);
if (!from_sp)
delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, kept_shared_srcw[i]);
if (from_sp || type == recurse_swap_global)
delayed_mem_copy_move(&status, SLJIT_SP, kept_shared_srcw[i], base_reg, stackptr);
stackptr += sizeof(sljit_sw);
}
}
else
stackptr += sizeof(sljit_sw) * kept_shared_count;
}
SLJIT_ASSERT(cc == ccend && stackptr == stacktop);
delayed_mem_copy_finish(&status);
} | 1992 | True | 1 |
|
CVE-2022-1587 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0', 'name': 'https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/', 'name': 'FEDORA-2022-e56085ba31', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077983,', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077983,', 'refsource': 'MISC', 'tags': ['Broken Link']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/', 'name': 'FEDORA-2022-a3edad0ab6', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/', 'name': 'FEDORA-2022-9c9691d058', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/', 'name': 'FEDORA-2022-19f4c34184', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pcre:pcre2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.40', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An out-of-bounds read vulnerability was discovered in the PCRE2 library in the get_recurse_data_length() function of the pcre2_jit_compile.c file. This issue affects recursions in JIT-compiled regular expressions caused by duplicate data transfers.'}] | 2022-06-02T14:15Z | 2022-05-16T21: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 | Zoltan Herczeg | 2022-03-26 07:55:50+00:00 | Fixed an issue affecting recursions in JIT | 03654e751e7f0700693526b67dfcadda6b42c9d0 | False | PCRE2Project/pcre2 | PCRE2 development is now based here. | 2021-08-20 11:18:29 | 2022-08-19 07:56:03 | PCRE2Project | 308.0 | 70.0 | get_recurse_data_length | get_recurse_data_length( compiler_common * common , PCRE2_SPTR cc , PCRE2_SPTR ccend , BOOL * needs_control_head , BOOL * has_quit , BOOL * has_accept) | ['common', 'cc', 'ccend', 'needs_control_head', 'has_quit', 'has_accept'] | static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend,
BOOL *needs_control_head, BOOL *has_quit, BOOL *has_accept)
{
int length = 1;
int size;
PCRE2_SPTR alternative;
BOOL quit_found = FALSE;
BOOL accept_found = FALSE;
BOOL setsom_found = FALSE;
BOOL setmark_found = FALSE;
BOOL capture_last_found = FALSE;
BOOL control_head_found = FALSE;
#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
SLJIT_ASSERT(common->control_head_ptr != 0);
control_head_found = TRUE;
#endif
/* Calculate the sum of the private machine words. */
while (cc < ccend)
{
size = 0;
switch(*cc)
{
case OP_SET_SOM:
SLJIT_ASSERT(common->has_set_som);
setsom_found = TRUE;
cc += 1;
break;
case OP_RECURSE:
if (common->has_set_som)
setsom_found = TRUE;
if (common->mark_ptr != 0)
setmark_found = TRUE;
if (common->capture_last_ptr != 0)
capture_last_found = TRUE;
cc += 1 + LINK_SIZE;
break;
case OP_KET:
if (PRIVATE_DATA(cc) != 0)
{
length++;
SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
cc += PRIVATE_DATA(cc + 1);
}
cc += 1 + LINK_SIZE;
break;
case OP_ASSERT:
case OP_ASSERT_NOT:
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ASSERT_NA:
case OP_ASSERTBACK_NA:
case OP_ONCE:
case OP_SCRIPT_RUN:
case OP_BRAPOS:
case OP_SBRA:
case OP_SBRAPOS:
case OP_SCOND:
length++;
SLJIT_ASSERT(PRIVATE_DATA(cc) != 0);
cc += 1 + LINK_SIZE;
break;
case OP_CBRA:
case OP_SCBRA:
length += 2;
if (common->capture_last_ptr != 0)
capture_last_found = TRUE;
if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)
length++;
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
case OP_CBRAPOS:
case OP_SCBRAPOS:
length += 2 + 2;
if (common->capture_last_ptr != 0)
capture_last_found = TRUE;
cc += 1 + LINK_SIZE + IMM2_SIZE;
break;
case OP_COND:
/* Might be a hidden SCOND. */
alternative = cc + GET(cc, 1);
if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
length++;
cc += 1 + LINK_SIZE;
break;
CASE_ITERATOR_PRIVATE_DATA_1
if (PRIVATE_DATA(cc) != 0)
length++;
cc += 2;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
break;
CASE_ITERATOR_PRIVATE_DATA_2A
if (PRIVATE_DATA(cc) != 0)
length += 2;
cc += 2;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
break;
CASE_ITERATOR_PRIVATE_DATA_2B
if (PRIVATE_DATA(cc) != 0)
length += 2;
cc += 2 + IMM2_SIZE;
#ifdef SUPPORT_UNICODE
if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
#endif
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_1
if (PRIVATE_DATA(cc) != 0)
length++;
cc += 1;
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_2A
if (PRIVATE_DATA(cc) != 0)
length += 2;
cc += 1;
break;
CASE_ITERATOR_TYPE_PRIVATE_DATA_2B
if (PRIVATE_DATA(cc) != 0)
length += 2;
cc += 1 + IMM2_SIZE;
break;
case OP_CLASS:
case OP_NCLASS:
#if defined SUPPORT_UNICODE || PCRE2_CODE_UNIT_WIDTH != 8
case OP_XCLASS:
size = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#else
size = 1 + 32 / (int)sizeof(PCRE2_UCHAR);
#endif
if (PRIVATE_DATA(cc) != 0)
length += get_class_iterator_size(cc + size);
cc += size;
break;
case OP_MARK:
case OP_COMMIT_ARG:
case OP_PRUNE_ARG:
case OP_THEN_ARG:
SLJIT_ASSERT(common->mark_ptr != 0);
if (!setmark_found)
setmark_found = TRUE;
if (common->control_head_ptr != 0)
control_head_found = TRUE;
if (*cc != OP_MARK)
quit_found = TRUE;
cc += 1 + 2 + cc[1];
break;
case OP_PRUNE:
case OP_SKIP:
case OP_COMMIT:
quit_found = TRUE;
cc++;
break;
case OP_SKIP_ARG:
quit_found = TRUE;
cc += 1 + 2 + cc[1];
break;
case OP_THEN:
SLJIT_ASSERT(common->control_head_ptr != 0);
quit_found = TRUE;
if (!control_head_found)
control_head_found = TRUE;
cc++;
break;
case OP_ACCEPT:
case OP_ASSERT_ACCEPT:
accept_found = TRUE;
cc++;
break;
default:
cc = next_opcode(common, cc);
SLJIT_ASSERT(cc != NULL);
break;
}
}
SLJIT_ASSERT(cc == ccend);
if (control_head_found)
length++;
if (capture_last_found)
length++;
if (quit_found)
{
if (setsom_found)
length++;
if (setmark_found)
length++;
}
*needs_control_head = control_head_found;
*has_quit = quit_found;
*has_accept = accept_found;
return length;
} | 894 | True | 1 |
|
CVE-2022-1587 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0', 'name': 'https://github.com/PCRE2Project/pcre2/commit/03654e751e7f0700693526b67dfcadda6b42c9d0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/M2GLQQUEY5VFM57CFYXVIFOXN2HUZPDM/', 'name': 'FEDORA-2022-e56085ba31', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077983,', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2077983,', 'refsource': 'MISC', 'tags': ['Broken Link']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KAX7767BCUFC7JMDGP7GOQ5GIZCAUGBB/', 'name': 'FEDORA-2022-a3edad0ab6', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/DWNG2NS3GINO6LQYUVC4BZLUQPJ3DYHA/', 'name': 'FEDORA-2022-9c9691d058', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JXINO3KKI5DICQ45E2FKD6MKVMGJLEKJ/', 'name': 'FEDORA-2022-19f4c34184', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pcre:pcre2:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.40', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An out-of-bounds read vulnerability was discovered in the PCRE2 library in the get_recurse_data_length() function of the pcre2_jit_compile.c file. This issue affects recursions in JIT-compiled regular expressions caused by duplicate data transfers.'}] | 2022-06-02T14:15Z | 2022-05-16T21: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 | Zoltan Herczeg | 2022-03-26 07:55:50+00:00 | Fixed an issue affecting recursions in JIT | 03654e751e7f0700693526b67dfcadda6b42c9d0 | False | PCRE2Project/pcre2 | PCRE2 development is now based here. | 2021-08-20 11:18:29 | 2022-08-19 07:56:03 | PCRE2Project | 308.0 | 70.0 | jit_compile | jit_compile( pcre2_code * code , sljit_u32 mode) | ['code', 'mode'] | static int jit_compile(pcre2_code *code, sljit_u32 mode)
{
pcre2_real_code *re = (pcre2_real_code *)code;
struct sljit_compiler *compiler;
backtrack_common rootbacktrack;
compiler_common common_data;
compiler_common *common = &common_data;
const sljit_u8 *tables = re->tables;
void *allocator_data = &re->memctl;
int private_data_size;
PCRE2_SPTR ccend;
executable_functions *functions;
void *executable_func;
sljit_uw executable_size;
sljit_uw total_length;
struct sljit_label *mainloop_label = NULL;
struct sljit_label *continue_match_label;
struct sljit_label *empty_match_found_label = NULL;
struct sljit_label *empty_match_backtrack_label = NULL;
struct sljit_label *reset_match_label;
struct sljit_label *quit_label;
struct sljit_jump *jump;
struct sljit_jump *minlength_check_failed = NULL;
struct sljit_jump *empty_match = NULL;
struct sljit_jump *end_anchor_failed = NULL;
jump_list *reqcu_not_found = NULL;
SLJIT_ASSERT(tables);
#if HAS_VIRTUAL_REGISTERS == 1
SLJIT_ASSERT(sljit_get_register_index(TMP3) < 0 && sljit_get_register_index(ARGUMENTS) < 0 && sljit_get_register_index(RETURN_ADDR) < 0);
#elif HAS_VIRTUAL_REGISTERS == 0
SLJIT_ASSERT(sljit_get_register_index(TMP3) >= 0 && sljit_get_register_index(ARGUMENTS) >= 0 && sljit_get_register_index(RETURN_ADDR) >= 0);
#else
#error "Invalid value for HAS_VIRTUAL_REGISTERS"
#endif
memset(&rootbacktrack, 0, sizeof(backtrack_common));
memset(common, 0, sizeof(compiler_common));
common->re = re;
common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code));
rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size;
#ifdef SUPPORT_UNICODE
common->invalid_utf = (mode & PCRE2_JIT_INVALID_UTF) != 0;
#endif /* SUPPORT_UNICODE */
mode &= ~PUBLIC_JIT_COMPILE_CONFIGURATION_OPTIONS;
common->start = rootbacktrack.cc;
common->read_only_data_head = NULL;
common->fcc = tables + fcc_offset;
common->lcc = (sljit_sw)(tables + lcc_offset);
common->mode = mode;
common->might_be_empty = (re->minlength == 0) || (re->flags & PCRE2_MATCH_EMPTY);
common->allow_empty_partial = (re->max_lookbehind > 0) || (re->flags & PCRE2_MATCH_EMPTY);
common->nltype = NLTYPE_FIXED;
switch(re->newline_convention)
{
case PCRE2_NEWLINE_CR: common->newline = CHAR_CR; break;
case PCRE2_NEWLINE_LF: common->newline = CHAR_NL; break;
case PCRE2_NEWLINE_CRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; break;
case PCRE2_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; break;
case PCRE2_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANYCRLF; break;
case PCRE2_NEWLINE_NUL: common->newline = CHAR_NUL; break;
default: return PCRE2_ERROR_INTERNAL;
}
common->nlmax = READ_CHAR_MAX;
common->nlmin = 0;
if (re->bsr_convention == PCRE2_BSR_UNICODE)
common->bsr_nltype = NLTYPE_ANY;
else if (re->bsr_convention == PCRE2_BSR_ANYCRLF)
common->bsr_nltype = NLTYPE_ANYCRLF;
else
{
#ifdef BSR_ANYCRLF
common->bsr_nltype = NLTYPE_ANYCRLF;
#else
common->bsr_nltype = NLTYPE_ANY;
#endif
}
common->bsr_nlmax = READ_CHAR_MAX;
common->bsr_nlmin = 0;
common->endonly = (re->overall_options & PCRE2_DOLLAR_ENDONLY) != 0;
common->ctypes = (sljit_sw)(tables + ctypes_offset);
common->name_count = re->name_count;
common->name_entry_size = re->name_entry_size;
common->unset_backref = (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) != 0;
common->alt_circumflex = (re->overall_options & PCRE2_ALT_CIRCUMFLEX) != 0;
#ifdef SUPPORT_UNICODE
/* PCRE_UTF[16|32] have the same value as PCRE_UTF8. */
common->utf = (re->overall_options & PCRE2_UTF) != 0;
common->ucp = (re->overall_options & PCRE2_UCP) != 0;
if (common->utf)
{
if (common->nltype == NLTYPE_ANY)
common->nlmax = 0x2029;
else if (common->nltype == NLTYPE_ANYCRLF)
common->nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL;
else
{
/* We only care about the first newline character. */
common->nlmax = common->newline & 0xff;
}
if (common->nltype == NLTYPE_FIXED)
common->nlmin = common->newline & 0xff;
else
common->nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL;
if (common->bsr_nltype == NLTYPE_ANY)
common->bsr_nlmax = 0x2029;
else
common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL;
common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL;
}
else
common->invalid_utf = FALSE;
#endif /* SUPPORT_UNICODE */
ccend = bracketend(common->start);
/* Calculate the local space size on the stack. */
common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw);
common->optimized_cbracket = (sljit_u8 *)SLJIT_MALLOC(re->top_bracket + 1, allocator_data);
if (!common->optimized_cbracket)
return PCRE2_ERROR_NOMEMORY;
#if defined DEBUG_FORCE_UNOPTIMIZED_CBRAS && DEBUG_FORCE_UNOPTIMIZED_CBRAS == 1
memset(common->optimized_cbracket, 0, re->top_bracket + 1);
#else
memset(common->optimized_cbracket, 1, re->top_bracket + 1);
#endif
SLJIT_ASSERT(*common->start == OP_BRA && ccend[-(1 + LINK_SIZE)] == OP_KET);
#if defined DEBUG_FORCE_UNOPTIMIZED_CBRAS && DEBUG_FORCE_UNOPTIMIZED_CBRAS == 2
common->capture_last_ptr = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
#endif
if (!check_opcode_types(common, common->start, ccend))
{
SLJIT_FREE(common->optimized_cbracket, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
/* Checking flags and updating ovector_start. */
if (mode == PCRE2_JIT_COMPLETE && (re->flags & PCRE2_LASTSET) != 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
{
common->req_char_ptr = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
}
if (mode != PCRE2_JIT_COMPLETE)
{
common->start_used_ptr = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
if (mode == PCRE2_JIT_PARTIAL_SOFT)
{
common->hit_start = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
}
}
if ((re->overall_options & (PCRE2_FIRSTLINE | PCRE2_USE_OFFSET_LIMIT)) != 0)
{
common->match_end_ptr = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
}
#if defined DEBUG_FORCE_CONTROL_HEAD && DEBUG_FORCE_CONTROL_HEAD
common->control_head_ptr = 1;
#endif
if (common->control_head_ptr != 0)
{
common->control_head_ptr = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
}
if (common->has_set_som)
{
/* Saving the real start pointer is necessary. */
common->start_ptr = common->ovector_start;
common->ovector_start += sizeof(sljit_sw);
}
/* Aligning ovector to even number of sljit words. */
if ((common->ovector_start & sizeof(sljit_sw)) != 0)
common->ovector_start += sizeof(sljit_sw);
if (common->start_ptr == 0)
common->start_ptr = OVECTOR(0);
/* Capturing brackets cannot be optimized if callouts are allowed. */
if (common->capture_last_ptr != 0)
memset(common->optimized_cbracket, 0, re->top_bracket + 1);
SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0));
common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw);
total_length = ccend - common->start;
common->private_data_ptrs = (sljit_s32 *)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->has_then ? 1 : 0)), allocator_data);
if (!common->private_data_ptrs)
{
SLJIT_FREE(common->optimized_cbracket, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32));
private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw);
if ((re->overall_options & PCRE2_ANCHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && !common->has_skip_in_assert_back)
detect_early_fail(common, common->start, &private_data_size, 0, 0, TRUE);
set_private_data_ptrs(common, &private_data_size, ccend);
SLJIT_ASSERT(common->early_fail_start_ptr <= common->early_fail_end_ptr);
if (private_data_size > SLJIT_MAX_LOCAL_SIZE)
{
SLJIT_FREE(common->private_data_ptrs, allocator_data);
SLJIT_FREE(common->optimized_cbracket, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
if (common->has_then)
{
common->then_offsets = (sljit_u8 *)(common->private_data_ptrs + total_length);
memset(common->then_offsets, 0, total_length);
set_then_offsets(common, common->start, NULL);
}
compiler = sljit_create_compiler(allocator_data, NULL);
if (!compiler)
{
SLJIT_FREE(common->optimized_cbracket, allocator_data);
SLJIT_FREE(common->private_data_ptrs, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
common->compiler = compiler;
/* Main pcre2_jit_exec entry. */
sljit_emit_enter(compiler, 0, SLJIT_ARGS1(W, W), 5, 5, 0, 0, private_data_size);
/* Register init. */
reset_ovector(common, (re->top_bracket + 1) * 2);
if (common->req_char_ptr != 0)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, SLJIT_R0, 0);
OP1(SLJIT_MOV, ARGUMENTS, 0, SLJIT_S0, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_S0, 0);
OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, end));
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, stack));
OP1(SLJIT_MOV_U32, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, limit_match));
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(struct sljit_stack, end));
OP1(SLJIT_MOV, STACK_LIMIT, 0, SLJIT_MEM1(TMP2), SLJIT_OFFSETOF(struct sljit_stack, start));
OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LIMIT_MATCH, TMP1, 0);
if (common->early_fail_start_ptr < common->early_fail_end_ptr)
reset_early_fail(common);
if (mode == PCRE2_JIT_PARTIAL_SOFT)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1);
if (common->mark_ptr != 0)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0);
if (common->control_head_ptr != 0)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0);
/* Main part of the matching */
if ((re->overall_options & PCRE2_ANCHORED) == 0)
{
mainloop_label = mainloop_entry(common);
continue_match_label = LABEL();
/* Forward search if possible. */
if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
{
if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common))
;
else if ((re->flags & PCRE2_FIRSTSET) != 0)
fast_forward_first_char(common);
else if ((re->flags & PCRE2_STARTLINE) != 0)
fast_forward_newline(common);
else if ((re->flags & PCRE2_FIRSTMAPSET) != 0)
fast_forward_start_bits(common);
}
}
else
continue_match_label = LABEL();
if (mode == PCRE2_JIT_COMPLETE && re->minlength > 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0)
{
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
OP2(SLJIT_ADD, TMP2, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(re->minlength));
minlength_check_failed = CMP(SLJIT_GREATER, TMP2, 0, STR_END, 0);
}
if (common->req_char_ptr != 0)
reqcu_not_found = search_requested_char(common, (PCRE2_UCHAR)(re->last_codeunit), (re->flags & PCRE2_LASTCASELESS) != 0, (re->flags & PCRE2_FIRSTSET) != 0);
/* Store the current STR_PTR in OVECTOR(0). */
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), STR_PTR, 0);
/* Copy the limit of allowed recursions. */
OP1(SLJIT_MOV, COUNT_MATCH, 0, SLJIT_MEM1(SLJIT_SP), LIMIT_MATCH);
if (common->capture_last_ptr != 0)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, 0);
if (common->fast_forward_bc_ptr != NULL)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1) >> 3, STR_PTR, 0);
if (common->start_ptr != OVECTOR(0))
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0);
/* Copy the beginning of the string. */
if (mode == PCRE2_JIT_PARTIAL_SOFT)
{
jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0);
JUMPHERE(jump);
}
else if (mode == PCRE2_JIT_PARTIAL_HARD)
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0);
compile_matchingpath(common, common->start, ccend, &rootbacktrack);
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
{
sljit_free_compiler(compiler);
SLJIT_FREE(common->optimized_cbracket, allocator_data);
SLJIT_FREE(common->private_data_ptrs, allocator_data);
PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
if ((re->overall_options & PCRE2_ENDANCHORED) != 0)
end_anchor_failed = CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0);
if (common->might_be_empty)
{
empty_match = CMP(SLJIT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0));
empty_match_found_label = LABEL();
}
common->accept_label = LABEL();
if (common->accept != NULL)
set_jumps(common->accept, common->accept_label);
/* This means we have a match. Update the ovector. */
copy_ovector(common, re->top_bracket + 1);
common->quit_label = common->abort_label = LABEL();
if (common->quit != NULL)
set_jumps(common->quit, common->quit_label);
if (common->abort != NULL)
set_jumps(common->abort, common->abort_label);
if (minlength_check_failed != NULL)
SET_LABEL(minlength_check_failed, common->abort_label);
sljit_emit_op0(compiler, SLJIT_SKIP_FRAMES_BEFORE_RETURN);
sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);
if (common->failed_match != NULL)
{
SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE);
set_jumps(common->failed_match, LABEL());
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
JUMPTO(SLJIT_JUMP, common->abort_label);
}
if ((re->overall_options & PCRE2_ENDANCHORED) != 0)
JUMPHERE(end_anchor_failed);
if (mode != PCRE2_JIT_COMPLETE)
{
common->partialmatchlabel = LABEL();
set_jumps(common->partialmatch, common->partialmatchlabel);
return_with_partial_match(common, common->quit_label);
}
if (common->might_be_empty)
empty_match_backtrack_label = LABEL();
compile_backtrackingpath(common, rootbacktrack.top);
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
{
sljit_free_compiler(compiler);
SLJIT_FREE(common->optimized_cbracket, allocator_data);
SLJIT_FREE(common->private_data_ptrs, allocator_data);
PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
SLJIT_ASSERT(rootbacktrack.prev == NULL);
reset_match_label = LABEL();
if (mode == PCRE2_JIT_PARTIAL_SOFT)
{
/* Update hit_start only in the first time. */
jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, TMP1, 0);
JUMPHERE(jump);
}
/* Check we have remaining characters. */
if ((re->overall_options & PCRE2_ANCHORED) == 0 && common->match_end_ptr != 0)
{
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr);
}
OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP),
(common->fast_forward_bc_ptr != NULL) ? (PRIVATE_DATA(common->fast_forward_bc_ptr + 1) >> 3) : common->start_ptr);
if ((re->overall_options & PCRE2_ANCHORED) == 0)
{
if (common->ff_newline_shortcut != NULL)
{
/* There cannot be more newlines if PCRE2_FIRSTLINE is set. */
if ((re->overall_options & PCRE2_FIRSTLINE) == 0)
{
if (common->match_end_ptr != 0)
{
OP1(SLJIT_MOV, TMP3, 0, STR_END, 0);
OP1(SLJIT_MOV, STR_END, 0, TMP1, 0);
CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, common->ff_newline_shortcut);
OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
}
else
CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut);
}
}
else
CMPTO(SLJIT_LESS, STR_PTR, 0, (common->match_end_ptr == 0) ? STR_END : TMP1, 0, mainloop_label);
}
/* No more remaining characters. */
if (reqcu_not_found != NULL)
set_jumps(reqcu_not_found, LABEL());
if (mode == PCRE2_JIT_PARTIAL_SOFT)
CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1, common->partialmatchlabel);
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH);
JUMPTO(SLJIT_JUMP, common->quit_label);
flush_stubs(common);
if (common->might_be_empty)
{
JUMPHERE(empty_match);
OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
OP1(SLJIT_MOV_U32, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, options));
OP2U(SLJIT_AND | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY);
JUMPTO(SLJIT_NOT_ZERO, empty_match_backtrack_label);
OP2U(SLJIT_AND | SLJIT_SET_Z, TMP2, 0, SLJIT_IMM, PCRE2_NOTEMPTY_ATSTART);
JUMPTO(SLJIT_ZERO, empty_match_found_label);
OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, str));
CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, empty_match_found_label);
JUMPTO(SLJIT_JUMP, empty_match_backtrack_label);
}
common->fast_forward_bc_ptr = NULL;
common->early_fail_start_ptr = 0;
common->early_fail_end_ptr = 0;
common->currententry = common->entries;
common->local_quit_available = TRUE;
quit_label = common->quit_label;
while (common->currententry != NULL)
{
/* Might add new entries. */
compile_recurse(common);
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
{
sljit_free_compiler(compiler);
SLJIT_FREE(common->optimized_cbracket, allocator_data);
SLJIT_FREE(common->private_data_ptrs, allocator_data);
PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
flush_stubs(common);
common->currententry = common->currententry->next;
}
common->local_quit_available = FALSE;
common->quit_label = quit_label;
/* Allocating stack, returns with PCRE_ERROR_JIT_STACKLIMIT if fails. */
/* This is a (really) rare case. */
set_jumps(common->stackalloc, LABEL());
/* RETURN_ADDR is not a saved register. */
sljit_emit_fast_enter(compiler, SLJIT_MEM1(SLJIT_SP), LOCALS0);
SLJIT_ASSERT(TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1);
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), LOCALS1, STR_PTR, 0);
OP1(SLJIT_MOV, SLJIT_R0, 0, ARGUMENTS, 0);
OP2(SLJIT_SUB, SLJIT_R1, 0, STACK_LIMIT, 0, SLJIT_IMM, STACK_GROWTH_RATE);
OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_R0), SLJIT_OFFSETOF(jit_arguments, stack));
OP1(SLJIT_MOV, STACK_LIMIT, 0, TMP2, 0);
sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARGS2(W, W, W), SLJIT_IMM, SLJIT_FUNC_ADDR(sljit_stack_resize));
jump = CMP(SLJIT_EQUAL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 0);
OP1(SLJIT_MOV, TMP2, 0, STACK_LIMIT, 0);
OP1(SLJIT_MOV, STACK_LIMIT, 0, SLJIT_RETURN_REG, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), LOCALS0);
OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), LOCALS1);
OP_SRC(SLJIT_FAST_RETURN, TMP1, 0);
/* Allocation failed. */
JUMPHERE(jump);
/* We break the return address cache here, but this is a really rare case. */
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_JIT_STACKLIMIT);
JUMPTO(SLJIT_JUMP, common->quit_label);
/* Call limit reached. */
set_jumps(common->calllimit, LABEL());
OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_MATCHLIMIT);
JUMPTO(SLJIT_JUMP, common->quit_label);
if (common->revertframes != NULL)
{
set_jumps(common->revertframes, LABEL());
do_revertframes(common);
}
if (common->wordboundary != NULL)
{
set_jumps(common->wordboundary, LABEL());
check_wordboundary(common);
}
if (common->anynewline != NULL)
{
set_jumps(common->anynewline, LABEL());
check_anynewline(common);
}
if (common->hspace != NULL)
{
set_jumps(common->hspace, LABEL());
check_hspace(common);
}
if (common->vspace != NULL)
{
set_jumps(common->vspace, LABEL());
check_vspace(common);
}
if (common->casefulcmp != NULL)
{
set_jumps(common->casefulcmp, LABEL());
do_casefulcmp(common);
}
if (common->caselesscmp != NULL)
{
set_jumps(common->caselesscmp, LABEL());
do_caselesscmp(common);
}
if (common->reset_match != NULL)
{
set_jumps(common->reset_match, LABEL());
do_reset_match(common, (re->top_bracket + 1) * 2);
CMPTO(SLJIT_GREATER, STR_PTR, 0, TMP1, 0, continue_match_label);
OP1(SLJIT_MOV, STR_PTR, 0, TMP1, 0);
JUMPTO(SLJIT_JUMP, reset_match_label);
}
#ifdef SUPPORT_UNICODE
#if PCRE2_CODE_UNIT_WIDTH == 8
if (common->utfreadchar != NULL)
{
set_jumps(common->utfreadchar, LABEL());
do_utfreadchar(common);
}
if (common->utfreadtype8 != NULL)
{
set_jumps(common->utfreadtype8, LABEL());
do_utfreadtype8(common);
}
if (common->utfpeakcharback != NULL)
{
set_jumps(common->utfpeakcharback, LABEL());
do_utfpeakcharback(common);
}
#endif /* PCRE2_CODE_UNIT_WIDTH == 8 */
#if PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16
if (common->utfreadchar_invalid != NULL)
{
set_jumps(common->utfreadchar_invalid, LABEL());
do_utfreadchar_invalid(common);
}
if (common->utfreadnewline_invalid != NULL)
{
set_jumps(common->utfreadnewline_invalid, LABEL());
do_utfreadnewline_invalid(common);
}
if (common->utfmoveback_invalid)
{
set_jumps(common->utfmoveback_invalid, LABEL());
do_utfmoveback_invalid(common);
}
if (common->utfpeakcharback_invalid)
{
set_jumps(common->utfpeakcharback_invalid, LABEL());
do_utfpeakcharback_invalid(common);
}
#endif /* PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16 */
if (common->getucd != NULL)
{
set_jumps(common->getucd, LABEL());
do_getucd(common);
}
if (common->getucdtype != NULL)
{
set_jumps(common->getucdtype, LABEL());
do_getucdtype(common);
}
#endif /* SUPPORT_UNICODE */
SLJIT_FREE(common->optimized_cbracket, allocator_data);
SLJIT_FREE(common->private_data_ptrs, allocator_data);
executable_func = sljit_generate_code(compiler);
executable_size = sljit_get_generated_code_size(compiler);
sljit_free_compiler(compiler);
if (executable_func == NULL)
{
PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
/* Reuse the function descriptor if possible. */
if (re->executable_jit != NULL)
functions = (executable_functions *)re->executable_jit;
else
{
functions = SLJIT_MALLOC(sizeof(executable_functions), allocator_data);
if (functions == NULL)
{
/* This case is highly unlikely since we just recently
freed a lot of memory. Not impossible though. */
sljit_free_code(executable_func, NULL);
PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data);
return PCRE2_ERROR_NOMEMORY;
}
memset(functions, 0, sizeof(executable_functions));
functions->top_bracket = re->top_bracket + 1;
functions->limit_match = re->limit_match;
re->executable_jit = functions;
}
/* Turn mode into an index. */
if (mode == PCRE2_JIT_COMPLETE)
mode = 0;
else
mode = (mode == PCRE2_JIT_PARTIAL_SOFT) ? 1 : 2;
SLJIT_ASSERT(mode < JIT_NUMBER_OF_COMPILE_MODES);
functions->executable_funcs[mode] = executable_func;
functions->read_only_data_heads[mode] = common->read_only_data_head;
functions->executable_sizes[mode] = executable_size;
return 0;
} | 4352 | True | 1 |
|
CVE-2022-21144 | 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://snyk.io/vuln/SNYK-JS-LIBXMLJS-2348756', 'name': 'https://snyk.io/vuln/SNYK-JS-LIBXMLJS-2348756', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libxmljs/libxmljs/commit/2501807bde9b38cfaed06d1e140487516d91379d', 'name': 'https://github.com/libxmljs/libxmljs/commit/2501807bde9b38cfaed06d1e140487516d91379d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libxmljs/libxmljs/pull/594', 'name': 'https://github.com/libxmljs/libxmljs/pull/594', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libxmljs_project:libxmljs:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '0.19.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "This affects all versions of package libxmljs. When invoking the libxmljs.parseXml function with a non-buffer argument the V8 code will attempt invoking the .toString method of the argument. If the argument's toString value is not a Function object V8 will crash."}] | 2022-07-18T17:41Z | 2022-05-01T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | rchipka | 2022-03-30 11:48:41-04:00 | Ensure parseXml/parseHtml input is string or buffer (#594) | 2501807bde9b38cfaed06d1e140487516d91379d | False | libxmljs/libxmljs | libxml bindings for v8 javascript engine | 2010-03-17 03:08:06 | 2022-06-21 16:12:35 | https://github.com/libxmljs/libxmljs/wiki | libxmljs | 999.0 | 241.0 | libxmljs::NAN_METHOD | libxmljs::NAN_METHOD( XmlDocument :: FromHtml) | ['FromHtml'] | NAN_METHOD(XmlDocument::FromHtml)
{
Nan::HandleScope scope;
v8::Local<v8::Object> options = Nan::To<v8::Object>(info[1]).ToLocalChecked();
v8::Local<v8::Value> baseUrlOpt = Nan::Get(options,
Nan::New<v8::String>("baseUrl").ToLocalChecked()).ToLocalChecked();
v8::Local<v8::Value> encodingOpt = Nan::Get(options,
Nan::New<v8::String>("encoding").ToLocalChecked()).ToLocalChecked();
v8::Local<v8::Value> excludeImpliedElementsOpt = Nan::Get(options,
Nan::New<v8::String>("excludeImpliedElements").ToLocalChecked()).ToLocalChecked();
// the base URL that will be used for this HTML parsed document
Nan::Utf8String baseUrl_(Nan::To<v8::String>(baseUrlOpt).ToLocalChecked());
const char * baseUrl = *baseUrl_;
if (!baseUrlOpt->IsString()) {
baseUrl = NULL;
}
// the encoding to be used for this document
// (leave NULL for libxml to autodetect)
Nan::Utf8String encoding_(Nan::To<v8::String>(encodingOpt).ToLocalChecked());
const char * encoding = *encoding_;
if (!encodingOpt->IsString()) {
encoding = NULL;
}
v8::Local<v8::Array> errors = Nan::New<v8::Array>();
xmlResetLastError();
xmlSetStructuredErrorFunc(reinterpret_cast<void*>(&errors), XmlSyntaxError::PushToArray);
int opts = (int)getParserOptions(options);
if (Nan::To<v8::Boolean>(excludeImpliedElementsOpt).ToLocalChecked()->Value())
opts |= HTML_PARSE_NOIMPLIED | HTML_PARSE_NODEFDTD;
htmlDocPtr doc;
if (!node::Buffer::HasInstance(info[0])) {
// Parse a string
Nan::Utf8String str(Nan::To<v8::String>(info[0]).ToLocalChecked());
doc = htmlReadMemory(*str, str.length(), baseUrl, encoding, opts);
}
else {
// Parse a buffer
v8::Local<v8::Object> buf = Nan::To<v8::Object>(info[0]).ToLocalChecked();
doc = htmlReadMemory(node::Buffer::Data(buf), node::Buffer::Length(buf),
baseUrl, encoding, opts);
}
xmlSetStructuredErrorFunc(NULL, NULL);
if (!doc) {
xmlError* error = xmlGetLastError();
if (error) {
return Nan::ThrowError(XmlSyntaxError::BuildSyntaxError(error));
}
return Nan::ThrowError("Could not parse XML string");
}
v8::Local<v8::Object> doc_handle = XmlDocument::New(doc);
Nan::Set(doc_handle, Nan::New<v8::String>("errors").ToLocalChecked(), errors);
// create the xml document handle to return
return info.GetReturnValue().Set(doc_handle);
} | 553 | True | 1 |
CVE-2022-21144 | 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://snyk.io/vuln/SNYK-JS-LIBXMLJS-2348756', 'name': 'https://snyk.io/vuln/SNYK-JS-LIBXMLJS-2348756', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libxmljs/libxmljs/commit/2501807bde9b38cfaed06d1e140487516d91379d', 'name': 'https://github.com/libxmljs/libxmljs/commit/2501807bde9b38cfaed06d1e140487516d91379d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libxmljs/libxmljs/pull/594', 'name': 'https://github.com/libxmljs/libxmljs/pull/594', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libxmljs_project:libxmljs:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '0.19.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "This affects all versions of package libxmljs. When invoking the libxmljs.parseXml function with a non-buffer argument the V8 code will attempt invoking the .toString method of the argument. If the argument's toString value is not a Function object V8 will crash."}] | 2022-07-18T17:41Z | 2022-05-01T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | rchipka | 2022-03-30 11:48:41-04:00 | Ensure parseXml/parseHtml input is string or buffer (#594) | 2501807bde9b38cfaed06d1e140487516d91379d | False | libxmljs/libxmljs | libxml bindings for v8 javascript engine | 2010-03-17 03:08:06 | 2022-06-21 16:12:35 | https://github.com/libxmljs/libxmljs/wiki | libxmljs | 999.0 | 241.0 | libxmljs::NAN_METHOD | libxmljs::NAN_METHOD( XmlDocument :: FromXml) | ['FromXml'] | NAN_METHOD(XmlDocument::FromXml)
{
Nan::HandleScope scope;
v8::Local<v8::Array> errors = Nan::New<v8::Array>();
xmlResetLastError();
xmlSetStructuredErrorFunc(reinterpret_cast<void *>(&errors),
XmlSyntaxError::PushToArray);
v8::Local<v8::Object> options = Nan::To<v8::Object>(info[1]).ToLocalChecked();
v8::Local<v8::Value> baseUrlOpt = Nan::Get(options,
Nan::New<v8::String>("baseUrl").ToLocalChecked()).ToLocalChecked();
v8::Local<v8::Value> encodingOpt = Nan::Get(options,
Nan::New<v8::String>("encoding").ToLocalChecked()).ToLocalChecked();
// the base URL that will be used for this document
Nan::Utf8String baseUrl_(Nan::To<v8::String>(baseUrlOpt).ToLocalChecked());
const char * baseUrl = *baseUrl_;
if (!baseUrlOpt->IsString()) {
baseUrl = NULL;
}
// the encoding to be used for this document
// (leave NULL for libxml to autodetect)
Nan::Utf8String encoding_(Nan::To<v8::String>(encodingOpt).ToLocalChecked());
const char * encoding = *encoding_;
if (!encodingOpt->IsString()) {
encoding = NULL;
}
int opts = (int) getParserOptions(options);
xmlDocPtr doc;
if (!node::Buffer::HasInstance(info[0])) {
// Parse a string
Nan::Utf8String str(Nan::To<v8::String>(info[0]).ToLocalChecked());
doc = xmlReadMemory(*str, str.length(), baseUrl, "UTF-8", opts);
}
else {
// Parse a buffer
v8::Local<v8::Object> buf = Nan::To<v8::Object>(info[0]).ToLocalChecked();
doc = xmlReadMemory(node::Buffer::Data(buf), node::Buffer::Length(buf),
baseUrl, encoding, opts);
}
xmlSetStructuredErrorFunc(NULL, NULL);
if (!doc) {
xmlError* error = xmlGetLastError();
if (error) {
return Nan::ThrowError(XmlSyntaxError::BuildSyntaxError(error));
}
return Nan::ThrowError("Could not parse XML string");
}
v8::Local<v8::Object> doc_handle = XmlDocument::New(doc);
Nan::Set(doc_handle, Nan::New<v8::String>("errors").ToLocalChecked(), errors);
xmlNode* root_node = xmlDocGetRootElement(doc);
if (root_node == NULL) {
return Nan::ThrowError("parsed document has no root element");
}
// create the xml document handle to return
return info.GetReturnValue().Set(doc_handle);
} | 513 | True | 1 |
CVE-2022-21227 | 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://snyk.io/vuln/SNYK-JS-SQLITE3-2388645', 'name': 'https://snyk.io/vuln/SNYK-JS-SQLITE3-2388645', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/TryGhost/node-sqlite3/commit/593c9d498be2510d286349134537e3bf89401c4a', 'name': 'https://github.com/TryGhost/node-sqlite3/commit/593c9d498be2510d286349134537e3bf89401c4a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2805470', 'name': 'https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2805470', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ghost:sqlite3:*:*:*:*:*:node.js:*:*', 'versionEndExcluding': '5.0.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The package sqlite3 before 5.0.3 are vulnerable to Denial of Service (DoS) which will invoke the toString function of the passed parameter. If passed an invalid Function object it will throw and crash the V8 engine.'}] | 2022-05-11T14:10Z | 2022-05-01T16: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 | Kewde | 2021-03-09 22:54:46+00:00 | bug: fix segfault of invalid toString() object (#1450)
* bug: verify toString() returns valid data
* test: faulty toString test | 593c9d498be2510d286349134537e3bf89401c4a | False | TryGhost/node-sqlite3 | SQLite3 bindings for Node.js | 2011-02-14 21:50:01 | 2022-08-27 01:23:36 | TryGhost | 5435.0 | 742.0 | Statement::BindParameter | Statement::BindParameter( const Napi :: Value source , T pos) | ['source', 'pos'] | Statement::BindParameter(const Napi::Value source, T pos) {
if (source.IsString()) {
std::string val = source.As<Napi::String>().Utf8Value();
return new Values::Text(pos, val.length(), val.c_str());
}
else if (OtherInstanceOf(source.As<Object>(), "RegExp")) {
std::string val = source.ToString().Utf8Value();
return new Values::Text(pos, val.length(), val.c_str());
}
else if (source.IsNumber()) {
if (OtherIsInt(source.As<Napi::Number>())) {
return new Values::Integer(pos, source.As<Napi::Number>().Int32Value());
} else {
return new Values::Float(pos, source.As<Napi::Number>().DoubleValue());
}
}
else if (source.IsBoolean()) {
return new Values::Integer(pos, source.As<Napi::Boolean>().Value() ? 1 : 0);
}
else if (source.IsNull()) {
return new Values::Null(pos);
}
else if (source.IsBuffer()) {
Napi::Buffer<char> buffer = source.As<Napi::Buffer<char>>();
return new Values::Blob(pos, buffer.Length(), buffer.Data());
}
else if (OtherInstanceOf(source.As<Object>(), "Date")) {
return new Values::Float(pos, source.ToNumber().DoubleValue());
}
else if (source.IsObject()) {
std::string val = source.ToString().Utf8Value();
return new Values::Text(pos, val.length(), val.c_str());
}
else {
return NULL;
}
} | 405 | True | 1 |
|
CVE-2022-21504 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:N/A:P | LOCAL | LOW | NONE | NONE | NONE | PARTIAL | 2.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/oracle/linux-uek/commit/49c68f5f892d8c2be00e0a89ff2a035422c03b59', 'name': 'https://github.com/oracle/linux-uek/commit/49c68f5f892d8c2be00e0a89ff2a035422c03b59', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:oracle:linux:7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:oracle:linux:8:-:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The code in UEK6 U3 was missing an appropiate file descriptor count to be missing. This resulted in a use count error that allowed a file descriptor to a socket to be closed and freed while it was still in use by another portion of the kernel. An attack with local access can operate on the socket, and cause a denial of service. CVSS 3.1 Base Score 6.2 (Availability impacts). CVSS Vector: (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).'}] | 2022-06-24T18:13Z | 2022-06-14T18:15Z | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. |
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for freeing the memory.
In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.
| https://cwe.mitre.org/data/definitions/416.html | 0 | Jens Axboe | 2019-12-11 14:10:35-07:00 | fs: move filp_close() outside of __close_fd_get_file()
Just one caller of this, and just use filp_close() there manually.
This is important to allow async close/removal of the fd.
Signed-off-by: Jens Axboe <[email protected]>
(cherry picked from commit 6e802a4ba056a6f2f51ac9d54eead3ed6f9829a2)
Conflicts:
drivers/android/binder.c: no real conflict but code base difference
Orabug: 33413846
Signed-off-by: Prasad Singamsetty <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Brian Maly <[email protected]> | 49c68f5f892d8c2be00e0a89ff2a035422c03b59 | False | oracle/linux-uek | Oracle Linux UEK: Unbreakable Enterprise Kernel | 2018-01-13 05:00:58 | 2022-08-26 16:02:19 | https://blogs.oracle.com/linuxkernel | oracle | 231.0 | 63.0 | binder_deferred_fd_close | binder_deferred_fd_close( int fd) | ['fd'] | static void binder_deferred_fd_close(int fd)
{
struct binder_task_work_cb *twcb;
twcb = kzalloc(sizeof(*twcb), GFP_KERNEL);
if (!twcb)
return;
init_task_work(&twcb->twork, binder_do_fd_close);
__close_fd_get_file(fd, &twcb->file);
if (twcb->file)
task_work_add(current, &twcb->twork, TWA_RESUME);
else
kfree(twcb);
} | 76 | True | 1 |
CVE-2022-21504 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:N/A:P | LOCAL | LOW | NONE | NONE | NONE | PARTIAL | 2.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/oracle/linux-uek/commit/49c68f5f892d8c2be00e0a89ff2a035422c03b59', 'name': 'https://github.com/oracle/linux-uek/commit/49c68f5f892d8c2be00e0a89ff2a035422c03b59', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:oracle:linux:7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:oracle:linux:8:-:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The code in UEK6 U3 was missing an appropiate file descriptor count to be missing. This resulted in a use count error that allowed a file descriptor to a socket to be closed and freed while it was still in use by another portion of the kernel. An attack with local access can operate on the socket, and cause a denial of service. CVSS 3.1 Base Score 6.2 (Availability impacts). CVSS Vector: (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).'}] | 2022-06-24T18:13Z | 2022-06-14T18:15Z | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. |
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for freeing the memory.
In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.
| https://cwe.mitre.org/data/definitions/416.html | 0 | Jens Axboe | 2019-12-11 14:10:35-07:00 | fs: move filp_close() outside of __close_fd_get_file()
Just one caller of this, and just use filp_close() there manually.
This is important to allow async close/removal of the fd.
Signed-off-by: Jens Axboe <[email protected]>
(cherry picked from commit 6e802a4ba056a6f2f51ac9d54eead3ed6f9829a2)
Conflicts:
drivers/android/binder.c: no real conflict but code base difference
Orabug: 33413846
Signed-off-by: Prasad Singamsetty <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Brian Maly <[email protected]> | 49c68f5f892d8c2be00e0a89ff2a035422c03b59 | False | oracle/linux-uek | Oracle Linux UEK: Unbreakable Enterprise Kernel | 2018-01-13 05:00:58 | 2022-08-26 16:02:19 | https://blogs.oracle.com/linuxkernel | oracle | 231.0 | 63.0 | __close_fd_get_file | __close_fd_get_file( unsigned int fd , struct file ** res) | ['fd', 'res'] | int __close_fd_get_file(unsigned int fd, struct file **res)
{
struct files_struct *files = current->files;
struct file *file;
struct fdtable *fdt;
spin_lock(&files->file_lock);
fdt = files_fdtable(files);
if (fd >= fdt->max_fds)
goto out_unlock;
file = fdt->fd[fd];
if (!file)
goto out_unlock;
rcu_assign_pointer(fdt->fd[fd], NULL);
__put_unused_fd(files, fd);
spin_unlock(&files->file_lock);
get_file(file);
*res = file;
return filp_close(file, files);
out_unlock:
spin_unlock(&files->file_lock);
*res = NULL;
return -ENOENT;
} | 139 | True | 1 |
CVE-2022-23645 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:N/A:P | LOCAL | LOW | NONE | NONE | NONE | PARTIAL | 2.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/stefanberger/swtpm/security/advisories/GHSA-2qgm-8xf4-3hqw', 'name': 'https://github.com/stefanberger/swtpm/security/advisories/GHSA-2qgm-8xf4-3hqw', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/stefanberger/swtpm/commit/9f740868fc36761de27df3935513bdebf8852d19', 'name': 'https://github.com/stefanberger/swtpm/commit/9f740868fc36761de27df3935513bdebf8852d19', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/stefanberger/swtpm/releases/tag/v0.5.3', 'name': 'https://github.com/stefanberger/swtpm/releases/tag/v0.5.3', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/stefanberger/swtpm/releases/tag/v0.6.2', 'name': 'https://github.com/stefanberger/swtpm/releases/tag/v0.6.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/stefanberger/swtpm/releases/tag/v0.7.1', 'name': 'https://github.com/stefanberger/swtpm/releases/tag/v0.7.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/WL735FW266GO4C2JX4CJBOIOB7R7AY5A/', 'name': 'FEDORA-2022-12443a525c', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swtpm_project:swtpm:0.7.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swtpm_project:swtpm:0.7.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swtpm_project:swtpm:0.7.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swtpm_project:swtpm:*:*:*:*:*:*:*:*', 'versionStartIncluding': '0.6.0', 'versionEndExcluding': '0.6.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swtpm_project:swtpm:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.5.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "swtpm is a libtpms-based TPM emulator with socket, character device, and Linux CUSE interface. Versions prior to 0.5.3, 0.6.2, and 0.7.1 are vulnerable to out-of-bounds read. A specially crafted header of swtpm's state, where the blobheader's hdrsize indicator has an invalid value, may cause an out-of-bounds access when the byte array representing the state of the TPM is accessed. This will likely crash swtpm or prevent it from starting since the state cannot be understood. Users should upgrade to swtpm v0.5.3, v0.6.2, or v0.7.1 to receive a patch. There are currently no known workarounds."}] | 2022-03-07T13:49Z | 2022-02-18T21: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 | Stefan Berger | 2022-02-16 11:17:47-05:00 | swtpm: Check header size indicator against expected size (CID 375869)
This fix addresses Coverity issue CID 375869.
Check the header size indicated in the header of the state against the
expected size and return an error code in case the header size indicator
is different. There was only one header size so far since blobheader was
introduced, so we don't need to deal with different sizes.
Without this fix a specially craft header could have cause out-of-bounds
accesses on the byte array containing the swtpm's state.
Signed-off-by: Stefan Berger <[email protected]> | 9f740868fc36761de27df3935513bdebf8852d19 | False | stefanberger/swtpm | Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface. | 2014-07-24 01:10:58 | 2022-08-26 18:41:40 | stefanberger | 347.0 | 104.0 | SWTPM_NVRAM_CheckHeader | SWTPM_NVRAM_CheckHeader( unsigned char * data , uint32_t length , uint32_t * dataoffset , uint16_t * hdrflags , uint8_t * hdrversion , bool quiet) | ['data', 'length', 'dataoffset', 'hdrflags', 'hdrversion', 'quiet'] | SWTPM_NVRAM_CheckHeader(unsigned char *data, uint32_t length,
uint32_t *dataoffset, uint16_t *hdrflags,
uint8_t *hdrversion, bool quiet)
{
blobheader *bh = (blobheader *)data;
if (length < sizeof(bh)) {
if (!quiet)
logprintf(STDERR_FILENO,
"not enough bytes for header: %u\n", length);
return TPM_BAD_PARAMETER;
}
if (ntohl(bh->totlen) != length) {
if (!quiet)
logprintf(STDERR_FILENO,
"broken header: bh->totlen %u != %u\n",
htonl(bh->totlen), length);
return TPM_BAD_PARAMETER;
}
if (bh->min_version > BLOB_HEADER_VERSION) {
if (!quiet)
logprintf(STDERR_FILENO,
"Minimum required version for the blob is %d, we "
"only support version %d\n", bh->min_version,
BLOB_HEADER_VERSION);
return TPM_BAD_VERSION;
}
*hdrversion = bh->version;
*dataoffset = ntohs(bh->hdrsize);
*hdrflags = ntohs(bh->flags);
return TPM_SUCCESS;
} | 164 | True | 1 |
|
CVE-2022-24301 | 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:L/I:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | LOW | LOW | NONE | 6.5 | MEDIUM | 3.9 | 2.5 | False | [{'url': 'https://github.com/minetest/minetest/commit/3693b6871eba268ecc79b3f52d00d3cefe761131', 'name': 'https://github.com/minetest/minetest/commit/3693b6871eba268ecc79b3f52d00d3cefe761131', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/minetest/minetest/security/advisories/GHSA-fvwv-qcq6-wmp5', 'name': 'https://github.com/minetest/minetest/security/advisories/GHSA-fvwv-qcq6-wmp5', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5075', 'name': 'DSA-5075', 'refsource': 'DEBIAN', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-276'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:minetest:minetest:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "In Minetest before 5.4.0, players can add or subtract items from a different player's inventory."}] | 2022-02-28T15:33Z | 2022-02-02T06:15Z | Incorrect Default Permissions | During installation, installed file permissions are set to allow anyone to modify those files. | https://cwe.mitre.org/data/definitions/276.html | 0 | Lars Müller | 2020-08-29 17:41:03+02:00 | Prevent players accessing inventories of other players (#10341) | 3693b6871eba268ecc79b3f52d00d3cefe761131 | False | minetest/minetest | Minetest is an open source voxel game engine with easy modding and game creation | 2011-08-07 13:48:36 | 2022-08-27 16:51:50 | https://www.minetest.net/ | minetest | 7932.0 | 1610.0 | Server::handleCommand_InventoryAction | Server::handleCommand_InventoryAction( NetworkPacket * pkt) | ['pkt'] | void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
{
session_t peer_id = pkt->getPeerId();
RemotePlayer *player = m_env->getPlayer(peer_id);
if (player == NULL) {
errorstream <<
"Server::ProcessData(): Canceling: No player for peer_id=" <<
peer_id << " disconnecting peer!" << std::endl;
DisconnectPeer(peer_id);
return;
}
PlayerSAO *playersao = player->getPlayerSAO();
if (playersao == NULL) {
errorstream <<
"Server::ProcessData(): Canceling: No player object for peer_id=" <<
peer_id << " disconnecting peer!" << std::endl;
DisconnectPeer(peer_id);
return;
}
// Strip command and create a stream
std::string datastring(pkt->getString(0), pkt->getSize());
verbosestream << "TOSERVER_INVENTORY_ACTION: data=" << datastring
<< std::endl;
std::istringstream is(datastring, std::ios_base::binary);
// Create an action
InventoryAction *a = InventoryAction::deSerialize(is);
if (!a) {
infostream << "TOSERVER_INVENTORY_ACTION: "
<< "InventoryAction::deSerialize() returned NULL"
<< std::endl;
return;
}
// If something goes wrong, this player is to blame
RollbackScopeActor rollback_scope(m_rollback,
std::string("player:")+player->getName());
/*
Note: Always set inventory not sent, to repair cases
where the client made a bad prediction.
*/
/*
Handle restrictions and special cases of the move action
*/
if (a->getType() == IAction::Move) {
IMoveAction *ma = (IMoveAction*)a;
ma->from_inv.applyCurrentPlayer(player->getName());
ma->to_inv.applyCurrentPlayer(player->getName());
m_inventory_mgr->setInventoryModified(ma->from_inv);
if (ma->from_inv != ma->to_inv)
m_inventory_mgr->setInventoryModified(ma->to_inv);
bool from_inv_is_current_player =
(ma->from_inv.type == InventoryLocation::PLAYER) &&
(ma->from_inv.name == player->getName());
bool to_inv_is_current_player =
(ma->to_inv.type == InventoryLocation::PLAYER) &&
(ma->to_inv.name == player->getName());
InventoryLocation *remote = from_inv_is_current_player ?
&ma->to_inv : &ma->from_inv;
// Check for out-of-range interaction
if (remote->type == InventoryLocation::NODEMETA) {
v3f node_pos = intToFloat(remote->p, BS);
v3f player_pos = player->getPlayerSAO()->getEyePosition();
f32 d = player_pos.getDistanceFrom(node_pos);
if (!checkInteractDistance(player, d, "inventory"))
return;
}
/*
Disable moving items out of craftpreview
*/
if (ma->from_list == "craftpreview") {
infostream << "Ignoring IMoveAction from "
<< (ma->from_inv.dump()) << ":" << ma->from_list
<< " to " << (ma->to_inv.dump()) << ":" << ma->to_list
<< " because src is " << ma->from_list << std::endl;
delete a;
return;
}
/*
Disable moving items into craftresult and craftpreview
*/
if (ma->to_list == "craftpreview" || ma->to_list == "craftresult") {
infostream << "Ignoring IMoveAction from "
<< (ma->from_inv.dump()) << ":" << ma->from_list
<< " to " << (ma->to_inv.dump()) << ":" << ma->to_list
<< " because dst is " << ma->to_list << std::endl;
delete a;
return;
}
// Disallow moving items in elsewhere than player's inventory
// if not allowed to interact
if (!checkPriv(player->getName(), "interact") &&
(!from_inv_is_current_player ||
!to_inv_is_current_player)) {
infostream << "Cannot move outside of player's inventory: "
<< "No interact privilege" << std::endl;
delete a;
return;
}
}
/*
Handle restrictions and special cases of the drop action
*/
else if (a->getType() == IAction::Drop) {
IDropAction *da = (IDropAction*)a;
da->from_inv.applyCurrentPlayer(player->getName());
m_inventory_mgr->setInventoryModified(da->from_inv);
/*
Disable dropping items out of craftpreview
*/
if (da->from_list == "craftpreview") {
infostream << "Ignoring IDropAction from "
<< (da->from_inv.dump()) << ":" << da->from_list
<< " because src is " << da->from_list << std::endl;
delete a;
return;
}
// Disallow dropping items if not allowed to interact
if (!checkPriv(player->getName(), "interact")) {
delete a;
return;
}
// Disallow dropping items if dead
if (playersao->isDead()) {
infostream << "Ignoring IDropAction from "
<< (da->from_inv.dump()) << ":" << da->from_list
<< " because player is dead." << std::endl;
delete a;
return;
}
}
/*
Handle restrictions and special cases of the craft action
*/
else if (a->getType() == IAction::Craft) {
ICraftAction *ca = (ICraftAction*)a;
ca->craft_inv.applyCurrentPlayer(player->getName());
m_inventory_mgr->setInventoryModified(ca->craft_inv);
//bool craft_inv_is_current_player =
// (ca->craft_inv.type == InventoryLocation::PLAYER) &&
// (ca->craft_inv.name == player->getName());
// Disallow crafting if not allowed to interact
if (!checkPriv(player->getName(), "interact")) {
infostream << "Cannot craft: "
<< "No interact privilege" << std::endl;
delete a;
return;
}
}
// Do the action
a->apply(m_inventory_mgr.get(), playersao, this);
// Eat the action
delete a;
} | 875 | True | 1 |
|
CVE-2022-24300 | 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/minetest/minetest/security/advisories/GHSA-hwj2-xf72-r4cf', 'name': 'https://github.com/minetest/minetest/security/advisories/GHSA-hwj2-xf72-r4cf', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/minetest/minetest/commit/b5956bde259faa240a81060ff4e598e25ad52dae', 'name': 'https://github.com/minetest/minetest/commit/b5956bde259faa240a81060ff4e598e25ad52dae', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.debian.org/1004223', 'name': 'https://bugs.debian.org/1004223', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5075', 'name': 'DSA-5075', 'refsource': 'DEBIAN', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-74'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:minetest:minetest:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Minetest before 5.4.0 allows attackers to add or modify arbitrary meta fields of the same item stack as saved user input, aka ItemStack meta injection.'}] | 2022-02-28T15:33Z | 2022-02-02T06:15Z | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | Software has certain assumptions about what constitutes data and control respectively. It is the lack of verification of these assumptions for user-controlled input that leads to injection problems. Injection problems encompass a wide variety of issues -- all mitigated in very different ways and usually attempted in order to alter the control flow of the process. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.
| https://cwe.mitre.org/data/definitions/74.html | 0 | rubenwardy | 2021-01-28 16:32:37+00:00 | Sanitize ItemStack meta text | b5956bde259faa240a81060ff4e598e25ad52dae | False | minetest/minetest | Minetest is an open source voxel game engine with easy modding and game creation | 2011-08-07 13:48:36 | 2022-08-27 16:51:50 | https://www.minetest.net/ | minetest | 7932.0 | 1610.0 | ItemStackMetadata::setString | ItemStackMetadata::setString( const std :: string & name , const std :: string & var) | ['name', 'var'] | bool ItemStackMetadata::setString(const std::string &name, const std::string &var)
{
bool result = Metadata::setString(name, var);
if (name == TOOLCAP_KEY)
updateToolCapabilities();
return result;
} | 45 | True | 1 |
CVE-2022-35978 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 10.0 | CRITICAL | 3.9 | 6.0 | nan | [{'url': 'https://github.com/minetest/minetest/commit/da71e86633d0b27cd02d7aac9fdac625d141ca13', 'name': 'https://github.com/minetest/minetest/commit/da71e86633d0b27cd02d7aac9fdac625d141ca13', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/minetest/minetest/security/advisories/GHSA-663q-pcjw-27cc', 'name': 'https://github.com/minetest/minetest/security/advisories/GHSA-663q-pcjw-27cc', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://dev.minetest.net/Changelog#5.5.0_.E2.86.92_5.6.0', 'name': 'https://dev.minetest.net/Changelog#5.5.0_.E2.86.92_5.6.0', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:minetest:minetest:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Minetest is a free open-source voxel game engine with easy modding and game creation. In **single player**, a mod can set a global setting that controls the Lua script loaded to display the main menu. The script is then loaded as soon as the game session is exited. The Lua environment the menu runs in is not sandboxed and can directly interfere with the user's system. There are currently no known workarounds."}] | 2022-08-17T14:16Z | 2022-08-15T19: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 | sfan5 | 2022-05-25 19:07:49+02:00 | Protect a few more settings from being set from mods
Of those settings main_menu_script has concrete security impact, the rest are added out of abundance of caution. | da71e86633d0b27cd02d7aac9fdac625d141ca13 | False | minetest/minetest | Minetest is an open source voxel game engine with easy modding and game creation | 2011-08-07 13:48:36 | 2022-08-27 16:51:50 | https://www.minetest.net/ | minetest | 7932.0 | 1610.0 | checkSettingSecurity | checkSettingSecurity( lua_State * L , const std :: string & name) | ['L', 'name'] | static inline int checkSettingSecurity(lua_State* L, const std::string &name)
{
if (ScriptApiSecurity::isSecure(L) && name.compare(0, 7, "secure.") == 0)
throw LuaError("Attempt to set secure setting.");
bool is_mainmenu = false;
#ifndef SERVER
is_mainmenu = ModApiBase::getGuiEngine(L) != nullptr;
#endif
if (!is_mainmenu && (name == "mg_name" || name == "mg_flags")) {
errorstream << "Tried to set global setting " << name << ", ignoring. "
"minetest.set_mapgen_setting() should be used instead." << std::endl;
infostream << script_get_backtrace(L) << std::endl;
return -1;
}
return 0;
} | 113 | True | 1 |
CVE-2022-24750 | False | False | False | False | AV:L/AC:L/Au:N/C:C/I:C/A:C | LOCAL | LOW | NONE | COMPLETE | COMPLETE | COMPLETE | 7.2 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/ultravnc/UltraVNC/security/advisories/GHSA-3mvp-cp5x-vj5g', 'name': 'https://github.com/ultravnc/UltraVNC/security/advisories/GHSA-3mvp-cp5x-vj5g', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/bowtiejicode/UltraVNC-DSMPlugin-LPE', 'name': 'https://github.com/bowtiejicode/UltraVNC-DSMPlugin-LPE', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ultravnc/UltraVNC/commit/36a31b37b98f70c1db0428f5ad83170d604fb352', 'name': 'https://github.com/ultravnc/UltraVNC/commit/36a31b37b98f70c1db0428f5ad83170d604fb352', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:uvnc:ultravnc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.3.8.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'UltraVNC is a free and open source remote pc access software. A vulnerability has been found in versions prior to 1.3.8.0 in which the DSM plugin module, which allows a local authenticated user to achieve local privilege escalation (LPE) on a vulnerable system. The vulnerability has been fixed to allow loading of plugins from the installed directory. Affected users should upgrade their UltraVNC to 1.3.8.0. Users unable to upgrade should not install and run UltraVNC server as a service. It is advisable to create a scheduled task on a low privilege account to launch WinVNC.exe instead. There are no known workarounds if wincnc needs to be started as a service.'}] | 2022-03-18T20:06Z | 2022-03-10T21: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 | ultravnc | 2022-03-06 22:12:36+01:00 | security fix | 36a31b37b98f70c1db0428f5ad83170d604fb352 | False | ultravnc/UltraVNC | UltraVNC Server and UltraVNC Viewer | Official repository: https://github.com/ultravnc/UltraVNC | 2020-09-20 11:57:01 | 2022-08-14 14:38:57 | https://uvnc.com | ultravnc | 323.0 | 92.0 | vncProperties::DialogProc | vncProperties::DialogProc( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam) | ['hwnd', 'uMsg', 'wParam', 'lParam'] | vncProperties::DialogProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
{
// We use the dialog-box's USERDATA to store a _this pointer
// This is set only once WM_INITDIALOG has been recieved, though!
vncProperties *_this = helper::SafeGetWindowUserData<vncProperties>(hwnd);
switch (uMsg)
{
case WM_INITDIALOG:
{
vnclog.Print(LL_INTINFO, VNCLOG("INITDIALOG properties\n"));
// Retrieve the Dialog box parameter and use it as a pointer
// to the calling vncProperties object
helper::SafeSetWindowUserData(hwnd, lParam);
_this = (vncProperties *) lParam;
_this->m_dlgvisible = TRUE;
if (_this->m_fUseRegistry)
{
_this->Load(_this->m_usersettings);
// Set the dialog box's title to indicate which Properties we're editting
if (_this->m_usersettings) {
SetWindowText(hwnd, sz_ID_CURRENT_USER_PROP);
} else {
SetWindowText(hwnd, sz_ID_DEFAULT_SYST_PROP);
}
}
else
{
_this->LoadFromIniFile();
}
// Initialise the properties controls
HWND hConnectSock = GetDlgItem(hwnd, IDC_CONNECT_SOCK);
// Tight 1.2.7 method
BOOL bConnectSock = _this->m_server->SockConnected();
SendMessage(hConnectSock, BM_SETCHECK, bConnectSock, 0);
// Set the content of the password field to a predefined string.
SetDlgItemText(hwnd, IDC_PASSWORD, "~~~~~~~~");
EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD), bConnectSock);
// Set the content of the view-only password field to a predefined string. //PGM
SetDlgItemText(hwnd, IDC_PASSWORD2, "~~~~~~~~"); //PGM
EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD2), bConnectSock); //PGM
// Set the initial keyboard focus
if (bConnectSock)
{
SetFocus(GetDlgItem(hwnd, IDC_PASSWORD));
SendDlgItemMessage(hwnd, IDC_PASSWORD, EM_SETSEL, 0, (LPARAM)-1);
}
else
SetFocus(hConnectSock);
// Set display/ports settings
_this->InitPortSettings(hwnd);
HWND hConnectHTTP = GetDlgItem(hwnd, IDC_CONNECT_HTTP);
SendMessage(hConnectHTTP,
BM_SETCHECK,
_this->m_server->HTTPConnectEnabled(),
0);
// Modif sf@2002 - v1.1.0
HWND hFileTransfer = GetDlgItem(hwnd, IDC_FILETRANSFER);
SendMessage(hFileTransfer, BM_SETCHECK, _this->m_server->FileTransferEnabled(), 0);
HWND hFileTransferUserImp = GetDlgItem(hwnd, IDC_FTUSERIMPERSONATION_CHECK);
SendMessage(hFileTransferUserImp, BM_SETCHECK, _this->m_server->FTUserImpersonation(), 0);
HWND hBlank = GetDlgItem(hwnd, IDC_BLANK);
SendMessage(hBlank, BM_SETCHECK, _this->m_server->BlankMonitorEnabled(), 0);
if (!VNC_OSVersion::getInstance()->OS_WIN10_TRANS && VNC_OSVersion::getInstance()->OS_WIN10)
SetDlgItemText(hwnd, IDC_BLANK, "Enable Blank Monitor on Viewer Request require Min Win10 build 19041 ");
if (VNC_OSVersion::getInstance()->OS_WIN8)
SetDlgItemText(hwnd, IDC_BLANK, "Enable Blank Monitor on Viewer Not supported on windows 8 ");
HWND hBlank2 = GetDlgItem(hwnd, IDC_BLANK2); //PGM
SendMessage(hBlank2, BM_SETCHECK, _this->m_server->BlankInputsOnly(), 0); //PGM
HWND hLoopback = GetDlgItem(hwnd, IDC_ALLOWLOOPBACK);
BOOL fLoopback = _this->m_server->LoopbackOk();
SendMessage(hLoopback, BM_SETCHECK, fLoopback, 0);
#ifdef IPV6V4
HWND hIPV6 = GetDlgItem(hwnd, IDC_IPV6);
BOOL fIPV6 = _this->m_server->IPV6();
SendMessage(hIPV6, BM_SETCHECK, fIPV6, 0);
#else
HWND hIPV6 = GetDlgItem(hwnd, IDC_IPV6);
EnableWindow(hIPV6, false);
#endif
HWND hLoopbackonly = GetDlgItem(hwnd, IDC_LOOPBACKONLY);
BOOL fLoopbackonly = _this->m_server->LoopbackOnly();
SendMessage(hLoopbackonly, BM_SETCHECK, fLoopbackonly, 0);
HWND hTrayicon = GetDlgItem(hwnd, IDC_DISABLETRAY);
BOOL fTrayicon = _this->m_server->GetDisableTrayIcon();
SendMessage(hTrayicon, BM_SETCHECK, fTrayicon, 0);
HWND hrdpmode = GetDlgItem(hwnd, IDC_RDPMODE);
BOOL frdpmode = _this->m_server->GetRdpmode();
SendMessage(hrdpmode, BM_SETCHECK, frdpmode, 0);
HWND hNoScreensaver= GetDlgItem(hwnd,IDC_NOSCREENSAVER);
BOOL fNoScrensaver = _this->m_server->GetNoScreensaver();
SendMessage(hNoScreensaver, BM_SETCHECK, fNoScrensaver, 0);
HWND hAllowshutdown = GetDlgItem(hwnd, IDC_ALLOWSHUTDOWN);
SendMessage(hAllowshutdown, BM_SETCHECK, !_this->m_allowshutdown , 0);
HWND hm_alloweditclients = GetDlgItem(hwnd, IDC_ALLOWEDITCLIENTS);
SendMessage(hm_alloweditclients, BM_SETCHECK, !_this->m_alloweditclients , 0);
_this->m_server->SetAllowEditClients(_this->m_alloweditclients);
if (vnclog.GetMode() >= 2)
CheckDlgButton(hwnd, IDC_LOG, BST_CHECKED);
else
CheckDlgButton(hwnd, IDC_LOG, BST_UNCHECKED);
#ifndef AVILOG
ShowWindow (GetDlgItem(hwnd, IDC_CLEAR), SW_HIDE);
ShowWindow (GetDlgItem(hwnd, IDC_VIDEO), SW_HIDE);
#endif
if (vnclog.GetVideo())
{
SetDlgItemText(hwnd, IDC_EDIT_PATH, vnclog.GetPath());
//EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), true);
CheckDlgButton(hwnd, IDC_VIDEO, BST_CHECKED);
}
else
{
SetDlgItemText(hwnd, IDC_EDIT_PATH, vnclog.GetPath());
//EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), false);
CheckDlgButton(hwnd, IDC_VIDEO, BST_UNCHECKED);
}
// Marscha@2004 - authSSP: moved MS-Logon checkbox back to admin props page
// added New MS-Logon checkbox
// only enable New MS-Logon checkbox and Configure MS-Logon groups when MS-Logon
// is checked.
HWND hSecure = GetDlgItem(hwnd, IDC_SAVEPASSWORDSECURE);
SendMessage(hSecure, BM_SETCHECK, _this->m_server->Secure(), 0);
HWND hMSLogon = GetDlgItem(hwnd, IDC_MSLOGON_CHECKD);
SendMessage(hMSLogon, BM_SETCHECK, _this->m_server->MSLogonRequired(), 0);
HWND hNewMSLogon = GetDlgItem(hwnd, IDC_NEW_MSLOGON);
SendMessage(hNewMSLogon, BM_SETCHECK, _this->m_server->GetNewMSLogon(), 0);
HWND hReverseAuth = GetDlgItem(hwnd, IDC_REVERSEAUTH);
SendMessage(hReverseAuth, BM_SETCHECK, _this->m_server->GetReverseAuthRequired(), 0);
EnableWindow(GetDlgItem(hwnd, IDC_NEW_MSLOGON), _this->m_server->MSLogonRequired());
EnableWindow(GetDlgItem(hwnd, IDC_MSLOGON), _this->m_server->MSLogonRequired());
// Marscha@2004 - authSSP: end of change
SetDlgItemInt(hwnd, IDC_SCALE, _this->m_server->GetDefaultScale(), false);
// Remote input settings
HWND hEnableRemoteInputs = GetDlgItem(hwnd, IDC_DISABLE_INPUTS);
SendMessage(hEnableRemoteInputs,
BM_SETCHECK,
!(_this->m_server->RemoteInputsEnabled()),
0);
// Local input settings
HWND hDisableLocalInputs = GetDlgItem(hwnd, IDC_DISABLE_LOCAL_INPUTS);
SendMessage(hDisableLocalInputs,
BM_SETCHECK,
_this->m_server->LocalInputsDisabled(),
0);
// japanese keybaord
HWND hJapInputs = GetDlgItem(hwnd, IDC_JAP_INPUTS);
SendMessage(hJapInputs,
BM_SETCHECK,
_this->m_server->JapInputEnabled(),
0);
HWND hUnicodeInputs = GetDlgItem(hwnd, IDC_UNICODE_INPUTS);
SendMessage(hUnicodeInputs,
BM_SETCHECK,
_this->m_server->UnicodeInputEnabled(),
0);
HWND hwinhelper = GetDlgItem(hwnd, IDC_WIN8_HELPER);
SendMessage(hwinhelper,
BM_SETCHECK,
_this->m_server->Win8HelperEnabled(),
0);
// Remove the wallpaper
HWND hRemoveWallpaper = GetDlgItem(hwnd, IDC_REMOVE_WALLPAPER);
SendMessage(hRemoveWallpaper,
BM_SETCHECK,
_this->m_server->RemoveWallpaperEnabled(),
0);
// Lock settings
HWND hLockSetting;
switch (_this->m_server->LockSettings()) {
case 1:
hLockSetting = GetDlgItem(hwnd, IDC_LOCKSETTING_LOCK);
break;
case 2:
hLockSetting = GetDlgItem(hwnd, IDC_LOCKSETTING_LOGOFF);
break;
default:
hLockSetting = GetDlgItem(hwnd, IDC_LOCKSETTING_NOTHING);
};
SendMessage(hLockSetting,
BM_SETCHECK,
TRUE,
0);
HWND hNotificationSelection;
switch (_this->m_server->getNotificationSelection()) {
case 1:
hNotificationSelection = GetDlgItem(hwnd, IDC_RADIONOTIFICATIONIFPROVIDED);
break;
default:
hNotificationSelection = GetDlgItem(hwnd,
IDC_RADIONOTIFICATIONON);
break;
};
SendMessage(hNotificationSelection,
BM_SETCHECK,
TRUE,
0);
HWND hmvSetting = 0;
switch (_this->m_server->ConnectPriority()) {
case 0:
hmvSetting = GetDlgItem(hwnd, IDC_MV1);
break;
case 1:
hmvSetting = GetDlgItem(hwnd, IDC_MV2);
break;
case 2:
hmvSetting = GetDlgItem(hwnd, IDC_MV3);
break;
case 3:
hmvSetting = GetDlgItem(hwnd, IDC_MV4);
break;
};
SendMessage(hmvSetting,
BM_SETCHECK,
TRUE,
0);
HWND hQuerySetting;
switch (_this->m_server->QueryAccept()) {
case 0:
hQuerySetting = GetDlgItem(hwnd, IDC_DREFUSE);
break;
case 1:
hQuerySetting = GetDlgItem(hwnd, IDC_DACCEPT);
break;
default:
hQuerySetting = GetDlgItem(hwnd, IDC_DREFUSE);
};
SendMessage(hQuerySetting,
BM_SETCHECK,
TRUE,
0);
HWND hMaxViewerSetting;
switch (_this->m_server->getMaxViewerSetting()) {
case 0:
hMaxViewerSetting = GetDlgItem(hwnd, IDC_MAXREFUSE);
break;
case 1:
hMaxViewerSetting = GetDlgItem(hwnd, IDC_MAXDISCONNECT);
break;
default:
hMaxViewerSetting = GetDlgItem(hwnd, IDC_MAXREFUSE);
};
SendMessage(hMaxViewerSetting,
BM_SETCHECK,
TRUE,
0);
HWND hCollabo = GetDlgItem(hwnd, IDC_COLLABO);
SendMessage(hCollabo,
BM_SETCHECK,
_this->m_server->getCollabo(),
0);
HWND hwndDlg = GetDlgItem(hwnd, IDC_FRAME);
SendMessage(hwndDlg,
BM_SETCHECK,
_this->m_server->getFrame(),
0);
hwndDlg = GetDlgItem(hwnd, IDC_NOTIFOCATION);
SendMessage(hwndDlg,
BM_SETCHECK,
_this->m_server->getNotification(),
0);
hwndDlg = GetDlgItem(hwnd, IDC_OSD);
SendMessage(hwndDlg,
BM_SETCHECK,
_this->m_server->getOSD(),
0);
char maxviewersChar[128];
UINT maxviewers = _this->m_server->getMaxViewers();
sprintf_s(maxviewersChar, "%d", (int)maxviewers);
SetDlgItemText(hwnd, IDC_MAXVIEWERS, (const char*)maxviewersChar);
// sf@2002 - List available DSM Plugins
HWND hPlugins = GetDlgItem(hwnd, IDC_PLUGINS_COMBO);
int nPlugins = _this->m_server->GetDSMPluginPointer()->ListPlugins(hPlugins);
if (!nPlugins)
{
SendMessage(hPlugins, CB_ADDSTRING, 0, (LPARAM) sz_ID_NO_PLUGIN_DETECT);
SendMessage(hPlugins, CB_SETCURSEL, 0, 0);
}
else
SendMessage(hPlugins, CB_SELECTSTRING, 0, (LPARAM)_this->m_server->GetDSMPluginName());
// Modif sf@2002
SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_SETCHECK, _this->m_server->IsDSMPluginEnabled(), 0);
EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON), _this->m_server->IsDSMPluginEnabled());
// Query window option - Taken from TightVNC advanced properties
BOOL queryEnabled = (_this->m_server->QuerySetting() == 4);
SendMessage(GetDlgItem(hwnd, IDQUERY), BM_SETCHECK, queryEnabled, 0);
EnableWindow(GetDlgItem(hwnd, IDQUERYTIMEOUT), queryEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_QUERYDISABLETIME), queryEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_DREFUSE), queryEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_DACCEPT), queryEnabled);
SetDlgItemText(hwnd, IDC_SERVICE_COMMANDLINE, _this->service_commandline);
SetDlgItemText(hwnd, IDC_EDITQUERYTEXT, _this->accept_reject_mesg);
char timeout[128];
UINT t = _this->m_server->QueryTimeout();
sprintf_s(timeout, "%d", (int)t);
SetDlgItemText(hwnd, IDQUERYTIMEOUT, (const char *) timeout);
char disableTime[128];
UINT tt = _this->m_server->QueryDisableTime();
sprintf_s(disableTime, "%d", (int)tt);
SetDlgItemText(hwnd, IDC_QUERYDISABLETIME, (const char *) disableTime);
_this->ExpandBox(hwnd, !_this->m_bExpanded);
SendMessage(GetDlgItem(hwnd, IDC_BUTTON_EXPAND), BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)_this->hBmpExpand);
SetForegroundWindow(hwnd);
return FALSE; // Because we've set the focus
}
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_SHOWOPTIONS:
case IDC_BUTTON_EXPAND:
_this->ExpandBox(hwnd, !_this->m_bExpanded);
// if (_this->m_bExpanded)
// _this->InitTab(hwnd);
return TRUE;
case IDOK:
case IDC_APPLY:
{
char path[512];
int lenpath = GetDlgItemText(hwnd, IDC_EDIT_PATH, (LPSTR) &path, 512);
if (lenpath != 0)
{
vnclog.SetPath(path);
}
else
{
strcpy_s(path,"");
vnclog.SetPath(path);
}
bool Secure_old = _this->m_server->Secure();
HWND hSecure = GetDlgItem(hwnd, IDC_SAVEPASSWORDSECURE);
_this->m_server->Secure(SendMessage(hSecure, BM_GETCHECK, 0, 0) == BST_CHECKED);
// Save the password
char passwd[MAXPWLEN+1];
char passwd2[MAXPWLEN+1];
memset(passwd, '\0', MAXPWLEN + 1); //PGM
memset(passwd2, '\0', MAXPWLEN + 1); //PGM
// TightVNC method
int lenPassword = GetDlgItemText(hwnd, IDC_PASSWORD, (LPSTR) &passwd, MAXPWLEN+1);
int lenPassword2 = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR)&passwd2, MAXPWLEN + 1); //PGM
bool bSecure = _this->m_server->Secure() ? true : false;
if (Secure_old != bSecure) {
//We changed the method to save the password
//load passwords and encrypt the other method
char password[MAXPWLEN];
char password2[MAXPWLEN];
_this->m_server->GetPassword(password);
vncPasswd::ToText plain(password, Secure_old);
_this->m_server->GetPassword2(password2);
vncPasswd::ToText plain2(password2, Secure_old);
memset(passwd, '\0', MAXPWLEN + 1); //PGM
memset(passwd2, '\0', MAXPWLEN + 1); //PGM
strcpy_s(passwd,plain);
strcpy_s(passwd2, plain2);
lenPassword = (int)strlen(passwd);
lenPassword2 = (int)strlen(passwd2);
}
if (strcmp(passwd, "~~~~~~~~") != 0) {
if (lenPassword == 0)
{
vncPasswd::FromClear crypt(_this->m_server->Secure());
_this->m_server->SetPassword(crypt);
}
else
{
vncPasswd::FromText crypt(passwd, _this->m_server->Secure());
_this->m_server->SetPassword(crypt);
}
}
if (strcmp(passwd2, "~~~~~~~~") != 0) { //PGM
if (lenPassword2 == 0) //PGM
{ //PGM
vncPasswd::FromClear crypt2(_this->m_server->Secure()); //PGM
_this->m_server->SetPassword2(crypt2); //PGM
} //PGM
else //PGM
{ //PGM
vncPasswd::FromText crypt2(passwd2, _this->m_server->Secure()); //PGM
_this->m_server->SetPassword2(crypt2); //PGM
} //PGM
} //PGM
//avoid readonly and full passwd being set the same
if (strcmp(passwd, "~~~~~~~~") != 0 && strcmp(passwd2, "~~~~~~~~") != 0) {
if (strcmp(passwd,passwd2)==0)
{
MessageBox(NULL,"View only and full password are the same\nView only ignored","Warning",0);
}
}
// Save the new settings to the server
int state = (int)SendDlgItemMessage(hwnd, IDC_PORTNO_AUTO, BM_GETCHECK, 0, 0);
_this->m_server->SetAutoPortSelect(state == BST_CHECKED);
// Save port numbers if we're not auto selecting
if (!_this->m_server->AutoPortSelect()) {
if ( SendDlgItemMessage(hwnd, IDC_SPECDISPLAY,
BM_GETCHECK, 0, 0) == BST_CHECKED ) {
// Display number was specified
BOOL ok;
UINT display = GetDlgItemInt(hwnd, IDC_DISPLAYNO, &ok, TRUE);
if (ok)
_this->m_server->SetPorts(DISPLAY_TO_PORT(display),
DISPLAY_TO_HPORT(display));
} else {
// Assuming that port numbers were specified
BOOL ok1, ok2;
UINT port_rfb = GetDlgItemInt(hwnd, IDC_PORTRFB, &ok1, TRUE);
UINT port_http = GetDlgItemInt(hwnd, IDC_PORTHTTP, &ok2, TRUE);
if (ok1 && ok2)
_this->m_server->SetPorts(port_rfb, port_http);
}
}
HWND hConnectSock = GetDlgItem(hwnd, IDC_CONNECT_SOCK);
_this->m_server->SockConnect(
SendMessage(hConnectSock, BM_GETCHECK, 0, 0) == BST_CHECKED
);
// Update display/port controls on pressing the "Apply" button
if (LOWORD(wParam) == IDC_APPLY)
_this->InitPortSettings(hwnd);
HWND hConnectHTTP = GetDlgItem(hwnd, IDC_CONNECT_HTTP);
_this->m_server->EnableHTTPConnect(
SendMessage(hConnectHTTP, BM_GETCHECK, 0, 0) == BST_CHECKED
);
// Remote input stuff
HWND hEnableRemoteInputs = GetDlgItem(hwnd, IDC_DISABLE_INPUTS);
_this->m_server->EnableRemoteInputs(
SendMessage(hEnableRemoteInputs, BM_GETCHECK, 0, 0) != BST_CHECKED
);
// Local input stuff
HWND hDisableLocalInputs = GetDlgItem(hwnd, IDC_DISABLE_LOCAL_INPUTS);
_this->m_server->DisableLocalInputs(
SendMessage(hDisableLocalInputs, BM_GETCHECK, 0, 0) == BST_CHECKED
);
// japanese keyboard
HWND hJapInputs = GetDlgItem(hwnd, IDC_JAP_INPUTS);
_this->m_server->EnableJapInput(
SendMessage(hJapInputs, BM_GETCHECK, 0, 0) == BST_CHECKED
);
// japanese keyboard
HWND hUnicodeInputs = GetDlgItem(hwnd, IDC_UNICODE_INPUTS);
_this->m_server->EnableUnicodeInput(
SendMessage(hUnicodeInputs, BM_GETCHECK, 0, 0) == BST_CHECKED
);
HWND hwinhelper = GetDlgItem(hwnd, IDC_WIN8_HELPER);
_this->m_server->Win8HelperEnabled(
SendMessage(hwinhelper, BM_GETCHECK, 0, 0) == BST_CHECKED
);
// Wallpaper handling
HWND hRemoveWallpaper = GetDlgItem(hwnd, IDC_REMOVE_WALLPAPER);
_this->m_server->EnableRemoveWallpaper(
SendMessage(hRemoveWallpaper, BM_GETCHECK, 0, 0) == BST_CHECKED
);
// Lock settings handling
if (SendMessage(GetDlgItem(hwnd, IDC_LOCKSETTING_LOCK), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetLockSettings(1);
} else if (SendMessage(GetDlgItem(hwnd, IDC_LOCKSETTING_LOGOFF), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetLockSettings(2);
} else {
_this->m_server->SetLockSettings(0);
}
if (SendMessage(GetDlgItem(hwnd, IDC_RADIONOTIFICATIONON), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->setNotificationSelection(0);
}
else if (SendMessage(GetDlgItem(hwnd, IDC_RADIONOTIFICATIONIFPROVIDED), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->setNotificationSelection(1);
}
if (SendMessage(GetDlgItem(hwnd, IDC_DREFUSE), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetQueryAccept(0);
} else if (SendMessage(GetDlgItem(hwnd, IDC_DACCEPT), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetQueryAccept(1);
}
if (SendMessage(GetDlgItem(hwnd, IDC_MAXREFUSE), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->setMaxViewerSetting(0);
}
else if (SendMessage(GetDlgItem(hwnd, IDC_MAXDISCONNECT), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->setMaxViewerSetting(1);
}
char maxViewerChar[256];
strcpy_s(maxViewerChar, "128");
if (GetDlgItemText(hwnd, IDC_MAXVIEWERS, (LPSTR)&maxViewerChar, 256) == 0) {
int value = atoi(maxViewerChar);
if (value > 128)
value = 128;
_this->m_server->setMaxViewers(value);
}
else
_this->m_server->setMaxViewers(atoi(maxViewerChar));
HWND hCollabo = GetDlgItem(hwnd, IDC_COLLABO);
_this->m_server->setCollabo(
SendMessage(hCollabo, BM_GETCHECK, 0, 0) == BST_CHECKED
);
HWND hwndDlg = GetDlgItem(hwnd, IDC_FRAME);
_this->m_server->setFrame(
SendMessage(hwndDlg, BM_GETCHECK, 0, 0) == BST_CHECKED
);
hwndDlg = GetDlgItem(hwnd, IDC_NOTIFOCATION);
_this->m_server->setNotification(
SendMessage(hwndDlg, BM_GETCHECK, 0, 0) == BST_CHECKED
);
hwndDlg = GetDlgItem(hwnd, IDC_OSD);
_this->m_server->setOSD(
SendMessage(hwndDlg, BM_GETCHECK, 0, 0) == BST_CHECKED
);
if (SendMessage(GetDlgItem(hwnd, IDC_MV1), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetConnectPriority(0);
} else if (SendMessage(GetDlgItem(hwnd, IDC_MV2), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetConnectPriority(1);
}
else if (SendMessage(GetDlgItem(hwnd, IDC_MV3), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetConnectPriority(2);
} else if (SendMessage(GetDlgItem(hwnd, IDC_MV4), BM_GETCHECK, 0, 0)
== BST_CHECKED) {
_this->m_server->SetConnectPriority(3);
}
// Modif sf@2002 - v1.1.0
HWND hFileTransfer = GetDlgItem(hwnd, IDC_FILETRANSFER);
_this->m_server->EnableFileTransfer(SendMessage(hFileTransfer, BM_GETCHECK, 0, 0) == BST_CHECKED);
HWND hFileTransferUserImp = GetDlgItem(hwnd, IDC_FTUSERIMPERSONATION_CHECK);
_this->m_server->FTUserImpersonation(SendMessage(hFileTransferUserImp, BM_GETCHECK, 0, 0) == BST_CHECKED);
HWND hBlank = GetDlgItem(hwnd, IDC_BLANK);
_this->m_server->BlankMonitorEnabled(SendMessage(hBlank, BM_GETCHECK, 0, 0) == BST_CHECKED);
HWND hBlank2 = GetDlgItem(hwnd, IDC_BLANK2); //PGM
_this->m_server->BlankInputsOnly(SendMessage(hBlank2, BM_GETCHECK, 0, 0) == BST_CHECKED); //PGM
_this->m_server->SetLoopbackOk(IsDlgButtonChecked(hwnd, IDC_ALLOWLOOPBACK));
#ifdef IPV6V4
_this->m_server->SetIPV6(IsDlgButtonChecked(hwnd, IDC_IPV6));
#endif
_this->m_server->SetLoopbackOnly(IsDlgButtonChecked(hwnd, IDC_LOOPBACKONLY));
_this->m_server->SetDisableTrayIcon(IsDlgButtonChecked(hwnd, IDC_DISABLETRAY));
_this->m_server->SetRdpmode(IsDlgButtonChecked(hwnd, IDC_RDPMODE));
_this->m_server->SetNoScreensaver(IsDlgButtonChecked(hwnd, IDC_NOSCREENSAVER));
_this->m_allowshutdown=!IsDlgButtonChecked(hwnd, IDC_ALLOWSHUTDOWN);
_this->m_alloweditclients=!IsDlgButtonChecked(hwnd, IDC_ALLOWEDITCLIENTS);
_this->m_server->SetAllowEditClients(_this->m_alloweditclients);
if (IsDlgButtonChecked(hwnd, IDC_LOG))
{
vnclog.SetMode(2);
vnclog.SetLevel(10);
}
else
{
vnclog.SetMode(0);
}
if (IsDlgButtonChecked(hwnd, IDC_VIDEO))
{
vnclog.SetVideo(true);
}
else
{
vnclog.SetVideo(false);
}
// Modif sf@2002 - v1.1.0
// Marscha@2004 - authSSP: moved MS-Logon checkbox back to admin props page
// added New MS-Logon checkbox
HWND hMSLogon = GetDlgItem(hwnd, IDC_MSLOGON_CHECKD);
_this->m_server->RequireMSLogon(SendMessage(hMSLogon, BM_GETCHECK, 0, 0) == BST_CHECKED);
HWND hNewMSLogon = GetDlgItem(hwnd, IDC_NEW_MSLOGON);
_this->m_server->SetNewMSLogon(SendMessage(hNewMSLogon, BM_GETCHECK, 0, 0) == BST_CHECKED);
// Marscha@2004 - authSSP: end of change
HWND hReverseAuth = GetDlgItem(hwnd, IDC_REVERSEAUTH);
_this->m_server->SetReverseAuthRequired(SendMessage(hReverseAuth, BM_GETCHECK, 0, 0) == BST_CHECKED);
int nDScale = GetDlgItemInt(hwnd, IDC_SCALE, NULL, FALSE);
if (nDScale < 1 || nDScale > 9) nDScale = 1;
_this->m_server->SetDefaultScale(nDScale);
// sf@2002 - DSM Plugin loading
// If Use plugin is checked, load the plugin if necessary
if (SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED)
{
TCHAR szPlugin[MAX_PATH];
GetDlgItemText(hwnd, IDC_PLUGINS_COMBO, szPlugin, MAX_PATH);
_this->m_server->SetDSMPluginName(szPlugin);
_this->m_server->EnableDSMPlugin(true);
}
else // If Use plugin unchecked but the plugin is loaded, unload it
{
_this->m_server->EnableDSMPlugin(false);
if (_this->m_server->GetDSMPluginPointer()->IsLoaded())
{
_this->m_server->GetDSMPluginPointer()->UnloadPlugin();
_this->m_server->GetDSMPluginPointer()->SetEnabled(false);
}
}
//adzm 2010-05-12 - dsmplugin config
_this->m_server->SetDSMPluginConfig(_this->m_pref_DSMPluginConfig);
// Query Window options - Taken from TightVNC advanced properties
char timeout[256];
strcpy_s(timeout,"5");
if (GetDlgItemText(hwnd, IDQUERYTIMEOUT, (LPSTR) &timeout, 256) == 0)
_this->m_server->SetQueryTimeout(atoi(timeout));
else
_this->m_server->SetQueryTimeout(atoi(timeout));
char disabletime[256];
strcpy_s(disabletime,"5");
if (GetDlgItemText(hwnd, IDC_QUERYDISABLETIME, (LPSTR) &disabletime, 256) == 0)
_this->m_server->SetQueryDisableTime(atoi(disabletime));
else
_this->m_server->SetQueryDisableTime(atoi(disabletime));
GetDlgItemText(hwnd, IDC_SERVICE_COMMANDLINE, _this->service_commandline, 1024);
GetDlgItemText(hwnd, IDC_EDITQUERYTEXT, _this->accept_reject_mesg, 512);
HWND hQuery = GetDlgItem(hwnd, IDQUERY);
_this->m_server->SetQuerySetting((SendMessage(hQuery, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 4 : 2);
// And to the registry
/*if (!RunningAsAdministrator () && vncService::RunningAsService())
{
MessageBoxSecure(NULL,"Only admins are allowed to save","Warning", MB_OK | MB_ICONINFORMATION);
}
else*/
{
// Load the settings
if (_this->m_fUseRegistry)
_this->Save();
else
_this->SaveToIniFile();
}
// Was ok pressed?
if (LOWORD(wParam) == IDOK)
{
// Yes, so close the dialog
vnclog.Print(LL_INTINFO, VNCLOG("enddialog (OK)\n"));
_this->m_returncode_valid = TRUE;
EndDialog(hwnd, IDOK);
_this->m_dlgvisible = FALSE;
}
_this->m_server->SetHookings();
return TRUE;
}
case IDCANCEL:
vnclog.Print(LL_INTINFO, VNCLOG("enddialog (CANCEL)\n"));
_this->m_returncode_valid = TRUE;
EndDialog(hwnd, IDCANCEL);
_this->m_dlgvisible = FALSE;
return TRUE;
// Added Jef Fix - 5 March 2008 [email protected]
case IDC_BLANK:
{
// only enable alpha blanking if blanking is enabled
HWND hBlank = ::GetDlgItem(hwnd, IDC_BLANK);
HWND hBlank2 = ::GetDlgItem(hwnd, IDC_BLANK2); //PGM
::EnableWindow(hBlank2, ::SendMessage(hBlank, BM_GETCHECK, 0, 0) == BST_CHECKED); //PGM
}
break;
case IDC_BLANK2: //PGM
{ //PGM
// only enable alpha blanking if Disable Only Inputs is disabled //PGM
HWND hBlank = ::GetDlgItem(hwnd, IDC_BLANK2); //PGM
} //PGM
break; //PGM
case IDC_VIDEO:
{
if (IsDlgButtonChecked(hwnd, IDC_VIDEO))
{
EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), true);
}
else
{
EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), false);
}
break;
}
case IDC_CLEAR:
{
vnclog.ClearAviConfig();
break;
}
case IDC_CONNECT_SOCK:
// TightVNC 1.2.7 method
// The user has clicked on the socket connect tickbox
{
BOOL bConnectSock =
(SendDlgItemMessage(hwnd, IDC_CONNECT_SOCK,
BM_GETCHECK, 0, 0) == BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD), bConnectSock);
HWND hPortNoAuto = GetDlgItem(hwnd, IDC_PORTNO_AUTO);
EnableWindow(hPortNoAuto, bConnectSock);
HWND hSpecDisplay = GetDlgItem(hwnd, IDC_SPECDISPLAY);
EnableWindow(hSpecDisplay, bConnectSock);
HWND hSpecPort = GetDlgItem(hwnd, IDC_SPECPORT);
EnableWindow(hSpecPort, bConnectSock);
EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), bConnectSock &&
(SendMessage(hSpecDisplay, BM_GETCHECK, 0, 0) == BST_CHECKED));
EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), bConnectSock &&
(SendMessage(hSpecPort, BM_GETCHECK, 0, 0) == BST_CHECKED));
EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), bConnectSock &&
(SendMessage(hSpecPort, BM_GETCHECK, 0, 0) == BST_CHECKED));
}
return TRUE;
// TightVNC 1.2.7 method
case IDC_PORTNO_AUTO:
{
EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), FALSE);
SetDlgItemText(hwnd, IDC_DISPLAYNO, "");
SetDlgItemText(hwnd, IDC_PORTRFB, "");
SetDlgItemText(hwnd, IDC_PORTHTTP, "");
}
return TRUE;
case IDC_SPECDISPLAY:
{
EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), FALSE);
int display = PORT_TO_DISPLAY(_this->m_server->GetPort());
if (display < 0 || display > 99)
display = 0;
SetDlgItemInt(hwnd, IDC_DISPLAYNO, display, FALSE);
SetDlgItemInt(hwnd, IDC_PORTRFB, _this->m_server->GetPort(), FALSE);
SetDlgItemInt(hwnd, IDC_PORTHTTP, _this->m_server->GetHttpPort(), FALSE);
SetFocus(GetDlgItem(hwnd, IDC_DISPLAYNO));
SendDlgItemMessage(hwnd, IDC_DISPLAYNO, EM_SETSEL, 0, (LPARAM)-1);
}
return TRUE;
case IDC_SPECPORT:
{
EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), FALSE);
EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), TRUE);
EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), TRUE);
int d1 = PORT_TO_DISPLAY(_this->m_server->GetPort());
int d2 = HPORT_TO_DISPLAY(_this->m_server->GetHttpPort());
if (d1 == d2 && d1 >= 0 && d1 <= 99) {
SetDlgItemInt(hwnd, IDC_DISPLAYNO, d1, FALSE);
} else {
SetDlgItemText(hwnd, IDC_DISPLAYNO, "");
}
SetDlgItemInt(hwnd, IDC_PORTRFB, _this->m_server->GetPort(), FALSE);
SetDlgItemInt(hwnd, IDC_PORTHTTP, _this->m_server->GetHttpPort(), FALSE);
SetFocus(GetDlgItem(hwnd, IDC_PORTRFB));
SendDlgItemMessage(hwnd, IDC_PORTRFB, EM_SETSEL, 0, (LPARAM)-1);
}
return TRUE;
// Query window option - Taken from TightVNC advanced properties code
case IDQUERY:
{
HWND hQuery = GetDlgItem(hwnd, IDQUERY);
BOOL queryon = (SendMessage(hQuery, BM_GETCHECK, 0, 0) == BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDQUERYTIMEOUT), queryon);
EnableWindow(GetDlgItem(hwnd, IDC_QUERYDISABLETIME), queryon);
EnableWindow(GetDlgItem(hwnd, IDC_DREFUSE), queryon);
EnableWindow(GetDlgItem(hwnd, IDC_DACCEPT), queryon);
}
return TRUE;
case IDC_STARTREP:
{
vncConnDialog *newconn = new vncConnDialog(_this->m_server);
if (newconn)
{
newconn->DoDialog(true);
// delete newconn; // NO ! Already done in vncConnDialog.
}
}
// sf@2002 - DSM Plugin
case IDC_PLUGIN_CHECK:
{
EnableWindow(GetDlgItem(hwnd, IDC_PLUGIN_BUTTON),
SendMessage(GetDlgItem(hwnd, IDC_PLUGIN_CHECK), BM_GETCHECK, 0, 0) == BST_CHECKED);
}
return TRUE;
// Marscha@2004 - authSSP: moved MSLogon checkbox back to admin props page
// Reason: Different UI for old and new mslogon group config.
case IDC_MSLOGON_CHECKD:
{
BOOL bMSLogonChecked =
(SendDlgItemMessage(hwnd, IDC_MSLOGON_CHECKD,
BM_GETCHECK, 0, 0) == BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_NEW_MSLOGON), bMSLogonChecked);
EnableWindow(GetDlgItem(hwnd, IDC_MSLOGON), bMSLogonChecked);
}
return TRUE;
case IDC_MSLOGON:
{
// Marscha@2004 - authSSP: if "New MS-Logon" is checked,
// call vncEditSecurity from SecurityEditor.dll,
// else call "old" dialog.
BOOL bNewMSLogonChecked =
(SendDlgItemMessage(hwnd, IDC_NEW_MSLOGON,
BM_GETCHECK, 0, 0) == BST_CHECKED);
if (bNewMSLogonChecked) {
void winvncSecurityEditorHelper_as_admin();
HANDLE hProcess,hPToken;
DWORD id = vncService::GetExplorerLogonPid();
if (id!=0)
{
hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
if (!hProcess) goto error;
if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
char dir[MAX_PATH];
char exe_file_name[MAX_PATH];
GetModuleFileName(0, exe_file_name, MAX_PATH);
strcpy_s(dir, exe_file_name);
strcat_s(dir, " -securityeditorhelper");
{
STARTUPINFO StartUPInfo;
PROCESS_INFORMATION ProcessInfo;
ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
StartUPInfo.wShowWindow = SW_SHOW;
StartUPInfo.lpDesktop = "Winsta0\\Default";
StartUPInfo.cb = sizeof(STARTUPINFO);
CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
DWORD errorcode=GetLastError();
if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
if (errorcode == 1314) goto error;
break;
error:
winvncSecurityEditorHelper_as_admin();
}
}
} else {
// Marscha@2004 - authSSP: end of change
_this->m_vncauth.Init(_this->m_server);
_this->m_vncauth.SetTemp(_this->m_Tempfile);
_this->m_vncauth.Show(TRUE);
}
}
return TRUE;
case IDC_CHECKDRIVER:
{
CheckVideoDriver(1);
}
return TRUE;
case IDC_PLUGIN_BUTTON:
{
HWND hPlugin = GetDlgItem(hwnd, IDC_PLUGIN_CHECK);
if (SendMessage(hPlugin, BM_GETCHECK, 0, 0) == BST_CHECKED)
{
TCHAR szPlugin[MAX_PATH];
GetDlgItemText(hwnd, IDC_PLUGINS_COMBO, szPlugin, MAX_PATH);
if (!_this->m_server->GetDSMPluginPointer()->IsLoaded())
_this->m_server->GetDSMPluginPointer()->LoadPlugin(szPlugin, false);
else
{
// sf@2003 - We check if the loaded plugin is the same than
// the currently selected one or not
_this->m_server->GetDSMPluginPointer()->DescribePlugin();
if (_stricmp(_this->m_server->GetDSMPluginPointer()->GetPluginFileName(), szPlugin))
{
_this->m_server->GetDSMPluginPointer()->UnloadPlugin();
_this->m_server->GetDSMPluginPointer()->LoadPlugin(szPlugin, false);
}
}
if (_this->m_server->GetDSMPluginPointer()->IsLoaded())
{
Secure_Save_Plugin_Config(szPlugin);
}
else
{
MessageBoxSecure(NULL,
sz_ID_PLUGIN_NOT_LOAD,
sz_ID_PLUGIN_LOADIN, MB_OK | MB_ICONEXCLAMATION );
}
}
return TRUE;
}
}
break;
}
return 0;
}
| 5728 | True | 1 |
CVE-2022-24949 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-120'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A privilege escalation to root exists in Eternal Terminal prior to version 6.2.0. This is due to the combination of a race condition, buffer overflow, and logic bug all in PipeSocketHandler::listen().'}] | 2022-08-17T13:53Z | 2022-08-16T01:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::PipeSocketHandler::connect | et::PipeSocketHandler::connect( const SocketEndpoint & endpoint) | ['endpoint'] | int PipeSocketHandler::connect(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> mutexGuard(globalMutex);
string pipePath = endpoint.name();
sockaddr_un remote;
int sockFd = ::socket(AF_UNIX, SOCK_STREAM, 0);
FATAL_FAIL(sockFd);
initSocket(sockFd);
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, pipePath.c_str());
VLOG(3) << "Connecting to " << endpoint << " with fd " << sockFd;
int result =
::connect(sockFd, (struct sockaddr*)&remote, sizeof(sockaddr_un));
auto localErrno = GetErrno();
if (result < 0 && localErrno != EINPROGRESS) {
VLOG(3) << "Connection result: " << result << " (" << strerror(localErrno)
<< ")";
#ifdef WIN32
::shutdown(sockFd, SD_BOTH);
#else
::shutdown(sockFd, SHUT_RDWR);
#endif
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
SetErrno(localErrno);
return sockFd;
}
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(sockFd, &fdset);
timeval tv;
tv.tv_sec = 3; /* 3 second timeout */
tv.tv_usec = 0;
VLOG(4) << "Before selecting sockFd";
select(sockFd + 1, NULL, &fdset, NULL, &tv);
if (FD_ISSET(sockFd, &fdset)) {
VLOG(4) << "sockFd " << sockFd << " is selected";
int so_error;
socklen_t len = sizeof so_error;
FATAL_FAIL(
::getsockopt(sockFd, SOL_SOCKET, SO_ERROR, (char*)&so_error, &len));
if (so_error == 0) {
LOG(INFO) << "Connected to endpoint " << endpoint;
// Initialize the socket again once it's blocking to make sure timeouts
// are set
initSocket(sockFd);
// if we get here, we must have connected successfully
} else {
LOG(INFO) << "Error connecting to " << endpoint << ": " << so_error << " "
<< strerror(so_error);
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
}
} else {
auto localErrno = GetErrno();
LOG(INFO) << "Error connecting to " << endpoint << ": " << localErrno << " "
<< strerror(localErrno);
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
}
LOG(INFO) << sockFd << " is a good socket";
if (sockFd >= 0) {
addToActiveSockets(sockFd);
}
return sockFd;
} | 481 | True | 1 |
CVE-2022-24949 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-120'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A privilege escalation to root exists in Eternal Terminal prior to version 6.2.0. This is due to the combination of a race condition, buffer overflow, and logic bug all in PipeSocketHandler::listen().'}] | 2022-08-17T13:53Z | 2022-08-16T01:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::PipeSocketHandler::connect | et::PipeSocketHandler::connect( const SocketEndpoint & endpoint) | ['endpoint'] | int PipeSocketHandler::connect(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> mutexGuard(globalMutex);
string pipePath = endpoint.name();
sockaddr_un remote;
int sockFd = ::socket(AF_UNIX, SOCK_STREAM, 0);
FATAL_FAIL(sockFd);
initSocket(sockFd);
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, pipePath.c_str());
VLOG(3) << "Connecting to " << endpoint << " with fd " << sockFd;
int result =
::connect(sockFd, (struct sockaddr*)&remote, sizeof(sockaddr_un));
auto localErrno = GetErrno();
if (result < 0 && localErrno != EINPROGRESS) {
VLOG(3) << "Connection result: " << result << " (" << strerror(localErrno)
<< ")";
#ifdef WIN32
::shutdown(sockFd, SD_BOTH);
#else
::shutdown(sockFd, SHUT_RDWR);
#endif
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
SetErrno(localErrno);
return sockFd;
}
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(sockFd, &fdset);
timeval tv;
tv.tv_sec = 3; /* 3 second timeout */
tv.tv_usec = 0;
VLOG(4) << "Before selecting sockFd";
select(sockFd + 1, NULL, &fdset, NULL, &tv);
if (FD_ISSET(sockFd, &fdset)) {
VLOG(4) << "sockFd " << sockFd << " is selected";
int so_error;
socklen_t len = sizeof so_error;
FATAL_FAIL(
::getsockopt(sockFd, SOL_SOCKET, SO_ERROR, (char*)&so_error, &len));
if (so_error == 0) {
LOG(INFO) << "Connected to endpoint " << endpoint;
// Initialize the socket again once it's blocking to make sure timeouts
// are set
initSocket(sockFd);
// if we get here, we must have connected successfully
} else {
LOG(INFO) << "Error connecting to " << endpoint << ": " << so_error << " "
<< strerror(so_error);
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
}
} else {
auto localErrno = GetErrno();
LOG(INFO) << "Error connecting to " << endpoint << ": " << localErrno << " "
<< strerror(localErrno);
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
}
LOG(INFO) << sockFd << " is a good socket";
if (sockFd >= 0) {
addToActiveSockets(sockFd);
}
return sockFd;
} | 481 | True | 1 |
CVE-2022-24950 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-85gw-pchc-4rf3', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-85gw-pchc-4rf3', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "A race condition exists in Eternal Terminal prior to version 6.2.0 that allows an authenticated attacker to hijack other users' SSH authorization socket, enabling the attacker to login to other systems as the targeted users. The bug is in UserTerminalRouter::getInfoForId()."}] | 2022-08-17T13:55Z | 2022-08-16T01:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::PipeSocketHandler::connect | et::PipeSocketHandler::connect( const SocketEndpoint & endpoint) | ['endpoint'] | int PipeSocketHandler::connect(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> mutexGuard(globalMutex);
string pipePath = endpoint.name();
sockaddr_un remote;
int sockFd = ::socket(AF_UNIX, SOCK_STREAM, 0);
FATAL_FAIL(sockFd);
initSocket(sockFd);
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, pipePath.c_str());
VLOG(3) << "Connecting to " << endpoint << " with fd " << sockFd;
int result =
::connect(sockFd, (struct sockaddr*)&remote, sizeof(sockaddr_un));
auto localErrno = GetErrno();
if (result < 0 && localErrno != EINPROGRESS) {
VLOG(3) << "Connection result: " << result << " (" << strerror(localErrno)
<< ")";
#ifdef WIN32
::shutdown(sockFd, SD_BOTH);
#else
::shutdown(sockFd, SHUT_RDWR);
#endif
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
SetErrno(localErrno);
return sockFd;
}
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(sockFd, &fdset);
timeval tv;
tv.tv_sec = 3; /* 3 second timeout */
tv.tv_usec = 0;
VLOG(4) << "Before selecting sockFd";
select(sockFd + 1, NULL, &fdset, NULL, &tv);
if (FD_ISSET(sockFd, &fdset)) {
VLOG(4) << "sockFd " << sockFd << " is selected";
int so_error;
socklen_t len = sizeof so_error;
FATAL_FAIL(
::getsockopt(sockFd, SOL_SOCKET, SO_ERROR, (char*)&so_error, &len));
if (so_error == 0) {
LOG(INFO) << "Connected to endpoint " << endpoint;
// Initialize the socket again once it's blocking to make sure timeouts
// are set
initSocket(sockFd);
// if we get here, we must have connected successfully
} else {
LOG(INFO) << "Error connecting to " << endpoint << ": " << so_error << " "
<< strerror(so_error);
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
}
} else {
auto localErrno = GetErrno();
LOG(INFO) << "Error connecting to " << endpoint << ": " << localErrno << " "
<< strerror(localErrno);
#ifdef _MSC_VER
FATAL_FAIL(::closesocket(sockFd));
#else
FATAL_FAIL(::close(sockFd));
#endif
sockFd = -1;
}
LOG(INFO) << sockFd << " is a good socket";
if (sockFd >= 0) {
addToActiveSockets(sockFd);
}
return sockFd;
} | 481 | True | 1 |
CVE-2022-24949 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-120'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A privilege escalation to root exists in Eternal Terminal prior to version 6.2.0. This is due to the combination of a race condition, buffer overflow, and logic bug all in PipeSocketHandler::listen().'}] | 2022-08-17T13:53Z | 2022-08-16T01:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::PipeSocketHandler::listen | et::PipeSocketHandler::listen( const SocketEndpoint & endpoint) | ['endpoint'] | set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> guard(globalMutex);
string pipePath = endpoint.name();
if (pipeServerSockets.find(pipePath) != pipeServerSockets.end()) {
throw runtime_error("Tried to listen twice on the same path");
}
sockaddr_un local;
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
FATAL_FAIL(fd);
initServerSocket(fd);
local.sun_family = AF_UNIX; /* local is declared before socket() ^ */
strcpy(local.sun_path, pipePath.c_str());
unlink(local.sun_path);
FATAL_FAIL(::bind(fd, (struct sockaddr*)&local, sizeof(sockaddr_un)));
::listen(fd, 5);
#ifndef WIN32
FATAL_FAIL(::chmod(local.sun_path, S_IRUSR | S_IWUSR | S_IXUSR));
#endif
pipeServerSockets[pipePath] = set<int>({fd});
return pipeServerSockets[pipePath];
} | 173 | True | 1 |
CVE-2022-24949 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-120'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A privilege escalation to root exists in Eternal Terminal prior to version 6.2.0. This is due to the combination of a race condition, buffer overflow, and logic bug all in PipeSocketHandler::listen().'}] | 2022-08-17T13:53Z | 2022-08-16T01:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::PipeSocketHandler::listen | et::PipeSocketHandler::listen( const SocketEndpoint & endpoint) | ['endpoint'] | set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> guard(globalMutex);
string pipePath = endpoint.name();
if (pipeServerSockets.find(pipePath) != pipeServerSockets.end()) {
throw runtime_error("Tried to listen twice on the same path");
}
sockaddr_un local;
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
FATAL_FAIL(fd);
initServerSocket(fd);
local.sun_family = AF_UNIX; /* local is declared before socket() ^ */
strcpy(local.sun_path, pipePath.c_str());
unlink(local.sun_path);
FATAL_FAIL(::bind(fd, (struct sockaddr*)&local, sizeof(sockaddr_un)));
::listen(fd, 5);
#ifndef WIN32
FATAL_FAIL(::chmod(local.sun_path, S_IRUSR | S_IWUSR | S_IXUSR));
#endif
pipeServerSockets[pipePath] = set<int>({fd});
return pipeServerSockets[pipePath];
} | 173 | True | 1 |
CVE-2022-24950 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-85gw-pchc-4rf3', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-85gw-pchc-4rf3', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "A race condition exists in Eternal Terminal prior to version 6.2.0 that allows an authenticated attacker to hijack other users' SSH authorization socket, enabling the attacker to login to other systems as the targeted users. The bug is in UserTerminalRouter::getInfoForId()."}] | 2022-08-17T13:55Z | 2022-08-16T01:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::PipeSocketHandler::listen | et::PipeSocketHandler::listen( const SocketEndpoint & endpoint) | ['endpoint'] | set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) {
lock_guard<std::recursive_mutex> guard(globalMutex);
string pipePath = endpoint.name();
if (pipeServerSockets.find(pipePath) != pipeServerSockets.end()) {
throw runtime_error("Tried to listen twice on the same path");
}
sockaddr_un local;
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
FATAL_FAIL(fd);
initServerSocket(fd);
local.sun_family = AF_UNIX; /* local is declared before socket() ^ */
strcpy(local.sun_path, pipePath.c_str());
unlink(local.sun_path);
FATAL_FAIL(::bind(fd, (struct sockaddr*)&local, sizeof(sockaddr_un)));
::listen(fd, 5);
#ifndef WIN32
FATAL_FAIL(::chmod(local.sun_path, S_IRUSR | S_IWUSR | S_IXUSR));
#endif
pipeServerSockets[pipePath] = set<int>({fd});
return pipeServerSockets[pipePath];
} | 173 | True | 1 |
CVE-2022-24949 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-120'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A privilege escalation to root exists in Eternal Terminal prior to version 6.2.0. This is due to the combination of a race condition, buffer overflow, and logic bug all in PipeSocketHandler::listen().'}] | 2022-08-17T13:53Z | 2022-08-16T01:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::parseRangesToRequests | et::parseRangesToRequests( const string & input) | ['input'] | vector<PortForwardSourceRequest> parseRangesToRequests(const string& input) {
vector<PortForwardSourceRequest> pfsrs;
auto j = split(input, ',');
for (auto& pair : j) {
vector<string> sourceDestination = split(pair, ':');
try {
if (sourceDestination[0].find_first_not_of("0123456789-") !=
string::npos &&
sourceDestination[1].find_first_not_of("0123456789-") !=
string::npos) {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_name(sourceDestination[0]);
pfsr.mutable_destination()->set_name(sourceDestination[1]);
pfsrs.push_back(pfsr);
} else if (sourceDestination[0].find('-') != string::npos &&
sourceDestination[1].find('-') != string::npos) {
vector<string> sourcePortRange = split(sourceDestination[0], '-');
int sourcePortStart = stoi(sourcePortRange[0]);
int sourcePortEnd = stoi(sourcePortRange[1]);
vector<string> destinationPortRange = split(sourceDestination[1], '-');
int destinationPortStart = stoi(destinationPortRange[0]);
int destinationPortEnd = stoi(destinationPortRange[1]);
if (sourcePortEnd - sourcePortStart !=
destinationPortEnd - destinationPortStart) {
STFATAL << "source/destination port range mismatch";
exit(1);
} else {
int portRangeLength = sourcePortEnd - sourcePortStart + 1;
for (int i = 0; i < portRangeLength; ++i) {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_port(sourcePortStart + i);
pfsr.mutable_destination()->set_port(destinationPortStart + i);
pfsrs.push_back(pfsr);
}
}
} else if (sourceDestination[0].find('-') != string::npos ||
sourceDestination[1].find('-') != string::npos) {
STFATAL << "Invalid port range syntax: if source is range, "
"destination must be range";
} else {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_port(stoi(sourceDestination[0]));
pfsr.mutable_destination()->set_port(stoi(sourceDestination[1]));
pfsrs.push_back(pfsr);
}
} catch (const std::logic_error& lr) {
STFATAL << "Logic error: " << lr.what();
exit(1);
}
}
return pfsrs;
} | 433 | True | 1 |
CVE-2022-24949 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-hxg8-4r3q-p9rv', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-120'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A privilege escalation to root exists in Eternal Terminal prior to version 6.2.0. This is due to the combination of a race condition, buffer overflow, and logic bug all in PipeSocketHandler::listen().'}] | 2022-08-17T13:53Z | 2022-08-16T01:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::parseRangesToRequests | et::parseRangesToRequests( const string & input) | ['input'] | vector<PortForwardSourceRequest> parseRangesToRequests(const string& input) {
vector<PortForwardSourceRequest> pfsrs;
auto j = split(input, ',');
for (auto& pair : j) {
vector<string> sourceDestination = split(pair, ':');
try {
if (sourceDestination[0].find_first_not_of("0123456789-") !=
string::npos &&
sourceDestination[1].find_first_not_of("0123456789-") !=
string::npos) {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_name(sourceDestination[0]);
pfsr.mutable_destination()->set_name(sourceDestination[1]);
pfsrs.push_back(pfsr);
} else if (sourceDestination[0].find('-') != string::npos &&
sourceDestination[1].find('-') != string::npos) {
vector<string> sourcePortRange = split(sourceDestination[0], '-');
int sourcePortStart = stoi(sourcePortRange[0]);
int sourcePortEnd = stoi(sourcePortRange[1]);
vector<string> destinationPortRange = split(sourceDestination[1], '-');
int destinationPortStart = stoi(destinationPortRange[0]);
int destinationPortEnd = stoi(destinationPortRange[1]);
if (sourcePortEnd - sourcePortStart !=
destinationPortEnd - destinationPortStart) {
STFATAL << "source/destination port range mismatch";
exit(1);
} else {
int portRangeLength = sourcePortEnd - sourcePortStart + 1;
for (int i = 0; i < portRangeLength; ++i) {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_port(sourcePortStart + i);
pfsr.mutable_destination()->set_port(destinationPortStart + i);
pfsrs.push_back(pfsr);
}
}
} else if (sourceDestination[0].find('-') != string::npos ||
sourceDestination[1].find('-') != string::npos) {
STFATAL << "Invalid port range syntax: if source is range, "
"destination must be range";
} else {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_port(stoi(sourceDestination[0]));
pfsr.mutable_destination()->set_port(stoi(sourceDestination[1]));
pfsrs.push_back(pfsr);
}
} catch (const std::logic_error& lr) {
STFATAL << "Logic error: " << lr.what();
exit(1);
}
}
return pfsrs;
} | 433 | True | 1 |
CVE-2022-24950 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | nan | [{'url': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'name': 'https://github.com/MisterTea/EternalTerminal/commit/900348bb8bc96e1c7ba4888ac8480f643c43d3c3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-85gw-pchc-4rf3', 'name': 'https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-85gw-pchc-4rf3', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:eternal_terminal_project:eternal_terminal:*:*:*:*:*:*:*:*', 'versionEndExcluding': '6.2.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "A race condition exists in Eternal Terminal prior to version 6.2.0 that allows an authenticated attacker to hijack other users' SSH authorization socket, enabling the attacker to login to other systems as the targeted users. The bug is in UserTerminalRouter::getInfoForId()."}] | 2022-08-17T13:55Z | 2022-08-16T01:15Z | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently. |
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
A race condition violates these properties, which are closely related:
Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
A race condition exists when an "interfering code sequence" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single "x++" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
The interfering code sequence could be "trusted" or "untrusted." A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.
| https://cwe.mitre.org/data/definitions/362.html | 0 | Jason Gauci | 2021-11-03 12:09:01-05:00 | red fixes (#468)
* red fixes
* remove magic number | 900348bb8bc96e1c7ba4888ac8480f643c43d3c3 | False | MisterTea/EternalTerminal | Re-Connectable secure remote shell | 2016-11-19 17:15:18 | 2022-08-04 15:27:34 | https://mistertea.github.io/EternalTerminal/ | MisterTea | 2379.0 | 144.0 | et::parseRangesToRequests | et::parseRangesToRequests( const string & input) | ['input'] | vector<PortForwardSourceRequest> parseRangesToRequests(const string& input) {
vector<PortForwardSourceRequest> pfsrs;
auto j = split(input, ',');
for (auto& pair : j) {
vector<string> sourceDestination = split(pair, ':');
try {
if (sourceDestination[0].find_first_not_of("0123456789-") !=
string::npos &&
sourceDestination[1].find_first_not_of("0123456789-") !=
string::npos) {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_name(sourceDestination[0]);
pfsr.mutable_destination()->set_name(sourceDestination[1]);
pfsrs.push_back(pfsr);
} else if (sourceDestination[0].find('-') != string::npos &&
sourceDestination[1].find('-') != string::npos) {
vector<string> sourcePortRange = split(sourceDestination[0], '-');
int sourcePortStart = stoi(sourcePortRange[0]);
int sourcePortEnd = stoi(sourcePortRange[1]);
vector<string> destinationPortRange = split(sourceDestination[1], '-');
int destinationPortStart = stoi(destinationPortRange[0]);
int destinationPortEnd = stoi(destinationPortRange[1]);
if (sourcePortEnd - sourcePortStart !=
destinationPortEnd - destinationPortStart) {
STFATAL << "source/destination port range mismatch";
exit(1);
} else {
int portRangeLength = sourcePortEnd - sourcePortStart + 1;
for (int i = 0; i < portRangeLength; ++i) {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_port(sourcePortStart + i);
pfsr.mutable_destination()->set_port(destinationPortStart + i);
pfsrs.push_back(pfsr);
}
}
} else if (sourceDestination[0].find('-') != string::npos ||
sourceDestination[1].find('-') != string::npos) {
STFATAL << "Invalid port range syntax: if source is range, "
"destination must be range";
} else {
PortForwardSourceRequest pfsr;
pfsr.mutable_source()->set_port(stoi(sourceDestination[0]));
pfsr.mutable_destination()->set_port(stoi(sourceDestination[1]));
pfsrs.push_back(pfsr);
}
} catch (const std::logic_error& lr) {
STFATAL << "Logic error: " << lr.what();
exit(1);
}
}
return pfsrs;
} | 433 | True | 1 |
CVE-2022-25297 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://snyk.io/vuln/SNYK-UNMANAGED-DROGONFRAMEWORKDROGON-2407243', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/drogonframework/drogon/commit/3c785326c63a34aa1799a639ae185bc9453cb447', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/drogonframework/drogon/pull/1174', 'name': 'N/A', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-552'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:drogon:drogon:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.7.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package drogonframework/drogon before 1.7.5. The unsafe handling of file names during upload using HttpFile::save() method may enable attackers to write files to arbitrary locations outside the designated target folder.'}] | 2022-02-28T19:22Z | 2022-02-21T08:15Z | Files or Directories Accessible to External Parties | The product makes files or directories accessible to unauthorized actors, even though they should not be. | Web servers, FTP servers, and similar servers may store a set of files underneath a "root" directory that is accessible to the server's users. Applications may store sensitive files underneath this root without also using access control to limit which users may request those files, if any. Alternately, an application might package multiple files or directories into an archive file (e.g., ZIP or tar), but the application might not exclude sensitive files that are underneath those directories.
| https://cwe.mitre.org/data/definitions/552.html | 0 | Kirill | 2022-02-11 17:54:42+02:00 | Prevent malformed upload path causing arbitrary write (#1174) | 3c785326c63a34aa1799a639ae185bc9453cb447 | False | drogonframework/drogon | Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows | 2018-04-27 02:49:26 | 2022-08-27 15:38:39 | drogonframework | 7868.0 | 762.0 | HttpFileImpl::save | HttpFileImpl::save( const std :: string & path) const | ['path'] | int HttpFileImpl::save(const std::string &path) const
{
assert(!path.empty());
if (fileName_.empty())
return -1;
filesystem::path fsPath(utils::toNativePath(path));
if (!fsPath.is_absolute() &&
(!fsPath.has_parent_path() ||
(fsPath.begin()->string() != "." && fsPath.begin()->string() != "..")))
{
filesystem::path fsUploadPath(utils::toNativePath(
HttpAppFrameworkImpl::instance().getUploadPath()));
fsPath = fsUploadPath / fsPath;
}
filesystem::path fsFileName(utils::toNativePath(fileName_));
if (!filesystem::exists(fsPath))
{
LOG_TRACE << "create path:" << fsPath;
drogon::error_code err;
filesystem::create_directories(fsPath, err);
if (err)
{
LOG_SYSERR;
return -1;
}
}
return saveTo(fsPath / fsFileName);
} | 189 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::FileBody::Dump | webcc::FileBody::Dump( std :: ostream & os , const std :: string & prefix) const | ['os', 'prefix'] | void FileBody::Dump(std::ostream& os, const std::string& prefix) const {
os << prefix << "<file: " << path_.string() << ">" << std::endl;
} | 43 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::RequestParser::OnHeadersEnd | webcc::RequestParser::OnHeadersEnd() | [] | bool RequestParser::OnHeadersEnd() {
bool matched = view_matcher_(request_->method(), request_->url().path(),
&stream_);
if (!matched) {
LOG_WARN("No view matches the request: %s %s", request_->method().c_str(),
request_->url().path().c_str());
}
return matched;
} | 71 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::Router::MatchView | webcc::Router::MatchView( const std :: string & method , const std :: string & url , bool * stream) | ['method', 'url', 'stream'] | bool Router::MatchView(const std::string& method, const std::string& url,
bool* stream) {
assert(stream != nullptr);
*stream = false;
for (auto& route : routes_) {
if (std::find(route.methods.begin(), route.methods.end(), method) ==
route.methods.end()) {
continue;
}
if (route.url.empty()) {
std::smatch match;
if (std::regex_match(url, match, route.url_regex)) {
*stream = route.view->Stream(method);
return true;
}
} else {
if (boost::iequals(route.url, url)) {
*stream = route.view->Stream(method);
return true;
}
}
}
return false;
} | 168 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::Server::MatchViewOrStatic | webcc::Server::MatchViewOrStatic( const std :: string & method , const std :: string & url , bool * stream) | ['method', 'url', 'stream'] | bool Server::MatchViewOrStatic(const std::string& method,
const std::string& url, bool* stream) {
if (Router::MatchView(method, url, stream)) {
return true;
}
// Try to match a static file.
if (method == methods::kGet && !doc_root_.empty()) {
fs::path path = doc_root_ / url;
fs::error_code ec;
if (!fs::is_directory(path, ec) && fs::exists(path, ec)) {
return true;
}
}
return false;
} | 102 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::Server::ServeStatic | webcc::Server::ServeStatic( RequestPtr request) | ['request'] | ResponsePtr Server::ServeStatic(RequestPtr request) {
assert(request->method() == methods::kGet);
if (doc_root_.empty()) {
LOG_INFO("The doc root was not specified");
return {};
}
fs::path path = doc_root_ / request->url().path();
try {
// NOTE: FileBody might throw Error::kFileError.
auto body = std::make_shared<FileBody>(path, file_chunk_size_);
auto response = std::make_shared<Response>(Status::kOK);
std::string extension = path.extension().string();
response->SetContentType(media_types::FromExtension(extension), "");
// NOTE: Gzip compression is not supported.
response->SetBody(body, true);
return response;
} catch (const Error& error) {
LOG_ERRO("File error: %s", error.message().c_str());
return {};
}
} | 160 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::Decode | webcc::Decode( string_view encoded , std :: string * raw) | ['encoded', 'raw'] | bool Decode(string_view encoded, std::string* raw) {
for (auto iter = encoded.begin(); iter != encoded.end(); ++iter) {
if (*iter == '%') {
if (++iter == encoded.end()) {
// Invalid URI string, two hexadecimal digits must follow '%'.
return false;
}
int h_decimal = 0;
if (!HexToDecimal(*iter, &h_decimal)) {
return false;
}
if (++iter == encoded.end()) {
// Invalid URI string, two hexadecimal digits must follow '%'.
return false;
}
int l_decimal = 0;
if (!HexToDecimal(*iter, &l_decimal)) {
return false;
}
raw->push_back(static_cast<char>((h_decimal << 4) + l_decimal));
} else if (*iter > 127 || *iter < 0) {
// Invalid encoded URI string, must be entirely ASCII.
return false;
} else {
raw->push_back(*iter);
}
}
return true;
} | 174 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::DecodeUnsafe | webcc::DecodeUnsafe( string_view encoded) | ['encoded'] | std::string DecodeUnsafe(string_view encoded) {
std::string raw;
if (Decode(encoded, &raw)) {
return raw;
}
return ToString(encoded);
} | 33 | True | 1 |
|
CVE-2022-25298 | 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://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'name': 'https://snyk.io/vuln/SNYK-UNMANAGED-SPRINFALLWEBCC-2404182', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'name': 'https://github.com/sprinfall/webcc/commit/55a45fd5039061d5cc62e9f1b9d1f7e97a15143f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:webcc_project:webcc:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'This affects the package sprinfall/webcc before 0.3.0. It is possible to traverse directories to fetch arbitrary files from the server.'}] | 2022-02-25T20:26Z | 2022-02-18T13: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 | Chunting Gu | 2022-02-15 22:58:33+08:00 | fix static file serving security issue; fix url path encoding issue | 55a45fd5039061d5cc62e9f1b9d1f7e97a15143f | False | sprinfall/webcc | Lightweight C++ HTTP client and server library based on Asio for embedding purpose. | 2017-05-26 08:43:48 | 2022-05-04 03:17:03 | sprinfall | 240.0 | 54.0 | webcc::UrlQuery::UrlQuery | webcc::UrlQuery::UrlQuery( const std :: string & encoded_str) | ['encoded_str'] | UrlQuery::UrlQuery(const std::string& encoded_str) {
if (!encoded_str.empty()) {
// Split into key value pairs separated by '&'.
for (std::size_t i = 0; i != std::string::npos;) {
std::size_t j = encoded_str.find_first_of('&', i);
std::string kv;
if (j == std::string::npos) {
kv = encoded_str.substr(i);
i = std::string::npos;
} else {
kv = encoded_str.substr(i, j - i);
i = j + 1;
}
string_view key;
string_view value;
if (SplitKV(kv, '=', false, &key, &value)) {
parameters_.push_back({ DecodeUnsafe(key), DecodeUnsafe(value) });
}
}
}
} | 156 | True | 1 |
|
CVE-2022-2553 | 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:L/I:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | LOW | LOW | NONE | 6.5 | MEDIUM | 3.9 | 2.5 | nan | [{'url': 'https://github.com/ClusterLabs/booth/commit/35bf0b7b048d715f671eb68974fb6b4af6528c67', 'name': 'https://github.com/ClusterLabs/booth/commit/35bf0b7b048d715f671eb68974fb6b4af6528c67', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5194', 'name': 'DSA-5194', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:clusterlabs:booth:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.0', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The authfile directive in the booth config file is ignored, preventing use of authentication in communications from node to node. As a result, nodes that do not have the correct authentication key are not prevented from communicating with other nodes in the cluster.'}] | 2022-08-04T14:47Z | 2022-07-28T15: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 | Jan Friesse | 2022-07-04 09:39:47+02:00 | Revert "Refactor: main: substitute is_auth_req macro"
This reverts commit da79b8ba28ad4837a0fee13e5f8fb6f89fe0e24c.
authfile != authkey
Signed-off-by: Jan Friesse <[email protected]> | 35bf0b7b048d715f671eb68974fb6b4af6528c67 | False | ClusterLabs/booth | The Booth Cluster Ticket Manager | 2011-10-31 11:37:26 | 2022-08-15 18:55:38 | ClusterLabs | 43.0 | 26.0 | setup_config | setup_config( int type) | ['type'] | static int setup_config(int type)
{
int rv;
rv = read_config(cl.configfile, type);
if (rv < 0)
goto out;
if (is_auth_req()) {
rv = read_authkey();
if (rv < 0)
goto out;
#if HAVE_LIBGCRYPT
if (!gcry_check_version(NULL)) {
log_error("gcry_check_version");
rv = -ENOENT;
goto out;
}
gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
}
/* Set "local" pointer, ignoring errors. */
if (cl.type == DAEMON && cl.site[0]) {
if (!find_site_by_name(cl.site, &local, 1)) {
log_error("Cannot find \"%s\" in the configuration.",
cl.site);
return -EINVAL;
}
local->local = 1;
} else
find_myself(NULL, type == CLIENT || type == GEOSTORE);
rv = check_config(type);
if (rv < 0)
goto out;
/* Per default the PID file name is derived from the
* configuration name. */
if (!cl.lockfile[0]) {
snprintf(cl.lockfile, sizeof(cl.lockfile)-1,
"%s/%s.pid", BOOTH_RUN_DIR, booth_conf->name);
}
out:
return rv;
} | 214 | True | 1 |
||
CVE-2022-2652 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:H | LOCAL | LOW | HIGH | NONE | UNCHANGED | HIGH | NONE | HIGH | 6.0 | MEDIUM | 0.8 | 5.2 | nan | [{'url': 'https://huntr.dev/bounties/1b055da5-7a9e-4409-99d7-030280d242d5', 'name': 'https://huntr.dev/bounties/1b055da5-7a9e-4409-99d7-030280d242d5', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/umlaeute/v4l2loopback/commit/e4cd225557486c420f6a34411f98c575effd43dd', 'name': 'https://github.com/umlaeute/v4l2loopback/commit/e4cd225557486c420f6a34411f98c575effd43dd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-134'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:v4l2loopback_project:v4l2loopback:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.12.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Depending on the way the format strings in the card label are crafted it's possible to leak kernel stack memory. There is also the possibility for DoS due to the v4l2loopback kernel module crashing when providing the card label on request (reproduce e.g. with many %s modifiers in a row)."}] | 2022-08-10T13:40Z | 2022-08-04T10:15Z | Use of Externally-Controlled Format String | The software uses a function that accepts a format string as an argument, but the format string originates from an external source. |
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems.
It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
| https://cwe.mitre.org/data/definitions/134.html | 0 | IOhannes m zmölnig | 2022-08-03 15:09:17+02:00 | add explicit format specifier to printf() invocations
CWE-134 | e4cd225557486c420f6a34411f98c575effd43dd | False | umlaeute/v4l2loopback | v4l2-loopback device | 2010-09-24 09:59:39 | 2022-08-27 10:29:28 | umlaeute | 2900.0 | 440.0 | vidioc_querycap | vidioc_querycap( struct file * file , void * priv , struct v4l2_capability * cap) | ['file', 'priv', 'cap'] | static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct v4l2_loopback_device *dev = v4l2loopback_getdevice(file);
int labellen = (sizeof(cap->card) < sizeof(dev->card_label)) ?
sizeof(cap->card) :
sizeof(dev->card_label);
int device_nr =
((struct v4l2loopback_private *)video_get_drvdata(dev->vdev))
->device_nr;
__u32 capabilities = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE;
strlcpy(cap->driver, "v4l2 loopback", sizeof(cap->driver));
snprintf(cap->card, labellen, dev->card_label);
snprintf(cap->bus_info, sizeof(cap->bus_info),
"platform:v4l2loopback-%03d", device_nr);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
/* since 3.1.0, the v4l2-core system is supposed to set the version */
cap->version = V4L2LOOPBACK_VERSION_CODE;
#endif
#ifdef V4L2_CAP_VIDEO_M2M
capabilities |= V4L2_CAP_VIDEO_M2M;
#endif /* V4L2_CAP_VIDEO_M2M */
if (dev->announce_all_caps) {
capabilities |= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
} else {
if (dev->ready_for_capture) {
capabilities |= V4L2_CAP_VIDEO_CAPTURE;
}
if (dev->ready_for_output) {
capabilities |= V4L2_CAP_VIDEO_OUTPUT;
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
dev->vdev->device_caps =
#endif /* >=linux-4.7.0 */
cap->device_caps = cap->capabilities = capabilities;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
cap->capabilities |= V4L2_CAP_DEVICE_CAPS;
#endif
memset(cap->reserved, 0, sizeof(cap->reserved));
return 0;
} | 226 | True | 1 |
|
CVE-2022-26530 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066596', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066596', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/swaywm/swaylock/commit/1d1c75b6316d21933069a9d201f966d84099f6ca', 'name': 'https://github.com/swaywm/swaylock/commit/1d1c75b6316d21933069a9d201f966d84099f6ca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/swaywm/swaylock/pull/219', 'name': 'https://github.com/swaywm/swaylock/pull/219', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swaywm:swaylock:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'swaylock before 1.6 allows attackers to trigger a crash and achieve unlocked access to a Wayland compositor.'}] | 2022-04-19T03:08Z | 2022-04-03T23: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 | Simon Ser | 2021-12-20 17:25:44+01:00 | Add support for ext-session-lock-v1
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131 | 1d1c75b6316d21933069a9d201f966d84099f6ca | False | swaywm/swaylock | Screen locker for Wayland | 2019-01-14 02:25:09 | 2022-06-15 08:49:32 | null | swaywm | 425.0 | 116.0 | create_layer_surface | create_layer_surface( struct swaylock_surface * surface) | ['surface'] | static void create_layer_surface(struct swaylock_surface *surface) {
struct swaylock_state *state = surface->state;
surface->image = select_image(state, surface);
surface->surface = wl_compositor_create_surface(state->compositor);
assert(surface->surface);
surface->child = wl_compositor_create_surface(state->compositor);
assert(surface->child);
surface->subsurface = wl_subcompositor_get_subsurface(state->subcompositor, surface->child, surface->surface);
assert(surface->subsurface);
wl_subsurface_set_sync(surface->subsurface);
surface->layer_surface = zwlr_layer_shell_v1_get_layer_surface(
state->layer_shell, surface->surface, surface->output,
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY, "lockscreen");
assert(surface->layer_surface);
zwlr_layer_surface_v1_set_size(surface->layer_surface, 0, 0);
zwlr_layer_surface_v1_set_anchor(surface->layer_surface,
ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT);
zwlr_layer_surface_v1_set_exclusive_zone(surface->layer_surface, -1);
zwlr_layer_surface_v1_set_keyboard_interactivity(
surface->layer_surface, true);
zwlr_layer_surface_v1_add_listener(surface->layer_surface,
&layer_surface_listener, surface);
if (surface_is_opaque(surface) &&
surface->state->args.mode != BACKGROUND_MODE_CENTER &&
surface->state->args.mode != BACKGROUND_MODE_FIT) {
struct wl_region *region =
wl_compositor_create_region(surface->state->compositor);
wl_region_add(region, 0, 0, INT32_MAX, INT32_MAX);
wl_surface_set_opaque_region(surface->surface, region);
wl_region_destroy(region);
}
wl_surface_commit(surface->surface);
} | 262 | True | 1 |
CVE-2022-26530 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066596', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066596', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/swaywm/swaylock/commit/1d1c75b6316d21933069a9d201f966d84099f6ca', 'name': 'https://github.com/swaywm/swaylock/commit/1d1c75b6316d21933069a9d201f966d84099f6ca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/swaywm/swaylock/pull/219', 'name': 'https://github.com/swaywm/swaylock/pull/219', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swaywm:swaylock:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'swaylock before 1.6 allows attackers to trigger a crash and achieve unlocked access to a Wayland compositor.'}] | 2022-04-19T03:08Z | 2022-04-03T23: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 | Simon Ser | 2021-12-20 17:25:44+01:00 | Add support for ext-session-lock-v1
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131 | 1d1c75b6316d21933069a9d201f966d84099f6ca | False | swaywm/swaylock | Screen locker for Wayland | 2019-01-14 02:25:09 | 2022-06-15 08:49:32 | null | swaywm | 425.0 | 116.0 | handle_global | handle_global( void * data , struct wl_registry * registry , uint32_t name , const char * interface , uint32_t version) | ['data', 'registry', 'name', 'interface', 'version'] | static void handle_global(void *data, struct wl_registry *registry,
uint32_t name, const char *interface, uint32_t version) {
struct swaylock_state *state = data;
if (strcmp(interface, wl_compositor_interface.name) == 0) {
state->compositor = wl_registry_bind(registry, name,
&wl_compositor_interface, 4);
} else if (strcmp(interface, wl_subcompositor_interface.name) == 0) {
state->subcompositor = wl_registry_bind(registry, name,
&wl_subcompositor_interface, 1);
} else if (strcmp(interface, wl_shm_interface.name) == 0) {
state->shm = wl_registry_bind(registry, name,
&wl_shm_interface, 1);
} else if (strcmp(interface, wl_seat_interface.name) == 0) {
struct wl_seat *seat = wl_registry_bind(
registry, name, &wl_seat_interface, 4);
struct swaylock_seat *swaylock_seat =
calloc(1, sizeof(struct swaylock_seat));
swaylock_seat->state = state;
wl_seat_add_listener(seat, &seat_listener, swaylock_seat);
} else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
state->layer_shell = wl_registry_bind(
registry, name, &zwlr_layer_shell_v1_interface, 1);
} else if (strcmp(interface, zwlr_input_inhibit_manager_v1_interface.name) == 0) {
state->input_inhibit_manager = wl_registry_bind(
registry, name, &zwlr_input_inhibit_manager_v1_interface, 1);
} else if (strcmp(interface, zxdg_output_manager_v1_interface.name) == 0) {
state->zxdg_output_manager = wl_registry_bind(
registry, name, &zxdg_output_manager_v1_interface, 2);
} else if (strcmp(interface, wl_output_interface.name) == 0) {
struct swaylock_surface *surface =
calloc(1, sizeof(struct swaylock_surface));
surface->state = state;
surface->output = wl_registry_bind(registry, name,
&wl_output_interface, 3);
surface->output_global_name = name;
wl_output_add_listener(surface->output, &_wl_output_listener, surface);
wl_list_insert(&state->surfaces, &surface->link);
if (state->run_display) {
create_layer_surface(surface);
wl_display_roundtrip(state->display);
}
}
} | 392 | True | 1 |
CVE-2022-26530 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066596', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066596', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/swaywm/swaylock/commit/1d1c75b6316d21933069a9d201f966d84099f6ca', 'name': 'https://github.com/swaywm/swaylock/commit/1d1c75b6316d21933069a9d201f966d84099f6ca', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/swaywm/swaylock/pull/219', 'name': 'https://github.com/swaywm/swaylock/pull/219', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:swaywm:swaylock:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.6', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'swaylock before 1.6 allows attackers to trigger a crash and achieve unlocked access to a Wayland compositor.'}] | 2022-04-19T03:08Z | 2022-04-03T23: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 | Simon Ser | 2021-12-20 17:25:44+01:00 | Add support for ext-session-lock-v1
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131 | 1d1c75b6316d21933069a9d201f966d84099f6ca | False | swaywm/swaylock | Screen locker for Wayland | 2019-01-14 02:25:09 | 2022-06-15 08:49:32 | null | swaywm | 425.0 | 116.0 | main | main( int argc , char ** argv) | ['argc', 'argv'] | int main(int argc, char **argv) {
swaylock_log_init(LOG_ERROR);
initialize_pw_backend(argc, argv);
srand(time(NULL));
enum line_mode line_mode = LM_LINE;
state.failed_attempts = 0;
state.args = (struct swaylock_args){
.mode = BACKGROUND_MODE_FILL,
.font = strdup("sans-serif"),
.font_size = 0,
.radius = 50,
.thickness = 10,
.indicator_x_position = 0,
.indicator_y_position = 0,
.override_indicator_x_position = false,
.override_indicator_y_position = false,
.ignore_empty = false,
.show_indicator = true,
.show_caps_lock_indicator = false,
.show_caps_lock_text = true,
.show_keyboard_layout = false,
.hide_keyboard_layout = false,
.show_failed_attempts = false,
.indicator_idle_visible = false
};
wl_list_init(&state.images);
set_default_colors(&state.args.colors);
char *config_path = NULL;
int result = parse_options(argc, argv, NULL, NULL, &config_path);
if (result != 0) {
free(config_path);
return result;
}
if (!config_path) {
config_path = get_config_path();
}
if (config_path) {
swaylock_log(LOG_DEBUG, "Found config at %s", config_path);
int config_status = load_config(config_path, &state, &line_mode);
free(config_path);
if (config_status != 0) {
free(state.args.font);
return config_status;
}
}
if (argc > 1) {
swaylock_log(LOG_DEBUG, "Parsing CLI Args");
int result = parse_options(argc, argv, &state, &line_mode, NULL);
if (result != 0) {
free(state.args.font);
return result;
}
}
if (line_mode == LM_INSIDE) {
state.args.colors.line = state.args.colors.inside;
} else if (line_mode == LM_RING) {
state.args.colors.line = state.args.colors.ring;
}
#ifdef __linux__
// Most non-linux platforms require root to mlock()
if (mlock(state.password.buffer, sizeof(state.password.buffer)) != 0) {
swaylock_log(LOG_ERROR, "Unable to mlock() password memory.");
return EXIT_FAILURE;
}
#endif
wl_list_init(&state.surfaces);
state.xkb.context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
state.display = wl_display_connect(NULL);
if (!state.display) {
free(state.args.font);
swaylock_log(LOG_ERROR, "Unable to connect to the compositor. "
"If your compositor is running, check or set the "
"WAYLAND_DISPLAY environment variable.");
return EXIT_FAILURE;
}
struct wl_registry *registry = wl_display_get_registry(state.display);
wl_registry_add_listener(registry, ®istry_listener, &state);
wl_display_roundtrip(state.display);
assert(state.compositor && state.layer_shell && state.shm);
if (!state.input_inhibit_manager) {
free(state.args.font);
swaylock_log(LOG_ERROR, "Compositor does not support the input "
"inhibitor protocol, refusing to run insecurely");
return 1;
}
zwlr_input_inhibit_manager_v1_get_inhibitor(state.input_inhibit_manager);
if (wl_display_roundtrip(state.display) == -1) {
free(state.args.font);
swaylock_log(LOG_ERROR, "Exiting - failed to inhibit input:"
" is another lockscreen already running?");
return 2;
}
if (state.zxdg_output_manager) {
struct swaylock_surface *surface;
wl_list_for_each(surface, &state.surfaces, link) {
surface->xdg_output = zxdg_output_manager_v1_get_xdg_output(
state.zxdg_output_manager, surface->output);
zxdg_output_v1_add_listener(
surface->xdg_output, &_xdg_output_listener, surface);
}
wl_display_roundtrip(state.display);
} else {
swaylock_log(LOG_INFO, "Compositor does not support zxdg output "
"manager, images assigned to named outputs will not work");
}
struct swaylock_surface *surface;
wl_list_for_each(surface, &state.surfaces, link) {
create_layer_surface(surface);
}
if (state.args.daemonize) {
wl_display_roundtrip(state.display);
daemonize();
}
state.eventloop = loop_create();
loop_add_fd(state.eventloop, wl_display_get_fd(state.display), POLLIN,
display_in, NULL);
loop_add_fd(state.eventloop, get_comm_reply_fd(), POLLIN, comm_in, NULL);
state.run_display = true;
while (state.run_display) {
errno = 0;
if (wl_display_flush(state.display) == -1 && errno != EAGAIN) {
break;
}
loop_poll(state.eventloop);
}
free(state.args.font);
return 0;
} | 791 | True | 1 |
CVE-2022-26691 | False | False | False | False | AV:L/AC:L/Au:N/C:C/I:C/A:C | LOCAL | LOW | NONE | COMPLETE | COMPLETE | COMPLETE | 7.2 | CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | HIGH | NONE | UNCHANGED | HIGH | HIGH | HIGH | 6.7 | MEDIUM | 0.8 | 5.9 | False | [{'url': 'https://support.apple.com/en-us/HT213184', 'name': 'https://support.apple.com/en-us/HT213184', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://support.apple.com/en-us/HT213185', 'name': 'https://support.apple.com/en-us/HT213185', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://support.apple.com/en-us/HT213183', 'name': 'https://support.apple.com/en-us/HT213183', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/mandiant/Vulnerability-Disclosures/blob/master/2022/MNDT-2022-0026/MNDT-2022-0026.md', 'name': 'https://github.com/mandiant/Vulnerability-Disclosures/blob/master/2022/MNDT-2022-0026/MNDT-2022-0026.md', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00039.html', 'name': '[debian-lts-announce] 20220527 [SECURITY] [DLA 3029-1] cups security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5149', 'name': 'DSA-5149', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/KQ6TD7F3VRITPEHFDHZHK7MU6FEBMZ5U/', 'name': 'FEDORA-2022-09a89bc265', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/OpenPrinting/cups/commit/de4f8c196106033e4c372dce3e91b9d42b0b9444', 'name': 'https://github.com/OpenPrinting/cups/commit/de4f8c196106033e4c372dce3e91b9d42b0b9444', 'refsource': 'MISC', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YQRIT4H75XV6M42K7ZTARWZ7YLLYQHPO/', 'name': 'FEDORA-2022-39e057bc6d', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-269'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionStartIncluding': '10.15', 'versionEndExcluding': '10.15.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:supplemental_update:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-005:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2020:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-003:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-006:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-008:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2021-007:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartIncluding': '11.0', 'versionEndExcluding': '11.6.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-002:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:10.15.7:security_update_2022-001:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*', 'versionStartExcluding': '12.0.0', 'versionEndExcluding': '12.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:apple:cups:*:*:*:*:*:*:*:*', 'versionEndExcluding': '499.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openprinting:cups:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.4.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A logic issue was addressed with improved state management. This issue is fixed in Security Update 2022-003 Catalina, macOS Monterey 12.3, macOS Big Sur 11.6.5. An application may be able to gain elevated privileges.'}] | 2022-06-16T04:15Z | 2022-05-26T18:15Z | Improper Privilege Management | The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. | https://cwe.mitre.org/data/definitions/269.html | 0 | Zdenek Dohnal | 2022-05-26 06:27:04+02:00 | scheduler/cert.c: Fix string comparison (fixes CVE-2022-26691)
The previous algorithm didn't expect the strings can have a different
length, so one string can be a substring of the other and such substring
was reported as equal to the longer string. | de4f8c196106033e4c372dce3e91b9d42b0b9444 | False | OpenPrinting/cups | OpenPrinting CUPS Sources | 2020-09-03 19:43:01 | 2022-08-26 09:45:18 | https://openprinting.github.io/cups | OpenPrinting | 519.0 | 89.0 | ctcompare | ctcompare( const char * a , const char * b) | ['a', 'b'] | ctcompare(const char *a, /* I - First string */
const char *b) /* I - Second string */
{
int result = 0; /* Result */
while (*a && *b)
{
result |= *a ^ *b;
a ++;
b ++;
}
return (result);
} | 48 | True | 1 |
|
CVE-2022-27470 | 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/libsdl-org/SDL_ttf/commit/db1b41ab8bde6723c24b866e466cad78c2fa0448', 'name': 'https://github.com/libsdl-org/SDL_ttf/commit/db1b41ab8bde6723c24b866e466cad78c2fa0448', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libsdl-org/SDL_ttf/issues/187', 'name': 'https://github.com/libsdl-org/SDL_ttf/issues/187', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EAGMQMRQDTZFQW64JEW3O6HY3JYLAAHT/', 'name': 'FEDORA-2022-600e0cba93', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XPYTEBBNHCDGPVFACC5RC5K2FZUCYTPZ/', 'name': 'FEDORA-2022-280ac942be', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/RXI3MDPR24W5557G34YHWOP2MOK6BTGB/', 'name': 'FEDORA-2022-857d1f7050', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libsdl:sdl_ttf:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.0.18', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'SDL_ttf v2.0.18 and below was discovered to contain an arbitrary memory write via the function TTF_RenderText_Solid(). This vulnerability is triggered via a crafted TTF file.'}] | 2022-05-12T19:43Z | 2022-05-04T03: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 | Sylvain | 2022-03-19 20:40:28+01:00 | More integer overflow (see bug #187)
Make sure that 'width + alignment' doesn't overflow, otherwise
it could create a SDL_Surface of 'width' but with wrong 'pitch' | db1b41ab8bde6723c24b866e466cad78c2fa0448 | False | libsdl-org/SDL_ttf | Support for TrueType (.ttf) font files with Simple Directmedia Layer. | 2021-02-10 14:17:12 | 2022-08-19 17:44:52 | libsdl-org | 152.0 | 75.0 | Create_Surface_Blended | Create_Surface_Blended( int width , int height , SDL_Color fg , Uint32 * color) | ['width', 'height', 'fg', 'color'] |
static SDL_Surface *Create_Surface_Blended(int width, int height, SDL_Color fg, Uint32 *color)
{
const int alignment = Get_Alignement() - 1;
SDL_Surface *textbuf = NULL;
Uint32 bgcolor;
/* Background color */
bgcolor = (fg.r << 16) | (fg.g << 8) | fg.b;
/* Underline/Strikethrough color style */
*color = bgcolor | (fg.a << 24);
/* Create the target surface if required */
if (width != 0) {
/* Create a surface with memory:
* - pitch is rounded to alignment
* - adress is aligned
*/
Sint64 size;
void *pixels, *ptr;
/* Worse case at the end of line pulling 'alignment' extra blank pixels */
Sint64 pitch = (width + alignment) * 4;
pitch += alignment;
pitch &= ~alignment;
size = height * pitch + sizeof (void *) + alignment;
if (size < 0 || size > SDL_MAX_SINT32) {
/* Overflow... */
return NULL;
}
ptr = SDL_malloc((size_t)size);
if (ptr == NULL) {
return NULL;
}
/* address is aligned */
pixels = (void *)(((uintptr_t)ptr + sizeof(void *) + alignment) & ~alignment);
((void **)pixels)[-1] = ptr;
textbuf = SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, SDL_PIXELFORMAT_ARGB8888);
if (textbuf == NULL) {
SDL_free(ptr);
return NULL;
}
/* Let SDL handle the memory allocation */
textbuf->flags &= ~SDL_PREALLOC;
textbuf->flags |= SDL_SIMD_ALIGNED;
/* Initialize with fg and 0 alpha */
SDL_memset4(pixels, bgcolor, (height * pitch) / 4);
/* Support alpha blending */
if (fg.a != SDL_ALPHA_OPAQUE) {
SDL_SetSurfaceBlendMode(textbuf, SDL_BLENDMODE_BLEND);
}
}
return textbuf; | 280 | True | 1 |
|
CVE-2022-27470 | 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/libsdl-org/SDL_ttf/commit/db1b41ab8bde6723c24b866e466cad78c2fa0448', 'name': 'https://github.com/libsdl-org/SDL_ttf/commit/db1b41ab8bde6723c24b866e466cad78c2fa0448', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libsdl-org/SDL_ttf/issues/187', 'name': 'https://github.com/libsdl-org/SDL_ttf/issues/187', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EAGMQMRQDTZFQW64JEW3O6HY3JYLAAHT/', 'name': 'FEDORA-2022-600e0cba93', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XPYTEBBNHCDGPVFACC5RC5K2FZUCYTPZ/', 'name': 'FEDORA-2022-280ac942be', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/RXI3MDPR24W5557G34YHWOP2MOK6BTGB/', 'name': 'FEDORA-2022-857d1f7050', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libsdl:sdl_ttf:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.0.18', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'SDL_ttf v2.0.18 and below was discovered to contain an arbitrary memory write via the function TTF_RenderText_Solid(). This vulnerability is triggered via a crafted TTF file.'}] | 2022-05-12T19:43Z | 2022-05-04T03: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 | Sylvain | 2022-03-19 20:40:28+01:00 | More integer overflow (see bug #187)
Make sure that 'width + alignment' doesn't overflow, otherwise
it could create a SDL_Surface of 'width' but with wrong 'pitch' | db1b41ab8bde6723c24b866e466cad78c2fa0448 | False | libsdl-org/SDL_ttf | Support for TrueType (.ttf) font files with Simple Directmedia Layer. | 2021-02-10 14:17:12 | 2022-08-19 17:44:52 | libsdl-org | 152.0 | 75.0 | Create_Surface_Shaded | Create_Surface_Shaded( int width , int height , SDL_Color fg , SDL_Color bg , Uint32 * color) | ['width', 'height', 'fg', 'bg', 'color'] |
static SDL_Surface* Create_Surface_Shaded(int width, int height, SDL_Color fg, SDL_Color bg, Uint32 *color)
{
const int alignment = Get_Alignement() - 1;
SDL_Surface *textbuf;
Sint64 size;
Uint8 bg_alpha = bg.a;
/* Create a surface with memory:
* - pitch is rounded to alignment
* - adress is aligned
*/
void *pixels, *ptr;
/* Worse case at the end of line pulling 'alignment' extra blank pixels */
Sint64 pitch = width + alignment;
pitch += alignment;
pitch &= ~alignment;
size = height * pitch + sizeof (void *) + alignment;
if (size < 0 || size > SDL_MAX_SINT32) {
/* Overflow... */
return NULL;
}
ptr = SDL_malloc((size_t)size);
if (ptr == NULL) {
return NULL;
}
/* address is aligned */
pixels = (void *)(((uintptr_t)ptr + sizeof(void *) + alignment) & ~alignment);
((void **)pixels)[-1] = ptr;
textbuf = SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, SDL_PIXELFORMAT_INDEX8);
if (textbuf == NULL) {
SDL_free(ptr);
return NULL;
}
/* Let SDL handle the memory allocation */
textbuf->flags &= ~SDL_PREALLOC;
textbuf->flags |= SDL_SIMD_ALIGNED;
/* Initialize with background to 0 */
SDL_memset(pixels, 0, height * pitch);
/* Underline/Strikethrough color style */
*color = NUM_GRAYS - 1;
/* Support alpha blending */
if (fg.a != SDL_ALPHA_OPAQUE || bg.a != SDL_ALPHA_OPAQUE) {
SDL_SetSurfaceBlendMode(textbuf, SDL_BLENDMODE_BLEND);
/* Would disturb alpha palette */
if (bg.a == SDL_ALPHA_OPAQUE) {
bg.a = 0;
}
}
/* Fill the palette with NUM_GRAYS levels of shading from bg to fg */
{
SDL_Palette *palette = textbuf->format->palette;
int rdiff = fg.r - bg.r;
int gdiff = fg.g - bg.g;
int bdiff = fg.b - bg.b;
int adiff = fg.a - bg.a;
int sign_r = (rdiff >= 0) ? 1 : 255;
int sign_g = (gdiff >= 0) ? 1 : 255;
int sign_b = (bdiff >= 0) ? 1 : 255;
int sign_a = (adiff >= 0) ? 1 : 255;
int i;
for (i = 0; i < NUM_GRAYS; ++i) {
/* Compute color[i] = (i * color_diff / 255) */
int tmp_r = i * rdiff;
int tmp_g = i * gdiff;
int tmp_b = i * bdiff;
int tmp_a = i * adiff;
palette->colors[i].r = (Uint8)(bg.r + DIVIDE_BY_255_SIGNED(tmp_r, sign_r));
palette->colors[i].g = (Uint8)(bg.g + DIVIDE_BY_255_SIGNED(tmp_g, sign_g));
palette->colors[i].b = (Uint8)(bg.b + DIVIDE_BY_255_SIGNED(tmp_b, sign_b));
palette->colors[i].a = (Uint8)(bg.a + DIVIDE_BY_255_SIGNED(tmp_a, sign_a));
}
/* Make sure background has the correct alpha value */
palette->colors[0].a = bg_alpha;
}
return textbuf; | 525 | True | 1 |
|
CVE-2022-27470 | 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/libsdl-org/SDL_ttf/commit/db1b41ab8bde6723c24b866e466cad78c2fa0448', 'name': 'https://github.com/libsdl-org/SDL_ttf/commit/db1b41ab8bde6723c24b866e466cad78c2fa0448', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libsdl-org/SDL_ttf/issues/187', 'name': 'https://github.com/libsdl-org/SDL_ttf/issues/187', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EAGMQMRQDTZFQW64JEW3O6HY3JYLAAHT/', 'name': 'FEDORA-2022-600e0cba93', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/XPYTEBBNHCDGPVFACC5RC5K2FZUCYTPZ/', 'name': 'FEDORA-2022-280ac942be', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/RXI3MDPR24W5557G34YHWOP2MOK6BTGB/', 'name': 'FEDORA-2022-857d1f7050', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libsdl:sdl_ttf:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.0.18', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'SDL_ttf v2.0.18 and below was discovered to contain an arbitrary memory write via the function TTF_RenderText_Solid(). This vulnerability is triggered via a crafted TTF file.'}] | 2022-05-12T19:43Z | 2022-05-04T03: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 | Sylvain | 2022-03-19 20:40:28+01:00 | More integer overflow (see bug #187)
Make sure that 'width + alignment' doesn't overflow, otherwise
it could create a SDL_Surface of 'width' but with wrong 'pitch' | db1b41ab8bde6723c24b866e466cad78c2fa0448 | False | libsdl-org/SDL_ttf | Support for TrueType (.ttf) font files with Simple Directmedia Layer. | 2021-02-10 14:17:12 | 2022-08-19 17:44:52 | libsdl-org | 152.0 | 75.0 | Create_Surface_Solid | Create_Surface_Solid( int width , int height , SDL_Color fg , Uint32 * color) | ['width', 'height', 'fg', 'color'] |
static SDL_Surface* Create_Surface_Solid(int width, int height, SDL_Color fg, Uint32 *color)
{
const int alignment = Get_Alignement() - 1;
SDL_Surface *textbuf;
Sint64 size;
/* Create a surface with memory:
* - pitch is rounded to alignment
* - adress is aligned
*/
void *pixels, *ptr;
/* Worse case at the end of line pulling 'alignment' extra blank pixels */
Sint64 pitch = width + alignment;
pitch += alignment;
pitch &= ~alignment;
size = height * pitch + sizeof (void *) + alignment;
if (size < 0 || size > SDL_MAX_SINT32) {
/* Overflow... */
return NULL;
}
ptr = SDL_malloc((size_t)size);
if (ptr == NULL) {
return NULL;
}
/* address is aligned */
pixels = (void *)(((uintptr_t)ptr + sizeof(void *) + alignment) & ~alignment);
((void **)pixels)[-1] = ptr;
textbuf = SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, SDL_PIXELFORMAT_INDEX8);
if (textbuf == NULL) {
SDL_free(ptr);
return NULL;
}
/* Let SDL handle the memory allocation */
textbuf->flags &= ~SDL_PREALLOC;
textbuf->flags |= SDL_SIMD_ALIGNED;
/* Initialize with background to 0 */
SDL_memset(pixels, 0, height * pitch);
/* Underline/Strikethrough color style */
*color = 1;
/* Fill the palette: 1 is foreground */
{
SDL_Palette *palette = textbuf->format->palette;
palette->colors[0].r = 255 - fg.r;
palette->colors[0].g = 255 - fg.g;
palette->colors[0].b = 255 - fg.b;
palette->colors[1].r = fg.r;
palette->colors[1].g = fg.g;
palette->colors[1].b = fg.b;
palette->colors[1].a = fg.a;
}
SDL_SetColorKey(textbuf, SDL_TRUE, 0);
return textbuf; | 327 | True | 1 |
|
CVE-2022-27650 | False | False | False | False | 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:H/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.5 | HIGH | 1.6 | 5.9 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066845', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2066845', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/containers/crun/commit/1aeeed2e4fdeffb4875c0d0b439915894594c8c6', 'name': 'https://github.com/containers/crun/commit/1aeeed2e4fdeffb4875c0d0b439915894594c8c6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/containers/crun/security/advisories/GHSA-wr4f-w546-m398', 'name': 'https://github.com/containers/crun/security/advisories/GHSA-wr4f-w546-m398', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/HYIGABCZ7ZHAG2XCOGITTQRJU2ASWMFA/', 'name': 'FEDORA-2022-10fd054d40', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Release Notes', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-276'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:crun_project:crun:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.4.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openshift_container_platform:4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in crun where containers were incorrectly started with non-empty default permissions. A vulnerability was found in Moby (Docker Engine) where containers were started incorrectly with non-empty inheritable Linux process capabilities. This flaw allows an attacker with access to programs with inheritable file capabilities to elevate those capabilities to the permitted set when execve(2) runs.'}] | 2022-04-13T17:12Z | 2022-04-04T20:15Z | Incorrect Default Permissions | During installation, installed file permissions are set to allow anyone to modify those files. | https://cwe.mitre.org/data/definitions/276.html | 0 | Giuseppe Scrivano | 2022-02-28 11:06:50+01:00 | exec: --cap do not set inheritable capabilities
Closes: CVE-2022-27650
Signed-off-by: Giuseppe Scrivano <[email protected]> | 1aeeed2e4fdeffb4875c0d0b439915894594c8c6 | False | containers/crun | A fast and lightweight fully featured OCI runtime and C library for running containers | 2017-09-13 20:20:58 | 2022-08-25 15:24:26 | containers | 1789.0 | 194.0 | crun_command_exec | crun_command_exec( struct crun_global_arguments * global_args , int argc , char ** argv , libcrun_error_t * err) | ['global_args', 'argc', 'argv', 'err'] | crun_command_exec (struct crun_global_arguments *global_args, int argc, char **argv, libcrun_error_t *err)
{
int first_arg = 0, ret = 0;
libcrun_context_t crun_context = {
0,
};
cleanup_process_schema runtime_spec_schema_config_schema_process *process = NULL;
struct libcrun_container_exec_options_s exec_opts;
memset (&exec_opts, 0, sizeof (exec_opts));
exec_opts.struct_size = sizeof (exec_opts);
crun_context.preserve_fds = 0;
crun_context.listen_fds = 0;
argp_parse (&run_argp, argc, argv, ARGP_IN_ORDER, &first_arg, &exec_options);
crun_assert_n_args (argc - first_arg, exec_options.process ? 1 : 2, -1);
ret = init_libcrun_context (&crun_context, argv[first_arg], global_args, err);
if (UNLIKELY (ret < 0))
return ret;
crun_context.detach = exec_options.detach;
crun_context.console_socket = exec_options.console_socket;
crun_context.pid_file = exec_options.pid_file;
crun_context.preserve_fds = exec_options.preserve_fds;
if (getenv ("LISTEN_FDS"))
{
crun_context.listen_fds = strtoll (getenv ("LISTEN_FDS"), NULL, 10);
crun_context.preserve_fds += crun_context.listen_fds;
}
if (exec_options.process)
exec_opts.path = exec_options.process;
else
{
process = xmalloc0 (sizeof (*process));
int i;
process->args_len = argc;
process->args = xmalloc0 ((argc + 1) * sizeof (*process->args));
for (i = 0; i < argc - first_arg; i++)
process->args[i] = xstrdup (argv[first_arg + i + 1]);
process->args[i] = NULL;
if (exec_options.cwd)
process->cwd = exec_options.cwd;
process->terminal = exec_options.tty;
process->env = exec_options.env;
process->env_len = exec_options.env_size;
process->user = make_oci_process_user (exec_options.user);
if (exec_options.process_label != NULL)
process->selinux_label = exec_options.process_label;
if (exec_options.apparmor != NULL)
process->apparmor_profile = exec_options.apparmor;
if (exec_options.cap_size > 0)
{
runtime_spec_schema_config_schema_process_capabilities *capabilities
= xmalloc (sizeof (runtime_spec_schema_config_schema_process_capabilities));
capabilities->effective = exec_options.cap;
capabilities->effective_len = exec_options.cap_size;
capabilities->inheritable = dup_array (exec_options.cap, exec_options.cap_size);
capabilities->inheritable_len = exec_options.cap_size;
capabilities->bounding = dup_array (exec_options.cap, exec_options.cap_size);
capabilities->bounding_len = exec_options.cap_size;
capabilities->ambient = dup_array (exec_options.cap, exec_options.cap_size);
capabilities->ambient_len = exec_options.cap_size;
capabilities->permitted = dup_array (exec_options.cap, exec_options.cap_size);
capabilities->permitted_len = exec_options.cap_size;
process->capabilities = capabilities;
}
// noNewPriviledges will remain `false` if basespec has `false` unless specified
// Default is always `true` in generated basespec config
if (exec_options.no_new_privs)
process->no_new_privileges = 1;
exec_opts.process = process;
}
exec_opts.cgroup = exec_options.cgroup;
return libcrun_container_exec_with_options (&crun_context, argv[first_arg], &exec_opts, err);
} | 573 | True | 1 |
||
CVE-2022-28044 | 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/ckolivas/lrzip/commit/5faf80cd53ecfd16b636d653483144cd12004f46', 'name': 'https://github.com/ckolivas/lrzip/commit/5faf80cd53ecfd16b636d653483144cd12004f46', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ckolivas/lrzip/issues/216', 'name': 'https://github.com/ckolivas/lrzip/issues/216', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00016.html', 'name': '[debian-lts-announce] 20220514 [SECURITY] [DLA 3005-1] lrzip security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5145', 'name': 'DSA-5145', 'refsource': 'DEBIAN', '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:irzip_project:irzip:0.640:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Irzip v0.640 was discovered to contain a heap memory corruption via the component lrzip.c:initialise_control.'}] | 2022-07-22T09:47Z | 2022-04-15T14: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 | Con Kolivas | 2022-02-25 22:35:20+11:00 | Fix control->suffix being deallocated as heap memory as reported by Pietro Borrello. | 5faf80cd53ecfd16b636d653483144cd12004f46 | False | ckolivas/lrzip | Long Range Zip | 2010-03-28 23:03:27 | 2022-07-13 23:57:55 | http://lrzip.kolivas.org | ckolivas | 482.0 | 64.0 | initialise_control | initialise_control( rzip_control * control) | ['control'] | bool initialise_control(rzip_control *control)
{
time_t now_t, tdiff;
char localeptr[] = "./", *eptr; /* for environment */
size_t len;
memset(control, 0, sizeof(rzip_control));
control->msgout = stderr;
control->msgerr = stderr;
register_outputfile(control, control->msgout);
control->flags = FLAG_SHOW_PROGRESS | FLAG_KEEP_FILES | FLAG_THRESHOLD;
control->suffix = ".lrz";
control->compression_level = 7;
control->ramsize = get_ram(control);
if (unlikely(control->ramsize == -1))
return false;
/* for testing single CPU */
control->threads = PROCESSORS; /* get CPUs for LZMA */
control->page_size = PAGE_SIZE;
control->nice_val = 19;
/* The first 5 bytes of the salt is the time in seconds.
* The next 2 bytes encode how many times to hash the password.
* The last 9 bytes are random data, making 16 bytes of salt */
if (unlikely((now_t = time(NULL)) == ((time_t)-1)))
fatal_return(("Failed to call time in main\n"), false);
if (unlikely(now_t < T_ZERO)) {
print_output("Warning your time reads before the year 2011, check your system clock\n");
now_t = T_ZERO;
}
/* Workaround for CPUs no longer keeping up with Moore's law!
* This way we keep the magic header format unchanged. */
tdiff = (now_t - T_ZERO) / 4;
now_t = T_ZERO + tdiff;
control->secs = now_t;
control->encloops = nloops(control->secs, control->salt, control->salt + 1);
if (unlikely(!get_rand(control, control->salt + 2, 6)))
return false;
/* Get Temp Dir. Try variations on canonical unix environment variable */
eptr = getenv("TMPDIR");
if (!eptr)
eptr = getenv("TMP");
if (!eptr)
eptr = getenv("TEMPDIR");
if (!eptr)
eptr = getenv("TEMP");
if (!eptr)
eptr = localeptr;
len = strlen(eptr);
control->tmpdir = malloc(len + 2);
if (control->tmpdir == NULL)
fatal_return(("Failed to allocate for tmpdir\n"), false);
strcpy(control->tmpdir, eptr);
if (control->tmpdir[len - 1] != '/') {
control->tmpdir[len] = '/'; /* need a trailing slash */
control->tmpdir[len + 1] = '\0';
}
return true;
} | 373 | True | 1 |
CVE-2022-28044 | 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/ckolivas/lrzip/commit/5faf80cd53ecfd16b636d653483144cd12004f46', 'name': 'https://github.com/ckolivas/lrzip/commit/5faf80cd53ecfd16b636d653483144cd12004f46', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ckolivas/lrzip/issues/216', 'name': 'https://github.com/ckolivas/lrzip/issues/216', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00016.html', 'name': '[debian-lts-announce] 20220514 [SECURITY] [DLA 3005-1] lrzip security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5145', 'name': 'DSA-5145', 'refsource': 'DEBIAN', '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:irzip_project:irzip:0.640:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Irzip v0.640 was discovered to contain a heap memory corruption via the component lrzip.c:initialise_control.'}] | 2022-07-22T09:47Z | 2022-04-15T14: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 | Con Kolivas | 2022-02-25 22:35:20+11:00 | Fix control->suffix being deallocated as heap memory as reported by Pietro Borrello. | 5faf80cd53ecfd16b636d653483144cd12004f46 | False | ckolivas/lrzip | Long Range Zip | 2010-03-28 23:03:27 | 2022-07-13 23:57:55 | http://lrzip.kolivas.org | ckolivas | 482.0 | 64.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
bool lrzcat = false, compat = false, recurse = false;
bool options_file = false, conf_file_compression_set = false; /* for environment and tracking of compression setting */
struct timeval start_time, end_time;
struct sigaction handler;
double seconds,total_time; // for timers
bool nice_set = false;
int c, i;
int hours,minutes;
extern int optind;
char *eptr, *av; /* for environment */
char *endptr = NULL;
control = &base_control;
initialise_control(control);
av = basename(argv[0]);
if (!strcmp(av, "lrunzip"))
control->flags |= FLAG_DECOMPRESS;
else if (!strcmp(av, "lrzcat")) {
control->flags |= FLAG_DECOMPRESS | FLAG_STDOUT;
lrzcat = true;
} else if (!strcmp(av, "lrz")) {
/* Called in gzip compatible command line mode */
control->flags &= ~FLAG_SHOW_PROGRESS;
control->flags &= ~FLAG_KEEP_FILES;
compat = true;
long_options[1].name = "stdout";
long_options[11].name = "keep";
}
/* generate crc table */
CrcGenerateTable();
/* Get Preloaded Defaults from lrzip.conf
* Look in ., $HOME/.lrzip/, /etc/lrzip.
* If LRZIP=NOCONFIG is set, then ignore config
* If lrzip.conf sets a compression mode, options_file will be true.
* This will allow for a test to permit an override of compression mode.
* If there is an override, then all compression settings will be reset
* and command line switches will prevail, including for --lzma.
*/
eptr = getenv("LRZIP");
if (eptr == NULL)
options_file = read_config(control);
else if (!strstr(eptr,"NOCONFIG"))
options_file = read_config(control);
if (options_file && (control->flags & FLAG_NOT_LZMA)) /* if some compression set in lrzip.conf */
conf_file_compression_set = true; /* need this to allow command line override */
while ((c = getopt_long(argc, argv, compat ? coptions : loptions, long_options, &i)) != -1) {
switch (c) {
case 'b':
case 'g':
case 'l':
case 'n':
case 'z':
/* If some compression was chosen in lrzip.conf, allow this one time
* because conf_file_compression_set will be true
*/
if ((control->flags & FLAG_NOT_LZMA) && conf_file_compression_set == false)
failure("Can only use one of -l, -b, -g, -z or -n\n");
/* Select Compression Mode */
control->flags &= ~FLAG_NOT_LZMA; /* must clear all compressions first */
if (c == 'b')
control->flags |= FLAG_BZIP2_COMPRESS;
else if (c == 'g')
control->flags |= FLAG_ZLIB_COMPRESS;
else if (c == 'l')
control->flags |= FLAG_LZO_COMPRESS;
else if (c == 'n')
control->flags |= FLAG_NO_COMPRESS;
else if (c == 'z')
control->flags |= FLAG_ZPAQ_COMPRESS;
/* now FLAG_NOT_LZMA will evaluate as true */
conf_file_compression_set = false;
break;
case '/': /* LZMA Compress selected */
control->flags &= ~FLAG_NOT_LZMA; /* clear alternate compression flags */
break;
case 'c':
if (compat) {
control->flags |= FLAG_KEEP_FILES;
set_stdout(control);
break;
}
/* FALLTHRU */
case 'C':
control->flags |= FLAG_CHECK;
control->flags |= FLAG_HASH;
break;
case 'd':
control->flags |= FLAG_DECOMPRESS;
break;
case 'D':
control->flags &= ~FLAG_KEEP_FILES;
break;
case 'e':
control->flags |= FLAG_ENCRYPT;
control->passphrase = optarg;
break;
case 'f':
control->flags |= FLAG_FORCE_REPLACE;
break;
case 'h':
usage(compat);
exit(0);
break;
case 'H':
control->flags |= FLAG_HASH;
break;
case 'i':
control->flags |= FLAG_INFO;
control->flags &= ~FLAG_DECOMPRESS;
break;
case 'k':
if (compat) {
control->flags |= FLAG_KEEP_FILES;
break;
}
/* FALLTHRU */
case 'K':
control->flags |= FLAG_KEEP_BROKEN;
break;
case 'L':
if (compat) {
license();
exit(0);
}
control->compression_level = strtol(optarg, &endptr, 10);
if (control->compression_level < 1 || control->compression_level > 9)
failure("Invalid compression level (must be 1-9)\n");
if (*endptr)
failure("Extra characters after compression level: \'%s\'\n", endptr);
break;
case 'm':
control->ramsize = strtol(optarg, &endptr, 10) * 1024 * 1024 * 100;
if (*endptr)
failure("Extra characters after ramsize: \'%s\'\n", endptr);
break;
case 'N':
nice_set = true;
control->nice_val = strtol(optarg, &endptr, 10);
if (control->nice_val < PRIO_MIN || control->nice_val > PRIO_MAX)
failure("Invalid nice value (must be %d...%d)\n", PRIO_MIN, PRIO_MAX);
if (*endptr)
failure("Extra characters after nice level: \'%s\'\n", endptr);
break;
case 'o':
if (control->outdir)
failure("Cannot have -o and -O together\n");
if (unlikely(STDOUT))
failure("Cannot specify an output filename when outputting to stdout\n");
control->outname = optarg;
control->suffix = "";
break;
case 'O':
if (control->outname) /* can't mix -o and -O */
failure("Cannot have options -o and -O together\n");
if (unlikely(STDOUT))
failure("Cannot specify an output directory when outputting to stdout\n");
control->outdir = malloc(strlen(optarg) + 2);
if (control->outdir == NULL)
fatal("Failed to allocate for outdir\n");
strcpy(control->outdir,optarg);
if (strcmp(optarg+strlen(optarg) - 1, "/")) /* need a trailing slash */
strcat(control->outdir, "/");
break;
case 'p':
control->threads = strtol(optarg, &endptr, 10);
if (control->threads < 1)
failure("Must have at least one thread\n");
if (*endptr)
failure("Extra characters after number of threads: \'%s\'\n", endptr);
break;
case 'P':
control->flags |= FLAG_SHOW_PROGRESS;
break;
case 'q':
control->flags &= ~FLAG_SHOW_PROGRESS;
break;
case 'r':
recurse = true;
break;
case 'S':
if (control->outname)
failure("Specified output filename already, can't specify an extension.\n");
if (unlikely(STDOUT))
failure("Cannot specify a filename suffix when outputting to stdout\n");
control->suffix = optarg;
break;
case 't':
if (control->outname)
failure("Cannot specify an output file name when just testing.\n");
if (compat)
control->flags |= FLAG_KEEP_FILES;
if (!KEEP_FILES)
failure("Doubt that you want to delete a file when just testing.\n");
control->flags |= FLAG_TEST_ONLY;
break;
case 'T':
control->flags &= ~FLAG_THRESHOLD;
break;
case 'U':
control->flags |= FLAG_UNLIMITED;
break;
case 'v':
/* set verbosity flag */
if (!(control->flags & FLAG_SHOW_PROGRESS))
control->flags |= FLAG_SHOW_PROGRESS;
else if (!(control->flags & FLAG_VERBOSITY) && !(control->flags & FLAG_VERBOSITY_MAX))
control->flags |= FLAG_VERBOSITY;
else if ((control->flags & FLAG_VERBOSITY)) {
control->flags &= ~FLAG_VERBOSITY;
control->flags |= FLAG_VERBOSITY_MAX;
}
break;
case 'V':
control->msgout = stdout;
print_output("lrzip version %s\n", PACKAGE_VERSION);
exit(0);
break;
case 'w':
control->window = strtol(optarg, &endptr, 10);
if (control->window < 1)
failure("Window must be positive\n");
if (*endptr)
failure("Extra characters after window size: \'%s\'\n", endptr);
break;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
control->compression_level = c - '0';
break;
default:
usage(compat);
return 2;
}
}
argc -= optind;
argv += optind;
if (control->outname) {
if (argc > 1)
failure("Cannot specify output filename with more than 1 file\n");
if (recurse)
failure("Cannot specify output filename with recursive\n");
}
if (VERBOSE && !SHOW_PROGRESS) {
print_err("Cannot have -v and -q options. -v wins.\n");
control->flags |= FLAG_SHOW_PROGRESS;
}
if (UNLIMITED && control->window) {
print_err("If -U used, cannot specify a window size with -w.\n");
control->window = 0;
}
if (argc < 1)
control->flags |= FLAG_STDIN;
if (UNLIMITED && STDIN) {
print_err("Cannot have -U and stdin, unlimited mode disabled.\n");
control->flags &= ~FLAG_UNLIMITED;
}
setup_overhead(control);
/* Set the main nice value to half that of the backend threads since
* the rzip stage is usually the rate limiting step */
control->current_priority = getpriority(PRIO_PROCESS, 0);
if (nice_set) {
if (!NO_COMPRESS) {
/* If niceness can't be set. just reset process priority */
if (unlikely(setpriority(PRIO_PROCESS, 0, control->nice_val/2) == -1)) {
print_err("Warning, unable to set nice value %d...Resetting to %d\n",
control->nice_val, control->current_priority);
setpriority(PRIO_PROCESS, 0, (control->nice_val=control->current_priority));
}
} else {
if (unlikely(setpriority(PRIO_PROCESS, 0, control->nice_val) == -1)) {
print_err("Warning, unable to set nice value %d...Resetting to %d\n",
control->nice_val, control->current_priority);
setpriority(PRIO_PROCESS, 0, (control->nice_val=control->current_priority));
}
}
}
/* One extra iteration for the case of no parameters means we will default to stdin/out */
for (i = 0; i <= argc; i++) {
char *dirlist = NULL, *infile = NULL;
int direntries = 0, curentry = 0;
if (i < argc)
infile = argv[i];
else if (!(i == 0 && STDIN))
break;
if (infile) {
if ((strcmp(infile, "-") == 0))
control->flags |= FLAG_STDIN;
else {
bool isdir = false;
struct stat istat;
if (unlikely(stat(infile, &istat)))
failure("Failed to stat %s\n", infile);
isdir = S_ISDIR(istat.st_mode);
if (!recurse && (isdir || !S_ISREG(istat.st_mode))) {
failure("lrzip only works directly on regular FILES.\n"
"Use -r recursive, lrztar or pipe through tar for compressing directories.\n");
}
if (recurse && !isdir)
failure("%s not a directory, -r recursive needs a directory\n", infile);
}
}
if (recurse) {
if (unlikely(STDIN || STDOUT))
failure("Cannot use -r recursive with STDIO\n");
recurse_dirlist(infile, &dirlist, &direntries);
}
if (INFO && STDIN)
failure("Will not get file info from STDIN\n");
recursion:
if (recurse) {
if (curentry >= direntries) {
infile = NULL;
continue;
}
infile = dirlist + MAX_PATH_LEN * curentry++;
}
control->infile = infile;
/* If no output filename is specified, and we're using
* stdin, use stdout */
if ((control->outname && (strcmp(control->outname, "-") == 0)) ||
(!control->outname && STDIN) || lrzcat)
set_stdout(control);
if (lrzcat) {
control->msgout = stderr;
control->outFILE = stdout;
register_outputfile(control, control->msgout);
}
if (!STDOUT) {
control->msgout = stdout;
register_outputfile(control, control->msgout);
}
if (STDIN)
control->inFILE = stdin;
/* Implement signal handler only once flags are set */
sigemptyset(&handler.sa_mask);
handler.sa_flags = 0;
handler.sa_handler = &sighandler;
sigaction(SIGTERM, &handler, 0);
sigaction(SIGINT, &handler, 0);
if (!FORCE_REPLACE) {
if (STDIN && isatty(fileno((FILE *)stdin))) {
print_err("Will not read stdin from a terminal. Use -f to override.\n");
usage(compat);
exit (1);
}
if (!TEST_ONLY && STDOUT && isatty(fileno((FILE *)stdout)) && !compat) {
print_err("Will not write stdout to a terminal. Use -f to override.\n");
usage(compat);
exit (1);
}
}
if (CHECK_FILE) {
if (!DECOMPRESS) {
print_err("Can only check file written on decompression.\n");
control->flags &= ~FLAG_CHECK;
} else if (STDOUT) {
print_err("Can't check file written when writing to stdout. Checking disabled.\n");
control->flags &= ~FLAG_CHECK;
}
}
setup_ram(control);
show_summary();
gettimeofday(&start_time, NULL);
if (unlikely((STDIN || STDOUT) && ENCRYPT))
failure("Unable to work from STDIO while reading password\n");
memcpy(&local_control, &base_control, sizeof(rzip_control));
if (DECOMPRESS || TEST_ONLY)
decompress_file(&local_control);
else if (INFO)
get_fileinfo(&local_control);
else
compress_file(&local_control);
/* compute total time */
gettimeofday(&end_time, NULL);
total_time = (end_time.tv_sec + (double)end_time.tv_usec / 1000000) -
(start_time.tv_sec + (double)start_time.tv_usec / 1000000);
hours = (int)total_time / 3600;
minutes = (int)(total_time / 60) % 60;
seconds = total_time - hours * 3600 - minutes * 60;
if (!INFO)
print_progress("Total time: %02d:%02d:%05.2f\n", hours, minutes, seconds);
if (recurse)
goto recursion;
}
return 0;
} | 2141 | True | 1 |
CVE-2022-28927 | 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://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'name': 'https://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'name': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-434'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:subconverter_project:subconverter:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A remote code execution (RCE) vulnerability in Subconverter v0.7.2 allows attackers to execute arbitrary code via crafted config and url parameters.'}] | 2022-05-26T20:03Z | 2022-05-19T16:15Z | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | 0 | Tindy X | 2022-04-04 00:38:44+08:00 | Enhancements
Add authorization check before loading scripts.
Add detailed logs when loading preference settings. | ce8d2bd0f13f05fcbd2ed90755d097f402393dd3 | False | tindy2013/subconverter | Utility to convert between various subscription format | 2019-10-31 04:51:54 | 2022-08-23 20:22:01 | null | tindy2013 | 6729.0 | 1480.0 | addEmoji | addEmoji( const Proxy & node , const RegexMatchConfigs & emoji_array , extra_settings & ext) | ['node', 'emoji_array', 'ext'] | std::string addEmoji(const Proxy &node, const RegexMatchConfigs &emoji_array, extra_settings &ext)
{
std::string real_rule, ret;
for(const RegexMatchConfig &x : emoji_array)
{
if(!x.Script.empty())
{
std::string result;
script_safe_runner(ext.js_runtime, ext.js_context, [&](qjs::Context &ctx)
{
std::string script = x.Script;
if(startsWith(script, "path:"))
script = fileGet(script.substr(5), true);
try
{
ctx.eval(script);
auto getEmoji = (std::function<std::string(const Proxy&)>) ctx.eval("getEmoji");
ret = getEmoji(node);
if(!ret.empty())
result = ret + " " + node.Remark;
}
catch (qjs::exception)
{
script_print_stack(ctx);
}
}, global.scriptCleanContext);
if(!result.empty())
return result;
continue;
}
if(x.Replace.empty())
continue;
if(applyMatcher(x.Match, real_rule, node) && real_rule.size() && regFind(node.Remark, real_rule))
return x.Replace + " " + node.Remark;
}
return node.Remark;
} | 258 | True | 1 |
|
CVE-2022-28927 | 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://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'name': 'https://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'name': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-434'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:subconverter_project:subconverter:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A remote code execution (RCE) vulnerability in Subconverter v0.7.2 allows attackers to execute arbitrary code via crafted config and url parameters.'}] | 2022-05-26T20:03Z | 2022-05-19T16:15Z | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | 0 | Tindy X | 2022-04-04 00:38:44+08:00 | Enhancements
Add authorization check before loading scripts.
Add detailed logs when loading preference settings. | ce8d2bd0f13f05fcbd2ed90755d097f402393dd3 | False | tindy2013/subconverter | Utility to convert between various subscription format | 2019-10-31 04:51:54 | 2022-08-23 20:22:01 | null | tindy2013 | 6729.0 | 1480.0 | addNodes | addNodes( std :: string link , std :: vector<Proxy> & allNodes , int groupID , parse_settings & parse_set) | ['link', 'allNodes', 'groupID', 'parse_set'] | int addNodes(std::string link, std::vector<Proxy> &allNodes, int groupID, parse_settings &parse_set)
{
std::string &proxy = *parse_set.proxy, &subInfo = *parse_set.sub_info;
string_array &exclude_remarks = *parse_set.exclude_remarks;
string_array &include_remarks = *parse_set.include_remarks;
RegexMatchConfigs &stream_rules = *parse_set.stream_rules;
RegexMatchConfigs &time_rules = *parse_set.time_rules;
string_icase_map *request_headers = parse_set.request_header;
bool &authorized = parse_set.authorized;
ConfType linkType = ConfType::Unknow;
std::vector<Proxy> nodes;
Proxy node;
std::string strSub, extra_headers, custom_group;
// TODO: replace with startsWith if appropriate
link = replaceAllDistinct(link, "\"", "");
/// script:filepath,arg1,arg2,...
script_safe_runner(parse_set.js_runtime, parse_set.js_context, [&](qjs::Context &ctx)
{
if(startsWith(link, "script:")) /// process subscription with script
{
writeLog(0, "Found script link. Start running...", LOG_LEVEL_INFO);
string_array args = split(link.substr(7), ",");
if(args.size() >= 1)
{
std::string script = fileGet(args[0], false);
try
{
ctx.eval(script);
args.erase(args.begin()); /// remove script path
auto parse = (std::function<std::string(const std::string&, const string_array&)>) ctx.eval("parse");
switch(args.size())
{
case 0:
link = parse(std::string(), string_array());
break;
case 1:
link = parse(args[0], string_array());
break;
default:
{
std::string first = args[0];
args.erase(args.begin());
link = parse(first, args);
break;
}
}
}
catch(qjs::exception)
{
script_print_stack(ctx);
}
}
}
}, global.scriptCleanContext);
/*
duk_context *ctx = duktape_init();
defer(duk_destroy_heap(ctx);)
duktape_peval(ctx, script);
duk_get_global_string(ctx, "parse");
for(size_t i = 1; i < args.size(); i++)
duk_push_string(ctx, trim(args[i]).c_str());
if(duk_pcall(ctx, args.size() - 1) == 0)
link = duktape_get_res_str(ctx);
else
{
writeLog(0, "Error when trying to evaluate script:\n" + duktape_get_err_stack(ctx), LOG_LEVEL_ERROR);
duk_pop(ctx); /// pop err
}
*/
/// tag:group_name,link
if(startsWith(link, "tag:"))
{
string_size pos = link.find(",");
if(pos != link.npos)
{
custom_group = link.substr(4, pos - 4);
link.erase(0, pos + 1);
}
}
if(link == "nullnode")
{
node.GroupId = 0;
writeLog(0, "Adding node placeholder...");
allNodes.emplace_back(std::move(node));
return 0;
}
writeLog(LOG_TYPE_INFO, "Received Link.");
if(startsWith(link, "https://t.me/socks") || startsWith(link, "tg://socks"))
linkType = ConfType::SOCKS;
else if(startsWith(link, "https://t.me/http") || startsWith(link, "tg://http"))
linkType = ConfType::HTTP;
else if(isLink(link) || startsWith(link, "surge:///install-config"))
linkType = ConfType::SUB;
else if(startsWith(link, "Netch://"))
linkType = ConfType::Netch;
else if(fileExist(link))
linkType = ConfType::Local;
switch(linkType)
{
case ConfType::SUB:
writeLog(LOG_TYPE_INFO, "Downloading subscription data...");
if(startsWith(link, "surge:///install-config")) //surge config link
link = urlDecode(getUrlArg(link, "url"));
strSub = webGet(link, proxy, global.cacheSubscription, &extra_headers, request_headers);
/*
if(strSub.size() == 0)
{
//try to get it again with system proxy
writeLog(LOG_TYPE_WARN, "Cannot download subscription directly. Using system proxy.");
strProxy = getSystemProxy();
if(strProxy != "")
{
strSub = webGet(link, strProxy);
}
else
writeLog(LOG_TYPE_WARN, "No system proxy is set. Skipping.");
}
*/
if(strSub.size())
{
writeLog(LOG_TYPE_INFO, "Parsing subscription data...");
if(explodeConfContent(strSub, nodes) == 0)
{
writeLog(LOG_TYPE_ERROR, "Invalid subscription: '" + link + "'!");
return -1;
}
if(startsWith(strSub, "ssd://"))
{
getSubInfoFromSSD(strSub, subInfo);
}
else
{
if(!getSubInfoFromHeader(extra_headers, subInfo))
getSubInfoFromNodes(nodes, stream_rules, time_rules, subInfo);
}
filterNodes(nodes, exclude_remarks, include_remarks, groupID);
for(Proxy &x : nodes)
{
x.GroupId = groupID;
if(custom_group.size())
x.Group = custom_group;
}
copyNodes(nodes, allNodes);
}
else
{
writeLog(LOG_TYPE_ERROR, "Cannot download subscription data.");
return -1;
}
break;
case ConfType::Local:
if(!authorized)
return -1;
writeLog(LOG_TYPE_INFO, "Parsing configuration file data...");
if(explodeConf(link, nodes) == 0)
{
writeLog(LOG_TYPE_ERROR, "Invalid configuration file!");
return -1;
}
if(startsWith(strSub, "ssd://"))
{
getSubInfoFromSSD(strSub, subInfo);
}
else
{
getSubInfoFromNodes(nodes, stream_rules, time_rules, subInfo);
}
filterNodes(nodes, exclude_remarks, include_remarks, groupID);
for(Proxy &x : nodes)
{
x.GroupId = groupID;
if(custom_group.size())
x.Group = custom_group;
}
copyNodes(nodes, allNodes);
break;
default:
explode(link, node);
if(node.Type == -1)
{
writeLog(LOG_TYPE_ERROR, "No valid link found.");
return -1;
}
node.GroupId = groupID;
if(custom_group.size())
node.Group = custom_group;
allNodes.emplace_back(std::move(node));
}
return 0;
} | 969 | True | 1 |
|
CVE-2022-28927 | 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://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'name': 'https://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'name': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-434'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:subconverter_project:subconverter:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A remote code execution (RCE) vulnerability in Subconverter v0.7.2 allows attackers to execute arbitrary code via crafted config and url parameters.'}] | 2022-05-26T20:03Z | 2022-05-19T16:15Z | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | 0 | Tindy X | 2022-04-04 00:38:44+08:00 | Enhancements
Add authorization check before loading scripts.
Add detailed logs when loading preference settings. | ce8d2bd0f13f05fcbd2ed90755d097f402393dd3 | False | tindy2013/subconverter | Utility to convert between various subscription format | 2019-10-31 04:51:54 | 2022-08-23 20:22:01 | null | tindy2013 | 6729.0 | 1480.0 | nodeRename | nodeRename( Proxy & node , const RegexMatchConfigs & rename_array , extra_settings & ext) | ['node', 'rename_array', 'ext'] | void nodeRename(Proxy &node, const RegexMatchConfigs &rename_array, extra_settings &ext)
{
std::string &remark = node.Remark, original_remark = node.Remark, returned_remark, real_rule;
for(const RegexMatchConfig &x : rename_array)
{
if(!x.Script.empty())
{
script_safe_runner(ext.js_runtime, ext.js_context, [&](qjs::Context &ctx)
{
std::string script = x.Script;
if(startsWith(script, "path:"))
script = fileGet(script.substr(5), true);
try
{
ctx.eval(script);
auto rename = (std::function<std::string(const Proxy&)>) ctx.eval("rename");
returned_remark = rename(node);
if(!returned_remark.empty())
remark = returned_remark;
}
catch (qjs::exception)
{
script_print_stack(ctx);
}
}, global.scriptCleanContext);
continue;
}
if(applyMatcher(x.Match, real_rule, node) && real_rule.size())
remark = regReplace(remark, real_rule, x.Replace);
}
if(remark.empty())
remark = original_remark;
return;
} | 237 | True | 1 |
|
CVE-2022-28927 | 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://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'name': 'https://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'name': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-434'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:subconverter_project:subconverter:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A remote code execution (RCE) vulnerability in Subconverter v0.7.2 allows attackers to execute arbitrary code via crafted config and url parameters.'}] | 2022-05-26T20:03Z | 2022-05-19T16:15Z | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | 0 | Tindy X | 2022-04-04 00:38:44+08:00 | Enhancements
Add authorization check before loading scripts.
Add detailed logs when loading preference settings. | ce8d2bd0f13f05fcbd2ed90755d097f402393dd3 | False | tindy2013/subconverter | Utility to convert between various subscription format | 2019-10-31 04:51:54 | 2022-08-23 20:22:01 | null | tindy2013 | 6729.0 | 1480.0 | preprocessNodes | preprocessNodes( std :: vector<Proxy> & nodes , extra_settings & ext) | ['nodes', 'ext'] | void preprocessNodes(std::vector<Proxy> &nodes, extra_settings &ext)
{
std::for_each(nodes.begin(), nodes.end(), [&ext](Proxy &x)
{
if(ext.remove_emoji)
x.Remark = trim(removeEmoji(x.Remark));
nodeRename(x, ext.rename_array, ext);
if(ext.add_emoji)
x.Remark = addEmoji(x, ext.emoji_array, ext);
});
if(ext.sort_flag)
{
bool failed = true;
if(ext.sort_script.size())
{
std::string script = ext.sort_script;
if(startsWith(script, "path:"))
script = fileGet(script.substr(5), false);
script_safe_runner(ext.js_runtime, ext.js_context, [&](qjs::Context &ctx)
{
try
{
ctx.eval(script);
auto compare = (std::function<int(const Proxy&, const Proxy&)>) ctx.eval("compare");
auto comparer = [&](const Proxy &a, const Proxy &b)
{
if(a.Type == ProxyType::Unknow)
return 1;
if(b.Type == ProxyType::Unknow)
return 0;
return compare(a, b);
};
std::stable_sort(nodes.begin(), nodes.end(), comparer);
failed = false;
}
catch(qjs::exception)
{
script_print_stack(ctx);
}
}, global.scriptCleanContext);
}
if(failed) std::stable_sort(nodes.begin(), nodes.end(), [](const Proxy &a, const Proxy &b)
{
return a.Remark < b.Remark;
});
}
} | 356 | True | 1 |
|
CVE-2022-28927 | 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://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'name': 'https://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'name': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-434'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:subconverter_project:subconverter:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A remote code execution (RCE) vulnerability in Subconverter v0.7.2 allows attackers to execute arbitrary code via crafted config and url parameters.'}] | 2022-05-26T20:03Z | 2022-05-19T16:15Z | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | 0 | Tindy X | 2022-04-04 00:38:44+08:00 | Enhancements
Add authorization check before loading scripts.
Add detailed logs when loading preference settings. | ce8d2bd0f13f05fcbd2ed90755d097f402393dd3 | False | tindy2013/subconverter | Utility to convert between various subscription format | 2019-10-31 04:51:54 | 2022-08-23 20:22:01 | null | tindy2013 | 6729.0 | 1480.0 | groupGenerate | groupGenerate( const std :: string & rule , std :: vector<Proxy> & nodelist , string_array & filtered_nodelist , bool add_direct , extra_settings & ext) | ['rule', 'nodelist', 'filtered_nodelist', 'add_direct', 'ext'] | void groupGenerate(const std::string &rule, std::vector<Proxy> &nodelist, string_array &filtered_nodelist, bool add_direct, extra_settings &ext)
{
std::string real_rule;
if(startsWith(rule, "[]") && add_direct)
{
filtered_nodelist.emplace_back(rule.substr(2));
}
#ifndef NO_JS_RUNTIME
else if(startsWith(rule, "script:"))
{
script_safe_runner(ext.js_runtime, ext.js_context, [&](qjs::Context &ctx){
std::string script = fileGet(rule.substr(7), true);
try
{
ctx.eval(script);
auto filter = (std::function<std::string(const std::vector<Proxy>&)>) ctx.eval("filter");
std::string result_list = filter(nodelist);
filtered_nodelist = split(regTrim(result_list), "\n");
}
catch (qjs::exception)
{
script_print_stack(ctx);
}
}, global.scriptCleanContext);
}
#endif // NO_JS_RUNTIME
else
{
for(Proxy &x : nodelist)
{
if(applyMatcher(rule, real_rule, x) && (real_rule.empty() || regFind(x.Remark, real_rule)) && std::find(filtered_nodelist.begin(), filtered_nodelist.end(), x.Remark) == filtered_nodelist.end())
filtered_nodelist.emplace_back(x.Remark);
}
}
} | 270 | True | 1 |
|
CVE-2022-28927 | 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://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'name': 'https://gist.github.com/CwithW/01a726e5af709655d6ee0b2067cdae03', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'name': 'https://github.com/tindy2013/subconverter/commit/ce8d2bd0f13f05fcbd2ed90755d097f402393dd3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-434'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:subconverter_project:subconverter:0.7.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A remote code execution (RCE) vulnerability in Subconverter v0.7.2 allows attackers to execute arbitrary code via crafted config and url parameters.'}] | 2022-05-26T20:03Z | 2022-05-19T16:15Z | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | 0 | Tindy X | 2022-04-04 00:38:44+08:00 | Enhancements
Add authorization check before loading scripts.
Add detailed logs when loading preference settings. | ce8d2bd0f13f05fcbd2ed90755d097f402393dd3 | False | tindy2013/subconverter | Utility to convert between various subscription format | 2019-10-31 04:51:54 | 2022-08-23 20:22:01 | null | tindy2013 | 6729.0 | 1480.0 | readConf | readConf() | [] | void readConf()
{
guarded_mutex guard(gMutexConfigure);
//std::cerr<<"Reading preference settings..."<<std::endl;
writeLog(0, "Reading preference settings...", LOG_LEVEL_INFO);
eraseElements(global.excludeRemarks);
eraseElements(global.includeRemarks);
eraseElements(global.customProxyGroups);
eraseElements(global.customRulesets);
try
{
std::string prefdata = fileGet(global.prefPath, false);
if(prefdata.find("common:") != prefdata.npos)
{
YAML::Node yaml = YAML::Load(prefdata);
if(yaml.size() && yaml["common"])
return readYAMLConf(yaml);
}
toml::value conf = parseToml(prefdata, global.prefPath);
if(!conf.is_uninitialized() && toml::find_or<int>(conf, "version", 0))
return readTOMLConf(conf);
}
catch (YAML::Exception &e)
{
//ignore yaml parse error
}
catch (toml::exception &e)
{
//ignore toml parse error
writeLog(0, e.what(), LOG_LEVEL_DEBUG);
}
INIReader ini;
ini.allow_dup_section_titles = true;
//ini.do_utf8_to_gbk = true;
int retVal = ini.ParseFile(global.prefPath);
if(retVal != INIREADER_EXCEPTION_NONE)
{
//std::cerr<<"Unable to load preference settings. Reason: "<<ini.GetLastError()<<"\n";
writeLog(0, "Unable to load preference settings. Reason: " + ini.GetLastError(), LOG_LEVEL_FATAL);
return;
}
string_array tempArray;
ini.EnterSection("common");
ini.GetBoolIfExist("api_mode", global.APIMode);
ini.GetIfExist("api_access_token", global.accessToken);
ini.GetIfExist("default_url", global.defaultUrls);
global.enableInsert = ini.Get("enable_insert");
ini.GetIfExist("insert_url", global.insertUrls);
ini.GetBoolIfExist("prepend_insert_url", global.prependInsert);
if(ini.ItemPrefixExist("exclude_remarks"))
ini.GetAll("exclude_remarks", global.excludeRemarks);
if(ini.ItemPrefixExist("include_remarks"))
ini.GetAll("include_remarks", global.includeRemarks);
global.filterScript = ini.GetBool("enable_filter") ? ini.Get("filter_script"): "";
ini.GetIfExist("base_path", global.basePath);
ini.GetIfExist("clash_rule_base", global.clashBase);
ini.GetIfExist("surge_rule_base", global.surgeBase);
ini.GetIfExist("surfboard_rule_base", global.surfboardBase);
ini.GetIfExist("mellow_rule_base", global.mellowBase);
ini.GetIfExist("quan_rule_base", global.quanBase);
ini.GetIfExist("quanx_rule_base", global.quanXBase);
ini.GetIfExist("loon_rule_base", global.loonBase);
ini.GetIfExist("default_external_config", global.defaultExtConfig);
ini.GetBoolIfExist("append_proxy_type", global.appendType);
ini.GetIfExist("proxy_config", global.proxyConfig);
ini.GetIfExist("proxy_ruleset", global.proxyRuleset);
ini.GetIfExist("proxy_subscription", global.proxySubscription);
if(ini.SectionExist("surge_external_proxy"))
{
ini.EnterSection("surge_external_proxy");
ini.GetIfExist("surge_ssr_path", global.surgeSSRPath);
ini.GetBoolIfExist("resolve_hostname", global.surgeResolveHostname);
}
if(ini.SectionExist("node_pref"))
{
ini.EnterSection("node_pref");
/*
ini.GetBoolIfExist("udp_flag", udp_flag);
ini.GetBoolIfExist("tcp_fast_open_flag", tfo_flag);
ini.GetBoolIfExist("skip_cert_verify_flag", scv_flag);
*/
global.UDPFlag.set(ini.Get("udp_flag"));
global.TFOFlag.set(ini.Get("tcp_fast_open_flag"));
global.skipCertVerify.set(ini.Get("skip_cert_verify_flag"));
global.TLS13Flag.set(ini.Get("tls13_flag"));
ini.GetBoolIfExist("sort_flag", global.enableSort);
global.sortScript = ini.Get("sort_script");
ini.GetBoolIfExist("filter_deprecated_nodes", global.filterDeprecated);
ini.GetBoolIfExist("append_sub_userinfo", global.appendUserinfo);
ini.GetBoolIfExist("clash_use_new_field_name", global.clashUseNewField);
ini.GetIfExist("clash_proxies_style", global.clashProxiesStyle);
if(ini.ItemPrefixExist("rename_node"))
{
ini.GetAll("rename_node", tempArray);
importItems(tempArray, false);
auto configs = INIBinding::from<RegexMatchConfig>::from_ini(tempArray, "@");
safe_set_renames(configs);
eraseElements(tempArray);
}
}
if(ini.SectionExist("userinfo"))
{
ini.EnterSection("userinfo");
if(ini.ItemPrefixExist("stream_rule"))
{
ini.GetAll("stream_rule", tempArray);
importItems(tempArray, false);
auto configs = INIBinding::from<RegexMatchConfig>::from_ini(tempArray, "|");
safe_set_streams(configs);
eraseElements(tempArray);
}
if(ini.ItemPrefixExist("time_rule"))
{
ini.GetAll("time_rule", tempArray);
importItems(tempArray, false);
auto configs = INIBinding::from<RegexMatchConfig>::from_ini(tempArray, "|");
safe_set_times(configs);
eraseElements(tempArray);
}
}
ini.EnterSection("managed_config");
ini.GetBoolIfExist("write_managed_config", global.writeManagedConfig);
ini.GetIfExist("managed_config_prefix", global.managedConfigPrefix);
ini.GetIntIfExist("config_update_interval", global.updateInterval);
ini.GetBoolIfExist("config_update_strict", global.updateStrict);
ini.GetIfExist("quanx_device_id", global.quanXDevID);
ini.EnterSection("emojis");
ini.GetBoolIfExist("add_emoji", global.addEmoji);
ini.GetBoolIfExist("remove_old_emoji", global.removeEmoji);
if(ini.ItemPrefixExist("rule"))
{
ini.GetAll("rule", tempArray);
importItems(tempArray, false);
auto configs = INIBinding::from<RegexMatchConfig>::from_ini(tempArray, ",");
safe_set_emojis(configs);
eraseElements(tempArray);
}
if(ini.SectionExist("rulesets"))
ini.EnterSection("rulesets");
else
ini.EnterSection("ruleset");
global.enableRuleGen = ini.GetBool("enabled");
if(global.enableRuleGen)
{
ini.GetBoolIfExist("overwrite_original_rules", global.overwriteOriginalRules);
ini.GetBoolIfExist("update_ruleset_on_request", global.updateRulesetOnRequest);
if(ini.ItemPrefixExist("ruleset"))
{
string_array vArray;
ini.GetAll("ruleset", vArray);
importItems(vArray, false);
global.customRulesets = INIBinding::from<RulesetConfig>::from_ini(vArray);
}
else if(ini.ItemPrefixExist("surge_ruleset"))
{
string_array vArray;
ini.GetAll("surge_ruleset", vArray);
importItems(vArray, false);
global.customRulesets = INIBinding::from<RulesetConfig>::from_ini(vArray);
}
}
else
{
global.overwriteOriginalRules = false;
global.updateRulesetOnRequest = false;
}
if(ini.SectionExist("proxy_groups"))
ini.EnterSection("proxy_groups");
else
ini.EnterSection("clash_proxy_group");
if(ini.ItemPrefixExist("custom_proxy_group"))
{
string_array vArray;
ini.GetAll("custom_proxy_group", vArray);
importItems(vArray, false);
global.customProxyGroups = INIBinding::from<ProxyGroupConfig>::from_ini(vArray);
}
ini.EnterSection("template");
ini.GetIfExist("template_path", global.templatePath);
string_multimap tempmap;
ini.GetItems(tempmap);
eraseElements(global.templateVars);
for(auto &x : tempmap)
{
if(x.first == "template_path")
continue;
global.templateVars[x.first] = x.second;
}
global.templateVars["managed_config_prefix"] = global.managedConfigPrefix;
if(ini.SectionExist("aliases"))
{
ini.EnterSection("aliases");
ini.GetItems(tempmap);
webServer.reset_redirect();
for(auto &x : tempmap)
webServer.append_redirect(x.first, x.second);
}
if(ini.SectionExist("tasks"))
{
string_array vArray;
ini.EnterSection("tasks");
ini.GetAll("task", vArray);
importItems(vArray, false);
global.enableCron = !vArray.empty();
global.cronTasks = INIBinding::from<CronTaskConfig>::from_ini(vArray);
refresh_schedule();
}
ini.EnterSection("server");
ini.GetIfExist("listen", global.listenAddress);
ini.GetIntIfExist("port", global.listenPort);
webServer.serve_file_root = ini.Get("serve_file_root");
webServer.serve_file = !webServer.serve_file_root.empty();
ini.EnterSection("advanced");
std::string log_level;
ini.GetIfExist("log_level", log_level);
ini.GetBoolIfExist("print_debug_info", global.printDbgInfo);
if(global.printDbgInfo)
global.logLevel = LOG_LEVEL_VERBOSE;
else
{
switch(hash_(log_level))
{
case "warn"_hash:
global.logLevel = LOG_LEVEL_WARNING;
break;
case "error"_hash:
global.logLevel = LOG_LEVEL_ERROR;
break;
case "fatal"_hash:
global.logLevel = LOG_LEVEL_FATAL;
break;
case "verbose"_hash:
global.logLevel = LOG_LEVEL_VERBOSE;
break;
case "debug"_hash:
global.logLevel = LOG_LEVEL_DEBUG;
break;
default:
global.logLevel = LOG_LEVEL_INFO;
}
}
ini.GetIntIfExist("max_pending_connections", global.maxPendingConns);
ini.GetIntIfExist("max_concurrent_threads", global.maxConcurThreads);
ini.GetNumberIfExist("max_allowed_rulesets", global.maxAllowedRulesets);
ini.GetNumberIfExist("max_allowed_rules", global.maxAllowedRules);
ini.GetNumberIfExist("max_allowed_download_size", global.maxAllowedDownloadSize);
if(ini.ItemExist("enable_cache"))
{
if(ini.GetBool("enable_cache"))
{
ini.GetIntIfExist("cache_subscription", global.cacheSubscription);
ini.GetIntIfExist("cache_config", global.cacheConfig);
ini.GetIntIfExist("cache_ruleset", global.cacheRuleset);
ini.GetBoolIfExist("serve_cache_on_fetch_fail", global.serveCacheOnFetchFail);
}
else
{
global.cacheSubscription = global.cacheConfig = global.cacheRuleset = 0; //disable cache
global.serveCacheOnFetchFail = false;
}
}
ini.GetBoolIfExist("script_clean_context", global.scriptCleanContext);
ini.GetBoolIfExist("async_fetch_ruleset", global.asyncFetchRuleset);
ini.GetBoolIfExist("skip_failed_links", global.skipFailedLinks);
//std::cerr<<"Read preference settings completed."<<std::endl;
writeLog(0, "Read preference settings completed.", LOG_LEVEL_INFO);
} | 1822 | True | 1 |
|
CVE-2022-29242 | 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/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'name': 'https://github.com/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'name': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'name': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'name': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'name': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gost_engine_project:gost_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GOST engine is a reference implementation of the Russian GOST crypto algorithms for OpenSSL. TLS clients using GOST engine when ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is agreed and the server uses 512 bit GOST secret keys are vulnerable to buffer overflow. GOST engine version 3.0.1 contains a patch for this issue. Disabling ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is a possible workaround.'}] | 2022-06-07T16:54Z | 2022-05-24T15:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Dmitry Belyavskiy | 2022-05-20 18:13:50+02:00 | Fix buffer overrun in creating key transport blob according to RFC 9189, 4.2.4.1
Resolves: CVE-2022-29242 | c6655a0b620a3e31f085cc906f8073fe81b2fad3 | False | gost-engine/engine | A reference implementation of the Russian GOST crypto algorithms for OpenSSL | 2015-08-13 17:30:16 | 2022-08-11 15:48:01 | gost-engine | 268.0 | 148.0 | pkey_gost2018_encrypt | pkey_gost2018_encrypt( EVP_PKEY_CTX * pctx , unsigned char * out , size_t * out_len , const unsigned char * key , size_t key_len) | ['pctx', 'out', 'out_len', 'key', 'key_len'] | static int pkey_gost2018_encrypt(EVP_PKEY_CTX *pctx, unsigned char *out,
size_t *out_len, const unsigned char *key,
size_t key_len)
{
PSKeyTransport_gost *pst = NULL;
EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(pctx);
struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(pctx);
int pkey_nid = EVP_PKEY_base_id(pubk);
unsigned char expkeys[64];
EVP_PKEY *sec_key = NULL;
int ret = 0;
int mac_nid = NID_undef;
size_t mac_len = 0;
int exp_len = 0, iv_len = 0;
unsigned char *exp_buf = NULL;
int key_is_ephemeral = 0;
switch (data->cipher_nid) {
case NID_magma_ctr:
mac_nid = NID_magma_mac;
mac_len = 8;
iv_len = 4;
break;
case NID_grasshopper_ctr:
mac_nid = NID_grasshopper_mac;
mac_len = 16;
iv_len = 8;
break;
default:
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, GOST_R_INVALID_CIPHER);
return -1;
break;
}
exp_len = key_len + mac_len;
exp_buf = OPENSSL_malloc(exp_len);
if (!exp_buf) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_MALLOC_FAILURE);
return -1;
}
sec_key = EVP_PKEY_CTX_get0_peerkey(pctx);
if (!sec_key)
{
sec_key = EVP_PKEY_new();
if (sec_key == NULL) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_MALLOC_FAILURE );
goto err;
}
if (!EVP_PKEY_assign(sec_key, EVP_PKEY_base_id(pubk), EC_KEY_new())
|| !EVP_PKEY_copy_parameters(sec_key, pubk)
|| !gost_ec_keygen(EVP_PKEY_get0(sec_key))) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT,
GOST_R_ERROR_COMPUTING_SHARED_KEY);
goto err;
}
key_is_ephemeral = 1;
}
if (data->shared_ukm_size == 0) {
if (RAND_bytes(data->shared_ukm, 32) <= 0) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_INTERNAL_ERROR);
goto err;
}
data->shared_ukm_size = 32;
}
if (gost_keg(data->shared_ukm, pkey_nid,
EC_KEY_get0_public_key(EVP_PKEY_get0(pubk)),
EVP_PKEY_get0(sec_key), expkeys) <= 0) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT,
GOST_R_ERROR_COMPUTING_EXPORT_KEYS);
goto err;
}
if (gost_kexp15(key, key_len, data->cipher_nid, expkeys + 32,
mac_nid, expkeys + 0, data->shared_ukm + 24, iv_len,
exp_buf, &exp_len) <= 0) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, GOST_R_CANNOT_PACK_EPHEMERAL_KEY);
goto err;
}
pst = PSKeyTransport_gost_new();
if (!pst) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_MALLOC_FAILURE);
goto err;
}
pst->ukm = ASN1_OCTET_STRING_new();
if (pst->ukm == NULL) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!ASN1_OCTET_STRING_set(pst->ukm, data->shared_ukm, data->shared_ukm_size)) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!ASN1_OCTET_STRING_set(pst->psexp, exp_buf, exp_len)) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!X509_PUBKEY_set(&pst->ephem_key, out ? sec_key : pubk)) {
GOSTerr(GOST_F_PKEY_GOST2018_ENCRYPT, GOST_R_CANNOT_PACK_EPHEMERAL_KEY);
goto err;
}
if ((*out_len = i2d_PSKeyTransport_gost(pst, out ? &out : NULL)) > 0)
ret = 1;
err:
OPENSSL_cleanse(expkeys, sizeof(expkeys));
if (key_is_ephemeral)
EVP_PKEY_free(sec_key);
PSKeyTransport_gost_free(pst);
OPENSSL_free(exp_buf);
return ret;
} | 610 | True | 1 |
|
CVE-2022-29242 | 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/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'name': 'https://github.com/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'name': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'name': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'name': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'name': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gost_engine_project:gost_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GOST engine is a reference implementation of the Russian GOST crypto algorithms for OpenSSL. TLS clients using GOST engine when ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is agreed and the server uses 512 bit GOST secret keys are vulnerable to buffer overflow. GOST engine version 3.0.1 contains a patch for this issue. Disabling ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is a possible workaround.'}] | 2022-06-07T16:54Z | 2022-05-24T15:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Dmitry Belyavskiy | 2022-05-21 20:06:47+02:00 | Fix buffer overrun in creating key transport blob according to RFC 9189, 4.2.4.2
Resolves: CVE-2022-29242 | 7df766124f87768b43b9e8947c5a01e17545772c | False | gost-engine/engine | A reference implementation of the Russian GOST crypto algorithms for OpenSSL | 2015-08-13 17:30:16 | 2022-08-11 15:48:01 | gost-engine | 268.0 | 148.0 | pkey_GOST_ECcp_encrypt | pkey_GOST_ECcp_encrypt( EVP_PKEY_CTX * pctx , unsigned char * out , size_t * out_len , const unsigned char * key , size_t key_len) | ['pctx', 'out', 'out_len', 'key', 'key_len'] | static int pkey_GOST_ECcp_encrypt(EVP_PKEY_CTX *pctx, unsigned char *out,
size_t *out_len, const unsigned char *key,
size_t key_len)
{
GOST_KEY_TRANSPORT *gkt = NULL;
EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(pctx);
struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(pctx);
int pkey_nid = EVP_PKEY_base_id(pubk);
ASN1_OBJECT *crypt_params_obj = (pkey_nid == NID_id_GostR3410_2001 || pkey_nid == NID_id_GostR3410_2001DH) ?
OBJ_nid2obj(NID_id_Gost28147_89_CryptoPro_A_ParamSet) :
OBJ_nid2obj(NID_id_tc26_gost_28147_param_Z);
const struct gost_cipher_info *param =
get_encryption_params(crypt_params_obj);
unsigned char ukm[8], shared_key[32], crypted_key[44];
int ret = 0;
int key_is_ephemeral = 1;
gost_ctx cctx;
EVP_PKEY *sec_key = EVP_PKEY_CTX_get0_peerkey(pctx);
if (data->shared_ukm_size) {
memcpy(ukm, data->shared_ukm, 8);
} else {
if (RAND_bytes(ukm, 8) <= 0) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT, GOST_R_RNG_ERROR);
return 0;
}
}
if (!param)
goto err;
/* Check for private key in the peer_key of context */
if (sec_key) {
key_is_ephemeral = 0;
if (!gost_get0_priv_key(sec_key)) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT,
GOST_R_NO_PRIVATE_PART_OF_NON_EPHEMERAL_KEYPAIR);
goto err;
}
} else {
key_is_ephemeral = 1;
if (out) {
sec_key = EVP_PKEY_new();
if (!EVP_PKEY_assign(sec_key, EVP_PKEY_base_id(pubk), EC_KEY_new())
|| !EVP_PKEY_copy_parameters(sec_key, pubk)
|| !gost_ec_keygen(EVP_PKEY_get0(sec_key))) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT,
GOST_R_ERROR_COMPUTING_SHARED_KEY);
goto err;
}
}
}
if (out) {
int dgst_nid = NID_undef;
EVP_PKEY_get_default_digest_nid(pubk, &dgst_nid);
if (dgst_nid == NID_id_GostR3411_2012_512)
dgst_nid = NID_id_GostR3411_2012_256;
if (!VKO_compute_key(shared_key,
EC_KEY_get0_public_key(EVP_PKEY_get0(pubk)),
EVP_PKEY_get0(sec_key), ukm, 8, dgst_nid)) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT,
GOST_R_ERROR_COMPUTING_SHARED_KEY);
goto err;
}
gost_init(&cctx, param->sblock);
keyWrapCryptoPro(&cctx, shared_key, ukm, key, crypted_key);
}
gkt = GOST_KEY_TRANSPORT_new();
if (!gkt) {
goto err;
}
if (!ASN1_OCTET_STRING_set(gkt->key_agreement_info->eph_iv, ukm, 8)) {
goto err;
}
if (!ASN1_OCTET_STRING_set(gkt->key_info->imit, crypted_key + 40, 4)) {
goto err;
}
if (!ASN1_OCTET_STRING_set
(gkt->key_info->encrypted_key, crypted_key + 8, 32)) {
goto err;
}
if (key_is_ephemeral) {
if (!X509_PUBKEY_set
(&gkt->key_agreement_info->ephem_key, out ? sec_key : pubk)) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT,
GOST_R_CANNOT_PACK_EPHEMERAL_KEY);
goto err;
}
}
ASN1_OBJECT_free(gkt->key_agreement_info->cipher);
gkt->key_agreement_info->cipher = OBJ_nid2obj(param->nid);
if (key_is_ephemeral)
EVP_PKEY_free(sec_key);
if (!key_is_ephemeral) {
/* Set control "public key from client certificate used" */
if (EVP_PKEY_CTX_ctrl(pctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 3, NULL)
<= 0) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_ENCRYPT, GOST_R_CTRL_CALL_FAILED);
goto err;
}
}
if ((*out_len = i2d_GOST_KEY_TRANSPORT(gkt, out ? &out : NULL)) > 0)
ret = 1;
OPENSSL_cleanse(shared_key, sizeof(shared_key));
GOST_KEY_TRANSPORT_free(gkt);
return ret;
err:
OPENSSL_cleanse(shared_key, sizeof(shared_key));
if (key_is_ephemeral)
EVP_PKEY_free(sec_key);
GOST_KEY_TRANSPORT_free(gkt);
return -1;
} | 637 | True | 1 |
|
CVE-2022-29242 | 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/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'name': 'https://github.com/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'name': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'name': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'name': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'name': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gost_engine_project:gost_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GOST engine is a reference implementation of the Russian GOST crypto algorithms for OpenSSL. TLS clients using GOST engine when ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is agreed and the server uses 512 bit GOST secret keys are vulnerable to buffer overflow. GOST engine version 3.0.1 contains a patch for this issue. Disabling ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is a possible workaround.'}] | 2022-06-07T16:54Z | 2022-05-24T15:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Dmitry Belyavskiy | 2022-05-21 20:20:20+02:00 | On unpacking key blob output buffer size should be fixed
Related: CVE-2022-29242 | b2b4d629f100eaee9f5942a106b1ccefe85b8808 | False | gost-engine/engine | A reference implementation of the Russian GOST crypto algorithms for OpenSSL | 2015-08-13 17:30:16 | 2022-08-11 15:48:01 | gost-engine | 268.0 | 148.0 | pkey_GOST_ECcp_decrypt | pkey_GOST_ECcp_decrypt( EVP_PKEY_CTX * pctx , unsigned char * key , size_t * key_len , const unsigned char * in , size_t in_len) | ['pctx', 'key', 'key_len', 'in', 'in_len'] | static int pkey_GOST_ECcp_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
EVP_PKEY *priv = EVP_PKEY_CTX_get0_pkey(pctx);
GOST_KEY_TRANSPORT *gkt = NULL;
int ret = 0;
unsigned char wrappedKey[44];
unsigned char sharedKey[32];
gost_ctx ctx;
const struct gost_cipher_info *param = NULL;
EVP_PKEY *eph_key = NULL, *peerkey = NULL;
int dgst_nid = NID_undef;
if (!key) {
*key_len = 32;
return 1;
}
gkt = d2i_GOST_KEY_TRANSPORT(NULL, (const unsigned char **)&p, in_len);
if (!gkt) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_DECRYPT,
GOST_R_ERROR_PARSING_KEY_TRANSPORT_INFO);
return -1;
}
/* If key transport structure contains public key, use it */
eph_key = X509_PUBKEY_get(gkt->key_agreement_info->ephem_key);
if (eph_key) {
if (EVP_PKEY_derive_set_peer(pctx, eph_key) <= 0) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_DECRYPT,
GOST_R_INCOMPATIBLE_PEER_KEY);
goto err;
}
} else {
/* Set control "public key from client certificate used" */
if (EVP_PKEY_CTX_ctrl(pctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 3, NULL)
<= 0) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_DECRYPT, GOST_R_CTRL_CALL_FAILED);
goto err;
}
}
peerkey = EVP_PKEY_CTX_get0_peerkey(pctx);
if (!peerkey) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_DECRYPT, GOST_R_NO_PEER_KEY);
goto err;
}
param = get_encryption_params(gkt->key_agreement_info->cipher);
if (!param) {
goto err;
}
gost_init(&ctx, param->sblock);
OPENSSL_assert(gkt->key_agreement_info->eph_iv->length == 8);
memcpy(wrappedKey, gkt->key_agreement_info->eph_iv->data, 8);
OPENSSL_assert(gkt->key_info->encrypted_key->length == 32);
memcpy(wrappedKey + 8, gkt->key_info->encrypted_key->data, 32);
OPENSSL_assert(gkt->key_info->imit->length == 4);
memcpy(wrappedKey + 40, gkt->key_info->imit->data, 4);
EVP_PKEY_get_default_digest_nid(priv, &dgst_nid);
if (dgst_nid == NID_id_GostR3411_2012_512)
dgst_nid = NID_id_GostR3411_2012_256;
if (!VKO_compute_key(sharedKey,
EC_KEY_get0_public_key(EVP_PKEY_get0(peerkey)),
EVP_PKEY_get0(priv), wrappedKey, 8, dgst_nid)) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_DECRYPT,
GOST_R_ERROR_COMPUTING_SHARED_KEY);
goto err;
}
if (!keyUnwrapCryptoPro(&ctx, sharedKey, wrappedKey, key)) {
GOSTerr(GOST_F_PKEY_GOST_ECCP_DECRYPT,
GOST_R_ERROR_COMPUTING_SHARED_KEY);
goto err;
}
ret = 1;
err:
OPENSSL_cleanse(sharedKey, sizeof(sharedKey));
EVP_PKEY_free(eph_key);
GOST_KEY_TRANSPORT_free(gkt);
return ret;
} | 478 | True | 1 |
|
CVE-2022-29242 | 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/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'name': 'https://github.com/gost-engine/engine/commit/b2b4d629f100eaee9f5942a106b1ccefe85b8808', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'name': 'https://github.com/gost-engine/engine/releases/tag/v3.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'name': 'https://github.com/gost-engine/engine/commit/7df766124f87768b43b9e8947c5a01e17545772c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'name': 'https://github.com/gost-engine/engine/commit/c6655a0b620a3e31f085cc906f8073fe81b2fad3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'name': 'https://github.com/gost-engine/engine/security/advisories/GHSA-2rmw-8wpg-vgw5', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gost_engine_project:gost_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GOST engine is a reference implementation of the Russian GOST crypto algorithms for OpenSSL. TLS clients using GOST engine when ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is agreed and the server uses 512 bit GOST secret keys are vulnerable to buffer overflow. GOST engine version 3.0.1 contains a patch for this issue. Disabling ciphersuite `TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC` is a possible workaround.'}] | 2022-06-07T16:54Z | 2022-05-24T15:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Dmitry Belyavskiy | 2022-05-21 20:20:20+02:00 | On unpacking key blob output buffer size should be fixed
Related: CVE-2022-29242 | b2b4d629f100eaee9f5942a106b1ccefe85b8808 | False | gost-engine/engine | A reference implementation of the Russian GOST crypto algorithms for OpenSSL | 2015-08-13 17:30:16 | 2022-08-11 15:48:01 | gost-engine | 268.0 | 148.0 | pkey_gost2018_decrypt | pkey_gost2018_decrypt( EVP_PKEY_CTX * pctx , unsigned char * key , size_t * key_len , const unsigned char * in , size_t in_len) | ['pctx', 'key', 'key_len', 'in', 'in_len'] | static int pkey_gost2018_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
struct gost_pmeth_data *data;
EVP_PKEY *priv;
PSKeyTransport_gost *pst = NULL;
int ret = 0;
unsigned char expkeys[64];
EVP_PKEY *eph_key = NULL;
int pkey_nid;
int mac_nid = NID_undef;
int iv_len = 0;
if (!(data = EVP_PKEY_CTX_get_data(pctx)) ||
!(priv = EVP_PKEY_CTX_get0_pkey(pctx))) {
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT, GOST_R_ERROR_COMPUTING_EXPORT_KEYS);
ret = 0;
goto err;
}
pkey_nid = EVP_PKEY_base_id(priv);
switch (data->cipher_nid) {
case NID_magma_ctr:
mac_nid = NID_magma_mac;
iv_len = 4;
break;
case NID_grasshopper_ctr:
mac_nid = NID_grasshopper_mac;
iv_len = 8;
break;
default:
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT, GOST_R_INVALID_CIPHER);
return -1;
break;
}
if (!key) {
*key_len = 32;
return 1;
}
pst = d2i_PSKeyTransport_gost(NULL, (const unsigned char **)&p, in_len);
if (!pst) {
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT,
GOST_R_ERROR_PARSING_KEY_TRANSPORT_INFO);
return -1;
}
eph_key = X509_PUBKEY_get(pst->ephem_key);
/*
* TODO beldmit
1. Checks the next three conditions fulfilling and terminates the
connection with fatal error if not.
o Q_eph is on the same curve as server public key;
o Q_eph is not equal to zero point;
o q * Q_eph is not equal to zero point.
*/
if (eph_key == NULL) {
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT,
GOST_R_ERROR_COMPUTING_EXPORT_KEYS);
ret = 0;
goto err;
}
if (data->shared_ukm_size == 0 && pst->ukm != NULL) {
if (EVP_PKEY_CTX_ctrl(pctx, -1, -1, EVP_PKEY_CTRL_SET_IV,
ASN1_STRING_length(pst->ukm), (void *)ASN1_STRING_get0_data(pst->ukm)) < 0) {
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT, GOST_R_UKM_NOT_SET);
goto err;
}
}
if (gost_keg(data->shared_ukm, pkey_nid,
EC_KEY_get0_public_key(EVP_PKEY_get0(eph_key)),
EVP_PKEY_get0(priv), expkeys) <= 0) {
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT,
GOST_R_ERROR_COMPUTING_EXPORT_KEYS);
goto err;
}
if (gost_kimp15(ASN1_STRING_get0_data(pst->psexp),
ASN1_STRING_length(pst->psexp), data->cipher_nid,
expkeys + 32, mac_nid, expkeys + 0, data->shared_ukm + 24,
iv_len, key) <= 0) {
GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT, GOST_R_CANNOT_UNPACK_EPHEMERAL_KEY);
goto err;
}
ret = 1;
err:
OPENSSL_cleanse(expkeys, sizeof(expkeys));
EVP_PKEY_free(eph_key);
PSKeyTransport_gost_free(pst);
return ret;
} | 445 | True | 1 |
|
CVE-2022-29264 | 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/coreboot/coreboot/commit/afb7a814783cda12f5b72167163b9109ee1d15a7', 'name': 'https://github.com/coreboot/coreboot/commit/afb7a814783cda12f5b72167163b9109ee1d15a7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://review.coreboot.org/c/coreboot/+/63478', 'name': 'https://review.coreboot.org/c/coreboot/+/63478', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:coreboot:coreboot:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.13', 'versionEndIncluding': '4.16', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in coreboot 4.13 through 4.16. On APs, arbitrary code execution in SMM may occur.'}] | 2022-05-04T18:28Z | 2022-04-25T07: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 | Rocky Phagura | 2020-07-21 14:48:48-07:00 | cpu/x86/smm: Introduce SMM module loader version 2
Xeon-SP Skylake Scalable Processor can have 36 CPU threads (18 cores).
Current coreboot SMM is unable to handle more than ~32 CPU threads.
This patch introduces a version 2 of the SMM module loader which
addresses this problem. Having two versions of the SMM module loader
prevents any issues to current projects. Future Xeon-SP products will
be using this version of the SMM loader. Subsequent patches will
enable board specific functionality for Xeon-SP.
The reason for moving to version 2 is the state save area begins to
encroach upon the SMI handling code when more than 32 CPU threads are
in the system. This can cause system hangs, reboots, etc. The second
change is related to staggered entry points with simple near jumps. In
the current loader, near jumps will not work because the CPU is jumping
within the same code segment. In version 2, "far" address jumps are
necessary therefore protected mode must be enabled first. The SMM
layout and how the CPUs are staggered are documented in the code.
By making the modifications above, this allows the smm module loader to
expand easily as more CPU threads are added.
TEST=build for Tiogapass platform under OCP mainboard. Enable the
following in Kconfig.
select CPU_INTEL_COMMON_SMM
select SOC_INTEL_COMMON_BLOCK_SMM
select SMM_TSEG
select HAVE_SMI_HANDLER
select ACPI_INTEL_HARDWARE_SLEEP_VALUES
Debug console will show all 36 cores relocated. Further tested by
generating SMI's to port 0xb2 using XDP/ITP HW debugger and ensured all
cores entering and exiting SMM properly. In addition, booted to Linux
5.4 kernel and observed no issues during mp init.
Change-Id: I00a23a5f2a46110536c344254868390dbb71854c
Signed-off-by: Rocky Phagura <[email protected]>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43684
Tested-by: build bot (Jenkins) <[email protected]>
Reviewed-by: Angel Pons <[email protected]> | afb7a814783cda12f5b72167163b9109ee1d15a7 | False | coreboot/coreboot | Mirror of https://review.coreboot.org/coreboot.git. We don't handle Pull Requests. | 2014-03-16 08:11:46 | 2022-08-27 16:07:58 | https://www.coreboot.org/ | coreboot | 1589.0 | 437.0 | install_permanent_handler | install_permanent_handler( int num_cpus , uintptr_t smbase , size_t smsize , size_t save_state_size) | ['num_cpus', 'smbase', 'smsize', 'save_state_size'] | static int install_permanent_handler(int num_cpus, uintptr_t smbase,
size_t smsize, size_t save_state_size)
{
/* There are num_cpus concurrent stacks and num_cpus concurrent save
* state areas. Lastly, set the stack size to 1KiB. */
struct smm_loader_params smm_params = {
.per_cpu_stack_size = CONFIG_SMM_MODULE_STACK_SIZE,
.num_concurrent_stacks = num_cpus,
.per_cpu_save_state_size = save_state_size,
.num_concurrent_save_states = num_cpus,
};
/* Allow callback to override parameters. */
if (mp_state.ops.adjust_smm_params != NULL)
mp_state.ops.adjust_smm_params(&smm_params, 1);
printk(BIOS_DEBUG, "Installing SMM handler to 0x%08lx\n", smbase);
if (smm_load_module((void *)smbase, smsize, &smm_params))
return -1;
adjust_smm_apic_id_map(&smm_params);
return 0;
} | 103 | True | 1 |
CVE-2022-29264 | 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/coreboot/coreboot/commit/afb7a814783cda12f5b72167163b9109ee1d15a7', 'name': 'https://github.com/coreboot/coreboot/commit/afb7a814783cda12f5b72167163b9109ee1d15a7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://review.coreboot.org/c/coreboot/+/63478', 'name': 'https://review.coreboot.org/c/coreboot/+/63478', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:coreboot:coreboot:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.13', 'versionEndIncluding': '4.16', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in coreboot 4.13 through 4.16. On APs, arbitrary code execution in SMM may occur.'}] | 2022-05-04T18:28Z | 2022-04-25T07: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 | Rocky Phagura | 2020-07-21 14:48:48-07:00 | cpu/x86/smm: Introduce SMM module loader version 2
Xeon-SP Skylake Scalable Processor can have 36 CPU threads (18 cores).
Current coreboot SMM is unable to handle more than ~32 CPU threads.
This patch introduces a version 2 of the SMM module loader which
addresses this problem. Having two versions of the SMM module loader
prevents any issues to current projects. Future Xeon-SP products will
be using this version of the SMM loader. Subsequent patches will
enable board specific functionality for Xeon-SP.
The reason for moving to version 2 is the state save area begins to
encroach upon the SMI handling code when more than 32 CPU threads are
in the system. This can cause system hangs, reboots, etc. The second
change is related to staggered entry points with simple near jumps. In
the current loader, near jumps will not work because the CPU is jumping
within the same code segment. In version 2, "far" address jumps are
necessary therefore protected mode must be enabled first. The SMM
layout and how the CPUs are staggered are documented in the code.
By making the modifications above, this allows the smm module loader to
expand easily as more CPU threads are added.
TEST=build for Tiogapass platform under OCP mainboard. Enable the
following in Kconfig.
select CPU_INTEL_COMMON_SMM
select SOC_INTEL_COMMON_BLOCK_SMM
select SMM_TSEG
select HAVE_SMI_HANDLER
select ACPI_INTEL_HARDWARE_SLEEP_VALUES
Debug console will show all 36 cores relocated. Further tested by
generating SMI's to port 0xb2 using XDP/ITP HW debugger and ensured all
cores entering and exiting SMM properly. In addition, booted to Linux
5.4 kernel and observed no issues during mp init.
Change-Id: I00a23a5f2a46110536c344254868390dbb71854c
Signed-off-by: Rocky Phagura <[email protected]>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43684
Tested-by: build bot (Jenkins) <[email protected]>
Reviewed-by: Angel Pons <[email protected]> | afb7a814783cda12f5b72167163b9109ee1d15a7 | False | coreboot/coreboot | Mirror of https://review.coreboot.org/coreboot.git. We don't handle Pull Requests. | 2014-03-16 08:11:46 | 2022-08-27 16:07:58 | https://www.coreboot.org/ | coreboot | 1589.0 | 437.0 | install_relocation_handler | install_relocation_handler( int num_cpus , size_t save_state_size) | ['num_cpus', 'save_state_size'] | static int install_relocation_handler(int num_cpus, size_t save_state_size)
{
struct smm_loader_params smm_params = {
.per_cpu_stack_size = CONFIG_SMM_STUB_STACK_SIZE,
.num_concurrent_stacks = num_cpus,
.per_cpu_save_state_size = save_state_size,
.num_concurrent_save_states = 1,
.handler = smm_do_relocation,
};
/* Allow callback to override parameters. */
if (mp_state.ops.adjust_smm_params != NULL)
mp_state.ops.adjust_smm_params(&smm_params, 0);
if (smm_setup_relocation_handler(&smm_params))
return -1;
adjust_smm_apic_id_map(&smm_params);
return 0;
} | 85 | True | 1 |
CVE-2022-29264 | 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/coreboot/coreboot/commit/afb7a814783cda12f5b72167163b9109ee1d15a7', 'name': 'https://github.com/coreboot/coreboot/commit/afb7a814783cda12f5b72167163b9109ee1d15a7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://review.coreboot.org/c/coreboot/+/63478', 'name': 'https://review.coreboot.org/c/coreboot/+/63478', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:coreboot:coreboot:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.13', 'versionEndIncluding': '4.16', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in coreboot 4.13 through 4.16. On APs, arbitrary code execution in SMM may occur.'}] | 2022-05-04T18:28Z | 2022-04-25T07: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 | Rocky Phagura | 2020-07-21 14:48:48-07:00 | cpu/x86/smm: Introduce SMM module loader version 2
Xeon-SP Skylake Scalable Processor can have 36 CPU threads (18 cores).
Current coreboot SMM is unable to handle more than ~32 CPU threads.
This patch introduces a version 2 of the SMM module loader which
addresses this problem. Having two versions of the SMM module loader
prevents any issues to current projects. Future Xeon-SP products will
be using this version of the SMM loader. Subsequent patches will
enable board specific functionality for Xeon-SP.
The reason for moving to version 2 is the state save area begins to
encroach upon the SMI handling code when more than 32 CPU threads are
in the system. This can cause system hangs, reboots, etc. The second
change is related to staggered entry points with simple near jumps. In
the current loader, near jumps will not work because the CPU is jumping
within the same code segment. In version 2, "far" address jumps are
necessary therefore protected mode must be enabled first. The SMM
layout and how the CPUs are staggered are documented in the code.
By making the modifications above, this allows the smm module loader to
expand easily as more CPU threads are added.
TEST=build for Tiogapass platform under OCP mainboard. Enable the
following in Kconfig.
select CPU_INTEL_COMMON_SMM
select SOC_INTEL_COMMON_BLOCK_SMM
select SMM_TSEG
select HAVE_SMI_HANDLER
select ACPI_INTEL_HARDWARE_SLEEP_VALUES
Debug console will show all 36 cores relocated. Further tested by
generating SMI's to port 0xb2 using XDP/ITP HW debugger and ensured all
cores entering and exiting SMM properly. In addition, booted to Linux
5.4 kernel and observed no issues during mp init.
Change-Id: I00a23a5f2a46110536c344254868390dbb71854c
Signed-off-by: Rocky Phagura <[email protected]>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43684
Tested-by: build bot (Jenkins) <[email protected]>
Reviewed-by: Angel Pons <[email protected]> | afb7a814783cda12f5b72167163b9109ee1d15a7 | False | coreboot/coreboot | Mirror of https://review.coreboot.org/coreboot.git. We don't handle Pull Requests. | 2014-03-16 08:11:46 | 2022-08-27 16:07:58 | https://www.coreboot.org/ | coreboot | 1589.0 | 437.0 | smm_do_relocation | smm_do_relocation( void * arg) | ['arg'] | static void asmlinkage smm_do_relocation(void *arg)
{
const struct smm_module_params *p;
const struct smm_runtime *runtime;
int cpu;
uintptr_t curr_smbase;
uintptr_t perm_smbase;
p = arg;
runtime = p->runtime;
cpu = p->cpu;
curr_smbase = runtime->smbase;
if (cpu >= CONFIG_MAX_CPUS) {
printk(BIOS_CRIT,
"Invalid CPU number assigned in SMM stub: %d\n", cpu);
return;
}
/*
* The permanent handler runs with all cpus concurrently. Precalculate
* the location of the new SMBASE. If using SMM modules then this
* calculation needs to match that of the module loader.
*/
perm_smbase = mp_state.perm_smbase;
perm_smbase -= cpu * runtime->save_state_size;
printk(BIOS_DEBUG, "New SMBASE 0x%08lx\n", perm_smbase);
/* Setup code checks this callback for validity. */
mp_state.ops.relocation_handler(cpu, curr_smbase, perm_smbase);
if (CONFIG(STM)) {
uintptr_t mseg;
mseg = mp_state.perm_smbase +
(mp_state.perm_smsize - CONFIG_MSEG_SIZE);
stm_setup(mseg, p->cpu,
perm_smbase,
mp_state.perm_smbase,
runtime->start32_offset);
}
} | 151 | True | 1 |
CVE-2022-29368 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 7.1 | HIGH | 1.8 | 5.2 | False | [{'url': 'https://github.com/Moddable-OpenSource/moddable/issues/896', 'name': 'https://github.com/Moddable-OpenSource/moddable/issues/896', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/Moddable-OpenSource/moddable/commit/135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45', 'name': 'https://github.com/Moddable-OpenSource/moddable/commit/135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:moddable:moddable:*:*:*:*:*:*:*:*', 'versionEndIncluding': 'os220330', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Moddable commit before 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 was discovered to contain an out-of-bounds read via the function fxUint8Getter at /moddable/xs/sources/xsDataView.c.'}] | 2022-05-23T18:41Z | 2022-05-12T19: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 | Patrick Soquet | 2022-04-12 13:38:55+02:00 | XS: #896 | 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 | False | Moddable-OpenSource/moddable | Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers. | 2017-10-17 04:08:41 | 2022-08-26 18:02:32 | http://www.moddable.com | Moddable-OpenSource | 985.0 | 182.0 | fx_DataView | fx_DataView( txMachine * the) | ['the'] | void fx_DataView(txMachine* the)
{
txSlot* slot;
txBoolean flag = 0;
txInteger offset, size;
txSlot* info;
txSlot* instance;
txSlot* view;
txSlot* buffer;
if (mxIsUndefined(mxTarget))
mxTypeError("call: DataView");
if ((mxArgc > 0) && (mxArgv(0)->kind == XS_REFERENCE_KIND)) {
slot = mxArgv(0)->value.reference->next;
if (slot && ((slot->kind == XS_ARRAY_BUFFER_KIND) || (slot->kind == XS_HOST_KIND))) {
flag = 1;
}
}
if (!flag)
mxTypeError("buffer is no ArrayBuffer instance");
offset = fxArgToByteLength(the, 1, 0);
info = fxGetBufferInfo(the, mxArgv(0));
if (info->value.bufferInfo.length < offset)
mxRangeError("out of range byteOffset %ld", offset);
size = fxArgToByteLength(the, 2, -1);
if (size >= 0) {
if (info->value.bufferInfo.length < (offset + size))
mxRangeError("out of range byteLength %ld", size);
}
else {
if (info->value.bufferInfo.maxLength < 0)
size = info->value.bufferInfo.length - offset;
}
mxPushSlot(mxTarget);
fxGetPrototypeFromConstructor(the, &mxDataViewPrototype);
instance = fxNewDataViewInstance(the);
mxPullSlot(mxResult);
view = instance->next;
buffer = view->next;
buffer->kind = XS_REFERENCE_KIND;
buffer->value.reference = mxArgv(0)->value.reference;
info = fxGetBufferInfo(the, buffer);
if (info->value.bufferInfo.maxLength >= 0) {
if (info->value.bufferInfo.length < offset)
mxRangeError("out of range byteOffset %ld", offset);
else if (size >= 0) {
if (info->value.bufferInfo.length < (offset + size))
mxRangeError("out of range byteLength %ld", size);
}
}
view->value.dataView.offset = offset;
view->value.dataView.size = size;
} | 386 | True | 1 |
CVE-2022-29368 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 7.1 | HIGH | 1.8 | 5.2 | False | [{'url': 'https://github.com/Moddable-OpenSource/moddable/issues/896', 'name': 'https://github.com/Moddable-OpenSource/moddable/issues/896', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/Moddable-OpenSource/moddable/commit/135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45', 'name': 'https://github.com/Moddable-OpenSource/moddable/commit/135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:moddable:moddable:*:*:*:*:*:*:*:*', 'versionEndIncluding': 'os220330', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Moddable commit before 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 was discovered to contain an out-of-bounds read via the function fxUint8Getter at /moddable/xs/sources/xsDataView.c.'}] | 2022-05-23T18:41Z | 2022-05-12T19: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 | Patrick Soquet | 2022-04-12 13:38:55+02:00 | XS: #896 | 135aa9a4a6a9b49b60aa730ebc3bcc6247d75c45 | False | Moddable-OpenSource/moddable | Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers. | 2017-10-17 04:08:41 | 2022-08-26 18:02:32 | http://www.moddable.com | Moddable-OpenSource | 985.0 | 182.0 | fx_TypedArray | fx_TypedArray( txMachine * the) | ['the'] | void fx_TypedArray(txMachine* the)
{
txSlot* instance = fxConstructTypedArray(the);
txSlot* dispatch = instance->next;
txSlot* view = dispatch->next;
txSlot* buffer = view->next;
txSlot* data = C_NULL;
txU2 shift = dispatch->value.typedArray.dispatch->shift;
txSlot* slot;
if ((mxArgc > 0) && (mxArgv(0)->kind == XS_REFERENCE_KIND)) {
slot = mxArgv(0)->value.reference->next;
if (slot && ((slot->kind == XS_ARRAY_BUFFER_KIND) || (slot->kind == XS_HOST_KIND))) {
txInteger offset = fxArgToByteLength(the, 1, 0);
txInteger size;
txSlot* info;
if (offset & ((1 << shift) - 1))
mxRangeError("invalid byteOffset %ld", offset);
size = fxArgToByteLength(the, 2, -1);
info = fxGetBufferInfo(the, mxArgv(0));
if (size >= 0) {
size <<= shift;
if (info->value.bufferInfo.length < (offset + size))
mxRangeError("out of range byteLength %ld", size);
}
else {
if (info->value.bufferInfo.length & ((1 << shift) - 1))
mxRangeError("invalid byteLength %ld", info->value.bufferInfo.length);
size = info->value.bufferInfo.length - offset;
if (size < 0)
mxRangeError("out of range byteLength %ld", size);
if (info->value.bufferInfo.maxLength >= 0)
size = -1;
}
view->value.dataView.offset = offset;
view->value.dataView.size = size;
buffer->kind = XS_REFERENCE_KIND;
buffer->value.reference = mxArgv(0)->value.reference;
}
else if (slot && (slot->kind == XS_TYPED_ARRAY_KIND)) {
txSlot* sourceDispatch = slot;
txSlot* sourceView = sourceDispatch->next;
txSlot* sourceBuffer = sourceView->next;
txU2 sourceShift = sourceDispatch->value.typedArray.dispatch->shift;
txInteger sourceLength = fxCheckDataViewSize(the, sourceView, sourceBuffer, XS_IMMUTABLE) >> sourceShift;
txSlot* sourceData = sourceBuffer->value.reference->next;
txInteger sourceDelta = sourceDispatch->value.typedArray.dispatch->size;
txInteger sourceOffset = sourceView->value.dataView.offset;
txInteger offset = 0;
txInteger size = sourceLength << shift;
/* THIS */
mxPushUninitialized();
/* FUNCTION */
mxPush(mxArrayBufferConstructor);
/* TARGET */
if (sourceData->kind == XS_ARRAY_BUFFER_KIND) {
mxPushSlot(sourceBuffer);
mxGetID(mxID(_constructor));
fxToSpeciesConstructor(the, &mxArrayBufferConstructor);
}
else
mxPush(mxArrayBufferConstructor);
/* RESULT */
mxPushUndefined();
mxPushUninitialized();
mxPushUninitialized();
/* ARGUMENTS */
sourceLength = fxGetDataViewSize(the, sourceView, sourceBuffer) >> sourceShift;
size = sourceLength << shift;
mxPushInteger(size);
mxRunCount(1);
mxPullSlot(buffer);
sourceLength = fxCheckDataViewSize(the, sourceView, sourceBuffer, XS_IMMUTABLE) >> sourceShift;
size = sourceLength << shift;
data = fxCheckArrayBufferDetached(the, buffer, XS_MUTABLE);
view->value.dataView.offset = offset;
view->value.dataView.size = size;
if (dispatch == sourceDispatch)
c_memcpy(data->value.arrayBuffer.address + offset, sourceData->value.arrayBuffer.address + sourceOffset, size);
else {
txBoolean contentType = (dispatch->value.typedArray.dispatch->constructorID == _BigInt64Array)
|| (dispatch->value.typedArray.dispatch->constructorID == _BigUint64Array);
txBoolean sourceContentType = (sourceDispatch->value.typedArray.dispatch->constructorID == _BigInt64Array)
|| (sourceDispatch->value.typedArray.dispatch->constructorID == _BigUint64Array);
if (contentType != sourceContentType)
mxTypeError("incompatible content type");
mxPushUndefined();
while (offset < size) {
(*sourceDispatch->value.typedArray.dispatch->getter)(the, sourceData, sourceOffset, the->stack, EndianNative);
(*dispatch->value.typedArray.dispatch->coerce)(the, the->stack);
(*dispatch->value.typedArray.dispatch->setter)(the, data, offset, the->stack, EndianNative);
sourceOffset += sourceDelta;
offset += 1 << shift;
}
mxPop();
}
}
else {
fx_TypedArray_from_object(the, instance, C_NULL, C_NULL);
}
}
else {
txInteger length = fxArgToByteLength(the, 0, 0);
if (length & (((1 << shift) - 1) << (32 - shift)))
mxRangeError("out of range byteLength");
length <<= shift;
mxPush(mxArrayBufferConstructor);
mxNew();
mxPushInteger(length);
mxRunCount(1);
mxPullSlot(buffer);
view->value.dataView.offset = 0;
view->value.dataView.size = length;
}
} | 918 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::CFontFileBase | NSFontConverter::CFontFileBase::CFontFileBase( char * sFile , int nLen , bool bFreeFileData) | ['sFile', 'nLen', 'bFreeFileData'] | CFontFileBase(char *sFile, int nLen, bool bFreeFileData)
{
m_sFileData = m_sFile = (unsigned char *)sFile;
m_nLen = nLen;
m_bFreeFileData = bFreeFileData;
m_nPos = 0;
} | 37 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::CheckRegion | NSFontConverter::CFontFileBase::CheckRegion( int nPos , int nSize) | ['nPos', 'nSize'] | bool CheckRegion(int nPos, int nSize)
{
return (nPos >= 0 && nPos + nSize >= nPos && nPos + nSize <= m_nLen);
} | 29 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetS16BE | NSFontConverter::CFontFileBase::GetS16BE( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | int GetS16BE (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + 1 >= m_nLen )
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[nPos];
nRes = (nRes << 8) + m_sFile[ nPos + 1 ];
if ( nRes & 0x8000 )
nRes |= ~0xffff;
return nRes;
} | 70 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetS32BE | NSFontConverter::CFontFileBase::GetS32BE( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | int GetS32BE (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + 3 >= m_nLen )
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[ nPos ];
nRes = (nRes << 8) + m_sFile[nPos + 1];
nRes = (nRes << 8) + m_sFile[nPos + 2];
nRes = (nRes << 8) + m_sFile[nPos + 3];
if ( nRes & 0x80000000 )
nRes |= ~0xffffffff;
return nRes;
} | 102 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetS8 | NSFontConverter::CFontFileBase::GetS8( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | int GetS8 (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos >= m_nLen )
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[ nPos ];
if ( nRes & 0x80 )
nRes |= ~0xff;
return nRes;
} | 52 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetU16BE | NSFontConverter::CFontFileBase::GetU16BE( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | int GetU16BE (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + 1 >= m_nLen)
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[ nPos ];
nRes = (nRes << 8) + m_sFile[ nPos + 1 ];
return nRes;
} | 60 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetU32BE | NSFontConverter::CFontFileBase::GetU32BE( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | unsigned int GetU32BE (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + 3 >= m_nLen )
{
*pbSuccess = false;
return 0;
}
unsigned int nRes = m_sFile[nPos];
nRes = (nRes << 8) + m_sFile[nPos + 1];
nRes = (nRes << 8) + m_sFile[nPos + 2];
nRes = (nRes << 8) + m_sFile[nPos + 3];
return nRes;
} | 93 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetU32LE | NSFontConverter::CFontFileBase::GetU32LE( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | unsigned int GetU32LE (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + 3 >= m_nLen )
{
*pbSuccess = false;
return 0;
}
unsigned int nRes = m_sFile[nPos + 3];
nRes = (nRes << 8) + m_sFile[nPos + 2];
nRes = (nRes << 8) + m_sFile[nPos + 1];
nRes = (nRes << 8) + m_sFile[nPos + 0];
return nRes;
} | 95 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetU8 | NSFontConverter::CFontFileBase::GetU8( int nPos , bool * pbSuccess) | ['nPos', 'pbSuccess'] | int GetU8 (int nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos >= m_nLen )
{
*pbSuccess = false;
return 0;
}
return m_sFile[ nPos ];
} | 37 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::GetUVarBE | NSFontConverter::CFontFileBase::GetUVarBE( int nPos , int nSize , bool * pbSuccess) | ['nPos', 'nSize', 'pbSuccess'] | unsigned int GetUVarBE(int nPos, int nSize, bool *pbSuccess)
{
//*pbSuccess = true;
if ( nPos < 0 || nPos + nSize > m_nLen )
{
*pbSuccess = false;
return 0;
}
unsigned int nRes = 0;
for ( int nIndex = 0; nIndex < nSize; ++nIndex )
nRes = (nRes << 8) + m_sFile[nPos + nIndex];
return nRes;
} | 75 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileBase::Read | NSFontConverter::CFontFileBase::Read( void * pDestBuffer , int nSize) | ['pDestBuffer', 'nSize'] | int Read(void* pDestBuffer, int nSize)
{
if ( m_nPos + nSize >= m_nLen )
nSize = m_nLen - m_nPos - 1;
memcpy( pDestBuffer, (m_sFile + m_nPos), nSize );
m_nPos += nSize;
return nSize;
} | 47 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileType1::Parse | NSFontConverter::CFontFileType1::Parse() | [] | void CFontFileType1::Parse()
{
// Сначала проверим, если это pfb файл, тогда избавимся от всех его маркеров.
Reset();
while( m_nPos < m_nLen && ( ' ' == m_sFile[m_nPos] || '\t' == m_sFile[m_nPos] || '\r' == m_sFile[m_nPos] || '\n' == m_sFile[m_nPos] ) )
++m_nPos;
bool bSuccess = true;
int nChar = GetU8( m_nPos, &bSuccess );
if ( !bSuccess || ( PFB_MARKER != nChar && '%' != nChar ) )
return;
else if ( PFB_MARKER == nChar )
{
if ( !RemovePfbMarkers() )
return;
}
char *sLine, *sLine1, *pCur, *pTemp;
char sBuffer[256];
int nCount, nCode;
int nIndex = 0;
unsigned char *sEexec = NULL;
m_oTopDict.arrdFontBBox[0] = 0; m_oTopDict.arrdFontBBox[1] = 0;
m_oTopDict.arrdFontBBox[2] = 0; m_oTopDict.arrdFontBBox[3] = 0;
m_oTopDict.arrdFontMatrix[0] = 0.001; m_oTopDict.arrdFontMatrix[1] = 0;
m_oTopDict.arrdFontMatrix[2] = 0; m_oTopDict.arrdFontMatrix[3] = 0.001;
m_oTopDict.arrdFontMatrix[4] = 0; m_oTopDict.arrdFontMatrix[5] = 0;
for (nIndex = 1, sLine = (char *)m_sFile; nIndex <= 100 && sLine && (!m_sName || !m_arrEncoding); ++nIndex )
{
if ( !m_sName && !strncmp( sLine, "/FontName", 9) )
{
strncpy( sBuffer, sLine, 255);
sBuffer[255] = '\0';
if ( ( pCur = strchr( sBuffer + 9, '/' ) ) && ( pCur = strtok( pCur + 1, " \t\n\r" ) ) )
{
m_sName = CopyString( pCur );
}
sLine = GetNextLine(sLine);
}
else if ( !strncmp( sLine, "/FontMatrix", 11 ) )
{
strncpy( sBuffer, sLine, 255);
sBuffer[255] = '\0';
ReadDoubleArray<6>( (unsigned char*)(sBuffer + 11), 244, m_oTopDict.arrdFontMatrix );
sLine = GetNextLine( sLine );
}
else if ( !strncmp( sLine, "/FontBBox", 9 ) )
{
strncpy( sBuffer, sLine, 255);
sBuffer[255] = '\0';
ReadDoubleArray<4>( (unsigned char*)(sBuffer + 9), 246, m_oTopDict.arrdFontBBox );
sLine = GetNextLine( sLine );
}
else if (!m_arrEncoding && !strncmp( sLine, "/Encoding StandardEncoding def", 30))
{
m_arrEncoding = c_arrsFontFileType1StandardEncoding;
}
else if (!m_arrEncoding && !strncmp( sLine, "/Encoding 256 array", 19))
{
m_arrEncoding = (char **)MemUtilsMallocArray(256, sizeof(char *));
int nJ = 0;
for (nJ = 0; nJ < 256; ++nJ )
{
m_arrEncoding[nJ] = NULL;
}
for (nJ = 0, sLine = GetNextLine(sLine); nJ < 300 && sLine && ( sLine1 = GetNextLine( sLine )); ++nJ, sLine = sLine1)
{
if ( ( nCount = sLine1 - sLine ) > 255 )
{
nCount = 255;
}
strncpy( sBuffer, sLine, nCount);
sBuffer[ nCount ] = '\0';
for ( pCur = sBuffer; *pCur == ' ' || *pCur == '\t'; ++pCur );
if ( !strncmp( pCur, "dup", 3 ) )
{
for ( pCur += 3; *pCur == ' ' || *pCur == '\t'; ++pCur ) ;
for ( pTemp = pCur; *pTemp >= '0' && *pTemp <= '9'; ++pTemp ) ;
if ( *pTemp )
{
char nChar = *pTemp;
*pTemp = '\0';
nCode = atoi( pCur );
*pTemp = nChar;
if ( nCode == 8 && *pTemp == '#')
{
nCode = 0;
for (++pTemp; *pTemp >= '0' && *pTemp <= '7'; ++pTemp)
{
nCode = nCode * 8 + (*pTemp - '0');
}
}
if ( nCode < 256 )
{
for ( pCur = pTemp; *pCur == ' ' || *pCur == '\t'; ++pCur ) ;
if ( *pCur == '/')
{
++pCur;
for ( pTemp = pCur; *pTemp && *pTemp != ' ' && *pTemp != '\t'; ++pTemp ) ;
*pTemp = '\0';
m_arrEncoding[ nCode ] = CopyString( pCur );
}
}
}
}
else
{
if ( strtok( sBuffer, " \t") && ( pCur = strtok(NULL, " \t\n\r")) && !strcmp( pCur, "def"))
{
break;
}
}
}
}
else
{
if ( !sEexec )
sEexec = (unsigned char*)strstr( sLine, "currentfile eexec" );
sLine = GetNextLine(sLine);
}
}
if ( NULL != sEexec )
{
unsigned char* sTemp = sEexec;
while ( sTemp != (unsigned char*)strstr( (char*)sTemp, "cleartomark" ) && sTemp < m_sFile + m_nLen )
sTemp++;
int nBufferLen = sTemp - ( sEexec + 17 );
unsigned char *sEexecBuffer = (unsigned char*)MemUtilsMalloc( nBufferLen );
if ( !sEexecBuffer )
return;
memcpy( sEexecBuffer, sEexec + 17, nBufferLen );
DecryptEexec( &sEexecBuffer, nBufferLen );
sEexec = sEexecBuffer + 4; // Первые четыре байта были случайными
int nEexecLen = nBufferLen - 4;
// Теперь прочитаем содержимое Private Dict
bool bGlyphsSection = false, bSubrsSection = false;
//unsigned short ushChar = '';
std::wstring sToken, sGlyph;
int nLength = 0;
// Выставляем значения по умолчанию элементов Private Dict
m_oPrivateDict.nBlueValues = 0;
m_oPrivateDict.nOtherBlues = 0;
m_oPrivateDict.nFamilyBlues = 0;
m_oPrivateDict.nFamilyOtherBlues = 0;
m_oPrivateDict.dBlueScale = 0.039625;
m_oPrivateDict.nBlueShift = 7;
m_oPrivateDict.nBlueFuzz = 1;
m_oPrivateDict.bHasStdHW = false;
m_oPrivateDict.bHasStdVW = false;
m_oPrivateDict.nStemSnapH = 0;
m_oPrivateDict.nStemSnapV = 0;
m_oPrivateDict.bHasForceBold = false;
m_oPrivateDict.nLanguageGroup = 0;
m_oPrivateDict.nLenIV = 4;
m_oPrivateDict.dExpansionFactor = 0.06;
for ( int nIndex = 0; nIndex < nEexecLen; nIndex++ )
{
unsigned char nChar = sEexec[nIndex];
if ( ( bGlyphsSection || bSubrsSection ) && 'R' == nChar && nLength > 0 )
{
unsigned char *sData = new unsigned char[nLength];
if ( sData )
{
memcpy( sData, sEexec + nIndex + 3, nLength );
unsigned short unKey = 4330U;
unsigned char *sCur = sData;
EexecDecode( &sCur, sCur + nLength, sCur, nLength, &unKey );
if ( m_oPrivateDict.nLenIV > 0 && m_oPrivateDict.nLenIV < nLength )
{
Type1Charstring oCharstring = DecodeCharString( sData + m_oPrivateDict.nLenIV, nLength - m_oPrivateDict.nLenIV );
if ( bGlyphsSection )
{
int nUnicode = Type1NameToUnicodeW( sGlyph.c_str() );
if ( 0 != nUnicode )
m_arrCharstrings.Add( Type1Glyph( sGlyph, nUnicode, oCharstring ) );
}
else // if ( bSubrsSection )
{
m_arrSubrs.Add( oCharstring );
}
}
delete []sData;
}
nIndex += nLength + 3;
}
else if ( IS_PS_SPACE( nChar ) )
{
nLength = Utils::GetInteger( sToken );
sToken.clear();
}
else
{
sToken.push_back( (wchar_t)nChar );
if ( !bGlyphsSection && '/' == sToken[0] )
{
int nTempChar = sToken[1];
switch (nTempChar)
{
case 'B':
{
if ( L"/BlueValues" == sToken )
m_oPrivateDict.nBlueValues = ReadIntArray<type1MaxBlueValues>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, m_oPrivateDict.arrnBlueValues );
else if ( L"/BlueScale" == sToken )
m_oPrivateDict.dBlueScale = ReadDouble( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
else if ( L"/BlueShift" == sToken )
m_oPrivateDict.nBlueShift = ReadInt( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
else if ( L"/BlueFuzz" == sToken )
m_oPrivateDict.nBlueFuzz = ReadInt( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
break;
}
case 'C':
{
if ( L"/CharString" == sToken )
bGlyphsSection = true;
break;
}
case 'E':
{
if ( L"/ExpansionFactor" == sToken )
m_oPrivateDict.dExpansionFactor = ReadDouble( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
break;
}
case 'F':
{
if ( L"/FamilyBlues" == sToken )
m_oPrivateDict.nFamilyBlues = ReadIntArray<type1MaxBlueValues>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, m_oPrivateDict.arrnFamilyBlues );
else if ( L"/FamilyOtherBlues" == sToken )
m_oPrivateDict.nFamilyOtherBlues = ReadIntArray<type1MaxOtherBlues>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, m_oPrivateDict.arrnFamilyOtherBlues );
else if ( L"/ForceBold" == sToken )
{
m_oPrivateDict.bHasForceBold = true;
m_oPrivateDict.bForceBold = ReadBool( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
}
break;
}
case 'L':
{
if ( L"/LanguageGroup" == sToken )
m_oPrivateDict.nLanguageGroup = ReadInt( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
else if ( L"/lenIV" == sToken )
m_oPrivateDict.nLenIV = ReadInt( sEexec + nIndex + 1, nEexecLen - nIndex - 1 );
break;
}
case 'S':
{
if ( L"/Subrs" == sToken )
bSubrsSection = true;
else if ( L"/StemSnapH" == sToken )
m_oPrivateDict.nStemSnapH = ReadDoubleArray<type1MaxStemSnap>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, m_oPrivateDict.arrdStemSnapH );
else if ( L"/StemSnapV" == sToken )
m_oPrivateDict.nStemSnapV = ReadDoubleArray<type1MaxStemSnap>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, m_oPrivateDict.arrdStemSnapV );
else if ( L"/StdHW" == sToken )
{
// Здесь содержится массив с одним значением
double dTemp[1];
if ( ReadDoubleArray<1>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, dTemp ) > 0 )
{
m_oPrivateDict.bHasStdHW = true;
m_oPrivateDict.dStdHW = dTemp[0];
}
}
else if ( L"/StdVW" == sToken )
{
// Здесь содержится массив с одним значением
double dTemp[1];
if ( ReadDoubleArray<1>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, dTemp ) > 0 )
{
m_oPrivateDict.bHasStdHW = true;
m_oPrivateDict.dStdVW = dTemp[0];
}
}
}
}
}
else if ( '/' == nChar )
{
sToken.clear();
sGlyph.clear();
while ( ( nChar = sEexec[++nIndex] ) != ' ' )
sGlyph.push_back( (wchar_t)nChar );
}
}
}
MemUtilsFree( sEexecBuffer );
// Проведем сортировку элементов m_arrCharstrings по юникодному значению
qsort( m_arrCharstrings.GetData(), m_arrCharstrings.GetSize(), sizeof(Type1Glyph), CompareType1Glyph );
}
m_bParsed = true;
} | 2016 | True | 1 |
CVE-2022-29777 | 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/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'name': 'https://github.com/ONLYOFFICE/core/commit/b17d5e860f30e8be2caeb0022b63be4c76660178', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29777', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a heap overflow via the component DesktopEditor/fontengine/fontconverter/FontFileBase.h.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Oleg Korshul | 2020-09-30 13:52:41+03:00 | Fix 34, 35, 37 | b17d5e860f30e8be2caeb0022b63be4c76660178 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileType1::RemovePfbMarkers | NSFontConverter::CFontFileType1::RemovePfbMarkers() | [] | bool CFontFileType1::RemovePfbMarkers()
{
bool bSuccess = true;
int nBlockType = 0;
int nBlockLen = 0;
int nChar = 0;
unsigned char *sBuffer = NULL;
int nBufLen = 0;
while ( nBlockType != PFB_DONE )
{
while ( 0 == nBlockLen )
{
nChar = ReadU8( &bSuccess );
if ( !bSuccess )
return false;
nBlockType = ReadU8( &bSuccess );
if ( !bSuccess || PFB_MARKER != nChar || ( PFB_ASCII != nBlockType && PFB_BINARY != nBlockType && PFB_DONE != nBlockType ) )
return false;
if ( PFB_DONE == nBlockType )
break;
nBlockLen = ReadU32LE( &bSuccess );
if ( !bSuccess )
return false;
}
// Читаем сам блок данных
if ( nBlockLen > 0 )
{
if ( !sBuffer )
{
sBuffer = (unsigned char*)MemUtilsMalloc( nBlockLen );
if ( !sBuffer )
return false;
}
else
sBuffer = (unsigned char*)MemUtilsRealloc( sBuffer, nBufLen + nBlockLen );
Read( sBuffer + nBufLen, nBlockLen );
nBufLen += nBlockLen;
}
nBlockLen = 0;
}
if ( m_bFreeFileData )
MemUtilsFree( m_sFile );
m_bFreeFileData = true;
m_sFile = (unsigned char*)sBuffer;
m_sFileData = m_sFile;
m_nLen = nBufLen;
m_nPos = 0;
return true;
} | 235 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFile::CUtf8Converter::GetUnicodeStringFromUTF8_2bytes | NSFile::CUtf8Converter::GetUnicodeStringFromUTF8_2bytes( BYTE * pBuffer , LONG lCount , std :: wstring & sOutput) | ['pBuffer', 'lCount', 'sOutput'] | void CUtf8Converter::GetUnicodeStringFromUTF8_2bytes( BYTE* pBuffer, LONG lCount, std::wstring& sOutput )
{
WCHAR* pUnicodeString = new WCHAR[lCount + 1];
WCHAR* pStart = pUnicodeString;
LONG lIndex = 0;
while (lIndex < lCount)
{
BYTE byteMain = pBuffer[lIndex];
if (0x00 == (byteMain & 0x80))
{
// 1 byte
*pUnicodeString++ = (WCHAR)byteMain;
++lIndex;
}
else if (0x00 == (byteMain & 0x20))
{
// 2 byte
int val = (int)(((byteMain & 0x1F) << 6) |
(pBuffer[lIndex + 1] & 0x3F));
*pUnicodeString++ = (WCHAR)(val);
lIndex += 2;
}
else if (0x00 == (byteMain & 0x10))
{
// 3 byte
int val = (int)(((byteMain & 0x0F) << 12) |
((pBuffer[lIndex + 1] & 0x3F) << 6) |
(pBuffer[lIndex + 2] & 0x3F));
WriteUtf16_WCHAR(val, pUnicodeString);
lIndex += 3;
}
else if (0x00 == (byteMain & 0x0F))
{
// 4 byte
int val = (int)(((byteMain & 0x07) << 18) |
((pBuffer[lIndex + 1] & 0x3F) << 12) |
((pBuffer[lIndex + 2] & 0x3F) << 6) |
(pBuffer[lIndex + 3] & 0x3F));
WriteUtf16_WCHAR(val, pUnicodeString);
lIndex += 4;
}
else if (0x00 == (byteMain & 0x08))
{
// 4 byte
int val = (int)(((byteMain & 0x07) << 18) |
((pBuffer[lIndex + 1] & 0x3F) << 12) |
((pBuffer[lIndex + 2] & 0x3F) << 6) |
(pBuffer[lIndex + 3] & 0x3F));
WriteUtf16_WCHAR(val, pUnicodeString);
lIndex += 4;
}
else if (0x00 == (byteMain & 0x04))
{
// 5 byte
int val = (int)(((byteMain & 0x03) << 24) |
((pBuffer[lIndex + 1] & 0x3F) << 18) |
((pBuffer[lIndex + 2] & 0x3F) << 12) |
((pBuffer[lIndex + 3] & 0x3F) << 6) |
(pBuffer[lIndex + 4] & 0x3F));
WriteUtf16_WCHAR(val, pUnicodeString);
lIndex += 5;
}
else
{
// 6 byte
int val = (int)(((byteMain & 0x01) << 30) |
((pBuffer[lIndex + 1] & 0x3F) << 24) |
((pBuffer[lIndex + 2] & 0x3F) << 18) |
((pBuffer[lIndex + 3] & 0x3F) << 12) |
((pBuffer[lIndex + 4] & 0x3F) << 6) |
(pBuffer[lIndex + 5] & 0x3F));
WriteUtf16_WCHAR(val, pUnicodeString);
lIndex += 5;
}
}
*pUnicodeString++ = 0;
sOutput.append(pStart);
delete [] pStart;
} | 610 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFile::CUtf8Converter::GetUnicodeStringFromUTF8_4bytes | NSFile::CUtf8Converter::GetUnicodeStringFromUTF8_4bytes( BYTE * pBuffer , LONG lCount , std :: wstring & sOutput) | ['pBuffer', 'lCount', 'sOutput'] | void CUtf8Converter::GetUnicodeStringFromUTF8_4bytes( BYTE* pBuffer, LONG lCount, std::wstring& sOutput )
{
WCHAR* pUnicodeString = new WCHAR[lCount + 1];
LONG lIndexUnicode = 0;
LONG lIndex = 0;
while (lIndex < lCount)
{
BYTE byteMain = pBuffer[lIndex];
if (0x00 == (byteMain & 0x80))
{
// 1 byte
pUnicodeString[lIndexUnicode++] = (WCHAR)byteMain;
++lIndex;
}
else if (0x00 == (byteMain & 0x20))
{
// 2 byte
int val = (int)(((byteMain & 0x1F) << 6) |
(pBuffer[lIndex + 1] & 0x3F));
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
lIndex += 2;
}
else if (0x00 == (byteMain & 0x10))
{
// 3 byte
int val = (int)(((byteMain & 0x0F) << 12) |
((pBuffer[lIndex + 1] & 0x3F) << 6) |
(pBuffer[lIndex + 2] & 0x3F));
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
lIndex += 3;
}
else if (0x00 == (byteMain & 0x0F))
{
// 4 byte
int val = (int)(((byteMain & 0x07) << 18) |
((pBuffer[lIndex + 1] & 0x3F) << 12) |
((pBuffer[lIndex + 2] & 0x3F) << 6) |
(pBuffer[lIndex + 3] & 0x3F));
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
lIndex += 4;
}
else if (0x00 == (byteMain & 0x08))
{
// 4 byte
int val = (int)(((byteMain & 0x07) << 18) |
((pBuffer[lIndex + 1] & 0x3F) << 12) |
((pBuffer[lIndex + 2] & 0x3F) << 6) |
(pBuffer[lIndex + 3] & 0x3F));
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
lIndex += 4;
}
else if (0x00 == (byteMain & 0x04))
{
// 5 byte
int val = (int)(((byteMain & 0x03) << 24) |
((pBuffer[lIndex + 1] & 0x3F) << 18) |
((pBuffer[lIndex + 2] & 0x3F) << 12) |
((pBuffer[lIndex + 3] & 0x3F) << 6) |
(pBuffer[lIndex + 4] & 0x3F));
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
lIndex += 5;
}
else
{
// 6 byte
int val = (int)(((byteMain & 0x01) << 30) |
((pBuffer[lIndex + 1] & 0x3F) << 24) |
((pBuffer[lIndex + 2] & 0x3F) << 18) |
((pBuffer[lIndex + 3] & 0x3F) << 12) |
((pBuffer[lIndex + 4] & 0x3F) << 6) |
(pBuffer[lIndex + 5] & 0x3F));
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
lIndex += 5;
}
}
pUnicodeString[lIndexUnicode] = 0;
sOutput.append(pUnicodeString);
delete [] pUnicodeString;
} | 644 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | DLL_EXPCxFile::CxFile | DLL_EXPCxFile::CxFile( void) | ['void'] | CxFile(void) { };
| 6 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | DLL_EXPCxFile::~CxFile | DLL_EXPCxFile::~CxFile() | [] | virtual ~CxFile() { };
| 5 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImageBMP::Decode | CxImageBMP::Decode( CxFile * hFile) | ['hFile'] | bool CxImageBMP::Decode(CxFile * hFile)
{
if (hFile == NULL) return false;
BITMAPFILEHEADER bf;
uint32_t off = hFile->Tell(); //<CSC>
cx_try {
if (hFile->Read(&bf,min(14,sizeof(bf)),1)==0) cx_throw("Not a BMP");
bf.bfSize = m_ntohl(bf.bfSize);
bf.bfOffBits = m_ntohl(bf.bfOffBits);
if (m_ntohs(bf.bfType) != BFT_BITMAP) { //do we have a RC HEADER?
bf.bfOffBits = 0L;
hFile->Seek(off,SEEK_SET);
}
BITMAPINFOHEADER bmpHeader;
if (!DibReadBitmapInfo(hFile,&bmpHeader)) cx_throw("Error reading BMP info");
uint32_t dwCompression=bmpHeader.biCompression;
uint32_t dwBitCount=bmpHeader.biBitCount; //preserve for BI_BITFIELDS compression <Thomas Ernst>
bool bIsOldBmp = bmpHeader.biSize == sizeof(BITMAPCOREHEADER);
bool bTopDownDib = bmpHeader.biHeight<0; //<Flanders> check if it's a top-down bitmap
if (bTopDownDib) bmpHeader.biHeight=-bmpHeader.biHeight;
if (info.nEscape == -1) {
// Return output dimensions only
head.biWidth = bmpHeader.biWidth;
head.biHeight = bmpHeader.biHeight;
info.dwType = CXIMAGE_FORMAT_BMP;
cx_throw("output dimensions returned");
}
if (!Create(bmpHeader.biWidth,bmpHeader.biHeight,bmpHeader.biBitCount,CXIMAGE_FORMAT_BMP))
cx_throw("");
SetXDPI((int32_t) floor(bmpHeader.biXPelsPerMeter * 254.0 / 10000.0 + 0.5));
SetYDPI((int32_t) floor(bmpHeader.biYPelsPerMeter * 254.0 / 10000.0 + 0.5));
if (info.nEscape) cx_throw("Cancelled"); // <vho> - cancel decoding
RGBQUAD *pRgb = GetPalette();
if (pRgb){
if (bIsOldBmp){
// convert a old color table (3 byte entries) to a new
// color table (4 byte entries)
hFile->Read((void*)pRgb,DibNumColors(&bmpHeader) * sizeof(RGBTRIPLE),1);
for (int32_t i=DibNumColors(&head)-1; i>=0; i--){
pRgb[i].rgbRed = ((RGBTRIPLE *)pRgb)[i].rgbtRed;
pRgb[i].rgbBlue = ((RGBTRIPLE *)pRgb)[i].rgbtBlue;
pRgb[i].rgbGreen = ((RGBTRIPLE *)pRgb)[i].rgbtGreen;
pRgb[i].rgbReserved = (uint8_t)0;
}
} else {
hFile->Read((void*)pRgb,DibNumColors(&bmpHeader) * sizeof(RGBQUAD),1);
//force rgbReserved=0, to avoid problems with some WinXp bitmaps
for (uint32_t i=0; i<head.biClrUsed; i++) pRgb[i].rgbReserved=0;
}
}
if (info.nEscape) cx_throw("Cancelled"); // <vho> - cancel decoding
switch (dwBitCount) {
case 32 :
uint32_t bfmask[3];
if (dwCompression == BI_BITFIELDS)
{
hFile->Read(bfmask, 12, 1);
} else {
bfmask[0]=0x00FF0000;
bfmask[1]=0x0000FF00;
bfmask[2]=0x000000FF;
}
if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET);
if (dwCompression == BI_BITFIELDS || dwCompression == BI_RGB){
int32_t imagesize=4*head.biHeight*head.biWidth;
uint8_t* buff32=(uint8_t*)malloc(imagesize);
if (buff32){
hFile->Read(buff32, imagesize,1); // read in the pixels
#if CXIMAGE_SUPPORT_ALPHA
if (dwCompression == BI_RGB){
AlphaCreate();
if (AlphaIsValid()){
bool bAlphaOk = false;
uint8_t* p;
for (int32_t y=0; y<head.biHeight; y++){
p = buff32 + 3 + head.biWidth * 4 * y;
for (int32_t x=0; x<head.biWidth; x++){
if (*p) bAlphaOk = true;
AlphaSet(x,y,*p);
p+=4;
}
}
// fix if alpha pixels are all zero
if (!bAlphaOk) AlphaInvert();
}
}
#endif //CXIMAGE_SUPPORT_ALPHA
Bitfield2RGB(buff32,bfmask[0],bfmask[1],bfmask[2],32);
free(buff32);
} else cx_throw("can't allocate memory");
} else cx_throw("unknown compression");
break;
case 24 :
if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET);
if (dwCompression == BI_RGB){
hFile->Read(info.pImage, head.biSizeImage,1); // read in the pixels
} else cx_throw("unknown compression");
break;
case 16 :
{
uint32_t bfmask[3];
if (dwCompression == BI_BITFIELDS)
{
hFile->Read(bfmask, 12, 1);
} else {
bfmask[0]=0x7C00; bfmask[1]=0x3E0; bfmask[2]=0x1F; //RGB555
}
// bf.bfOffBits required after the bitfield mask <Cui Ying Jie>
if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET);
// read in the pixels
hFile->Read(info.pImage, head.biHeight*((head.biWidth+1)/2)*4,1);
// transform into RGB
Bitfield2RGB(info.pImage,bfmask[0],bfmask[1],bfmask[2],16);
break;
}
case 8 :
case 4 :
case 1 :
if (off + bf.bfOffBits < bmpHeader.biSize)
{
// ОШИБКА
// файлы паттерных заливок автофигур в ppt файлах !!!
}
else
{
if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET);
}
switch (dwCompression) {
case BI_RGB :
hFile->Read(info.pImage, head.biSizeImage,1); // read in the pixels
break;
case BI_RLE4 :
{
uint8_t status_byte = 0;
uint8_t second_byte = 0;
int32_t scanline = 0;
int32_t bits = 0;
BOOL low_nibble = FALSE;
CImageIterator iter(this);
for (BOOL bContinue = TRUE; bContinue && hFile->Read(&status_byte, sizeof(uint8_t), 1);) {
switch (status_byte) {
case RLE_COMMAND :
hFile->Read(&status_byte, sizeof(uint8_t), 1);
switch (status_byte) {
case RLE_ENDOFLINE :
bits = 0;
scanline++;
low_nibble = FALSE;
break;
case RLE_ENDOFBITMAP :
bContinue=FALSE;
break;
case RLE_DELTA :
{
// read the delta values
uint8_t delta_x;
uint8_t delta_y;
hFile->Read(&delta_x, sizeof(uint8_t), 1);
hFile->Read(&delta_y, sizeof(uint8_t), 1);
// apply them
bits += delta_x / 2;
scanline += delta_y;
break;
}
default :
hFile->Read(&second_byte, sizeof(uint8_t), 1);
uint8_t *sline = iter.GetRow(scanline);
for (int32_t i = 0; i < status_byte; i++) {
if ((uint8_t*)(sline+bits) < (uint8_t*)(info.pImage+head.biSizeImage)){
if (low_nibble) {
if (i&1)
*(sline + bits) |= (second_byte & 0x0f);
else
*(sline + bits) |= (second_byte & 0xf0)>>4;
bits++;
} else {
if (i&1)
*(sline + bits) = (uint8_t)(second_byte & 0x0f)<<4;
else
*(sline + bits) = (uint8_t)(second_byte & 0xf0);
}
}
if ((i & 1) && (i != (status_byte - 1)))
hFile->Read(&second_byte, sizeof(uint8_t), 1);
low_nibble = !low_nibble;
}
if ((((status_byte+1) >> 1) & 1 ) == 1)
hFile->Read(&second_byte, sizeof(uint8_t), 1);
break;
};
break;
default :
{
uint8_t *sline = iter.GetRow(scanline);
hFile->Read(&second_byte, sizeof(uint8_t), 1);
for (unsigned i = 0; i < status_byte; i++) {
if ((uint8_t*)(sline+bits) < (uint8_t*)(info.pImage+head.biSizeImage)){
if (low_nibble) {
if (i&1)
*(sline + bits) |= (second_byte & 0x0f);
else
*(sline + bits) |= (second_byte & 0xf0)>>4;
bits++;
} else {
if (i&1)
*(sline + bits) = (uint8_t)(second_byte & 0x0f)<<4;
else
*(sline + bits) = (uint8_t)(second_byte & 0xf0);
}
}
low_nibble = !low_nibble;
}
}
break;
};
}
break;
}
case BI_RLE8 :
{
uint8_t status_byte = 0;
uint8_t second_byte = 0;
int32_t scanline = 0;
int32_t bits = 0;
CImageIterator iter(this);
for (BOOL bContinue = TRUE; bContinue && hFile->Read(&status_byte, sizeof(uint8_t), 1);) {
switch (status_byte) {
case RLE_COMMAND :
hFile->Read(&status_byte, sizeof(uint8_t), 1);
switch (status_byte) {
case RLE_ENDOFLINE :
bits = 0;
scanline++;
break;
case RLE_ENDOFBITMAP :
bContinue=FALSE;
break;
case RLE_DELTA :
{
// read the delta values
uint8_t delta_x;
uint8_t delta_y;
hFile->Read(&delta_x, sizeof(uint8_t), 1);
hFile->Read(&delta_y, sizeof(uint8_t), 1);
// apply them
bits += delta_x;
scanline += delta_y;
break;
}
default :
hFile->Read((void *)(iter.GetRow(scanline) + bits), sizeof(uint8_t) * status_byte, 1);
// align run length to even number of bytes
if ((status_byte & 1) == 1)
hFile->Read(&second_byte, sizeof(uint8_t), 1);
bits += status_byte;
break;
};
break;
default :
uint8_t *sline = iter.GetRow(scanline);
hFile->Read(&second_byte, sizeof(uint8_t), 1);
for (unsigned i = 0; i < status_byte; i++) {
if ((uint8_t*)(sline+bits) < (uint8_t*)(info.pImage+head.biSizeImage)){
*(sline + bits) = second_byte;
bits++;
} else {
break;
}
}
break;
};
}
break;
}
default :
cx_throw("compression type not supported");
}
}
if (bTopDownDib) Flip(); //<Flanders>
} cx_catch {
if (strcmp(message,"")) strncpy(info.szLastError,message,255);
if (info.nEscape == -1 && info.dwType == CXIMAGE_FORMAT_BMP) return true;
return false;
}
return true;
}
| 2014 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImage::GetSize | CxImage::GetSize() | [] | int32_t CxImage::GetSize()
{
return head.biSize + head.biSizeImage + GetPaletteSize();
}
| 20 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImage::Startup | CxImage::Startup( uint32_t imagetype) | ['imagetype'] | void CxImage::Startup(uint32_t imagetype)
{
//init pointers
pDib = pSelection = pAlpha = NULL;
ppLayers = ppFrames = NULL;
//init structures
memset(&head,0,sizeof(BITMAPINFOHEADER));
memset(&info,0,sizeof(CXIMAGEINFO));
//init default attributes
info.dwType = imagetype;
info.fQuality = 90.0f;
info.nAlphaMax = 255;
info.nBkgndIndex = -1;
info.bEnabled = true;
info.nJpegScale = 1;
SetXDPI(CXIMAGE_DEFAULT_DPI);
SetYDPI(CXIMAGE_DEFAULT_DPI);
int16_t test = 1;
info.bLittleEndianHost = (*((char *) &test) == 1);
}
| 121 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImage::Transfer | CxImage::Transfer( CxImage & from , bool bTransferFrames) | ['from', 'bTransferFrames'] | bool CxImage::Transfer(CxImage &from, bool bTransferFrames /*=true*/)
{
if (!Destroy())
return false;
memcpy(&head,&from.head,sizeof(BITMAPINFOHEADER));
memcpy(&info,&from.info,sizeof(CXIMAGEINFO));
pDib = from.pDib;
pSelection = from.pSelection;
pAlpha = from.pAlpha;
ppLayers = from.ppLayers;
memset(&from.head,0,sizeof(BITMAPINFOHEADER));
memset(&from.info,0,sizeof(CXIMAGEINFO));
from.pDib = from.pSelection = from.pAlpha = NULL;
from.ppLayers = NULL;
if (bTransferFrames){
DestroyFrames();
ppFrames = from.ppFrames;
from.ppFrames = NULL;
}
return true;
}
| 154 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImageICO::Decode | CxImageICO::Decode( CxFile * hFile) | ['hFile'] | bool CxImageICO::Decode(CxFile *hFile)
{
if (hFile==NULL) return false;
uint32_t off = hFile->Tell(); //<yuandi>
int32_t page=info.nFrame; //internal icon structure indexes
// read the first part of the header
ICONHEADER icon_header;
hFile->Read(&icon_header,sizeof(ICONHEADER),1);
icon_header.idType = m_ntohs(icon_header.idType);
icon_header.idCount = m_ntohs(icon_header.idCount);
// check if it's an icon or a cursor
if ((icon_header.idReserved == 0) && ((icon_header.idType == 1)||(icon_header.idType == 2))) {
info.nNumFrames = icon_header.idCount;
// load the icon descriptions
ICONDIRENTRY *icon_list = (ICONDIRENTRY *)malloc(icon_header.idCount * sizeof(ICONDIRENTRY));
int32_t c;
for (c = 0; c < icon_header.idCount; c++) {
hFile->Read(icon_list + c, sizeof(ICONDIRENTRY), 1);
icon_list[c].wPlanes = m_ntohs(icon_list[c].wPlanes);
icon_list[c].wBitCount = m_ntohs(icon_list[c].wBitCount);
icon_list[c].dwBytesInRes = m_ntohl(icon_list[c].dwBytesInRes);
icon_list[c].dwImageOffset = m_ntohl(icon_list[c].dwImageOffset);
}
if ((page>=0)&&(page<icon_header.idCount)){
if (info.nEscape == -1) {
// Return output dimensions only
head.biWidth = icon_list[page].bWidth;
head.biHeight = icon_list[page].bHeight;
#if CXIMAGE_SUPPORT_PNG
if (head.biWidth==0 && head.biHeight==0)
{ // Vista icon support
hFile->Seek(off + icon_list[page].dwImageOffset, SEEK_SET);
CxImage png;
png.SetEscape(-1);
if (png.Decode(hFile,CXIMAGE_FORMAT_PNG)){
Transfer(png);
info.nNumFrames = icon_header.idCount;
}
}
#endif //CXIMAGE_SUPPORT_PNG
free(icon_list);
info.dwType = CXIMAGE_FORMAT_ICO;
return true;
}
// get the bit count for the colors in the icon <CoreyRLucier>
BITMAPINFOHEADER bih;
hFile->Seek(off + icon_list[page].dwImageOffset, SEEK_SET);
if (icon_list[page].bWidth==0 && icon_list[page].bHeight==0)
{ // Vista icon support
#if CXIMAGE_SUPPORT_PNG
CxImage png;
if (png.Decode(hFile,CXIMAGE_FORMAT_PNG)){
Transfer(png);
info.nNumFrames = icon_header.idCount;
}
SetType(CXIMAGE_FORMAT_ICO);
#endif //CXIMAGE_SUPPORT_PNG
}
else
{ // standard icon
hFile->Read(&bih,sizeof(BITMAPINFOHEADER),1);
bihtoh(&bih);
c = bih.biBitCount;
// allocate memory for one icon
Create(icon_list[page].bWidth,icon_list[page].bHeight, c, CXIMAGE_FORMAT_ICO); //image creation
// read the palette
RGBQUAD pal[256];
if (bih.biClrUsed)
hFile->Read(pal,bih.biClrUsed*sizeof(RGBQUAD), 1);
else
hFile->Read(pal,head.biClrUsed*sizeof(RGBQUAD), 1);
SetPalette(pal,head.biClrUsed); //palette assign
//read the icon
if (c<=24){
hFile->Read(info.pImage, head.biSizeImage, 1);
} else { // 32 bit icon
uint8_t* buf=(uint8_t*)malloc(4*head.biHeight*head.biWidth);
uint8_t* src = buf;
hFile->Read(buf, 4*head.biHeight*head.biWidth, 1);
#if CXIMAGE_SUPPORT_ALPHA
if (!AlphaIsValid()) AlphaCreate();
#endif //CXIMAGE_SUPPORT_ALPHA
for (int32_t y = 0; y < head.biHeight; y++) {
uint8_t* dst = GetBits(y);
for(int32_t x=0;x<head.biWidth;x++){
*dst++=src[0];
*dst++=src[1];
*dst++=src[2];
#if CXIMAGE_SUPPORT_ALPHA
AlphaSet(x,y,src[3]);
#endif //CXIMAGE_SUPPORT_ALPHA
src+=4;
}
}
free(buf);
}
// apply the AND and XOR masks
int32_t maskwdt = ((head.biWidth+31) / 32) * 4; //line width of AND mask (always 1 Bpp)
int32_t masksize = head.biHeight * maskwdt; //size of mask
uint8_t *mask = (uint8_t *)malloc(masksize);
if (hFile->Read(mask, masksize, 1)){
bool bGoodMask=false;
for (int32_t im=0;im<masksize;im++){
if (mask[im]!=255){
bGoodMask=true;
break;
}
}
if (bGoodMask){
int32_t x,y;
#if CXIMAGE_SUPPORT_ALPHA
bool bNeedAlpha = false;
if (!AlphaIsValid()){
AlphaCreate();
} else {
bNeedAlpha=true; //32bit icon
}
for (y = 0; y < head.biHeight; y++) {
for (x = 0; x < head.biWidth; x++) {
if (((mask[y*maskwdt+(x>>3)]>>(7-x%8))&0x01)){
AlphaSet(x,y,0);
bNeedAlpha=true;
}
}
}
if (!bNeedAlpha) AlphaDelete();
#endif //CXIMAGE_SUPPORT_ALPHA
//check if there is only one transparent color
RGBQUAD cc,ct;
int32_t nTransColors=0;
int32_t nTransIndex=0;
for (y = 0; y < head.biHeight; y++){
for (x = 0; x < head.biWidth; x++){
if (((mask[y*maskwdt+(x>>3)] >> (7-x%8)) & 0x01)){
cc = GetPixelColor(x,y,false);
if (nTransColors==0){
nTransIndex = GetPixelIndex(x,y);
nTransColors++;
ct = cc;
} else {
if (memcmp(&cc, &ct, sizeof(RGBQUAD)) != 0){
nTransColors++;
}
}
}
}
}
if (nTransColors==1 && c<=8){
SetTransColor(ct);
SetTransIndex(nTransIndex);
#if CXIMAGE_SUPPORT_ALPHA
AlphaDelete(); //because we have a unique transparent color in the image
#endif //CXIMAGE_SUPPORT_ALPHA
}
// <vho> - Transparency support w/o Alpha support
if (c <= 8){ // only for icons with less than 256 colors (XP icons need alpha).
// find a color index, which is not used in the image
// it is almost sure to find one, bcs. nobody uses all possible colors for an icon
uint8_t colorsUsed[256];
memset(colorsUsed, 0, sizeof(colorsUsed));
for (y = 0; y < head.biHeight; y++){
for (x = 0; x < head.biWidth; x++){
colorsUsed[BlindGetPixelIndex(x,y)] = 1;
}
}
int32_t iTransIdx = -1;
for (x = (int32_t)(head.biClrUsed-1); x>=0 ; x--){
if (colorsUsed[x] == 0){
iTransIdx = x; // this one is not in use. we may use it as transparent color
break;
}
}
// Go thru image and set unused color as transparent index if needed
if (iTransIdx >= 0){
bool bNeedTrans = false;
for (y = 0; y < head.biHeight; y++){
for (x = 0; x < head.biWidth; x++){
// AND mask (Each Byte represents 8 Pixels)
if (((mask[y*maskwdt+(x>>3)] >> (7-x%8)) & 0x01)){
// AND mask is set (!=0). This is a transparent part
SetPixelIndex(x, y, (uint8_t)iTransIdx);
bNeedTrans = true;
}
}
}
// set transparent index if needed
if (bNeedTrans) SetTransIndex(iTransIdx);
#if CXIMAGE_SUPPORT_ALPHA
AlphaDelete(); //because we have a transparent color in the palette
#endif //CXIMAGE_SUPPORT_ALPHA
}
}
} else {
SetTransIndex(0); //empty mask, set black as transparent color
Negative();
}
}
free(mask);
}
free(icon_list);
// icon has been loaded successfully!
return true;
}
free(icon_list);
}
return false;
}
| 1378 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImagePCX::Decode | CxImagePCX::Decode( CxFile * hFile) | ['hFile'] | bool CxImagePCX::Decode(CxFile *hFile)
{
if (hFile == NULL) return false;
PCXHEADER pcxHeader;
int32_t i, x, y, y2, nbytes, count, Height, Width;
uint8_t c, ColorMap[PCX_MAXCOLORS][3];
uint8_t *pcximage = NULL, *lpHead1 = NULL, *lpHead2 = NULL;
uint8_t *pcxplanes, *pcxpixels;
cx_try
{
if (hFile->Read(&pcxHeader,sizeof(PCXHEADER),1)==0) cx_throw("Can't read PCX image");
PCX_toh(&pcxHeader);
if (pcxHeader.Manufacturer != PCX_MAGIC) cx_throw("Error: Not a PCX file");
// Check for PCX run length encoding
if (pcxHeader.Encoding != 1) cx_throw("PCX file has unknown encoding scheme");
Width = (pcxHeader.Xmax - pcxHeader.Xmin) + 1;
Height = (pcxHeader.Ymax - pcxHeader.Ymin) + 1;
info.xDPI = pcxHeader.Hres;
info.yDPI = pcxHeader.Vres;
if (info.nEscape == -1){
head.biWidth = Width;
head.biHeight= Height;
info.dwType = CXIMAGE_FORMAT_PCX;
return true;
}
// Check that we can handle this image format
if (pcxHeader.ColorPlanes > 4)
cx_throw("Can't handle image with more than 4 planes");
// Create the image
if (pcxHeader.ColorPlanes >= 3 && pcxHeader.BitsPerPixel == 8){
Create (Width, Height, 24, CXIMAGE_FORMAT_PCX);
#if CXIMAGE_SUPPORT_ALPHA
if (pcxHeader.ColorPlanes==4) AlphaCreate();
#endif //CXIMAGE_SUPPORT_ALPHA
} else if (pcxHeader.ColorPlanes == 4 && pcxHeader.BitsPerPixel == 1)
Create (Width, Height, 4, CXIMAGE_FORMAT_PCX);
else
Create (Width, Height, pcxHeader.BitsPerPixel, CXIMAGE_FORMAT_PCX);
if (info.nEscape) cx_throw("Cancelled"); // <vho> - cancel decoding
//Read the image and check if it's ok
nbytes = pcxHeader.BytesPerLine * pcxHeader.ColorPlanes * Height;
lpHead1 = pcximage = (uint8_t*)malloc(nbytes);
while (nbytes > 0){
if (hFile == NULL || hFile->Eof()) cx_throw("corrupted PCX");
hFile->Read(&c,1,1);
if ((c & 0XC0) != 0XC0){ // Repeated group
*pcximage++ = c;
--nbytes;
continue;
}
count = c & 0X3F; // extract count
hFile->Read(&c,1,1);
if (count > nbytes) cx_throw("repeat count spans end of image");
nbytes -= count;
while (--count >=0) *pcximage++ = c;
}
pcximage = lpHead1;
//store the palette
for (i = 0; i < 16; i++){
ColorMap[i][0] = pcxHeader.ColorMap[i][0];
ColorMap[i][1] = pcxHeader.ColorMap[i][1];
ColorMap[i][2] = pcxHeader.ColorMap[i][2];
}
if (pcxHeader.BitsPerPixel == 8 && pcxHeader.ColorPlanes == 1){
hFile->Read(&c,1,1);
if (c != PCX_256_COLORS) cx_throw("bad color map signature");
for (i = 0; i < PCX_MAXCOLORS; i++){
hFile->Read(&ColorMap[i][0],1,1);
hFile->Read(&ColorMap[i][1],1,1);
hFile->Read(&ColorMap[i][2],1,1);
}
}
if (pcxHeader.BitsPerPixel == 1 && pcxHeader.ColorPlanes == 1){
ColorMap[0][0] = ColorMap[0][1] = ColorMap[0][2] = 0;
ColorMap[1][0] = ColorMap[1][1] = ColorMap[1][2] = 255;
}
for (uint32_t idx=0; idx<head.biClrUsed; idx++) SetPaletteColor((uint8_t)idx,ColorMap[idx][0],ColorMap[idx][1],ColorMap[idx][2]);
lpHead2 = pcxpixels = (uint8_t *)malloc(Width + pcxHeader.BytesPerLine * 8);
// Convert the image
for (y = 0; y < Height; y++){
if (info.nEscape) cx_throw("Cancelled"); // <vho> - cancel decoding
y2=Height-1-y;
pcxpixels = lpHead2;
pcxplanes = pcximage + (y * pcxHeader.BytesPerLine * pcxHeader.ColorPlanes);
if (pcxHeader.ColorPlanes == 3 && pcxHeader.BitsPerPixel == 8){
// Deal with 24 bit color image
for (x = 0; x < Width; x++){
SetPixelColor(x,y2,RGB(pcxplanes[x],pcxplanes[pcxHeader.BytesPerLine + x],pcxplanes[2*pcxHeader.BytesPerLine + x]));
}
continue;
#if CXIMAGE_SUPPORT_ALPHA
} else if (pcxHeader.ColorPlanes == 4 && pcxHeader.BitsPerPixel == 8){
for (x = 0; x < Width; x++){
SetPixelColor(x,y2,RGB(pcxplanes[x],pcxplanes[pcxHeader.BytesPerLine + x],pcxplanes[2*pcxHeader.BytesPerLine + x]));
AlphaSet(x,y2,pcxplanes[3*pcxHeader.BytesPerLine + x]);
}
continue;
#endif //CXIMAGE_SUPPORT_ALPHA
} else if (pcxHeader.ColorPlanes == 1) {
if (!PCX_UnpackPixels(pcxpixels, pcxplanes, pcxHeader.BytesPerLine, pcxHeader.ColorPlanes, pcxHeader.BitsPerPixel)){
cx_throw("PCX_UnpackPixels: Can't handle packed pixels with more than 1 plane");
}
} else {
if (!PCX_PlanesToPixels(pcxpixels, pcxplanes, pcxHeader.BytesPerLine, pcxHeader.ColorPlanes, pcxHeader.BitsPerPixel)){
cx_throw("PCX_PlanesToPixels: more than 4 planes or more than 1 bit per pixel");
}
}
for (x = 0; x < Width; x++) SetPixelIndex(x,y2,pcxpixels[x]);
}
} cx_catch {
if (strcmp(message,"")) strncpy(info.szLastError,message,255);
if (lpHead1){ free(lpHead1); lpHead1 = NULL; }
if (lpHead2){ free(lpHead2); lpHead2 = NULL; }
return false;
}
if (lpHead1){ free(lpHead1); lpHead1 = NULL; }
if (lpHead2){ free(lpHead2); lpHead2 = NULL; }
return true;
}
| 1153 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxImageTIF::Decode | CxImageTIF::Decode( CxFile * hFile) | ['hFile'] | bool CxImageTIF::Decode(CxFile * hFile)
{
//Comment this line if you need more information on errors
// TIFFSetErrorHandler(NULL); //<Patrick Hoffmann>
//Open file and fill the TIFF structure
// m_tif = TIFFOpen(imageFileName,"rb");
TIFF* m_tif = _TIFFOpenEx(hFile, "rb");
uint32 height=0;
uint32 width=0;
uint16 bitspersample=1;
uint16 samplesperpixel=1;
uint32 rowsperstrip=(uint32_t)-1;
uint16 photometric=0;
uint16 compression=1;
uint16 orientation=ORIENTATION_TOPLEFT; //<vho>
uint16 res_unit; //<Trifon>
uint32 x, y;
float resolution, offset;
BOOL isRGB;
uint8_t *bits; //pointer to source data
uint8_t *bits2; //pointer to destination data
cx_try
{
//check if it's a tiff file
if (!m_tif)
cx_throw("Error encountered while opening TIFF file");
// <Robert Abram> - 12/2002 : get NumFrames directly, instead of looping
// info.nNumFrames=0;
// while(TIFFSetDirectory(m_tif,(uint16)info.nNumFrames)) info.nNumFrames++;
info.nNumFrames = TIFFNumberOfDirectories(m_tif);
if (!TIFFSetDirectory(m_tif, (uint16)info.nFrame))
cx_throw("Error: page not present in TIFF file");
//get image info
TIFFGetField(m_tif, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(m_tif, TIFFTAG_IMAGELENGTH, &height);
TIFFGetField(m_tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
TIFFGetField(m_tif, TIFFTAG_BITSPERSAMPLE, &bitspersample);
TIFFGetField(m_tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
TIFFGetField(m_tif, TIFFTAG_PHOTOMETRIC, &photometric);
TIFFGetField(m_tif, TIFFTAG_ORIENTATION, &orientation);
if (info.nEscape == -1) {
// Return output dimensions only
head.biWidth = width;
head.biHeight = height;
info.dwType = CXIMAGE_FORMAT_TIF;
cx_throw("output dimensions returned");
}
TIFFGetFieldDefaulted(m_tif, TIFFTAG_RESOLUTIONUNIT, &res_unit);
if (TIFFGetField(m_tif, TIFFTAG_XRESOLUTION, &resolution))
{
if (res_unit == RESUNIT_CENTIMETER) resolution = (float)(resolution*2.54f + 0.5f);
SetXDPI((int32_t)resolution);
}
if (TIFFGetField(m_tif, TIFFTAG_YRESOLUTION, &resolution))
{
if (res_unit == RESUNIT_CENTIMETER) resolution = (float)(resolution*2.54f + 0.5f);
SetYDPI((int32_t)resolution);
}
if (TIFFGetField(m_tif, TIFFTAG_XPOSITION, &offset)) info.xOffset = (int32_t)offset;
if (TIFFGetField(m_tif, TIFFTAG_YPOSITION, &offset)) info.yOffset = (int32_t)offset;
head.biClrUsed=0;
info.nBkgndIndex =-1;
if (rowsperstrip>height){
rowsperstrip=height;
TIFFSetField(m_tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
}
isRGB = /*(bitspersample >= 8) && (VK: it is possible so for RGB to have < 8 bpp!)*/
(photometric == PHOTOMETRIC_RGB) ||
(photometric == PHOTOMETRIC_YCBCR) ||
(photometric == PHOTOMETRIC_SEPARATED) ||
(photometric == PHOTOMETRIC_LOGL) ||
(photometric == PHOTOMETRIC_LOGLUV);
if (isRGB){
head.biBitCount=24;
}else{
if ((photometric==PHOTOMETRIC_MINISBLACK)||(photometric==PHOTOMETRIC_MINISWHITE)||(photometric==PHOTOMETRIC_PALETTE)){
if (bitspersample == 1){
head.biBitCount=1; //B&W image
head.biClrUsed =2;
} else if (bitspersample == 4) {
head.biBitCount=4; //16 colors gray scale
head.biClrUsed =16;
} else {
head.biBitCount=8; //gray scale
head.biClrUsed =256;
}
} else if (bitspersample == 4) {
head.biBitCount=4; // 16 colors
head.biClrUsed=16;
} else {
head.biBitCount=8; //256 colors
head.biClrUsed=256;
}
if ((bitspersample > 8) && (photometric==PHOTOMETRIC_PALETTE)) // + VK + (BIG palette! => convert to RGB)
{ head.biBitCount=24;
head.biClrUsed =0;
}
}
if (info.nEscape) cx_throw("Cancelled"); // <vho> - cancel decoding
Create(width,height,head.biBitCount,CXIMAGE_FORMAT_TIF); //image creation
if (!pDib) cx_throw("CxImageTIF can't create image");
#if CXIMAGE_SUPPORT_ALPHA
if (samplesperpixel==4) AlphaCreate(); //add alpha support for 32bpp tiffs
if (samplesperpixel==2 && bitspersample==8) AlphaCreate(); //add alpha support for 8bpp + alpha
#endif //CXIMAGE_SUPPORT_ALPHA
TIFFGetField(m_tif, TIFFTAG_COMPRESSION, &compression);
SetCodecOption(compression); // <DPR> save original compression type
if (isRGB) {
// Read the whole image into one big RGBA buffer using
// the traditional TIFFReadRGBAImage() API that we trust.
uint32* raster; // retrieve RGBA image
uint32 *row;
raster = (uint32*)_TIFFmalloc(width * height * sizeof (uint32));
if (raster == NULL) cx_throw("No space for raster buffer");
// Read the image in one chunk into an RGBA array
if(!TIFFReadRGBAImage(m_tif, width, height, raster, 1)) {
_TIFFfree(raster);
cx_throw("Corrupted TIFF file!");
}
// read the raster lines and save them in the DIB
// with RGB mode, we have to change the order of the 3 samples RGB
row = &raster[0];
bits2 = info.pImage;
for (y = 0; y < height; y++) {
if (info.nEscape){ // <vho> - cancel decoding
_TIFFfree(raster);
cx_throw("Cancelled");
}
bits = bits2;
for (x = 0; x < width; x++) {
*bits++ = (uint8_t)TIFFGetB(row[x]);
*bits++ = (uint8_t)TIFFGetG(row[x]);
*bits++ = (uint8_t)TIFFGetR(row[x]);
#if CXIMAGE_SUPPORT_ALPHA
if (samplesperpixel==4) AlphaSet(x,y,(uint8_t)TIFFGetA(row[x]));
#endif //CXIMAGE_SUPPORT_ALPHA
}
row += width;
bits2 += info.dwEffWidth;
}
_TIFFfree(raster);
} else {
int32_t BIG_palette = (bitspersample > 8) && // + VK
(photometric==PHOTOMETRIC_PALETTE);
if (BIG_palette && (bitspersample > 24)) // + VK
cx_throw("Too big palette to handle"); // + VK
RGBQUAD *pal;
pal=(RGBQUAD*)calloc(BIG_palette ? 1<<bitspersample : 256,sizeof(RGBQUAD));
// ! VK: it coasts nothing but more correct to use 256 as temp palette storage
// ! VK: but for case of BIG palette it just copied
if (pal==NULL) cx_throw("Unable to allocate TIFF palette");
int32_t bpp = bitspersample <= 8 ? bitspersample : 8; // + VK (to use instead of bitspersample for case of > 8)
// set up the colormap based on photometric
switch(photometric) {
case PHOTOMETRIC_MINISBLACK: // bitmap and greyscale image types
case PHOTOMETRIC_MINISWHITE:
if (bitspersample == 1) { // Monochrome image
if (photometric == PHOTOMETRIC_MINISBLACK) {
pal[1].rgbRed = pal[1].rgbGreen = pal[1].rgbBlue = 255;
} else {
pal[0].rgbRed = pal[0].rgbGreen = pal[0].rgbBlue = 255;
}
} else { // need to build the scale for greyscale images
if (photometric == PHOTOMETRIC_MINISBLACK) {
for (int32_t i=0; i<(1<<bpp); i++){
pal[i].rgbRed = pal[i].rgbGreen = pal[i].rgbBlue = (uint8_t)(i*(255/((1<<bpp)-1)));
}
} else {
for (int32_t i=0; i<(1<<bpp); i++){
pal[i].rgbRed = pal[i].rgbGreen = pal[i].rgbBlue = (uint8_t)(255-i*(255/((1<<bpp)-1)));
}
}
}
break;
case PHOTOMETRIC_PALETTE: // color map indexed
uint16 *red;
uint16 *green;
uint16 *blue;
TIFFGetField(m_tif, TIFFTAG_COLORMAP, &red, &green, &blue);
// Is the palette 16 or 8 bits ?
BOOL Palette16Bits = /*FALSE*/ BIG_palette;
if (!BIG_palette) {
int32_t n= 1<<bpp;
while (n-- > 0) {
if (red[n] >= 256 || green[n] >= 256 || blue[n] >= 256) {
Palette16Bits=TRUE;
break;
}
}
}
// load the palette in the DIB
for (int32_t i = (1 << ( BIG_palette ? bitspersample : bpp )) - 1; i >= 0; i--) {
if (Palette16Bits) {
pal[i].rgbRed =(uint8_t) CVT(red[i]);
pal[i].rgbGreen = (uint8_t) CVT(green[i]);
pal[i].rgbBlue = (uint8_t) CVT(blue[i]);
} else {
pal[i].rgbRed = (uint8_t) red[i];
pal[i].rgbGreen = (uint8_t) green[i];
pal[i].rgbBlue = (uint8_t) blue[i];
}
}
break;
}
if (!BIG_palette) { // + VK (BIG palette is stored until image is ready)
SetPalette(pal,/*head.biClrUsed*/ 1<<bpp); //palette assign // * VK
free(pal);
pal = NULL;
}
// read the tiff lines and save them in the DIB
uint32 nrow;
uint32 ys;
int32_t line = CalculateLine(width, bitspersample * samplesperpixel);
int32_t bitsize = TIFFStripSize(m_tif);
//verify bitsize: could be wrong if StripByteCounts is missing.
if (bitsize>(int32_t)(head.biSizeImage*samplesperpixel))
bitsize = head.biSizeImage*samplesperpixel;
if (bitsize<(int32_t)(info.dwEffWidth*rowsperstrip))
bitsize = info.dwEffWidth*rowsperstrip;
if ((bitspersample > 8) && (bitspersample != 16)) // + VK (for bitspersample == 9..15,17..32..64
bitsize *= (bitspersample + 7)/8;
int32_t tiled_image = TIFFIsTiled(m_tif);
uint32 tw=0, tl=0;
uint8_t* tilebuf=NULL;
if (tiled_image){
TIFFGetField(m_tif, TIFFTAG_TILEWIDTH, &tw);
TIFFGetField(m_tif, TIFFTAG_TILELENGTH, &tl);
rowsperstrip = tl;
bitsize = TIFFTileSize(m_tif) * (int32_t)(1+width/tw);
tilebuf = (uint8_t*)malloc(TIFFTileSize(m_tif));
}
bits = (uint8_t*)malloc(bitspersample==16? bitsize*2 : bitsize); // * VK
uint8_t * bits16 = NULL; // + VK
int32_t line16 = 0; // + VK
if (!tiled_image && bitspersample==16) { // + VK +
line16 = line;
line = CalculateLine(width, 8 * samplesperpixel);
bits16 = bits;
bits = (uint8_t*)malloc(bitsize);
}
if (bits==NULL){
if (bits16) free(bits16); // + VK
if (pal) free(pal); // + VK
if (tilebuf)free(tilebuf); // + VK
cx_throw("CxImageTIF can't allocate memory");
}
#ifdef FIX_16BPP_DARKIMG // + VK: for each line, store shift count bits used to fix it
uint8_t* row_shifts = NULL;
if (bits16) row_shifts = (uint8_t*)malloc(height);
#endif
for (ys = 0; ys < height; ys += rowsperstrip) {
if (info.nEscape){ // <vho> - cancel decoding
free(bits);
cx_throw("Cancelled");
}
nrow = (ys + rowsperstrip > height ? height - ys : rowsperstrip);
if (tiled_image){
uint32 imagew = TIFFScanlineSize(m_tif);
uint32 tilew = TIFFTileRowSize(m_tif);
int32_t iskew = imagew - tilew;
uint8* bufp = (uint8*) bits;
uint32 colb = 0;
for (uint32 col = 0; col < width; col += tw) {
if (TIFFReadTile(m_tif, tilebuf, col, ys, 0, 0) < 0){
free(tilebuf);
free(bits);
cx_throw("Corrupted tiled TIFF file!");
}
if (colb + tw > imagew) {
uint32 owidth = imagew - colb;
uint32 oskew = tilew - owidth;
TileToStrip(bufp + colb, tilebuf, nrow, owidth, oskew + iskew, oskew );
} else {
TileToStrip(bufp + colb, tilebuf, nrow, tilew, iskew, 0);
}
colb += tilew;
}
} else {
if (TIFFReadEncodedStrip(m_tif, TIFFComputeStrip(m_tif, ys, 0),
(bits16? bits16 : bits), nrow * (bits16 ? line16 : line)) == -1) { // * VK
#ifdef NOT_IGNORE_CORRUPTED
free(bits);
if (bits16) free(bits16); // + VK
cx_throw("Corrupted TIFF file!");
#else
break;
#endif
}
}
for (y = 0; y < nrow; y++) {
int32_t offset=(nrow-y-1)*line;
if ((bitspersample==16) && !BIG_palette) { // * VK
int32_t offset16 = (nrow-y-1)*line16; // + VK
if (bits16) { // + VK +
#ifdef FIX_16BPP_DARKIMG
int32_t the_shift;
uint8_t hi_byte, hi_max=0;
uint32_t xi;
for (xi=0;xi<(uint32)line;xi++) {
hi_byte = bits16[xi*2+offset16+1];
if(hi_byte>hi_max)
hi_max = hi_byte;
}
the_shift = (hi_max == 0) ? 8 : 0;
if (!the_shift)
while( ! (hi_max & 0x80) ) {
the_shift++;
hi_max <<= 1;
}
row_shifts[height-ys-nrow+y] = the_shift;
the_shift = 8 - the_shift;
for (xi=0;xi<(uint32)line;xi++)
bits[xi+offset]= ((bits16[xi*2+offset16+1]<<8) | bits16[xi*2+offset16]) >> the_shift;
#else
for (uint32_t xi=0;xi<(uint32)line;xi++)
bits[xi+offset]=bits16[xi*2+offset16+1];
#endif
} else {
for (uint32_t xi=0;xi<width;xi++)
bits[xi+offset]=bits[xi*2+offset+1];
}
}
if (samplesperpixel==1) {
if (BIG_palette)
if (bits16) {
int32_t offset16 = (nrow-y-1)*line16; // + VK
MoveBitsPal( info.pImage + info.dwEffWidth * (height-ys-nrow+y),
bits16 + offset16, width, bitspersample, pal );
} else
MoveBitsPal( info.pImage + info.dwEffWidth * (height-ys-nrow+y),
bits + offset, width, bitspersample, pal );
else if ((bitspersample == head.biBitCount) ||
(bitspersample == 16)) //simple 8bpp, 4bpp image or 16bpp
memcpy(info.pImage+info.dwEffWidth*(height-ys-nrow+y),bits+offset,min((unsigned)line, info.dwEffWidth));
else
MoveBits( info.pImage + info.dwEffWidth * (height-ys-nrow+y),
bits + offset, width, bitspersample );
} else if (samplesperpixel==2) { //8bpp image with alpha layer
int32_t xi=0;
int32_t ii=0;
int32_t yi=height-ys-nrow+y;
#if CXIMAGE_SUPPORT_ALPHA
if (!pAlpha) AlphaCreate(); // + VK
#endif //CXIMAGE_SUPPORT_ALPHA
while (ii<line){
SetPixelIndex(xi,yi,bits[ii+offset]);
#if CXIMAGE_SUPPORT_ALPHA
AlphaSet(xi,yi,bits[ii+offset+1]);
#endif //CXIMAGE_SUPPORT_ALPHA
ii+=2;
xi++;
if (xi>=(int32_t)width){
yi--;
xi=0;
}
}
} else { //photometric==PHOTOMETRIC_CIELAB
if (head.biBitCount!=24){ //fix image
Create(width,height,24,CXIMAGE_FORMAT_TIF);
#if CXIMAGE_SUPPORT_ALPHA
if (samplesperpixel==4) AlphaCreate();
#endif //CXIMAGE_SUPPORT_ALPHA
}
int32_t xi=0;
uint32 ii=0;
int32_t yi=height-ys-nrow+y;
RGBQUAD c;
int32_t l,a,b,bitsoffset;
double p,cx,cy,cz,cr,cg,cb;
while (ii</*line*/width){ // * VK
bitsoffset = ii*samplesperpixel+offset;
l=bits[bitsoffset];
a=bits[bitsoffset+1];
b=bits[bitsoffset+2];
if (a>127) a-=256;
if (b>127) b-=256;
// lab to xyz
p = (l/2.55 + 16) / 116.0;
cx = pow( p + a * 0.002, 3);
cy = pow( p, 3);
cz = pow( p - b * 0.005, 3);
// white point
cx*=0.95047;
//cy*=1.000;
cz*=1.0883;
// xyz to rgb
cr = 3.240479 * cx - 1.537150 * cy - 0.498535 * cz;
cg = -0.969256 * cx + 1.875992 * cy + 0.041556 * cz;
cb = 0.055648 * cx - 0.204043 * cy + 1.057311 * cz;
if ( cr > 0.00304 ) cr = 1.055 * pow(cr,0.41667) - 0.055;
else cr = 12.92 * cr;
if ( cg > 0.00304 ) cg = 1.055 * pow(cg,0.41667) - 0.055;
else cg = 12.92 * cg;
if ( cb > 0.00304 ) cb = 1.055 * pow(cb,0.41667) - 0.055;
else cb = 12.92 * cb;
c.rgbRed =(uint8_t)max(0,min(255,(int32_t)(cr*255)));
c.rgbGreen=(uint8_t)max(0,min(255,(int32_t)(cg*255)));
c.rgbBlue =(uint8_t)max(0,min(255,(int32_t)(cb*255)));
SetPixelColor(xi,yi,c);
#if CXIMAGE_SUPPORT_ALPHA
if (samplesperpixel==4) AlphaSet(xi,yi,bits[bitsoffset+3]);
#endif //CXIMAGE_SUPPORT_ALPHA
ii++;
xi++;
if (xi>=(int32_t)width){
yi--;
xi=0;
}
}
}
}
}
free(bits);
if (bits16) free(bits16);
#ifdef FIX_16BPP_DARKIMG
if (row_shifts && (samplesperpixel == 1) && (bitspersample==16) && !BIG_palette) {
// 1. calculate maximum necessary shift
int32_t min_row_shift = 8;
for( y=0; y<height; y++ ) {
if (min_row_shift > row_shifts[y]) min_row_shift = row_shifts[y];
}
// 2. for rows having less shift value, correct such rows:
for( y=0; y<height; y++ ) {
if (min_row_shift < row_shifts[y]) {
int32_t need_shift = row_shifts[y] - min_row_shift;
uint8_t* data = info.pImage + info.dwEffWidth * y;
for( x=0; x<width; x++, data++ )
*data >>= need_shift;
}
}
}
if (row_shifts) free( row_shifts );
#endif
if (tiled_image) free(tilebuf);
if (pal) free(pal);
switch(orientation){
case ORIENTATION_TOPRIGHT: /* row 0 top, col 0 rhs */
Mirror();
break;
case ORIENTATION_BOTRIGHT: /* row 0 bottom, col 0 rhs */
Flip();
Mirror();
break;
case ORIENTATION_BOTLEFT: /* row 0 bottom, col 0 lhs */
Flip();
break;
case ORIENTATION_LEFTTOP: /* row 0 lhs, col 0 top */
RotateRight();
Mirror();
break;
case ORIENTATION_RIGHTTOP: /* row 0 rhs, col 0 top */
RotateLeft();
break;
case ORIENTATION_RIGHTBOT: /* row 0 rhs, col 0 bottom */
RotateLeft();
Mirror();
break;
case ORIENTATION_LEFTBOT: /* row 0 lhs, col 0 bottom */
RotateRight();
break;
}
}
} cx_catch {
if (strcmp(message,"")) strncpy(info.szLastError,message,255);
if (m_tif) TIFFClose(m_tif);
if (info.nEscape == -1 && info.dwType == CXIMAGE_FORMAT_TIF) return true;
return false;
}
TIFFClose(m_tif);
return true;
}
| 3440 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | DLL_EXPCxIOFile::Read | DLL_EXPCxIOFile::Read( void * buffer , size_t size , size_t count) | ['buffer', 'size', 'count'] | virtual size_t Read(void *buffer, size_t size, size_t count)
{
if (!m_fp) return 0;
return fread(buffer, size, count, m_fp);
}
| 34 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | CxMemFile::Read | CxMemFile::Read( void * buffer , size_t size , size_t count) | ['buffer', 'size', 'count'] | size_t CxMemFile::Read(void *buffer, size_t size, size_t count)
{
if (buffer==NULL) return 0;
if (m_pBuffer==NULL) return 0;
if (m_Position >= (int32_t)m_Size){
m_bEOF = true;
return 0;
}
int32_t nCount = (int32_t)(count*size);
if (nCount == 0) return 0;
int32_t nRead;
if (m_Position + nCount > (int32_t)m_Size){
m_bEOF = true;
nRead = (m_Size - m_Position);
} else
nRead = nCount;
memcpy(buffer, m_pBuffer + m_Position, nRead);
m_Position += nRead;
return (size_t)(nRead/size);
}
| 131 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | jpc_ppxstab_insert | jpc_ppxstab_insert( jpc_ppxstab_t * tab , jpc_ppxstabent_t * ent) | ['tab', 'ent'] | int jpc_ppxstab_insert(jpc_ppxstab_t *tab, jpc_ppxstabent_t *ent)
{
int inspt;
int i;
for (i = 0; i < tab->numents; ++i) {
if (tab->ents[i]->ind > ent->ind) {
break;
}
}
inspt = i;
if (tab->numents >= tab->maxents) {
if (jpc_ppxstab_grow(tab, tab->maxents + 128)) {
return -1;
}
}
for (i = tab->numents; i > inspt; --i) {
tab->ents[i] = tab->ents[i - 1];
}
tab->ents[i] = ent;
++tab->numents;
return 0;
} | 139 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | dcr_cam_xyz_coeff | dcr_cam_xyz_coeff( DCRAW * p , double cam_xyz [ 4 ] [ 3 ]) | ['p'] | void DCR_CLASS dcr_cam_xyz_coeff (DCRAW* p, double cam_xyz[4][3])
{
double cam_rgb[4][3], inverse[4][3], num;
int i, j, k;
for (i=0; i < p->colors; i++) /* Multiply out XYZ colorspace */
for (j=0; j < 3; j++)
for (cam_rgb[i][j] = k=0; k < 3; k++)
cam_rgb[i][j] += cam_xyz[i][k] * xyz_rgb[k][j];
for (i=0; i < p->colors; i++) { /* Normalize cam_rgb so that */
for (num=j=0; j < 3; j++) /* cam_rgb * (1,1,1) is (1,1,1,1) */
num += cam_rgb[i][j];
for (j=0; j < 3; j++)
cam_rgb[i][j] /= num;
p->pre_mul[i] = 1 / (float)num;
}
dcr_pseudoinverse (cam_rgb, inverse, p->colors);
for (p->raw_color = i=0; i < 3; i++)
for (j=0; j < p->colors; j++)
p->rgb_cam[i][j] = (float)inverse[j][i];
}
| 260 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | dcr_parse_riff | dcr_parse_riff( DCRAW * p) | ['p'] | void DCR_CLASS dcr_parse_riff(DCRAW* p)
{
unsigned i, size, end;
char tag[4], date[64], month[64];
static const char mon[12][4] =
{ "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };
struct tm t;
p->order = 0x4949;
dcr_fread(p->obj_, tag, 4, 1);
size = dcr_get4(p);
end = dcr_ftell(p->obj_) + size;
if (!memcmp(tag,"RIFF",4) || !memcmp(tag,"LIST",4)) {
dcr_get4(p);
while (dcr_ftell(p->obj_)+7 < (long)end)
dcr_parse_riff(p);
} else if (!memcmp(tag,"nctg",4)) {
while (dcr_ftell(p->obj_)+7 < (long)end) {
i = dcr_get2(p);
size = dcr_get2(p);
if ((i+1) >> 1 == 10 && size == 20)
dcr_get_timestamp(p,0);
else dcr_fseek(p->obj_, size, SEEK_CUR);
}
} else if (!memcmp(tag,"IDIT",4) && size < 64) {
dcr_fread(p->obj_, date, 64, 1);
date[size] = 0;
memset (&t, 0, sizeof t);
if (sscanf (date, "%*s %s %d %d:%d:%d %d", month, &t.tm_mday,
&t.tm_hour, &t.tm_min, &t.tm_sec, &t.tm_year) == 6) {
for (i=0; i < 12 && strcasecmp(mon[i],month); i++);
t.tm_mon = i;
t.tm_year -= 1900;
if (mktime(&t) > 0)
p->timestamp = mktime(&t);
}
} else
dcr_fseek(p->obj_, size, SEEK_CUR);
}
| 400 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | dcr_parse_tiff | dcr_parse_tiff( DCRAW * p , int base) | ['p', 'base'] | void DCR_CLASS dcr_parse_tiff (DCRAW* p, int base)
{
int doff, max_samp=0, raw=-1, thm=-1, i;
struct dcr_jhead jh;
dcr_fseek(p->obj_, base, SEEK_SET);
p->order = dcr_get2(p);
if (p->order != 0x4949 && p->order != 0x4d4d) return;
dcr_get2(p);
memset (p->tiff_ifd, 0, sizeof p->tiff_ifd);
p->tiff_nifds = 0;
while ((doff = dcr_get4(p))) {
dcr_fseek(p->obj_, doff+base, SEEK_SET);
if (dcr_parse_tiff_ifd (p, base)) break;
}
p->thumb_misc = 16;
if (p->thumb_offset) {
dcr_fseek(p->obj_, p->thumb_offset, SEEK_SET);
if (dcr_ljpeg_start (p,&jh, 1)) {
p->thumb_misc = jh.bits;
p->thumb_width = jh.wide;
p->thumb_height = jh.high;
}
}
for (i=0; i < (int)p->tiff_nifds; i++) {
if (max_samp < p->tiff_ifd[i].samples)
max_samp = p->tiff_ifd[i].samples;
if (max_samp > 3) max_samp = 3;
if ((p->tiff_ifd[i].comp != 6 || p->tiff_ifd[i].samples != 3) &&
p->tiff_ifd[i].width*p->tiff_ifd[i].height > p->raw_width*p->raw_height) {
p->raw_width = p->tiff_ifd[i].width;
p->raw_height = p->tiff_ifd[i].height;
p->tiff_bps = p->tiff_ifd[i].bps;
p->tiff_compress = p->tiff_ifd[i].comp;
p->data_offset = p->tiff_ifd[i].offset;
p->tiff_flip = p->tiff_ifd[i].flip;
p->tiff_samples = p->tiff_ifd[i].samples;
raw = i;
}
}
p->fuji_width *= (p->raw_width+1)/2;
if (p->tiff_ifd[0].flip) p->tiff_flip = p->tiff_ifd[0].flip;
if (raw >= 0 && !p->load_raw)
switch (p->tiff_compress) {
case 0: case 1:
switch (p->tiff_bps) {
case 8: p->load_raw = &DCR_CLASS dcr_eight_bit_load_raw; break;
case 12: p->load_raw = &DCR_CLASS dcr_packed_12_load_raw;
if (p->tiff_ifd[raw].phint == 2)
p->load_flags = 6;
if (strncmp(p->make,"PENTAX",6)) break;
case 14:
case 16: p->load_raw = &DCR_CLASS dcr_unpacked_load_raw; break;
}
if (p->tiff_ifd[raw].bytes*5 == p->raw_width*p->raw_height*8)
p->load_raw = &DCR_CLASS dcr_olympus_e300_load_raw;
break;
case 6: case 7: case 99:
p->load_raw = &DCR_CLASS dcr_lossless_jpeg_load_raw; break;
case 262:
p->load_raw = &DCR_CLASS dcr_kodak_262_load_raw; break;
case 32767:
p->load_raw = &DCR_CLASS dcr_sony_arw2_load_raw;
if (p->tiff_ifd[raw].bytes*8 == (int)(p->raw_width*p->raw_height*p->tiff_bps))
break;
p->raw_height += 8;
p->load_raw = &DCR_CLASS dcr_sony_arw_load_raw; break;
case 32769:
p->load_flags = 8;
case 32773:
p->load_raw = &DCR_CLASS dcr_packed_12_load_raw; break;
case 34713:
p->load_raw = &DCR_CLASS dcr_nikon_compressed_load_raw; break;
case 65535:
p->load_raw = &DCR_CLASS dcr_pentax_k10_load_raw; break;
case 65000:
switch (p->tiff_ifd[raw].phint) {
case 2: p->load_raw = &DCR_CLASS dcr_kodak_rgb_load_raw; p->filters = 0; break;
case 6: p->load_raw = &DCR_CLASS dcr_kodak_ycbcr_load_raw; p->filters = 0; break;
case 32803: p->load_raw = &DCR_CLASS dcr_kodak_65000_load_raw;
}
case 32867: break;
default: p->is_raw = 0;
}
if (!p->dng_version && p->tiff_samples == 3)
if (p->tiff_ifd[raw].bytes && p->tiff_bps != 14 && p->tiff_bps != 2048)
p->is_raw = 0;
if (!p->dng_version && p->tiff_bps == 8 && p->tiff_compress == 1 &&
p->tiff_ifd[raw].phint == 1) p->is_raw = 0;
if (p->tiff_bps == 8 && p->tiff_samples == 4) p->is_raw = 0;
for (i=0; i < (int)p->tiff_nifds; i++)
if (i != raw && p->tiff_ifd[i].samples == max_samp &&
p->tiff_ifd[i].width * p->tiff_ifd[i].height / SQR(p->tiff_ifd[i].bps+1) >
(int)(p->thumb_width * p->thumb_height / SQR(p->thumb_misc+1))) {
p->thumb_width = p->tiff_ifd[i].width;
p->thumb_height = p->tiff_ifd[i].height;
p->thumb_offset = p->tiff_ifd[i].offset;
p->thumb_length = p->tiff_ifd[i].bytes;
p->thumb_misc = p->tiff_ifd[i].bps;
thm = i;
}
if (thm >= 0) {
p->thumb_misc |= p->tiff_ifd[thm].samples << 5;
switch (p->tiff_ifd[thm].comp) {
case 0:
p->write_thumb = &DCR_CLASS dcr_layer_thumb;
break;
case 1:
if (p->tiff_ifd[thm].bps > 8)
p->thumb_load_raw = &DCR_CLASS dcr_kodak_thumb_load_raw;
else
p->write_thumb = &DCR_CLASS dcr_ppm_thumb;
break;
case 65000:
p->thumb_load_raw = p->tiff_ifd[thm].phint == 6 ?
&DCR_CLASS dcr_kodak_ycbcr_load_raw : &DCR_CLASS dcr_kodak_rgb_load_raw;
}
}
}
| 1165 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | TIFFReadCustomDirectory | TIFFReadCustomDirectory( TIFF * tif , toff_t diroff , const TIFFFieldInfo info [ ] , size_t n) | ['tif', 'diroff', 'n'] | TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
const TIFFFieldInfo info[], size_t n)
{
static const char module[] = "TIFFReadCustomDirectory";
TIFFDirectory* td = &tif->tif_dir;
TIFFDirEntry *dp, *dir = NULL;
const TIFFFieldInfo* fip;
size_t fix;
uint16 i, dircount;
_TIFFSetupFieldInfo(tif, info, n);
dircount = TIFFFetchDirectory(tif, diroff, &dir, NULL);
if (!dircount) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Failed to read custom directory at offset %u",
tif->tif_name, diroff);
return 0;
}
TIFFFreeDirectory(tif);
_TIFFmemset(&tif->tif_dir, 0, sizeof(TIFFDirectory));
fix = 0;
for (dp = dir, i = dircount; i > 0; i--, dp++) {
if (tif->tif_flags & TIFF_SWAB) {
TIFFSwabArrayOfShort(&dp->tdir_tag, 2);
TIFFSwabArrayOfLong(&dp->tdir_count, 2);
}
if (fix >= tif->tif_nfields || dp->tdir_tag == IGNORE)
continue;
while (fix < tif->tif_nfields &&
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
fix++;
if (fix >= tif->tif_nfields ||
tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) {
TIFFWarningExt(tif->tif_clientdata, module,
"%s: unknown field with tag %d (0x%x) encountered",
tif->tif_name, dp->tdir_tag, dp->tdir_tag);
if (!_TIFFMergeFieldInfo(tif,
_TIFFCreateAnonFieldInfo(tif,
dp->tdir_tag,
(TIFFDataType) dp->tdir_type),
1))
{
TIFFWarningExt(tif->tif_clientdata, module,
"Registering anonymous field with tag %d (0x%x) failed",
dp->tdir_tag, dp->tdir_tag);
goto ignore;
}
fix = 0;
while (fix < tif->tif_nfields &&
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
fix++;
}
/*
* Null out old tags that we ignore.
*/
if (tif->tif_fieldinfo[fix]->field_bit == FIELD_IGNORE) {
ignore:
dp->tdir_tag = IGNORE;
continue;
}
/*
* Check data type.
*/
fip = tif->tif_fieldinfo[fix];
while (dp->tdir_type != (unsigned short) fip->field_type
&& fix < tif->tif_nfields) {
if (fip->field_type == TIFF_ANY) /* wildcard */
break;
fip = tif->tif_fieldinfo[++fix];
if (fix >= tif->tif_nfields ||
fip->field_tag != dp->tdir_tag) {
TIFFWarningExt(tif->tif_clientdata, module,
"%s: wrong data type %d for \"%s\"; tag ignored",
tif->tif_name, dp->tdir_type,
tif->tif_fieldinfo[fix-1]->field_name);
goto ignore;
}
}
/*
* Check count if known in advance.
*/
if (fip->field_readcount != TIFF_VARIABLE
&& fip->field_readcount != TIFF_VARIABLE2) {
uint32 expected = (fip->field_readcount == TIFF_SPP) ?
(uint32) td->td_samplesperpixel :
(uint32) fip->field_readcount;
if (!CheckDirCount(tif, dp, expected))
goto ignore;
}
/*
* EXIF tags which need to be specifically processed.
*/
switch (dp->tdir_tag) {
case EXIFTAG_SUBJECTDISTANCE:
(void) TIFFFetchSubjectDistance(tif, dp);
break;
default:
(void) TIFFFetchNormalTag(tif, dp);
break;
}
}
if (dir)
_TIFFfree(dir);
return 1;
} | 582 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | TIFFReadDirectory | TIFFReadDirectory( TIFF * tif) | ['tif'] | TIFFReadDirectory(TIFF* tif)
{
static const char module[] = "TIFFReadDirectory";
int n;
TIFFDirectory* td;
TIFFDirEntry *dp, *dir = NULL;
uint16 iv;
uint32 v;
const TIFFFieldInfo* fip;
size_t fix;
uint16 dircount;
int diroutoforderwarning = 0, compressionknown = 0;
int haveunknowntags = 0;
tif->tif_diroff = tif->tif_nextdiroff;
/*
* Check whether we have the last offset or bad offset (IFD looping).
*/
if (!TIFFCheckDirOffset(tif, tif->tif_nextdiroff))
return 0;
/*
* Cleanup any previous compression state.
*/
(*tif->tif_cleanup)(tif);
tif->tif_curdir++;
dircount = TIFFFetchDirectory(tif, tif->tif_nextdiroff,
&dir, &tif->tif_nextdiroff);
if (!dircount) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Failed to read directory at offset %u",
tif->tif_name, tif->tif_nextdiroff);
return 0;
}
tif->tif_flags &= ~TIFF_BEENWRITING; /* reset before new dir */
/*
* Setup default value and then make a pass over
* the fields to check type and tag information,
* and to extract info required to size data
* structures. A second pass is made afterwards
* to read in everthing not taken in the first pass.
*/
td = &tif->tif_dir;
/* free any old stuff and reinit */
TIFFFreeDirectory(tif);
TIFFDefaultDirectory(tif);
/*
* Electronic Arts writes gray-scale TIFF files
* without a PlanarConfiguration directory entry.
* Thus we setup a default value here, even though
* the TIFF spec says there is no default value.
*/
TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
/*
* Sigh, we must make a separate pass through the
* directory for the following reason:
*
* We must process the Compression tag in the first pass
* in order to merge in codec-private tag definitions (otherwise
* we may get complaints about unknown tags). However, the
* Compression tag may be dependent on the SamplesPerPixel
* tag value because older TIFF specs permited Compression
* to be written as a SamplesPerPixel-count tag entry.
* Thus if we don't first figure out the correct SamplesPerPixel
* tag value then we may end up ignoring the Compression tag
* value because it has an incorrect count value (if the
* true value of SamplesPerPixel is not 1).
*
* It sure would have been nice if Aldus had really thought
* this stuff through carefully.
*/
for (dp = dir, n = dircount; n > 0; n--, dp++) {
if (tif->tif_flags & TIFF_SWAB) {
TIFFSwabArrayOfShort(&dp->tdir_tag, 2);
TIFFSwabArrayOfLong(&dp->tdir_count, 2);
}
if (dp->tdir_tag == TIFFTAG_SAMPLESPERPIXEL) {
if (!TIFFFetchNormalTag(tif, dp))
goto bad;
dp->tdir_tag = IGNORE;
}
}
/*
* First real pass over the directory.
*/
fix = 0;
for (dp = dir, n = dircount; n > 0; n--, dp++) {
if (dp->tdir_tag == IGNORE)
continue;
if (fix >= tif->tif_nfields)
fix = 0;
/*
* Silicon Beach (at least) writes unordered
* directory tags (violating the spec). Handle
* it here, but be obnoxious (maybe they'll fix it?).
*/
if (dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag) {
if (!diroutoforderwarning) {
TIFFWarningExt(tif->tif_clientdata, module,
"%s: invalid TIFF directory; tags are not sorted in ascending order",
tif->tif_name);
diroutoforderwarning = 1;
}
fix = 0; /* O(n^2) */
}
while (fix < tif->tif_nfields &&
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
fix++;
if (fix >= tif->tif_nfields ||
tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) {
/* Unknown tag ... we'll deal with it below */
haveunknowntags = 1;
continue;
}
/*
* Null out old tags that we ignore.
*/
if (tif->tif_fieldinfo[fix]->field_bit == FIELD_IGNORE) {
ignore:
dp->tdir_tag = IGNORE;
continue;
}
/*
* Check data type.
*/
fip = tif->tif_fieldinfo[fix];
while (dp->tdir_type != (unsigned short) fip->field_type
&& fix < tif->tif_nfields) {
if (fip->field_type == TIFF_ANY) /* wildcard */
break;
fip = tif->tif_fieldinfo[++fix];
if (fix >= tif->tif_nfields ||
fip->field_tag != dp->tdir_tag) {
TIFFWarningExt(tif->tif_clientdata, module,
"%s: wrong data type %d for \"%s\"; tag ignored",
tif->tif_name, dp->tdir_type,
tif->tif_fieldinfo[fix-1]->field_name);
goto ignore;
}
}
/*
* Check count if known in advance.
*/
if (fip->field_readcount != TIFF_VARIABLE
&& fip->field_readcount != TIFF_VARIABLE2) {
uint32 expected = (fip->field_readcount == TIFF_SPP) ?
(uint32) td->td_samplesperpixel :
(uint32) fip->field_readcount;
if (!CheckDirCount(tif, dp, expected))
goto ignore;
}
switch (dp->tdir_tag) {
case TIFFTAG_COMPRESSION:
/*
* The 5.0 spec says the Compression tag has
* one value, while earlier specs say it has
* one value per sample. Because of this, we
* accept the tag if one value is supplied.
*/
if (dp->tdir_count == 1) {
v = TIFFExtractData(tif,
dp->tdir_type, dp->tdir_offset);
if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
goto bad;
else
compressionknown = 1;
break;
/* XXX: workaround for broken TIFFs */
} else if (dp->tdir_type == TIFF_LONG) {
if (!TIFFFetchPerSampleLongs(tif, dp, &v) ||
!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
goto bad;
} else {
if (!TIFFFetchPerSampleShorts(tif, dp, &iv)
|| !TIFFSetField(tif, dp->tdir_tag, iv))
goto bad;
}
dp->tdir_tag = IGNORE;
break;
case TIFFTAG_STRIPOFFSETS:
case TIFFTAG_STRIPBYTECOUNTS:
case TIFFTAG_TILEOFFSETS:
case TIFFTAG_TILEBYTECOUNTS:
TIFFSetFieldBit(tif, fip->field_bit);
break;
case TIFFTAG_IMAGEWIDTH:
case TIFFTAG_IMAGELENGTH:
case TIFFTAG_IMAGEDEPTH:
case TIFFTAG_TILELENGTH:
case TIFFTAG_TILEWIDTH:
case TIFFTAG_TILEDEPTH:
case TIFFTAG_PLANARCONFIG:
case TIFFTAG_ROWSPERSTRIP:
case TIFFTAG_EXTRASAMPLES:
if (!TIFFFetchNormalTag(tif, dp))
goto bad;
dp->tdir_tag = IGNORE;
break;
}
}
/*
* If we saw any unknown tags, make an extra pass over the directory
* to deal with them. This must be done separately because the tags
* could have become known when we registered a codec after finding
* the Compression tag. In a correctly-sorted directory there's
* no problem because Compression will come before any codec-private
* tags, but if the sorting is wrong that might not hold.
*/
if (haveunknowntags) {
fix = 0;
for (dp = dir, n = dircount; n > 0; n--, dp++) {
if (dp->tdir_tag == IGNORE)
continue;
if (fix >= tif->tif_nfields ||
dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag)
fix = 0; /* O(n^2) */
while (fix < tif->tif_nfields &&
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
fix++;
if (fix >= tif->tif_nfields ||
tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) {
TIFFWarningExt(tif->tif_clientdata,
module,
"%s: unknown field with tag %d (0x%x) encountered",
tif->tif_name,
dp->tdir_tag,
dp->tdir_tag);
if (!_TIFFMergeFieldInfo(tif,
_TIFFCreateAnonFieldInfo(tif,
dp->tdir_tag,
(TIFFDataType) dp->tdir_type),
1))
{
TIFFWarningExt(tif->tif_clientdata,
module,
"Registering anonymous field with tag %d (0x%x) failed",
dp->tdir_tag,
dp->tdir_tag);
dp->tdir_tag = IGNORE;
continue;
}
fix = 0;
while (fix < tif->tif_nfields &&
tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag)
fix++;
}
/*
* Check data type.
*/
fip = tif->tif_fieldinfo[fix];
while (dp->tdir_type != (unsigned short) fip->field_type
&& fix < tif->tif_nfields) {
if (fip->field_type == TIFF_ANY) /* wildcard */
break;
fip = tif->tif_fieldinfo[++fix];
if (fix >= tif->tif_nfields ||
fip->field_tag != dp->tdir_tag) {
TIFFWarningExt(tif->tif_clientdata, module,
"%s: wrong data type %d for \"%s\"; tag ignored",
tif->tif_name, dp->tdir_type,
tif->tif_fieldinfo[fix-1]->field_name);
dp->tdir_tag = IGNORE;
break;
}
}
}
}
/*
* XXX: OJPEG hack.
* If a) compression is OJPEG, b) planarconfig tag says it's separate,
* c) strip offsets/bytecounts tag are both present and
* d) both contain exactly one value, then we consistently find
* that the buggy implementation of the buggy compression scheme
* matches contig planarconfig best. So we 'fix-up' the tag here
*/
if ((td->td_compression==COMPRESSION_OJPEG) &&
(td->td_planarconfig==PLANARCONFIG_SEPARATE)) {
dp = TIFFReadDirectoryFind(dir,dircount,TIFFTAG_STRIPOFFSETS);
if ((dp!=0) && (dp->tdir_count==1)) {
dp = TIFFReadDirectoryFind(dir, dircount,
TIFFTAG_STRIPBYTECOUNTS);
if ((dp!=0) && (dp->tdir_count==1)) {
td->td_planarconfig=PLANARCONFIG_CONTIG;
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
"Planarconfig tag value assumed incorrect, "
"assuming data is contig instead of chunky");
}
}
}
/*
* Allocate directory structure and setup defaults.
*/
if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) {
MissingRequired(tif, "ImageLength");
goto bad;
}
/*
* Setup appropriate structures (by strip or by tile)
*/
if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) {
td->td_nstrips = TIFFNumberOfStrips(tif);
td->td_tilewidth = td->td_imagewidth;
td->td_tilelength = td->td_rowsperstrip;
td->td_tiledepth = td->td_imagedepth;
tif->tif_flags &= ~TIFF_ISTILED;
} else {
td->td_nstrips = TIFFNumberOfTiles(tif);
tif->tif_flags |= TIFF_ISTILED;
}
if (!td->td_nstrips) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: cannot handle zero number of %s",
tif->tif_name, isTiled(tif) ? "tiles" : "strips");
goto bad;
}
td->td_stripsperimage = td->td_nstrips;
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
td->td_stripsperimage /= td->td_samplesperpixel;
if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) {
if ((td->td_compression==COMPRESSION_OJPEG) &&
(isTiled(tif)==0) &&
(td->td_nstrips==1)) {
/*
* XXX: OJPEG hack.
* If a) compression is OJPEG, b) it's not a tiled TIFF,
* and c) the number of strips is 1,
* then we tolerate the absence of stripoffsets tag,
* because, presumably, all required data is in the
* JpegInterchangeFormat stream.
*/
TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
} else {
MissingRequired(tif,
isTiled(tif) ? "TileOffsets" : "StripOffsets");
goto bad;
}
}
/*
* Second pass: extract other information.
*/
for (dp = dir, n = dircount; n > 0; n--, dp++) {
if (dp->tdir_tag == IGNORE)
continue;
switch (dp->tdir_tag) {
case TIFFTAG_MINSAMPLEVALUE:
case TIFFTAG_MAXSAMPLEVALUE:
case TIFFTAG_BITSPERSAMPLE:
case TIFFTAG_DATATYPE:
case TIFFTAG_SAMPLEFORMAT:
/*
* The 5.0 spec says the Compression tag has
* one value, while earlier specs say it has
* one value per sample. Because of this, we
* accept the tag if one value is supplied.
*
* The MinSampleValue, MaxSampleValue, BitsPerSample
* DataType and SampleFormat tags are supposed to be
* written as one value/sample, but some vendors
* incorrectly write one value only -- so we accept
* that as well (yech). Other vendors write correct
* value for NumberOfSamples, but incorrect one for
* BitsPerSample and friends, and we will read this
* too.
*/
if (dp->tdir_count == 1) {
v = TIFFExtractData(tif,
dp->tdir_type, dp->tdir_offset);
if (!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
goto bad;
/* XXX: workaround for broken TIFFs */
} else if (dp->tdir_tag == TIFFTAG_BITSPERSAMPLE
&& dp->tdir_type == TIFF_LONG) {
if (!TIFFFetchPerSampleLongs(tif, dp, &v) ||
!TIFFSetField(tif, dp->tdir_tag, (uint16)v))
goto bad;
} else {
if (!TIFFFetchPerSampleShorts(tif, dp, &iv) ||
!TIFFSetField(tif, dp->tdir_tag, iv))
goto bad;
}
break;
case TIFFTAG_SMINSAMPLEVALUE:
case TIFFTAG_SMAXSAMPLEVALUE:
{
double dv = 0.0;
if (!TIFFFetchPerSampleAnys(tif, dp, &dv) ||
!TIFFSetField(tif, dp->tdir_tag, dv))
goto bad;
}
break;
case TIFFTAG_STRIPOFFSETS:
case TIFFTAG_TILEOFFSETS:
if (!TIFFFetchStripThing(tif, dp,
td->td_nstrips, &td->td_stripoffset))
goto bad;
break;
case TIFFTAG_STRIPBYTECOUNTS:
case TIFFTAG_TILEBYTECOUNTS:
if (!TIFFFetchStripThing(tif, dp,
td->td_nstrips, &td->td_stripbytecount))
goto bad;
break;
case TIFFTAG_COLORMAP:
case TIFFTAG_TRANSFERFUNCTION:
{
char* cp;
/*
* TransferFunction can have either 1x or 3x
* data values; Colormap can have only 3x
* items.
*/
v = 1L<<td->td_bitspersample;
if (dp->tdir_tag == TIFFTAG_COLORMAP ||
dp->tdir_count != v) {
if (!CheckDirCount(tif, dp, 3 * v))
break;
}
v *= sizeof(uint16);
cp = (char *)_TIFFCheckMalloc(tif,
dp->tdir_count,
sizeof (uint16),
"to read \"TransferFunction\" tag");
if (cp != NULL) {
if (TIFFFetchData(tif, dp, cp)) {
/*
* This deals with there being
* only one array to apply to
* all samples.
*/
uint32 c = 1L << td->td_bitspersample;
if (dp->tdir_count == c)
v = 0L;
TIFFSetField(tif, dp->tdir_tag,
cp, cp+v, cp+2*v);
}
_TIFFfree(cp);
}
break;
}
case TIFFTAG_PAGENUMBER:
case TIFFTAG_HALFTONEHINTS:
case TIFFTAG_YCBCRSUBSAMPLING:
case TIFFTAG_DOTRANGE:
(void) TIFFFetchShortPair(tif, dp);
break;
case TIFFTAG_REFERENCEBLACKWHITE:
(void) TIFFFetchRefBlackWhite(tif, dp);
break;
/* BEGIN REV 4.0 COMPATIBILITY */
case TIFFTAG_OSUBFILETYPE:
v = 0L;
switch (TIFFExtractData(tif, dp->tdir_type,
dp->tdir_offset)) {
case OFILETYPE_REDUCEDIMAGE:
v = FILETYPE_REDUCEDIMAGE;
break;
case OFILETYPE_PAGE:
v = FILETYPE_PAGE;
break;
}
if (v)
TIFFSetField(tif, TIFFTAG_SUBFILETYPE, v);
break;
/* END REV 4.0 COMPATIBILITY */
default:
(void) TIFFFetchNormalTag(tif, dp);
break;
}
}
/*
* OJPEG hack:
* - If a) compression is OJPEG, and b) photometric tag is missing,
* then we consistently find that photometric should be YCbCr
* - If a) compression is OJPEG, and b) photometric tag says it's RGB,
* then we consistently find that the buggy implementation of the
* buggy compression scheme matches photometric YCbCr instead.
* - If a) compression is OJPEG, and b) bitspersample tag is missing,
* then we consistently find bitspersample should be 8.
* - If a) compression is OJPEG, b) samplesperpixel tag is missing,
* and c) photometric is RGB or YCbCr, then we consistently find
* samplesperpixel should be 3
* - If a) compression is OJPEG, b) samplesperpixel tag is missing,
* and c) photometric is MINISWHITE or MINISBLACK, then we consistently
* find samplesperpixel should be 3
*/
if (td->td_compression==COMPRESSION_OJPEG)
{
if (!TIFFFieldSet(tif,FIELD_PHOTOMETRIC))
{
TIFFWarningExt(tif->tif_clientdata, "TIFFReadDirectory",
"Photometric tag is missing, assuming data is YCbCr");
if (!TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_YCBCR))
goto bad;
}
else if (td->td_photometric==PHOTOMETRIC_RGB)
{
td->td_photometric=PHOTOMETRIC_YCBCR;
TIFFWarningExt(tif->tif_clientdata, "TIFFReadDirectory",
"Photometric tag value assumed incorrect, "
"assuming data is YCbCr instead of RGB");
}
if (!TIFFFieldSet(tif,FIELD_BITSPERSAMPLE))
{
TIFFWarningExt(tif->tif_clientdata,"TIFFReadDirectory",
"BitsPerSample tag is missing, assuming 8 bits per sample");
if (!TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE,8))
goto bad;
}
if (!TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL))
{
if ((td->td_photometric==PHOTOMETRIC_RGB)
|| (td->td_photometric==PHOTOMETRIC_YCBCR))
{
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
"SamplesPerPixel tag is missing, "
"assuming correct SamplesPerPixel value is 3");
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3))
goto bad;
}
else if ((td->td_photometric==PHOTOMETRIC_MINISWHITE)
|| (td->td_photometric==PHOTOMETRIC_MINISBLACK))
{
TIFFWarningExt(tif->tif_clientdata,
"TIFFReadDirectory",
"SamplesPerPixel tag is missing, "
"assuming correct SamplesPerPixel value is 1");
if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,1))
goto bad;
}
}
}
/*
* Verify Palette image has a Colormap.
*/
if (td->td_photometric == PHOTOMETRIC_PALETTE &&
!TIFFFieldSet(tif, FIELD_COLORMAP)) {
MissingRequired(tif, "Colormap");
goto bad;
}
/*
* OJPEG hack:
* We do no further messing with strip/tile offsets/bytecounts in OJPEG
* TIFFs
*/
if (td->td_compression!=COMPRESSION_OJPEG)
{
/*
* Attempt to deal with a missing StripByteCounts tag.
*/
if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) {
/*
* Some manufacturers violate the spec by not giving
* the size of the strips. In this case, assume there
* is one uncompressed strip of data.
*/
if ((td->td_planarconfig == PLANARCONFIG_CONTIG &&
td->td_nstrips > 1) ||
(td->td_planarconfig == PLANARCONFIG_SEPARATE &&
td->td_nstrips != td->td_samplesperpixel)) {
MissingRequired(tif, "StripByteCounts");
goto bad;
}
TIFFWarningExt(tif->tif_clientdata, module,
"%s: TIFF directory is missing required "
"\"%s\" field, calculating from imagelength",
tif->tif_name,
_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
if (EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
/*
* Assume we have wrong StripByteCount value (in case
* of single strip) in following cases:
* - it is equal to zero along with StripOffset;
* - it is larger than file itself (in case of uncompressed
* image);
* - it is smaller than the size of the bytes per row
* multiplied on the number of rows. The last case should
* not be checked in the case of writing new image,
* because we may do not know the exact strip size
* until the whole image will be written and directory
* dumped out.
*/
#define BYTECOUNTLOOKSBAD \
( (td->td_stripbytecount[0] == 0 && td->td_stripoffset[0] != 0) || \
(td->td_compression == COMPRESSION_NONE && \
td->td_stripbytecount[0] > TIFFGetFileSize(tif) - td->td_stripoffset[0]) || \
(tif->tif_mode == O_RDONLY && \
td->td_compression == COMPRESSION_NONE && \
td->td_stripbytecount[0] < TIFFScanlineSize(tif) * td->td_imagelength) )
} else if (td->td_nstrips == 1
&& td->td_stripoffset[0] != 0
&& BYTECOUNTLOOKSBAD) {
/*
* XXX: Plexus (and others) sometimes give a value of
* zero for a tag when they don't know what the
* correct value is! Try and handle the simple case
* of estimating the size of a one strip image.
*/
TIFFWarningExt(tif->tif_clientdata, module,
"%s: Bogus \"%s\" field, ignoring and calculating from imagelength",
tif->tif_name,
_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
if(EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
} else if (td->td_planarconfig == PLANARCONFIG_CONTIG
&& td->td_nstrips > 2
&& td->td_compression == COMPRESSION_NONE
&& td->td_stripbytecount[0] != td->td_stripbytecount[1]
&& td->td_stripbytecount[0] != 0
&& td->td_stripbytecount[1] != 0 ) {
/*
* XXX: Some vendors fill StripByteCount array with
* absolutely wrong values (it can be equal to
* StripOffset array, for example). Catch this case
* here.
*/
TIFFWarningExt(tif->tif_clientdata, module,
"%s: Wrong \"%s\" field, ignoring and calculating from imagelength",
tif->tif_name,
_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
if (EstimateStripByteCounts(tif, dir, dircount) < 0)
goto bad;
}
}
if (dir) {
_TIFFfree((char *)dir);
dir = NULL;
}
if (!TIFFFieldSet(tif, FIELD_MAXSAMPLEVALUE))
td->td_maxsamplevalue = (uint16)((1L<<td->td_bitspersample)-1);
/*
* Setup default compression scheme.
*/
/*
* XXX: We can optimize checking for the strip bounds using the sorted
* bytecounts array. See also comments for TIFFAppendToStrip()
* function in tif_write.c.
*/
if (td->td_nstrips > 1) {
tstrip_t strip;
td->td_stripbytecountsorted = 1;
for (strip = 1; strip < td->td_nstrips; strip++) {
if (td->td_stripoffset[strip - 1] >
td->td_stripoffset[strip]) {
td->td_stripbytecountsorted = 0;
break;
}
}
}
if (!TIFFFieldSet(tif, FIELD_COMPRESSION))
TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
/*
* Some manufacturers make life difficult by writing
* large amounts of uncompressed data as a single strip.
* This is contrary to the recommendations of the spec.
* The following makes an attempt at breaking such images
* into strips closer to the recommended 8k bytes. A
* side effect, however, is that the RowsPerStrip tag
* value may be changed.
*/
if (td->td_nstrips == 1 && td->td_compression == COMPRESSION_NONE &&
(tif->tif_flags & (TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP)
ChopUpSingleUncompressedStrip(tif);
/*
* Reinitialize i/o since we are starting on a new directory.
*/
tif->tif_row = (uint32) -1;
tif->tif_curstrip = (tstrip_t) -1;
tif->tif_col = (uint32) -1;
tif->tif_curtile = (ttile_t) -1;
tif->tif_tilesize = (tsize_t) -1;
tif->tif_scanlinesize = TIFFScanlineSize(tif);
if (!tif->tif_scanlinesize) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: cannot handle zero scanline size",
tif->tif_name);
return (0);
}
if (isTiled(tif)) {
tif->tif_tilesize = TIFFTileSize(tif);
if (!tif->tif_tilesize) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: cannot handle zero tile size",
tif->tif_name);
return (0);
}
} else {
if (!TIFFStripSize(tif)) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: cannot handle zero strip size",
tif->tif_name);
return (0);
}
}
return (1);
bad:
if (dir)
_TIFFfree(dir);
return (0);
} | 2870 | True | 1 |
CVE-2022-29776 | 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/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'name': 'https://github.com/ONLYOFFICE/core/commit/88cf60a3ed4a2b40d71a1c2ced72fa3902a30967', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'name': 'https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#601', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'name': 'https://github.com/moehw/poc_exploits/tree/master/CVE-2022-29776', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:core:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.1.0.26', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:onlyoffice:document_server:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Onlyoffice Document Server v6.0.0 and below and Core 6.1.0.26 and below were discovered to contain a stack overflow via the component DesktopEditor/common/File.cpp.'}] | 2022-06-24T15:15Z | 2022-06-02T14:15Z | Allocation of Resources Without Limits or Throttling | The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor. | Code frequently has to work with limited resources, so programmers must be careful to ensure that resources are not consumed too quickly, or too easily. Without use of quotas, resource limits, or other protection mechanisms, it can be easy for an attacker to consume many resources by rapidly making many requests, or causing larger resources to be used than is needed. When too many resources are allocated, or if a single resource is too large, then it can prevent the code from working correctly, possibly leading to a denial of service.
| https://cwe.mitre.org/data/definitions/770.html | 0 | Oleg Korshul | 2020-10-13 20:11:21+03:00 | Fix 25 errors | 88cf60a3ed4a2b40d71a1c2ced72fa3902a30967 | False | ONLYOFFICE/core | Server core components which are a part of ONLYOFFICE Document Server | 2016-03-25 13:17:48 | 2022-08-28 02:44:06 | https://www.onlyoffice.com | ONLYOFFICE | 203.0 | 157.0 | NSFontConverter::CFontFileType1::DecryptEexec | NSFontConverter::CFontFileType1::DecryptEexec( unsigned char ** ppEexecBuffer , int nLen) | ['ppEexecBuffer', 'nLen'] | void CFontFileType1::DecryptEexec(unsigned char** ppEexecBuffer, int nLen)
{
// Согласно спецификации Type1, первый байт не должен быть ASCII пробелом
// (пробел, таб, перенос каретки или перенос строки).
unsigned char *sCur = (unsigned char*)(*ppEexecBuffer);
while( sCur < (unsigned char*)(*ppEexecBuffer) + nLen && ( ' ' == *sCur || '\t' == *sCur || '\r' == *sCur || '\n' == *sCur ) )
++sCur;
// Теперь нам надо определить в каком формате у нас данные: ASKII или бинарные данные.
// Если первые четыре байта являются шестнадцатиричными символами, значит, кодировка ASCII.
bool bASCII = false;
if ( isxdigit( sCur[0] ) && isxdigit( sCur[1] ) && isxdigit( sCur[2] ) && isxdigit( sCur[3] ) )
bASCII = true;
if ( bASCII )
ASCIIHexDecode( &sCur, sCur + nLen, sCur, nLen );
unsigned short ushKey = 55665U;
EexecDecode( &sCur, *ppEexecBuffer + nLen, sCur, nLen, &ushKey );
} | 155 | True | 1 |
CVE-2022-29869 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:N/A:N | NETWORK | MEDIUM | NONE | PARTIAL | NONE | NONE | 4.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | LOW | NONE | NONE | 5.3 | MEDIUM | 3.9 | 1.4 | False | [{'url': 'https://github.com/piastry/cifs-utils/pull/7', 'name': 'https://github.com/piastry/cifs-utils/pull/7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/piastry/cifs-utils/commit/8acc963a2e7e9d63fe1f2e7f73f5a03f83d9c379', 'name': 'https://github.com/piastry/cifs-utils/commit/8acc963a2e7e9d63fe1f2e7f73f5a03f83d9c379', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/QIYZ4L6SLSYJQ446VJAO2VGAESURQNSP/', 'name': 'FEDORA-2022-eb2d3ca94d', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/HXKZLJYJJEC3TIBFLXUORRMZUKG5W676/', 'name': 'FEDORA-2022-7fda04ab5a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/5WBOLMANBYJILXQKRRK7OCR774PXJAYY/', 'name': 'FEDORA-2022-34de4f833d', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/05/msg00020.html', 'name': '[debian-lts-announce] 20220516 [SECURITY] [DLA 3009-1] cifs-utils security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2022/dsa-5157', 'name': 'DSA-5157', 'refsource': 'DEBIAN', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:samba:cifs-utils:*:*:*:*:*:*:*:*', 'versionEndIncluding': '6.14', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'cifs-utils through 6.14, with verbose logging, can cause an information leak when a file contains = (equal sign) characters but is not a valid credentials file.'}] | 2022-06-03T15:15Z | 2022-04-28T01: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 | Jeffrey Bencteux | 2022-03-19 13:41:15-04:00 | mount.cifs: fix verbose messages on option parsing
When verbose logging is enabled, invalid credentials file lines may be
dumped to stderr. This may lead to information disclosure in particular
conditions when the credentials file given is sensitive and contains '='
signs.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15026
Signed-off-by: Jeffrey Bencteux <[email protected]>
Reviewed-by: David Disseldorp <[email protected]> | 8acc963a2e7e9d63fe1f2e7f73f5a03f83d9c379 | False | piastry/cifs-utils | Mirror of git://git.samba.org/cifs-utils.git | 2018-03-19 22:42:15 | 2022-08-11 20:52:06 | null | piastry | 1.0 | 7.0 | open_cred_file | open_cred_file( char * file_name , struct parsed_mount_info * parsed_info) | ['file_name', 'parsed_info'] | static int open_cred_file(char *file_name,
struct parsed_mount_info *parsed_info)
{
char *line_buf = NULL;
char *temp_val = NULL;
FILE *fs = NULL;
int i;
const int line_buf_size = 4096;
const int min_non_white = 10;
i = toggle_dac_capability(0, 1);
if (i)
goto return_i;
i = access(file_name, R_OK);
if (i) {
toggle_dac_capability(0, 0);
i = errno;
goto return_i;
}
fs = fopen(file_name, "r");
if (fs == NULL) {
toggle_dac_capability(0, 0);
i = errno;
goto return_i;
}
i = toggle_dac_capability(0, 0);
if (i)
goto return_i;
line_buf = (char *)malloc(line_buf_size);
if (line_buf == NULL) {
i = EX_SYSERR;
goto return_i;
}
/* parse line from credentials file */
while (fgets(line_buf, line_buf_size, fs)) {
/* eat leading white space */
for (i = 0; i < line_buf_size - min_non_white + 1; i++) {
if ((line_buf[i] != ' ') && (line_buf[i] != '\t'))
break;
}
null_terminate_endl(line_buf);
/* parse next token */
switch (parse_cred_line(line_buf + i, &temp_val)) {
case CRED_USER:
strlcpy(parsed_info->username, temp_val,
sizeof(parsed_info->username));
parsed_info->got_user = 1;
break;
case CRED_PASS:
i = set_password(parsed_info, temp_val);
if (i)
goto return_i;
break;
case CRED_DOM:
if (parsed_info->verboseflag)
fprintf(stderr, "domain=%s\n",
temp_val);
strlcpy(parsed_info->domain, temp_val,
sizeof(parsed_info->domain));
break;
case CRED_UNPARSEABLE:
if (parsed_info->verboseflag)
fprintf(stderr, "Credential formatted "
"incorrectly: %s\n",
temp_val ? temp_val : "(null)");
break;
}
}
i = 0;
return_i:
if (fs != NULL)
fclose(fs);
/* make sure passwords are scrubbed from memory */
if (line_buf != NULL)
memset(line_buf, 0, line_buf_size);
free(line_buf);
return i;
} | 386 | True | 1 |
CVE-2022-31135 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | 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/AttorneyOnline/akashi/security/advisories/GHSA-vj86-vfmg-q68v', 'name': 'https://github.com/AttorneyOnline/akashi/security/advisories/GHSA-vj86-vfmg-q68v', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/AttorneyOnline/akashi/commit/5566cdfedddef1f219aee33477d9c9690bf2f78b', 'name': 'https://github.com/AttorneyOnline/akashi/commit/5566cdfedddef1f219aee33477d9c9690bf2f78b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-129'}, {'lang': 'en', 'value': 'CWE-129'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:aceattorneyonline:akashi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.4', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Akashi is an open source server implementation of the Attorney Online video game based on the Ace Attorney universe. Affected versions of Akashi are subject to a denial of service attack. An attacker can use a specially crafted evidence packet to make an illegal modification, causing a server crash. This can be used to mount a denial-of-service exploit. Users are advised to upgrade. There is no known workaround for this issue.'}] | 2022-07-15T03:22Z | 2022-07-07T18:15Z | Improper Validation of Array Index | The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array. | https://cwe.mitre.org/data/definitions/129.html | 0 | oldmud0 | 2021-07-27 22:57:29-05:00 | Fix out of bounds crash on evidence | 5566cdfedddef1f219aee33477d9c9690bf2f78b | False | AttorneyOnline/akashi | C++ AO2 Server | 2020-08-22 07:19:20 | 2022-08-20 13:42:00 | null | AttorneyOnline | 5.0 | 21.0 | AOClient::pktEditEvidence | AOClient::pktEditEvidence( AreaData * area , int argc , QStringList argv , AOPacket packet) | ['area', 'argc', 'argv', 'packet'] | void AOClient::pktEditEvidence(AreaData* area, int argc, QStringList argv, AOPacket packet)
{
if (!checkEvidenceAccess(area))
return;
bool is_int = false;
int idx = argv[0].toInt(&is_int);
AreaData::Evidence evi = {argv[1], argv[2], argv[3]};
if (is_int && idx <= area->evidence().size() && idx >= 0) {
area->replaceEvidence(idx, evi);
}
sendEvidenceList(area);
} | 106 | True | 1 |