cve_id
stringlengths 13
16
| obtain_all_privilege
stringclasses 3
values | obtain_user_privilege
stringclasses 2
values | obtain_other_privilege
stringclasses 2
values | user_interaction_required
stringclasses 3
values | cvss2_vector_string
stringclasses 106
values | cvss2_access_vector
stringclasses 4
values | cvss2_access_complexity
stringclasses 4
values | cvss2_authentication
stringclasses 3
values | cvss2_confidentiality_impact
stringclasses 4
values | cvss2_integrity_impact
stringclasses 4
values | cvss2_availability_impact
stringclasses 4
values | cvss2_base_score
stringclasses 50
values | cvss3_vector_string
stringclasses 226
values | cvss3_attack_vector
stringclasses 5
values | cvss3_attack_complexity
stringclasses 3
values | cvss3_privileges_required
stringclasses 4
values | cvss3_user_interaction
stringclasses 3
values | cvss3_scope
stringclasses 3
values | cvss3_confidentiality_impact
stringclasses 4
values | cvss3_integrity_impact
stringclasses 4
values | cvss3_availability_impact
stringclasses 4
values | cvss3_base_score
stringclasses 55
values | cvss3_base_severity
stringclasses 5
values | exploitability_score
stringclasses 22
values | impact_score
stringclasses 15
values | ac_insuf_info
stringclasses 3
values | reference_json
stringlengths 221
23.3k
| problemtype_json
stringclasses 200
values | severity
stringclasses 4
values | cve_nodes
stringlengths 2
33.1k
| cve_description
stringlengths 64
1.99k
| cve_last_modified_date
stringlengths 17
17
| cve_published_date
stringlengths 17
17
| cwe_name
stringclasses 125
values | cwe_description
stringclasses 124
values | cwe_extended_description
stringclasses 95
values | cwe_url
stringclasses 124
values | cwe_is_category
int64 0
1
| commit_author
stringlengths 0
34
| commit_author_date
stringlengths 25
25
| commit_msg
stringlengths 0
13.3k
| commit_hash
stringlengths 40
40
| commit_is_merge
stringclasses 1
value | repo_name
stringclasses 467
values | repo_description
stringclasses 459
values | repo_date_created
stringclasses 467
values | repo_date_last_push
stringclasses 467
values | repo_homepage
stringclasses 294
values | repo_owner
stringclasses 470
values | repo_stars
stringclasses 406
values | repo_forks
stringclasses 352
values | function_name
stringlengths 3
120
| function_signature
stringlengths 6
640
| function_parameters
stringlengths 2
302
| function
stringlengths 12
114k
| function_token_count
stringlengths 1
5
| function_before_change
stringclasses 1
value | labels
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2019-1010295 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'name': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linaro:op-tee:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Linaro/OP-TEE OP-TEE 3.3.0 and earlier is affected by: Buffer Overflow. The impact is: Memory corruption and disclosure of memory content. The component is: optee_os. The fixed version is: 3.4.0 and later.'}] | 2021-07-21T11:39Z | 2019-07-15T18:15Z | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. |
Input validation is a frequently-used technique
for checking potentially dangerous inputs in order to
ensure that the inputs are safe for processing within the
code, or when communicating with other components. When
software does not validate input properly, an attacker is
able to craft the input in a form that is not expected by
the rest of the application. This will lead to parts of the
system receiving unintended input, which may result in
altered control flow, arbitrary control of a resource, or
arbitrary code execution.
Input validation is not the only technique for
processing input, however. Other techniques attempt to
transform potentially-dangerous input into something safe, such
as filtering (CWE-790) - which attempts to remove dangerous
inputs - or encoding/escaping (CWE-116), which attempts to
ensure that the input is not misinterpreted when it is included
in output to another component. Other techniques exist as well
(see CWE-138 for more examples.)
Input validation can be applied to:
raw data - strings, numbers, parameters, file contents, etc.
metadata - information about the raw data, such as headers or size
Data can be simple or structured. Structured data
can be composed of many nested layers, composed of
combinations of metadata and raw data, with other simple or
structured data.
Many properties of raw data or metadata may need
to be validated upon entry into the code, such
as:
specified quantities such as size, length, frequency, price, rate, number of operations, time, etc.
implied or derived quantities, such as the actual size of a file instead of a specified size
indexes, offsets, or positions into more complex data structures
symbolic keys or other elements into hash tables, associative arrays, etc.
well-formedness, i.e. syntactic correctness - compliance with expected syntax
lexical token correctness - compliance with rules for what is treated as a token
specified or derived type - the actual type of the input (or what the input appears to be)
consistency - between individual data elements, between raw data and metadata, between references, etc.
conformance to domain-specific rules, e.g. business logic
equivalence - ensuring that equivalent inputs are treated the same
authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data
Implied or derived properties of data must often
be calculated or inferred by the code itself. Errors in
deriving properties may be considered a contributing factor
to improper input validation.
Note that "input validation" has very different
meanings to different people, or within different
classification schemes. Caution must be used when
referencing this CWE entry or mapping to it. For example,
some weaknesses might involve inadvertently giving control
to an attacker over an input when they should not be able
to provide an input at all, but sometimes this is referred
to as input validation.
Finally, it is important to emphasize that the
distinctions between input validation and output escaping
are often blurred, and developers must be careful to
understand the difference, including how input validation
is not always sufficient to prevent vulnerabilities,
especially when less stringent data types must be
supported, such as free-form text. Consider a SQL injection
scenario in which a person's last name is inserted into a
query. The name "O'Reilly" would likely pass the validation
step since it is a common last name in the English
language. However, this valid name cannot be directly
inserted into the database because it contains the "'"
apostrophe character, which would need to be escaped or
otherwise transformed. In this case, removing the
apostrophe might reduce the risk of SQL injection, but it
would produce incorrect behavior because the wrong name
would be recorded.
| https://cwe.mitre.org/data/definitions/20.html | 0 | Jens Wiklander | 2018-11-20 09:56:58+01:00 | core: svc: always check ta parameters
Always check TA parameters from a user TA. This prevents a user TA from
passing invalid pointers to a pseudo TA.
Fixes: OP-TEE-2018-0007: "Buffer checks missing when calling pseudo
TAs".
Signed-off-by: Jens Wiklander <[email protected]>
Tested-by: Joakim Bech <[email protected]> (QEMU v7, v8)
Reviewed-by: Joakim Bech <[email protected]>
Reported-by: Riscure <[email protected]>
Reported-by: Alyssa Milburn <[email protected]>
Acked-by: Etienne Carriere <[email protected]> | d5c5b0b77b2b589666024d219a8007b3f5b6faeb | False | OP-TEE/optee_os | Trusted side of the TEE | 2014-05-26 17:18:57 | 2022-08-26 17:12:14 | null | OP-TEE | 1176.0 | 844.0 | tee_svc_copy_param | tee_svc_copy_param( struct tee_ta_session * sess , struct tee_ta_session * called_sess , struct utee_params * callee_params , struct tee_ta_param * param , void * tmp_buf_va [ TEE_NUM_PARAMS ] , struct mobj ** mobj_tmp) | ['sess', 'called_sess', 'callee_params', 'param', 'mobj_tmp'] | static TEE_Result tee_svc_copy_param(struct tee_ta_session *sess,
struct tee_ta_session *called_sess,
struct utee_params *callee_params,
struct tee_ta_param *param,
void *tmp_buf_va[TEE_NUM_PARAMS],
struct mobj **mobj_tmp)
{
size_t n;
TEE_Result res;
size_t req_mem = 0;
size_t s;
uint8_t *dst = 0;
bool ta_private_memref[TEE_NUM_PARAMS];
struct user_ta_ctx *utc = to_user_ta_ctx(sess->ctx);
void *va;
size_t dst_offs;
/* fill 'param' input struct with caller params description buffer */
if (!callee_params) {
memset(param, 0, sizeof(*param));
} else {
res = tee_mmu_check_access_rights(utc,
TEE_MEMORY_ACCESS_READ | TEE_MEMORY_ACCESS_ANY_OWNER,
(uaddr_t)callee_params, sizeof(struct utee_params));
if (res != TEE_SUCCESS)
return res;
utee_param_to_param(param, callee_params);
}
if (called_sess && is_pseudo_ta_ctx(called_sess->ctx)) {
/* pseudo TA borrows the mapping of the calling TA */
return TEE_SUCCESS;
}
/* All mobj in param are of type MOJB_TYPE_VIRT */
for (n = 0; n < TEE_NUM_PARAMS; n++) {
ta_private_memref[n] = false;
switch (TEE_PARAM_TYPE_GET(param->types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
va = (void *)param->u[n].mem.offs;
s = param->u[n].mem.size;
if (!va) {
if (s)
return TEE_ERROR_BAD_PARAMETERS;
break;
}
/* uTA cannot expose its private memory */
if (tee_mmu_is_vbuf_inside_ta_private(utc, va, s)) {
s = ROUNDUP(s, sizeof(uint32_t));
if (ADD_OVERFLOW(req_mem, s, &req_mem))
return TEE_ERROR_BAD_PARAMETERS;
ta_private_memref[n] = true;
break;
}
res = tee_mmu_vbuf_to_mobj_offs(utc, va, s,
¶m->u[n].mem.mobj,
¶m->u[n].mem.offs);
if (res != TEE_SUCCESS)
return res;
break;
default:
break;
}
}
if (req_mem == 0)
return TEE_SUCCESS;
res = alloc_temp_sec_mem(req_mem, mobj_tmp, &dst);
if (res != TEE_SUCCESS)
return res;
dst_offs = 0;
for (n = 0; n < TEE_NUM_PARAMS; n++) {
if (!ta_private_memref[n])
continue;
s = ROUNDUP(param->u[n].mem.size, sizeof(uint32_t));
switch (TEE_PARAM_TYPE_GET(param->types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
va = (void *)param->u[n].mem.offs;
if (va) {
res = tee_svc_copy_from_user(dst, va,
param->u[n].mem.size);
if (res != TEE_SUCCESS)
return res;
param->u[n].mem.offs = dst_offs;
param->u[n].mem.mobj = *mobj_tmp;
tmp_buf_va[n] = dst;
dst += s;
dst_offs += s;
}
break;
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
va = (void *)param->u[n].mem.offs;
if (va) {
param->u[n].mem.offs = dst_offs;
param->u[n].mem.mobj = *mobj_tmp;
tmp_buf_va[n] = dst;
dst += s;
dst_offs += s;
}
break;
default:
continue;
}
}
return TEE_SUCCESS;
} | 619 | True | 1 |
CVE-2019-1010295 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'name': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linaro:op-tee:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Linaro/OP-TEE OP-TEE 3.3.0 and earlier is affected by: Buffer Overflow. The impact is: Memory corruption and disclosure of memory content. The component is: optee_os. The fixed version is: 3.4.0 and later.'}] | 2021-07-21T11:39Z | 2019-07-15T18: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 | Jens Wiklander | 2018-11-20 09:56:58+01:00 | core: svc: always check ta parameters
Always check TA parameters from a user TA. This prevents a user TA from
passing invalid pointers to a pseudo TA.
Fixes: OP-TEE-2018-0007: "Buffer checks missing when calling pseudo
TAs".
Signed-off-by: Jens Wiklander <[email protected]>
Tested-by: Joakim Bech <[email protected]> (QEMU v7, v8)
Reviewed-by: Joakim Bech <[email protected]>
Reported-by: Riscure <[email protected]>
Reported-by: Alyssa Milburn <[email protected]>
Acked-by: Etienne Carriere <[email protected]> | d5c5b0b77b2b589666024d219a8007b3f5b6faeb | False | OP-TEE/optee_os | Trusted side of the TEE | 2014-05-26 17:18:57 | 2022-08-26 17:12:14 | null | OP-TEE | 1176.0 | 844.0 | tee_svc_copy_param | tee_svc_copy_param( struct tee_ta_session * sess , struct tee_ta_session * called_sess , struct utee_params * callee_params , struct tee_ta_param * param , void * tmp_buf_va [ TEE_NUM_PARAMS ] , struct mobj ** mobj_tmp) | ['sess', 'called_sess', 'callee_params', 'param', 'mobj_tmp'] | static TEE_Result tee_svc_copy_param(struct tee_ta_session *sess,
struct tee_ta_session *called_sess,
struct utee_params *callee_params,
struct tee_ta_param *param,
void *tmp_buf_va[TEE_NUM_PARAMS],
struct mobj **mobj_tmp)
{
size_t n;
TEE_Result res;
size_t req_mem = 0;
size_t s;
uint8_t *dst = 0;
bool ta_private_memref[TEE_NUM_PARAMS];
struct user_ta_ctx *utc = to_user_ta_ctx(sess->ctx);
void *va;
size_t dst_offs;
/* fill 'param' input struct with caller params description buffer */
if (!callee_params) {
memset(param, 0, sizeof(*param));
} else {
res = tee_mmu_check_access_rights(utc,
TEE_MEMORY_ACCESS_READ | TEE_MEMORY_ACCESS_ANY_OWNER,
(uaddr_t)callee_params, sizeof(struct utee_params));
if (res != TEE_SUCCESS)
return res;
utee_param_to_param(param, callee_params);
}
if (called_sess && is_pseudo_ta_ctx(called_sess->ctx)) {
/* pseudo TA borrows the mapping of the calling TA */
return TEE_SUCCESS;
}
/* All mobj in param are of type MOJB_TYPE_VIRT */
for (n = 0; n < TEE_NUM_PARAMS; n++) {
ta_private_memref[n] = false;
switch (TEE_PARAM_TYPE_GET(param->types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
va = (void *)param->u[n].mem.offs;
s = param->u[n].mem.size;
if (!va) {
if (s)
return TEE_ERROR_BAD_PARAMETERS;
break;
}
/* uTA cannot expose its private memory */
if (tee_mmu_is_vbuf_inside_ta_private(utc, va, s)) {
s = ROUNDUP(s, sizeof(uint32_t));
if (ADD_OVERFLOW(req_mem, s, &req_mem))
return TEE_ERROR_BAD_PARAMETERS;
ta_private_memref[n] = true;
break;
}
res = tee_mmu_vbuf_to_mobj_offs(utc, va, s,
¶m->u[n].mem.mobj,
¶m->u[n].mem.offs);
if (res != TEE_SUCCESS)
return res;
break;
default:
break;
}
}
if (req_mem == 0)
return TEE_SUCCESS;
res = alloc_temp_sec_mem(req_mem, mobj_tmp, &dst);
if (res != TEE_SUCCESS)
return res;
dst_offs = 0;
for (n = 0; n < TEE_NUM_PARAMS; n++) {
if (!ta_private_memref[n])
continue;
s = ROUNDUP(param->u[n].mem.size, sizeof(uint32_t));
switch (TEE_PARAM_TYPE_GET(param->types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
va = (void *)param->u[n].mem.offs;
if (va) {
res = tee_svc_copy_from_user(dst, va,
param->u[n].mem.size);
if (res != TEE_SUCCESS)
return res;
param->u[n].mem.offs = dst_offs;
param->u[n].mem.mobj = *mobj_tmp;
tmp_buf_va[n] = dst;
dst += s;
dst_offs += s;
}
break;
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
va = (void *)param->u[n].mem.offs;
if (va) {
param->u[n].mem.offs = dst_offs;
param->u[n].mem.mobj = *mobj_tmp;
tmp_buf_va[n] = dst;
dst += s;
dst_offs += s;
}
break;
default:
continue;
}
}
return TEE_SUCCESS;
} | 619 | True | 1 |
CVE-2019-1010295 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'name': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linaro:op-tee:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Linaro/OP-TEE OP-TEE 3.3.0 and earlier is affected by: Buffer Overflow. The impact is: Memory corruption and disclosure of memory content. The component is: optee_os. The fixed version is: 3.4.0 and later.'}] | 2021-07-21T11:39Z | 2019-07-15T18: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 | Jens Wiklander | 2018-11-20 09:56:58+01:00 | core: svc: always check ta parameters
Always check TA parameters from a user TA. This prevents a user TA from
passing invalid pointers to a pseudo TA.
Fixes: OP-TEE-2018-0007: "Buffer checks missing when calling pseudo
TAs".
Signed-off-by: Jens Wiklander <[email protected]>
Tested-by: Joakim Bech <[email protected]> (QEMU v7, v8)
Reviewed-by: Joakim Bech <[email protected]>
Reported-by: Riscure <[email protected]>
Reported-by: Alyssa Milburn <[email protected]>
Acked-by: Etienne Carriere <[email protected]> | d5c5b0b77b2b589666024d219a8007b3f5b6faeb | False | OP-TEE/optee_os | Trusted side of the TEE | 2014-05-26 17:18:57 | 2022-08-26 17:12:14 | null | OP-TEE | 1176.0 | 844.0 | utee_param_to_param | utee_param_to_param( struct tee_ta_param * p , struct utee_params * up) | ['p', 'up'] | static void utee_param_to_param(struct tee_ta_param *p, struct utee_params *up)
{
size_t n;
uint32_t types = up->types;
p->types = types;
for (n = 0; n < TEE_NUM_PARAMS; n++) {
uintptr_t a = up->vals[n * 2];
size_t b = up->vals[n * 2 + 1];
switch (TEE_PARAM_TYPE_GET(types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
p->u[n].mem.mobj = &mobj_virt;
p->u[n].mem.offs = a;
p->u[n].mem.size = b;
break;
case TEE_PARAM_TYPE_VALUE_INPUT:
case TEE_PARAM_TYPE_VALUE_INOUT:
p->u[n].val.a = a;
p->u[n].val.b = b;
break;
default:
memset(&p->u[n], 0, sizeof(p->u[n]));
break;
}
}
} | 194 | True | 1 |
CVE-2019-1010295 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'name': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linaro:op-tee:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Linaro/OP-TEE OP-TEE 3.3.0 and earlier is affected by: Buffer Overflow. The impact is: Memory corruption and disclosure of memory content. The component is: optee_os. The fixed version is: 3.4.0 and later.'}] | 2021-07-21T11:39Z | 2019-07-15T18:15Z | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. |
Input validation is a frequently-used technique
for checking potentially dangerous inputs in order to
ensure that the inputs are safe for processing within the
code, or when communicating with other components. When
software does not validate input properly, an attacker is
able to craft the input in a form that is not expected by
the rest of the application. This will lead to parts of the
system receiving unintended input, which may result in
altered control flow, arbitrary control of a resource, or
arbitrary code execution.
Input validation is not the only technique for
processing input, however. Other techniques attempt to
transform potentially-dangerous input into something safe, such
as filtering (CWE-790) - which attempts to remove dangerous
inputs - or encoding/escaping (CWE-116), which attempts to
ensure that the input is not misinterpreted when it is included
in output to another component. Other techniques exist as well
(see CWE-138 for more examples.)
Input validation can be applied to:
raw data - strings, numbers, parameters, file contents, etc.
metadata - information about the raw data, such as headers or size
Data can be simple or structured. Structured data
can be composed of many nested layers, composed of
combinations of metadata and raw data, with other simple or
structured data.
Many properties of raw data or metadata may need
to be validated upon entry into the code, such
as:
specified quantities such as size, length, frequency, price, rate, number of operations, time, etc.
implied or derived quantities, such as the actual size of a file instead of a specified size
indexes, offsets, or positions into more complex data structures
symbolic keys or other elements into hash tables, associative arrays, etc.
well-formedness, i.e. syntactic correctness - compliance with expected syntax
lexical token correctness - compliance with rules for what is treated as a token
specified or derived type - the actual type of the input (or what the input appears to be)
consistency - between individual data elements, between raw data and metadata, between references, etc.
conformance to domain-specific rules, e.g. business logic
equivalence - ensuring that equivalent inputs are treated the same
authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data
Implied or derived properties of data must often
be calculated or inferred by the code itself. Errors in
deriving properties may be considered a contributing factor
to improper input validation.
Note that "input validation" has very different
meanings to different people, or within different
classification schemes. Caution must be used when
referencing this CWE entry or mapping to it. For example,
some weaknesses might involve inadvertently giving control
to an attacker over an input when they should not be able
to provide an input at all, but sometimes this is referred
to as input validation.
Finally, it is important to emphasize that the
distinctions between input validation and output escaping
are often blurred, and developers must be careful to
understand the difference, including how input validation
is not always sufficient to prevent vulnerabilities,
especially when less stringent data types must be
supported, such as free-form text. Consider a SQL injection
scenario in which a person's last name is inserted into a
query. The name "O'Reilly" would likely pass the validation
step since it is a common last name in the English
language. However, this valid name cannot be directly
inserted into the database because it contains the "'"
apostrophe character, which would need to be escaped or
otherwise transformed. In this case, removing the
apostrophe might reduce the risk of SQL injection, but it
would produce incorrect behavior because the wrong name
would be recorded.
| https://cwe.mitre.org/data/definitions/20.html | 0 | Jens Wiklander | 2018-11-20 09:56:58+01:00 | core: svc: always check ta parameters
Always check TA parameters from a user TA. This prevents a user TA from
passing invalid pointers to a pseudo TA.
Fixes: OP-TEE-2018-0007: "Buffer checks missing when calling pseudo
TAs".
Signed-off-by: Jens Wiklander <[email protected]>
Tested-by: Joakim Bech <[email protected]> (QEMU v7, v8)
Reviewed-by: Joakim Bech <[email protected]>
Reported-by: Riscure <[email protected]>
Reported-by: Alyssa Milburn <[email protected]>
Acked-by: Etienne Carriere <[email protected]> | d5c5b0b77b2b589666024d219a8007b3f5b6faeb | False | OP-TEE/optee_os | Trusted side of the TEE | 2014-05-26 17:18:57 | 2022-08-26 17:12:14 | null | OP-TEE | 1176.0 | 844.0 | utee_param_to_param | utee_param_to_param( struct tee_ta_param * p , struct utee_params * up) | ['p', 'up'] | static void utee_param_to_param(struct tee_ta_param *p, struct utee_params *up)
{
size_t n;
uint32_t types = up->types;
p->types = types;
for (n = 0; n < TEE_NUM_PARAMS; n++) {
uintptr_t a = up->vals[n * 2];
size_t b = up->vals[n * 2 + 1];
switch (TEE_PARAM_TYPE_GET(types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
p->u[n].mem.mobj = &mobj_virt;
p->u[n].mem.offs = a;
p->u[n].mem.size = b;
break;
case TEE_PARAM_TYPE_VALUE_INPUT:
case TEE_PARAM_TYPE_VALUE_INOUT:
p->u[n].val.a = a;
p->u[n].val.b = b;
break;
default:
memset(&p->u[n], 0, sizeof(p->u[n]));
break;
}
}
} | 194 | True | 1 |
CVE-2019-1010295 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'name': 'https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-20'}, {'lang': 'en', 'value': 'CWE-125'}, {'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linaro:op-tee:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.3.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Linaro/OP-TEE OP-TEE 3.3.0 and earlier is affected by: Buffer Overflow. The impact is: Memory corruption and disclosure of memory content. The component is: optee_os. The fixed version is: 3.4.0 and later.'}] | 2021-07-21T11:39Z | 2019-07-15T18: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 | Jens Wiklander | 2018-11-20 09:56:58+01:00 | core: svc: always check ta parameters
Always check TA parameters from a user TA. This prevents a user TA from
passing invalid pointers to a pseudo TA.
Fixes: OP-TEE-2018-0007: "Buffer checks missing when calling pseudo
TAs".
Signed-off-by: Jens Wiklander <[email protected]>
Tested-by: Joakim Bech <[email protected]> (QEMU v7, v8)
Reviewed-by: Joakim Bech <[email protected]>
Reported-by: Riscure <[email protected]>
Reported-by: Alyssa Milburn <[email protected]>
Acked-by: Etienne Carriere <[email protected]> | d5c5b0b77b2b589666024d219a8007b3f5b6faeb | False | OP-TEE/optee_os | Trusted side of the TEE | 2014-05-26 17:18:57 | 2022-08-26 17:12:14 | null | OP-TEE | 1176.0 | 844.0 | utee_param_to_param | utee_param_to_param( struct tee_ta_param * p , struct utee_params * up) | ['p', 'up'] | static void utee_param_to_param(struct tee_ta_param *p, struct utee_params *up)
{
size_t n;
uint32_t types = up->types;
p->types = types;
for (n = 0; n < TEE_NUM_PARAMS; n++) {
uintptr_t a = up->vals[n * 2];
size_t b = up->vals[n * 2 + 1];
switch (TEE_PARAM_TYPE_GET(types, n)) {
case TEE_PARAM_TYPE_MEMREF_INPUT:
case TEE_PARAM_TYPE_MEMREF_OUTPUT:
case TEE_PARAM_TYPE_MEMREF_INOUT:
p->u[n].mem.mobj = &mobj_virt;
p->u[n].mem.offs = a;
p->u[n].mem.size = b;
break;
case TEE_PARAM_TYPE_VALUE_INPUT:
case TEE_PARAM_TYPE_VALUE_INOUT:
p->u[n].val.a = a;
p->u[n].val.b = b;
break;
default:
memset(&p->u[n], 0, sizeof(p->u[n]));
break;
}
}
} | 194 | True | 1 |
CVE-2019-10664 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/domoticz/domoticz/commit/ee70db46f81afa582c96b887b73bcd2a86feda00', 'name': 'https://github.com/domoticz/domoticz/commit/ee70db46f81afa582c96b887b73bcd2a86feda00', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/46773/', 'name': '46773', 'refsource': 'EXPLOIT-DB', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://packetstormsecurity.com/files/152678/Domoticz-4.10577-Unauthenticated-Remote-Command-Execution.html', 'name': 'http://packetstormsecurity.com/files/152678/Domoticz-4.10577-Unauthenticated-Remote-Command-Execution.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}] | [{'description': [{'lang': 'en', 'value': 'CWE-89'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:domoticz:domoticz:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.10578', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Domoticz before 4.10578 allows SQL Injection via the idx parameter in CWebServer::GetFloorplanImage in WebServer.cpp.'}] | 2019-05-03T11:51Z | 2019-03-31T14:29Z | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. |
Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.
| https://cwe.mitre.org/data/definitions/89.html | 0 | Rob Peters | 2019-03-29 15:04:04+01:00 | Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!) | ee70db46f81afa582c96b887b73bcd2a86feda00 | False | domoticz/domoticz | Open source Home Automation System | 2015-08-15 12:49:39 | 2022-08-27 11:13:34 | http://www.domoticz.com | domoticz | 3152.0 | 1108.0 | http::server::CWebServer::GetFloorplanImage | http::server::CWebServer::GetFloorplanImage( WebEmSession & session , const request & req , reply & rep) | ['session', 'req', 'rep'] | void CWebServer::GetFloorplanImage(WebEmSession & session, const request& req, reply & rep)
{
std::string idx = request::findValue(&req, "idx");
if (idx == "") {
return;
}
std::vector<std::vector<std::string> > result;
result = m_sql.safe_queryBlob("SELECT Image FROM Floorplans WHERE ID=%s", idx.c_str());
if (result.empty())
return;
reply::set_content(&rep, result[0][0].begin(), result[0][0].end());
std::string oname = "floorplan";
if (result[0][0].size() > 10)
{
if (result[0][0][0] == 'P')
oname += ".png";
else if (result[0][0][0] == -1)
oname += ".jpg";
else if (result[0][0][0] == 'B')
oname += ".bmp";
else if (result[0][0][0] == 'G')
oname += ".gif";
}
reply::add_header_attachment(&rep, oname);
} | 231 | True | 1 |
CVE-2019-10672 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/hoene/libmysofa/releases/tag/v0.7', 'name': 'https://github.com/hoene/libmysofa/releases/tag/v0.7', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/hoene/libmysofa/compare/49aa1c7...2ed84bb', 'name': 'https://github.com/hoene/libmysofa/compare/49aa1c7...2ed84bb', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/hoene/libmysofa/commit/d39a171e9c6a1c44dbdf43f9db6c3fbd887e38c1', 'name': 'https://github.com/hoene/libmysofa/commit/d39a171e9c6a1c44dbdf43f9db6c3fbd887e38c1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4033-1/', 'name': 'USN-4033-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-20'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:symonics:libmysofa:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'treeRead in hdf/btree.c in libmysofa before 0.7 does not properly validate multiplications and additions.'}] | 2020-01-08T14:41Z | 2019-03-31T17:29Z | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. |
Input validation is a frequently-used technique
for checking potentially dangerous inputs in order to
ensure that the inputs are safe for processing within the
code, or when communicating with other components. When
software does not validate input properly, an attacker is
able to craft the input in a form that is not expected by
the rest of the application. This will lead to parts of the
system receiving unintended input, which may result in
altered control flow, arbitrary control of a resource, or
arbitrary code execution.
Input validation is not the only technique for
processing input, however. Other techniques attempt to
transform potentially-dangerous input into something safe, such
as filtering (CWE-790) - which attempts to remove dangerous
inputs - or encoding/escaping (CWE-116), which attempts to
ensure that the input is not misinterpreted when it is included
in output to another component. Other techniques exist as well
(see CWE-138 for more examples.)
Input validation can be applied to:
raw data - strings, numbers, parameters, file contents, etc.
metadata - information about the raw data, such as headers or size
Data can be simple or structured. Structured data
can be composed of many nested layers, composed of
combinations of metadata and raw data, with other simple or
structured data.
Many properties of raw data or metadata may need
to be validated upon entry into the code, such
as:
specified quantities such as size, length, frequency, price, rate, number of operations, time, etc.
implied or derived quantities, such as the actual size of a file instead of a specified size
indexes, offsets, or positions into more complex data structures
symbolic keys or other elements into hash tables, associative arrays, etc.
well-formedness, i.e. syntactic correctness - compliance with expected syntax
lexical token correctness - compliance with rules for what is treated as a token
specified or derived type - the actual type of the input (or what the input appears to be)
consistency - between individual data elements, between raw data and metadata, between references, etc.
conformance to domain-specific rules, e.g. business logic
equivalence - ensuring that equivalent inputs are treated the same
authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data
Implied or derived properties of data must often
be calculated or inferred by the code itself. Errors in
deriving properties may be considered a contributing factor
to improper input validation.
Note that "input validation" has very different
meanings to different people, or within different
classification schemes. Caution must be used when
referencing this CWE entry or mapping to it. For example,
some weaknesses might involve inadvertently giving control
to an attacker over an input when they should not be able
to provide an input at all, but sometimes this is referred
to as input validation.
Finally, it is important to emphasize that the
distinctions between input validation and output escaping
are often blurred, and developers must be careful to
understand the difference, including how input validation
is not always sufficient to prevent vulnerabilities,
especially when less stringent data types must be
supported, such as free-form text. Consider a SQL injection
scenario in which a person's last name is inserted into a
query. The name "O'Reilly" would likely pass the validation
step since it is a common last name in the English
language. However, this valid name cannot be directly
inserted into the database because it contains the "'"
apostrophe character, which would need to be escaped or
otherwise transformed. In this case, removing the
apostrophe might reduce the risk of SQL injection, but it
would produce incorrect behavior because the wrong name
would be recorded.
| https://cwe.mitre.org/data/definitions/20.html | 0 | Christian Hoene | 2019-03-31 15:57:14+02:00 | Fixed security issue 1 | d39a171e9c6a1c44dbdf43f9db6c3fbd887e38c1 | False | hoene/libmysofa | Reader for AES SOFA files to get better HRTFs | 2016-12-06 22:13:29 | 2022-07-09 15:15:26 | hoene | 96.0 | 51.0 | treeRead | treeRead( struct READER * reader , struct DATAOBJECT * data) | ['reader', 'data'] | int treeRead(struct READER *reader, struct DATAOBJECT *data) {
int i, j, err, olen, elements, size, x, y, z, b, e, dy, dz, sx, sy, sz, dzy,
szy;
char *input, *output;
uint8_t node_type, node_level;
uint16_t entries_used;
uint32_t size_of_chunk;
uint32_t filter_mask;
uint64_t address_of_left_sibling, address_of_right_sibling, start[4],
child_pointer, key, store;
char buf[4];
UNUSED(node_level);
UNUSED(address_of_right_sibling);
UNUSED(address_of_left_sibling);
UNUSED(key);
if (data->ds.dimensionality > 3) {
log("TREE dimensions > 3");
return MYSOFA_INVALID_FORMAT;
}
/* read signature */
if (fread(buf, 1, 4, reader->fhd) != 4 || strncmp(buf, "TREE", 4)) {
log("cannot read signature of TREE\n");
return MYSOFA_INVALID_FORMAT;
} log("%08lX %.4s\n", (uint64_t )ftell(reader->fhd) - 4, buf);
node_type = (uint8_t)fgetc(reader->fhd);
node_level = (uint8_t)fgetc(reader->fhd);
entries_used = (uint16_t)readValue(reader, 2);
if(entries_used>0x1000)
return MYSOFA_UNSUPPORTED_FORMAT;
address_of_left_sibling = readValue(reader,
reader->superblock.size_of_offsets);
address_of_right_sibling = readValue(reader,
reader->superblock.size_of_offsets);
elements = 1;
for (j = 0; j < data->ds.dimensionality; j++)
elements *= data->datalayout_chunk[j];
dy = data->datalayout_chunk[1];
dz = data->datalayout_chunk[2];
sx = data->ds.dimension_size[0];
sy = data->ds.dimension_size[1];
sz = data->ds.dimension_size[2];
dzy = dz * dy;
szy = sz * sy;
size = data->datalayout_chunk[data->ds.dimensionality];
log("elements %d size %d\n",elements,size);
if (!(output = malloc(elements * size))) {
return MYSOFA_NO_MEMORY;
}
for (e = 0; e < entries_used * 2; e++) {
if (node_type == 0) {
key = readValue(reader, reader->superblock.size_of_lengths);
} else {
size_of_chunk = (uint32_t)readValue(reader, 4);
filter_mask = (uint32_t)readValue(reader, 4);
if (filter_mask) {
log("TREE all filters must be enabled\n");
free(output);
return MYSOFA_INVALID_FORMAT;
}
for (j = 0; j < data->ds.dimensionality; j++) {
start[j] = readValue(reader, 8);
log("start %d %lu\n",j,start[j]);
}
if (readValue(reader, 8)) {
break;
}
child_pointer = readValue(reader,
reader->superblock.size_of_offsets);
log(" data at %lX len %u\n", child_pointer, size_of_chunk);
/* read data */
store = ftell(reader->fhd);
if (fseek(reader->fhd, child_pointer, SEEK_SET)<0) {
free(output);
return errno;
}
if (!(input = malloc(size_of_chunk))) {
free(output);
return MYSOFA_NO_MEMORY;
}
if (fread(input, 1, size_of_chunk, reader->fhd) != size_of_chunk) {
free(output);
free(input);
return MYSOFA_INVALID_FORMAT;
}
olen = elements * size;
err = gunzip(size_of_chunk, input, &olen, output);
free(input);
log(" gunzip %d %d %d\n",err, olen, elements*size);
if (err || olen != elements * size) {
free(output);
return MYSOFA_INVALID_FORMAT;
}
switch (data->ds.dimensionality) {
case 1:
for (i = 0; i < olen; i++) {
b = i / elements;
x = i % elements + start[0];
if (x < sx) {
j = x * size + b;
((char*)data->data)[j] = output[i];
}
}
break;
case 2:
for (i = 0; i < olen; i++) {
b = i / elements;
x = i % elements;
y = x % dy + start[1];
x = x / dy + start[0];
if (y < sy && x < sx) {
j = ((x * sy + y) * size) + b;
((char*)data->data)[j] = output[i];
}
}
break;
case 3:
for (i = 0; i < olen; i++) {
b = i / elements;
x = i % elements;
z = x % dz + start[2];
y = (x / dz) % dy + start[1];
x = (x / dzy) + start[0];
if (z < sz && y < sy && x < sx) {
j = (x * szy + y * sz + z) * size + b;
((char*)data->data)[j] = output[i];
}
}
break;
default:
log("invalid dim\n");
return MYSOFA_INTERNAL_ERROR;
}
if(fseek(reader->fhd, store, SEEK_SET)<0) {
free(output);
return errno;
}
}
}
free(output);
if(fseek(reader->fhd, 4, SEEK_CUR)<0) /* skip checksum */
return errno;
return MYSOFA_OK;
} | 1068 | True | 1 |
|
CVE-2021-3756 | 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/hoene/libmysofa/commit/890400ebd092c574707d0c132124f8ff047e20e1', 'name': 'https://github.com/hoene/libmysofa/commit/890400ebd092c574707d0c132124f8ff047e20e1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/7ca8d9ea-e2a6-4294-af28-70260bb53bc1', 'name': 'https://huntr.dev/bounties/7ca8d9ea-e2a6-4294-af28-70260bb53bc1', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/WGY7TAZX2M4NYXXGNHIBBKKN5XMSMKQ4/', 'name': 'FEDORA-2021-36ac17e5ac', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/PGQ45S4RH7MC42NHTAGOIHYR4C5IRTMZ/', 'name': 'FEDORA-2021-28b495e9e0', 'refsource': 'FEDORA', '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:symonics:libmysofa:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmysofa is vulnerable to Heap-based Buffer Overflow'}] | 2021-12-22T17:37Z | 2021-10-29T16: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 | Christian Hoene | 2021-10-03 17:48:38+02:00 | Fix for issue 163 | 890400ebd092c574707d0c132124f8ff047e20e1 | False | hoene/libmysofa | Reader for AES SOFA files to get better HRTFs | 2016-12-06 22:13:29 | 2022-07-09 15:15:26 | hoene | 96.0 | 51.0 | readOHDRHeaderMessageDataLayout | readOHDRHeaderMessageDataLayout( struct READER * reader , struct DATAOBJECT * data) | ['reader', 'data'] | static int readOHDRHeaderMessageDataLayout(struct READER *reader,
struct DATAOBJECT *data) {
int i, err;
unsigned size;
uint8_t dimensionality, layout_class;
uint32_t dataset_element_size;
uint64_t data_address, store, data_size;
UNUSED(dataset_element_size);
UNUSED(data_size);
if (fgetc(reader->fhd) != 3) {
// LCOV_EXCL_START
mylog("object OHDR message data layout message must have version 3\n");
return MYSOFA_INVALID_FORMAT;
// LCOV_EXCL_STOP
}
layout_class = (uint8_t)fgetc(reader->fhd);
mylog("data layout %d\n", layout_class);
switch (layout_class) {
#if 0
case 0:
data_size = readValue(reader, 2);
fseek(reader->fhd, data_size, SEEK_CUR);
mylog("TODO 0 SIZE %u\n", data_size);
break;
#endif
case 1:
data_address = readValue(reader, reader->superblock.size_of_offsets);
data_size = readValue(reader, reader->superblock.size_of_lengths);
mylog("CHUNK Contiguous SIZE %" PRIu64 "\n", data_size);
if (validAddress(reader, data_address)) {
store = ftell(reader->fhd);
if (fseek(reader->fhd, data_address, SEEK_SET) < 0)
return errno; // LCOV_EXCL_LINE
if (!data->data) {
if (data_size > 0x10000000)
return MYSOFA_INVALID_FORMAT;
data->data_len = data_size;
data->data = calloc(1, data_size);
if (!data->data)
return MYSOFA_NO_MEMORY; // LCOV_EXCL_LINE
}
err = fread(data->data, 1, data_size, reader->fhd);
if (err != data_size)
return MYSOFA_READ_ERROR; // LCOV_EXCL_LINE
if (fseek(reader->fhd, store, SEEK_SET) < 0)
return errno; // LCOV_EXCL_LINE
}
break;
case 2:
dimensionality = (uint8_t)fgetc(reader->fhd);
mylog("dimensionality %d\n", dimensionality);
if (dimensionality < 1 || dimensionality > DATAOBJECT_MAX_DIMENSIONALITY) {
mylog("data layout 2: invalid dimensionality %d %lu %lu\n",
dimensionality, sizeof(data->datalayout_chunk),
sizeof(data->datalayout_chunk[0]));
return MYSOFA_INVALID_FORMAT; // LCOV_EXCL_LINE
}
data_address = readValue(reader, reader->superblock.size_of_offsets);
mylog(" CHUNK %" PRIX64 "\n", data_address);
for (i = 0; i < dimensionality; i++) {
data->datalayout_chunk[i] = readValue(reader, 4);
mylog(" %d\n", data->datalayout_chunk[i]);
}
/* TODO last entry? error in spec: ?*/
size = data->datalayout_chunk[dimensionality - 1];
for (i = 0; i < data->ds.dimensionality; i++)
size *= data->ds.dimension_size[i];
if (validAddress(reader, data_address) && dimensionality <= 4) {
store = ftell(reader->fhd);
if (fseek(reader->fhd, data_address, SEEK_SET) < 0)
return errno; // LCOV_EXCL_LINE
if (!data->data) {
if (size > 0x10000000)
return MYSOFA_INVALID_FORMAT; // LCOV_EXCL_LINE
data->data_len = size;
data->data = calloc(1, size);
if (!data->data)
return MYSOFA_NO_MEMORY; // LCOV_EXCL_LINE
}
err = treeRead(reader, data);
if (err)
return err; // LCOV_EXCL_LINE
if (fseek(reader->fhd, store, SEEK_SET) < 0)
return errno; // LCOV_EXCL_LINE
}
break;
default:
// LCOV_EXCL_START
mylog("object OHDR message data layout message has unknown layout class "
"%d\n",
layout_class);
return MYSOFA_INVALID_FORMAT;
// LCOV_EXCL_STOP
}
return MYSOFA_OK;
} | 595 | True | 1 |
|
CVE-2019-20016 | 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/hoene/libmysofa/issues/84', 'name': 'https://github.com/hoene/libmysofa/issues/84', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/hoene/libmysofa/issues/83', 'name': 'https://github.com/hoene/libmysofa/issues/83', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/hoene/libmysofa/commit/2e6fac6ab6156dae8e8c6f417741388084b70d6f', 'name': 'https://github.com/hoene/libmysofa/commit/2e6fac6ab6156dae8e8c6f417741388084b70d6f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:symonics:libmysofa:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmysofa before 2019-11-24 does not properly restrict recursive function calls, as demonstrated by reports of stack consumption in readOHDRHeaderMessageDatatype in dataobject.c and directblockRead in fractalhead.c. NOTE: a download of v0.9 after 2019-12-06 should fully remediate this issue.'}] | 2020-01-08T21:22Z | 2019-12-27T02: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 | Christian Hoene | 2019-11-24 10:42:37+01:00 | Fixed recursive function calls | 2e6fac6ab6156dae8e8c6f417741388084b70d6f | False | hoene/libmysofa | Reader for AES SOFA files to get better HRTFs | 2016-12-06 22:13:29 | 2022-07-09 15:15:26 | hoene | 96.0 | 51.0 | directblockRead | directblockRead( struct READER * reader , struct DATAOBJECT * dataobject , struct FRACTALHEAP * fractalheap) | ['reader', 'dataobject', 'fractalheap'] | static int directblockRead(struct READER *reader, struct DATAOBJECT *dataobject,
struct FRACTALHEAP *fractalheap) {
char buf[4], *name, *value;
int size, offset_size, length_size, err, len;
uint8_t typeandversion;
uint64_t unknown, heap_header_address, block_offset, block_size, offset,
length;
long store;
struct DIR *dir;
struct MYSOFA_ATTRIBUTE *attr;
UNUSED(offset);
UNUSED(block_size);
UNUSED(block_offset);
/* read signature */
if (fread(buf, 1, 4, reader->fhd) != 4 || strncmp(buf, "FHDB", 4)) {
log("cannot read signature of fractal heap indirect block\n");
return MYSOFA_INVALID_FORMAT;
}
log("%08" PRIX64 " %.4s\n", (uint64_t )ftell(reader->fhd) - 4, buf);
if (fgetc(reader->fhd) != 0) {
log("object FHDB must have version 0\n");
return MYSOFA_UNSUPPORTED_FORMAT;
}
/* ignore heap_header_address */
if (fseek(reader->fhd, reader->superblock.size_of_offsets, SEEK_CUR) < 0)
return errno;
size = (fractalheap->maximum_heap_size + 7) / 8;
block_offset = readValue(reader, size);
if (fractalheap->flags & 2)
if (fseek(reader->fhd, 4, SEEK_CUR))
return errno;
offset_size = ceilf(log2f(fractalheap->maximum_heap_size) / 8);
if (fractalheap->maximum_direct_block_size < fractalheap->maximum_size)
length_size = ceilf(log2f(fractalheap->maximum_direct_block_size) / 8);
else
length_size = ceilf(log2f(fractalheap->maximum_size) / 8);
log(" %d %" PRIu64 " %d\n",size,block_offset,offset_size);
/*
* 00003e00 00 46 48 44 42 00 40 02 00 00 00 00 00 00 00 00 |.FHDB.@.........|
00003e10 00 00 00 83 8d ac f6 >03 00 0c 00 08 00 04 00 00 |................|
00003e20 43 6f 6e 76 65 6e 74 69 6f 6e 73 00 13 00 00 00 |Conventions.....|
00003e30 04 00 00 00 02 00 00 00 53 4f 46 41< 03 00 08 00 |........SOFA....|
00003e40 08 00 04 00 00 56 65 72 73 69 6f 6e 00 13 00 00 |.....Version....|
00003e50 00 03 00 00 00 02 00 00 00 30 2e 36 03 00 10 00 |.........0.6....|
00003e60 08 00 04 00 00 53 4f 46 41 43 6f 6e 76 65 6e 74 |.....SOFAConvent|
00003e70 69 6f 6e 73 00 13 00 00 00 13 00 00 00 02 00 00 |ions............|
00003e80 00 53 69 6d 70 6c 65 46 72 65 65 46 69 65 6c 64 |.SimpleFreeField|
00003e90 48 52 49 52 03 00 17 00 08 00 04 00 00 53 4f 46 |HRIR.........SOF|
00003ea0 41 43 6f 6e 76 65 6e 74 69 6f 6e 73 56 65 72 73 |AConventionsVers|
00003eb0 69 6f 6e 00 13 00 00 00 03 00 00 00 02 00 00 00 |ion.............|
*
*/
do {
typeandversion = (uint8_t) fgetc(reader->fhd);
offset = readValue(reader, offset_size);
length = readValue(reader, length_size);
if (offset > 0x10000000 || length > 0x10000000)
return MYSOFA_UNSUPPORTED_FORMAT;
log(" %d %4" PRIX64 " %" PRIX64 " %08lX\n",typeandversion,offset,length,ftell(reader->fhd));
/* TODO: for the following part, the specification is incomplete */
if (typeandversion == 3) {
/*
* this seems to be a name and value pair
*/
if (readValue(reader, 5) != 0x0000040008) {
log("FHDB type 3 unsupported values");
return MYSOFA_UNSUPPORTED_FORMAT;
}
if (!(name = malloc(length+1)))
return MYSOFA_NO_MEMORY;
if (fread(name, 1, length, reader->fhd) != length) {
free(name);
return MYSOFA_READ_ERROR;
}
name[length]=0;
if (readValue(reader, 4) != 0x00000013) {
log("FHDB type 3 unsupported values");
free(name);
return MYSOFA_UNSUPPORTED_FORMAT;
}
len = (int) readValue(reader, 2);
if (len > 0x1000 || len < 0) {
free(name);
return MYSOFA_UNSUPPORTED_FORMAT;
}
/* TODO: Get definition of this field */
unknown = readValue(reader, 6);
if (unknown == 0x000000020200)
value = NULL;
else if (unknown == 0x000000020000) {
if (!(value = malloc(len + 1))) {
free(name);
return MYSOFA_NO_MEMORY;
}
if (fread(value, 1, len, reader->fhd) != len) {
free(value);
free(name);
return MYSOFA_READ_ERROR;
}
value[len] = 0;
} else if (unknown == 0x20000020000) {
if (!(value = malloc(5))) {
free(name);
return MYSOFA_NO_MEMORY;
}
strcpy(value, "");
} else {
log("FHDB type 3 unsupported values: %12" PRIX64 "\n",unknown);
free(name);
/* TODO: return MYSOFA_UNSUPPORTED_FORMAT; */
return MYSOFA_OK;
}
log(" %s = %s\n", name, value);
attr = malloc(sizeof(struct MYSOFA_ATTRIBUTE));
attr->name = name;
attr->value = value;
attr->next = dataobject->attributes;
dataobject->attributes = attr;
} else if (typeandversion == 1) {
/*
* pointer to another data object
*/
unknown = readValue(reader, 6);
if (unknown) {
log("FHDB type 1 unsupported values\n");
return MYSOFA_UNSUPPORTED_FORMAT;
}
len = fgetc(reader->fhd);
if (len < 0)
return MYSOFA_READ_ERROR;
assert(len < 0x100);
if (!(name = malloc(len + 1)))
return MYSOFA_NO_MEMORY;
if (fread(name, 1, len, reader->fhd) != len) {
free(name);
return MYSOFA_READ_ERROR;
}
name[len] = 0;
heap_header_address = readValue(reader,
reader->superblock.size_of_offsets);
log("\nfractal head type 1 length %4" PRIX64 " name %s address %" PRIX64 "\n", length, name, heap_header_address);
dir = malloc(sizeof(struct DIR));
if (!dir) {
free(name);
return MYSOFA_NO_MEMORY;
}
memset(dir, 0, sizeof(*dir));
dir->next = dataobject->directory;
dataobject->directory = dir;
store = ftell(reader->fhd);
if (fseek(reader->fhd, heap_header_address, SEEK_SET)) {
free(name);
return errno;
}
err = dataobjectRead(reader, &dir->dataobject, name);
if (err) {
return err;
}
if (store < 0) {
return errno;
}
if (fseek(reader->fhd, store, SEEK_SET) < 0)
return errno;
} else if (typeandversion != 0) {
/* TODO is must be avoided somehow */
log("fractal head unknown type %d\n", typeandversion);
/* return MYSOFA_UNSUPPORTED_FORMAT; */
return MYSOFA_OK;
}
} while (typeandversion != 0);
return MYSOFA_OK;
} | 1000 | True | 1 |
|
CVE-2021-27138 | 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/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'name': 'https://github.com/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'name': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'name': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2021.04:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2021.01', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The boot loader in Das U-Boot before 2021.04-rc2 mishandles use of unit addresses in a FIT.'}] | 2021-02-24T00:35Z | 2021-02-17T23: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 Glass | 2021-02-15 17:08:06-07:00 | fit: Don't allow verification of images with @ nodes
When searching for a node called 'fred', any unit address appended to the
name is ignored by libfdt, meaning that 'fred' can match 'fred@1'. This
means that we cannot be sure that the node originally intended is the one
that is used.
Disallow use of nodes with unit addresses.
Update the forge test also, since it uses @ addresses.
CVE-2021-27138
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Bruce Monroe <[email protected]>
Reported-by: Arie Haenel <[email protected]>
Reported-by: Julien Lenoir <[email protected]> | 79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | fit_config_verify_required_sigs | fit_config_verify_required_sigs( const void * fit , int conf_noffset , const void * sig_blob) | ['fit', 'conf_noffset', 'sig_blob'] | int fit_config_verify_required_sigs(const void *fit, int conf_noffset,
const void *sig_blob)
{
int noffset;
int sig_node;
int verified = 0;
int reqd_sigs = 0;
bool reqd_policy_all = true;
const char *reqd_mode;
/* Work out what we need to verify */
sig_node = fdt_subnode_offset(sig_blob, 0, FIT_SIG_NODENAME);
if (sig_node < 0) {
debug("%s: No signature node found: %s\n", __func__,
fdt_strerror(sig_node));
return 0;
}
/* Get required-mode policy property from DTB */
reqd_mode = fdt_getprop(sig_blob, sig_node, "required-mode", NULL);
if (reqd_mode && !strcmp(reqd_mode, "any"))
reqd_policy_all = false;
debug("%s: required-mode policy set to '%s'\n", __func__,
reqd_policy_all ? "all" : "any");
fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
required = fdt_getprop(sig_blob, noffset, FIT_KEY_REQUIRED,
NULL);
if (!required || strcmp(required, "conf"))
continue;
reqd_sigs++;
ret = fit_config_verify_sig(fit, conf_noffset, sig_blob,
noffset);
if (ret) {
if (reqd_policy_all) {
printf("Failed to verify required signature '%s'\n",
fit_get_name(sig_blob, noffset, NULL));
return ret;
}
} else {
verified++;
if (!reqd_policy_all)
break;
}
}
if (reqd_sigs && !verified) {
printf("Failed to verify 'any' of the required signature(s)\n");
return -EPERM;
}
return 0;
} | 243 | True | 1 |
CVE-2021-27138 | 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/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'name': 'https://github.com/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'name': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'name': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2021.04:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2021.01', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The boot loader in Das U-Boot before 2021.04-rc2 mishandles use of unit addresses in a FIT.'}] | 2021-02-24T00:35Z | 2021-02-17T23: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 Glass | 2021-02-15 17:08:06-07:00 | fit: Don't allow verification of images with @ nodes
When searching for a node called 'fred', any unit address appended to the
name is ignored by libfdt, meaning that 'fred' can match 'fred@1'. This
means that we cannot be sure that the node originally intended is the one
that is used.
Disallow use of nodes with unit addresses.
Update the forge test also, since it uses @ addresses.
CVE-2021-27138
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Bruce Monroe <[email protected]>
Reported-by: Arie Haenel <[email protected]>
Reported-by: Julien Lenoir <[email protected]> | 79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | fit_image_verify | fit_image_verify( const void * fit , int image_noffset) | ['fit', 'image_noffset'] | int fit_image_verify(const void *fit, int image_noffset)
{
const void *data;
size_t size;
int noffset = 0;
char *err_msg = "";
/* Get image data and data length */
if (fit_image_get_data_and_size(fit, image_noffset, &data, &size)) {
err_msg = "Can't get image data/size";
printf("error!\n%s for '%s' hash node in '%s' image node\n",
err_msg, fit_get_name(fit, noffset, NULL),
fit_get_name(fit, image_noffset, NULL));
return 0;
}
return fit_image_verify_with_data(fit, image_noffset, data, size);
} | 92 | True | 1 |
CVE-2021-27138 | 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/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'name': 'https://github.com/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'name': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'name': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2021.04:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2021.01', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The boot loader in Das U-Boot before 2021.04-rc2 mishandles use of unit addresses in a FIT.'}] | 2021-02-24T00:35Z | 2021-02-17T23: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 Glass | 2021-02-15 17:08:12-07:00 | image: Check for unit addresses in FITs
Using unit addresses in a FIT is a security risk. Add a check for this
and disallow it.
CVE-2021-27138
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Bruce Monroe <[email protected]>
Reported-by: Arie Haenel <[email protected]>
Reported-by: Julien Lenoir <[email protected]> | 3f04db891a353f4b127ed57279279f851c6b4917 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | fit_check_format | fit_check_format( const void * fit , ulong size) | ['fit', 'size'] | int fit_check_format(const void *fit, ulong size)
{
int ret;
/* A FIT image must be a valid FDT */
ret = fdt_check_header(fit);
if (ret) {
log_debug("Wrong FIT format: not a flattened device tree (err=%d)\n",
ret);
return -ENOEXEC;
}
if (CONFIG_IS_ENABLED(FIT_FULL_CHECK)) {
/*
* If we are not given the size, make do wtih calculating it.
* This is not as secure, so we should consider a flag to
* control this.
*/
if (size == IMAGE_SIZE_INVAL)
size = fdt_totalsize(fit);
ret = fdt_check_full(fit, size);
if (ret) {
log_debug("FIT check error %d\n", ret);
return -EINVAL;
}
}
/* mandatory / node 'description' property */
if (!fdt_getprop(fit, 0, FIT_DESC_PROP, NULL)) {
log_debug("Wrong FIT format: no description\n");
return -ENOMSG;
}
if (IMAGE_ENABLE_TIMESTAMP) {
/* mandatory / node 'timestamp' property */
if (!fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL)) {
log_debug("Wrong FIT format: no timestamp\n");
return -ENODATA;
}
}
/* mandatory subimages parent '/images' node */
if (fdt_path_offset(fit, FIT_IMAGES_PATH) < 0) {
log_debug("Wrong FIT format: no images parent node\n");
return -ENOENT;
}
return 0;
} | 168 | True | 1 |
CVE-2021-27138 | 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/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'name': 'https://github.com/u-boot/u-boot/commit/3f04db891a353f4b127ed57279279f851c6b4917', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'name': 'https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'name': 'https://github.com/u-boot/u-boot/commit/b6f4c757959f8850e1299a77c8e5713da78e8ec0', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2021.04:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2021.01', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The boot loader in Das U-Boot before 2021.04-rc2 mishandles use of unit addresses in a FIT.'}] | 2021-02-24T00:35Z | 2021-02-17T23: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 Glass | 2021-02-15 17:08:12-07:00 | image: Check for unit addresses in FITs
Using unit addresses in a FIT is a security risk. Add a check for this
and disallow it.
CVE-2021-27138
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Bruce Monroe <[email protected]>
Reported-by: Arie Haenel <[email protected]>
Reported-by: Julien Lenoir <[email protected]> | 3f04db891a353f4b127ed57279279f851c6b4917 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | fit_image_load | fit_image_load( bootm_headers_t * images , ulong addr , const char ** fit_unamep , const char ** fit_uname_configp , int arch , int image_type , int bootstage_id , enum fit_load_op load_op , ulong * datap , ulong * lenp) | ['images', 'addr', 'fit_unamep', 'fit_uname_configp', 'arch', 'image_type', 'bootstage_id', 'load_op', 'datap', 'lenp'] | int fit_image_load(bootm_headers_t *images, ulong addr,
const char **fit_unamep, const char **fit_uname_configp,
int arch, int image_type, int bootstage_id,
enum fit_load_op load_op, ulong *datap, ulong *lenp)
{
int cfg_noffset, noffset;
const char *fit_uname;
const char *fit_uname_config;
const char *fit_base_uname_config;
const void *fit;
void *buf;
void *loadbuf;
size_t size;
int type_ok, os_ok;
ulong load, load_end, data, len;
uint8_t os, comp;
#ifndef USE_HOSTCC
uint8_t os_arch;
#endif
const char *prop_name;
int ret;
fit = map_sysmem(addr, 0);
fit_uname = fit_unamep ? *fit_unamep : NULL;
fit_uname_config = fit_uname_configp ? *fit_uname_configp : NULL;
fit_base_uname_config = NULL;
prop_name = fit_get_image_type_property(image_type);
printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, addr);
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT);
if (fit_check_format(fit, IMAGE_SIZE_INVAL)) {
printf("Bad FIT %s image format!\n", prop_name);
bootstage_error(bootstage_id + BOOTSTAGE_SUB_FORMAT);
return -ENOEXEC;
}
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT_OK);
if (fit_uname) {
/* get FIT component image node offset */
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_UNIT_NAME);
noffset = fit_image_get_node(fit, fit_uname);
} else {
/*
* no image node unit name, try to get config
* node first. If config unit node name is NULL
* fit_conf_get_node() will try to find default config node
*/
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_NO_UNIT_NAME);
if (IMAGE_ENABLE_BEST_MATCH && !fit_uname_config) {
cfg_noffset = fit_conf_find_compat(fit, gd_fdt_blob());
} else {
cfg_noffset = fit_conf_get_node(fit,
fit_uname_config);
}
if (cfg_noffset < 0) {
puts("Could not find configuration node\n");
bootstage_error(bootstage_id +
BOOTSTAGE_SUB_NO_UNIT_NAME);
return -ENOENT;
}
fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
printf(" Using '%s' configuration\n", fit_base_uname_config);
/* Remember this config */
if (image_type == IH_TYPE_KERNEL)
images->fit_uname_cfg = fit_base_uname_config;
if (FIT_IMAGE_ENABLE_VERIFY && images->verify) {
puts(" Verifying Hash Integrity ... ");
if (fit_config_verify(fit, cfg_noffset)) {
puts("Bad Data Hash\n");
bootstage_error(bootstage_id +
BOOTSTAGE_SUB_HASH);
return -EACCES;
}
puts("OK\n");
}
bootstage_mark(BOOTSTAGE_ID_FIT_CONFIG);
noffset = fit_conf_get_prop_node(fit, cfg_noffset,
prop_name);
fit_uname = fit_get_name(fit, noffset, NULL);
}
if (noffset < 0) {
printf("Could not find subimage node type '%s'\n", prop_name);
bootstage_error(bootstage_id + BOOTSTAGE_SUB_SUBNODE);
return -ENOENT;
}
printf(" Trying '%s' %s subimage\n", fit_uname, prop_name);
ret = fit_image_select(fit, noffset, images->verify);
if (ret) {
bootstage_error(bootstage_id + BOOTSTAGE_SUB_HASH);
return ret;
}
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH);
if (!host_build() && IS_ENABLED(CONFIG_SANDBOX)) {
if (!fit_image_check_target_arch(fit, noffset)) {
puts("Unsupported Architecture\n");
bootstage_error(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH);
return -ENOEXEC;
}
}
#ifndef USE_HOSTCC
fit_image_get_arch(fit, noffset, &os_arch);
images->os.arch = os_arch;
#endif
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL);
type_ok = fit_image_check_type(fit, noffset, image_type) ||
fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE) ||
(image_type == IH_TYPE_KERNEL &&
fit_image_check_type(fit, noffset, IH_TYPE_KERNEL_NOLOAD));
os_ok = image_type == IH_TYPE_FLATDT ||
image_type == IH_TYPE_FPGA ||
fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
fit_image_check_os(fit, noffset, IH_OS_U_BOOT) ||
fit_image_check_os(fit, noffset, IH_OS_OPENRTOS) ||
fit_image_check_os(fit, noffset, IH_OS_EFI) ||
fit_image_check_os(fit, noffset, IH_OS_VXWORKS);
/*
* If either of the checks fail, we should report an error, but
* if the image type is coming from the "loadables" field, we
* don't care what it is
*/
if ((!type_ok || !os_ok) && image_type != IH_TYPE_LOADABLE) {
fit_image_get_os(fit, noffset, &os);
printf("No %s %s %s Image\n",
genimg_get_os_name(os),
genimg_get_arch_name(arch),
genimg_get_type_name(image_type));
bootstage_error(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL);
return -EIO;
}
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL_OK);
/* get image data address and length */
if (fit_image_get_data_and_size(fit, noffset,
(const void **)&buf, &size)) {
printf("Could not find %s subimage data!\n", prop_name);
bootstage_error(bootstage_id + BOOTSTAGE_SUB_GET_DATA);
return -ENOENT;
}
/* Decrypt data before uncompress/move */
if (IS_ENABLED(CONFIG_FIT_CIPHER) && IMAGE_ENABLE_DECRYPT) {
puts(" Decrypting Data ... ");
if (fit_image_uncipher(fit, noffset, &buf, &size)) {
puts("Error\n");
return -EACCES;
}
puts("OK\n");
}
/* perform any post-processing on the image data */
if (!host_build() && IS_ENABLED(CONFIG_FIT_IMAGE_POST_PROCESS))
board_fit_image_post_process(&buf, &size);
len = (ulong)size;
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_GET_DATA_OK);
data = map_to_sysmem(buf);
load = data;
if (load_op == FIT_LOAD_IGNORED) {
/* Don't load */
} else if (fit_image_get_load(fit, noffset, &load)) {
if (load_op == FIT_LOAD_REQUIRED) {
printf("Can't get %s subimage load address!\n",
prop_name);
bootstage_error(bootstage_id + BOOTSTAGE_SUB_LOAD);
return -EBADF;
}
} else if (load_op != FIT_LOAD_OPTIONAL_NON_ZERO || load) {
ulong image_start, image_end;
/*
* move image data to the load address,
* make sure we don't overwrite initial image
*/
image_start = addr;
image_end = addr + fit_get_size(fit);
load_end = load + len;
if (image_type != IH_TYPE_KERNEL &&
load < image_end && load_end > image_start) {
printf("Error: %s overwritten\n", prop_name);
return -EXDEV;
}
printf(" Loading %s from 0x%08lx to 0x%08lx\n",
prop_name, data, load);
} else {
load = data; /* No load address specified */
}
comp = IH_COMP_NONE;
loadbuf = buf;
/* Kernel images get decompressed later in bootm_load_os(). */
if (!fit_image_get_comp(fit, noffset, &comp) &&
comp != IH_COMP_NONE &&
!(image_type == IH_TYPE_KERNEL ||
image_type == IH_TYPE_KERNEL_NOLOAD ||
image_type == IH_TYPE_RAMDISK)) {
ulong max_decomp_len = len * 20;
if (load == data) {
loadbuf = malloc(max_decomp_len);
load = map_to_sysmem(loadbuf);
} else {
loadbuf = map_sysmem(load, max_decomp_len);
}
if (image_decomp(comp, load, data, image_type,
loadbuf, buf, len, max_decomp_len, &load_end)) {
printf("Error decompressing %s\n", prop_name);
return -ENOEXEC;
}
len = load_end - load;
} else if (load != data) {
loadbuf = map_sysmem(load, len);
memcpy(loadbuf, buf, len);
}
if (image_type == IH_TYPE_RAMDISK && comp != IH_COMP_NONE)
puts("WARNING: 'compression' nodes for ramdisks are deprecated,"
" please fix your .its file!\n");
/* verify that image data is a proper FDT blob */
if (image_type == IH_TYPE_FLATDT && fdt_check_header(loadbuf)) {
puts("Subimage data is not a FDT");
return -ENOEXEC;
}
bootstage_mark(bootstage_id + BOOTSTAGE_SUB_LOAD);
*datap = load;
*lenp = len;
if (fit_unamep)
*fit_unamep = (char *)fit_uname;
if (fit_uname_configp)
*fit_uname_configp = (char *)(fit_uname_config ? :
fit_base_uname_config);
return noffset;
} | 1186 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | do_i2c_crc | do_i2c_crc( struct cmd_tbl * cmdtp , int flag , int argc , char * const argv [ ]) | ['cmdtp', 'flag', 'argc'] | static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
ulong addr;
int alen;
int count;
uchar byte;
ulong crc;
ulong err;
int ret = 0;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
if (argc < 4)
return CMD_RET_USAGE;
/*
* Chip is always specified.
*/
chip = hextoul(argv[1], NULL);
/*
* Address is always specified.
*/
addr = hextoul(argv[2], NULL);
alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
if (alen > 3)
return CMD_RET_USAGE;
#if CONFIG_IS_ENABLED(DM_I2C)
ret = i2c_get_cur_bus_chip(chip, &dev);
if (!ret && alen != -1)
ret = i2c_set_chip_offset_len(dev, alen);
if (ret)
return i2c_report_err(ret, I2C_ERR_READ);
#endif
/*
* Count is always specified
*/
count = hextoul(argv[3], NULL);
printf ("CRC32 for %08lx ... %08lx ==> ", addr, addr + count - 1);
/*
* CRC a byte at a time. This is going to be slooow, but hey, the
* memories are small and slow too so hopefully nobody notices.
*/
crc = 0;
err = 0;
while (count-- > 0) {
#if CONFIG_IS_ENABLED(DM_I2C)
ret = dm_i2c_read(dev, addr, &byte, 1);
#else
ret = i2c_read(chip, addr, alen, &byte, 1);
#endif
if (ret)
err++;
crc = crc32(crc, &byte, 1);
addr++;
}
if (err > 0)
i2c_report_err(ret, I2C_ERR_READ);
else
printf ("%08lx\n", crc);
return 0;
} | 266 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | do_i2c_loop | do_i2c_loop( struct cmd_tbl * cmdtp , int flag , int argc , char * const argv [ ]) | ['cmdtp', 'flag', 'argc'] | static int do_i2c_loop(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
int alen;
uint addr;
uint length;
u_char bytes[16];
int delay;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
if (argc < 3)
return CMD_RET_USAGE;
/*
* Chip is always specified.
*/
chip = hextoul(argv[1], NULL);
/*
* Address is always specified.
*/
addr = hextoul(argv[2], NULL);
alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
if (alen > 3)
return CMD_RET_USAGE;
#if CONFIG_IS_ENABLED(DM_I2C)
ret = i2c_get_cur_bus_chip(chip, &dev);
if (!ret && alen != -1)
ret = i2c_set_chip_offset_len(dev, alen);
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
#endif
/*
* Length is the number of objects, not number of bytes.
*/
length = 1;
length = hextoul(argv[3], NULL);
if (length > sizeof(bytes))
length = sizeof(bytes);
/*
* The delay time (uSec) is optional.
*/
delay = 1000;
if (argc > 3)
delay = dectoul(argv[4], NULL);
/*
* Run the loop...
*/
while (1) {
#if CONFIG_IS_ENABLED(DM_I2C)
ret = dm_i2c_read(dev, addr, bytes, length);
#else
ret = i2c_read(chip, addr, alen, bytes, length);
#endif
if (ret)
i2c_report_err(ret, I2C_ERR_READ);
udelay(delay);
}
/* NOTREACHED */
return 0;
} | 253 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | do_i2c_md | do_i2c_md( struct cmd_tbl * cmdtp , int flag , int argc , char * const argv [ ]) | ['cmdtp', 'flag', 'argc'] | static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
uint addr, length;
int alen;
int j, nbytes, linebytes;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
/* We use the last specified parameters, unless new ones are
* entered.
*/
chip = i2c_dp_last_chip;
addr = i2c_dp_last_addr;
alen = i2c_dp_last_alen;
length = i2c_dp_last_length;
if (argc < 3)
return CMD_RET_USAGE;
if ((flag & CMD_FLAG_REPEAT) == 0) {
/*
* New command specified.
*/
/*
* I2C chip address
*/
chip = hextoul(argv[1], NULL);
/*
* I2C data address within the chip. This can be 1 or
* 2 bytes long. Some day it might be 3 bytes long :-).
*/
addr = hextoul(argv[2], NULL);
alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
if (alen > 3)
return CMD_RET_USAGE;
/*
* If another parameter, it is the length to display.
* Length is the number of objects, not number of bytes.
*/
if (argc > 3)
length = hextoul(argv[3], NULL);
}
#if CONFIG_IS_ENABLED(DM_I2C)
ret = i2c_get_cur_bus_chip(chip, &dev);
if (!ret && alen != -1)
ret = i2c_set_chip_offset_len(dev, alen);
if (ret)
return i2c_report_err(ret, I2C_ERR_READ);
#endif
/*
* Print the lines.
*
* We buffer all read data, so we can make sure data is read only
* once.
*/
nbytes = length;
do {
unsigned char linebuf[DISP_LINE_LEN];
unsigned char *cp;
linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
#if CONFIG_IS_ENABLED(DM_I2C)
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
#else
ret = i2c_read(chip, addr, alen, linebuf, linebytes);
#endif
if (ret)
return i2c_report_err(ret, I2C_ERR_READ);
else {
printf("%04x:", addr);
cp = linebuf;
for (j=0; j<linebytes; j++) {
printf(" %02x", *cp++);
addr++;
}
puts (" ");
cp = linebuf;
for (j=0; j<linebytes; j++) {
if ((*cp < 0x20) || (*cp > 0x7e))
puts (".");
else
printf("%c", *cp);
cp++;
}
putc ('\n');
}
nbytes -= linebytes;
} while (nbytes > 0);
i2c_dp_last_chip = chip;
i2c_dp_last_addr = addr;
i2c_dp_last_alen = alen;
i2c_dp_last_length = length;
return 0;
} | 393 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | do_i2c_mw | do_i2c_mw( struct cmd_tbl * cmdtp , int flag , int argc , char * const argv [ ]) | ['cmdtp', 'flag', 'argc'] | static int do_i2c_mw(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
ulong addr;
int alen;
uchar byte;
int count;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
if ((argc < 4) || (argc > 5))
return CMD_RET_USAGE;
/*
* Chip is always specified.
*/
chip = hextoul(argv[1], NULL);
/*
* Address is always specified.
*/
addr = hextoul(argv[2], NULL);
alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
if (alen > 3)
return CMD_RET_USAGE;
#if CONFIG_IS_ENABLED(DM_I2C)
ret = i2c_get_cur_bus_chip(chip, &dev);
if (!ret && alen != -1)
ret = i2c_set_chip_offset_len(dev, alen);
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
#endif
/*
* Value to write is always specified.
*/
byte = hextoul(argv[3], NULL);
/*
* Optional count
*/
if (argc == 5)
count = hextoul(argv[4], NULL);
else
count = 1;
while (count-- > 0) {
#if CONFIG_IS_ENABLED(DM_I2C)
ret = dm_i2c_write(dev, addr++, &byte, 1);
#else
ret = i2c_write(chip, addr++, alen, &byte, 1);
#endif
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
/*
* Wait for the write to complete. The write can take
* up to 10mSec (we allow a little more time).
*/
/*
* No write delay with FRAM devices.
*/
#if !defined(CONFIG_SYS_I2C_FRAM)
udelay(11000);
#endif
}
return 0;
} | 244 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | do_i2c_read | do_i2c_read( struct cmd_tbl * cmdtp , int flag , int argc , char * const argv [ ]) | ['cmdtp', 'flag', 'argc'] | static int do_i2c_read(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
uint devaddr, length;
int alen;
u_char *memaddr;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
if (argc != 5)
return CMD_RET_USAGE;
/*
* I2C chip address
*/
chip = hextoul(argv[1], NULL);
/*
* I2C data address within the chip. This can be 1 or
* 2 bytes long. Some day it might be 3 bytes long :-).
*/
devaddr = hextoul(argv[2], NULL);
alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
if (alen > 3)
return CMD_RET_USAGE;
/*
* Length is the number of objects, not number of bytes.
*/
length = hextoul(argv[3], NULL);
/*
* memaddr is the address where to store things in memory
*/
memaddr = (u_char *)hextoul(argv[4], NULL);
#if CONFIG_IS_ENABLED(DM_I2C)
ret = i2c_get_cur_bus_chip(chip, &dev);
if (!ret && alen != -1)
ret = i2c_set_chip_offset_len(dev, alen);
if (!ret)
ret = dm_i2c_read(dev, devaddr, memaddr, length);
#else
ret = i2c_read(chip, devaddr, alen, memaddr, length);
#endif
if (ret)
return i2c_report_err(ret, I2C_ERR_READ);
return 0;
} | 204 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | do_i2c_write | do_i2c_write( struct cmd_tbl * cmdtp , int flag , int argc , char * const argv [ ]) | ['cmdtp', 'flag', 'argc'] | static int do_i2c_write(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
uint devaddr, length;
int alen;
u_char *memaddr;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
struct dm_i2c_chip *i2c_chip;
#endif
if ((argc < 5) || (argc > 6))
return cmd_usage(cmdtp);
/*
* memaddr is the address where to store things in memory
*/
memaddr = (u_char *)hextoul(argv[1], NULL);
/*
* I2C chip address
*/
chip = hextoul(argv[2], NULL);
/*
* I2C data address within the chip. This can be 1 or
* 2 bytes long. Some day it might be 3 bytes long :-).
*/
devaddr = hextoul(argv[3], NULL);
alen = get_alen(argv[3], DEFAULT_ADDR_LEN);
if (alen > 3)
return cmd_usage(cmdtp);
/*
* Length is the number of bytes.
*/
length = hextoul(argv[4], NULL);
#if CONFIG_IS_ENABLED(DM_I2C)
ret = i2c_get_cur_bus_chip(chip, &dev);
if (!ret && alen != -1)
ret = i2c_set_chip_offset_len(dev, alen);
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
i2c_chip = dev_get_parent_plat(dev);
if (!i2c_chip)
return i2c_report_err(ret, I2C_ERR_WRITE);
#endif
if (argc == 6 && !strcmp(argv[5], "-s")) {
/*
* Write all bytes in a single I2C transaction. If the target
* device is an EEPROM, it is your responsibility to not cross
* a page boundary. No write delay upon completion, take this
* into account if linking commands.
*/
#if CONFIG_IS_ENABLED(DM_I2C)
i2c_chip->flags &= ~DM_I2C_CHIP_WR_ADDRESS;
ret = dm_i2c_write(dev, devaddr, memaddr, length);
#else
ret = i2c_write(chip, devaddr, alen, memaddr, length);
#endif
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
} else {
/*
* Repeated addressing - perform <length> separate
* write transactions of one byte each
*/
while (length-- > 0) {
#if CONFIG_IS_ENABLED(DM_I2C)
i2c_chip->flags |= DM_I2C_CHIP_WR_ADDRESS;
ret = dm_i2c_write(dev, devaddr++, memaddr++, 1);
#else
ret = i2c_write(chip, devaddr++, alen, memaddr++, 1);
#endif
if (ret)
return i2c_report_err(ret, I2C_ERR_WRITE);
/*
* No write delay with FRAM devices.
*/
#if !defined(CONFIG_SYS_I2C_FRAM)
udelay(11000);
#endif
}
}
return 0;
} | 342 | True | 1 |
CVE-2022-34835 | 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://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://source.denx.de/u-boot/u-boot/-/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'name': 'https://lists.denx.de/pipermail/u-boot/2022-June/486113.html', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'name': 'https://github.com/u-boot/u-boot/commit/8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:2022.07:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:denx:u-boot:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2022.07', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Das U-Boot through 2022.07-rc5, an integer signedness error and resultant stack-based buffer overflow in the "i2c md" command enables the corruption of the return address pointer of the do_i2c_md function.'}] | 2022-07-09T02:28Z | 2022-06-30T00: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 | Nicolas Iooss | 2022-06-10 14:50:25+00:00 | i2c: fix stack buffer overflow vulnerability in i2c md command
When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:
int nbytes = length;
#define DISP_LINE_LEN 16
int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
ret = dm_i2c_read(dev, addr, linebuf, linebytes);
On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.
The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.
Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.
Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]> | 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409 | False | u-boot/u-boot | "Das U-Boot" Source Tree | 2014-11-12 13:29:02 | 2022-08-27 22:15:04 | null | u-boot | 2315.0 | 2533.0 | get_alen | get_alen( char * arg , int default_len) | ['arg', 'default_len'] | static uint get_alen(char *arg, int default_len)
{
int j;
int alen;
alen = default_len;
for (j = 0; j < 8; j++) {
if (arg[j] == '.') {
alen = arg[j+1] - '0';
break;
} else if (arg[j] == '\0')
break;
}
return alen;
} | 75 | True | 1 |
CVE-2019-11411 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/da632ca08f240590d2dec786722ed08486ce1be6', 'name': 'https://github.com/ccxvii/mujs/commit/da632ca08f240590d2dec786722ed08486ce1be6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700938', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700938', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?da632ca08f240590d2dec786722ed08486ce1be6', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?da632ca08f240590d2dec786722ed08486ce1be6', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. The Number#toFixed() and numtostr implementations in jsnumber.c have a stack-based buffer overflow.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Tor Andersson | 2019-04-02 10:52:44+02:00 | Bug 700938: Fix stack overflow in numtostr as used by Number#toFixed().
32 is not enough to fit sprintf("%.20f", 1e20).
We need at least 43 bytes to fit that format.
Bump the static buffer size. | da632ca08f240590d2dec786722ed08486ce1be6 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | Np_toString | Np_toString( js_State * J) | ['J'] | static void Np_toString(js_State *J)
{
char buf[32];
js_Object *self = js_toobject(J, 0);
int radix = js_isundefined(J, 1) ? 10 : js_tointeger(J, 1);
if (self->type != JS_CNUMBER)
js_typeerror(J, "not a number");
if (radix == 10) {
js_pushstring(J, jsV_numbertostring(J, buf, self->u.number));
return;
}
if (radix < 2 || radix > 36)
js_rangeerror(J, "invalid radix");
/* lame number to string conversion for any radix from 2 to 36 */
{
static const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
char buf[100];
double number = self->u.number;
int sign = self->u.number < 0;
js_Buffer *sb = NULL;
uint64_t u, limit = ((uint64_t)1<<52);
int ndigits, exp, point;
if (number == 0) { js_pushstring(J, "0"); return; }
if (isnan(number)) { js_pushstring(J, "NaN"); return; }
if (isinf(number)) { js_pushstring(J, sign ? "-Infinity" : "Infinity"); return; }
if (sign)
number = -number;
/* fit as many digits as we want in an int */
exp = 0;
while (number * pow(radix, exp) > limit)
--exp;
while (number * pow(radix, exp+1) < limit)
++exp;
u = number * pow(radix, exp) + 0.5;
/* trim trailing zeros */
while (u > 0 && (u % radix) == 0) {
u /= radix;
--exp;
}
/* serialize digits */
ndigits = 0;
while (u > 0) {
buf[ndigits++] = digits[u % radix];
u /= radix;
}
point = ndigits - exp;
if (js_try(J)) {
js_free(J, sb);
js_throw(J);
}
if (sign)
js_putc(J, &sb, '-');
if (point <= 0) {
js_putc(J, &sb, '0');
js_putc(J, &sb, '.');
while (point++ < 0)
js_putc(J, &sb, '0');
while (ndigits-- > 0)
js_putc(J, &sb, buf[ndigits]);
} else {
while (ndigits-- > 0) {
js_putc(J, &sb, buf[ndigits]);
if (--point == 0 && ndigits > 0)
js_putc(J, &sb, '.');
}
while (point-- > 0)
js_putc(J, &sb, '0');
}
js_putc(J, &sb, 0);
js_pushstring(J, sb->s);
js_endtry(J);
js_free(J, sb);
}
} | 542 | True | 1 |
CVE-2019-11411 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/da632ca08f240590d2dec786722ed08486ce1be6', 'name': 'https://github.com/ccxvii/mujs/commit/da632ca08f240590d2dec786722ed08486ce1be6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700938', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700938', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?da632ca08f240590d2dec786722ed08486ce1be6', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?da632ca08f240590d2dec786722ed08486ce1be6', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. The Number#toFixed() and numtostr implementations in jsnumber.c have a stack-based buffer overflow.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Tor Andersson | 2019-04-02 10:52:44+02:00 | Bug 700938: Fix stack overflow in numtostr as used by Number#toFixed().
32 is not enough to fit sprintf("%.20f", 1e20).
We need at least 43 bytes to fit that format.
Bump the static buffer size. | da632ca08f240590d2dec786722ed08486ce1be6 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | numtostr | numtostr( js_State * J , const char * fmt , int w , double n) | ['J', 'fmt', 'w', 'n'] | static void numtostr(js_State *J, const char *fmt, int w, double n)
{
char buf[32], *e;
sprintf(buf, fmt, w, n);
e = strchr(buf, 'e');
if (e) {
int exp = atoi(e+1);
sprintf(e, "e%+d", exp);
}
js_pushstring(J, buf);
} | 80 | True | 1 |
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | Rp_test | Rp_test( js_State * J) | ['J'] | static void Rp_test(js_State *J)
{
js_Regexp *re;
const char *text;
int opts;
Resub m;
re = js_toregexp(J, 0);
text = js_tostring(J, 1);
opts = 0;
if (re->flags & JS_REGEXP_G) {
if (re->last > strlen(text)) {
re->last = 0;
js_pushboolean(J, 0);
return;
}
if (re->last > 0) {
text += re->last;
opts |= REG_NOTBOL;
}
}
if (!js_regexec(re->prog, text, &m, opts)) {
if (re->flags & JS_REGEXP_G)
re->last = re->last + (m.sub[0].ep - text);
js_pushboolean(J, 1);
return;
}
if (re->flags & JS_REGEXP_G)
re->last = 0;
js_pushboolean(J, 0);
} | 181 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | js_RegExp_prototype_exec | js_RegExp_prototype_exec( js_State * J , js_Regexp * re , const char * text) | ['J', 're', 'text'] | void js_RegExp_prototype_exec(js_State *J, js_Regexp *re, const char *text)
{
int i;
int opts;
Resub m;
opts = 0;
if (re->flags & JS_REGEXP_G) {
if (re->last > strlen(text)) {
re->last = 0;
js_pushnull(J);
return;
}
if (re->last > 0) {
text += re->last;
opts |= REG_NOTBOL;
}
}
if (!js_regexec(re->prog, text, &m, opts)) {
js_newarray(J);
js_pushstring(J, text);
js_setproperty(J, -2, "input");
js_pushnumber(J, js_utfptrtoidx(text, m.sub[0].sp));
js_setproperty(J, -2, "index");
for (i = 0; i < m.nsub; ++i) {
js_pushlstring(J, m.sub[i].sp, m.sub[i].ep - m.sub[i].sp);
js_setindex(J, -2, i);
}
if (re->flags & JS_REGEXP_G)
re->last = re->last + (m.sub[0].ep - text);
return;
}
if (re->flags & JS_REGEXP_G)
re->last = 0;
js_pushnull(J);
} | 265 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | Sp_match | Sp_match( js_State * J) | ['J'] | static void Sp_match(js_State *J)
{
js_Regexp *re;
const char *text;
int len;
const char *a, *b, *c, *e;
Resub m;
text = checkstring(J, 0);
if (js_isregexp(J, 1))
js_copy(J, 1);
else if (js_isundefined(J, 1))
js_newregexp(J, "", 0);
else
js_newregexp(J, js_tostring(J, 1), 0);
re = js_toregexp(J, -1);
if (!(re->flags & JS_REGEXP_G)) {
js_RegExp_prototype_exec(J, re, text);
return;
}
re->last = 0;
js_newarray(J);
len = 0;
a = text;
e = text + strlen(text);
while (a <= e) {
if (js_regexec(re->prog, a, &m, a > text ? REG_NOTBOL : 0))
break;
b = m.sub[0].sp;
c = m.sub[0].ep;
js_pushlstring(J, b, c - b);
js_setindex(J, -2, len++);
a = c;
if (c - b == 0)
++a;
}
if (len == 0) {
js_pop(J, 1);
js_pushnull(J);
}
} | 269 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | Sp_replace_regexp | Sp_replace_regexp( js_State * J) | ['J'] | static void Sp_replace_regexp(js_State *J)
{
js_Regexp *re;
const char *source, *s, *r;
js_Buffer *sb = NULL;
int n, x;
Resub m;
source = checkstring(J, 0);
re = js_toregexp(J, 1);
if (js_regexec(re->prog, source, &m, 0)) {
js_copy(J, 0);
return;
}
re->last = 0;
loop:
s = m.sub[0].sp;
n = m.sub[0].ep - m.sub[0].sp;
if (js_iscallable(J, 2)) {
js_copy(J, 2);
js_pushundefined(J);
for (x = 0; m.sub[x].sp; ++x) /* arg 0..x: substring and subexps that matched */
js_pushlstring(J, m.sub[x].sp, m.sub[x].ep - m.sub[x].sp);
js_pushnumber(J, s - source); /* arg x+2: offset within search string */
js_copy(J, 0); /* arg x+3: search string */
js_call(J, 2 + x);
r = js_tostring(J, -1);
js_putm(J, &sb, source, s);
js_puts(J, &sb, r);
js_pop(J, 1);
} else {
r = js_tostring(J, 2);
js_putm(J, &sb, source, s);
while (*r) {
if (*r == '$') {
switch (*(++r)) {
case 0: --r; /* end of string; back up */
/* fallthrough */
case '$': js_putc(J, &sb, '$'); break;
case '`': js_putm(J, &sb, source, s); break;
case '\'': js_puts(J, &sb, s + n); break;
case '&':
js_putm(J, &sb, s, s + n);
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
x = *r - '0';
if (r[1] >= '0' && r[1] <= '9')
x = x * 10 + *(++r) - '0';
if (x > 0 && x < m.nsub) {
js_putm(J, &sb, m.sub[x].sp, m.sub[x].ep);
} else {
js_putc(J, &sb, '$');
if (x > 10) {
js_putc(J, &sb, '0' + x / 10);
js_putc(J, &sb, '0' + x % 10);
} else {
js_putc(J, &sb, '0' + x);
}
}
break;
default:
js_putc(J, &sb, '$');
js_putc(J, &sb, *r);
break;
}
++r;
} else {
js_putc(J, &sb, *r++);
}
}
}
if (re->flags & JS_REGEXP_G) {
source = m.sub[0].ep;
if (n == 0) {
if (*source)
js_putc(J, &sb, *source++);
else
goto end;
}
if (!js_regexec(re->prog, source, &m, REG_NOTBOL))
goto loop;
}
end:
js_puts(J, &sb, s + n);
js_putc(J, &sb, 0);
if (js_try(J)) {
js_free(J, sb);
js_throw(J);
}
js_pushstring(J, sb ? sb->s : "");
js_endtry(J);
js_free(J, sb);
} | 738 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | Sp_search | Sp_search( js_State * J) | ['J'] | static void Sp_search(js_State *J)
{
js_Regexp *re;
const char *text;
Resub m;
text = checkstring(J, 0);
if (js_isregexp(J, 1))
js_copy(J, 1);
else if (js_isundefined(J, 1))
js_newregexp(J, "", 0);
else
js_newregexp(J, js_tostring(J, 1), 0);
re = js_toregexp(J, -1);
if (!js_regexec(re->prog, text, &m, 0))
js_pushnumber(J, js_utfptrtoidx(text, m.sub[0].sp));
else
js_pushnumber(J, -1);
} | 134 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | Sp_split_regexp | Sp_split_regexp( js_State * J) | ['J'] | static void Sp_split_regexp(js_State *J)
{
js_Regexp *re;
const char *text;
int limit, len, k;
const char *p, *a, *b, *c, *e;
Resub m;
text = checkstring(J, 0);
re = js_toregexp(J, 1);
limit = js_isdefined(J, 2) ? js_tointeger(J, 2) : 1 << 30;
js_newarray(J);
len = 0;
e = text + strlen(text);
/* splitting the empty string */
if (e == text) {
if (js_regexec(re->prog, text, &m, 0)) {
if (len == limit) return;
js_pushliteral(J, "");
js_setindex(J, -2, 0);
}
return;
}
p = a = text;
while (a < e) {
if (js_regexec(re->prog, a, &m, a > text ? REG_NOTBOL : 0))
break; /* no match */
b = m.sub[0].sp;
c = m.sub[0].ep;
/* empty string at end of last match */
if (b == p) {
++a;
continue;
}
if (len == limit) return;
js_pushlstring(J, p, b - p);
js_setindex(J, -2, len++);
for (k = 1; k < m.nsub; ++k) {
if (len == limit) return;
js_pushlstring(J, m.sub[k].sp, m.sub[k].ep - m.sub[k].sp);
js_setindex(J, -2, len++);
}
a = p = c;
}
if (len == limit) return;
js_pushstring(J, p);
js_setindex(J, -2, len);
} | 356 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | match | match( Reinst * pc , const char * sp , const char * bol , int flags , Resub * out) | ['pc', 'sp', 'bol', 'flags', 'out'] | static int match(Reinst *pc, const char *sp, const char *bol, int flags, Resub *out)
{
Resub scratch;
int i;
Rune c;
for (;;) {
switch (pc->opcode) {
case I_END:
return 1;
case I_JUMP:
pc = pc->x;
break;
case I_SPLIT:
scratch = *out;
if (match(pc->x, sp, bol, flags, &scratch)) {
*out = scratch;
return 1;
}
pc = pc->y;
break;
case I_PLA:
if (!match(pc->x, sp, bol, flags, out))
return 0;
pc = pc->y;
break;
case I_NLA:
scratch = *out;
if (match(pc->x, sp, bol, flags, &scratch))
return 0;
pc = pc->y;
break;
case I_ANYNL:
sp += chartorune(&c, sp);
if (c == 0)
return 0;
pc = pc + 1;
break;
case I_ANY:
sp += chartorune(&c, sp);
if (c == 0)
return 0;
if (isnewline(c))
return 0;
pc = pc + 1;
break;
case I_CHAR:
sp += chartorune(&c, sp);
if (c == 0)
return 0;
if (flags & REG_ICASE)
c = canon(c);
if (c != pc->c)
return 0;
pc = pc + 1;
break;
case I_CCLASS:
sp += chartorune(&c, sp);
if (c == 0)
return 0;
if (flags & REG_ICASE) {
if (!incclasscanon(pc->cc, canon(c)))
return 0;
} else {
if (!incclass(pc->cc, c))
return 0;
}
pc = pc + 1;
break;
case I_NCCLASS:
sp += chartorune(&c, sp);
if (c == 0)
return 0;
if (flags & REG_ICASE) {
if (incclasscanon(pc->cc, canon(c)))
return 0;
} else {
if (incclass(pc->cc, c))
return 0;
}
pc = pc + 1;
break;
case I_REF:
i = out->sub[pc->n].ep - out->sub[pc->n].sp;
if (flags & REG_ICASE) {
if (strncmpcanon(sp, out->sub[pc->n].sp, i))
return 0;
} else {
if (strncmp(sp, out->sub[pc->n].sp, i))
return 0;
}
if (i > 0)
sp += i;
pc = pc + 1;
break;
case I_BOL:
if (sp == bol && !(flags & REG_NOTBOL)) {
pc = pc + 1;
break;
}
if (flags & REG_NEWLINE) {
if (sp > bol && isnewline(sp[-1])) {
pc = pc + 1;
break;
}
}
return 0;
case I_EOL:
if (*sp == 0) {
pc = pc + 1;
break;
}
if (flags & REG_NEWLINE) {
if (isnewline(*sp)) {
pc = pc + 1;
break;
}
}
return 0;
case I_WORD:
i = sp > bol && iswordchar(sp[-1]);
i ^= iswordchar(sp[0]);
if (!i)
return 0;
pc = pc + 1;
break;
case I_NWORD:
i = sp > bol && iswordchar(sp[-1]);
i ^= iswordchar(sp[0]);
if (i)
return 0;
pc = pc + 1;
break;
case I_LPAR:
out->sub[pc->n].sp = sp;
pc = pc + 1;
break;
case I_RPAR:
out->sub[pc->n].ep = sp;
pc = pc + 1;
break;
default:
return 0;
}
}
} | 802 | True | 1 |
|
CVE-2019-11413 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'https://github.com/ccxvii/mujs/commit/00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=700937', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Permissions Required', 'Vendor Advisory']}, {'url': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'name': 'http://www.ghostscript.com/cgi-bin/findgit.cgi?00d4606c3baf813b7b1c176823b2729bf51002a2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/108093', 'name': '108093', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://security.gentoo.org/glsa/202007-52', 'name': 'GLSA-202007-52', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/3RQXMWEOWCGLOLFBQSXBM3MBN33T4I5H/', 'name': 'FEDORA-2020-496ab4615a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MFCRO74ORRIVWNVAX2MAMRY3THCTWLQI/', 'name': 'FEDORA-2020-f3d08b9b3a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/67PMOZV4DLVL2KGU2SV724QL7Y4PKWKU/', 'name': 'FEDORA-2020-53773f4954', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Artifex MuJS 1.0.5. It has unlimited recursion because the match function in regexp.c lacks a depth check.'}] | 2020-11-10T03:15Z | 2019-04-22T11:29Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Tor Andersson | 2019-04-04 12:06:56+02:00 | Bug 700937: Limit recursion in regexp matcher.
Also handle negative return code as an error in the JS bindings. | 00d4606c3baf813b7b1c176823b2729bf51002a2 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | regexec | regexec( Reprog * prog , const char * sp , Resub * sub , int eflags) | ['prog', 'sp', 'sub', 'eflags'] | int regexec(Reprog *prog, const char *sp, Resub *sub, int eflags)
{
Resub scratch;
int i;
if (!sub)
sub = &scratch;
sub->nsub = prog->nsub;
for (i = 0; i < MAXSUB; ++i)
sub->sub[i].sp = sub->sub[i].ep = NULL;
return !match(prog->start, sp, sp, prog->flags | eflags, sub);
} | 98 | True | 1 |
|
CVE-2021-45005 | 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/ccxvii/mujs/commit/df8559e7bdbc6065276e786217eeee70f28fce66', 'name': 'https://github.com/ccxvii/mujs/commit/df8559e7bdbc6065276e786217eeee70f28fce66', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=704749', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=704749', 'refsource': 'MISC', 'tags': ['Permissions Required']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.1.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Artifex MuJS v1.1.3 was discovered to contain a heap buffer overflow which is caused by conflicting JumpList of nested try/finally statements.'}] | 2022-02-22T20:37Z | 2022-02-14T22: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 | Tor Andersson | 2021-12-06 11:47:31+01:00 | Bug 704749: Clear jump list after patching jump addresses.
Since we can emit a statement multiple times when compiling try/finally
we have to use a new patch list for each instance. | df8559e7bdbc6065276e786217eeee70f28fce66 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | cstm | cstm( JF , js_Ast * stm) | ['JF', 'stm'] | static void cstm(JF, js_Ast *stm)
{
js_Ast *target;
int loop, cont, then, end;
emitline(J, F, stm);
switch (stm->type) {
case AST_FUNDEC:
break;
case STM_BLOCK:
cstmlist(J, F, stm->a);
break;
case STM_EMPTY:
if (F->script) {
emitline(J, F, stm);
emit(J, F, OP_POP);
emit(J, F, OP_UNDEF);
}
break;
case STM_VAR:
cvarinit(J, F, stm->a);
break;
case STM_IF:
if (stm->c) {
cexp(J, F, stm->a);
emitline(J, F, stm);
then = emitjump(J, F, OP_JTRUE);
cstm(J, F, stm->c);
emitline(J, F, stm);
end = emitjump(J, F, OP_JUMP);
label(J, F, then);
cstm(J, F, stm->b);
label(J, F, end);
} else {
cexp(J, F, stm->a);
emitline(J, F, stm);
end = emitjump(J, F, OP_JFALSE);
cstm(J, F, stm->b);
label(J, F, end);
}
break;
case STM_DO:
loop = here(J, F);
cstm(J, F, stm->a);
cont = here(J, F);
cexp(J, F, stm->b);
emitline(J, F, stm);
emitjumpto(J, F, OP_JTRUE, loop);
labeljumps(J, F, stm->jumps, here(J,F), cont);
break;
case STM_WHILE:
loop = here(J, F);
cexp(J, F, stm->a);
emitline(J, F, stm);
end = emitjump(J, F, OP_JFALSE);
cstm(J, F, stm->b);
emitline(J, F, stm);
emitjumpto(J, F, OP_JUMP, loop);
label(J, F, end);
labeljumps(J, F, stm->jumps, here(J,F), loop);
break;
case STM_FOR:
case STM_FOR_VAR:
if (stm->type == STM_FOR_VAR) {
cvarinit(J, F, stm->a);
} else {
if (stm->a) {
cexp(J, F, stm->a);
emit(J, F, OP_POP);
}
}
loop = here(J, F);
if (stm->b) {
cexp(J, F, stm->b);
emitline(J, F, stm);
end = emitjump(J, F, OP_JFALSE);
} else {
end = 0;
}
cstm(J, F, stm->d);
cont = here(J, F);
if (stm->c) {
cexp(J, F, stm->c);
emit(J, F, OP_POP);
}
emitline(J, F, stm);
emitjumpto(J, F, OP_JUMP, loop);
if (end)
label(J, F, end);
labeljumps(J, F, stm->jumps, here(J,F), cont);
break;
case STM_FOR_IN:
case STM_FOR_IN_VAR:
cexp(J, F, stm->b);
emitline(J, F, stm);
emit(J, F, OP_ITERATOR);
loop = here(J, F);
{
emitline(J, F, stm);
emit(J, F, OP_NEXTITER);
end = emitjump(J, F, OP_JFALSE);
cassignforin(J, F, stm);
if (F->script) {
emit(J, F, OP_ROT2);
cstm(J, F, stm->c);
emit(J, F, OP_ROT2);
} else {
cstm(J, F, stm->c);
}
emitline(J, F, stm);
emitjumpto(J, F, OP_JUMP, loop);
}
label(J, F, end);
labeljumps(J, F, stm->jumps, here(J,F), loop);
break;
case STM_SWITCH:
cswitch(J, F, stm->a, stm->b);
labeljumps(J, F, stm->jumps, here(J,F), 0);
break;
case STM_LABEL:
cstm(J, F, stm->b);
/* skip consecutive labels */
while (stm->type == STM_LABEL)
stm = stm->b;
/* loops and switches have already been labelled */
if (!isloop(stm->type) && stm->type != STM_SWITCH)
labeljumps(J, F, stm->jumps, here(J,F), 0);
break;
case STM_BREAK:
if (stm->a) {
checkfutureword(J, F, stm->a);
target = breaktarget(J, F, stm->parent, stm->a->string);
if (!target)
jsC_error(J, stm, "break label '%s' not found", stm->a->string);
} else {
target = breaktarget(J, F, stm->parent, NULL);
if (!target)
jsC_error(J, stm, "unlabelled break must be inside loop or switch");
}
cexit(J, F, STM_BREAK, stm, target);
emitline(J, F, stm);
addjump(J, F, STM_BREAK, target, emitjump(J, F, OP_JUMP));
break;
case STM_CONTINUE:
if (stm->a) {
checkfutureword(J, F, stm->a);
target = continuetarget(J, F, stm->parent, stm->a->string);
if (!target)
jsC_error(J, stm, "continue label '%s' not found", stm->a->string);
} else {
target = continuetarget(J, F, stm->parent, NULL);
if (!target)
jsC_error(J, stm, "continue must be inside loop");
}
cexit(J, F, STM_CONTINUE, stm, target);
emitline(J, F, stm);
addjump(J, F, STM_CONTINUE, target, emitjump(J, F, OP_JUMP));
break;
case STM_RETURN:
if (stm->a)
cexp(J, F, stm->a);
else
emit(J, F, OP_UNDEF);
target = returntarget(J, F, stm->parent);
if (!target)
jsC_error(J, stm, "return not in function");
cexit(J, F, STM_RETURN, stm, target);
emitline(J, F, stm);
emit(J, F, OP_RETURN);
break;
case STM_THROW:
cexp(J, F, stm->a);
emitline(J, F, stm);
emit(J, F, OP_THROW);
break;
case STM_WITH:
F->lightweight = 0;
if (F->strict)
jsC_error(J, stm->a, "'with' statements are not allowed in strict mode");
cexp(J, F, stm->a);
emitline(J, F, stm);
emit(J, F, OP_WITH);
cstm(J, F, stm->b);
emitline(J, F, stm);
emit(J, F, OP_ENDWITH);
break;
case STM_TRY:
emitline(J, F, stm);
if (stm->b && stm->c) {
F->lightweight = 0;
if (stm->d)
ctrycatchfinally(J, F, stm->a, stm->b, stm->c, stm->d);
else
ctrycatch(J, F, stm->a, stm->b, stm->c);
} else {
ctryfinally(J, F, stm->a, stm->d);
}
break;
case STM_DEBUGGER:
emitline(J, F, stm);
emit(J, F, OP_DEBUGGER);
break;
default:
if (F->script) {
emitline(J, F, stm);
emit(J, F, OP_POP);
cexp(J, F, stm);
} else {
cexp(J, F, stm);
emitline(J, F, stm);
emit(J, F, OP_POP);
}
break;
}
} | 1648 | True | 1 |
CVE-2021-45005 | 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/ccxvii/mujs/commit/df8559e7bdbc6065276e786217eeee70f28fce66', 'name': 'https://github.com/ccxvii/mujs/commit/df8559e7bdbc6065276e786217eeee70f28fce66', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.ghostscript.com/show_bug.cgi?id=704749', 'name': 'https://bugs.ghostscript.com/show_bug.cgi?id=704749', 'refsource': 'MISC', 'tags': ['Permissions Required']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:artifex:mujs:1.1.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Artifex MuJS v1.1.3 was discovered to contain a heap buffer overflow which is caused by conflicting JumpList of nested try/finally statements.'}] | 2022-02-22T20:37Z | 2022-02-14T22: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 | Tor Andersson | 2021-12-06 11:47:31+01:00 | Bug 704749: Clear jump list after patching jump addresses.
Since we can emit a statement multiple times when compiling try/finally
we have to use a new patch list for each instance. | df8559e7bdbc6065276e786217eeee70f28fce66 | False | ccxvii/mujs | An embeddable Javascript interpreter in C. | 2013-12-23 18:35:20 | 2022-08-23 09:17:21 | http://mujs.com/ | ccxvii | 633.0 | 76.0 | labeljumps | labeljumps( JF , js_JumpList * jump , int baddr , int caddr) | ['JF', 'jump', 'baddr', 'caddr'] | static void labeljumps(JF, js_JumpList *jump, int baddr, int caddr)
{
while (jump) {
if (jump->type == STM_BREAK)
labelto(J, F, jump->inst, baddr);
if (jump->type == STM_CONTINUE)
labelto(J, F, jump->inst, caddr);
jump = jump->next;
}
} | 70 | True | 1 |
CVE-2020-19498 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/strukturag/libheif/commit/2710c930918609caaf0a664e9c7bc3dce05d5b58', 'name': 'https://github.com/strukturag/libheif/commit/2710c930918609caaf0a664e9c7bc3dce05d5b58', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/strukturag/libheif/issues/139', 'name': 'https://github.com/strukturag/libheif/issues/139', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:struktur:libheif:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Floating point exception in function Fraction in libheif 1.4.0, allows attackers to cause a Denial of Service or possibly other unspecified impacts.'}] | 2021-07-30T15:27Z | 2021-07-21T18: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 | Dirk Farin | 2019-08-02 17:37:19+02:00 | force fraction to a limited resolution to finally solve those pesky numerical edge cases | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | False | strukturag/libheif | libheif is an HEIF and AVIF file format decoder and encoder. | 2017-12-21 14:06:21 | 2022-08-22 06:13:08 | http://www.libheif.org | strukturag | 1047.0 | 198.0 | Fraction::Fraction | Fraction::Fraction( int32_t num , int32_t den) | ['num', 'den'] | Fraction::Fraction(int32_t num,int32_t den)
{
int32_t g = gcd(num, den);
// these strange tests are for catching the case that we divide -2147483648 by -1,
// which would exceed the maximum positive value by one.
if (num == std::numeric_limits<int32_t>::min() && g == -1) {
num++;
}
if (den == std::numeric_limits<int32_t>::min() && g == -1) {
den++;
}
numerator = num / g;
denominator = den / g;
// Reduce resolution of fraction until we are in a safe range.
// We need this as adding fractions may lead to very large denominators
// (e.g. 0x10000 * 0x10000 > 0x100000000 -> overflow, leading to integer 0)
while (denominator > MAX_FRACTION_DENOMINATOR) {
numerator >>= 1;
denominator >>= 1;
}
} | 100 | True | 1 |
CVE-2020-19498 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/strukturag/libheif/commit/2710c930918609caaf0a664e9c7bc3dce05d5b58', 'name': 'https://github.com/strukturag/libheif/commit/2710c930918609caaf0a664e9c7bc3dce05d5b58', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/strukturag/libheif/issues/139', 'name': 'https://github.com/strukturag/libheif/issues/139', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:struktur:libheif:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Floating point exception in function Fraction in libheif 1.4.0, allows attackers to cause a Denial of Service or possibly other unspecified impacts.'}] | 2021-07-30T15:27Z | 2021-07-21T18: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 | Dirk Farin | 2019-08-02 17:37:19+02:00 | force fraction to a limited resolution to finally solve those pesky numerical edge cases | 2710c930918609caaf0a664e9c7bc3dce05d5b58 | False | strukturag/libheif | libheif is an HEIF and AVIF file format decoder and encoder. | 2017-12-21 14:06:21 | 2022-08-22 06:13:08 | http://www.libheif.org | strukturag | 1047.0 | 198.0 | gcd | gcd( int a , int b) | ['a', 'b'] | static int32_t gcd(int a, int b)
{
if (a == 0 && b == 0) {
return 1;
}
if (a == 0) return b;
if (b == 0) return a;
int32_t h;
do {
h = a % b;
a = b;
b = h;
} while (b != 0);
return a;
} | 73 | True | 1 |
CVE-2019-11502 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.openwall.com/lists/oss-security/2019/04/18/4', 'name': 'https://www.openwall.com/lists/oss-security/2019/04/18/4', 'refsource': 'MISC', 'tags': ['Mailing List', 'Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/snapcore/snapd/commit/bdbfeebef03245176ae0dc323392bb0522a339b1', 'name': 'https://github.com/snapcore/snapd/commit/bdbfeebef03245176ae0dc323392bb0522a339b1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/04/25/7', 'name': '[oss-security] 20190425 Re: Security issues in snapcraft snap-confine set*id binary', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:canonical:snapd:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.38', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'snap-confine in snapd before 2.38 incorrectly set the ownership of a snap application to the uid and gid of the first calling user. Consequently, that user had unintended access to a private /tmp directory.'}] | 2019-05-02T13:35Z | 2019-04-24T21:29Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | Zygmunt Krynicki | 2019-03-04 18:40:11+01:00 | cmd/snap-confine: chown private /tmp parent to root.root
When snap-confine creates a private /tmp directory for a given snap it
first creates a temporary directory in /tmp/ named after the snap, along
with a random name. Inside that directory it creates a /tmp directory
with permissions appropriate for a future /tmp, namely 1777.
Up until recently the that directory was owned by the user who first
invoked snap-confine. Since the directory is reused by all the users on
the system this logic makes no sense.
This patch changes the related logic so that the private /tmp directory
is owned by root, just like the real one.
Signed-off-by: Zygmunt Krynicki <[email protected]> | bdbfeebef03245176ae0dc323392bb0522a339b1 | False | snapcore/snapd | The snapd and snap tools enable systems to work with .snap files. | 2015-10-21 11:51:46 | 2022-08-27 09:28:21 | snapcore | 1664.0 | 485.0 | setup_private_mount | setup_private_mount( const char * snap_name) | ['snap_name'] | static void setup_private_mount(const char *snap_name)
{
uid_t uid = getuid();
gid_t gid = getgid();
char tmpdir[MAX_BUF] = { 0 };
// Create a 0700 base directory, this is the base dir that is
// protected from other users.
//
// Under that basedir, we put a 1777 /tmp dir that is then bind
// mounted for the applications to use
sc_must_snprintf(tmpdir, sizeof(tmpdir), "/tmp/snap.%s_XXXXXX", snap_name);
if (mkdtemp(tmpdir) == NULL) {
die("cannot create temporary directory essential for private /tmp");
}
// now we create a 1777 /tmp inside our private dir
mode_t old_mask = umask(0);
char *d = sc_strdup(tmpdir);
sc_must_snprintf(tmpdir, sizeof(tmpdir), "%s/tmp", d);
free(d);
if (mkdir(tmpdir, 01777) != 0) {
die("cannot create temporary directory for private /tmp");
}
umask(old_mask);
// chdir to '/' since the mount won't apply to the current directory
char *pwd = get_current_dir_name();
if (pwd == NULL)
die("cannot get current working directory");
if (chdir("/") != 0)
die("cannot change directory to '/'");
// MS_BIND is there from linux 2.4
sc_do_mount(tmpdir, "/tmp", NULL, MS_BIND, NULL);
// MS_PRIVATE needs linux > 2.6.11
sc_do_mount("none", "/tmp", NULL, MS_PRIVATE, NULL);
// do the chown after the bind mount to avoid potential shenanigans
if (chown("/tmp/", uid, gid) < 0) {
die("cannot change ownership of /tmp");
}
// chdir to original directory
if (chdir(pwd) != 0)
die("cannot change current working directory to the original directory");
free(pwd);
} | 220 | True | 1 |
||
CVE-2019-11937 | 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/facebook/mcrouter/commit/97e033b3bb0cb16b61bf49f0dc7f311a3e0edd1b', 'name': 'https://github.com/facebook/mcrouter/commit/97e033b3bb0cb16b61bf49f0dc7f311a3e0edd1b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://www.facebook.com/security/advisories/cve-2019-11937', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11937', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebook/mcrouter/releases/tag/v0.41.0-release', 'name': 'https://github.com/facebook/mcrouter/releases/tag/v0.41.0-release', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:mcrouter:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.41.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Mcrouter prior to v0.41.0, a large struct input provided to the Carbon protocol reader could result in stack exhaustion and denial of service.'}] | 2020-08-24T17:37Z | 2019-12-04T16:15Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Ted Reed | 2019-11-04 07:02:54-08:00 | Attempt to make CarbonProtocolReader::skip tail recursive
Reviewed By: edenzik
Differential Revision: D17967570
fbshipit-source-id: fdc32e190a521349c7c8f4d6081902fa18eb0284 | 97e033b3bb0cb16b61bf49f0dc7f311a3e0edd1b | False | facebook/mcrouter | Mcrouter is a memcached protocol router for scaling memcached deployments. | 2014-01-24 17:42:42 | 2022-08-27 01:37:58 | facebook | 3071.0 | 516.0 | carbon::CarbonProtocolReader::skip | carbon::CarbonProtocolReader::skip( const FieldType ft) | ['ft'] | void CarbonProtocolReader::skip(const FieldType ft) {
switch (ft) {
case FieldType::True:
case FieldType::False: {
break;
}
case FieldType::Int8: {
readRaw<int8_t>();
break;
}
case FieldType::Int16: {
readRaw<int16_t>();
break;
}
case FieldType::Int32: {
readRaw<int32_t>();
break;
}
case FieldType::Int64: {
readRaw<int64_t>();
break;
}
case FieldType::Double: {
readRaw<double>();
break;
}
case FieldType::Float: {
readRaw<float>();
break;
}
case FieldType::Binary: {
readRaw<std::string>();
break;
}
case FieldType::List: {
skipLinearContainer();
break;
}
case FieldType::Struct: {
readStructBegin();
while (true) {
const auto fieldType = readFieldHeader().first;
if (fieldType == FieldType::Stop) {
break;
}
skip(fieldType);
}
readStructEnd();
break;
}
case FieldType::Set: {
skipLinearContainer();
break;
}
case FieldType::Map: {
skipKVContainer();
break;
}
default: { break; }
}
} | 239 | True | 1 |
||
CVE-2019-11937 | 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/facebook/mcrouter/commit/97e033b3bb0cb16b61bf49f0dc7f311a3e0edd1b', 'name': 'https://github.com/facebook/mcrouter/commit/97e033b3bb0cb16b61bf49f0dc7f311a3e0edd1b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://www.facebook.com/security/advisories/cve-2019-11937', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11937', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebook/mcrouter/releases/tag/v0.41.0-release', 'name': 'https://github.com/facebook/mcrouter/releases/tag/v0.41.0-release', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-674'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:mcrouter:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.41.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Mcrouter prior to v0.41.0, a large struct input provided to the Carbon protocol reader could result in stack exhaustion and denial of service.'}] | 2020-08-24T17:37Z | 2019-12-04T16:15Z | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | 0 | Ted Reed | 2019-11-04 07:02:54-08:00 | Attempt to make CarbonProtocolReader::skip tail recursive
Reviewed By: edenzik
Differential Revision: D17967570
fbshipit-source-id: fdc32e190a521349c7c8f4d6081902fa18eb0284 | 97e033b3bb0cb16b61bf49f0dc7f311a3e0edd1b | False | facebook/mcrouter | Mcrouter is a memcached protocol router for scaling memcached deployments. | 2014-01-24 17:42:42 | 2022-08-27 01:37:58 | facebook | 3071.0 | 516.0 | carbon::CarbonProtocolReader::readStructEnd | carbon::CarbonProtocolReader::readStructEnd() | [] | void readStructEnd() {
lastFieldId_ = nestedStructFieldIds_.back();
nestedStructFieldIds_.pop_back();
} | 19 | True | 1 |
||
CVE-2019-3560 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/facebookincubator/fizz/commit/40bbb161e72fb609608d53b9d64c56bb961a6ee2', 'name': 'https://github.com/facebookincubator/fizz/commit/40bbb161e72fb609608d53b9d64c56bb961a6ee2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-131'}, {'lang': 'en', 'value': 'CWE-835'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:fizz:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.03.04.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An improperly performed length calculation on a buffer in PlaintextRecordLayer could lead to an infinite loop and denial-of-service based on user input. This issue affected versions of fizz prior to v2019.03.04.00.'}] | 2020-10-16T18:04Z | 2019-04-29T16:29Z | Incorrect Calculation of Buffer Size | The software does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow. | https://cwe.mitre.org/data/definitions/131.html | 0 | Kyle Nekritz | 2019-02-25 17:07:20-08:00 | Avoid arithmetic operation on uint16 read from the wire.
Summary:
This could overflow previously.
CVE-2019-3560
Reviewed By: yfeldblum
Differential Revision: D14152362
fbshipit-source-id: c0ebb3fc59b49c7c23e6bcb90458c19cd891be65 | 40bbb161e72fb609608d53b9d64c56bb961a6ee2 | False | facebookincubator/fizz | C++14 implementation of the TLS-1.3 standard | 2017-05-01 16:55:30 | 2022-08-27 05:38:08 | null | facebookincubator | 1036.0 | 154.0 | fizz::PlaintextReadRecordLayer::read | fizz::PlaintextReadRecordLayer::read( folly :: IOBufQueue & buf) | ['buf'] | folly::Optional<TLSMessage> PlaintextReadRecordLayer::read(
folly::IOBufQueue& buf) {
while (true) {
folly::io::Cursor cursor(buf.front());
if (buf.empty() || !cursor.canAdvance(kPlaintextHeaderSize)) {
return folly::none;
}
TLSMessage msg;
msg.type = static_cast<ContentType>(cursor.readBE<ContentTypeType>());
if (skipEncryptedRecords_) {
if (msg.type == ContentType::application_data) {
cursor.skip(sizeof(ProtocolVersion));
auto length = cursor.readBE<uint16_t>();
if (buf.chainLength() < (cursor - buf.front()) + length) {
return folly::none;
}
length +=
sizeof(ContentType) + sizeof(ProtocolVersion) + sizeof(uint16_t);
buf.trimStart(length);
continue;
} else if (msg.type != ContentType::change_cipher_spec) {
skipEncryptedRecords_ = false;
}
}
switch (msg.type) {
case ContentType::handshake:
case ContentType::alert:
break;
case ContentType::change_cipher_spec:
break;
default:
throw std::runtime_error(folly::to<std::string>(
"received plaintext content type ",
static_cast<ContentTypeType>(msg.type),
", header: ",
folly::hexlify(buf.splitAtMost(10)->coalesce())));
}
receivedRecordVersion_ =
static_cast<ProtocolVersion>(cursor.readBE<ProtocolVersionType>());
auto length = cursor.readBE<uint16_t>();
if (length > kMaxPlaintextRecordSize) {
throw std::runtime_error("received too long plaintext record");
}
if (length == 0) {
throw std::runtime_error("received empty plaintext record");
}
if (buf.chainLength() < (cursor - buf.front()) + length) {
return folly::none;
}
cursor.clone(msg.fragment, length);
buf.trimStart(cursor - buf.front());
if (msg.type == ContentType::change_cipher_spec) {
msg.fragment->coalesce();
if (msg.fragment->length() == 1 && *msg.fragment->data() == 0x01) {
continue;
} else {
throw FizzException(
"received ccs", AlertDescription::illegal_parameter);
}
}
return std::move(msg);
}
} | 442 | True | 1 |
|
CVE-2019-3560 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/facebookincubator/fizz/commit/40bbb161e72fb609608d53b9d64c56bb961a6ee2', 'name': 'https://github.com/facebookincubator/fizz/commit/40bbb161e72fb609608d53b9d64c56bb961a6ee2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-131'}, {'lang': 'en', 'value': 'CWE-835'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:fizz:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.03.04.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An improperly performed length calculation on a buffer in PlaintextRecordLayer could lead to an infinite loop and denial-of-service based on user input. This issue affected versions of fizz prior to v2019.03.04.00.'}] | 2020-10-16T18:04Z | 2019-04-29T16:29Z | Loop with Unreachable Exit Condition ('Infinite Loop') | The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. | If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.
| https://cwe.mitre.org/data/definitions/835.html | 0 | Kyle Nekritz | 2019-02-25 17:07:20-08:00 | Avoid arithmetic operation on uint16 read from the wire.
Summary:
This could overflow previously.
CVE-2019-3560
Reviewed By: yfeldblum
Differential Revision: D14152362
fbshipit-source-id: c0ebb3fc59b49c7c23e6bcb90458c19cd891be65 | 40bbb161e72fb609608d53b9d64c56bb961a6ee2 | False | facebookincubator/fizz | C++14 implementation of the TLS-1.3 standard | 2017-05-01 16:55:30 | 2022-08-27 05:38:08 | null | facebookincubator | 1036.0 | 154.0 | fizz::PlaintextReadRecordLayer::read | fizz::PlaintextReadRecordLayer::read( folly :: IOBufQueue & buf) | ['buf'] | folly::Optional<TLSMessage> PlaintextReadRecordLayer::read(
folly::IOBufQueue& buf) {
while (true) {
folly::io::Cursor cursor(buf.front());
if (buf.empty() || !cursor.canAdvance(kPlaintextHeaderSize)) {
return folly::none;
}
TLSMessage msg;
msg.type = static_cast<ContentType>(cursor.readBE<ContentTypeType>());
if (skipEncryptedRecords_) {
if (msg.type == ContentType::application_data) {
cursor.skip(sizeof(ProtocolVersion));
auto length = cursor.readBE<uint16_t>();
if (buf.chainLength() < (cursor - buf.front()) + length) {
return folly::none;
}
length +=
sizeof(ContentType) + sizeof(ProtocolVersion) + sizeof(uint16_t);
buf.trimStart(length);
continue;
} else if (msg.type != ContentType::change_cipher_spec) {
skipEncryptedRecords_ = false;
}
}
switch (msg.type) {
case ContentType::handshake:
case ContentType::alert:
break;
case ContentType::change_cipher_spec:
break;
default:
throw std::runtime_error(folly::to<std::string>(
"received plaintext content type ",
static_cast<ContentTypeType>(msg.type),
", header: ",
folly::hexlify(buf.splitAtMost(10)->coalesce())));
}
receivedRecordVersion_ =
static_cast<ProtocolVersion>(cursor.readBE<ProtocolVersionType>());
auto length = cursor.readBE<uint16_t>();
if (length > kMaxPlaintextRecordSize) {
throw std::runtime_error("received too long plaintext record");
}
if (length == 0) {
throw std::runtime_error("received empty plaintext record");
}
if (buf.chainLength() < (cursor - buf.front()) + length) {
return folly::none;
}
cursor.clone(msg.fragment, length);
buf.trimStart(cursor - buf.front());
if (msg.type == ContentType::change_cipher_spec) {
msg.fragment->coalesce();
if (msg.fragment->length() == 1 && *msg.fragment->data() == 0x01) {
continue;
} else {
throw FizzException(
"received ccs", AlertDescription::illegal_parameter);
}
}
return std::move(msg);
}
} | 442 | True | 1 |
CVE-2019-11924 | 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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'name': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'name': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:fizz:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2019.01.28.00', 'versionEndIncluding': '2019.08.05.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A peer could send empty handshake fragments containing only padding which would be kept in memory until a full handshake was received, resulting in memory exhaustion. This issue affects versions v2019.01.28.00 and above of fizz, until v2019.08.05.00.'}] | 2020-08-24T17:37Z | 2019-08-20T20: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 | Subodh Iyengar | 2019-08-08 11:38:29-07:00 | Reject zero length handshake records.
Summary:
Zero length (all padding) handshake are forbidden by RFC. Allowing
these was a regression in D13754697 (2c6f78a).
This is a partial fix for CVE-2019-11924
Reviewed By: xybu
Differential Revision: D16285100
fbshipit-source-id: 05a19d31ad74601ce89156a0e59517aaad8dd928 | 6bf67137ef1ee5cd70c842b014c322b7deaf994b | False | facebookincubator/fizz | C++14 implementation of the TLS-1.3 standard | 2017-05-01 16:55:30 | 2022-08-27 05:38:08 | null | facebookincubator | 1036.0 | 154.0 | fizz::EncryptedReadRecordLayer::read | fizz::EncryptedReadRecordLayer::read( folly :: IOBufQueue & buf) | ['buf'] | folly::Optional<TLSMessage> EncryptedReadRecordLayer::read(
folly::IOBufQueue& buf) {
auto decryptedBuf = getDecryptedBuf(buf);
if (!decryptedBuf) {
return folly::none;
}
TLSMessage msg;
// Iterate over the buffers while trying to find
// the first non-zero octet. This is much faster than
// first iterating and then trimming.
auto currentBuf = decryptedBuf->get();
bool nonZeroFound = false;
do {
currentBuf = currentBuf->prev();
size_t i = currentBuf->length();
while (i > 0 && !nonZeroFound) {
nonZeroFound = (currentBuf->data()[i - 1] != 0);
i--;
}
if (nonZeroFound) {
msg.type = static_cast<ContentType>(currentBuf->data()[i]);
}
currentBuf->trimEnd(currentBuf->length() - i);
} while (!nonZeroFound && currentBuf != decryptedBuf->get());
if (!nonZeroFound) {
throw std::runtime_error("No content type found");
}
msg.fragment = std::move(*decryptedBuf);
switch (msg.type) {
case ContentType::handshake:
case ContentType::alert:
case ContentType::application_data:
break;
default:
throw std::runtime_error(folly::to<std::string>(
"received encrypted content type ",
static_cast<ContentTypeType>(msg.type)));
}
if (!msg.fragment) {
if (msg.type == ContentType::application_data) {
msg.fragment = folly::IOBuf::create(0);
} else {
throw std::runtime_error("received empty fragment");
}
}
return msg;
} | 282 | True | 1 |
CVE-2019-11924 | 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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'name': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'name': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:fizz:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2019.01.28.00', 'versionEndIncluding': '2019.08.05.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A peer could send empty handshake fragments containing only padding which would be kept in memory until a full handshake was received, resulting in memory exhaustion. This issue affects versions v2019.01.28.00 and above of fizz, until v2019.08.05.00.'}] | 2020-08-24T17:37Z | 2019-08-20T20: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 | Subodh Iyengar | 2019-08-08 11:38:29-07:00 | Reject zero length handshake records.
Summary:
Zero length (all padding) handshake are forbidden by RFC. Allowing
these was a regression in D13754697 (2c6f78a).
This is a partial fix for CVE-2019-11924
Reviewed By: xybu
Differential Revision: D16285100
fbshipit-source-id: 05a19d31ad74601ce89156a0e59517aaad8dd928 | 6bf67137ef1ee5cd70c842b014c322b7deaf994b | False | facebookincubator/fizz | C++14 implementation of the TLS-1.3 standard | 2017-05-01 16:55:30 | 2022-08-27 05:38:08 | null | facebookincubator | 1036.0 | 154.0 | fizz::test::TEST_F | fizz::test::TEST_F( EncryptedRecordTest , TestAllPaddingHandshake) | ['EncryptedRecordTest', 'TestAllPaddingHandshake'] | TEST_F(EncryptedRecordTest, TestAllPaddingHandshake) {
addToQueue("17030100050123456789");
EXPECT_CALL(*readAead_, _decrypt(_, _, 0))
.WillOnce(Invoke([](std::unique_ptr<IOBuf>& buf, const IOBuf*, uint64_t) {
expectSame(buf, "0123456789");
return getBuf("16000000");
}));
EXPECT_NO_THROW(read_.read(queue_));
} | 78 | True | 1 |
CVE-2019-11924 | 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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'name': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'name': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:fizz:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2019.01.28.00', 'versionEndIncluding': '2019.08.05.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A peer could send empty handshake fragments containing only padding which would be kept in memory until a full handshake was received, resulting in memory exhaustion. This issue affects versions v2019.01.28.00 and above of fizz, until v2019.08.05.00.'}] | 2020-08-24T17:37Z | 2019-08-20T20: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 | Subodh Iyengar | 2019-08-08 11:38:29-07:00 | Coalesce handshake buffers
Summary:
It is possible that a peer might send us records in a manner such
that there is a 16KB record and only 1 byte of handshake message in
each record. Since we normally just trim the IOBuf, we would end up
holding 16K of data per actual byte of data. To prevent this we allocate a contiguous
buffer to copy over these bytes for handshake messages for now.
This is a partial fix for CVE-2019-11924
Reviewed By: ngoyal
Differential Revision: D16478044
fbshipit-source-id: 464bc68eaefda065d9a327818100427377293fbd | 3eaddb33619eaaf74a760872850c550ad8f5c52f | False | facebookincubator/fizz | C++14 implementation of the TLS-1.3 standard | 2017-05-01 16:55:30 | 2022-08-27 05:38:08 | null | facebookincubator | 1036.0 | 154.0 | fizz::EncryptedReadRecordLayer::read | fizz::EncryptedReadRecordLayer::read( folly :: IOBufQueue & buf) | ['buf'] | folly::Optional<TLSMessage> EncryptedReadRecordLayer::read(
folly::IOBufQueue& buf) {
auto decryptedBuf = getDecryptedBuf(buf);
if (!decryptedBuf) {
return folly::none;
}
TLSMessage msg;
// Iterate over the buffers while trying to find
// the first non-zero octet. This is much faster than
// first iterating and then trimming.
auto currentBuf = decryptedBuf->get();
bool nonZeroFound = false;
do {
currentBuf = currentBuf->prev();
size_t i = currentBuf->length();
while (i > 0 && !nonZeroFound) {
nonZeroFound = (currentBuf->data()[i - 1] != 0);
i--;
}
if (nonZeroFound) {
msg.type = static_cast<ContentType>(currentBuf->data()[i]);
}
currentBuf->trimEnd(currentBuf->length() - i);
} while (!nonZeroFound && currentBuf != decryptedBuf->get());
if (!nonZeroFound) {
throw std::runtime_error("No content type found");
}
msg.fragment = std::move(*decryptedBuf);
switch (msg.type) {
case ContentType::handshake:
case ContentType::alert:
case ContentType::application_data:
break;
default:
throw std::runtime_error(folly::to<std::string>(
"received encrypted content type ",
static_cast<ContentTypeType>(msg.type)));
}
if (!msg.fragment || msg.fragment->empty()) {
if (msg.type == ContentType::application_data) {
msg.fragment = folly::IOBuf::create(0);
} else {
throw std::runtime_error("received empty fragment");
}
}
return msg;
} | 290 | True | 1 |
CVE-2019-11924 | 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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11924', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'name': 'https://github.com/facebookincubator/fizz/commit/3eaddb33619eaaf74a760872850c550ad8f5c52f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'name': 'https://github.com/facebookincubator/fizz/commit/6bf67137ef1ee5cd70c842b014c322b7deaf994b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-770'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:fizz:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2019.01.28.00', 'versionEndIncluding': '2019.08.05.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A peer could send empty handshake fragments containing only padding which would be kept in memory until a full handshake was received, resulting in memory exhaustion. This issue affects versions v2019.01.28.00 and above of fizz, until v2019.08.05.00.'}] | 2020-08-24T17:37Z | 2019-08-20T20: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 | Subodh Iyengar | 2019-08-08 11:38:29-07:00 | Coalesce handshake buffers
Summary:
It is possible that a peer might send us records in a manner such
that there is a 16KB record and only 1 byte of handshake message in
each record. Since we normally just trim the IOBuf, we would end up
holding 16K of data per actual byte of data. To prevent this we allocate a contiguous
buffer to copy over these bytes for handshake messages for now.
This is a partial fix for CVE-2019-11924
Reviewed By: ngoyal
Differential Revision: D16478044
fbshipit-source-id: 464bc68eaefda065d9a327818100427377293fbd | 3eaddb33619eaaf74a760872850c550ad8f5c52f | False | facebookincubator/fizz | C++14 implementation of the TLS-1.3 standard | 2017-05-01 16:55:30 | 2022-08-27 05:38:08 | null | facebookincubator | 1036.0 | 154.0 | fizz::ReadRecordLayer::readEvent | fizz::ReadRecordLayer::readEvent( folly :: IOBufQueue & socketBuf) | ['socketBuf'] | folly::Optional<Param> ReadRecordLayer::readEvent(
folly::IOBufQueue& socketBuf) {
if (!unparsedHandshakeData_.empty()) {
auto param = decodeHandshakeMessage(unparsedHandshakeData_);
if (param) {
VLOG(8) << "Received handshake message "
<< toString(boost::apply_visitor(EventVisitor(), *param));
return param;
}
}
while (true) {
// Read one record. We read one record at a time since records could cause
// a change in the record layer.
auto message = read(socketBuf);
if (!message) {
return folly::none;
}
if (!unparsedHandshakeData_.empty() &&
message->type != ContentType::handshake) {
throw std::runtime_error("spliced handshake data");
}
switch (message->type) {
case ContentType::alert: {
auto alert = decode<Alert>(std::move(message->fragment));
if (alert.description == AlertDescription::close_notify) {
return Param(CloseNotify(socketBuf.move()));
} else {
return Param(std::move(alert));
}
}
case ContentType::handshake: {
unparsedHandshakeData_.append(std::move(message->fragment));
auto param = decodeHandshakeMessage(unparsedHandshakeData_);
if (param) {
VLOG(8) << "Received handshake message "
<< toString(boost::apply_visitor(EventVisitor(), *param));
return param;
} else {
// If we read handshake data but didn't have enough to get a full
// message we immediately try to read another record.
// TODO: add limits on number of records we buffer
continue;
}
}
case ContentType::application_data:
return Param(AppData(std::move(message->fragment)));
default:
throw std::runtime_error("unknown content type");
}
}
} | 287 | True | 1 |
CVE-2019-11932 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-11932', 'name': 'https://www.facebook.com/security/advisories/cve-2019-11932', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/154867/Whatsapp-2.19.216-Remote-Code-Execution.html', 'name': 'http://packetstormsecurity.com/files/154867/Whatsapp-2.19.216-Remote-Code-Execution.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://seclists.org/fulldisclosure/2019/Nov/27', 'name': '20191126 CVE-2019-11932 (double free in libpl_droidsonroids_gif) many apps vulnerable', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/koral--/android-gif-drawable/pull/673/commits/4944c92761e0a14f04868cbcf4f4e86fd4b7a4a9', 'name': 'https://github.com/koral--/android-gif-drawable/pull/673/commits/4944c92761e0a14f04868cbcf4f4e86fd4b7a4a9', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://awakened1712.github.io/hacking/hacking-whatsapp-gif-rce/', 'name': 'https://awakened1712.github.io/hacking/hacking-whatsapp-gif-rce/', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/koral--/android-gif-drawable/pull/673', 'name': 'https://github.com/koral--/android-gif-drawable/pull/673', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://gist.github.com/wdormann/874198c1bd29c7dd2157d9fc1d858263', 'name': 'https://gist.github.com/wdormann/874198c1bd29c7dd2157d9fc1d858263', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/158306/WhatsApp-android-gif-drawable-Double-Free.html', 'name': 'http://packetstormsecurity.com/files/158306/WhatsApp-android-gif-drawable-Double-Free.html', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/koral--/android-gif-drawable/commit/cc5b4f8e43463995a84efd594f89a21f906c2d20', 'name': 'https://github.com/koral--/android-gif-drawable/commit/cc5b4f8e43463995a84efd594f89a21f906c2d20', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-415'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whatsapp:whatsapp:*:*:*:*:*:android:*:*', 'versionEndExcluding': '2.19.244', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:android-gif-drawable_project:android-gif-drawable:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.2.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A double free vulnerability in the DDGifSlurp function in decoding.c in the android-gif-drawable library before version 1.2.18, as used in WhatsApp for Android before version 2.19.244 and many other Android applications, allows remote attackers to execute arbitrary code or cause a denial of service when the library is used to parse a specially crafted GIF image.'}] | 2020-10-27T15:15Z | 2019-10-03T22:15Z | Double Free | The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. | When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
| https://cwe.mitre.org/data/definitions/415.html | 0 | Oleg Sukhodolskii | 2019-08-10 00:03:08-07:00 | Do not realloc array if new raster size is 0.
if realloc() is called with 0 size it may return NULL and this will be incorrectly handled
as not enough memory and (also) rasterBits will be freed by realloc but we will not update
it. | cc5b4f8e43463995a84efd594f89a21f906c2d20 | False | koral--/android-gif-drawable | Views and Drawable for displaying animated GIFs on Android | 2013-01-30 01:37:46 | 2022-08-19 13:24:29 | koral-- | 9165.0 | 1767.0 | DDGifSlurp | DDGifSlurp( GifInfo * info , bool decode , bool exitAfterFrame) | ['info', 'decode', 'exitAfterFrame'] | void DDGifSlurp(GifInfo *info, bool decode, bool exitAfterFrame) {
GifRecordType RecordType;
GifByteType *ExtData;
int ExtFunction;
GifFileType *gifFilePtr;
gifFilePtr = info->gifFilePtr;
uint_fast32_t lastAllocatedGCBIndex = 0;
do {
if (DGifGetRecordType(gifFilePtr, &RecordType) == GIF_ERROR) {
break;
}
bool isInitialPass = !decode && !exitAfterFrame;
switch (RecordType) {
case IMAGE_DESC_RECORD_TYPE:
if (DGifGetImageDesc(gifFilePtr, isInitialPass) == GIF_ERROR) {
break;
}
if (isInitialPass) {
int_fast32_t widthOverflow = gifFilePtr->Image.Width - gifFilePtr->SWidth;
int_fast32_t heightOverflow = gifFilePtr->Image.Height - gifFilePtr->SHeight;
if (widthOverflow > 0 || heightOverflow > 0) {
gifFilePtr->SWidth += widthOverflow;
gifFilePtr->SHeight += heightOverflow;
}
SavedImage *sp = &gifFilePtr->SavedImages[gifFilePtr->ImageCount - 1];
int_fast32_t topOverflow = gifFilePtr->Image.Top + gifFilePtr->Image.Height - gifFilePtr->SHeight;
if (topOverflow > 0) {
sp->ImageDesc.Top -= topOverflow;
}
int_fast32_t leftOverflow = gifFilePtr->Image.Left + gifFilePtr->Image.Width - gifFilePtr->SWidth;
if (leftOverflow > 0) {
sp->ImageDesc.Left -= leftOverflow;
}
if (!updateGCB(info, &lastAllocatedGCBIndex)) {
break;
}
}
if (decode) {
int_fast32_t widthOverflow = gifFilePtr->Image.Width - info->originalWidth;
int_fast32_t heightOverflow = gifFilePtr->Image.Height - info->originalHeight;
const uint_fast32_t newRasterSize = gifFilePtr->Image.Width * gifFilePtr->Image.Height;
if (newRasterSize > info->rasterSize || widthOverflow > 0 || heightOverflow > 0) {
void *tmpRasterBits = reallocarray(info->rasterBits, newRasterSize, sizeof(GifPixelType));
if (tmpRasterBits == NULL) {
gifFilePtr->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
break;
}
info->rasterBits = tmpRasterBits;
info->rasterSize = newRasterSize;
}
if (gifFilePtr->Image.Interlace) {
uint_fast16_t i, j;
/*
* The way an interlaced image should be read -
* offsets and jumps...
*/
uint_fast8_t InterlacedOffset[] = {0, 4, 2, 1};
uint_fast8_t InterlacedJumps[] = {8, 8, 4, 2};
/* Need to perform 4 passes on the image */
for (i = 0; i < 4; i++)
for (j = InterlacedOffset[i]; j < gifFilePtr->Image.Height; j += InterlacedJumps[i]) {
if (DGifGetLine(gifFilePtr, info->rasterBits + j * gifFilePtr->Image.Width, gifFilePtr->Image.Width) == GIF_ERROR)
break;
}
} else {
if (DGifGetLine(gifFilePtr, info->rasterBits, gifFilePtr->Image.Width * gifFilePtr->Image.Height) == GIF_ERROR) {
break;
}
}
if (info->sampleSize > 1) {
unsigned char *dst = info->rasterBits;
unsigned char *src = info->rasterBits;
unsigned char *const srcEndImage = info->rasterBits + gifFilePtr->Image.Width * gifFilePtr->Image.Height;
do {
unsigned char *srcNextLineStart = src + gifFilePtr->Image.Width * info->sampleSize;
unsigned char *const srcEndLine = src + gifFilePtr->Image.Width;
unsigned char *dstEndLine = dst + gifFilePtr->Image.Width / info->sampleSize;
do {
*dst = *src;
dst++;
src += info->sampleSize;
} while (src < srcEndLine);
dst = dstEndLine;
src = srcNextLineStart;
} while (src < srcEndImage);
}
return;
} else {
do {
if (DGifGetCodeNext(gifFilePtr, &ExtData) == GIF_ERROR) {
break;
}
} while (ExtData != NULL);
if (exitAfterFrame) {
return;
}
}
break;
case EXTENSION_RECORD_TYPE:
if (DGifGetExtension(gifFilePtr, &ExtFunction, &ExtData) == GIF_ERROR) {
break;
}
if (isInitialPass) {
updateGCB(info, &lastAllocatedGCBIndex);
if (readExtensions(ExtFunction, ExtData, info) == GIF_ERROR) {
break;
}
}
while (ExtData != NULL) {
if (DGifGetExtensionNext(gifFilePtr, &ExtData) == GIF_ERROR) {
break;
}
if (isInitialPass && readExtensions(ExtFunction, ExtData, info) == GIF_ERROR) {
break;
}
}
break;
case TERMINATE_RECORD_TYPE:
break;
default: /* Should be trapped by DGifGetRecordType */
break;
}
} while (RecordType != TERMINATE_RECORD_TYPE);
info->rewindFunction(info);
} | 808 | True | 1 |
|
CVE-2021-24028 | 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/facebook/fbthrift/commit/bfda1efa547dce11a38592820916db01b05b9339', 'name': 'https://github.com/facebook/fbthrift/commit/bfda1efa547dce11a38592820916db01b05b9339', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.facebook.com/security/advisories/cve-2021-24028', 'name': 'https://www.facebook.com/security/advisories/cve-2021-24028', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-763'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:thrift:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2021.02.22.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An invalid free in Thrift's table-based serialization can cause the application to crash or potentially result in code execution or other undesirable effects. This issue affects Facebook Thrift prior to v2021.02.22.00."}] | 2021-04-21T15:38Z | 2021-04-14T00:15Z | Release of Invalid Pointer or Reference | The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly. |
This weakness can take several forms, such as:
The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.
| https://cwe.mitre.org/data/definitions/763.html | 0 | Victor Zverovich | 2021-02-18 17:18:39-08:00 | Fix handling of invalid union data in table-based serializer
Summary:
Fix handling of invalid union data in the table-based serializer. Previously if the input contained duplicate union data, previous active member of the union was overwritten without calling the destructor of the old object, potentially causing a memory leak. In addition to that, if the second piece of data was incomplete the wrong destructor would be called during stack unwinding causing a segfault, data corruption or other undesirable effects.
Fix the issue by clearing the union if there is an active member.
Also fix the type of the data member that holds the active field id (it's `int`, not `FieldID`).
Reviewed By: yfeldblum
Differential Revision: D26440248
fbshipit-source-id: fae9ab96566cf07e14dabe9663b2beb680a01bb4 | bfda1efa547dce11a38592820916db01b05b9339 | False | facebook/fbthrift | Facebook's branch of Apache Thrift, including a new C++ server. | 2013-07-02 18:15:51 | 2022-08-27 07:00:25 | facebook | 2358.0 | 579.0 | apache::thrift::detail::activeUnionMemberId | apache::thrift::detail::activeUnionMemberId( const void * object , ptrdiff_t offset) | ['object', 'offset'] | const FieldID& activeUnionMemberId(const void* object, ptrdiff_t offset) {
return *reinterpret_cast<const FieldID*>(
offset + static_cast<const char*>(object));
} | 34 | True | 1 |
|
CVE-2021-24028 | 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/facebook/fbthrift/commit/bfda1efa547dce11a38592820916db01b05b9339', 'name': 'https://github.com/facebook/fbthrift/commit/bfda1efa547dce11a38592820916db01b05b9339', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.facebook.com/security/advisories/cve-2021-24028', 'name': 'https://www.facebook.com/security/advisories/cve-2021-24028', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-763'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:thrift:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2021.02.22.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An invalid free in Thrift's table-based serialization can cause the application to crash or potentially result in code execution or other undesirable effects. This issue affects Facebook Thrift prior to v2021.02.22.00."}] | 2021-04-21T15:38Z | 2021-04-14T00:15Z | Release of Invalid Pointer or Reference | The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly. |
This weakness can take several forms, such as:
The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.
| https://cwe.mitre.org/data/definitions/763.html | 0 | Victor Zverovich | 2021-02-18 17:18:39-08:00 | Fix handling of invalid union data in table-based serializer
Summary:
Fix handling of invalid union data in the table-based serializer. Previously if the input contained duplicate union data, previous active member of the union was overwritten without calling the destructor of the old object, potentially causing a memory leak. In addition to that, if the second piece of data was incomplete the wrong destructor would be called during stack unwinding causing a segfault, data corruption or other undesirable effects.
Fix the issue by clearing the union if there is an active member.
Also fix the type of the data member that holds the active field id (it's `int`, not `FieldID`).
Reviewed By: yfeldblum
Differential Revision: D26440248
fbshipit-source-id: fae9ab96566cf07e14dabe9663b2beb680a01bb4 | bfda1efa547dce11a38592820916db01b05b9339 | False | facebook/fbthrift | Facebook's branch of Apache Thrift, including a new C++ server. | 2013-07-02 18:15:51 | 2022-08-27 07:00:25 | facebook | 2358.0 | 579.0 | apache::thrift::detail::read | apache::thrift::detail::read( Protocol_ * iprot , const StructInfo & structInfo , void * object) | ['iprot', 'structInfo', 'object'] | void read(Protocol_* iprot, const StructInfo& structInfo, void* object) {
DCHECK(object);
ProtocolReaderStructReadState<Protocol_> readState;
readState.readStructBegin(iprot);
if (UNLIKELY(structInfo.unionExt != nullptr)) {
readState.fieldId = 0;
readState.readFieldBegin(iprot);
if (readState.atStop()) {
structInfo.unionExt->clear(object);
readState.readStructEnd(iprot);
return;
}
const auto* fieldInfo = findFieldInfo(iprot, readState, structInfo);
// Found it.
if (fieldInfo) {
void* unionVal = getMember(*fieldInfo, object);
// Default construct and placement new into the member union.
structInfo.unionExt->initMember[fieldInfo - structInfo.fieldInfos](
unionVal);
read(iprot, *fieldInfo->typeInfo, readState, unionVal);
const_cast<FieldID&>(activeUnionMemberId(
object, structInfo.unionExt->unionTypeOffset)) = fieldInfo->id;
} else {
skip(iprot, readState);
}
readState.readFieldEnd(iprot);
readState.readFieldBegin(iprot);
if (UNLIKELY(!readState.atStop())) {
TProtocolException::throwUnionMissingStop();
}
readState.readStructEnd(iprot);
return;
}
// Define out of loop to call advanceToNextField after the loop ends.
FieldID prevFieldId = 0;
// The index of the expected field in the struct layout.
std::int16_t index = 0;
// Every time advanceToNextField reports a field mismatch, either because the
// field is missing or if the serialized fields are not sorted (protocols
// don't guarantee a specific field order), we search for the field info
// matching the read bytes. Then we resume from the one past the found field
// to reduce the number of scans we have to do if the fields are sorted which
// is a common case. When we increment index past the number of fields we
// utilize the same search logic with a field info of type TType::T_STOP.
for (;; ++index) {
auto* fieldInfo = index < structInfo.numFields
? &structInfo.fieldInfos[index]
: &kStopMarker;
// Try to match the next field in order against the current bytes.
if (UNLIKELY(!readState.advanceToNextField(
iprot, prevFieldId, fieldInfo->id, fieldInfo->typeInfo->type))) {
// Loop to skip until we find a match for both field id/name and type.
for (;;) {
readState.afterAdvanceFailure(iprot);
if (readState.atStop()) {
// Already at stop, return immediately.
readState.readStructEnd(iprot);
return;
}
fieldInfo = findFieldInfo(iprot, readState, structInfo);
// Found it.
if (fieldInfo) {
// Set the index to the field next in order to the found field.
index = fieldInfo - structInfo.fieldInfos;
break;
}
skip(iprot, readState);
}
} else if (UNLIKELY(index >= structInfo.numFields)) {
// We are at stop and have tried all of the fields, so return.
readState.readStructEnd(iprot);
return;
}
// Id and type are what we expect, try read.
prevFieldId = fieldInfo->id;
read(iprot, *fieldInfo->typeInfo, readState, getMember(*fieldInfo, object));
if (fieldInfo->issetOffset > 0) {
const_cast<bool&>(fieldIsSet(object, fieldInfo->issetOffset)) = true;
}
}
} | 439 | True | 1 |
|
CVE-2021-24028 | 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/facebook/fbthrift/commit/bfda1efa547dce11a38592820916db01b05b9339', 'name': 'https://github.com/facebook/fbthrift/commit/bfda1efa547dce11a38592820916db01b05b9339', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.facebook.com/security/advisories/cve-2021-24028', 'name': 'https://www.facebook.com/security/advisories/cve-2021-24028', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-763'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:thrift:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2021.02.22.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An invalid free in Thrift's table-based serialization can cause the application to crash or potentially result in code execution or other undesirable effects. This issue affects Facebook Thrift prior to v2021.02.22.00."}] | 2021-04-21T15:38Z | 2021-04-14T00:15Z | Release of Invalid Pointer or Reference | The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly. |
This weakness can take several forms, such as:
The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.
| https://cwe.mitre.org/data/definitions/763.html | 0 | Victor Zverovich | 2021-02-18 17:18:39-08:00 | Fix handling of invalid union data in table-based serializer
Summary:
Fix handling of invalid union data in the table-based serializer. Previously if the input contained duplicate union data, previous active member of the union was overwritten without calling the destructor of the old object, potentially causing a memory leak. In addition to that, if the second piece of data was incomplete the wrong destructor would be called during stack unwinding causing a segfault, data corruption or other undesirable effects.
Fix the issue by clearing the union if there is an active member.
Also fix the type of the data member that holds the active field id (it's `int`, not `FieldID`).
Reviewed By: yfeldblum
Differential Revision: D26440248
fbshipit-source-id: fae9ab96566cf07e14dabe9663b2beb680a01bb4 | bfda1efa547dce11a38592820916db01b05b9339 | False | facebook/fbthrift | Facebook's branch of Apache Thrift, including a new C++ server. | 2013-07-02 18:15:51 | 2022-08-27 07:00:25 | facebook | 2358.0 | 579.0 | apache::thrift::detail::write | apache::thrift::detail::write( Protocol_ * iprot , const StructInfo & structInfo , const void * object) | ['iprot', 'structInfo', 'object'] | write(Protocol_* iprot, const StructInfo& structInfo, const void* object) {
DCHECK(object);
size_t written = iprot->writeStructBegin(structInfo.name);
if (UNLIKELY(structInfo.unionExt != nullptr)) {
const FieldInfo* end = structInfo.fieldInfos + structInfo.numFields;
const auto& unionId =
activeUnionMemberId(object, structInfo.unionExt->unionTypeOffset);
const FieldInfo* found = std::lower_bound(
structInfo.fieldInfos,
end,
unionId,
[](const FieldInfo& lhs, FieldID rhs) { return lhs.id < rhs; });
if (found < end && found->id == unionId) {
const OptionalThriftValue value = getValue(*found->typeInfo, object);
if (value.hasValue()) {
written += writeField(iprot, *found, value.value());
} else if (found->typeInfo->type == protocol::TType::T_STRUCT) {
written += iprot->writeFieldBegin(
found->name, found->typeInfo->type, found->id);
written += iprot->writeStructBegin(found->name);
written += iprot->writeStructEnd();
written += iprot->writeFieldStop();
written += iprot->writeFieldEnd();
}
}
} else {
for (std::int16_t index = 0; index < structInfo.numFields; index++) {
const auto& fieldInfo = structInfo.fieldInfos[index];
if (fieldInfo.isUnqualified || fieldInfo.issetOffset == 0 ||
fieldIsSet(object, fieldInfo.issetOffset)) {
const OptionalThriftValue value =
getValue(*fieldInfo.typeInfo, getMember(fieldInfo, object));
if (value.hasValue()) {
written += writeField(iprot, fieldInfo, value.value());
}
}
}
}
written += iprot->writeFieldStop();
written += iprot->writeStructEnd();
return written;
} | 364 | True | 1 |
|
CVE-2019-3565 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-3565', 'name': 'https://www.facebook.com/security/advisories/cve-2019-3565', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebook/fbthrift/commit/01686e15ec77ccb4d49a77d5bce3a01601e54d64', 'name': 'https://github.com/facebook/fbthrift/commit/01686e15ec77ccb4d49a77d5bce3a01601e54d64', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/108280', 'name': '108280', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26@%3Ccommits.pulsar.apache.org%3E', 'name': '[pulsar-commits] 20201215 [GitHub] [pulsar] yanshuchong opened a new issue #8967: CVSS issue list', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-755'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:thrift:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.05.06.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Legacy C++ Facebook Thrift servers (using cpp instead of cpp2) would not error upon receiving messages with containers of fields of unknown type. As a result, malicious clients could send short messages which would take a long time for the server to parse, potentially leading to denial of service. This issue affects Facebook Thrift prior to v2019.05.06.00.'}] | 2021-11-02T20:20Z | 2019-05-06T16:29Z | Improper Handling of Exceptional Conditions | The software does not handle or incorrectly handles an exceptional condition. | https://cwe.mitre.org/data/definitions/755.html | 0 | David Goldblatt | 2019-05-02 18:52:10-07:00 | Throw on skipping an invalid type.
Summary:
Certain values (e.g.) T_STOP should not appear as a skip type. Allowing them to
can cause thrift to loop unboundedly.
Reviewed By: spalamarchuk
Differential Revision: D15102451
fbshipit-source-id: c08d52f44f37e9c212d3480233ac217105586c9f | 01686e15ec77ccb4d49a77d5bce3a01601e54d64 | False | facebook/fbthrift | Facebook's branch of Apache Thrift, including a new C++ server. | 2013-07-02 18:15:51 | 2022-08-27 07:00:25 | facebook | 2358.0 | 579.0 | apache::thrift::protocol::skip | apache::thrift::protocol::skip( Protocol_ & prot , TType arg_type) | ['prot', 'arg_type'] | uint32_t skip(Protocol_& prot, TType arg_type) {
switch (arg_type) {
case T_BOOL: {
bool boolv;
return prot.readBool(boolv);
}
case T_BYTE: {
int8_t bytev = 0;
return prot.readByte(bytev);
}
case T_I16: {
int16_t i16;
return prot.readI16(i16);
}
case T_I32: {
int32_t i32;
return prot.readI32(i32);
}
case T_I64: {
int64_t i64;
return prot.readI64(i64);
}
case T_DOUBLE: {
double dub;
return prot.readDouble(dub);
}
case T_FLOAT: {
float flt;
return prot.readFloat(flt);
}
case T_STRING: {
std::string str;
return prot.readBinary(str);
}
case T_STRUCT: {
uint32_t result = 0;
std::string name;
int16_t fid;
TType ftype;
result += prot.readStructBegin(name);
while (true) {
result += prot.readFieldBegin(name, ftype, fid);
if (ftype == T_STOP) {
break;
}
result += skip(prot, ftype);
result += prot.readFieldEnd();
}
result += prot.readStructEnd();
return result;
}
case T_MAP: {
uint32_t result = 0;
TType keyType;
TType valType;
uint32_t i, size;
bool sizeUnknown;
result += prot.readMapBegin(keyType, valType, size, sizeUnknown);
if (!sizeUnknown) {
for (i = 0; i < size; i++) {
result += skip(prot, keyType);
result += skip(prot, valType);
}
} else {
while (prot.peekMap()) {
result += skip(prot, keyType);
result += skip(prot, valType);
}
}
result += prot.readMapEnd();
return result;
}
case T_SET: {
uint32_t result = 0;
TType elemType;
uint32_t i, size;
bool sizeUnknown;
result += prot.readSetBegin(elemType, size, sizeUnknown);
if (!sizeUnknown) {
for (i = 0; i < size; i++) {
result += skip(prot, elemType);
}
} else {
while (prot.peekSet()) {
result += skip(prot, elemType);
}
}
result += prot.readSetEnd();
return result;
}
case T_LIST: {
uint32_t result = 0;
TType elemType;
uint32_t i, size;
bool sizeUnknown;
result += prot.readListBegin(elemType, size, sizeUnknown);
if (!sizeUnknown) {
for (i = 0; i < size; i++) {
result += skip(prot, elemType);
}
} else {
while (prot.peekList()) {
result += skip(prot, elemType);
}
}
result += prot.readListEnd();
return result;
}
default:
return 0;
}
} | 558 | True | 1 |
||
CVE-2019-3552 | 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/facebook/fbthrift/commit/c5d6e07588cd03061bc54d451a7fa6e84883d62b', 'name': 'https://github.com/facebook/fbthrift/commit/c5d6e07588cd03061bc54d451a7fa6e84883d62b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/108279', 'name': '108279', 'refsource': 'BID', 'tags': ['Broken Link']}, {'url': 'https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26@%3Ccommits.pulsar.apache.org%3E', 'name': '[pulsar-commits] 20201215 [GitHub] [pulsar] yanshuchong opened a new issue #8967: CVSS issue list', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-755'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:thrift:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.02.18.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'C++ Facebook Thrift servers (using cpp2) would not error upon receiving messages with containers of fields of unknown type. As a result, malicious clients could send short messages which would take a long time for the server to parse, potentially leading to denial of service. This issue affects Facebook Thrift prior to v2019.02.18.00.'}] | 2021-10-29T18:56Z | 2019-05-06T16:29Z | Improper Handling of Exceptional Conditions | The software does not handle or incorrectly handles an exceptional condition. | https://cwe.mitre.org/data/definitions/755.html | 0 | Stepan Palamarchuk | 2019-02-14 13:37:15-08:00 | Throw on bad types during skipping data
Summary:
The current code silently returns on bad types. In case when we have an invalid data, we may get a container of a large size with a bad type, this would lead to us running long loop doing nothing (though we already can say that the data is invalid).
The new code would throw an exception as soon as we try to skip a value of invalid type.
Fixes CVE-2019-3552
Reviewed By: yfeldblum, stevegury
Differential Revision: D8344920
fbshipit-source-id: f12e8f3442f7ad5e1a81d822380701e929b80f0d | c5d6e07588cd03061bc54d451a7fa6e84883d62b | False | facebook/fbthrift | Facebook's branch of Apache Thrift, including a new C++ server. | 2013-07-02 18:15:51 | 2022-08-27 07:00:25 | facebook | 2358.0 | 579.0 | apache::thrift::skip | apache::thrift::skip( Protocol_ & prot , TType arg_type) | ['prot', 'arg_type'] | void skip(Protocol_& prot, TType arg_type) {
switch (arg_type) {
case TType::T_BOOL: {
bool boolv;
prot.readBool(boolv);
return;
}
case TType::T_BYTE: {
int8_t bytev;
prot.readByte(bytev);
return;
}
case TType::T_I16: {
int16_t i16;
prot.readI16(i16);
return;
}
case TType::T_I32: {
int32_t i32;
prot.readI32(i32);
return;
}
case TType::T_I64: {
int64_t i64;
prot.readI64(i64);
return;
}
case TType::T_DOUBLE: {
double dub;
prot.readDouble(dub);
return;
}
case TType::T_FLOAT: {
float flt;
prot.readFloat(flt);
return;
}
case TType::T_STRING: {
std::string str;
prot.readBinary(str);
return;
}
case TType::T_STRUCT: {
std::string name;
int16_t fid;
TType ftype;
prot.readStructBegin(name);
while (true) {
prot.readFieldBegin(name, ftype, fid);
if (ftype == TType::T_STOP) {
break;
}
apache::thrift::skip(prot, ftype);
prot.readFieldEnd();
}
prot.readStructEnd();
return;
}
case TType::T_MAP: {
TType keyType;
TType valType;
uint32_t i, size;
prot.readMapBegin(keyType, valType, size);
for (i = 0; i < size; i++) {
apache::thrift::skip(prot, keyType);
apache::thrift::skip(prot, valType);
}
prot.readMapEnd();
return;
}
case TType::T_SET: {
TType elemType;
uint32_t i, size;
prot.readSetBegin(elemType, size);
for (i = 0; i < size; i++) {
apache::thrift::skip(prot, elemType);
}
prot.readSetEnd();
return;
}
case TType::T_LIST: {
TType elemType;
uint32_t i, size;
prot.readListBegin(elemType, size);
for (i = 0; i < size; i++) {
apache::thrift::skip(prot, elemType);
}
prot.readListEnd();
return;
}
default:
return;
}
} | 444 | True | 1 |
||
CVE-2019-3558 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://www.facebook.com/security/advisories/cve-2019-3558', 'name': 'https://www.facebook.com/security/advisories/cve-2019-3558', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/facebook/fbthrift/commit/c5d6e07588cd03061bc54d451a7fa6e84883d62b', 'name': 'https://github.com/facebook/fbthrift/commit/c5d6e07588cd03061bc54d451a7fa6e84883d62b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/108274', 'name': '108274', 'refsource': 'BID', 'tags': ['Broken Link']}, {'url': 'https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26@%3Ccommits.pulsar.apache.org%3E', 'name': '[pulsar-commits] 20201215 [GitHub] [pulsar] yanshuchong opened a new issue #8967: CVSS issue list', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-755'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:thrift:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.02.18.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Python Facebook Thrift servers would not error upon receiving messages with containers of fields of unknown type. As a result, malicious clients could send short messages which would take a long time for the server to parse, potentially leading to denial of service. This issue affects Facebook Thrift prior to v2019.02.18.00.'}] | 2021-10-29T19:07Z | 2019-05-06T16:29Z | Improper Handling of Exceptional Conditions | The software does not handle or incorrectly handles an exceptional condition. | https://cwe.mitre.org/data/definitions/755.html | 0 | Stepan Palamarchuk | 2019-02-14 13:37:15-08:00 | Throw on bad types during skipping data
Summary:
The current code silently returns on bad types. In case when we have an invalid data, we may get a container of a large size with a bad type, this would lead to us running long loop doing nothing (though we already can say that the data is invalid).
The new code would throw an exception as soon as we try to skip a value of invalid type.
Fixes CVE-2019-3552
Reviewed By: yfeldblum, stevegury
Differential Revision: D8344920
fbshipit-source-id: f12e8f3442f7ad5e1a81d822380701e929b80f0d | c5d6e07588cd03061bc54d451a7fa6e84883d62b | False | facebook/fbthrift | Facebook's branch of Apache Thrift, including a new C++ server. | 2013-07-02 18:15:51 | 2022-08-27 07:00:25 | facebook | 2358.0 | 579.0 | apache::thrift::skip | apache::thrift::skip( Protocol_ & prot , TType arg_type) | ['prot', 'arg_type'] | void skip(Protocol_& prot, TType arg_type) {
switch (arg_type) {
case TType::T_BOOL: {
bool boolv;
prot.readBool(boolv);
return;
}
case TType::T_BYTE: {
int8_t bytev;
prot.readByte(bytev);
return;
}
case TType::T_I16: {
int16_t i16;
prot.readI16(i16);
return;
}
case TType::T_I32: {
int32_t i32;
prot.readI32(i32);
return;
}
case TType::T_I64: {
int64_t i64;
prot.readI64(i64);
return;
}
case TType::T_DOUBLE: {
double dub;
prot.readDouble(dub);
return;
}
case TType::T_FLOAT: {
float flt;
prot.readFloat(flt);
return;
}
case TType::T_STRING: {
std::string str;
prot.readBinary(str);
return;
}
case TType::T_STRUCT: {
std::string name;
int16_t fid;
TType ftype;
prot.readStructBegin(name);
while (true) {
prot.readFieldBegin(name, ftype, fid);
if (ftype == TType::T_STOP) {
break;
}
apache::thrift::skip(prot, ftype);
prot.readFieldEnd();
}
prot.readStructEnd();
return;
}
case TType::T_MAP: {
TType keyType;
TType valType;
uint32_t i, size;
prot.readMapBegin(keyType, valType, size);
for (i = 0; i < size; i++) {
apache::thrift::skip(prot, keyType);
apache::thrift::skip(prot, valType);
}
prot.readMapEnd();
return;
}
case TType::T_SET: {
TType elemType;
uint32_t i, size;
prot.readSetBegin(elemType, size);
for (i = 0; i < size; i++) {
apache::thrift::skip(prot, elemType);
}
prot.readSetEnd();
return;
}
case TType::T_LIST: {
TType elemType;
uint32_t i, size;
prot.readListBegin(elemType, size);
for (i = 0; i < size; i++) {
apache::thrift::skip(prot, elemType);
}
prot.readListEnd();
return;
}
default:
return;
}
} | 444 | True | 1 |
||
CVE-2019-12210 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:N | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | NONE | 5.5 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | NONE | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://github.com/Yubico/pam-u2f/commit/18b1914e32b74ff52000f10e97067e841e5fff62', 'name': 'https://github.com/Yubico/pam-u2f/commit/18b1914e32b74ff52000f10e97067e841e5fff62', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'name': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/06/05/1', 'name': '[oss-security] 20190605 pam-u2f: CVE-2019-12210: debug_file file descriptor leak, CVE-2019-12209: symlink attack on u2f_keys leading to possible information leak', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Exploit', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00012.html', 'name': 'openSUSE-SU-2019:1708', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00018.html', 'name': 'openSUSE-SU-2019:1725', 'refsource': 'SUSE', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:yubico:pam-u2f:1.0.7:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Yubico pam-u2f 1.0.7, when configured with debug and a custom debug log file is set using debug_file, that file descriptor is not closed when a new process is spawned. This leads to the file descriptor being inherited into the child process; the child process can then read from and write to it. This can leak sensitive information and also, if written to, be used to fill the disk or plant misinformation.'}] | 2020-08-24T17:37Z | 2019-06-04T21:29Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Gabriel Kihlman | 2019-06-04 09:59:50+02:00 | Do not leak file descriptor when doing exec
When opening a custom debug file, the descriptor would stay
open when calling exec and leak to the child process.
Make sure all files are opened with close-on-exec.
This fixes CVE-2019-12210.
Thanks to Matthias Gerstner of the SUSE Security Team for reporting
the issue. | 18b1914e32b74ff52000f10e97067e841e5fff62 | False | Yubico/pam-u2f | Pluggable Authentication Module (PAM) for U2F and FIDO2 | 2014-12-10 17:12:52 | 2022-07-13 06:29:36 | https://developers.yubico.com/pam-u2f/ | Yubico | 446.0 | 65.0 | pam_sm_authenticate | pam_sm_authenticate( pam_handle_t * pamh , int flags , int argc , const char ** argv) | ['pamh', 'flags', 'argc', 'argv'] | int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
const char **argv) {
struct passwd *pw = NULL, pw_s;
const char *user = NULL;
cfg_t cfg_st;
cfg_t *cfg = &cfg_st;
char buffer[BUFSIZE];
char *buf = NULL;
char *authfile_dir;
size_t authfile_dir_len;
int pgu_ret, gpn_ret;
int retval = PAM_IGNORE;
device_t *devices = NULL;
unsigned n_devices = 0;
int openasuser;
int should_free_origin = 0;
int should_free_appid = 0;
int should_free_auth_file = 0;
int should_free_authpending_file = 0;
parse_cfg(flags, argc, argv, cfg);
if (!cfg->origin) {
strcpy(buffer, DEFAULT_ORIGIN_PREFIX);
if (gethostname(buffer + strlen(DEFAULT_ORIGIN_PREFIX),
BUFSIZE - strlen(DEFAULT_ORIGIN_PREFIX)) == -1) {
DBG("Unable to get host name");
goto done;
}
DBG("Origin not specified, using \"%s\"", buffer);
cfg->origin = strdup(buffer);
if (!cfg->origin) {
DBG("Unable to allocate memory");
goto done;
} else {
should_free_origin = 1;
}
}
if (!cfg->appid) {
DBG("Appid not specified, using the same value of origin (%s)",
cfg->origin);
cfg->appid = strdup(cfg->origin);
if (!cfg->appid) {
DBG("Unable to allocate memory")
goto done;
} else {
should_free_appid = 1;
}
}
if (cfg->max_devs == 0) {
DBG("Maximum devices number not set. Using default (%d)", MAX_DEVS);
cfg->max_devs = MAX_DEVS;
}
devices = malloc(sizeof(device_t) * cfg->max_devs);
if (!devices) {
DBG("Unable to allocate memory");
retval = PAM_IGNORE;
goto done;
}
pgu_ret = pam_get_user(pamh, &user, NULL);
if (pgu_ret != PAM_SUCCESS || user == NULL) {
DBG("Unable to access user %s", user);
retval = PAM_CONV_ERR;
goto done;
}
DBG("Requesting authentication for user %s", user);
gpn_ret = getpwnam_r(user, &pw_s, buffer, sizeof(buffer), &pw);
if (gpn_ret != 0 || pw == NULL || pw->pw_dir == NULL ||
pw->pw_dir[0] != '/') {
DBG("Unable to retrieve credentials for user %s, (%s)", user,
strerror(errno));
retval = PAM_USER_UNKNOWN;
goto done;
}
DBG("Found user %s", user);
DBG("Home directory for %s is %s", user, pw->pw_dir);
if (!cfg->auth_file) {
buf = NULL;
authfile_dir = secure_getenv(DEFAULT_AUTHFILE_DIR_VAR);
if (!authfile_dir) {
DBG("Variable %s is not set. Using default value ($HOME/.config/)",
DEFAULT_AUTHFILE_DIR_VAR);
authfile_dir_len =
strlen(pw->pw_dir) + strlen("/.config") + strlen(DEFAULT_AUTHFILE) + 1;
buf = malloc(sizeof(char) * (authfile_dir_len));
if (!buf) {
DBG("Unable to allocate memory");
retval = PAM_IGNORE;
goto done;
}
snprintf(buf, authfile_dir_len,
"%s/.config%s", pw->pw_dir, DEFAULT_AUTHFILE);
} else {
DBG("Variable %s set to %s", DEFAULT_AUTHFILE_DIR_VAR, authfile_dir);
authfile_dir_len = strlen(authfile_dir) + strlen(DEFAULT_AUTHFILE) + 1;
buf = malloc(sizeof(char) * (authfile_dir_len));
if (!buf) {
DBG("Unable to allocate memory");
retval = PAM_IGNORE;
goto done;
}
snprintf(buf, authfile_dir_len,
"%s%s", authfile_dir, DEFAULT_AUTHFILE);
}
DBG("Using default authentication file %s", buf);
cfg->auth_file = buf; /* cfg takes ownership */
should_free_auth_file = 1;
buf = NULL;
} else {
DBG("Using authentication file %s", cfg->auth_file);
}
openasuser = geteuid() == 0 && cfg->openasuser;
if (openasuser) {
if (seteuid(pw_s.pw_uid)) {
DBG("Unable to switch user to uid %i", pw_s.pw_uid);
retval = PAM_IGNORE;
goto done;
}
DBG("Switched to uid %i", pw_s.pw_uid);
}
retval = get_devices_from_authfile(cfg->auth_file, user, cfg->max_devs,
cfg->debug, cfg->debug_file,
devices, &n_devices);
if (openasuser) {
if (seteuid(0)) {
DBG("Unable to switch back to uid 0");
retval = PAM_IGNORE;
goto done;
}
DBG("Switched back to uid 0");
}
if (retval != 1) {
// for nouserok; make sure errors in get_devices_from_authfile don't
// result in valid devices
n_devices = 0;
}
if (n_devices == 0) {
if (cfg->nouserok) {
DBG("Found no devices but nouserok specified. Skipping authentication");
retval = PAM_SUCCESS;
goto done;
} else if (retval != 1) {
DBG("Unable to get devices from file %s", cfg->auth_file);
retval = PAM_AUTHINFO_UNAVAIL;
goto done;
} else {
DBG("Found no devices. Aborting.");
retval = PAM_AUTHINFO_UNAVAIL;
goto done;
}
}
// Determine the full path for authpending_file in order to emit touch request notifications
if (!cfg->authpending_file) {
int actual_size = snprintf(buffer, BUFSIZE, DEFAULT_AUTHPENDING_FILE_PATH, getuid());
if (actual_size >= 0 && actual_size < BUFSIZE) {
cfg->authpending_file = strdup(buffer);
}
if (!cfg->authpending_file) {
DBG("Unable to allocate memory for the authpending_file, touch request notifications will not be emitted");
} else {
should_free_authpending_file = 1;
}
} else {
if (strlen(cfg->authpending_file) == 0) {
DBG("authpending_file is set to an empty value, touch request notifications will be disabled");
cfg->authpending_file = NULL;
}
}
int authpending_file_descriptor = -1;
if (cfg->authpending_file) {
DBG("Using file '%s' for emitting touch request notifications", cfg->authpending_file);
// Open (or create) the authpending_file to indicate that we start waiting for a touch
authpending_file_descriptor = open(cfg->authpending_file, O_RDONLY | O_CREAT, 0664);
if (authpending_file_descriptor < 0) {
DBG("Unable to emit 'authentication started' notification by opening the file '%s', (%s)",
cfg->authpending_file, strerror(errno));
}
}
if (cfg->manual == 0) {
if (cfg->interactive) {
converse(pamh, PAM_PROMPT_ECHO_ON,
cfg->prompt != NULL ? cfg->prompt : DEFAULT_PROMPT);
}
retval = do_authentication(cfg, devices, n_devices, pamh);
} else {
retval = do_manual_authentication(cfg, devices, n_devices, pamh);
}
// Close the authpending_file to indicate that we stop waiting for a touch
if (authpending_file_descriptor >= 0) {
if (close(authpending_file_descriptor) < 0) {
DBG("Unable to emit 'authentication stopped' notification by closing the file '%s', (%s)",
cfg->authpending_file, strerror(errno));
}
}
if (retval != 1) {
DBG("do_authentication returned %d", retval);
retval = PAM_AUTH_ERR;
goto done;
}
retval = PAM_SUCCESS;
done:
free_devices(devices, n_devices);
if (buf) {
free(buf);
buf = NULL;
}
if (should_free_origin) {
free((char *) cfg->origin);
cfg->origin = NULL;
}
if (should_free_appid) {
free((char *) cfg->appid);
cfg->appid = NULL;
}
if (should_free_auth_file) {
free((char *) cfg->auth_file);
cfg->auth_file = NULL;
}
if (should_free_authpending_file) {
free((char *) cfg->authpending_file);
cfg->authpending_file = NULL;
}
if (cfg->alwaysok && retval != PAM_SUCCESS) {
DBG("alwaysok needed (otherwise return with %d)", retval);
retval = PAM_SUCCESS;
}
DBG("done. [%s]", pam_strerror(pamh, retval));
return retval;
} | 1279 | True | 1 |
CVE-2019-12210 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:N | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | NONE | 5.5 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | NONE | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://github.com/Yubico/pam-u2f/commit/18b1914e32b74ff52000f10e97067e841e5fff62', 'name': 'https://github.com/Yubico/pam-u2f/commit/18b1914e32b74ff52000f10e97067e841e5fff62', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'name': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/06/05/1', 'name': '[oss-security] 20190605 pam-u2f: CVE-2019-12210: debug_file file descriptor leak, CVE-2019-12209: symlink attack on u2f_keys leading to possible information leak', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Exploit', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00012.html', 'name': 'openSUSE-SU-2019:1708', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00018.html', 'name': 'openSUSE-SU-2019:1725', 'refsource': 'SUSE', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:yubico:pam-u2f:1.0.7:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Yubico pam-u2f 1.0.7, when configured with debug and a custom debug log file is set using debug_file, that file descriptor is not closed when a new process is spawned. This leads to the file descriptor being inherited into the child process; the child process can then read from and write to it. This can leak sensitive information and also, if written to, be used to fill the disk or plant misinformation.'}] | 2020-08-24T17:37Z | 2019-06-04T21:29Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Gabriel Kihlman | 2019-06-04 09:59:50+02:00 | Do not leak file descriptor when doing exec
When opening a custom debug file, the descriptor would stay
open when calling exec and leak to the child process.
Make sure all files are opened with close-on-exec.
This fixes CVE-2019-12210.
Thanks to Matthias Gerstner of the SUSE Security Team for reporting
the issue. | 18b1914e32b74ff52000f10e97067e841e5fff62 | False | Yubico/pam-u2f | Pluggable Authentication Module (PAM) for U2F and FIDO2 | 2014-12-10 17:12:52 | 2022-07-13 06:29:36 | https://developers.yubico.com/pam-u2f/ | Yubico | 446.0 | 65.0 | parse_cfg | parse_cfg( int flags , int argc , const char ** argv , cfg_t * cfg) | ['flags', 'argc', 'argv', 'cfg'] | static void parse_cfg(int flags, int argc, const char **argv, cfg_t *cfg) {
int i;
memset(cfg, 0, sizeof(cfg_t));
cfg->debug_file = stderr;
for (i = 0; i < argc; i++) {
if (strncmp(argv[i], "max_devices=", 12) == 0)
sscanf(argv[i], "max_devices=%u", &cfg->max_devs);
if (strcmp(argv[i], "manual") == 0)
cfg->manual = 1;
if (strcmp(argv[i], "debug") == 0)
cfg->debug = 1;
if (strcmp(argv[i], "nouserok") == 0)
cfg->nouserok = 1;
if (strcmp(argv[i], "openasuser") == 0)
cfg->openasuser = 1;
if (strcmp(argv[i], "alwaysok") == 0)
cfg->alwaysok = 1;
if (strcmp(argv[i], "interactive") == 0)
cfg->interactive = 1;
if (strcmp(argv[i], "cue") == 0)
cfg->cue = 1;
if (strcmp(argv[i], "nodetect") == 0)
cfg->nodetect = 1;
if (strncmp(argv[i], "authfile=", 9) == 0)
cfg->auth_file = argv[i] + 9;
if (strncmp(argv[i], "authpending_file=", 17) == 0)
cfg->authpending_file = argv[i] + 17;
if (strncmp(argv[i], "origin=", 7) == 0)
cfg->origin = argv[i] + 7;
if (strncmp(argv[i], "appid=", 6) == 0)
cfg->appid = argv[i] + 6;
if (strncmp(argv[i], "prompt=", 7) == 0)
cfg->prompt = argv[i] + 7;
if (strncmp (argv[i], "debug_file=", 11) == 0) {
const char *filename = argv[i] + 11;
if(strncmp (filename, "stdout", 6) == 0) {
cfg->debug_file = stdout;
}
else if(strncmp (filename, "stderr", 6) == 0) {
cfg->debug_file = stderr;
}
else if( strncmp (filename, "syslog", 6) == 0) {
cfg->debug_file = (FILE *)-1;
}
else {
struct stat st;
FILE *file;
if(lstat(filename, &st) == 0) {
if(S_ISREG(st.st_mode)) {
file = fopen(filename, "a");
if(file != NULL) {
cfg->debug_file = file;
}
}
}
}
}
}
if (cfg->debug) {
D(cfg->debug_file, "called.");
D(cfg->debug_file, "flags %d argc %d", flags, argc);
for (i = 0; i < argc; i++) {
D(cfg->debug_file, "argv[%d]=%s", i, argv[i]);
}
D(cfg->debug_file, "max_devices=%d", cfg->max_devs);
D(cfg->debug_file, "debug=%d", cfg->debug);
D(cfg->debug_file, "interactive=%d", cfg->interactive);
D(cfg->debug_file, "cue=%d", cfg->cue);
D(cfg->debug_file, "nodetect=%d", cfg->nodetect);
D(cfg->debug_file, "manual=%d", cfg->manual);
D(cfg->debug_file, "nouserok=%d", cfg->nouserok);
D(cfg->debug_file, "openasuser=%d", cfg->openasuser);
D(cfg->debug_file, "alwaysok=%d", cfg->alwaysok);
D(cfg->debug_file, "authfile=%s", cfg->auth_file ? cfg->auth_file : "(null)");
D(cfg->debug_file, "authpending_file=%s", cfg->authpending_file ? cfg->authpending_file : "(null)");
D(cfg->debug_file, "origin=%s", cfg->origin ? cfg->origin : "(null)");
D(cfg->debug_file, "appid=%s", cfg->appid ? cfg->appid : "(null)");
D(cfg->debug_file, "prompt=%s", cfg->prompt ? cfg->prompt : "(null)");
}
} | 813 | True | 1 |
CVE-2019-12210 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:N | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | NONE | 5.5 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | NONE | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://github.com/Yubico/pam-u2f/commit/18b1914e32b74ff52000f10e97067e841e5fff62', 'name': 'https://github.com/Yubico/pam-u2f/commit/18b1914e32b74ff52000f10e97067e841e5fff62', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'name': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/06/05/1', 'name': '[oss-security] 20190605 pam-u2f: CVE-2019-12210: debug_file file descriptor leak, CVE-2019-12209: symlink attack on u2f_keys leading to possible information leak', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Exploit', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00012.html', 'name': 'openSUSE-SU-2019:1708', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00018.html', 'name': 'openSUSE-SU-2019:1725', 'refsource': 'SUSE', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:yubico:pam-u2f:1.0.7:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Yubico pam-u2f 1.0.7, when configured with debug and a custom debug log file is set using debug_file, that file descriptor is not closed when a new process is spawned. This leads to the file descriptor being inherited into the child process; the child process can then read from and write to it. This can leak sensitive information and also, if written to, be used to fill the disk or plant misinformation.'}] | 2020-08-24T17:37Z | 2019-06-04T21:29Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Gabriel Kihlman | 2019-06-04 09:59:50+02:00 | Do not leak file descriptor when doing exec
When opening a custom debug file, the descriptor would stay
open when calling exec and leak to the child process.
Make sure all files are opened with close-on-exec.
This fixes CVE-2019-12210.
Thanks to Matthias Gerstner of the SUSE Security Team for reporting
the issue. | 18b1914e32b74ff52000f10e97067e841e5fff62 | False | Yubico/pam-u2f | Pluggable Authentication Module (PAM) for U2F and FIDO2 | 2014-12-10 17:12:52 | 2022-07-13 06:29:36 | https://developers.yubico.com/pam-u2f/ | Yubico | 446.0 | 65.0 | get_devices_from_authfile | get_devices_from_authfile( const char * authfile , const char * username , unsigned max_devs , int verbose , FILE * debug_file , device_t * devices , unsigned * n_devs) | ['authfile', 'username', 'max_devs', 'verbose', 'debug_file', 'devices', 'n_devs'] | int get_devices_from_authfile(const char *authfile, const char *username,
unsigned max_devs, int verbose, FILE *debug_file,
device_t *devices, unsigned *n_devs) {
char *buf = NULL;
char *s_user, *s_token;
int retval = 0;
int fd = -1;
struct stat st;
struct passwd *pw = NULL, pw_s;
char buffer[BUFSIZE];
int gpu_ret;
FILE *opwfile = NULL;
unsigned i, j;
/* Ensure we never return uninitialized count. */
*n_devs = 0;
fd = open(authfile, O_RDONLY, 0);
if (fd < 0) {
if (verbose)
D(debug_file, "Cannot open file: %s (%s)", authfile, strerror(errno));
goto err;
}
if (fstat(fd, &st) < 0) {
if (verbose)
D(debug_file, "Cannot stat file: %s (%s)", authfile, strerror(errno));
goto err;
}
if (!S_ISREG(st.st_mode)) {
if (verbose)
D(debug_file, "%s is not a regular file", authfile);
goto err;
}
if (st.st_size == 0) {
if (verbose)
D(debug_file, "File %s is empty", authfile);
goto err;
}
gpu_ret = getpwuid_r(st.st_uid, &pw_s, buffer, sizeof(buffer), &pw);
if (gpu_ret != 0 || pw == NULL) {
D(debug_file, "Unable to retrieve credentials for uid %u, (%s)", st.st_uid,
strerror(errno));
goto err;
}
if (strcmp(pw->pw_name, username) != 0 && strcmp(pw->pw_name, "root") != 0) {
if (strcmp(username, "root") != 0) {
D(debug_file, "The owner of the authentication file is neither %s nor root",
username);
} else {
D(debug_file, "The owner of the authentication file is not root");
}
goto err;
}
opwfile = fdopen(fd, "r");
if (opwfile == NULL) {
if (verbose)
D(debug_file, "fdopen: %s", strerror(errno));
goto err;
}
buf = malloc(sizeof(char) * (DEVSIZE * max_devs));
if (!buf) {
if (verbose)
D(debug_file, "Unable to allocate memory");
goto err;
}
retval = -2;
while (fgets(buf, (int)(DEVSIZE * (max_devs - 1)), opwfile)) {
char *saveptr = NULL;
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = '\0';
if (verbose)
D(debug_file, "Authorization line: %s", buf);
s_user = strtok_r(buf, ":", &saveptr);
if (s_user && strcmp(username, s_user) == 0) {
if (verbose)
D(debug_file, "Matched user: %s", s_user);
retval = -1; // We found at least one line for the user
// only keep last line for this user
for (i = 0; i < *n_devs; i++) {
free(devices[i].keyHandle);
free(devices[i].publicKey);
devices[i].keyHandle = NULL;
devices[i].publicKey = NULL;
}
*n_devs = 0;
i = 0;
while ((s_token = strtok_r(NULL, ",", &saveptr))) {
devices[i].keyHandle = NULL;
devices[i].publicKey = NULL;
if ((*n_devs)++ > MAX_DEVS - 1) {
*n_devs = MAX_DEVS;
if (verbose)
D(debug_file, "Found more than %d devices, ignoring the remaining ones",
MAX_DEVS);
break;
}
if (verbose)
D(debug_file, "KeyHandle for device number %d: %s", i + 1, s_token);
devices[i].keyHandle = strdup(s_token);
if (!devices[i].keyHandle) {
if (verbose)
D(debug_file, "Unable to allocate memory for keyHandle number %d", i);
goto err;
}
s_token = strtok_r(NULL, ":", &saveptr);
if (!s_token) {
if (verbose)
D(debug_file, "Unable to retrieve publicKey number %d", i + 1);
goto err;
}
if (verbose)
D(debug_file, "publicKey for device number %d: %s", i + 1, s_token);
if (strlen(s_token) % 2 != 0) {
if (verbose)
D(debug_file, "Length of key number %d not even", i + 1);
goto err;
}
devices[i].key_len = strlen(s_token) / 2;
if (verbose)
D(debug_file, "Length of key number %d is %zu", i + 1, devices[i].key_len);
devices[i].publicKey =
malloc((sizeof(unsigned char) * devices[i].key_len));
if (!devices[i].publicKey) {
if (verbose)
D(debug_file, "Unable to allocate memory for publicKey number %d", i);
goto err;
}
for (j = 0; j < devices[i].key_len; j++) {
unsigned int x;
if (sscanf(&s_token[2 * j], "%2x", &x) != 1) {
if (verbose)
D(debug_file, "Invalid hex number in key");
goto err;
}
devices[i].publicKey[j] = (unsigned char)x;
}
i++;
}
}
}
if (verbose)
D(debug_file, "Found %d device(s) for user %s", *n_devs, username);
retval = 1;
goto out;
err:
for (i = 0; i < *n_devs; i++) {
free(devices[i].keyHandle);
free(devices[i].publicKey);
devices[i].keyHandle = NULL;
devices[i].publicKey = NULL;
}
*n_devs = 0;
out:
if (buf) {
free(buf);
buf = NULL;
}
if (opwfile)
fclose(opwfile);
else if (fd >= 0)
close(fd);
return retval;
} | 1097 | True | 1 |
CVE-2019-12209 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/Yubico/pam-u2f/commit/7db3386fcdb454e33a3ea30dcfb8e8960d4c3aa3', 'name': 'https://github.com/Yubico/pam-u2f/commit/7db3386fcdb454e33a3ea30dcfb8e8960d4c3aa3', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'name': 'https://developers.yubico.com/pam-u2f/Release_Notes.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/06/05/1', 'name': '[oss-security] 20190605 pam-u2f: CVE-2019-12210: debug_file file descriptor leak, CVE-2019-12209: symlink attack on u2f_keys leading to possible information leak', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Exploit', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/5FOR4ADC356JPCHAJI5UXZORLC3VNBPS/', 'name': 'FEDORA-2019-b6d3c8b0a8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00012.html', 'name': 'openSUSE-SU-2019:1708', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00018.html', 'name': 'openSUSE-SU-2019:1725', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/ZCGU6UQLI3ZTW3UYCTMQW7VDL5M4LCWR/', 'name': 'FEDORA-2019-cd8f4b9568', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:yubico:pam-u2f:1.0.7:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Yubico pam-u2f 1.0.7 attempts parsing of the configured authfile (default $HOME/.config/Yubico/u2f_keys) as root (unless openasuser was enabled), and does not properly verify that the path lacks symlinks pointing to other files on the system owned by root. If the debug option is enabled in the PAM configuration, part of the file contents of a symlink target will be logged, possibly revealing sensitive information.'}] | 2020-08-24T17:37Z | 2019-06-04T21:29Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | Gabriel Kihlman | 2019-06-04 10:06:41+02:00 | Drop privileges by default when opening user-related files
The module is typically executed as root and would sometimes
open files or follow symlinks that could be controlled from the
outside.
Drop privileges to the target user before opening any files.
Fixes CVE-2019-12209.
Thanks to Matthias Gerstner of the SUSE Security Team for reporting
the issue. | 7db3386fcdb454e33a3ea30dcfb8e8960d4c3aa3 | False | Yubico/pam-u2f | Pluggable Authentication Module (PAM) for U2F and FIDO2 | 2014-12-10 17:12:52 | 2022-07-13 06:29:36 | https://developers.yubico.com/pam-u2f/ | Yubico | 446.0 | 65.0 | pam_sm_authenticate | pam_sm_authenticate( pam_handle_t * pamh , int flags , int argc , const char ** argv) | ['pamh', 'flags', 'argc', 'argv'] | int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
const char **argv) {
struct passwd *pw = NULL, pw_s;
const char *user = NULL;
cfg_t cfg_st;
cfg_t *cfg = &cfg_st;
char buffer[BUFSIZE];
char *buf = NULL;
char *authfile_dir;
size_t authfile_dir_len;
int pgu_ret, gpn_ret;
int retval = PAM_IGNORE;
device_t *devices = NULL;
unsigned n_devices = 0;
int openasuser;
int should_free_origin = 0;
int should_free_appid = 0;
int should_free_auth_file = 0;
int should_free_authpending_file = 0;
parse_cfg(flags, argc, argv, cfg);
if (!cfg->origin) {
strcpy(buffer, DEFAULT_ORIGIN_PREFIX);
if (gethostname(buffer + strlen(DEFAULT_ORIGIN_PREFIX),
BUFSIZE - strlen(DEFAULT_ORIGIN_PREFIX)) == -1) {
DBG("Unable to get host name");
goto done;
}
DBG("Origin not specified, using \"%s\"", buffer);
cfg->origin = strdup(buffer);
if (!cfg->origin) {
DBG("Unable to allocate memory");
goto done;
} else {
should_free_origin = 1;
}
}
if (!cfg->appid) {
DBG("Appid not specified, using the same value of origin (%s)",
cfg->origin);
cfg->appid = strdup(cfg->origin);
if (!cfg->appid) {
DBG("Unable to allocate memory")
goto done;
} else {
should_free_appid = 1;
}
}
if (cfg->max_devs == 0) {
DBG("Maximum devices number not set. Using default (%d)", MAX_DEVS);
cfg->max_devs = MAX_DEVS;
}
devices = malloc(sizeof(device_t) * cfg->max_devs);
if (!devices) {
DBG("Unable to allocate memory");
retval = PAM_IGNORE;
goto done;
}
pgu_ret = pam_get_user(pamh, &user, NULL);
if (pgu_ret != PAM_SUCCESS || user == NULL) {
DBG("Unable to access user %s", user);
retval = PAM_CONV_ERR;
goto done;
}
DBG("Requesting authentication for user %s", user);
gpn_ret = getpwnam_r(user, &pw_s, buffer, sizeof(buffer), &pw);
if (gpn_ret != 0 || pw == NULL || pw->pw_dir == NULL ||
pw->pw_dir[0] != '/') {
DBG("Unable to retrieve credentials for user %s, (%s)", user,
strerror(errno));
retval = PAM_USER_UNKNOWN;
goto done;
}
DBG("Found user %s", user);
DBG("Home directory for %s is %s", user, pw->pw_dir);
if (!cfg->auth_file) {
buf = NULL;
authfile_dir = secure_getenv(DEFAULT_AUTHFILE_DIR_VAR);
if (!authfile_dir) {
DBG("Variable %s is not set. Using default value ($HOME/.config/)",
DEFAULT_AUTHFILE_DIR_VAR);
authfile_dir_len =
strlen(pw->pw_dir) + strlen("/.config") + strlen(DEFAULT_AUTHFILE) + 1;
buf = malloc(sizeof(char) * (authfile_dir_len));
if (!buf) {
DBG("Unable to allocate memory");
retval = PAM_IGNORE;
goto done;
}
snprintf(buf, authfile_dir_len,
"%s/.config%s", pw->pw_dir, DEFAULT_AUTHFILE);
} else {
DBG("Variable %s set to %s", DEFAULT_AUTHFILE_DIR_VAR, authfile_dir);
authfile_dir_len = strlen(authfile_dir) + strlen(DEFAULT_AUTHFILE) + 1;
buf = malloc(sizeof(char) * (authfile_dir_len));
if (!buf) {
DBG("Unable to allocate memory");
retval = PAM_IGNORE;
goto done;
}
snprintf(buf, authfile_dir_len,
"%s%s", authfile_dir, DEFAULT_AUTHFILE);
}
DBG("Using default authentication file %s", buf);
cfg->auth_file = buf; /* cfg takes ownership */
should_free_auth_file = 1;
buf = NULL;
} else {
DBG("Using authentication file %s", cfg->auth_file);
}
openasuser = geteuid() == 0 && cfg->openasuser;
if (openasuser) {
if (seteuid(pw_s.pw_uid)) {
DBG("Unable to switch user to uid %i", pw_s.pw_uid);
retval = PAM_IGNORE;
goto done;
}
DBG("Switched to uid %i", pw_s.pw_uid);
}
retval = get_devices_from_authfile(cfg->auth_file, user, cfg->max_devs,
cfg->debug, cfg->debug_file,
devices, &n_devices);
if (openasuser) {
if (seteuid(0)) {
DBG("Unable to switch back to uid 0");
retval = PAM_IGNORE;
goto done;
}
DBG("Switched back to uid 0");
}
if (retval != 1) {
// for nouserok; make sure errors in get_devices_from_authfile don't
// result in valid devices
n_devices = 0;
}
if (n_devices == 0) {
if (cfg->nouserok) {
DBG("Found no devices but nouserok specified. Skipping authentication");
retval = PAM_SUCCESS;
goto done;
} else if (retval != 1) {
DBG("Unable to get devices from file %s", cfg->auth_file);
retval = PAM_AUTHINFO_UNAVAIL;
goto done;
} else {
DBG("Found no devices. Aborting.");
retval = PAM_AUTHINFO_UNAVAIL;
goto done;
}
}
// Determine the full path for authpending_file in order to emit touch request notifications
if (!cfg->authpending_file) {
int actual_size = snprintf(buffer, BUFSIZE, DEFAULT_AUTHPENDING_FILE_PATH, getuid());
if (actual_size >= 0 && actual_size < BUFSIZE) {
cfg->authpending_file = strdup(buffer);
}
if (!cfg->authpending_file) {
DBG("Unable to allocate memory for the authpending_file, touch request notifications will not be emitted");
} else {
should_free_authpending_file = 1;
}
} else {
if (strlen(cfg->authpending_file) == 0) {
DBG("authpending_file is set to an empty value, touch request notifications will be disabled");
cfg->authpending_file = NULL;
}
}
int authpending_file_descriptor = -1;
if (cfg->authpending_file) {
DBG("Using file '%s' for emitting touch request notifications", cfg->authpending_file);
// Open (or create) the authpending_file to indicate that we start waiting for a touch
authpending_file_descriptor =
open(cfg->authpending_file, O_RDONLY | O_CREAT | O_CLOEXEC | O_NOFOLLOW | O_NOCTTY, 0664);
if (authpending_file_descriptor < 0) {
DBG("Unable to emit 'authentication started' notification by opening the file '%s', (%s)",
cfg->authpending_file, strerror(errno));
}
}
if (cfg->manual == 0) {
if (cfg->interactive) {
converse(pamh, PAM_PROMPT_ECHO_ON,
cfg->prompt != NULL ? cfg->prompt : DEFAULT_PROMPT);
}
retval = do_authentication(cfg, devices, n_devices, pamh);
} else {
retval = do_manual_authentication(cfg, devices, n_devices, pamh);
}
// Close the authpending_file to indicate that we stop waiting for a touch
if (authpending_file_descriptor >= 0) {
if (close(authpending_file_descriptor) < 0) {
DBG("Unable to emit 'authentication stopped' notification by closing the file '%s', (%s)",
cfg->authpending_file, strerror(errno));
}
}
if (retval != 1) {
DBG("do_authentication returned %d", retval);
retval = PAM_AUTH_ERR;
goto done;
}
retval = PAM_SUCCESS;
done:
free_devices(devices, n_devices);
if (buf) {
free(buf);
buf = NULL;
}
if (should_free_origin) {
free((char *) cfg->origin);
cfg->origin = NULL;
}
if (should_free_appid) {
free((char *) cfg->appid);
cfg->appid = NULL;
}
if (should_free_auth_file) {
free((char *) cfg->auth_file);
cfg->auth_file = NULL;
}
if (should_free_authpending_file) {
free((char *) cfg->authpending_file);
cfg->authpending_file = NULL;
}
if (cfg->alwaysok && retval != PAM_SUCCESS) {
DBG("alwaysok needed (otherwise return with %d)", retval);
retval = PAM_SUCCESS;
}
DBG("done. [%s]", pam_strerror(pamh, retval));
if (cfg->is_custom_debug_file) {
fclose(cfg->debug_file);
}
return retval;
} | 1300 | True | 1 |
|
CVE-2021-28662 | 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': 'http://www.squid-cache.org/Versions/v6/changesets/squid-6-051824924c709bd6162a378f746fb859454c674e.patch', 'name': 'http://www.squid-cache.org/Versions/v6/changesets/squid-6-051824924c709bd6162a378f746fb859454c674e.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/squid-cache/squid/security/advisories/GHSA-jjq6-mh2h-g39h', 'name': 'https://github.com/squid-cache/squid/security/advisories/GHSA-jjq6-mh2h-g39h', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/squid-cache/squid/commit/051824924c709bd6162a378f746fb859454c674e', 'name': 'https://github.com/squid-cache/squid/commit/051824924c709bd6162a378f746fb859454c674e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4924', 'name': 'DSA-4924', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/T4EPIWUZDJAXADDHVOPKRBTQHPBR6H66/', 'name': 'FEDORA-2021-24af72ff2c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LSQ3U54ZCNXR44QRPW3AV2VCS6K3TKCF/', 'name': 'FEDORA-2021-c0bec55ec7', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-116'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:squid-cache:squid:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0', 'versionEndExcluding': '5.0.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:squid-cache:squid:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.0.1', 'versionEndExcluding': '4.15', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in Squid 4.x before 4.15 and 5.x before 5.0.6. If a remote server sends a certain response header over HTTP or HTTPS, there is a denial of service. This header can plausibly occur in benign network traffic.'}] | 2022-04-19T03:56Z | 2021-05-27T12:15Z | Improper Encoding or Escaping of Output | The software prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. |
Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
Most software follows a certain protocol that uses structured messages for communication between components, such as queries or commands. These structured messages can contain raw data interspersed with metadata or control information. For example, "GET /index.html HTTP/1.1" is a structured message containing a command ("GET") with a single argument ("/index.html") and metadata about which protocol version is being used ("HTTP/1.1").
If an application uses attacker-supplied inputs to construct a structured message without properly encoding or escaping, then the attacker could insert special characters that will cause the data to be interpreted as control information or metadata. Consequently, the component that receives the output will perform the wrong operations, or otherwise interpret the data incorrectly.
| https://cwe.mitre.org/data/definitions/116.html | 0 | Alex Rousskov | 2021-03-16 11:45:11-04:00 | Merge pull request from GHSA-jjq6-mh2h-g39h | 051824924c709bd6162a378f746fb859454c674e | False | squid-cache/squid | Squid Web Proxy Cache | 2014-09-27 00:59:40 | 2022-08-26 19:03:33 | http://www.squid-cache.org/ | squid-cache | 1391.0 | 379.0 | Http::HeaderLookupTable_t::lookup | Http::HeaderLookupTable_t::lookup( const char * buf , const std :: size_t len) const | ['buf', 'len'] | HeaderLookupTable_t::lookup (const char *buf, const std::size_t len) const {
const HeaderTableRecord *r = HttpHeaderHashTable::lookup(buf, len);
if (!r)
return BadHdr;
return *r;
} | 44 | True | 1 |
CVE-2021-46784 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | nan | [{'url': 'http://www.squid-cache.org/Versions/v5/changesets/SQUID-2021_7.patch', 'name': 'http://www.squid-cache.org/Versions/v5/changesets/SQUID-2021_7.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/squid-cache/squid/security/advisories/GHSA-f5cp-6rh3-284w', 'name': 'https://github.com/squid-cache/squid/security/advisories/GHSA-f5cp-6rh3-284w', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Patch', 'Third Party Advisory']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2021-46784', 'name': 'https://security-tracker.debian.org/tracker/CVE-2021-46784', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/squid-cache/squid/commit/5e2ea2b13bd98f53e29964ca26bb0d602a8a12b9', 'name': 'https://github.com/squid-cache/squid/commit/5e2ea2b13bd98f53e29964ca26bb0d602a8a12b9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.squid-cache.org/Versions/v4/changesets/SQUID-2021_7.patch', 'name': 'http://www.squid-cache.org/Versions/v4/changesets/SQUID-2021_7.patch', 'refsource': 'MISC', 'tags': ['Broken Link']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | nan | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:squid-cache:squid:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0', 'versionEndIncluding': '3.5.28', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:squid-cache:squid:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0', 'versionEndExcluding': '5.6', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:squid-cache:squid:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.0', 'versionEndIncluding': '4.17', '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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:12.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Squid 3.x through 3.5.28, 4.x through 4.17, and 5.x before 5.6, due to improper buffer management, a Denial of Service can occur when processing long Gopher server responses.'}] | 2022-07-27T17:26Z | 2022-07-17T22: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 | Joshua Rogers | 2022-04-18 13:42:36+00:00 | Improve handling of Gopher responses (#1022) | 5e2ea2b13bd98f53e29964ca26bb0d602a8a12b9 | False | squid-cache/squid | Squid Web Proxy Cache | 2014-09-27 00:59:40 | 2022-08-26 19:03:33 | http://www.squid-cache.org/ | squid-cache | 1391.0 | 379.0 | gopherToHTML | gopherToHTML( GopherStateData * gopherState , char * inbuf , int len) | ['gopherState', 'inbuf', 'len'] | gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
{
char *pos = inbuf;
char *lpos = NULL;
char *tline = NULL;
LOCAL_ARRAY(char, line, TEMP_BUF_SIZE);
LOCAL_ARRAY(char, tmpbuf, TEMP_BUF_SIZE);
char *name = NULL;
char *selector = NULL;
char *host = NULL;
char *port = NULL;
char *escaped_selector = NULL;
const char *icon_url = NULL;
char gtype;
StoreEntry *entry = NULL;
memset(tmpbuf, '\0', TEMP_BUF_SIZE);
memset(line, '\0', TEMP_BUF_SIZE);
entry = gopherState->entry;
if (gopherState->conversion == GopherStateData::HTML_INDEX_PAGE) {
char *html_url = html_quote(entry->url());
gopherHTMLHeader(entry, "Gopher Index %s", html_url);
storeAppendPrintf(entry,
"<p>This is a searchable Gopher index. Use the search\n"
"function of your browser to enter search terms.\n"
"<ISINDEX>\n");
gopherHTMLFooter(entry);
/* now let start sending stuff to client */
entry->flush();
gopherState->HTML_header_added = 1;
return;
}
if (gopherState->conversion == GopherStateData::HTML_CSO_PAGE) {
char *html_url = html_quote(entry->url());
gopherHTMLHeader(entry, "CSO Search of %s", html_url);
storeAppendPrintf(entry,
"<P>A CSO database usually contains a phonebook or\n"
"directory. Use the search function of your browser to enter\n"
"search terms.</P><ISINDEX>\n");
gopherHTMLFooter(entry);
/* now let start sending stuff to client */
entry->flush();
gopherState->HTML_header_added = 1;
return;
}
String outbuf;
if (!gopherState->HTML_header_added) {
if (gopherState->conversion == GopherStateData::HTML_CSO_RESULT)
gopherHTMLHeader(entry, "CSO Search Result", NULL);
else
gopherHTMLHeader(entry, "Gopher Menu", NULL);
outbuf.append ("<PRE>");
gopherState->HTML_header_added = 1;
gopherState->HTML_pre = 1;
}
while (pos < inbuf + len) {
int llen;
int left = len - (pos - inbuf);
lpos = (char *)memchr(pos, '\n', left);
if (lpos) {
++lpos; /* Next line is after \n */
llen = lpos - pos;
} else {
llen = left;
}
if (gopherState->len + llen >= TEMP_BUF_SIZE) {
debugs(10, DBG_IMPORTANT, "GopherHTML: Buffer overflow. Lost some data on URL: " << entry->url() );
llen = TEMP_BUF_SIZE - gopherState->len - 1;
gopherState->overflowed = true; // may already be true
}
if (!lpos) {
/* there is no complete line in inbuf */
/* copy it to temp buffer */
/* note: llen is adjusted above */
memcpy(gopherState->buf + gopherState->len, pos, llen);
gopherState->len += llen;
break;
}
if (gopherState->len != 0) {
/* there is something left from last tx. */
memcpy(line, gopherState->buf, gopherState->len);
memcpy(line + gopherState->len, pos, llen);
llen += gopherState->len;
gopherState->len = 0;
} else {
memcpy(line, pos, llen);
}
line[llen + 1] = '\0';
/* move input to next line */
pos = lpos;
/* at this point. We should have one line in buffer to process */
if (*line == '.') {
/* skip it */
memset(line, '\0', TEMP_BUF_SIZE);
continue;
}
switch (gopherState->conversion) {
case GopherStateData::HTML_INDEX_RESULT:
case GopherStateData::HTML_DIR: {
tline = line;
gtype = *tline;
++tline;
name = tline;
selector = strchr(tline, TAB);
if (selector) {
*selector = '\0';
++selector;
host = strchr(selector, TAB);
if (host) {
*host = '\0';
++host;
port = strchr(host, TAB);
if (port) {
char *junk;
port[0] = ':';
junk = strchr(host, TAB);
if (junk)
*junk++ = 0; /* Chop port */
else {
junk = strchr(host, '\r');
if (junk)
*junk++ = 0; /* Chop port */
else {
junk = strchr(host, '\n');
if (junk)
*junk++ = 0; /* Chop port */
}
}
if ((port[1] == '0') && (!port[2]))
port[0] = 0; /* 0 means none */
}
/* escape a selector here */
escaped_selector = xstrdup(rfc1738_escape_part(selector));
switch (gtype) {
case GOPHER_DIRECTORY:
icon_url = mimeGetIconURL("internal-menu");
break;
case GOPHER_HTML:
case GOPHER_FILE:
icon_url = mimeGetIconURL("internal-text");
break;
case GOPHER_INDEX:
case GOPHER_CSO:
icon_url = mimeGetIconURL("internal-index");
break;
case GOPHER_IMAGE:
case GOPHER_GIF:
case GOPHER_PLUS_IMAGE:
icon_url = mimeGetIconURL("internal-image");
break;
case GOPHER_SOUND:
case GOPHER_PLUS_SOUND:
icon_url = mimeGetIconURL("internal-sound");
break;
case GOPHER_PLUS_MOVIE:
icon_url = mimeGetIconURL("internal-movie");
break;
case GOPHER_TELNET:
case GOPHER_3270:
icon_url = mimeGetIconURL("internal-telnet");
break;
case GOPHER_BIN:
case GOPHER_MACBINHEX:
case GOPHER_DOSBIN:
case GOPHER_UUENCODED:
icon_url = mimeGetIconURL("internal-binary");
break;
case GOPHER_INFO:
icon_url = NULL;
break;
case GOPHER_WWW:
icon_url = mimeGetIconURL("internal-link");
break;
default:
icon_url = mimeGetIconURL("internal-unknown");
break;
}
memset(tmpbuf, '\0', TEMP_BUF_SIZE);
if ((gtype == GOPHER_TELNET) || (gtype == GOPHER_3270)) {
if (strlen(escaped_selector) != 0)
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG border=\"0\" SRC=\"%s\"> <A HREF=\"telnet://%s@%s%s%s/\">%s</A>\n",
icon_url, escaped_selector, rfc1738_escape_part(host),
*port ? ":" : "", port, html_quote(name));
else
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG border=\"0\" SRC=\"%s\"> <A HREF=\"telnet://%s%s%s/\">%s</A>\n",
icon_url, rfc1738_escape_part(host), *port ? ":" : "",
port, html_quote(name));
} else if (gtype == GOPHER_INFO) {
snprintf(tmpbuf, TEMP_BUF_SIZE, "\t%s\n", html_quote(name));
} else {
if (strncmp(selector, "GET /", 5) == 0) {
/* WWW link */
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG border=\"0\" SRC=\"%s\"> <A HREF=\"http://%s/%s\">%s</A>\n",
icon_url, host, rfc1738_escape_unescaped(selector + 5), html_quote(name));
} else if (gtype == GOPHER_WWW) {
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG border=\"0\" SRC=\"%s\"> <A HREF=\"%s\">%s</A>\n",
icon_url, rfc1738_escape_unescaped(selector), html_quote(name));
} else {
/* Standard link */
snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG border=\"0\" SRC=\"%s\"> <A HREF=\"gopher://%s/%c%s\">%s</A>\n",
icon_url, host, gtype, escaped_selector, html_quote(name));
}
}
safe_free(escaped_selector);
outbuf.append(tmpbuf);
} else {
memset(line, '\0', TEMP_BUF_SIZE);
continue;
}
} else {
memset(line, '\0', TEMP_BUF_SIZE);
continue;
}
break;
} /* HTML_DIR, HTML_INDEX_RESULT */
case GopherStateData::HTML_CSO_RESULT: {
if (line[0] == '-') {
int code, recno;
char *s_code, *s_recno, *result;
s_code = strtok(line + 1, ":\n");
s_recno = strtok(NULL, ":\n");
result = strtok(NULL, "\n");
if (!result)
break;
code = atoi(s_code);
recno = atoi(s_recno);
if (code != 200)
break;
if (gopherState->cso_recno != recno) {
snprintf(tmpbuf, TEMP_BUF_SIZE, "</PRE><HR noshade size=\"1px\"><H2>Record# %d<br><i>%s</i></H2>\n<PRE>", recno, html_quote(result));
gopherState->cso_recno = recno;
} else {
snprintf(tmpbuf, TEMP_BUF_SIZE, "%s\n", html_quote(result));
}
outbuf.append(tmpbuf);
break;
} else {
int code;
char *s_code, *result;
s_code = strtok(line, ":");
result = strtok(NULL, "\n");
if (!result)
break;
code = atoi(s_code);
switch (code) {
case 200: {
/* OK */
/* Do nothing here */
break;
}
case 102: /* Number of matches */
case 501: /* No Match */
case 502: { /* Too Many Matches */
/* Print the message the server returns */
snprintf(tmpbuf, TEMP_BUF_SIZE, "</PRE><HR noshade size=\"1px\"><H2>%s</H2>\n<PRE>", html_quote(result));
outbuf.append(tmpbuf);
break;
}
}
}
break;
} /* HTML_CSO_RESULT */
default:
break; /* do nothing */
} /* switch */
} /* while loop */
if (outbuf.size() > 0) {
entry->append(outbuf.rawBuf(), outbuf.size());
/* now let start sending stuff to client */
entry->flush();
}
outbuf.clean();
return;
} | 1451 | True | 1 |
CVE-2019-12875 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:P/A:N | NETWORK | LOW | SINGLE | NONE | PARTIAL | NONE | 4.0 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://github.com/sroracle/abuild/commit/4f90ce92778d0ee302e288def75591b96a397c8b', 'name': 'https://github.com/sroracle/abuild/commit/4f90ce92778d0ee302e288def75591b96a397c8b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://code.foxkit.us/adelie/packages/commit/15b160780c6eeff7048063c099a7f8757e1d8391', 'name': 'https://code.foxkit.us/adelie/packages/commit/15b160780c6eeff7048063c099a7f8757e1d8391', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190625-0005/', 'name': 'https://security.netapp.com/advisory/ntap-20190625-0005/', 'refsource': 'CONFIRM', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}, {'lang': 'en', 'value': 'CWE-862'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:alpinelinux:abuild:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.4.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Alpine Linux abuild through 3.4.0 allows an unprivileged member of the abuild group to add an untrusted package via a --keys-dir option that causes acceptance of an untrusted signing key.'}] | 2020-08-24T17:37Z | 2019-06-18T19: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 | Max Rees | 2019-06-13 23:19:54-04:00 | abuild-sudo: don't allow --keys-dir
Not allowing --allow-untrusted is obviously a good idea, but it can be
trivially bypassed if --keys-dir is allowed:
$ abuild-apk add foo-1-r0.apk
ERROR: foo-1-r0.apk: UNTRUSTED signature
$ abuild-apk --allow-untrusted add foo-1-r0.apk
abuild-apk: --allow-untrusted: not allowed option
$ cp -rp /etc/apk/keys /tmp/keys
$ cp untrusted.pub /tmp/keys
$ abuild-apk --keys-dir /tmp/keys add foo-1-r0.apk
(1/1) Installing foo (1-r0)
OK: 4319 MiB in 806 packages
If both --allow-untrusted and --keys-dir are not allowed, then it should
no longer be possible for an unprivileged member of the abuild group to
add an untrusted package.
$ abuild-apk --keys-dir /tmp/keys add foo-1-r0.apk
abuild-apk: --keys-dir: not allowed option | 4f90ce92778d0ee302e288def75591b96a397c8b | False | sroracle/abuild | Build script to build Alpine packages (mirror) | 2019-06-14 03:21:56 | 2019-06-14 03:23:24 | http://git.alpinelinux.org/cgit/abuild/ | sroracle | 0.0 | 0.0 | main | main( int argc , const char * argv [ ]) | ['argc'] | int main(int argc, const char *argv[])
{
struct group *grent;
const char *cmd;
const char *path;
int i;
struct passwd *pw;
grent = getgrnam(ABUILD_GROUP);
if (grent == NULL)
errx(1, "%s: Group not found", ABUILD_GROUP);
char *name = NULL;
pw = getpwuid(getuid());
if (pw)
name = pw->pw_name;
if (!is_in_group(grent->gr_gid)) {
errx(1, "User %s is not a member of group %s\n",
name ? name : "(unknown)", ABUILD_GROUP);
}
if (name == NULL)
warnx("Could not find username for uid %d\n", getuid());
setenv("USER", name ?: "", 1);
cmd = strrchr(argv[0], '/');
if (cmd)
cmd++;
else
cmd = argv[0];
cmd = strchr(cmd, '-');
if (cmd == NULL)
errx(1, "Calling command has no '-'");
cmd++;
path = get_command_path(cmd);
if (path == NULL)
errx(1, "%s: Not a valid subcommand", cmd);
/* we dont allow --allow-untrusted option */
for (i = 1; i < argc; i++)
if (strcmp(argv[i], "--allow-untrusted") == 0)
errx(1, "%s: not allowed option", "--allow-untrusted");
argv[0] = path;
/* set our uid to root so bbsuid --install works */
setuid(0);
/* set our gid to root so apk commit hooks run with the same gid as for "sudo apk add ..." */
setgid(0);
execv(path, (char * const*)argv);
perror(path);
return 1;
} | 286 | True | 1 |
CVE-2019-12875 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:P/A:N | NETWORK | LOW | SINGLE | NONE | PARTIAL | NONE | 4.0 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://github.com/sroracle/abuild/commit/4f90ce92778d0ee302e288def75591b96a397c8b', 'name': 'https://github.com/sroracle/abuild/commit/4f90ce92778d0ee302e288def75591b96a397c8b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://code.foxkit.us/adelie/packages/commit/15b160780c6eeff7048063c099a7f8757e1d8391', 'name': 'https://code.foxkit.us/adelie/packages/commit/15b160780c6eeff7048063c099a7f8757e1d8391', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20190625-0005/', 'name': 'https://security.netapp.com/advisory/ntap-20190625-0005/', 'refsource': 'CONFIRM', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}, {'lang': 'en', 'value': 'CWE-862'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:alpinelinux:abuild:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.4.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Alpine Linux abuild through 3.4.0 allows an unprivileged member of the abuild group to add an untrusted package via a --keys-dir option that causes acceptance of an untrusted signing key.'}] | 2020-08-24T17:37Z | 2019-06-18T19:15Z | Missing Authorization | The software does not perform an authorization check when an actor attempts to access a resource or perform an action. |
Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
When access control checks are not applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.
| https://cwe.mitre.org/data/definitions/862.html | 0 | Max Rees | 2019-06-13 23:19:54-04:00 | abuild-sudo: don't allow --keys-dir
Not allowing --allow-untrusted is obviously a good idea, but it can be
trivially bypassed if --keys-dir is allowed:
$ abuild-apk add foo-1-r0.apk
ERROR: foo-1-r0.apk: UNTRUSTED signature
$ abuild-apk --allow-untrusted add foo-1-r0.apk
abuild-apk: --allow-untrusted: not allowed option
$ cp -rp /etc/apk/keys /tmp/keys
$ cp untrusted.pub /tmp/keys
$ abuild-apk --keys-dir /tmp/keys add foo-1-r0.apk
(1/1) Installing foo (1-r0)
OK: 4319 MiB in 806 packages
If both --allow-untrusted and --keys-dir are not allowed, then it should
no longer be possible for an unprivileged member of the abuild group to
add an untrusted package.
$ abuild-apk --keys-dir /tmp/keys add foo-1-r0.apk
abuild-apk: --keys-dir: not allowed option | 4f90ce92778d0ee302e288def75591b96a397c8b | False | sroracle/abuild | Build script to build Alpine packages (mirror) | 2019-06-14 03:21:56 | 2019-06-14 03:23:24 | http://git.alpinelinux.org/cgit/abuild/ | sroracle | 0.0 | 0.0 | main | main( int argc , const char * argv [ ]) | ['argc'] | int main(int argc, const char *argv[])
{
struct group *grent;
const char *cmd;
const char *path;
int i;
struct passwd *pw;
grent = getgrnam(ABUILD_GROUP);
if (grent == NULL)
errx(1, "%s: Group not found", ABUILD_GROUP);
char *name = NULL;
pw = getpwuid(getuid());
if (pw)
name = pw->pw_name;
if (!is_in_group(grent->gr_gid)) {
errx(1, "User %s is not a member of group %s\n",
name ? name : "(unknown)", ABUILD_GROUP);
}
if (name == NULL)
warnx("Could not find username for uid %d\n", getuid());
setenv("USER", name ?: "", 1);
cmd = strrchr(argv[0], '/');
if (cmd)
cmd++;
else
cmd = argv[0];
cmd = strchr(cmd, '-');
if (cmd == NULL)
errx(1, "Calling command has no '-'");
cmd++;
path = get_command_path(cmd);
if (path == NULL)
errx(1, "%s: Not a valid subcommand", cmd);
/* we dont allow --allow-untrusted option */
for (i = 1; i < argc; i++)
if (strcmp(argv[i], "--allow-untrusted") == 0)
errx(1, "%s: not allowed option", "--allow-untrusted");
argv[0] = path;
/* set our uid to root so bbsuid --install works */
setuid(0);
/* set our gid to root so apk commit hooks run with the same gid as for "sudo apk add ..." */
setgid(0);
execv(path, (char * const*)argv);
perror(path);
return 1;
} | 286 | True | 1 |
CVE-2019-12900 | 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://gitlab.com/federicomenaquintero/bzip2/commit/74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc', 'name': 'https://gitlab.com/federicomenaquintero/bzip2/commit/74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/06/msg00021.html', 'name': '[debian-lts-announce] 20190624 [SECURITY] [DLA 1833-1] bzip2 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4038-2/', 'name': 'USN-4038-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4038-1/', 'name': 'USN-4038-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Jul/22', 'name': '20190715 [slackware-security] bzip2 (SSA:2019-195-01)', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/153644/Slackware-Security-Advisory-bzip2-Updates.html', 'name': 'http://packetstormsecurity.com/files/153644/Slackware-Security-Advisory-bzip2-Updates.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/07/msg00014.html', 'name': '[debian-lts-announce] 20190718 [SECURITY] [DLA 1833-2] bzip2 regression update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00040.html', 'name': 'openSUSE-SU-2019:1781', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.FreeBSD.org/advisories/FreeBSD-SA-19:18.bzip2.asc', 'name': 'FreeBSD-SA-19:18', 'refsource': 'FREEBSD', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://seclists.org/bugtraq/2019/Aug/4', 'name': '20190806 FreeBSD Security Advisory FreeBSD-SA-19:18.bzip2', 'refsource': 'BUGTRAQ', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/153957/FreeBSD-Security-Advisory-FreeBSD-SA-19-18.bzip2.html', 'name': 'http://packetstormsecurity.com/files/153957/FreeBSD-Security-Advisory-FreeBSD-SA-19-18.bzip2.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00050.html', 'name': 'openSUSE-SU-2019:1918', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4146-1/', 'name': 'USN-4146-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4146-2/', 'name': 'USN-4146-2', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00012.html', 'name': '[debian-lts-announce] 20191010 [SECURITY] [DLA 1953-1] clamav security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/10/msg00018.html', 'name': '[debian-lts-announce] 20191014 [SECURITY] [DLA 1953-2] clamav regression update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://support.f5.com/csp/article/K68713584?utm_source=f5support&utm_medium=RSS', 'name': 'https://support.f5.com/csp/article/K68713584?utm_source=f5support&utm_medium=RSS', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00078.html', 'name': 'openSUSE-SU-2019:2595', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00000.html', 'name': 'openSUSE-SU-2019:2597', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/ra0adb9653c7de9539b93cc8434143b655f753b9f60580ff260becb2b@%3Cusers.kafka.apache.org%3E', 'name': '[kafka-users] 20200413 CVEs for the dependency software guava and rocksdbjni of Kafka', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'name': 'https://www.oracle.com/security-alerts/cpuoct2020.html', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rda98305669476c4d90cc8527c4deda7e449019dd1fe9936b56671dd4@%3Cuser.flink.apache.org%3E', 'name': '[flink-user] 20210716 Flink 1.13.1 - Vulnerabilities CVE-2019-12900 for librocksdbjni', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rce8cd8c30f60604b580ea01bebda8a671a25c9a1629f409fc24e7774@%3Cuser.flink.apache.org%3E', 'name': '[flink-user] 20210717 Re: Flink 1.13.1 - Vulnerabilities CVE-2019-12900 for librocksdbjni', 'refsource': 'MLIST', '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:bzip:bzip2:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.0.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.04:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:12.04:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p9:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p10:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.3:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p12:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.3:p1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:11.2:p11:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:freebsd:freebsd:12.0:p7:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.10.0', 'versionEndExcluding': '3.10.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.9.0', 'versionEndExcluding': '3.9.11', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.8.0', 'versionEndExcluding': '3.8.13', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:python:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.0', 'versionEndExcluding': '3.7.13', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'BZ2_decompress in decompress.c in bzip2 through 1.0.6 has an out-of-bounds write when there are many selectors.'}] | 2022-06-27T16:36Z | 2019-06-19T23: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 | Albert Astals Cid | 2019-05-28 19:35:18+02:00 | Make sure nSelectors is not out of range
nSelectors is used in a loop from 0 to nSelectors to access selectorMtf
which is
UChar selectorMtf[BZ_MAX_SELECTORS];
so if nSelectors is bigger than BZ_MAX_SELECTORS it'll do an invalid memory
access
Fixes out of bounds access discovered while fuzzying karchive | 74de1e2e6ffc9d51ef9824db71a8ffee5962cdbc | False | visit repo url | visit repo url | visit repo url | visit repo url | visit repo url | federicomenaquintero | visit repo url | visit repo url | BZ2_decompress | BZ2_decompress( DState * s) | ['s'] | Int32 BZ2_decompress ( DState* s )
{
UChar uc;
Int32 retVal;
Int32 minLen, maxLen;
bz_stream* strm = s->strm;
/* stuff that needs to be saved/restored */
Int32 i;
Int32 j;
Int32 t;
Int32 alphaSize;
Int32 nGroups;
Int32 nSelectors;
Int32 EOB;
Int32 groupNo;
Int32 groupPos;
Int32 nextSym;
Int32 nblockMAX;
Int32 nblock;
Int32 es;
Int32 N;
Int32 curr;
Int32 zt;
Int32 zn;
Int32 zvec;
Int32 zj;
Int32 gSel;
Int32 gMinlen;
Int32* gLimit;
Int32* gBase;
Int32* gPerm;
if (s->state == BZ_X_MAGIC_1) {
/*initialise the save area*/
s->save_i = 0;
s->save_j = 0;
s->save_t = 0;
s->save_alphaSize = 0;
s->save_nGroups = 0;
s->save_nSelectors = 0;
s->save_EOB = 0;
s->save_groupNo = 0;
s->save_groupPos = 0;
s->save_nextSym = 0;
s->save_nblockMAX = 0;
s->save_nblock = 0;
s->save_es = 0;
s->save_N = 0;
s->save_curr = 0;
s->save_zt = 0;
s->save_zn = 0;
s->save_zvec = 0;
s->save_zj = 0;
s->save_gSel = 0;
s->save_gMinlen = 0;
s->save_gLimit = NULL;
s->save_gBase = NULL;
s->save_gPerm = NULL;
}
/*restore from the save area*/
i = s->save_i;
j = s->save_j;
t = s->save_t;
alphaSize = s->save_alphaSize;
nGroups = s->save_nGroups;
nSelectors = s->save_nSelectors;
EOB = s->save_EOB;
groupNo = s->save_groupNo;
groupPos = s->save_groupPos;
nextSym = s->save_nextSym;
nblockMAX = s->save_nblockMAX;
nblock = s->save_nblock;
es = s->save_es;
N = s->save_N;
curr = s->save_curr;
zt = s->save_zt;
zn = s->save_zn;
zvec = s->save_zvec;
zj = s->save_zj;
gSel = s->save_gSel;
gMinlen = s->save_gMinlen;
gLimit = s->save_gLimit;
gBase = s->save_gBase;
gPerm = s->save_gPerm;
retVal = BZ_OK;
switch (s->state) {
GET_UCHAR(BZ_X_MAGIC_1, uc);
if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC);
GET_UCHAR(BZ_X_MAGIC_2, uc);
if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC);
GET_UCHAR(BZ_X_MAGIC_3, uc)
if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC);
GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
if (s->blockSize100k < (BZ_HDR_0 + 1) ||
s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC);
s->blockSize100k -= BZ_HDR_0;
if (s->smallDecompress) {
s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
s->ll4 = BZALLOC(
((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
);
if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
} else {
s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
}
GET_UCHAR(BZ_X_BLKHDR_1, uc);
if (uc == 0x17) goto endhdr_2;
if (uc != 0x31) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_2, uc);
if (uc != 0x41) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_3, uc);
if (uc != 0x59) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_4, uc);
if (uc != 0x26) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_5, uc);
if (uc != 0x53) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_6, uc);
if (uc != 0x59) RETURN(BZ_DATA_ERROR);
s->currBlockNo++;
if (s->verbosity >= 2)
VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo );
s->storedBlockCRC = 0;
GET_UCHAR(BZ_X_BCRC_1, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_2, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_3, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_4, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1);
s->origPtr = 0;
GET_UCHAR(BZ_X_ORIGPTR_1, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
GET_UCHAR(BZ_X_ORIGPTR_2, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
GET_UCHAR(BZ_X_ORIGPTR_3, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
if (s->origPtr < 0)
RETURN(BZ_DATA_ERROR);
if (s->origPtr > 10 + 100000*s->blockSize100k)
RETURN(BZ_DATA_ERROR);
/*--- Receive the mapping table ---*/
for (i = 0; i < 16; i++) {
GET_BIT(BZ_X_MAPPING_1, uc);
if (uc == 1)
s->inUse16[i] = True; else
s->inUse16[i] = False;
}
for (i = 0; i < 256; i++) s->inUse[i] = False;
for (i = 0; i < 16; i++)
if (s->inUse16[i])
for (j = 0; j < 16; j++) {
GET_BIT(BZ_X_MAPPING_2, uc);
if (uc == 1) s->inUse[i * 16 + j] = True;
}
makeMaps_d ( s );
if (s->nInUse == 0) RETURN(BZ_DATA_ERROR);
alphaSize = s->nInUse+2;
/*--- Now the selectors ---*/
GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
for (i = 0; i < nSelectors; i++) {
j = 0;
while (True) {
GET_BIT(BZ_X_SELECTOR_3, uc);
if (uc == 0) break;
j++;
if (j >= nGroups) RETURN(BZ_DATA_ERROR);
}
s->selectorMtf[i] = j;
}
/*--- Undo the MTF values for the selectors. ---*/
{
UChar pos[BZ_N_GROUPS], tmp, v;
for (v = 0; v < nGroups; v++) pos[v] = v;
for (i = 0; i < nSelectors; i++) {
v = s->selectorMtf[i];
tmp = pos[v];
while (v > 0) { pos[v] = pos[v-1]; v--; }
pos[0] = tmp;
s->selector[i] = tmp;
}
}
/*--- Now the coding tables ---*/
for (t = 0; t < nGroups; t++) {
GET_BITS(BZ_X_CODING_1, curr, 5);
for (i = 0; i < alphaSize; i++) {
while (True) {
if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR);
GET_BIT(BZ_X_CODING_2, uc);
if (uc == 0) break;
GET_BIT(BZ_X_CODING_3, uc);
if (uc == 0) curr++; else curr--;
}
s->len[t][i] = curr;
}
}
/*--- Create the Huffman decoding tables ---*/
for (t = 0; t < nGroups; t++) {
minLen = 32;
maxLen = 0;
for (i = 0; i < alphaSize; i++) {
if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
if (s->len[t][i] < minLen) minLen = s->len[t][i];
}
BZ2_hbCreateDecodeTables (
&(s->limit[t][0]),
&(s->base[t][0]),
&(s->perm[t][0]),
&(s->len[t][0]),
minLen, maxLen, alphaSize
);
s->minLens[t] = minLen;
}
/*--- Now the MTF values ---*/
EOB = s->nInUse+1;
nblockMAX = 100000 * s->blockSize100k;
groupNo = -1;
groupPos = 0;
for (i = 0; i <= 255; i++) s->unzftab[i] = 0;
/*-- MTF init --*/
{
Int32 ii, jj, kk;
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) {
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj);
kk--;
}
s->mtfbase[ii] = kk + 1;
}
}
/*-- end MTF init --*/
nblock = 0;
GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);
while (True) {
if (nextSym == EOB) break;
if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) {
es = -1;
N = 1;
do {
/* Check that N doesn't get too big, so that es doesn't
go negative. The maximum value that can be
RUNA/RUNB encoded is equal to the block size (post
the initial RLE), viz, 900k, so bounding N at 2
million should guard against overflow without
rejecting any legitimate inputs. */
if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2;
GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);
}
while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);
es++;
uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ];
s->unzftab[uc] += es;
if (s->smallDecompress)
while (es > 0) {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
s->ll16[nblock] = (UInt16)uc;
nblock++;
es--;
}
else
while (es > 0) {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
s->tt[nblock] = (UInt32)uc;
nblock++;
es--;
};
continue;
} else {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
/*-- uc = MTF ( nextSym-1 ) --*/
{
Int32 ii, jj, kk, pp, lno, off;
UInt32 nn;
nn = (UInt32)(nextSym - 1);
if (nn < MTFL_SIZE) {
/* avoid general-case expense */
pp = s->mtfbase[0];
uc = s->mtfa[pp+nn];
while (nn > 3) {
Int32 z = pp+nn;
s->mtfa[(z) ] = s->mtfa[(z)-1];
s->mtfa[(z)-1] = s->mtfa[(z)-2];
s->mtfa[(z)-2] = s->mtfa[(z)-3];
s->mtfa[(z)-3] = s->mtfa[(z)-4];
nn -= 4;
}
while (nn > 0) {
s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
};
s->mtfa[pp] = uc;
} else {
/* general case */
lno = nn / MTFL_SIZE;
off = nn % MTFL_SIZE;
pp = s->mtfbase[lno] + off;
uc = s->mtfa[pp];
while (pp > s->mtfbase[lno]) {
s->mtfa[pp] = s->mtfa[pp-1]; pp--;
};
s->mtfbase[lno]++;
while (lno > 0) {
s->mtfbase[lno]--;
s->mtfa[s->mtfbase[lno]]
= s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
lno--;
}
s->mtfbase[0]--;
s->mtfa[s->mtfbase[0]] = uc;
if (s->mtfbase[0] == 0) {
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];
kk--;
}
s->mtfbase[ii] = kk + 1;
}
}
}
}
/*-- end uc = MTF ( nextSym-1 ) --*/
s->unzftab[s->seqToUnseq[uc]]++;
if (s->smallDecompress)
s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else
s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]);
nblock++;
GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);
continue;
}
}
/* Now we know what nblock is, we can do a better sanity
check on s->origPtr.
*/
if (s->origPtr < 0 || s->origPtr >= nblock)
RETURN(BZ_DATA_ERROR);
/*-- Set up cftab to facilitate generation of T^(-1) --*/
/* Check: unzftab entries in range. */
for (i = 0; i <= 255; i++) {
if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
RETURN(BZ_DATA_ERROR);
}
/* Actually generate cftab. */
s->cftab[0] = 0;
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
/* Check: cftab entries in range. */
for (i = 0; i <= 256; i++) {
if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
/* s->cftab[i] can legitimately be == nblock */
RETURN(BZ_DATA_ERROR);
}
}
/* Check: cftab entries non-descending. */
for (i = 1; i <= 256; i++) {
if (s->cftab[i-1] > s->cftab[i]) {
RETURN(BZ_DATA_ERROR);
}
}
s->state_out_len = 0;
s->state_out_ch = 0;
BZ_INITIALISE_CRC ( s->calculatedBlockCRC );
s->state = BZ_X_OUTPUT;
if (s->verbosity >= 2) VPrintf0 ( "rt+rld" );
if (s->smallDecompress) {
/*-- Make a copy of cftab, used in generation of T --*/
for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i];
/*-- compute the T vector --*/
for (i = 0; i < nblock; i++) {
uc = (UChar)(s->ll16[i]);
SET_LL(i, s->cftabCopy[uc]);
s->cftabCopy[uc]++;
}
/*-- Compute T^(-1) by pointer reversal on T --*/
i = s->origPtr;
j = GET_LL(i);
do {
Int32 tmp = GET_LL(j);
SET_LL(j, i);
i = j;
j = tmp;
}
while (i != s->origPtr);
s->tPos = s->origPtr;
s->nblock_used = 0;
if (s->blockRandomised) {
BZ_RAND_INIT_MASK;
BZ_GET_SMALL(s->k0); s->nblock_used++;
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
} else {
BZ_GET_SMALL(s->k0); s->nblock_used++;
}
} else {
/*-- compute the T^(-1) vector --*/
for (i = 0; i < nblock; i++) {
uc = (UChar)(s->tt[i] & 0xff);
s->tt[s->cftab[uc]] |= (i << 8);
s->cftab[uc]++;
}
s->tPos = s->tt[s->origPtr] >> 8;
s->nblock_used = 0;
if (s->blockRandomised) {
BZ_RAND_INIT_MASK;
BZ_GET_FAST(s->k0); s->nblock_used++;
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
} else {
BZ_GET_FAST(s->k0); s->nblock_used++;
}
}
RETURN(BZ_OK);
endhdr_2:
GET_UCHAR(BZ_X_ENDHDR_2, uc);
if (uc != 0x72) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_3, uc);
if (uc != 0x45) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_4, uc);
if (uc != 0x38) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_5, uc);
if (uc != 0x50) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_6, uc);
if (uc != 0x90) RETURN(BZ_DATA_ERROR);
s->storedCombinedCRC = 0;
GET_UCHAR(BZ_X_CCRC_1, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_2, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_3, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_4, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
s->state = BZ_X_IDLE;
RETURN(BZ_STREAM_END);
default: AssertH ( False, 4001 );
}
AssertH ( False, 4002 );
save_state_and_return:
s->save_i = i;
s->save_j = j;
s->save_t = t;
s->save_alphaSize = alphaSize;
s->save_nGroups = nGroups;
s->save_nSelectors = nSelectors;
s->save_EOB = EOB;
s->save_groupNo = groupNo;
s->save_groupPos = groupPos;
s->save_nextSym = nextSym;
s->save_nblockMAX = nblockMAX;
s->save_nblock = nblock;
s->save_es = es;
s->save_N = N;
s->save_curr = curr;
s->save_zt = zt;
s->save_zn = zn;
s->save_zvec = zvec;
s->save_zj = zj;
s->save_gSel = gSel;
s->save_gMinlen = gMinlen;
s->save_gLimit = gLimit;
s->save_gBase = gBase;
s->save_gPerm = gPerm;
return retVal;
} | 3487 | True | 1 |
CVE-2019-12904 | 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://dev.gnupg.org/T4541', 'name': 'https://dev.gnupg.org/T4541', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'name': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'name': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html', 'name': 'openSUSE-SU-2019:1792', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnupg:libgcrypt:1.8.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "** DISPUTED ** In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.) NOTE: the vendor's position is that the issue report cannot be validated because there is no description of an attack."}] | 2021-07-21T11:39Z | 2019-06-20T00: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 | Jussi Kivilinna | 2019-05-31 17:18:09+03:00 | AES: move look-up tables to .data section and unshare between processes
* cipher/rijndael-internal.h (ATTR_ALIGNED_64): New.
* cipher/rijndael-tables.h (encT): Move to 'enc_tables' structure.
(enc_tables): New structure for encryption table with counters before
and after.
(encT): New macro.
(dec_tables): Add counters before and after encryption table; Move
from .rodata to .data section.
(do_encrypt): Change 'encT' to 'enc_tables.T'.
(do_decrypt): Change '&dec_tables' to 'dec_tables.T'.
* cipher/cipher-gcm.c (prefetch_table): Make inline; Handle input
with length not multiple of 256.
(prefetch_enc, prefetch_dec): Modify pre- and post-table counters
to unshare look-up table pages between processes.
--
GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <[email protected]> | daedbbb5541cd8ecda1459d3b843ea4d92788762 | False | gpg/libgcrypt | The GNU crypto library. NOTE: Maintainers are not tracking this mirror. Do not make pull requests here, nor comment any commits, submit them usual way to bug tracker (https://www.gnupg.org/documentation/bts.html) or to the mailing list (https://www.gnupg.org/documentation/mailing-lists.html). | 2015-09-07 21:47:25 | 2021-06-19 14:17:53 | https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git | gpg | 143.0 | 60.0 | do_decrypt | do_decrypt( const RIJNDAEL_context * ctx , unsigned char * bx , const unsigned char * ax) | ['ctx', 'bx', 'ax'] | do_decrypt (const RIJNDAEL_context *ctx, unsigned char *bx,
const unsigned char *ax)
{
#ifdef USE_AMD64_ASM
return _gcry_aes_amd64_decrypt_block(ctx->keyschdec, bx, ax, ctx->rounds,
&dec_tables);
#elif defined(USE_ARM_ASM)
return _gcry_aes_arm_decrypt_block(ctx->keyschdec, bx, ax, ctx->rounds,
&dec_tables);
#else
return do_decrypt_fn (ctx, bx, ax);
#endif /*!USE_ARM_ASM && !USE_AMD64_ASM*/
} | 68 | True | 1 |
CVE-2019-12904 | 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://dev.gnupg.org/T4541', 'name': 'https://dev.gnupg.org/T4541', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'name': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'name': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html', 'name': 'openSUSE-SU-2019:1792', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnupg:libgcrypt:1.8.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "** DISPUTED ** In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.) NOTE: the vendor's position is that the issue report cannot be validated because there is no description of an attack."}] | 2021-07-21T11:39Z | 2019-06-20T00: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 | Jussi Kivilinna | 2019-05-31 17:18:09+03:00 | AES: move look-up tables to .data section and unshare between processes
* cipher/rijndael-internal.h (ATTR_ALIGNED_64): New.
* cipher/rijndael-tables.h (encT): Move to 'enc_tables' structure.
(enc_tables): New structure for encryption table with counters before
and after.
(encT): New macro.
(dec_tables): Add counters before and after encryption table; Move
from .rodata to .data section.
(do_encrypt): Change 'encT' to 'enc_tables.T'.
(do_decrypt): Change '&dec_tables' to 'dec_tables.T'.
* cipher/cipher-gcm.c (prefetch_table): Make inline; Handle input
with length not multiple of 256.
(prefetch_enc, prefetch_dec): Modify pre- and post-table counters
to unshare look-up table pages between processes.
--
GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <[email protected]> | daedbbb5541cd8ecda1459d3b843ea4d92788762 | False | gpg/libgcrypt | The GNU crypto library. NOTE: Maintainers are not tracking this mirror. Do not make pull requests here, nor comment any commits, submit them usual way to bug tracker (https://www.gnupg.org/documentation/bts.html) or to the mailing list (https://www.gnupg.org/documentation/mailing-lists.html). | 2015-09-07 21:47:25 | 2021-06-19 14:17:53 | https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git | gpg | 143.0 | 60.0 | do_encrypt | do_encrypt( const RIJNDAEL_context * ctx , unsigned char * bx , const unsigned char * ax) | ['ctx', 'bx', 'ax'] | do_encrypt (const RIJNDAEL_context *ctx,
unsigned char *bx, const unsigned char *ax)
{
#ifdef USE_AMD64_ASM
return _gcry_aes_amd64_encrypt_block(ctx->keyschenc, bx, ax, ctx->rounds,
encT);
#elif defined(USE_ARM_ASM)
return _gcry_aes_arm_encrypt_block(ctx->keyschenc, bx, ax, ctx->rounds, encT);
#else
return do_encrypt_fn (ctx, bx, ax);
#endif /* !USE_ARM_ASM && !USE_AMD64_ASM*/
} | 66 | True | 1 |
CVE-2019-12904 | 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://dev.gnupg.org/T4541', 'name': 'https://dev.gnupg.org/T4541', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'name': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'name': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html', 'name': 'openSUSE-SU-2019:1792', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnupg:libgcrypt:1.8.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "** DISPUTED ** In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.) NOTE: the vendor's position is that the issue report cannot be validated because there is no description of an attack."}] | 2021-07-21T11:39Z | 2019-06-20T00: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 | Jussi Kivilinna | 2019-05-31 17:18:09+03:00 | AES: move look-up tables to .data section and unshare between processes
* cipher/rijndael-internal.h (ATTR_ALIGNED_64): New.
* cipher/rijndael-tables.h (encT): Move to 'enc_tables' structure.
(enc_tables): New structure for encryption table with counters before
and after.
(encT): New macro.
(dec_tables): Add counters before and after encryption table; Move
from .rodata to .data section.
(do_encrypt): Change 'encT' to 'enc_tables.T'.
(do_decrypt): Change '&dec_tables' to 'dec_tables.T'.
* cipher/cipher-gcm.c (prefetch_table): Make inline; Handle input
with length not multiple of 256.
(prefetch_enc, prefetch_dec): Modify pre- and post-table counters
to unshare look-up table pages between processes.
--
GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <[email protected]> | daedbbb5541cd8ecda1459d3b843ea4d92788762 | False | gpg/libgcrypt | The GNU crypto library. NOTE: Maintainers are not tracking this mirror. Do not make pull requests here, nor comment any commits, submit them usual way to bug tracker (https://www.gnupg.org/documentation/bts.html) or to the mailing list (https://www.gnupg.org/documentation/mailing-lists.html). | 2015-09-07 21:47:25 | 2021-06-19 14:17:53 | https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git | gpg | 143.0 | 60.0 | prefetch_enc | prefetch_enc( void) | ['void'] | static void prefetch_enc(void)
{
prefetch_table((const void *)encT, sizeof(encT));
} | 21 | True | 1 |
CVE-2019-12904 | 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://dev.gnupg.org/T4541', 'name': 'https://dev.gnupg.org/T4541', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'name': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'name': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html', 'name': 'openSUSE-SU-2019:1792', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnupg:libgcrypt:1.8.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "** DISPUTED ** In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.) NOTE: the vendor's position is that the issue report cannot be validated because there is no description of an attack."}] | 2021-07-21T11:39Z | 2019-06-20T00: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 | Jussi Kivilinna | 2019-05-31 17:18:09+03:00 | AES: move look-up tables to .data section and unshare between processes
* cipher/rijndael-internal.h (ATTR_ALIGNED_64): New.
* cipher/rijndael-tables.h (encT): Move to 'enc_tables' structure.
(enc_tables): New structure for encryption table with counters before
and after.
(encT): New macro.
(dec_tables): Add counters before and after encryption table; Move
from .rodata to .data section.
(do_encrypt): Change 'encT' to 'enc_tables.T'.
(do_decrypt): Change '&dec_tables' to 'dec_tables.T'.
* cipher/cipher-gcm.c (prefetch_table): Make inline; Handle input
with length not multiple of 256.
(prefetch_enc, prefetch_dec): Modify pre- and post-table counters
to unshare look-up table pages between processes.
--
GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <[email protected]> | daedbbb5541cd8ecda1459d3b843ea4d92788762 | False | gpg/libgcrypt | The GNU crypto library. NOTE: Maintainers are not tracking this mirror. Do not make pull requests here, nor comment any commits, submit them usual way to bug tracker (https://www.gnupg.org/documentation/bts.html) or to the mailing list (https://www.gnupg.org/documentation/mailing-lists.html). | 2015-09-07 21:47:25 | 2021-06-19 14:17:53 | https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git | gpg | 143.0 | 60.0 | prefetch_table | prefetch_table( const volatile byte * tab , size_t len) | ['tab', 'len'] | static void prefetch_table(const volatile byte *tab, size_t len)
{
size_t i;
for (i = 0; i < len; i += 8 * 32)
{
(void)tab[i + 0 * 32];
(void)tab[i + 1 * 32];
(void)tab[i + 2 * 32];
(void)tab[i + 3 * 32];
(void)tab[i + 4 * 32];
(void)tab[i + 5 * 32];
(void)tab[i + 6 * 32];
(void)tab[i + 7 * 32];
}
(void)tab[len - 1];
} | 140 | True | 1 |
CVE-2019-12904 | 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://dev.gnupg.org/T4541', 'name': 'https://dev.gnupg.org/T4541', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'name': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'name': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html', 'name': 'openSUSE-SU-2019:1792', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnupg:libgcrypt:1.8.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "** DISPUTED ** In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.) NOTE: the vendor's position is that the issue report cannot be validated because there is no description of an attack."}] | 2021-07-21T11:39Z | 2019-06-20T00: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 | Jussi Kivilinna | 2019-05-31 17:27:25+03:00 | GCM: move look-up table to .data section and unshare between processes
* cipher/cipher-gcm.c (ATTR_ALIGNED_64): New.
(gcmR): Move to 'gcm_table' structure.
(gcm_table): New structure for look-up table with counters before and
after.
(gcmR): New macro.
(prefetch_table): Handle input with length not multiple of 256.
(do_prefetch_tables): Modify pre- and post-table counters to unshare
look-up table pages between processes.
--
GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <[email protected]> | a4c561aab1014c3630bc88faf6f5246fee16b020 | False | gpg/libgcrypt | The GNU crypto library. NOTE: Maintainers are not tracking this mirror. Do not make pull requests here, nor comment any commits, submit them usual way to bug tracker (https://www.gnupg.org/documentation/bts.html) or to the mailing list (https://www.gnupg.org/documentation/mailing-lists.html). | 2015-09-07 21:47:25 | 2021-06-19 14:17:53 | https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git | gpg | 143.0 | 60.0 | do_prefetch_tables | do_prefetch_tables( const void * gcmM , size_t gcmM_size) | ['gcmM', 'gcmM_size'] | do_prefetch_tables (const void *gcmM, size_t gcmM_size)
{
prefetch_table(gcmM, gcmM_size);
prefetch_table(gcmR, sizeof(gcmR));
} | 29 | True | 1 |
CVE-2019-12904 | 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:H/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://dev.gnupg.org/T4541', 'name': 'https://dev.gnupg.org/T4541', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'name': 'https://github.com/gpg/libgcrypt/commit/daedbbb5541cd8ecda1459d3b843ea4d92788762', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'name': 'https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00049.html', 'name': 'openSUSE-SU-2019:1792', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/rf9fa47ab66495c78bb4120b0754dd9531ca2ff0430f6685ac9b07772@%3Cdev.mina.apache.org%3E', 'name': '[mina-dev] 20210225 [jira] [Created] (FTPSERVER-500) Security vulnerability in common/lib/log4j-1.2.17.jar', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-668'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnupg:libgcrypt:1.8.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "** DISPUTED ** In Libgcrypt 1.8.4, the C implementation of AES is vulnerable to a flush-and-reload side-channel attack because physical addresses are available to other processes. (The C implementation is used on platforms where an assembly-language implementation is unavailable.) NOTE: the vendor's position is that the issue report cannot be validated because there is no description of an attack."}] | 2021-07-21T11:39Z | 2019-06-20T00: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 | Jussi Kivilinna | 2019-05-31 17:27:25+03:00 | GCM: move look-up table to .data section and unshare between processes
* cipher/cipher-gcm.c (ATTR_ALIGNED_64): New.
(gcmR): Move to 'gcm_table' structure.
(gcm_table): New structure for look-up table with counters before and
after.
(gcmR): New macro.
(prefetch_table): Handle input with length not multiple of 256.
(do_prefetch_tables): Modify pre- and post-table counters to unshare
look-up table pages between processes.
--
GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <[email protected]> | a4c561aab1014c3630bc88faf6f5246fee16b020 | False | gpg/libgcrypt | The GNU crypto library. NOTE: Maintainers are not tracking this mirror. Do not make pull requests here, nor comment any commits, submit them usual way to bug tracker (https://www.gnupg.org/documentation/bts.html) or to the mailing list (https://www.gnupg.org/documentation/mailing-lists.html). | 2015-09-07 21:47:25 | 2021-06-19 14:17:53 | https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git | gpg | 143.0 | 60.0 | prefetch_table | prefetch_table( const void * tab , size_t len) | ['tab', 'len'] | void prefetch_table(const void *tab, size_t len)
{
const volatile byte *vtab = tab;
size_t i;
for (i = 0; i < len; i += 8 * 32)
{
(void)vtab[i + 0 * 32];
(void)vtab[i + 1 * 32];
(void)vtab[i + 2 * 32];
(void)vtab[i + 3 * 32];
(void)vtab[i + 4 * 32];
(void)vtab[i + 5 * 32];
(void)vtab[i + 6 * 32];
(void)vtab[i + 7 * 32];
}
(void)vtab[len - 1];
} | 147 | True | 1 |
CVE-2019-12982 | 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/libming/libming/commit/da9d86eab55cbf608d5c916b8b690f5b76bca462', 'name': 'https://github.com/libming/libming/commit/da9d86eab55cbf608d5c916b8b690f5b76bca462', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libming:libming:0.4.8:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Ming (aka libming) 0.4.8 has a heap buffer overflow and underflow in the decompileCAST function in util/decompile.c in libutil.a. Remote attackers could leverage this vulnerability to cause a denial of service via a crafted SWF file.'}] | 2020-10-14T17:27Z | 2019-06-26T18:15Z | Improper Restriction of Operations within the Bounds of a Memory Buffer | The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer. |
Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.
| https://cwe.mitre.org/data/definitions/119.html | 0 | Young Xiao | 2019-03-16 17:42:14+08:00 | decompileAction: Prevent heap buffer overflow and underflow with using OpCode | da9d86eab55cbf608d5c916b8b690f5b76bca462 | False | libming/libming | SWF output library | 2010-11-27 22:22:20 | 2021-05-11 04:13:37 | http://www.libming.org/ | libming | 103.0 | 38.0 | decompileAction | decompileAction( int n , SWF_ACTION * actions , int maxn) | ['n', 'actions', 'maxn'] | decompileAction(int n, SWF_ACTION *actions, int maxn)
{
if( n > maxn ) SWF_error("Action overflow!!");
#ifdef DEBUG
fprintf(stderr,"%d:\tACTION[%3.3d]: %s\n",
actions[n].SWF_ACTIONRECORD.Offset, n,
actionName(actions[n].SWF_ACTIONRECORD.ActionCode));
#endif
switch(actions[n].SWF_ACTIONRECORD.ActionCode)
{
case SWFACTION_END:
return 0;
case SWFACTION_CONSTANTPOOL:
decompileCONSTANTPOOL(&actions[n]);
return 0;
case SWFACTION_GOTOLABEL:
return decompileGOTOFRAME(n, actions, maxn,1);
case SWFACTION_GOTOFRAME:
return decompileGOTOFRAME(n, actions, maxn,0);
case SWFACTION_GOTOFRAME2:
return decompileGOTOFRAME2(n, actions, maxn);
case SWFACTION_WAITFORFRAME:
decompileWAITFORFRAME(&actions[n]);
return 0;
case SWFACTION_GETURL2:
decompileGETURL2(&actions[n]);
return 0;
case SWFACTION_GETURL:
decompileGETURL(&actions[n]);
return 0;
case SWFACTION_PUSH:
decompilePUSH(&actions[n]);
return 0;
case SWFACTION_PUSHDUP:
decompilePUSHDUP(&actions[n]);
return 0;
case SWFACTION_STACKSWAP:
decompileSTACKSWAP(&actions[n]);
return 0;
case SWFACTION_SETPROPERTY:
decompileSETPROPERTY(n, actions, maxn);
return 0;
case SWFACTION_GETPROPERTY:
decompileGETPROPERTY(n, actions, maxn);
return 0;
case SWFACTION_GETTIME:
return decompileGETTIME(n, actions, maxn);
case SWFACTION_TRACE:
decompileTRACE(n, actions, maxn);
return 0;
case SWFACTION_CALLFRAME:
decompileCALLFRAME(n, actions, maxn);
return 0;
case SWFACTION_EXTENDS:
decompileEXTENDS(n, actions, maxn);
return 0;
case SWFACTION_INITOBJECT:
decompileINITOBJECT(n, actions, maxn);
return 0;
case SWFACTION_NEWOBJECT:
decompileNEWOBJECT(n, actions, maxn);
return 0;
case SWFACTION_NEWMETHOD:
decompileNEWMETHOD(n, actions, maxn);
return 0;
case SWFACTION_GETMEMBER:
decompileGETMEMBER(n, actions, maxn);
return 0;
case SWFACTION_SETMEMBER:
decompileSETMEMBER(n, actions, maxn);
return 0;
case SWFACTION_GETVARIABLE:
decompileGETVARIABLE(n, actions, maxn);
return 0;
case SWFACTION_SETVARIABLE:
decompileSETVARIABLE(n, actions, maxn, 0);
return 0;
case SWFACTION_DEFINELOCAL:
decompileSETVARIABLE(n, actions, maxn, 1);
return 0;
case SWFACTION_DEFINELOCAL2:
decompileDEFINELOCAL2(n, actions, maxn);
return 0;
case SWFACTION_DECREMENT:
return decompileINCR_DECR(n, actions, maxn, 0);
case SWFACTION_INCREMENT:
return decompileINCR_DECR(n, actions, maxn,1);
case SWFACTION_STOREREGISTER:
decompileSTOREREGISTER(n, actions, maxn);
return 0;
case SWFACTION_JUMP:
return decompileJUMP(n, actions, maxn);
case SWFACTION_RETURN:
decompileRETURN(n, actions, maxn);
return 0;
case SWFACTION_LOGICALNOT:
return decompileLogicalNot(n, actions, maxn);
case SWFACTION_IF:
return decompileIF(n, actions, maxn);
case SWFACTION_WITH:
decompileWITH(n, actions, maxn);
return 0;
case SWFACTION_ENUMERATE:
return decompileENUMERATE(n, actions, maxn, 0);
case SWFACTION_ENUMERATE2 :
return decompileENUMERATE(n, actions, maxn,1);
case SWFACTION_INITARRAY:
return decompileINITARRAY(n, actions, maxn);
case SWFACTION_DEFINEFUNCTION:
return decompileDEFINEFUNCTION(n, actions, maxn,0);
case SWFACTION_DEFINEFUNCTION2:
return decompileDEFINEFUNCTION(n, actions, maxn,1);
case SWFACTION_CALLFUNCTION:
return decompileCALLFUNCTION(n, actions, maxn);
case SWFACTION_CALLMETHOD:
return decompileCALLMETHOD(n, actions, maxn);
case SWFACTION_INSTANCEOF:
case SWFACTION_SHIFTLEFT:
case SWFACTION_SHIFTRIGHT:
case SWFACTION_SHIFTRIGHT2:
case SWFACTION_ADD:
case SWFACTION_ADD2:
case SWFACTION_SUBTRACT:
case SWFACTION_MULTIPLY:
case SWFACTION_DIVIDE:
case SWFACTION_MODULO:
case SWFACTION_BITWISEAND:
case SWFACTION_BITWISEOR:
case SWFACTION_BITWISEXOR:
case SWFACTION_EQUAL:
case SWFACTION_EQUALS2:
case SWFACTION_LESS2:
case SWFACTION_LOGICALAND:
case SWFACTION_LOGICALOR:
case SWFACTION_GREATER:
case SWFACTION_LESSTHAN:
case SWFACTION_STRINGEQ:
case SWFACTION_STRINGCOMPARE:
case SWFACTION_STRICTEQUALS:
return decompileArithmeticOp(n, actions, maxn);
case SWFACTION_POP:
pop();
return 0;
case SWFACTION_STARTDRAG:
return decompileSTARTDRAG(n, actions, maxn);
case SWFACTION_DELETE:
return decompileDELETE(n, actions, maxn,0);
case SWFACTION_DELETE2:
return decompileDELETE(n, actions, maxn,1);
case SWFACTION_TARGETPATH:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"targetPath");
case SWFACTION_TYPEOF:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"typeof");
case SWFACTION_ORD:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"ord");
case SWFACTION_CHR:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"chr");
case SWFACTION_INT:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"int");
case SWFACTION_TOSTRING:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"String");
case SWFACTION_TONUMBER:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"Number");
case SWFACTION_RANDOMNUMBER:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"random");
case SWFACTION_STRINGLENGTH:
return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"length");
case SWFACTION_PLAY:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"play");
case SWFACTION_STOP:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"stop");
case SWFACTION_NEXTFRAME:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"nextFrame");
case SWFACTION_PREVFRAME:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"prevFrame");
case SWFACTION_ENDDRAG:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"stopDrag");
case SWFACTION_STOPSOUNDS:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"stopAllSounds");
case SWFACTION_TOGGLEQUALITY:
return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"toggleHighQuality");
case SWFACTION_MBSUBSTRING:
case SWFACTION_SUBSTRING:
return decompileSUBSTRING(n, actions, maxn);
case SWFACTION_STRINGCONCAT:
return decompileSTRINGCONCAT(n, actions, maxn);
case SWFACTION_REMOVECLIP:
return decompileREMOVECLIP(n, actions, maxn);
case SWFACTION_DUPLICATECLIP:
return decompileDUPLICATECLIP(n, actions, maxn);
case SWFACTION_SETTARGET:
return decompileSETTARGET(n, actions, maxn,0);
case SWFACTION_SETTARGET2:
return decompileSETTARGET(n, actions, maxn,1);
case SWFACTION_IMPLEMENTSOP:
return decompileIMPLEMENTS(n, actions, maxn);
case SWFACTION_CASTOP:
return decompileCAST(n, actions, maxn);
case SWFACTION_THROW:
return decompileTHROW(n, actions, maxn);
case SWFACTION_TRY:
return decompileTRY(n, actions, maxn);
default:
outputSWF_ACTION(n,&actions[n]);
return 0;
}
} | 1187 | True | 1 |
CVE-2019-12980 | 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/libming/libming/commit/a009a38dce1d9316cad1ab522b813b1d5ba4c62a', 'name': 'https://github.com/libming/libming/commit/a009a38dce1d9316cad1ab522b813b1d5ba4c62a', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libming:libming:0.4.8:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Ming (aka libming) 0.4.8, there is an integer overflow (caused by an out-of-range left shift) in the SWFInput_readSBits function in blocks/input.c. Remote attackers could leverage this vulnerability to cause a denial-of-service via a crafted swf file.'}] | 2020-10-14T18:14Z | 2019-06-26T18:15Z | Integer Overflow or Wraparound | The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. | An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
| https://cwe.mitre.org/data/definitions/190.html | 0 | Young Xiao | 2019-03-16 18:50:24+08:00 | Fix left shift of a negative value in SWFInput_readSBits. Check for number before before left-shifting by (number-1). | a009a38dce1d9316cad1ab522b813b1d5ba4c62a | False | libming/libming | SWF output library | 2010-11-27 22:22:20 | 2021-05-11 04:13:37 | http://www.libming.org/ | libming | 103.0 | 38.0 | SWFInput_readSBits | SWFInput_readSBits( SWFInput input , int number) | ['input', 'number'] | SWFInput_readSBits(SWFInput input, int number)
{
int num = SWFInput_readBits(input, number);
if ( num & (1<<(number-1)) )
return num - (1<<number);
else
return num;
} | 49 | True | 1 |
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12: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 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | DDeviceDiskInfoPrivate::openDataStream | DDeviceDiskInfoPrivate::openDataStream( int index) | ['index'] | bool DDeviceDiskInfoPrivate::openDataStream(int index)
{
if (process) {
process->deleteLater();
}
process = new QProcess();
QObject::connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
process, [this] (int code, QProcess::ExitStatus status) {
if (isClosing())
return;
if (status == QProcess::CrashExit) {
setErrorString(QObject::tr("process \"%1 %2\" crashed").arg(process->program()).arg(process->arguments().join(" ")));
} else if (code != 0) {
setErrorString(QObject::tr("Failed to perform process \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(QString::fromUtf8(process->readAllStandardError())));
}
});
switch (currentScope) {
case DDiskInfo::Headgear: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read) {
process->start(QStringLiteral("dd if=%1 bs=512 count=2048 status=none").arg(filePath()), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("dd of=%1 bs=512 status=none conv=fsync").arg(filePath()));
}
break;
}
case DDiskInfo::PartitionTable: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read)
process->start(QStringLiteral("sfdisk -d %1").arg(filePath()), QIODevice::ReadOnly);
else
process->start(QStringLiteral("sfdisk %1 --no-reread").arg(filePath()));
break;
}
case DDiskInfo::Partition: {
const DPartInfo &part = (index == 0 && currentMode == DDiskInfo::Write) ? DDevicePartInfo(filePath()) : q->getPartByNumber(index);
if (!part) {
dCDebug("Part is null(index: %d)", index);
return false;
}
dCDebug("Try open device: %s, mode: %s", qPrintable(part.filePath()), currentMode == DDiskInfo::Read ? "Read" : "Write");
if (Helper::isMounted(part.filePath())) {
if (Helper::umountDevice(part.filePath())) {
part.d->mountPoint.clear();
} else {
setErrorString(QObject::tr("\"%1\" is busy").arg(part.filePath()));
return false;
}
}
if (currentMode == DDiskInfo::Read) {
const QString &executer = Helper::getPartcloneExecuter(part);
process->start(QStringLiteral("%1 -s %2 -o - -c -z %3 -L /tmp/partclone.log").arg(executer).arg(part.filePath()).arg(Global::bufferSize), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("partclone.restore -s - -o %2 -z %3 -L /tmp/partclone.log").arg(part.filePath()).arg(Global::bufferSize));
}
break;
}
case DDiskInfo::JsonInfo: {
process->deleteLater();
process = 0;
buffer.setData(q->toJson());
break;
}
default:
return false;
}
if (process) {
if (!process->waitForStarted()) {
setErrorString(QObject::tr("Failed to start \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(process->errorString()));
return false;
}
dCDebug("The \"%s %s\" command start finished", qPrintable(process->program()), qPrintable(process->arguments().join(" ")));
}
bool ok = process ? process->isOpen() : buffer.open(QIODevice::ReadOnly);
if (!ok) {
setErrorString(QObject::tr("Failed to open process, error: %1").arg(process ? process->errorString(): buffer.errorString()));
}
return ok;
} | 778 | True | 1 |
|
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | DDeviceDiskInfoPrivate::openDataStream | DDeviceDiskInfoPrivate::openDataStream( int index) | ['index'] | bool DDeviceDiskInfoPrivate::openDataStream(int index)
{
if (process) {
process->deleteLater();
}
process = new QProcess();
QObject::connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
process, [this] (int code, QProcess::ExitStatus status) {
if (isClosing())
return;
if (status == QProcess::CrashExit) {
setErrorString(QObject::tr("process \"%1 %2\" crashed").arg(process->program()).arg(process->arguments().join(" ")));
} else if (code != 0) {
setErrorString(QObject::tr("Failed to perform process \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(QString::fromUtf8(process->readAllStandardError())));
}
});
switch (currentScope) {
case DDiskInfo::Headgear: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read) {
process->start(QStringLiteral("dd if=%1 bs=512 count=2048 status=none").arg(filePath()), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("dd of=%1 bs=512 status=none conv=fsync").arg(filePath()));
}
break;
}
case DDiskInfo::PartitionTable: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read)
process->start(QStringLiteral("sfdisk -d %1").arg(filePath()), QIODevice::ReadOnly);
else
process->start(QStringLiteral("sfdisk %1 --no-reread").arg(filePath()));
break;
}
case DDiskInfo::Partition: {
const DPartInfo &part = (index == 0 && currentMode == DDiskInfo::Write) ? DDevicePartInfo(filePath()) : q->getPartByNumber(index);
if (!part) {
dCDebug("Part is null(index: %d)", index);
return false;
}
dCDebug("Try open device: %s, mode: %s", qPrintable(part.filePath()), currentMode == DDiskInfo::Read ? "Read" : "Write");
if (Helper::isMounted(part.filePath())) {
if (Helper::umountDevice(part.filePath())) {
part.d->mountPoint.clear();
} else {
setErrorString(QObject::tr("\"%1\" is busy").arg(part.filePath()));
return false;
}
}
if (currentMode == DDiskInfo::Read) {
const QString &executer = Helper::getPartcloneExecuter(part);
process->start(QStringLiteral("%1 -s %2 -o - -c -z %3 -L /tmp/partclone.log").arg(executer).arg(part.filePath()).arg(Global::bufferSize), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("partclone.restore -s - -o %2 -z %3 -L /tmp/partclone.log").arg(part.filePath()).arg(Global::bufferSize));
}
break;
}
case DDiskInfo::JsonInfo: {
process->deleteLater();
process = 0;
buffer.setData(q->toJson());
break;
}
default:
return false;
}
if (process) {
if (!process->waitForStarted()) {
setErrorString(QObject::tr("Failed to start \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(process->errorString()));
return false;
}
dCDebug("The \"%s %s\" command start finished", qPrintable(process->program()), qPrintable(process->arguments().join(" ")));
}
bool ok = process ? process->isOpen() : buffer.open(QIODevice::ReadOnly);
if (!ok) {
setErrorString(QObject::tr("Failed to open process, error: %1").arg(process ? process->errorString(): buffer.errorString()));
}
return ok;
} | 778 | True | 1 |
||
CVE-2019-13227 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In GUI mode, deepin-clone before 1.1.3 creates a log file at the fixed path /tmp/.deepin-clone.log as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | DDeviceDiskInfoPrivate::openDataStream | DDeviceDiskInfoPrivate::openDataStream( int index) | ['index'] | bool DDeviceDiskInfoPrivate::openDataStream(int index)
{
if (process) {
process->deleteLater();
}
process = new QProcess();
QObject::connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
process, [this] (int code, QProcess::ExitStatus status) {
if (isClosing())
return;
if (status == QProcess::CrashExit) {
setErrorString(QObject::tr("process \"%1 %2\" crashed").arg(process->program()).arg(process->arguments().join(" ")));
} else if (code != 0) {
setErrorString(QObject::tr("Failed to perform process \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(QString::fromUtf8(process->readAllStandardError())));
}
});
switch (currentScope) {
case DDiskInfo::Headgear: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read) {
process->start(QStringLiteral("dd if=%1 bs=512 count=2048 status=none").arg(filePath()), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("dd of=%1 bs=512 status=none conv=fsync").arg(filePath()));
}
break;
}
case DDiskInfo::PartitionTable: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read)
process->start(QStringLiteral("sfdisk -d %1").arg(filePath()), QIODevice::ReadOnly);
else
process->start(QStringLiteral("sfdisk %1 --no-reread").arg(filePath()));
break;
}
case DDiskInfo::Partition: {
const DPartInfo &part = (index == 0 && currentMode == DDiskInfo::Write) ? DDevicePartInfo(filePath()) : q->getPartByNumber(index);
if (!part) {
dCDebug("Part is null(index: %d)", index);
return false;
}
dCDebug("Try open device: %s, mode: %s", qPrintable(part.filePath()), currentMode == DDiskInfo::Read ? "Read" : "Write");
if (Helper::isMounted(part.filePath())) {
if (Helper::umountDevice(part.filePath())) {
part.d->mountPoint.clear();
} else {
setErrorString(QObject::tr("\"%1\" is busy").arg(part.filePath()));
return false;
}
}
if (currentMode == DDiskInfo::Read) {
const QString &executer = Helper::getPartcloneExecuter(part);
process->start(QStringLiteral("%1 -s %2 -o - -c -z %3 -L /tmp/partclone.log").arg(executer).arg(part.filePath()).arg(Global::bufferSize), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("partclone.restore -s - -o %2 -z %3 -L /tmp/partclone.log").arg(part.filePath()).arg(Global::bufferSize));
}
break;
}
case DDiskInfo::JsonInfo: {
process->deleteLater();
process = 0;
buffer.setData(q->toJson());
break;
}
default:
return false;
}
if (process) {
if (!process->waitForStarted()) {
setErrorString(QObject::tr("Failed to start \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(process->errorString()));
return false;
}
dCDebug("The \"%s %s\" command start finished", qPrintable(process->program()), qPrintable(process->arguments().join(" ")));
}
bool ok = process ? process->isOpen() : buffer.open(QIODevice::ReadOnly);
if (!ok) {
setErrorString(QObject::tr("Failed to open process, error: %1").arg(process ? process->errorString(): buffer.errorString()));
}
return ok;
} | 778 | True | 1 |
||
CVE-2019-13228 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:C/A:C | LOCAL | MEDIUM | NONE | PARTIAL | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | HIGH | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 4.7 | MEDIUM | 1.0 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/repo.iso in the BootDoctor::fix() function to download an ISO file, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled. By winning a race condition to replace the /tmp/repo.iso symlink by an attacker controlled ISO file, further privilege escalation may be possible.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | DDeviceDiskInfoPrivate::openDataStream | DDeviceDiskInfoPrivate::openDataStream( int index) | ['index'] | bool DDeviceDiskInfoPrivate::openDataStream(int index)
{
if (process) {
process->deleteLater();
}
process = new QProcess();
QObject::connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
process, [this] (int code, QProcess::ExitStatus status) {
if (isClosing())
return;
if (status == QProcess::CrashExit) {
setErrorString(QObject::tr("process \"%1 %2\" crashed").arg(process->program()).arg(process->arguments().join(" ")));
} else if (code != 0) {
setErrorString(QObject::tr("Failed to perform process \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(QString::fromUtf8(process->readAllStandardError())));
}
});
switch (currentScope) {
case DDiskInfo::Headgear: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read) {
process->start(QStringLiteral("dd if=%1 bs=512 count=2048 status=none").arg(filePath()), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("dd of=%1 bs=512 status=none conv=fsync").arg(filePath()));
}
break;
}
case DDiskInfo::PartitionTable: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read)
process->start(QStringLiteral("sfdisk -d %1").arg(filePath()), QIODevice::ReadOnly);
else
process->start(QStringLiteral("sfdisk %1 --no-reread").arg(filePath()));
break;
}
case DDiskInfo::Partition: {
const DPartInfo &part = (index == 0 && currentMode == DDiskInfo::Write) ? DDevicePartInfo(filePath()) : q->getPartByNumber(index);
if (!part) {
dCDebug("Part is null(index: %d)", index);
return false;
}
dCDebug("Try open device: %s, mode: %s", qPrintable(part.filePath()), currentMode == DDiskInfo::Read ? "Read" : "Write");
if (Helper::isMounted(part.filePath())) {
if (Helper::umountDevice(part.filePath())) {
part.d->mountPoint.clear();
} else {
setErrorString(QObject::tr("\"%1\" is busy").arg(part.filePath()));
return false;
}
}
if (currentMode == DDiskInfo::Read) {
const QString &executer = Helper::getPartcloneExecuter(part);
process->start(QStringLiteral("%1 -s %2 -o - -c -z %3 -L /tmp/partclone.log").arg(executer).arg(part.filePath()).arg(Global::bufferSize), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("partclone.restore -s - -o %2 -z %3 -L /tmp/partclone.log").arg(part.filePath()).arg(Global::bufferSize));
}
break;
}
case DDiskInfo::JsonInfo: {
process->deleteLater();
process = 0;
buffer.setData(q->toJson());
break;
}
default:
return false;
}
if (process) {
if (!process->waitForStarted()) {
setErrorString(QObject::tr("Failed to start \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(process->errorString()));
return false;
}
dCDebug("The \"%s %s\" command start finished", qPrintable(process->program()), qPrintable(process->arguments().join(" ")));
}
bool ok = process ? process->isOpen() : buffer.open(QIODevice::ReadOnly);
if (!ok) {
setErrorString(QObject::tr("Failed to open process, error: %1").arg(process ? process->errorString(): buffer.errorString()));
}
return ok;
} | 778 | True | 1 |
||
CVE-2019-13229 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin_clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/partclone.log in the Helper::getPartitionSizeInfo() function to write a log file as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-08-14T11:25Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | DDeviceDiskInfoPrivate::openDataStream | DDeviceDiskInfoPrivate::openDataStream( int index) | ['index'] | bool DDeviceDiskInfoPrivate::openDataStream(int index)
{
if (process) {
process->deleteLater();
}
process = new QProcess();
QObject::connect(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
process, [this] (int code, QProcess::ExitStatus status) {
if (isClosing())
return;
if (status == QProcess::CrashExit) {
setErrorString(QObject::tr("process \"%1 %2\" crashed").arg(process->program()).arg(process->arguments().join(" ")));
} else if (code != 0) {
setErrorString(QObject::tr("Failed to perform process \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(QString::fromUtf8(process->readAllStandardError())));
}
});
switch (currentScope) {
case DDiskInfo::Headgear: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read) {
process->start(QStringLiteral("dd if=%1 bs=512 count=2048 status=none").arg(filePath()), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("dd of=%1 bs=512 status=none conv=fsync").arg(filePath()));
}
break;
}
case DDiskInfo::PartitionTable: {
if (type != DDiskInfo::Disk) {
setErrorString(QObject::tr("\"%1\" is not a disk device").arg(filePath()));
return false;
}
if (currentMode == DDiskInfo::Read)
process->start(QStringLiteral("sfdisk -d %1").arg(filePath()), QIODevice::ReadOnly);
else
process->start(QStringLiteral("sfdisk %1 --no-reread").arg(filePath()));
break;
}
case DDiskInfo::Partition: {
const DPartInfo &part = (index == 0 && currentMode == DDiskInfo::Write) ? DDevicePartInfo(filePath()) : q->getPartByNumber(index);
if (!part) {
dCDebug("Part is null(index: %d)", index);
return false;
}
dCDebug("Try open device: %s, mode: %s", qPrintable(part.filePath()), currentMode == DDiskInfo::Read ? "Read" : "Write");
if (Helper::isMounted(part.filePath())) {
if (Helper::umountDevice(part.filePath())) {
part.d->mountPoint.clear();
} else {
setErrorString(QObject::tr("\"%1\" is busy").arg(part.filePath()));
return false;
}
}
if (currentMode == DDiskInfo::Read) {
const QString &executer = Helper::getPartcloneExecuter(part);
process->start(QStringLiteral("%1 -s %2 -o - -c -z %3 -L /tmp/partclone.log").arg(executer).arg(part.filePath()).arg(Global::bufferSize), QIODevice::ReadOnly);
} else {
process->start(QStringLiteral("partclone.restore -s - -o %2 -z %3 -L /tmp/partclone.log").arg(part.filePath()).arg(Global::bufferSize));
}
break;
}
case DDiskInfo::JsonInfo: {
process->deleteLater();
process = 0;
buffer.setData(q->toJson());
break;
}
default:
return false;
}
if (process) {
if (!process->waitForStarted()) {
setErrorString(QObject::tr("Failed to start \"%1 %2\", error: %3").arg(process->program()).arg(process->arguments().join(" ")).arg(process->errorString()));
return false;
}
dCDebug("The \"%s %s\" command start finished", qPrintable(process->program()), qPrintable(process->arguments().join(" ")));
}
bool ok = process ? process->isOpen() : buffer.open(QIODevice::ReadOnly);
if (!ok) {
setErrorString(QObject::tr("Failed to open process, error: %1").arg(process ? process->errorString(): buffer.errorString()));
}
return ok;
} | 778 | True | 1 |
||
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12: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 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::getPartitionSizeInfo | Helper::getPartitionSizeInfo( const QString & partDevice , qint64 * used , qint64 * free , int * blockSize) | ['partDevice', 'used', 'free', 'blockSize'] | bool Helper::getPartitionSizeInfo(const QString &partDevice, qint64 *used, qint64 *free, int *blockSize)
{
QProcess process;
QStringList env_list = QProcess::systemEnvironment();
env_list.append("LANG=C");
process.setEnvironment(env_list);
if (Helper::isMounted(partDevice)) {
process.start(QString("df -B1 -P %1").arg(partDevice));
process.waitForFinished();
if (process.exitCode() != 0) {
dCError("Call df failed: %s", qPrintable(process.readAllStandardError()));
return false;
}
QByteArray output = process.readAll();
const QByteArrayList &lines = output.trimmed().split('\n');
if (lines.count() != 2)
return false;
output = lines.last().simplified();
const QByteArrayList &values = output.split(' ');
if (values.count() != 6)
return false;
bool ok = false;
if (used)
*used = values.at(2).toLongLong(&ok);
if (!ok)
return false;
if (free)
*free = values.at(3).toLongLong(&ok);
if (!ok)
return false;
return true;
} else {
process.start(QString("%1 -s %2 -c -q -C -L /tmp/partclone.log").arg(getPartcloneExecuter(DDevicePartInfo(partDevice))).arg(partDevice));
process.setStandardOutputFile("/dev/null");
process.setReadChannel(QProcess::StandardError);
process.waitForStarted();
qint64 used_block = -1;
qint64 free_block = -1;
while (process.waitForReadyRead(5000)) {
const QByteArray &data = process.readAll();
for (QByteArray line : data.split('\n')) {
line = line.simplified();
if (QString::fromLatin1(line).contains(QRegularExpression("\\berror\\b"))) {
dCError("Call \"%s %s\" failed: \"%s\"", qPrintable(process.program()), qPrintable(process.arguments().join(' ')), line.constData());
}
if (line.startsWith("Space in use:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(6, "-1");
used_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Free Space:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(5, "-1");
free_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Block size:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(2, "-1");
int block_size = value.toInt(&ok);
if (!ok) {
dCError("String to Int failed, String: %s", value.constData());
return false;
}
if (used_block < 0 || free_block < 0 || block_size < 0)
return false;
if (used)
*used = used_block * block_size;
if (free)
*free = free_block * block_size;
if (blockSize)
*blockSize = block_size;
process.terminate();
process.waitForFinished();
return true;
}
}
}
}
return false;
} | 676 | True | 1 |
|
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::getPartitionSizeInfo | Helper::getPartitionSizeInfo( const QString & partDevice , qint64 * used , qint64 * free , int * blockSize) | ['partDevice', 'used', 'free', 'blockSize'] | bool Helper::getPartitionSizeInfo(const QString &partDevice, qint64 *used, qint64 *free, int *blockSize)
{
QProcess process;
QStringList env_list = QProcess::systemEnvironment();
env_list.append("LANG=C");
process.setEnvironment(env_list);
if (Helper::isMounted(partDevice)) {
process.start(QString("df -B1 -P %1").arg(partDevice));
process.waitForFinished();
if (process.exitCode() != 0) {
dCError("Call df failed: %s", qPrintable(process.readAllStandardError()));
return false;
}
QByteArray output = process.readAll();
const QByteArrayList &lines = output.trimmed().split('\n');
if (lines.count() != 2)
return false;
output = lines.last().simplified();
const QByteArrayList &values = output.split(' ');
if (values.count() != 6)
return false;
bool ok = false;
if (used)
*used = values.at(2).toLongLong(&ok);
if (!ok)
return false;
if (free)
*free = values.at(3).toLongLong(&ok);
if (!ok)
return false;
return true;
} else {
process.start(QString("%1 -s %2 -c -q -C -L /tmp/partclone.log").arg(getPartcloneExecuter(DDevicePartInfo(partDevice))).arg(partDevice));
process.setStandardOutputFile("/dev/null");
process.setReadChannel(QProcess::StandardError);
process.waitForStarted();
qint64 used_block = -1;
qint64 free_block = -1;
while (process.waitForReadyRead(5000)) {
const QByteArray &data = process.readAll();
for (QByteArray line : data.split('\n')) {
line = line.simplified();
if (QString::fromLatin1(line).contains(QRegularExpression("\\berror\\b"))) {
dCError("Call \"%s %s\" failed: \"%s\"", qPrintable(process.program()), qPrintable(process.arguments().join(' ')), line.constData());
}
if (line.startsWith("Space in use:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(6, "-1");
used_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Free Space:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(5, "-1");
free_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Block size:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(2, "-1");
int block_size = value.toInt(&ok);
if (!ok) {
dCError("String to Int failed, String: %s", value.constData());
return false;
}
if (used_block < 0 || free_block < 0 || block_size < 0)
return false;
if (used)
*used = used_block * block_size;
if (free)
*free = free_block * block_size;
if (blockSize)
*blockSize = block_size;
process.terminate();
process.waitForFinished();
return true;
}
}
}
}
return false;
} | 676 | True | 1 |
||
CVE-2019-13227 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In GUI mode, deepin-clone before 1.1.3 creates a log file at the fixed path /tmp/.deepin-clone.log as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::getPartitionSizeInfo | Helper::getPartitionSizeInfo( const QString & partDevice , qint64 * used , qint64 * free , int * blockSize) | ['partDevice', 'used', 'free', 'blockSize'] | bool Helper::getPartitionSizeInfo(const QString &partDevice, qint64 *used, qint64 *free, int *blockSize)
{
QProcess process;
QStringList env_list = QProcess::systemEnvironment();
env_list.append("LANG=C");
process.setEnvironment(env_list);
if (Helper::isMounted(partDevice)) {
process.start(QString("df -B1 -P %1").arg(partDevice));
process.waitForFinished();
if (process.exitCode() != 0) {
dCError("Call df failed: %s", qPrintable(process.readAllStandardError()));
return false;
}
QByteArray output = process.readAll();
const QByteArrayList &lines = output.trimmed().split('\n');
if (lines.count() != 2)
return false;
output = lines.last().simplified();
const QByteArrayList &values = output.split(' ');
if (values.count() != 6)
return false;
bool ok = false;
if (used)
*used = values.at(2).toLongLong(&ok);
if (!ok)
return false;
if (free)
*free = values.at(3).toLongLong(&ok);
if (!ok)
return false;
return true;
} else {
process.start(QString("%1 -s %2 -c -q -C -L /tmp/partclone.log").arg(getPartcloneExecuter(DDevicePartInfo(partDevice))).arg(partDevice));
process.setStandardOutputFile("/dev/null");
process.setReadChannel(QProcess::StandardError);
process.waitForStarted();
qint64 used_block = -1;
qint64 free_block = -1;
while (process.waitForReadyRead(5000)) {
const QByteArray &data = process.readAll();
for (QByteArray line : data.split('\n')) {
line = line.simplified();
if (QString::fromLatin1(line).contains(QRegularExpression("\\berror\\b"))) {
dCError("Call \"%s %s\" failed: \"%s\"", qPrintable(process.program()), qPrintable(process.arguments().join(' ')), line.constData());
}
if (line.startsWith("Space in use:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(6, "-1");
used_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Free Space:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(5, "-1");
free_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Block size:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(2, "-1");
int block_size = value.toInt(&ok);
if (!ok) {
dCError("String to Int failed, String: %s", value.constData());
return false;
}
if (used_block < 0 || free_block < 0 || block_size < 0)
return false;
if (used)
*used = used_block * block_size;
if (free)
*free = free_block * block_size;
if (blockSize)
*blockSize = block_size;
process.terminate();
process.waitForFinished();
return true;
}
}
}
}
return false;
} | 676 | True | 1 |
||
CVE-2019-13228 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:C/A:C | LOCAL | MEDIUM | NONE | PARTIAL | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | HIGH | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 4.7 | MEDIUM | 1.0 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/repo.iso in the BootDoctor::fix() function to download an ISO file, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled. By winning a race condition to replace the /tmp/repo.iso symlink by an attacker controlled ISO file, further privilege escalation may be possible.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::getPartitionSizeInfo | Helper::getPartitionSizeInfo( const QString & partDevice , qint64 * used , qint64 * free , int * blockSize) | ['partDevice', 'used', 'free', 'blockSize'] | bool Helper::getPartitionSizeInfo(const QString &partDevice, qint64 *used, qint64 *free, int *blockSize)
{
QProcess process;
QStringList env_list = QProcess::systemEnvironment();
env_list.append("LANG=C");
process.setEnvironment(env_list);
if (Helper::isMounted(partDevice)) {
process.start(QString("df -B1 -P %1").arg(partDevice));
process.waitForFinished();
if (process.exitCode() != 0) {
dCError("Call df failed: %s", qPrintable(process.readAllStandardError()));
return false;
}
QByteArray output = process.readAll();
const QByteArrayList &lines = output.trimmed().split('\n');
if (lines.count() != 2)
return false;
output = lines.last().simplified();
const QByteArrayList &values = output.split(' ');
if (values.count() != 6)
return false;
bool ok = false;
if (used)
*used = values.at(2).toLongLong(&ok);
if (!ok)
return false;
if (free)
*free = values.at(3).toLongLong(&ok);
if (!ok)
return false;
return true;
} else {
process.start(QString("%1 -s %2 -c -q -C -L /tmp/partclone.log").arg(getPartcloneExecuter(DDevicePartInfo(partDevice))).arg(partDevice));
process.setStandardOutputFile("/dev/null");
process.setReadChannel(QProcess::StandardError);
process.waitForStarted();
qint64 used_block = -1;
qint64 free_block = -1;
while (process.waitForReadyRead(5000)) {
const QByteArray &data = process.readAll();
for (QByteArray line : data.split('\n')) {
line = line.simplified();
if (QString::fromLatin1(line).contains(QRegularExpression("\\berror\\b"))) {
dCError("Call \"%s %s\" failed: \"%s\"", qPrintable(process.program()), qPrintable(process.arguments().join(' ')), line.constData());
}
if (line.startsWith("Space in use:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(6, "-1");
used_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Free Space:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(5, "-1");
free_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Block size:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(2, "-1");
int block_size = value.toInt(&ok);
if (!ok) {
dCError("String to Int failed, String: %s", value.constData());
return false;
}
if (used_block < 0 || free_block < 0 || block_size < 0)
return false;
if (used)
*used = used_block * block_size;
if (free)
*free = free_block * block_size;
if (blockSize)
*blockSize = block_size;
process.terminate();
process.waitForFinished();
return true;
}
}
}
}
return false;
} | 676 | True | 1 |
||
CVE-2019-13229 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin_clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/partclone.log in the Helper::getPartitionSizeInfo() function to write a log file as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-08-14T11:25Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::getPartitionSizeInfo | Helper::getPartitionSizeInfo( const QString & partDevice , qint64 * used , qint64 * free , int * blockSize) | ['partDevice', 'used', 'free', 'blockSize'] | bool Helper::getPartitionSizeInfo(const QString &partDevice, qint64 *used, qint64 *free, int *blockSize)
{
QProcess process;
QStringList env_list = QProcess::systemEnvironment();
env_list.append("LANG=C");
process.setEnvironment(env_list);
if (Helper::isMounted(partDevice)) {
process.start(QString("df -B1 -P %1").arg(partDevice));
process.waitForFinished();
if (process.exitCode() != 0) {
dCError("Call df failed: %s", qPrintable(process.readAllStandardError()));
return false;
}
QByteArray output = process.readAll();
const QByteArrayList &lines = output.trimmed().split('\n');
if (lines.count() != 2)
return false;
output = lines.last().simplified();
const QByteArrayList &values = output.split(' ');
if (values.count() != 6)
return false;
bool ok = false;
if (used)
*used = values.at(2).toLongLong(&ok);
if (!ok)
return false;
if (free)
*free = values.at(3).toLongLong(&ok);
if (!ok)
return false;
return true;
} else {
process.start(QString("%1 -s %2 -c -q -C -L /tmp/partclone.log").arg(getPartcloneExecuter(DDevicePartInfo(partDevice))).arg(partDevice));
process.setStandardOutputFile("/dev/null");
process.setReadChannel(QProcess::StandardError);
process.waitForStarted();
qint64 used_block = -1;
qint64 free_block = -1;
while (process.waitForReadyRead(5000)) {
const QByteArray &data = process.readAll();
for (QByteArray line : data.split('\n')) {
line = line.simplified();
if (QString::fromLatin1(line).contains(QRegularExpression("\\berror\\b"))) {
dCError("Call \"%s %s\" failed: \"%s\"", qPrintable(process.program()), qPrintable(process.arguments().join(' ')), line.constData());
}
if (line.startsWith("Space in use:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(6, "-1");
used_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Free Space:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(5, "-1");
free_block = value.toLongLong(&ok);
if (!ok) {
dCError("String to LongLong failed, String: %s", value.constData());
return false;
}
} else if (line.startsWith("Block size:")) {
bool ok = false;
const QByteArray &value = line.split(' ').value(2, "-1");
int block_size = value.toInt(&ok);
if (!ok) {
dCError("String to Int failed, String: %s", value.constData());
return false;
}
if (used_block < 0 || free_block < 0 || block_size < 0)
return false;
if (used)
*used = used_block * block_size;
if (free)
*free = free_block * block_size;
if (blockSize)
*blockSize = block_size;
process.terminate();
process.waitForFinished();
return true;
}
}
}
}
return false;
} | 676 | True | 1 |
||
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12: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 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::temporaryMountDevice | Helper::temporaryMountDevice( const QString & device , const QString & name , bool readonly) | ['device', 'name', 'readonly'] | QString Helper::temporaryMountDevice(const QString &device, const QString &name, bool readonly)
{
QString mount_point = mountPoint(device);
if (!mount_point.isEmpty())
return mount_point;
mount_point = "%1/.%2/mount/%3";
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
mount_point = mount_point.arg(tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()).arg(qApp->applicationName()).arg(name);
if (!QDir::current().mkpath(mount_point)) {
dCError("mkpath \"%s\" failed", qPrintable(mount_point));
return QString();
}
if (!mountDevice(device, mount_point, readonly)) {
dCError("Mount the device \"%s\" to \"%s\" failed", qPrintable(device), qPrintable(mount_point));
return QString();
}
return mount_point;
} | 160 | True | 1 |
|
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::temporaryMountDevice | Helper::temporaryMountDevice( const QString & device , const QString & name , bool readonly) | ['device', 'name', 'readonly'] | QString Helper::temporaryMountDevice(const QString &device, const QString &name, bool readonly)
{
QString mount_point = mountPoint(device);
if (!mount_point.isEmpty())
return mount_point;
mount_point = "%1/.%2/mount/%3";
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
mount_point = mount_point.arg(tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()).arg(qApp->applicationName()).arg(name);
if (!QDir::current().mkpath(mount_point)) {
dCError("mkpath \"%s\" failed", qPrintable(mount_point));
return QString();
}
if (!mountDevice(device, mount_point, readonly)) {
dCError("Mount the device \"%s\" to \"%s\" failed", qPrintable(device), qPrintable(mount_point));
return QString();
}
return mount_point;
} | 160 | True | 1 |
||
CVE-2019-13227 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In GUI mode, deepin-clone before 1.1.3 creates a log file at the fixed path /tmp/.deepin-clone.log as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::temporaryMountDevice | Helper::temporaryMountDevice( const QString & device , const QString & name , bool readonly) | ['device', 'name', 'readonly'] | QString Helper::temporaryMountDevice(const QString &device, const QString &name, bool readonly)
{
QString mount_point = mountPoint(device);
if (!mount_point.isEmpty())
return mount_point;
mount_point = "%1/.%2/mount/%3";
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
mount_point = mount_point.arg(tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()).arg(qApp->applicationName()).arg(name);
if (!QDir::current().mkpath(mount_point)) {
dCError("mkpath \"%s\" failed", qPrintable(mount_point));
return QString();
}
if (!mountDevice(device, mount_point, readonly)) {
dCError("Mount the device \"%s\" to \"%s\" failed", qPrintable(device), qPrintable(mount_point));
return QString();
}
return mount_point;
} | 160 | True | 1 |
||
CVE-2019-13228 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:C/A:C | LOCAL | MEDIUM | NONE | PARTIAL | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | HIGH | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 4.7 | MEDIUM | 1.0 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/repo.iso in the BootDoctor::fix() function to download an ISO file, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled. By winning a race condition to replace the /tmp/repo.iso symlink by an attacker controlled ISO file, further privilege escalation may be possible.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::temporaryMountDevice | Helper::temporaryMountDevice( const QString & device , const QString & name , bool readonly) | ['device', 'name', 'readonly'] | QString Helper::temporaryMountDevice(const QString &device, const QString &name, bool readonly)
{
QString mount_point = mountPoint(device);
if (!mount_point.isEmpty())
return mount_point;
mount_point = "%1/.%2/mount/%3";
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
mount_point = mount_point.arg(tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()).arg(qApp->applicationName()).arg(name);
if (!QDir::current().mkpath(mount_point)) {
dCError("mkpath \"%s\" failed", qPrintable(mount_point));
return QString();
}
if (!mountDevice(device, mount_point, readonly)) {
dCError("Mount the device \"%s\" to \"%s\" failed", qPrintable(device), qPrintable(mount_point));
return QString();
}
return mount_point;
} | 160 | True | 1 |
||
CVE-2019-13229 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin_clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/partclone.log in the Helper::getPartitionSizeInfo() function to write a log file as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-08-14T11:25Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | Helper::temporaryMountDevice | Helper::temporaryMountDevice( const QString & device , const QString & name , bool readonly) | ['device', 'name', 'readonly'] | QString Helper::temporaryMountDevice(const QString &device, const QString &name, bool readonly)
{
QString mount_point = mountPoint(device);
if (!mount_point.isEmpty())
return mount_point;
mount_point = "%1/.%2/mount/%3";
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
mount_point = mount_point.arg(tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()).arg(qApp->applicationName()).arg(name);
if (!QDir::current().mkpath(mount_point)) {
dCError("mkpath \"%s\" failed", qPrintable(mount_point));
return QString();
}
if (!mountDevice(device, mount_point, readonly)) {
dCError("Mount the device \"%s\" to \"%s\" failed", qPrintable(device), qPrintable(mount_point));
return QString();
}
return mount_point;
} | 160 | True | 1 |
||
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12: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 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | BootDoctor::fix | BootDoctor::fix( const QString & partDevice) | ['partDevice'] | bool BootDoctor::fix(const QString &partDevice)
{
m_lastErrorString.clear();
DDevicePartInfo part_info(partDevice);
const QString part_old_uuid = part_info.uuid();
if (Helper::processExec("lsblk -s -d -n -o UUID") == 0) {
if (Helper::lastProcessStandardOutput().contains(part_old_uuid.toLatin1())) {
// reset uuid
if (Helper::resetPartUUID(part_info)) {
QThread::sleep(1);
part_info.refresh();
qDebug() << part_old_uuid << part_info.uuid();
} else {
dCWarning("Failed to reset uuid");
}
}
}
bool device_is_mounted = Helper::isMounted(partDevice);
const QString &mount_root = Helper::temporaryMountDevice(partDevice, QFileInfo(partDevice).fileName());
if (mount_root.isEmpty()) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(partDevice);
goto failed;
}
{
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
const QString tmp_dir = (tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()) + "/.deepin-clone";
if (!QDir::current().mkpath(tmp_dir)) {
dCError("mkpath \"%s\" failed", qPrintable(tmp_dir));
goto failed;
}
const QString &repo_path = tmp_dir + "/repo.iso";
if (!QFile::exists(repo_path)
&& !QFile::copy(QString(":/repo_%1.iso").arg(HOST_ARCH), repo_path)) {
dCError("copy file failed, new name: %s", qPrintable(repo_path));
goto failed;
}
bool ok = false;
const QString &repo_mount_point = mount_root + "/deepin-clone";
QFile file_boot_fix(mount_root + "/boot_fix.sh");
do {
if (!QDir(mount_root).exists("deepin-clone") && !QDir(mount_root).mkdir("deepin-clone")) {
dCError("Create \"deepin-clone\" dir failed(\"%s\")", qPrintable(mount_root));
break;
}
if (!Helper::mountDevice(repo_path, repo_mount_point, true)) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(repo_path);
break;
}
if (file_boot_fix.exists()) {
file_boot_fix.remove();
}
if (!QFile::copy(QString(":/scripts/boot_fix_%1.sh").arg(
#if defined(HOST_ARCH_x86_64) || defined(HOST_ARCH_i386) || defined(HOST_ARCH_i686)
"x86"
#elif defined(HOST_ARCH_mips64) || defined(HOST_ARCH_mips32)
"mips"
#elif defined(HOST_ARCH_sw_64)
"sw_64"
#elif defined(HOST_ARCH_aarch64)
"aarch64"
#else
#pragma message "Machine: " HOST_ARCH
"unknow"
#endif
), file_boot_fix.fileName())) {
dCError("copy file failed, new name: %s", qPrintable(file_boot_fix.fileName()));
break;
}
if (!file_boot_fix.setPermissions(file_boot_fix.permissions() | QFile::ExeUser)) {
dCError("Set \"%s\" permissions failed", qPrintable(file_boot_fix.fileName()));
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev %1/dev").arg(mount_root)) != 0) {
dCError("Failed to bind /dev");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev/pts %1/dev/pts").arg(mount_root)) != 0) {
dCError("Failed to bind /dev/pts");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /proc %1/proc").arg(mount_root)) != 0) {
dCError("Failed to bind /proc");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /sys %1/sys").arg(mount_root)) != 0) {
dCError("Failed to bind /sys");
break;
}
ok = true;
} while (0);
QProcess process;
if (ok) {
const QString &parent_device = Helper::parentDevice(partDevice);
bool is_efi = false;
if (!parent_device.isEmpty()) {
DDeviceDiskInfo info(parent_device);
dCDebug("Disk partition table type: %d", info.ptType());
if (info.ptType() == DDeviceDiskInfo::GPT) {
for (const DPartInfo &part : info.childrenPartList()) {
if (part.guidType() == DPartInfo::EFI_SP_None) {
const QString &efi_path = mount_root + "/boot/efi";
QDir::current().mkpath(efi_path);
if (Helper::processExec(QString("mount %1 %2").arg(part.filePath()).arg(efi_path)) != 0) {
dCError("Failed to mount EFI partition");
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(part.filePath());
ok = false;
break;
}
is_efi = true;
break;
}
}
if (!is_efi && m_lastErrorString.isEmpty()) {
m_lastErrorString = QObject::tr("EFI partition not found");
ok = false;
}
} else if (info.ptType() == DDeviceDiskInfo::Unknow) {
m_lastErrorString = QObject::tr("Unknown partition style");
ok = false;
}
}
if (ok) {
process.setProcessChannelMode(QProcess::MergedChannels);
process.start(QString("chroot %1 ./boot_fix.sh %2 %3 /deepin-clone")
.arg(mount_root)
.arg(parent_device)
.arg(is_efi ? "true" : "false"));
while (process.waitForReadyRead()) {
const QByteArray &data = process.readAll().simplified().constData();
dCDebug(data.constData());
}
process.waitForFinished(-1);
switch (process.exitCode()) {
case 1:
m_lastErrorString = QObject::tr("Boot for install system failed");
break;
case 2:
m_lastErrorString = QObject::tr("Boot for update system failed");
break;
default:
break;
}
}
}
// clear
Helper::processExec("umount " + repo_mount_point);
QDir(mount_root).rmdir("deepin-clone");
file_boot_fix.remove();
Helper::processExec("umount " + mount_root + "/dev/pts");
Helper::processExec("umount " + mount_root + "/dev");
Helper::processExec("umount " + mount_root + "/proc");
Helper::processExec("umount " + mount_root + "/sys");
Helper::processExec("umount " + mount_root + "/boot/efi");
if (ok && process.exitCode() == 0) {
if (part_old_uuid != part_info.uuid()) {
dCDebug("Reset the uuid from \"%s\" to \"%s\"", qPrintable(part_old_uuid), qPrintable(part_info.uuid()));
// update /etc/fstab
QFile file(mount_root + "/etc/fstab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/fstab, error: %s", qPrintable(file.errorString()));
}
file.setFileName(mount_root + "/etc/crypttab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/crypttab, error: %s", qPrintable(file.errorString()));
}
}
if (!device_is_mounted)
Helper::umountDevice(partDevice);
return true;
}
}
failed:
if (!device_is_mounted)
Helper::umountDevice(partDevice);
if (m_lastErrorString.isEmpty())
m_lastErrorString = QObject::tr("Boot for repair system failed");
dCDebug("Restore partition uuid");
if (!Helper::resetPartUUID(part_info, part_old_uuid.toLatin1())) {
dCWarning("Failed to restore partition uuid, part: %s, uuid: %s", qPrintable(partDevice), qPrintable(part_old_uuid));
}
return false;
} | 1375 | True | 1 |
|
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | BootDoctor::fix | BootDoctor::fix( const QString & partDevice) | ['partDevice'] | bool BootDoctor::fix(const QString &partDevice)
{
m_lastErrorString.clear();
DDevicePartInfo part_info(partDevice);
const QString part_old_uuid = part_info.uuid();
if (Helper::processExec("lsblk -s -d -n -o UUID") == 0) {
if (Helper::lastProcessStandardOutput().contains(part_old_uuid.toLatin1())) {
// reset uuid
if (Helper::resetPartUUID(part_info)) {
QThread::sleep(1);
part_info.refresh();
qDebug() << part_old_uuid << part_info.uuid();
} else {
dCWarning("Failed to reset uuid");
}
}
}
bool device_is_mounted = Helper::isMounted(partDevice);
const QString &mount_root = Helper::temporaryMountDevice(partDevice, QFileInfo(partDevice).fileName());
if (mount_root.isEmpty()) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(partDevice);
goto failed;
}
{
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
const QString tmp_dir = (tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()) + "/.deepin-clone";
if (!QDir::current().mkpath(tmp_dir)) {
dCError("mkpath \"%s\" failed", qPrintable(tmp_dir));
goto failed;
}
const QString &repo_path = tmp_dir + "/repo.iso";
if (!QFile::exists(repo_path)
&& !QFile::copy(QString(":/repo_%1.iso").arg(HOST_ARCH), repo_path)) {
dCError("copy file failed, new name: %s", qPrintable(repo_path));
goto failed;
}
bool ok = false;
const QString &repo_mount_point = mount_root + "/deepin-clone";
QFile file_boot_fix(mount_root + "/boot_fix.sh");
do {
if (!QDir(mount_root).exists("deepin-clone") && !QDir(mount_root).mkdir("deepin-clone")) {
dCError("Create \"deepin-clone\" dir failed(\"%s\")", qPrintable(mount_root));
break;
}
if (!Helper::mountDevice(repo_path, repo_mount_point, true)) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(repo_path);
break;
}
if (file_boot_fix.exists()) {
file_boot_fix.remove();
}
if (!QFile::copy(QString(":/scripts/boot_fix_%1.sh").arg(
#if defined(HOST_ARCH_x86_64) || defined(HOST_ARCH_i386) || defined(HOST_ARCH_i686)
"x86"
#elif defined(HOST_ARCH_mips64) || defined(HOST_ARCH_mips32)
"mips"
#elif defined(HOST_ARCH_sw_64)
"sw_64"
#elif defined(HOST_ARCH_aarch64)
"aarch64"
#else
#pragma message "Machine: " HOST_ARCH
"unknow"
#endif
), file_boot_fix.fileName())) {
dCError("copy file failed, new name: %s", qPrintable(file_boot_fix.fileName()));
break;
}
if (!file_boot_fix.setPermissions(file_boot_fix.permissions() | QFile::ExeUser)) {
dCError("Set \"%s\" permissions failed", qPrintable(file_boot_fix.fileName()));
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev %1/dev").arg(mount_root)) != 0) {
dCError("Failed to bind /dev");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev/pts %1/dev/pts").arg(mount_root)) != 0) {
dCError("Failed to bind /dev/pts");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /proc %1/proc").arg(mount_root)) != 0) {
dCError("Failed to bind /proc");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /sys %1/sys").arg(mount_root)) != 0) {
dCError("Failed to bind /sys");
break;
}
ok = true;
} while (0);
QProcess process;
if (ok) {
const QString &parent_device = Helper::parentDevice(partDevice);
bool is_efi = false;
if (!parent_device.isEmpty()) {
DDeviceDiskInfo info(parent_device);
dCDebug("Disk partition table type: %d", info.ptType());
if (info.ptType() == DDeviceDiskInfo::GPT) {
for (const DPartInfo &part : info.childrenPartList()) {
if (part.guidType() == DPartInfo::EFI_SP_None) {
const QString &efi_path = mount_root + "/boot/efi";
QDir::current().mkpath(efi_path);
if (Helper::processExec(QString("mount %1 %2").arg(part.filePath()).arg(efi_path)) != 0) {
dCError("Failed to mount EFI partition");
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(part.filePath());
ok = false;
break;
}
is_efi = true;
break;
}
}
if (!is_efi && m_lastErrorString.isEmpty()) {
m_lastErrorString = QObject::tr("EFI partition not found");
ok = false;
}
} else if (info.ptType() == DDeviceDiskInfo::Unknow) {
m_lastErrorString = QObject::tr("Unknown partition style");
ok = false;
}
}
if (ok) {
process.setProcessChannelMode(QProcess::MergedChannels);
process.start(QString("chroot %1 ./boot_fix.sh %2 %3 /deepin-clone")
.arg(mount_root)
.arg(parent_device)
.arg(is_efi ? "true" : "false"));
while (process.waitForReadyRead()) {
const QByteArray &data = process.readAll().simplified().constData();
dCDebug(data.constData());
}
process.waitForFinished(-1);
switch (process.exitCode()) {
case 1:
m_lastErrorString = QObject::tr("Boot for install system failed");
break;
case 2:
m_lastErrorString = QObject::tr("Boot for update system failed");
break;
default:
break;
}
}
}
// clear
Helper::processExec("umount " + repo_mount_point);
QDir(mount_root).rmdir("deepin-clone");
file_boot_fix.remove();
Helper::processExec("umount " + mount_root + "/dev/pts");
Helper::processExec("umount " + mount_root + "/dev");
Helper::processExec("umount " + mount_root + "/proc");
Helper::processExec("umount " + mount_root + "/sys");
Helper::processExec("umount " + mount_root + "/boot/efi");
if (ok && process.exitCode() == 0) {
if (part_old_uuid != part_info.uuid()) {
dCDebug("Reset the uuid from \"%s\" to \"%s\"", qPrintable(part_old_uuid), qPrintable(part_info.uuid()));
// update /etc/fstab
QFile file(mount_root + "/etc/fstab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/fstab, error: %s", qPrintable(file.errorString()));
}
file.setFileName(mount_root + "/etc/crypttab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/crypttab, error: %s", qPrintable(file.errorString()));
}
}
if (!device_is_mounted)
Helper::umountDevice(partDevice);
return true;
}
}
failed:
if (!device_is_mounted)
Helper::umountDevice(partDevice);
if (m_lastErrorString.isEmpty())
m_lastErrorString = QObject::tr("Boot for repair system failed");
dCDebug("Restore partition uuid");
if (!Helper::resetPartUUID(part_info, part_old_uuid.toLatin1())) {
dCWarning("Failed to restore partition uuid, part: %s, uuid: %s", qPrintable(partDevice), qPrintable(part_old_uuid));
}
return false;
} | 1375 | True | 1 |
||
CVE-2019-13227 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In GUI mode, deepin-clone before 1.1.3 creates a log file at the fixed path /tmp/.deepin-clone.log as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | BootDoctor::fix | BootDoctor::fix( const QString & partDevice) | ['partDevice'] | bool BootDoctor::fix(const QString &partDevice)
{
m_lastErrorString.clear();
DDevicePartInfo part_info(partDevice);
const QString part_old_uuid = part_info.uuid();
if (Helper::processExec("lsblk -s -d -n -o UUID") == 0) {
if (Helper::lastProcessStandardOutput().contains(part_old_uuid.toLatin1())) {
// reset uuid
if (Helper::resetPartUUID(part_info)) {
QThread::sleep(1);
part_info.refresh();
qDebug() << part_old_uuid << part_info.uuid();
} else {
dCWarning("Failed to reset uuid");
}
}
}
bool device_is_mounted = Helper::isMounted(partDevice);
const QString &mount_root = Helper::temporaryMountDevice(partDevice, QFileInfo(partDevice).fileName());
if (mount_root.isEmpty()) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(partDevice);
goto failed;
}
{
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
const QString tmp_dir = (tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()) + "/.deepin-clone";
if (!QDir::current().mkpath(tmp_dir)) {
dCError("mkpath \"%s\" failed", qPrintable(tmp_dir));
goto failed;
}
const QString &repo_path = tmp_dir + "/repo.iso";
if (!QFile::exists(repo_path)
&& !QFile::copy(QString(":/repo_%1.iso").arg(HOST_ARCH), repo_path)) {
dCError("copy file failed, new name: %s", qPrintable(repo_path));
goto failed;
}
bool ok = false;
const QString &repo_mount_point = mount_root + "/deepin-clone";
QFile file_boot_fix(mount_root + "/boot_fix.sh");
do {
if (!QDir(mount_root).exists("deepin-clone") && !QDir(mount_root).mkdir("deepin-clone")) {
dCError("Create \"deepin-clone\" dir failed(\"%s\")", qPrintable(mount_root));
break;
}
if (!Helper::mountDevice(repo_path, repo_mount_point, true)) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(repo_path);
break;
}
if (file_boot_fix.exists()) {
file_boot_fix.remove();
}
if (!QFile::copy(QString(":/scripts/boot_fix_%1.sh").arg(
#if defined(HOST_ARCH_x86_64) || defined(HOST_ARCH_i386) || defined(HOST_ARCH_i686)
"x86"
#elif defined(HOST_ARCH_mips64) || defined(HOST_ARCH_mips32)
"mips"
#elif defined(HOST_ARCH_sw_64)
"sw_64"
#elif defined(HOST_ARCH_aarch64)
"aarch64"
#else
#pragma message "Machine: " HOST_ARCH
"unknow"
#endif
), file_boot_fix.fileName())) {
dCError("copy file failed, new name: %s", qPrintable(file_boot_fix.fileName()));
break;
}
if (!file_boot_fix.setPermissions(file_boot_fix.permissions() | QFile::ExeUser)) {
dCError("Set \"%s\" permissions failed", qPrintable(file_boot_fix.fileName()));
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev %1/dev").arg(mount_root)) != 0) {
dCError("Failed to bind /dev");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev/pts %1/dev/pts").arg(mount_root)) != 0) {
dCError("Failed to bind /dev/pts");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /proc %1/proc").arg(mount_root)) != 0) {
dCError("Failed to bind /proc");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /sys %1/sys").arg(mount_root)) != 0) {
dCError("Failed to bind /sys");
break;
}
ok = true;
} while (0);
QProcess process;
if (ok) {
const QString &parent_device = Helper::parentDevice(partDevice);
bool is_efi = false;
if (!parent_device.isEmpty()) {
DDeviceDiskInfo info(parent_device);
dCDebug("Disk partition table type: %d", info.ptType());
if (info.ptType() == DDeviceDiskInfo::GPT) {
for (const DPartInfo &part : info.childrenPartList()) {
if (part.guidType() == DPartInfo::EFI_SP_None) {
const QString &efi_path = mount_root + "/boot/efi";
QDir::current().mkpath(efi_path);
if (Helper::processExec(QString("mount %1 %2").arg(part.filePath()).arg(efi_path)) != 0) {
dCError("Failed to mount EFI partition");
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(part.filePath());
ok = false;
break;
}
is_efi = true;
break;
}
}
if (!is_efi && m_lastErrorString.isEmpty()) {
m_lastErrorString = QObject::tr("EFI partition not found");
ok = false;
}
} else if (info.ptType() == DDeviceDiskInfo::Unknow) {
m_lastErrorString = QObject::tr("Unknown partition style");
ok = false;
}
}
if (ok) {
process.setProcessChannelMode(QProcess::MergedChannels);
process.start(QString("chroot %1 ./boot_fix.sh %2 %3 /deepin-clone")
.arg(mount_root)
.arg(parent_device)
.arg(is_efi ? "true" : "false"));
while (process.waitForReadyRead()) {
const QByteArray &data = process.readAll().simplified().constData();
dCDebug(data.constData());
}
process.waitForFinished(-1);
switch (process.exitCode()) {
case 1:
m_lastErrorString = QObject::tr("Boot for install system failed");
break;
case 2:
m_lastErrorString = QObject::tr("Boot for update system failed");
break;
default:
break;
}
}
}
// clear
Helper::processExec("umount " + repo_mount_point);
QDir(mount_root).rmdir("deepin-clone");
file_boot_fix.remove();
Helper::processExec("umount " + mount_root + "/dev/pts");
Helper::processExec("umount " + mount_root + "/dev");
Helper::processExec("umount " + mount_root + "/proc");
Helper::processExec("umount " + mount_root + "/sys");
Helper::processExec("umount " + mount_root + "/boot/efi");
if (ok && process.exitCode() == 0) {
if (part_old_uuid != part_info.uuid()) {
dCDebug("Reset the uuid from \"%s\" to \"%s\"", qPrintable(part_old_uuid), qPrintable(part_info.uuid()));
// update /etc/fstab
QFile file(mount_root + "/etc/fstab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/fstab, error: %s", qPrintable(file.errorString()));
}
file.setFileName(mount_root + "/etc/crypttab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/crypttab, error: %s", qPrintable(file.errorString()));
}
}
if (!device_is_mounted)
Helper::umountDevice(partDevice);
return true;
}
}
failed:
if (!device_is_mounted)
Helper::umountDevice(partDevice);
if (m_lastErrorString.isEmpty())
m_lastErrorString = QObject::tr("Boot for repair system failed");
dCDebug("Restore partition uuid");
if (!Helper::resetPartUUID(part_info, part_old_uuid.toLatin1())) {
dCWarning("Failed to restore partition uuid, part: %s, uuid: %s", qPrintable(partDevice), qPrintable(part_old_uuid));
}
return false;
} | 1375 | True | 1 |
||
CVE-2019-13228 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:C/A:C | LOCAL | MEDIUM | NONE | PARTIAL | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | HIGH | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 4.7 | MEDIUM | 1.0 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/repo.iso in the BootDoctor::fix() function to download an ISO file, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled. By winning a race condition to replace the /tmp/repo.iso symlink by an attacker controlled ISO file, further privilege escalation may be possible.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | BootDoctor::fix | BootDoctor::fix( const QString & partDevice) | ['partDevice'] | bool BootDoctor::fix(const QString &partDevice)
{
m_lastErrorString.clear();
DDevicePartInfo part_info(partDevice);
const QString part_old_uuid = part_info.uuid();
if (Helper::processExec("lsblk -s -d -n -o UUID") == 0) {
if (Helper::lastProcessStandardOutput().contains(part_old_uuid.toLatin1())) {
// reset uuid
if (Helper::resetPartUUID(part_info)) {
QThread::sleep(1);
part_info.refresh();
qDebug() << part_old_uuid << part_info.uuid();
} else {
dCWarning("Failed to reset uuid");
}
}
}
bool device_is_mounted = Helper::isMounted(partDevice);
const QString &mount_root = Helper::temporaryMountDevice(partDevice, QFileInfo(partDevice).fileName());
if (mount_root.isEmpty()) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(partDevice);
goto failed;
}
{
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
const QString tmp_dir = (tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()) + "/.deepin-clone";
if (!QDir::current().mkpath(tmp_dir)) {
dCError("mkpath \"%s\" failed", qPrintable(tmp_dir));
goto failed;
}
const QString &repo_path = tmp_dir + "/repo.iso";
if (!QFile::exists(repo_path)
&& !QFile::copy(QString(":/repo_%1.iso").arg(HOST_ARCH), repo_path)) {
dCError("copy file failed, new name: %s", qPrintable(repo_path));
goto failed;
}
bool ok = false;
const QString &repo_mount_point = mount_root + "/deepin-clone";
QFile file_boot_fix(mount_root + "/boot_fix.sh");
do {
if (!QDir(mount_root).exists("deepin-clone") && !QDir(mount_root).mkdir("deepin-clone")) {
dCError("Create \"deepin-clone\" dir failed(\"%s\")", qPrintable(mount_root));
break;
}
if (!Helper::mountDevice(repo_path, repo_mount_point, true)) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(repo_path);
break;
}
if (file_boot_fix.exists()) {
file_boot_fix.remove();
}
if (!QFile::copy(QString(":/scripts/boot_fix_%1.sh").arg(
#if defined(HOST_ARCH_x86_64) || defined(HOST_ARCH_i386) || defined(HOST_ARCH_i686)
"x86"
#elif defined(HOST_ARCH_mips64) || defined(HOST_ARCH_mips32)
"mips"
#elif defined(HOST_ARCH_sw_64)
"sw_64"
#elif defined(HOST_ARCH_aarch64)
"aarch64"
#else
#pragma message "Machine: " HOST_ARCH
"unknow"
#endif
), file_boot_fix.fileName())) {
dCError("copy file failed, new name: %s", qPrintable(file_boot_fix.fileName()));
break;
}
if (!file_boot_fix.setPermissions(file_boot_fix.permissions() | QFile::ExeUser)) {
dCError("Set \"%s\" permissions failed", qPrintable(file_boot_fix.fileName()));
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev %1/dev").arg(mount_root)) != 0) {
dCError("Failed to bind /dev");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev/pts %1/dev/pts").arg(mount_root)) != 0) {
dCError("Failed to bind /dev/pts");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /proc %1/proc").arg(mount_root)) != 0) {
dCError("Failed to bind /proc");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /sys %1/sys").arg(mount_root)) != 0) {
dCError("Failed to bind /sys");
break;
}
ok = true;
} while (0);
QProcess process;
if (ok) {
const QString &parent_device = Helper::parentDevice(partDevice);
bool is_efi = false;
if (!parent_device.isEmpty()) {
DDeviceDiskInfo info(parent_device);
dCDebug("Disk partition table type: %d", info.ptType());
if (info.ptType() == DDeviceDiskInfo::GPT) {
for (const DPartInfo &part : info.childrenPartList()) {
if (part.guidType() == DPartInfo::EFI_SP_None) {
const QString &efi_path = mount_root + "/boot/efi";
QDir::current().mkpath(efi_path);
if (Helper::processExec(QString("mount %1 %2").arg(part.filePath()).arg(efi_path)) != 0) {
dCError("Failed to mount EFI partition");
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(part.filePath());
ok = false;
break;
}
is_efi = true;
break;
}
}
if (!is_efi && m_lastErrorString.isEmpty()) {
m_lastErrorString = QObject::tr("EFI partition not found");
ok = false;
}
} else if (info.ptType() == DDeviceDiskInfo::Unknow) {
m_lastErrorString = QObject::tr("Unknown partition style");
ok = false;
}
}
if (ok) {
process.setProcessChannelMode(QProcess::MergedChannels);
process.start(QString("chroot %1 ./boot_fix.sh %2 %3 /deepin-clone")
.arg(mount_root)
.arg(parent_device)
.arg(is_efi ? "true" : "false"));
while (process.waitForReadyRead()) {
const QByteArray &data = process.readAll().simplified().constData();
dCDebug(data.constData());
}
process.waitForFinished(-1);
switch (process.exitCode()) {
case 1:
m_lastErrorString = QObject::tr("Boot for install system failed");
break;
case 2:
m_lastErrorString = QObject::tr("Boot for update system failed");
break;
default:
break;
}
}
}
// clear
Helper::processExec("umount " + repo_mount_point);
QDir(mount_root).rmdir("deepin-clone");
file_boot_fix.remove();
Helper::processExec("umount " + mount_root + "/dev/pts");
Helper::processExec("umount " + mount_root + "/dev");
Helper::processExec("umount " + mount_root + "/proc");
Helper::processExec("umount " + mount_root + "/sys");
Helper::processExec("umount " + mount_root + "/boot/efi");
if (ok && process.exitCode() == 0) {
if (part_old_uuid != part_info.uuid()) {
dCDebug("Reset the uuid from \"%s\" to \"%s\"", qPrintable(part_old_uuid), qPrintable(part_info.uuid()));
// update /etc/fstab
QFile file(mount_root + "/etc/fstab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/fstab, error: %s", qPrintable(file.errorString()));
}
file.setFileName(mount_root + "/etc/crypttab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/crypttab, error: %s", qPrintable(file.errorString()));
}
}
if (!device_is_mounted)
Helper::umountDevice(partDevice);
return true;
}
}
failed:
if (!device_is_mounted)
Helper::umountDevice(partDevice);
if (m_lastErrorString.isEmpty())
m_lastErrorString = QObject::tr("Boot for repair system failed");
dCDebug("Restore partition uuid");
if (!Helper::resetPartUUID(part_info, part_old_uuid.toLatin1())) {
dCWarning("Failed to restore partition uuid, part: %s, uuid: %s", qPrintable(partDevice), qPrintable(part_old_uuid));
}
return false;
} | 1375 | True | 1 |
||
CVE-2019-13229 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin_clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/partclone.log in the Helper::getPartitionSizeInfo() function to write a log file as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-08-14T11:25Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | BootDoctor::fix | BootDoctor::fix( const QString & partDevice) | ['partDevice'] | bool BootDoctor::fix(const QString &partDevice)
{
m_lastErrorString.clear();
DDevicePartInfo part_info(partDevice);
const QString part_old_uuid = part_info.uuid();
if (Helper::processExec("lsblk -s -d -n -o UUID") == 0) {
if (Helper::lastProcessStandardOutput().contains(part_old_uuid.toLatin1())) {
// reset uuid
if (Helper::resetPartUUID(part_info)) {
QThread::sleep(1);
part_info.refresh();
qDebug() << part_old_uuid << part_info.uuid();
} else {
dCWarning("Failed to reset uuid");
}
}
}
bool device_is_mounted = Helper::isMounted(partDevice);
const QString &mount_root = Helper::temporaryMountDevice(partDevice, QFileInfo(partDevice).fileName());
if (mount_root.isEmpty()) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(partDevice);
goto failed;
}
{
const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandardPaths::TempLocation);
const QString tmp_dir = (tmp_paths.isEmpty() ? "/tmp" : tmp_paths.first()) + "/.deepin-clone";
if (!QDir::current().mkpath(tmp_dir)) {
dCError("mkpath \"%s\" failed", qPrintable(tmp_dir));
goto failed;
}
const QString &repo_path = tmp_dir + "/repo.iso";
if (!QFile::exists(repo_path)
&& !QFile::copy(QString(":/repo_%1.iso").arg(HOST_ARCH), repo_path)) {
dCError("copy file failed, new name: %s", qPrintable(repo_path));
goto failed;
}
bool ok = false;
const QString &repo_mount_point = mount_root + "/deepin-clone";
QFile file_boot_fix(mount_root + "/boot_fix.sh");
do {
if (!QDir(mount_root).exists("deepin-clone") && !QDir(mount_root).mkdir("deepin-clone")) {
dCError("Create \"deepin-clone\" dir failed(\"%s\")", qPrintable(mount_root));
break;
}
if (!Helper::mountDevice(repo_path, repo_mount_point, true)) {
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(repo_path);
break;
}
if (file_boot_fix.exists()) {
file_boot_fix.remove();
}
if (!QFile::copy(QString(":/scripts/boot_fix_%1.sh").arg(
#if defined(HOST_ARCH_x86_64) || defined(HOST_ARCH_i386) || defined(HOST_ARCH_i686)
"x86"
#elif defined(HOST_ARCH_mips64) || defined(HOST_ARCH_mips32)
"mips"
#elif defined(HOST_ARCH_sw_64)
"sw_64"
#elif defined(HOST_ARCH_aarch64)
"aarch64"
#else
#pragma message "Machine: " HOST_ARCH
"unknow"
#endif
), file_boot_fix.fileName())) {
dCError("copy file failed, new name: %s", qPrintable(file_boot_fix.fileName()));
break;
}
if (!file_boot_fix.setPermissions(file_boot_fix.permissions() | QFile::ExeUser)) {
dCError("Set \"%s\" permissions failed", qPrintable(file_boot_fix.fileName()));
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev %1/dev").arg(mount_root)) != 0) {
dCError("Failed to bind /dev");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /dev/pts %1/dev/pts").arg(mount_root)) != 0) {
dCError("Failed to bind /dev/pts");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /proc %1/proc").arg(mount_root)) != 0) {
dCError("Failed to bind /proc");
break;
}
if (Helper::processExec(QString("mount --bind -v --bind /sys %1/sys").arg(mount_root)) != 0) {
dCError("Failed to bind /sys");
break;
}
ok = true;
} while (0);
QProcess process;
if (ok) {
const QString &parent_device = Helper::parentDevice(partDevice);
bool is_efi = false;
if (!parent_device.isEmpty()) {
DDeviceDiskInfo info(parent_device);
dCDebug("Disk partition table type: %d", info.ptType());
if (info.ptType() == DDeviceDiskInfo::GPT) {
for (const DPartInfo &part : info.childrenPartList()) {
if (part.guidType() == DPartInfo::EFI_SP_None) {
const QString &efi_path = mount_root + "/boot/efi";
QDir::current().mkpath(efi_path);
if (Helper::processExec(QString("mount %1 %2").arg(part.filePath()).arg(efi_path)) != 0) {
dCError("Failed to mount EFI partition");
m_lastErrorString = QObject::tr("Failed to mount partition \"%1\"").arg(part.filePath());
ok = false;
break;
}
is_efi = true;
break;
}
}
if (!is_efi && m_lastErrorString.isEmpty()) {
m_lastErrorString = QObject::tr("EFI partition not found");
ok = false;
}
} else if (info.ptType() == DDeviceDiskInfo::Unknow) {
m_lastErrorString = QObject::tr("Unknown partition style");
ok = false;
}
}
if (ok) {
process.setProcessChannelMode(QProcess::MergedChannels);
process.start(QString("chroot %1 ./boot_fix.sh %2 %3 /deepin-clone")
.arg(mount_root)
.arg(parent_device)
.arg(is_efi ? "true" : "false"));
while (process.waitForReadyRead()) {
const QByteArray &data = process.readAll().simplified().constData();
dCDebug(data.constData());
}
process.waitForFinished(-1);
switch (process.exitCode()) {
case 1:
m_lastErrorString = QObject::tr("Boot for install system failed");
break;
case 2:
m_lastErrorString = QObject::tr("Boot for update system failed");
break;
default:
break;
}
}
}
// clear
Helper::processExec("umount " + repo_mount_point);
QDir(mount_root).rmdir("deepin-clone");
file_boot_fix.remove();
Helper::processExec("umount " + mount_root + "/dev/pts");
Helper::processExec("umount " + mount_root + "/dev");
Helper::processExec("umount " + mount_root + "/proc");
Helper::processExec("umount " + mount_root + "/sys");
Helper::processExec("umount " + mount_root + "/boot/efi");
if (ok && process.exitCode() == 0) {
if (part_old_uuid != part_info.uuid()) {
dCDebug("Reset the uuid from \"%s\" to \"%s\"", qPrintable(part_old_uuid), qPrintable(part_info.uuid()));
// update /etc/fstab
QFile file(mount_root + "/etc/fstab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/fstab, error: %s", qPrintable(file.errorString()));
}
file.setFileName(mount_root + "/etc/crypttab");
if (file.exists() && file.open(QIODevice::ReadWrite)) {
QByteArray data = file.readAll();
if (file.seek(0)) {
file.write(data.replace(part_old_uuid.toLatin1(), part_info.uuid().toLatin1()));
}
file.close();
} else {
dCWarning("Failed to update /etc/crypttab, error: %s", qPrintable(file.errorString()));
}
}
if (!device_is_mounted)
Helper::umountDevice(partDevice);
return true;
}
}
failed:
if (!device_is_mounted)
Helper::umountDevice(partDevice);
if (m_lastErrorString.isEmpty())
m_lastErrorString = QObject::tr("Boot for repair system failed");
dCDebug("Restore partition uuid");
if (!Helper::resetPartUUID(part_info, part_old_uuid.toLatin1())) {
dCWarning("Failed to restore partition uuid, part: %s, uuid: %s", qPrintable(partDevice), qPrintable(part_old_uuid));
}
return false;
} | 1375 | True | 1 |
||
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12: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 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
QCoreApplication *a;
if (isTUIMode(argc, argv)) {
Global::isTUIMode = true;
a = new QCoreApplication(argc, argv);
}
#ifdef ENABLE_GUI
else {
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender("/tmp/.deepin-clone.log");
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerAppender(consoleAppender);
logger->registerAppender(rollingFileAppender);
if (qEnvironmentVariableIsSet("PKEXEC_UID")) {
const quint32 pkexec_uid = qgetenv("PKEXEC_UID").toUInt();
const QDir user_home(getpwuid(pkexec_uid)->pw_dir);
QFile pam_file(user_home.absoluteFilePath(".pam_environment"));
if (pam_file.open(QIODevice::ReadOnly)) {
while (!pam_file.atEnd()) {
const QByteArray &line = pam_file.readLine().simplified();
if (line.startsWith("QT_SCALE_FACTOR")) {
const QByteArrayList &list = line.split('=');
if (list.count() == 2) {
qputenv("QT_SCALE_FACTOR", list.last());
break;
}
}
}
pam_file.close();
}
}
DApplication::loadDXcbPlugin();
DApplication *app = new DApplication(argc, argv);
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
if (!qApp->setSingleInstance("_deepin_clone_")) {
qCritical() << "As well as the process is running";
return -1;
}
if (!app->loadTranslator()) {
dError("Load translator failed");
}
app->setApplicationDisplayName(QObject::tr("Deepin Clone"));
app->setApplicationDescription(QObject::tr("Deepin Clone is a backup and restore tool in deepin. "
"It supports disk or partition clone, backup and restore, and other functions."));
app->setApplicationAcknowledgementPage("https://www.deepin.org/acknowledgments/deepin-clone/");
app->setTheme("light");
a = app;
}
#endif
a->setApplicationName("deepin-clone");
#ifdef ENABLE_GUI
a->setApplicationVersion(DApplication::buildVersion("1.0.0.1"));
#else
a->setApplicationVersion("1.0.0.1");
#endif
a->setOrganizationName("deepin");
CommandLineParser parser;
QFile arguments_file("/lib/live/mount/medium/.tmp/deepin-clone.arguments");
QStringList arguments;
bool load_arg_from_file = arguments_file.exists() && !Global::isTUIMode && !a->arguments().contains("--tui");
if (load_arg_from_file) {
arguments.append(a->arguments().first());
if (!arguments_file.open(QIODevice::ReadOnly)) {
qCritical() << "Open \"/lib/live/mount/medium/.tmp/deepin-clone.arguments\" failed, error:" << arguments_file.errorString();
} else {
while (!arguments_file.atEnd()) {
const QString &arg = QString::fromUtf8(arguments_file.readLine().trimmed());
if (!arg.isEmpty())
arguments.append(arg);
}
arguments_file.close();
arguments_file.remove();
}
qDebug() << arguments;
} else {
arguments = a->arguments();
}
parser.process(arguments);
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender(parser.logFile());
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerCategoryAppender("deepin.ghost", consoleAppender);
logger->registerCategoryAppender("deepin.ghost", rollingFileAppender);
parser.parse();
if (load_arg_from_file) {
dCDebug("Load arguments from \"%s\"", qPrintable(arguments_file.fileName()));
}
dCInfo("Application command line: %s", qPrintable(arguments.join(' ')));
if (Global::debugLevel == 0) {
QLoggingCategory::setFilterRules("deepin.ghost.debug=false");
}
if (Global::isTUIMode) {
if (!parser.target().isEmpty()) {
CloneJob *job = new CloneJob;
QObject::connect(job, &QThread::finished, a, &QCoreApplication::quit);
job->start(parser.source(), parser.target());
}
}
#ifdef ENABLE_GUI
else {
if (!parser.isSetOverride())
Global::isOverride = true;
if (!parser.isSetDebug())
Global::debugLevel = 2;
MainWindow *window = new MainWindow;
window->setFixedSize(860, 660);
window->setStyleSheet(DThemeManager::instance()->getQssForWidget("main", window));
window->setWindowIcon(QIcon::fromTheme("deepin-clone"));
window->setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);
window->titlebar()->setIcon(window->windowIcon());
window->titlebar()->setTitle(QString());
#if DTK_VERSION > DTK_VERSION_CHECK(2, 0, 6, 0)
window->titlebar()->setBackgroundTransparent(true);
#endif
window->show();
qApp->setProductIcon(window->windowIcon());
if (!parser.source().isEmpty()) {
window->startWithFile(parser.source(), parser.target());
}
QObject::connect(a, &QCoreApplication::aboutToQuit, window, &MainWindow::deleteLater);
QDesktopServices::setUrlHandler("https", window, "openUrl");
}
#endif
int exitCode = Global::isTUIMode ? a->exec() : qApp->exec();
QString log_backup_file = parser.logBackupFile();
if (log_backup_file.startsWith("serial://")) {
log_backup_file = Helper::parseSerialUrl(log_backup_file);
}
if (log_backup_file.isEmpty()) {
return exitCode;
}
if (!QFile::copy(parser.logFile(), log_backup_file)) {
dCWarning("failed to copy log file to \"%s\"", qPrintable(log_backup_file));
}
return exitCode;
} | 1061 | True | 1 |
|
CVE-2019-13226 | False | False | False | False | AV:L/AC:M/Au:N/C:C/I:C/A:C | LOCAL | MEDIUM | NONE | COMPLETE | COMPLETE | COMPLETE | 6.9 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | HIGH | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.0 | HIGH | 1.0 | 5.9 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-362'}, {'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a predictable path /tmp/.deepin-clone/mount/<block-dev-basename> in the Helper::temporaryMountDevice() function to temporarily mount a file system as root. An unprivileged user can prepare a symlink at this location to have the file system mounted in an arbitrary location. By winning a race condition, the attacker can also enter the mount point, thereby preventing a subsequent unmount of the file system.'}] | 2022-04-18T16:56Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
QCoreApplication *a;
if (isTUIMode(argc, argv)) {
Global::isTUIMode = true;
a = new QCoreApplication(argc, argv);
}
#ifdef ENABLE_GUI
else {
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender("/tmp/.deepin-clone.log");
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerAppender(consoleAppender);
logger->registerAppender(rollingFileAppender);
if (qEnvironmentVariableIsSet("PKEXEC_UID")) {
const quint32 pkexec_uid = qgetenv("PKEXEC_UID").toUInt();
const QDir user_home(getpwuid(pkexec_uid)->pw_dir);
QFile pam_file(user_home.absoluteFilePath(".pam_environment"));
if (pam_file.open(QIODevice::ReadOnly)) {
while (!pam_file.atEnd()) {
const QByteArray &line = pam_file.readLine().simplified();
if (line.startsWith("QT_SCALE_FACTOR")) {
const QByteArrayList &list = line.split('=');
if (list.count() == 2) {
qputenv("QT_SCALE_FACTOR", list.last());
break;
}
}
}
pam_file.close();
}
}
DApplication::loadDXcbPlugin();
DApplication *app = new DApplication(argc, argv);
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
if (!qApp->setSingleInstance("_deepin_clone_")) {
qCritical() << "As well as the process is running";
return -1;
}
if (!app->loadTranslator()) {
dError("Load translator failed");
}
app->setApplicationDisplayName(QObject::tr("Deepin Clone"));
app->setApplicationDescription(QObject::tr("Deepin Clone is a backup and restore tool in deepin. "
"It supports disk or partition clone, backup and restore, and other functions."));
app->setApplicationAcknowledgementPage("https://www.deepin.org/acknowledgments/deepin-clone/");
app->setTheme("light");
a = app;
}
#endif
a->setApplicationName("deepin-clone");
#ifdef ENABLE_GUI
a->setApplicationVersion(DApplication::buildVersion("1.0.0.1"));
#else
a->setApplicationVersion("1.0.0.1");
#endif
a->setOrganizationName("deepin");
CommandLineParser parser;
QFile arguments_file("/lib/live/mount/medium/.tmp/deepin-clone.arguments");
QStringList arguments;
bool load_arg_from_file = arguments_file.exists() && !Global::isTUIMode && !a->arguments().contains("--tui");
if (load_arg_from_file) {
arguments.append(a->arguments().first());
if (!arguments_file.open(QIODevice::ReadOnly)) {
qCritical() << "Open \"/lib/live/mount/medium/.tmp/deepin-clone.arguments\" failed, error:" << arguments_file.errorString();
} else {
while (!arguments_file.atEnd()) {
const QString &arg = QString::fromUtf8(arguments_file.readLine().trimmed());
if (!arg.isEmpty())
arguments.append(arg);
}
arguments_file.close();
arguments_file.remove();
}
qDebug() << arguments;
} else {
arguments = a->arguments();
}
parser.process(arguments);
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender(parser.logFile());
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerCategoryAppender("deepin.ghost", consoleAppender);
logger->registerCategoryAppender("deepin.ghost", rollingFileAppender);
parser.parse();
if (load_arg_from_file) {
dCDebug("Load arguments from \"%s\"", qPrintable(arguments_file.fileName()));
}
dCInfo("Application command line: %s", qPrintable(arguments.join(' ')));
if (Global::debugLevel == 0) {
QLoggingCategory::setFilterRules("deepin.ghost.debug=false");
}
if (Global::isTUIMode) {
if (!parser.target().isEmpty()) {
CloneJob *job = new CloneJob;
QObject::connect(job, &QThread::finished, a, &QCoreApplication::quit);
job->start(parser.source(), parser.target());
}
}
#ifdef ENABLE_GUI
else {
if (!parser.isSetOverride())
Global::isOverride = true;
if (!parser.isSetDebug())
Global::debugLevel = 2;
MainWindow *window = new MainWindow;
window->setFixedSize(860, 660);
window->setStyleSheet(DThemeManager::instance()->getQssForWidget("main", window));
window->setWindowIcon(QIcon::fromTheme("deepin-clone"));
window->setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);
window->titlebar()->setIcon(window->windowIcon());
window->titlebar()->setTitle(QString());
#if DTK_VERSION > DTK_VERSION_CHECK(2, 0, 6, 0)
window->titlebar()->setBackgroundTransparent(true);
#endif
window->show();
qApp->setProductIcon(window->windowIcon());
if (!parser.source().isEmpty()) {
window->startWithFile(parser.source(), parser.target());
}
QObject::connect(a, &QCoreApplication::aboutToQuit, window, &MainWindow::deleteLater);
QDesktopServices::setUrlHandler("https", window, "openUrl");
}
#endif
int exitCode = Global::isTUIMode ? a->exec() : qApp->exec();
QString log_backup_file = parser.logBackupFile();
if (log_backup_file.startsWith("serial://")) {
log_backup_file = Helper::parseSerialUrl(log_backup_file);
}
if (log_backup_file.isEmpty()) {
return exitCode;
}
if (!QFile::copy(parser.logFile(), log_backup_file)) {
dCWarning("failed to copy log file to \"%s\"", qPrintable(log_backup_file));
}
return exitCode;
} | 1061 | True | 1 |
||
CVE-2019-13227 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In GUI mode, deepin-clone before 1.1.3 creates a log file at the fixed path /tmp/.deepin-clone.log as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
QCoreApplication *a;
if (isTUIMode(argc, argv)) {
Global::isTUIMode = true;
a = new QCoreApplication(argc, argv);
}
#ifdef ENABLE_GUI
else {
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender("/tmp/.deepin-clone.log");
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerAppender(consoleAppender);
logger->registerAppender(rollingFileAppender);
if (qEnvironmentVariableIsSet("PKEXEC_UID")) {
const quint32 pkexec_uid = qgetenv("PKEXEC_UID").toUInt();
const QDir user_home(getpwuid(pkexec_uid)->pw_dir);
QFile pam_file(user_home.absoluteFilePath(".pam_environment"));
if (pam_file.open(QIODevice::ReadOnly)) {
while (!pam_file.atEnd()) {
const QByteArray &line = pam_file.readLine().simplified();
if (line.startsWith("QT_SCALE_FACTOR")) {
const QByteArrayList &list = line.split('=');
if (list.count() == 2) {
qputenv("QT_SCALE_FACTOR", list.last());
break;
}
}
}
pam_file.close();
}
}
DApplication::loadDXcbPlugin();
DApplication *app = new DApplication(argc, argv);
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
if (!qApp->setSingleInstance("_deepin_clone_")) {
qCritical() << "As well as the process is running";
return -1;
}
if (!app->loadTranslator()) {
dError("Load translator failed");
}
app->setApplicationDisplayName(QObject::tr("Deepin Clone"));
app->setApplicationDescription(QObject::tr("Deepin Clone is a backup and restore tool in deepin. "
"It supports disk or partition clone, backup and restore, and other functions."));
app->setApplicationAcknowledgementPage("https://www.deepin.org/acknowledgments/deepin-clone/");
app->setTheme("light");
a = app;
}
#endif
a->setApplicationName("deepin-clone");
#ifdef ENABLE_GUI
a->setApplicationVersion(DApplication::buildVersion("1.0.0.1"));
#else
a->setApplicationVersion("1.0.0.1");
#endif
a->setOrganizationName("deepin");
CommandLineParser parser;
QFile arguments_file("/lib/live/mount/medium/.tmp/deepin-clone.arguments");
QStringList arguments;
bool load_arg_from_file = arguments_file.exists() && !Global::isTUIMode && !a->arguments().contains("--tui");
if (load_arg_from_file) {
arguments.append(a->arguments().first());
if (!arguments_file.open(QIODevice::ReadOnly)) {
qCritical() << "Open \"/lib/live/mount/medium/.tmp/deepin-clone.arguments\" failed, error:" << arguments_file.errorString();
} else {
while (!arguments_file.atEnd()) {
const QString &arg = QString::fromUtf8(arguments_file.readLine().trimmed());
if (!arg.isEmpty())
arguments.append(arg);
}
arguments_file.close();
arguments_file.remove();
}
qDebug() << arguments;
} else {
arguments = a->arguments();
}
parser.process(arguments);
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender(parser.logFile());
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerCategoryAppender("deepin.ghost", consoleAppender);
logger->registerCategoryAppender("deepin.ghost", rollingFileAppender);
parser.parse();
if (load_arg_from_file) {
dCDebug("Load arguments from \"%s\"", qPrintable(arguments_file.fileName()));
}
dCInfo("Application command line: %s", qPrintable(arguments.join(' ')));
if (Global::debugLevel == 0) {
QLoggingCategory::setFilterRules("deepin.ghost.debug=false");
}
if (Global::isTUIMode) {
if (!parser.target().isEmpty()) {
CloneJob *job = new CloneJob;
QObject::connect(job, &QThread::finished, a, &QCoreApplication::quit);
job->start(parser.source(), parser.target());
}
}
#ifdef ENABLE_GUI
else {
if (!parser.isSetOverride())
Global::isOverride = true;
if (!parser.isSetDebug())
Global::debugLevel = 2;
MainWindow *window = new MainWindow;
window->setFixedSize(860, 660);
window->setStyleSheet(DThemeManager::instance()->getQssForWidget("main", window));
window->setWindowIcon(QIcon::fromTheme("deepin-clone"));
window->setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);
window->titlebar()->setIcon(window->windowIcon());
window->titlebar()->setTitle(QString());
#if DTK_VERSION > DTK_VERSION_CHECK(2, 0, 6, 0)
window->titlebar()->setBackgroundTransparent(true);
#endif
window->show();
qApp->setProductIcon(window->windowIcon());
if (!parser.source().isEmpty()) {
window->startWithFile(parser.source(), parser.target());
}
QObject::connect(a, &QCoreApplication::aboutToQuit, window, &MainWindow::deleteLater);
QDesktopServices::setUrlHandler("https", window, "openUrl");
}
#endif
int exitCode = Global::isTUIMode ? a->exec() : qApp->exec();
QString log_backup_file = parser.logBackupFile();
if (log_backup_file.startsWith("serial://")) {
log_backup_file = Helper::parseSerialUrl(log_backup_file);
}
if (log_backup_file.isEmpty()) {
return exitCode;
}
if (!QFile::copy(parser.logFile(), log_backup_file)) {
dCWarning("failed to copy log file to \"%s\"", qPrintable(log_backup_file));
}
return exitCode;
} | 1061 | True | 1 |
||
CVE-2019-13228 | False | False | False | False | AV:L/AC:M/Au:N/C:P/I:C/A:C | LOCAL | MEDIUM | NONE | PARTIAL | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | HIGH | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 4.7 | MEDIUM | 1.0 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin-clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/repo.iso in the BootDoctor::fix() function to download an ISO file, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled. By winning a race condition to replace the /tmp/repo.iso symlink by an attacker controlled ISO file, further privilege escalation may be possible.'}] | 2019-07-28T03:15Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
QCoreApplication *a;
if (isTUIMode(argc, argv)) {
Global::isTUIMode = true;
a = new QCoreApplication(argc, argv);
}
#ifdef ENABLE_GUI
else {
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender("/tmp/.deepin-clone.log");
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerAppender(consoleAppender);
logger->registerAppender(rollingFileAppender);
if (qEnvironmentVariableIsSet("PKEXEC_UID")) {
const quint32 pkexec_uid = qgetenv("PKEXEC_UID").toUInt();
const QDir user_home(getpwuid(pkexec_uid)->pw_dir);
QFile pam_file(user_home.absoluteFilePath(".pam_environment"));
if (pam_file.open(QIODevice::ReadOnly)) {
while (!pam_file.atEnd()) {
const QByteArray &line = pam_file.readLine().simplified();
if (line.startsWith("QT_SCALE_FACTOR")) {
const QByteArrayList &list = line.split('=');
if (list.count() == 2) {
qputenv("QT_SCALE_FACTOR", list.last());
break;
}
}
}
pam_file.close();
}
}
DApplication::loadDXcbPlugin();
DApplication *app = new DApplication(argc, argv);
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
if (!qApp->setSingleInstance("_deepin_clone_")) {
qCritical() << "As well as the process is running";
return -1;
}
if (!app->loadTranslator()) {
dError("Load translator failed");
}
app->setApplicationDisplayName(QObject::tr("Deepin Clone"));
app->setApplicationDescription(QObject::tr("Deepin Clone is a backup and restore tool in deepin. "
"It supports disk or partition clone, backup and restore, and other functions."));
app->setApplicationAcknowledgementPage("https://www.deepin.org/acknowledgments/deepin-clone/");
app->setTheme("light");
a = app;
}
#endif
a->setApplicationName("deepin-clone");
#ifdef ENABLE_GUI
a->setApplicationVersion(DApplication::buildVersion("1.0.0.1"));
#else
a->setApplicationVersion("1.0.0.1");
#endif
a->setOrganizationName("deepin");
CommandLineParser parser;
QFile arguments_file("/lib/live/mount/medium/.tmp/deepin-clone.arguments");
QStringList arguments;
bool load_arg_from_file = arguments_file.exists() && !Global::isTUIMode && !a->arguments().contains("--tui");
if (load_arg_from_file) {
arguments.append(a->arguments().first());
if (!arguments_file.open(QIODevice::ReadOnly)) {
qCritical() << "Open \"/lib/live/mount/medium/.tmp/deepin-clone.arguments\" failed, error:" << arguments_file.errorString();
} else {
while (!arguments_file.atEnd()) {
const QString &arg = QString::fromUtf8(arguments_file.readLine().trimmed());
if (!arg.isEmpty())
arguments.append(arg);
}
arguments_file.close();
arguments_file.remove();
}
qDebug() << arguments;
} else {
arguments = a->arguments();
}
parser.process(arguments);
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender(parser.logFile());
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerCategoryAppender("deepin.ghost", consoleAppender);
logger->registerCategoryAppender("deepin.ghost", rollingFileAppender);
parser.parse();
if (load_arg_from_file) {
dCDebug("Load arguments from \"%s\"", qPrintable(arguments_file.fileName()));
}
dCInfo("Application command line: %s", qPrintable(arguments.join(' ')));
if (Global::debugLevel == 0) {
QLoggingCategory::setFilterRules("deepin.ghost.debug=false");
}
if (Global::isTUIMode) {
if (!parser.target().isEmpty()) {
CloneJob *job = new CloneJob;
QObject::connect(job, &QThread::finished, a, &QCoreApplication::quit);
job->start(parser.source(), parser.target());
}
}
#ifdef ENABLE_GUI
else {
if (!parser.isSetOverride())
Global::isOverride = true;
if (!parser.isSetDebug())
Global::debugLevel = 2;
MainWindow *window = new MainWindow;
window->setFixedSize(860, 660);
window->setStyleSheet(DThemeManager::instance()->getQssForWidget("main", window));
window->setWindowIcon(QIcon::fromTheme("deepin-clone"));
window->setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);
window->titlebar()->setIcon(window->windowIcon());
window->titlebar()->setTitle(QString());
#if DTK_VERSION > DTK_VERSION_CHECK(2, 0, 6, 0)
window->titlebar()->setBackgroundTransparent(true);
#endif
window->show();
qApp->setProductIcon(window->windowIcon());
if (!parser.source().isEmpty()) {
window->startWithFile(parser.source(), parser.target());
}
QObject::connect(a, &QCoreApplication::aboutToQuit, window, &MainWindow::deleteLater);
QDesktopServices::setUrlHandler("https", window, "openUrl");
}
#endif
int exitCode = Global::isTUIMode ? a->exec() : qApp->exec();
QString log_backup_file = parser.logBackupFile();
if (log_backup_file.startsWith("serial://")) {
log_backup_file = Helper::parseSerialUrl(log_backup_file);
}
if (log_backup_file.isEmpty()) {
return exitCode;
}
if (!QFile::copy(parser.logFile(), log_backup_file)) {
dCWarning("failed to copy log file to \"%s\"", qPrintable(log_backup_file));
}
return exitCode;
} | 1061 | True | 1 |
||
CVE-2019-13229 | False | False | False | False | AV:L/AC:L/Au:N/C:N/I:C/A:C | LOCAL | LOW | NONE | NONE | COMPLETE | COMPLETE | 6.6 | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | LOCAL | LOW | LOW | NONE | UNCHANGED | NONE | HIGH | NONE | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'name': 'https://github.com/linuxdeepin/deepin-clone/commit/e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1130388', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/07/04/1', 'name': '[oss-security] 20190704 deepin-clone: various symlink attacks', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/TCHGRJV5CWTMYEE5B5C2FNMCFVP45S7H/', 'name': 'FEDORA-2019-3d418f349c', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-59'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:deepin:deepin_clone:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'deepin-clone before 1.1.3 uses a fixed path /tmp/partclone.log in the Helper::getPartitionSizeInfo() function to write a log file as root, and follows symlinks there. An unprivileged user can prepare a symlink attack there to create or overwrite files in arbitrary file system locations. The content is not attacker controlled.'}] | 2019-08-14T11:25Z | 2019-07-04T12:15Z | Improper Link Resolution Before File Access ('Link Following') | The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. | https://cwe.mitre.org/data/definitions/59.html | 0 | zccrs | 2019-05-31 15:38:16+08:00 | fix: Do not use the "/tmp" directory
https://github.com/linuxdeepin/deepin-clone/issues/16
https://bugzilla.opensuse.org/show_bug.cgi?id=1130388 | e079f3e2712b4f8c28e3e63e71ba1a1f90fce1ab | False | linuxdeepin/deepin-clone | Disk and partition backup/restore tool. | 2017-08-21 09:24:59 | 2022-08-18 01:43:57 | linuxdeepin | 58.0 | 22.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
QCoreApplication *a;
if (isTUIMode(argc, argv)) {
Global::isTUIMode = true;
a = new QCoreApplication(argc, argv);
}
#ifdef ENABLE_GUI
else {
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender("/tmp/.deepin-clone.log");
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerAppender(consoleAppender);
logger->registerAppender(rollingFileAppender);
if (qEnvironmentVariableIsSet("PKEXEC_UID")) {
const quint32 pkexec_uid = qgetenv("PKEXEC_UID").toUInt();
const QDir user_home(getpwuid(pkexec_uid)->pw_dir);
QFile pam_file(user_home.absoluteFilePath(".pam_environment"));
if (pam_file.open(QIODevice::ReadOnly)) {
while (!pam_file.atEnd()) {
const QByteArray &line = pam_file.readLine().simplified();
if (line.startsWith("QT_SCALE_FACTOR")) {
const QByteArrayList &list = line.split('=');
if (list.count() == 2) {
qputenv("QT_SCALE_FACTOR", list.last());
break;
}
}
}
pam_file.close();
}
}
DApplication::loadDXcbPlugin();
DApplication *app = new DApplication(argc, argv);
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
if (!qApp->setSingleInstance("_deepin_clone_")) {
qCritical() << "As well as the process is running";
return -1;
}
if (!app->loadTranslator()) {
dError("Load translator failed");
}
app->setApplicationDisplayName(QObject::tr("Deepin Clone"));
app->setApplicationDescription(QObject::tr("Deepin Clone is a backup and restore tool in deepin. "
"It supports disk or partition clone, backup and restore, and other functions."));
app->setApplicationAcknowledgementPage("https://www.deepin.org/acknowledgments/deepin-clone/");
app->setTheme("light");
a = app;
}
#endif
a->setApplicationName("deepin-clone");
#ifdef ENABLE_GUI
a->setApplicationVersion(DApplication::buildVersion("1.0.0.1"));
#else
a->setApplicationVersion("1.0.0.1");
#endif
a->setOrganizationName("deepin");
CommandLineParser parser;
QFile arguments_file("/lib/live/mount/medium/.tmp/deepin-clone.arguments");
QStringList arguments;
bool load_arg_from_file = arguments_file.exists() && !Global::isTUIMode && !a->arguments().contains("--tui");
if (load_arg_from_file) {
arguments.append(a->arguments().first());
if (!arguments_file.open(QIODevice::ReadOnly)) {
qCritical() << "Open \"/lib/live/mount/medium/.tmp/deepin-clone.arguments\" failed, error:" << arguments_file.errorString();
} else {
while (!arguments_file.atEnd()) {
const QString &arg = QString::fromUtf8(arguments_file.readLine().trimmed());
if (!arg.isEmpty())
arguments.append(arg);
}
arguments_file.close();
arguments_file.remove();
}
qDebug() << arguments;
} else {
arguments = a->arguments();
}
parser.process(arguments);
ConsoleAppender *consoleAppender = new ConsoleAppender;
consoleAppender->setFormat(logFormat);
RollingFileAppender *rollingFileAppender = new RollingFileAppender(parser.logFile());
rollingFileAppender->setFormat(logFormat);
rollingFileAppender->setLogFilesLimit(5);
rollingFileAppender->setDatePattern(RollingFileAppender::DailyRollover);
logger->registerCategoryAppender("deepin.ghost", consoleAppender);
logger->registerCategoryAppender("deepin.ghost", rollingFileAppender);
parser.parse();
if (load_arg_from_file) {
dCDebug("Load arguments from \"%s\"", qPrintable(arguments_file.fileName()));
}
dCInfo("Application command line: %s", qPrintable(arguments.join(' ')));
if (Global::debugLevel == 0) {
QLoggingCategory::setFilterRules("deepin.ghost.debug=false");
}
if (Global::isTUIMode) {
if (!parser.target().isEmpty()) {
CloneJob *job = new CloneJob;
QObject::connect(job, &QThread::finished, a, &QCoreApplication::quit);
job->start(parser.source(), parser.target());
}
}
#ifdef ENABLE_GUI
else {
if (!parser.isSetOverride())
Global::isOverride = true;
if (!parser.isSetDebug())
Global::debugLevel = 2;
MainWindow *window = new MainWindow;
window->setFixedSize(860, 660);
window->setStyleSheet(DThemeManager::instance()->getQssForWidget("main", window));
window->setWindowIcon(QIcon::fromTheme("deepin-clone"));
window->setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);
window->titlebar()->setIcon(window->windowIcon());
window->titlebar()->setTitle(QString());
#if DTK_VERSION > DTK_VERSION_CHECK(2, 0, 6, 0)
window->titlebar()->setBackgroundTransparent(true);
#endif
window->show();
qApp->setProductIcon(window->windowIcon());
if (!parser.source().isEmpty()) {
window->startWithFile(parser.source(), parser.target());
}
QObject::connect(a, &QCoreApplication::aboutToQuit, window, &MainWindow::deleteLater);
QDesktopServices::setUrlHandler("https", window, "openUrl");
}
#endif
int exitCode = Global::isTUIMode ? a->exec() : qApp->exec();
QString log_backup_file = parser.logBackupFile();
if (log_backup_file.startsWith("serial://")) {
log_backup_file = Helper::parseSerialUrl(log_backup_file);
}
if (log_backup_file.isEmpty()) {
return exitCode;
}
if (!QFile::copy(parser.logFile(), log_backup_file)) {
dCWarning("failed to copy log file to \"%s\"", qPrintable(log_backup_file));
}
return exitCode;
} | 1061 | True | 1 |
||
CVE-2019-13456 | False | False | False | False | AV:A/AC:M/Au:N/C:P/I:N/A:N | ADJACENT_NETWORK | MEDIUM | NONE | PARTIAL | NONE | NONE | 2.9 | CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | ADJACENT_NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1737663', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1737663', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://wpa3.mathyvanhoef.com', 'name': 'https://wpa3.mathyvanhoef.com', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://freeradius.org/security/', 'name': 'https://freeradius.org/security/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/FreeRADIUS/freeradius-server/commit/3ea2a5a026e73d81cd9a3e9bbd4300c433004bfa', 'name': 'https://github.com/FreeRADIUS/freeradius-server/commit/3ea2a5a026e73d81cd9a3e9bbd4300c433004bfa', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00039.html', 'name': 'openSUSE-SU-2020:0553', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-203'}]}] | LOW | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0.0', 'versionEndIncluding': '3.0.19', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'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:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In FreeRADIUS 3.0 through 3.0.19, on average 1 in every 2048 EAP-pwd handshakes fails because the password element cannot be found within 10 iterations of the hunting and pecking loop. This leaks information that an attacker can use to recover the password of any user. This information leakage is similar to the "Dragonblood" attack and CVE-2019-9494.'}] | 2022-01-01T20:06Z | 2019-12-03T20:15Z | Observable Discrepancy | The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor, which exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not. | Discrepancies can take many forms, and variations may be detectable in timing, control flow, communications such as replies or requests, or general behavior. These discrepancies can reveal information about the product's operation or internal state to an unauthorized actor. In some cases, discrepancies can be used by attackers to form a side channel.
| https://cwe.mitre.org/data/definitions/203.html | 0 | Mathy Vanhoef | 2019-06-05 19:21:06+00:00 | EAP-pwd: fix side-channel leak where 1 in 2018 handshakes fail
Previously the Hunting and Pecking algorithm of EAP-pwd aborted when
more than 10 iterations are needed. Every iteration has a 50% chance
of finding the password element. This means one in every 2048 handshakes
will fail, in which case an error frame is sent to the client. This
event leaks information that can be abused in an offline password
brute-force attack. More precisely, the adversary learns that all 10
iterations failed for the given random EAP-pwd token. Using the same
techniques as in the Dragonblood attack, this can be used to brute-force
the password.
This patch fixes the above issue by executing enough iterations such that
the password element is always found eventually.
Note that timing and cache leaks remain a risk against the current
implementation of EAP-pwd. | 3ea2a5a026e73d81cd9a3e9bbd4300c433004bfa | False | FreeRADIUS/freeradius-server | FreeRADIUS - A multi-protocol policy server. | 2008-07-20 18:04:09 | 2022-08-26 17:40:35 | http://freeradius.org | FreeRADIUS | 1693.0 | 963.0 | compute_password_element | compute_password_element( pwd_session_t * session , uint16_t grp_num , char const * password , int password_len , char const * id_server , int id_server_len , char const * id_peer , int id_peer_len , uint32_t * token) | ['session', 'grp_num', 'password', 'password_len', 'id_server', 'id_server_len', 'id_peer', 'id_peer_len', 'token'] | int compute_password_element (pwd_session_t *session, uint16_t grp_num,
char const *password, int password_len,
char const *id_server, int id_server_len,
char const *id_peer, int id_peer_len,
uint32_t *token)
{
BIGNUM *x_candidate = NULL, *rnd = NULL, *cofactor = NULL;
HMAC_CTX *ctx = NULL;
uint8_t pwe_digest[SHA256_DIGEST_LENGTH], *prfbuf = NULL, ctr;
int nid, is_odd, primebitlen, primebytelen, ret = 0;
ctx = HMAC_CTX_new();
if (ctx == NULL) {
DEBUG("failed allocating HMAC context");
goto fail;
}
switch (grp_num) { /* from IANA registry for IKE D-H groups */
case 19:
nid = NID_X9_62_prime256v1;
break;
case 20:
nid = NID_secp384r1;
break;
case 21:
nid = NID_secp521r1;
break;
case 25:
nid = NID_X9_62_prime192v1;
break;
case 26:
nid = NID_secp224r1;
break;
default:
DEBUG("unknown group %d", grp_num);
goto fail;
}
session->pwe = NULL;
session->order = NULL;
session->prime = NULL;
if ((session->group = EC_GROUP_new_by_curve_name(nid)) == NULL) {
DEBUG("unable to create EC_GROUP");
goto fail;
}
if (((rnd = BN_new()) == NULL) ||
((cofactor = BN_new()) == NULL) ||
((session->pwe = EC_POINT_new(session->group)) == NULL) ||
((session->order = BN_new()) == NULL) ||
((session->prime = BN_new()) == NULL) ||
((x_candidate = BN_new()) == NULL)) {
DEBUG("unable to create bignums");
goto fail;
}
if (!EC_GROUP_get_curve_GFp(session->group, session->prime, NULL, NULL, NULL)) {
DEBUG("unable to get prime for GFp curve");
goto fail;
}
if (!EC_GROUP_get_order(session->group, session->order, NULL)) {
DEBUG("unable to get order for curve");
goto fail;
}
if (!EC_GROUP_get_cofactor(session->group, cofactor, NULL)) {
DEBUG("unable to get cofactor for curve");
goto fail;
}
primebitlen = BN_num_bits(session->prime);
primebytelen = BN_num_bytes(session->prime);
if ((prfbuf = talloc_zero_array(session, uint8_t, primebytelen)) == NULL) {
DEBUG("unable to alloc space for prf buffer");
goto fail;
}
ctr = 0;
while (1) {
if (ctr > 10) {
DEBUG("unable to find random point on curve for group %d, something's fishy", grp_num);
goto fail;
}
ctr++;
/*
* compute counter-mode password value and stretch to prime
* pwd-seed = H(token | peer-id | server-id | password |
* counter)
*/
H_Init(ctx);
H_Update(ctx, (uint8_t *)token, sizeof(*token));
H_Update(ctx, (uint8_t const *)id_peer, id_peer_len);
H_Update(ctx, (uint8_t const *)id_server, id_server_len);
H_Update(ctx, (uint8_t const *)password, password_len);
H_Update(ctx, (uint8_t *)&ctr, sizeof(ctr));
H_Final(ctx, pwe_digest);
BN_bin2bn(pwe_digest, SHA256_DIGEST_LENGTH, rnd);
if (eap_pwd_kdf(pwe_digest, SHA256_DIGEST_LENGTH, "EAP-pwd Hunting And Pecking",
strlen("EAP-pwd Hunting And Pecking"), prfbuf, primebitlen) != 0) {
DEBUG("key derivation function failed");
goto fail;
}
BN_bin2bn(prfbuf, primebytelen, x_candidate);
/*
* eap_pwd_kdf() returns a string of bits 0..primebitlen but
* BN_bin2bn will treat that string of bits as a big endian
* number. If the primebitlen is not an even multiple of 8
* then excessive bits-- those _after_ primebitlen-- so now
* we have to shift right the amount we masked off.
*/
if (primebitlen % 8) BN_rshift(x_candidate, x_candidate, (8 - (primebitlen % 8)));
if (BN_ucmp(x_candidate, session->prime) >= 0) continue;
/*
* need to unambiguously identify the solution, if there is
* one...
*/
is_odd = BN_is_odd(rnd) ? 1 : 0;
/*
* solve the quadratic equation, if it's not solvable then we
* don't have a point
*/
if (!EC_POINT_set_compressed_coordinates_GFp(session->group, session->pwe, x_candidate, is_odd, NULL)) {
continue;
}
/*
* If there's a solution to the equation then the point must be
* on the curve so why check again explicitly? OpenSSL code
* says this is required by X9.62. We're not X9.62 but it can't
* hurt just to be sure.
*/
if (!EC_POINT_is_on_curve(session->group, session->pwe, NULL)) {
DEBUG("EAP-pwd: point is not on curve");
continue;
}
if (BN_cmp(cofactor, BN_value_one())) {
/* make sure the point is not in a small sub-group */
if (!EC_POINT_mul(session->group, session->pwe, NULL, session->pwe,
cofactor, NULL)) {
DEBUG("EAP-pwd: cannot multiply generator by order");
continue;
}
if (EC_POINT_is_at_infinity(session->group, session->pwe)) {
DEBUG("EAP-pwd: point is at infinity");
continue;
}
}
/* if we got here then we have a new generator. */
break;
}
session->group_num = grp_num;
if (0) {
fail: /* DON'T free session, it's in handler->opaque */
ret = -1;
}
/* cleanliness and order.... */
BN_clear_free(cofactor);
BN_clear_free(x_candidate);
BN_clear_free(rnd);
talloc_free(prfbuf);
HMAC_CTX_free(ctx);
return ret;
} | 817 | True | 1 |
CVE-2019-13568 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/dtschump/CImg', 'name': 'https://github.com/dtschump/CImg', 'refsource': 'MISC', 'tags': ['Product']}, {'url': 'https://github.com/dtschump/CImg/commit/ac8003393569aba51048c9d67e1491559877b1d1', 'name': 'https://github.com/dtschump/CImg/commit/ac8003393569aba51048c9d67e1491559877b1d1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://cimg.eu/', 'name': 'http://cimg.eu/', 'refsource': 'MISC', 'tags': ['Product']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:cimg:cimg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.6.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'CImg through 2.6.7 has a heap-based buffer overflow in _load_bmp in CImg.h because of erroneous memory allocation for a malformed BMP image.'}] | 2020-08-24T17:37Z | 2019-07-31T15: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 | David Tschumperlé | 2019-07-11 22:12:33+02:00 | . | ac8003393569aba51048c9d67e1491559877b1d1 | False | visit repo url | visit repo url | visit repo url | visit repo url | visit repo url | dtschump | visit repo url | visit repo url | cimg_library_suffixed::CImg::_load_bmp | cimg_library_suffixed::CImg::_load_bmp( std :: FILE * const file , const char * const filename) | ['file', 'filename'] |
CImg<T>& _load_bmp(std::FILE *const file, const char *const filename) {
if (!file && !filename)
throw CImgArgumentException(_cimg_instance
"load_bmp(): Specified filename is (null).",
cimg_instance);
std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
CImg<ucharT> header(54);
cimg::fread(header._data,54,nfile);
if (*header!='B' || header[1]!='M') {
if (!file) cimg::fclose(nfile);
throw CImgIOException(_cimg_instance
"load_bmp(): Invalid BMP file '%s'.",
cimg_instance,
filename?filename:"(FILE*)");
}
// Read header and pixel buffer
int
file_size = header[0x02] + (header[0x03]<<8) + (header[0x04]<<16) + (header[0x05]<<24),
offset = header[0x0A] + (header[0x0B]<<8) + (header[0x0C]<<16) + (header[0x0D]<<24),
header_size = header[0x0E] + (header[0x0F]<<8) + (header[0x10]<<16) + (header[0x11]<<24),
dx = header[0x12] + (header[0x13]<<8) + (header[0x14]<<16) + (header[0x15]<<24),
dy = header[0x16] + (header[0x17]<<8) + (header[0x18]<<16) + (header[0x19]<<24),
compression = header[0x1E] + (header[0x1F]<<8) + (header[0x20]<<16) + (header[0x21]<<24),
nb_colors = header[0x2E] + (header[0x2F]<<8) + (header[0x30]<<16) + (header[0x31]<<24),
bpp = header[0x1C] + (header[0x1D]<<8);
if (!file_size || file_size==offset) {
cimg::fseek(nfile,0,SEEK_END);
file_size = (int)cimg::ftell(nfile);
cimg::fseek(nfile,54,SEEK_SET);
}
if (header_size>40) cimg::fseek(nfile,header_size - 40,SEEK_CUR);
const int
dx_bytes = (bpp==1)?(dx/8 + (dx%8?1:0)):((bpp==4)?(dx/2 + (dx%2)):(int)((longT)dx*bpp/8)),
align_bytes = (4 - dx_bytes%4)%4;
const ulongT
cimg_iobuffer = (ulongT)24*1024*1024,
buf_size = std::min((ulongT)cimg::abs(dy)*(dx_bytes + align_bytes),(ulongT)file_size - offset);
CImg<intT> colormap;
if (bpp<16) { if (!nb_colors) nb_colors = 1<<bpp; } else nb_colors = 0;
if (nb_colors) { colormap.assign(nb_colors); cimg::fread(colormap._data,nb_colors,nfile); }
const int xoffset = offset - 14 - header_size - 4*nb_colors;
if (xoffset>0) cimg::fseek(nfile,xoffset,SEEK_CUR);
CImg<ucharT> buffer;
if (buf_size<cimg_iobuffer) {
buffer.assign(cimg::abs(dy)*(dx_bytes + align_bytes),1,1,1,0);
cimg::fread(buffer._data,buf_size,nfile);
} else buffer.assign(dx_bytes + align_bytes);
unsigned char *ptrs = buffer;
// Decompress buffer (if necessary)
if (compression) {
if (file)
throw CImgIOException(_cimg_instance
"load_bmp(): Unable to load compressed data from '(*FILE)' inputs.",
cimg_instance);
else {
if (!file) cimg::fclose(nfile);
return load_other(filename);
}
}
// Read pixel data
assign(dx,cimg::abs(dy),1,3,0);
switch (bpp) {
case 1 : { // Monochrome
if (colormap._width>=2) for (int y = height() - 1; y>=0; --y) {
if (buf_size>=cimg_iobuffer) {
if (!cimg::fread(ptrs=buffer._data,dx_bytes,nfile)) break;
cimg::fseek(nfile,align_bytes,SEEK_CUR);
}
unsigned char mask = 0x80, val = 0;
cimg_forX(*this,x) {
if (mask==0x80) val = *(ptrs++);
const unsigned char *col = (unsigned char*)(colormap._data + (val&mask?1:0));
(*this)(x,y,2) = (T)*(col++);
(*this)(x,y,1) = (T)*(col++);
(*this)(x,y,0) = (T)*(col++);
mask = cimg::ror(mask);
}
ptrs+=align_bytes;
}
} break;
case 4 : { // 16 colors
if (colormap._width>=16) for (int y = height() - 1; y>=0; --y) {
if (buf_size>=cimg_iobuffer) {
if (!cimg::fread(ptrs=buffer._data,dx_bytes,nfile)) break;
cimg::fseek(nfile,align_bytes,SEEK_CUR);
}
unsigned char mask = 0xF0, val = 0;
cimg_forX(*this,x) {
if (mask==0xF0) val = *(ptrs++);
const unsigned char color = (unsigned char)((mask<16)?(val&mask):((val&mask)>>4));
const unsigned char *col = (unsigned char*)(colormap._data + color);
(*this)(x,y,2) = (T)*(col++);
(*this)(x,y,1) = (T)*(col++);
(*this)(x,y,0) = (T)*(col++);
mask = cimg::ror(mask,4);
}
ptrs+=align_bytes;
}
} break;
case 8 : { // 256 colors
if (colormap._width>=256) for (int y = height() - 1; y>=0; --y) {
if (buf_size>=cimg_iobuffer) {
if (!cimg::fread(ptrs=buffer._data,dx_bytes,nfile)) break;
cimg::fseek(nfile,align_bytes,SEEK_CUR);
}
cimg_forX(*this,x) {
const unsigned char *col = (unsigned char*)(colormap._data + *(ptrs++));
(*this)(x,y,2) = (T)*(col++);
(*this)(x,y,1) = (T)*(col++);
(*this)(x,y,0) = (T)*(col++);
}
ptrs+=align_bytes;
}
} break;
case 16 : { // 16 bits colors
for (int y = height() - 1; y>=0; --y) {
if (buf_size>=cimg_iobuffer) {
if (!cimg::fread(ptrs=buffer._data,dx_bytes,nfile)) break;
cimg::fseek(nfile,align_bytes,SEEK_CUR);
}
cimg_forX(*this,x) {
const unsigned char c1 = *(ptrs++), c2 = *(ptrs++);
const unsigned short col = (unsigned short)(c1|(c2<<8));
(*this)(x,y,2) = (T)(col&0x1F);
(*this)(x,y,1) = (T)((col>>5)&0x1F);
(*this)(x,y,0) = (T)((col>>10)&0x1F);
}
ptrs+=align_bytes;
}
} break;
case 24 : { // 24 bits colors
for (int y = height() - 1; y>=0; --y) {
if (buf_size>=cimg_iobuffer) {
if (!cimg::fread(ptrs=buffer._data,dx_bytes,nfile)) break;
cimg::fseek(nfile,align_bytes,SEEK_CUR);
}
cimg_forX(*this,x) {
(*this)(x,y,2) = (T)*(ptrs++);
(*this)(x,y,1) = (T)*(ptrs++);
(*this)(x,y,0) = (T)*(ptrs++);
}
ptrs+=align_bytes;
}
} break;
case 32 : { // 32 bits colors
for (int y = height() - 1; y>=0; --y) {
if (buf_size>=cimg_iobuffer) {
if (!cimg::fread(ptrs=buffer._data,dx_bytes,nfile)) break;
cimg::fseek(nfile,align_bytes,SEEK_CUR);
}
cimg_forX(*this,x) {
(*this)(x,y,2) = (T)*(ptrs++);
(*this)(x,y,1) = (T)*(ptrs++);
(*this)(x,y,0) = (T)*(ptrs++);
++ptrs;
}
ptrs+=align_bytes;
}
} break;
}
if (dy<0) mirror('y');
if (!file) cimg::fclose(nfile);
return *this; | 1923 | True | 1 |
CVE-2020-20740 | 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/enferex/pdfresurrect/commit/1b422459f07353adce2878806d5247d9e91fb397', 'name': 'https://github.com/enferex/pdfresurrect/commit/1b422459f07353adce2878806d5247d9e91fb397', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/issues/14', 'name': 'https://github.com/enferex/pdfresurrect/issues/14', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/ZOIEVFM3SIMAEOFJKKMYH2TLZ7PXLSUD/', 'name': 'FEDORA-2020-92195be0e2', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JMEEEPBBGER5LPABBRVZLMCC6Z24RBXW/', 'name': 'FEDORA-2020-e9f9bb77a0', '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:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.20', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'PDFResurrect before 0.20 lack of header validation checks causes heap-buffer-overflow in pdf_get_version().'}] | 2022-01-01T18:10Z | 2020-11-20T19: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 | Matt Davis | 2020-07-23 20:18:10-07:00 | Update header validation checks.
Thanks to yifengchen-cc for identifying this. | 1b422459f07353adce2878806d5247d9e91fb397 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | pdf_get_version | pdf_get_version( FILE * fp , pdf_t * pdf) | ['fp', 'pdf'] | void pdf_get_version(FILE *fp, pdf_t *pdf)
{
char *header, *c;
header = get_header(fp);
/* Locate version string start and make sure we dont go past header */
if ((c = strstr(header, "%PDF-")) &&
(c + strlen("%PDF-M.m") + 2))
{
pdf->pdf_major_version = atoi(c + strlen("%PDF-"));
pdf->pdf_minor_version = atoi(c + strlen("%PDF-M."));
}
free(header);
} | 85 | True | 1 |
CVE-2020-20740 | 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/enferex/pdfresurrect/commit/1b422459f07353adce2878806d5247d9e91fb397', 'name': 'https://github.com/enferex/pdfresurrect/commit/1b422459f07353adce2878806d5247d9e91fb397', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/issues/14', 'name': 'https://github.com/enferex/pdfresurrect/issues/14', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/ZOIEVFM3SIMAEOFJKKMYH2TLZ7PXLSUD/', 'name': 'FEDORA-2020-92195be0e2', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JMEEEPBBGER5LPABBRVZLMCC6Z24RBXW/', 'name': 'FEDORA-2020-e9f9bb77a0', '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:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.20', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'PDFResurrect before 0.20 lack of header validation checks causes heap-buffer-overflow in pdf_get_version().'}] | 2022-01-01T18:10Z | 2020-11-20T19: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 | Matt Davis | 2020-07-23 20:18:10-07:00 | Update header validation checks.
Thanks to yifengchen-cc for identifying this. | 1b422459f07353adce2878806d5247d9e91fb397 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | pdf_is_pdf | pdf_is_pdf( FILE * fp) | ['fp'] | int pdf_is_pdf(FILE *fp)
{
int is_pdf;
char *header;
header = get_header(fp);
if (header && strstr(header, "%PDF-"))
is_pdf = 1;
else
is_pdf = 0;
free(header);
return is_pdf;
} | 50 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22: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 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | main | main( int argc , char ** argv) | ['argc', 'argv'] | int main(int argc, char **argv)
{
int i, n_valid, do_write, do_scrub;
char *c, *dname, *name;
DIR *dir;
FILE *fp;
pdf_t *pdf;
pdf_flag_t flags;
if (argc < 2)
usage();
/* Args */
do_write = do_scrub = flags = 0;
name = NULL;
for (i=1; i<argc; i++)
{
if (strncmp(argv[i], "-w", 2) == 0)
do_write = 1;
else if (strncmp(argv[i], "-i", 2) == 0)
flags |= PDF_FLAG_DISP_CREATOR;
else if (strncmp(argv[i], "-q", 2) == 0)
flags |= PDF_FLAG_QUIET;
else if (strncmp(argv[i], "-s", 2) == 0)
do_scrub = 1;
else if (argv[i][0] != '-')
name = argv[i];
else if (argv[i][0] == '-')
usage();
}
if (!name)
usage();
if (!(fp = fopen(name, "r")))
{
ERR("Could not open file '%s'\n", argv[1]);
return -1;
}
else if (!pdf_is_pdf(fp))
{
ERR("'%s' specified is not a valid PDF\n", name);
fclose(fp);
return -1;
}
/* Load PDF */
if (!(pdf = init_pdf(fp, name)))
{
fclose(fp);
return -1;
}
/* Count valid xrefs */
for (i=0, n_valid=0; i<pdf->n_xrefs; i++)
if (pdf->xrefs[i].version)
++n_valid;
/* Bail if we only have 1 valid */
if (n_valid < 2)
{
if (!(flags & (PDF_FLAG_QUIET | PDF_FLAG_DISP_CREATOR)))
printf("%s: There is only one version of this PDF\n", pdf->name);
if (do_write)
{
fclose(fp);
pdf_delete(pdf);
return 0;
}
}
dname = NULL;
if (do_write)
{
/* Create directory to place the various versions in */
if ((c = strrchr(name, '/')))
name = c + 1;
if ((c = strrchr(name, '.')))
*c = '\0';
dname = malloc(strlen(name) + 16);
sprintf(dname, "%s-versions", name);
if (!(dir = opendir(dname)))
mkdir(dname, S_IRWXU);
else
{
ERR("This directory already exists, PDF version extraction will "
"not occur.\n");
fclose(fp);
closedir(dir);
free(dname);
pdf_delete(pdf);
return -1;
}
/* Write the pdf as a pervious version */
for (i=0; i<pdf->n_xrefs; i++)
if (pdf->xrefs[i].version)
write_version(fp, name, dname, &pdf->xrefs[i]);
}
/* Generate a per-object summary */
pdf_summarize(fp, pdf, dname, flags);
/* Have we been summoned to scrub history from this PDF */
if (do_scrub)
scrub_document(fp, pdf);
/* Display extra information */
if (flags & PDF_FLAG_DISP_CREATOR)
display_creator(fp, pdf);
fclose(fp);
free(dname);
pdf_delete(pdf);
return 0;
} | 591 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22: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 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | write_version | write_version( FILE * fp , const char * fname , const char * dirname , xref_t * xref) | ['fp', 'fname', 'dirname', 'xref'] | static void write_version(
FILE *fp,
const char *fname,
const char *dirname,
xref_t *xref)
{
long start;
char *c, *new_fname, data;
FILE *new_fp;
start = ftell(fp);
/* Create file */
if ((c = strstr(fname, ".pdf")))
*c = '\0';
new_fname = malloc(strlen(fname) + strlen(dirname) + 16);
snprintf(new_fname, strlen(fname) + strlen(dirname) + 16,
"%s/%s-version-%d.pdf", dirname, fname, xref->version);
if (!(new_fp = fopen(new_fname, "w")))
{
ERR("Could not create file '%s'\n", new_fname);
fseek(fp, start, SEEK_SET);
free(new_fname);
return;
}
/* Copy original PDF */
fseek(fp, 0, SEEK_SET);
while (fread(&data, 1, 1, fp))
fwrite(&data, 1, 1, new_fp);
/* Emit an older startxref, refering to an older version. */
fprintf(new_fp, "\r\nstartxref\r\n%ld\r\n%%%%EOF", xref->start);
/* Clean */
fclose(new_fp);
free(new_fname);
fseek(fp, start, SEEK_SET);
} | 211 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22: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 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | decode_text_string | decode_text_string( const char * str , size_t str_len) | ['str', 'str_len'] | static char *decode_text_string(const char *str, size_t str_len)
{
int idx, is_hex, is_utf16be, ascii_idx;
char *ascii, hex_buf[5] = {0};
is_hex = is_utf16be = idx = ascii_idx = 0;
/* Regular encoding */
if (str[0] == '(')
{
ascii = malloc(strlen(str) + 1);
strncpy(ascii, str, strlen(str) + 1);
return ascii;
}
else if (str[0] == '<')
{
is_hex = 1;
++idx;
}
/* Text strings can be either PDFDocEncoding or UTF-16BE */
if (is_hex && (str_len > 5) &&
(str[idx] == 'F') && (str[idx+1] == 'E') &&
(str[idx+2] == 'F') && (str[idx+3] == 'F'))
{
is_utf16be = 1;
idx += 4;
}
else
return NULL;
/* Now decode as hex */
ascii = malloc(str_len);
for ( ; idx<str_len; ++idx)
{
hex_buf[0] = str[idx++];
hex_buf[1] = str[idx++];
hex_buf[2] = str[idx++];
hex_buf[3] = str[idx];
ascii[ascii_idx++] = strtol(hex_buf, NULL, 16);
}
return ascii;
} | 249 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22: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 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | get_header | get_header( FILE * fp) | ['fp'] | static char *get_header(FILE *fp)
{
long start;
/* First 1024 bytes of doc must be header (1.7 spec pg 1102) */
char *header;
header = calloc(1, 1024);
start = ftell(fp);
fseek(fp, 0, SEEK_SET);
SAFE_E(fread(header, 1, 1023, fp), 1023, "Failed to load PDF header.\n");
fseek(fp, start, SEEK_SET);
return header;
} | 70 | True | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.