cve_id
stringlengths 13
16
| obtain_all_privilege
stringclasses 3
values | obtain_user_privilege
stringclasses 2
values | obtain_other_privilege
stringclasses 2
values | user_interaction_required
stringclasses 3
values | cvss2_vector_string
stringclasses 106
values | cvss2_access_vector
stringclasses 4
values | cvss2_access_complexity
stringclasses 4
values | cvss2_authentication
stringclasses 3
values | cvss2_confidentiality_impact
stringclasses 4
values | cvss2_integrity_impact
stringclasses 4
values | cvss2_availability_impact
stringclasses 4
values | cvss2_base_score
stringclasses 50
values | cvss3_vector_string
stringclasses 226
values | cvss3_attack_vector
stringclasses 5
values | cvss3_attack_complexity
stringclasses 3
values | cvss3_privileges_required
stringclasses 4
values | cvss3_user_interaction
stringclasses 3
values | cvss3_scope
stringclasses 3
values | cvss3_confidentiality_impact
stringclasses 4
values | cvss3_integrity_impact
stringclasses 4
values | cvss3_availability_impact
stringclasses 4
values | cvss3_base_score
stringclasses 55
values | cvss3_base_severity
stringclasses 5
values | exploitability_score
stringclasses 22
values | impact_score
stringclasses 15
values | ac_insuf_info
stringclasses 3
values | reference_json
stringlengths 221
23.3k
| problemtype_json
stringclasses 200
values | severity
stringclasses 4
values | cve_nodes
stringlengths 2
33.1k
| cve_description
stringlengths 64
1.99k
| cve_last_modified_date
stringlengths 17
17
| cve_published_date
stringlengths 17
17
| cwe_name
stringclasses 125
values | cwe_description
stringclasses 124
values | cwe_extended_description
stringclasses 95
values | cwe_url
stringclasses 124
values | cwe_is_category
int64 0
1
| commit_author
stringlengths 0
34
| commit_author_date
stringlengths 25
25
| commit_msg
stringlengths 0
13.3k
| commit_hash
stringlengths 40
40
| commit_is_merge
stringclasses 1
value | repo_name
stringclasses 467
values | repo_description
stringclasses 459
values | repo_date_created
stringclasses 467
values | repo_date_last_push
stringclasses 467
values | repo_homepage
stringclasses 294
values | repo_owner
stringclasses 470
values | repo_stars
stringclasses 406
values | repo_forks
stringclasses 352
values | function_name
stringlengths 3
120
| function_signature
stringlengths 6
640
| function_parameters
stringlengths 2
302
| function
stringlengths 12
114k
| function_token_count
stringlengths 1
5
| function_before_change
stringclasses 1
value | labels
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2021-26926 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 7.1 | HIGH | 1.8 | 5.2 | False | [{'url': 'https://github.com/jasper-software/jasper/issues/264', 'name': 'https://github.com/jasper-software/jasper/issues/264', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/jasper-software/jasper/commit/41f214b121b837fa30d9ca5f2430212110f5cd9b', 'name': 'https://github.com/jasper-software/jasper/commit/41f214b121b837fa30d9ca5f2430212110f5cd9b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JYVCFVTVPL66OS7LCNLUSYCMYQAVWXMM/', 'name': 'FEDORA-2021-7f3323a767', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YRZFZSJ4UVLLMXSKHR455TAC2SD3TOHI/', 'name': 'FEDORA-2021-56a49b0bc6', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JSXESYUHMO522Z3RHXOQ2SJNWP3XTO67/', 'name': 'FEDORA-2021-5a34dd3f2d', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:jasper_project:jasper:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.25', '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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in jasper before 2.0.25. An out of bounds read issue was found in jp2_decode function whic may lead to disclosure of information or program crash.'}] | 2021-03-22T16:09Z | 2021-02-23T18:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Michael Adams | 2021-02-07 12:31:55-08:00 | Fixes #264.
The JP2 decoder was allowing the decoding of a code stream to be
attempted when the stream has inconsistent values for the number of
components and/or the component types. For such invalid streams,
only a warning would be issued and decoding would proceed. This is
dangerous, however, as it can lead to many unexpected paths through
the code, which in some cases have been demonstrated to result in
security vulnerabilities. This code change makes decoding of these
types invalid code streams a hard error. | 41f214b121b837fa30d9ca5f2430212110f5cd9b | False | jasper-software/jasper | Official Repository for the JasPer Image Coding Toolkit | 2016-09-16 18:52:32 | 2022-08-24 16:06:43 | http://www.ece.uvic.ca/~mdadams/jasper | jasper-software | 171.0 | 86.0 | jp2_decode | jp2_decode( jas_stream_t * in , const char * optstr) | ['in', 'optstr'] | jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr)
{
jp2_box_t *box;
int found;
jas_image_t *image;
jp2_dec_t *dec;
bool samedtype;
int dtype;
unsigned int i;
jp2_cmap_t *cmapd;
jp2_pclr_t *pclrd;
jp2_cdef_t *cdefd;
unsigned int channo;
int newcmptno;
int_fast32_t *lutents;
#if 0
jp2_cdefchan_t *cdefent;
int cmptno;
#endif
jp2_cmapent_t *cmapent;
jas_icchdr_t icchdr;
jas_iccprof_t *iccprof;
dec = 0;
box = 0;
image = 0;
JAS_DBGLOG(100, ("jp2_decode(%p, \"%s\")\n", in, optstr));
if (!(dec = jp2_dec_create())) {
goto error;
}
/* Get the first box. This should be a JP box. */
if (!(box = jp2_box_get(in))) {
jas_eprintf("error: cannot get box\n");
goto error;
}
if (box->type != JP2_BOX_JP) {
jas_eprintf("error: expecting signature box\n");
goto error;
}
if (box->data.jp.magic != JP2_JP_MAGIC) {
jas_eprintf("incorrect magic number\n");
goto error;
}
jp2_box_destroy(box);
box = 0;
/* Get the second box. This should be a FTYP box. */
if (!(box = jp2_box_get(in))) {
goto error;
}
if (box->type != JP2_BOX_FTYP) {
jas_eprintf("expecting file type box\n");
goto error;
}
jp2_box_destroy(box);
box = 0;
/* Get more boxes... */
found = 0;
while ((box = jp2_box_get(in))) {
if (jas_getdbglevel() >= 1) {
jas_eprintf("got box type %s\n", box->info->name);
}
switch (box->type) {
case JP2_BOX_JP2C:
found = 1;
break;
case JP2_BOX_IHDR:
if (!dec->ihdr) {
dec->ihdr = box;
box = 0;
}
break;
case JP2_BOX_BPCC:
if (!dec->bpcc) {
dec->bpcc = box;
box = 0;
}
break;
case JP2_BOX_CDEF:
if (!dec->cdef) {
dec->cdef = box;
box = 0;
}
break;
case JP2_BOX_PCLR:
if (!dec->pclr) {
dec->pclr = box;
box = 0;
}
break;
case JP2_BOX_CMAP:
if (!dec->cmap) {
dec->cmap = box;
box = 0;
}
break;
case JP2_BOX_COLR:
if (!dec->colr) {
dec->colr = box;
box = 0;
}
break;
}
if (box) {
jp2_box_destroy(box);
box = 0;
}
if (found) {
break;
}
}
if (!found) {
jas_eprintf("error: no code stream found\n");
goto error;
}
if (!(dec->image = jpc_decode(in, optstr))) {
jas_eprintf("error: cannot decode code stream\n");
goto error;
}
/* An IHDR box must be present. */
if (!dec->ihdr) {
jas_eprintf("error: missing IHDR box\n");
goto error;
}
/* Does the number of components indicated in the IHDR box match
the value specified in the code stream? */
if (dec->ihdr->data.ihdr.numcmpts != JAS_CAST(jas_uint,
jas_image_numcmpts(dec->image))) {
jas_eprintf("warning: number of components mismatch\n");
}
/* At least one component must be present. */
if (!jas_image_numcmpts(dec->image)) {
jas_eprintf("error: no components\n");
goto error;
}
/* Determine if all components have the same data type. */
samedtype = true;
dtype = jas_image_cmptdtype(dec->image, 0);
for (i = 1; i < JAS_CAST(jas_uint, jas_image_numcmpts(dec->image)); ++i) {
if (jas_image_cmptdtype(dec->image, i) != dtype) {
samedtype = false;
break;
}
}
/* Is the component data type indicated in the IHDR box consistent
with the data in the code stream? */
if ((samedtype && dec->ihdr->data.ihdr.bpc != JP2_DTYPETOBPC(dtype)) ||
(!samedtype && dec->ihdr->data.ihdr.bpc != JP2_IHDR_BPCNULL)) {
jas_eprintf("warning: component data type mismatch (IHDR)\n");
}
/* Is the compression type supported? */
if (dec->ihdr->data.ihdr.comptype != JP2_IHDR_COMPTYPE) {
jas_eprintf("error: unsupported compression type\n");
goto error;
}
if (dec->bpcc) {
/* Is the number of components indicated in the BPCC box
consistent with the code stream data? */
if (dec->bpcc->data.bpcc.numcmpts != JAS_CAST(jas_uint, jas_image_numcmpts(
dec->image))) {
jas_eprintf("warning: number of components mismatch\n");
}
/* Is the component data type information indicated in the BPCC
box consistent with the code stream data? */
if (!samedtype) {
for (i = 0; i < JAS_CAST(jas_uint, jas_image_numcmpts(dec->image));
++i) {
if (jas_image_cmptdtype(dec->image, i) !=
JP2_BPCTODTYPE(dec->bpcc->data.bpcc.bpcs[i])) {
jas_eprintf("warning: component data type mismatch (BPCC)\n");
}
}
} else {
jas_eprintf("warning: superfluous BPCC box\n");
}
}
/* A COLR box must be present. */
if (!dec->colr) {
jas_eprintf("error: no COLR box\n");
goto error;
}
switch (dec->colr->data.colr.method) {
case JP2_COLR_ENUM:
jas_image_setclrspc(dec->image, jp2_getcs(&dec->colr->data.colr));
break;
case JP2_COLR_ICC:
iccprof = jas_iccprof_createfrombuf(dec->colr->data.colr.iccp,
dec->colr->data.colr.iccplen);
if (!iccprof) {
jas_eprintf("error: failed to parse ICC profile\n");
goto error;
}
jas_iccprof_gethdr(iccprof, &icchdr);
jas_eprintf("ICC Profile CS %08x\n", icchdr.colorspc);
jas_image_setclrspc(dec->image, fromiccpcs(icchdr.colorspc));
dec->image->cmprof_ = jas_cmprof_createfromiccprof(iccprof);
if (!dec->image->cmprof_) {
jas_iccprof_destroy(iccprof);
goto error;
}
jas_iccprof_destroy(iccprof);
break;
}
/* If a CMAP box is present, a PCLR box must also be present. */
if (dec->cmap && !dec->pclr) {
jas_eprintf("warning: missing PCLR box or superfluous CMAP box\n");
jp2_box_destroy(dec->cmap);
dec->cmap = 0;
}
/* If a CMAP box is not present, a PCLR box must not be present. */
if (!dec->cmap && dec->pclr) {
jas_eprintf("warning: missing CMAP box or superfluous PCLR box\n");
jp2_box_destroy(dec->pclr);
dec->pclr = 0;
}
/* Determine the number of channels (which is essentially the number
of components after any palette mappings have been applied). */
dec->numchans = dec->cmap ? dec->cmap->data.cmap.numchans :
JAS_CAST(jas_uint, jas_image_numcmpts(dec->image));
/* Perform a basic sanity check on the CMAP box if present. */
if (dec->cmap) {
for (i = 0; i < dec->numchans; ++i) {
/* Is the component number reasonable? */
if (dec->cmap->data.cmap.ents[i].cmptno >= JAS_CAST(jas_uint,
jas_image_numcmpts(dec->image))) {
jas_eprintf("error: invalid component number in CMAP box\n");
goto error;
}
/* Is the LUT index reasonable? */
if (dec->cmap->data.cmap.ents[i].pcol >=
dec->pclr->data.pclr.numchans) {
jas_eprintf("error: invalid CMAP LUT index\n");
goto error;
}
}
}
/* Allocate space for the channel-number to component-number LUT. */
if (!(dec->chantocmptlut = jas_alloc2(dec->numchans,
sizeof(uint_fast16_t)))) {
jas_eprintf("error: no memory\n");
goto error;
}
if (!dec->cmap) {
for (i = 0; i < dec->numchans; ++i) {
dec->chantocmptlut[i] = i;
}
} else {
cmapd = &dec->cmap->data.cmap;
pclrd = &dec->pclr->data.pclr;
cdefd = &dec->cdef->data.cdef;
for (channo = 0; channo < cmapd->numchans; ++channo) {
cmapent = &cmapd->ents[channo];
if (cmapent->map == JP2_CMAP_DIRECT) {
dec->chantocmptlut[channo] = channo;
} else if (cmapent->map == JP2_CMAP_PALETTE) {
if (!pclrd->numlutents) {
goto error;
}
lutents = jas_alloc2(pclrd->numlutents, sizeof(int_fast32_t));
if (!lutents) {
goto error;
}
for (i = 0; i < pclrd->numlutents; ++i) {
lutents[i] = pclrd->lutdata[cmapent->pcol + i * pclrd->numchans];
}
newcmptno = jas_image_numcmpts(dec->image);
jas_image_depalettize(dec->image, cmapent->cmptno,
pclrd->numlutents, lutents,
JP2_BPCTODTYPE(pclrd->bpc[cmapent->pcol]), newcmptno);
dec->chantocmptlut[channo] = newcmptno;
jas_free(lutents);
#if 0
if (dec->cdef) {
cdefent = jp2_cdef_lookup(cdefd, channo);
if (!cdefent) {
abort();
}
jas_image_setcmpttype(dec->image, newcmptno, jp2_getct(jas_image_clrspc(dec->image), cdefent->type, cdefent->assoc));
} else {
jas_image_setcmpttype(dec->image, newcmptno, jp2_getct(jas_image_clrspc(dec->image), 0, channo + 1));
}
#else
/* suppress -Wunused-but-set-variable */
(void)cdefd;
#endif
} else {
jas_eprintf("error: invalid MTYP in CMAP box\n");
goto error;
}
}
}
/* Ensure that the number of channels being used by the decoder
matches the number of image components. */
if (dec->numchans != jas_image_numcmpts(dec->image)) {
jas_eprintf("error: mismatch in number of components (%d != %d)\n",
dec->numchans, jas_image_numcmpts(dec->image));
goto error;
}
/* Mark all components as being of unknown type. */
for (i = 0; i < JAS_CAST(jas_uint, jas_image_numcmpts(dec->image)); ++i) {
jas_image_setcmpttype(dec->image, i, JAS_IMAGE_CT_UNKNOWN);
}
/* Determine the type of each component. */
if (dec->cdef) {
for (i = 0; i < dec->cdef->data.cdef.numchans; ++i) {
/* Is the channel number reasonable? */
if (dec->cdef->data.cdef.ents[i].channo >= dec->numchans) {
jas_eprintf("error: invalid channel number in CDEF box\n");
goto error;
}
jas_image_setcmpttype(dec->image,
dec->chantocmptlut[dec->cdef->data.cdef.ents[i].channo],
jp2_getct(jas_image_clrspc(dec->image),
dec->cdef->data.cdef.ents[i].type,
dec->cdef->data.cdef.ents[i].assoc));
}
} else {
for (i = 0; i < dec->numchans; ++i) {
jas_image_setcmpttype(dec->image, dec->chantocmptlut[i],
jp2_getct(jas_image_clrspc(dec->image), 0, i + 1));
}
}
/* Delete any components that are not of interest. */
for (i = jas_image_numcmpts(dec->image); i > 0; --i) {
if (jas_image_cmpttype(dec->image, i - 1) == JAS_IMAGE_CT_UNKNOWN) {
jas_image_delcmpt(dec->image, i - 1);
}
}
/* Ensure that some components survived. */
if (!jas_image_numcmpts(dec->image)) {
jas_eprintf("error: no components\n");
goto error;
}
#if 0
jas_eprintf("no of components is %d\n", jas_image_numcmpts(dec->image));
#endif
/* Prevent the image from being destroyed later. */
image = dec->image;
dec->image = 0;
jp2_dec_destroy(dec);
return image;
error:
if (box) {
jp2_box_destroy(box);
}
if (dec) {
jp2_dec_destroy(dec);
}
return 0;
} | 1929 | True | 1 |
CVE-2021-26927 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/jasper-software/jasper/issues/265', 'name': 'https://github.com/jasper-software/jasper/issues/265', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/jasper-software/jasper/commit/41f214b121b837fa30d9ca5f2430212110f5cd9b', 'name': 'https://github.com/jasper-software/jasper/commit/41f214b121b837fa30d9ca5f2430212110f5cd9b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JYVCFVTVPL66OS7LCNLUSYCMYQAVWXMM/', 'name': 'FEDORA-2021-7f3323a767', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YRZFZSJ4UVLLMXSKHR455TAC2SD3TOHI/', 'name': 'FEDORA-2021-56a49b0bc6', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JSXESYUHMO522Z3RHXOQ2SJNWP3XTO67/', 'name': 'FEDORA-2021-5a34dd3f2d', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:jasper_project:jasper:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.25', '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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in jasper before 2.0.25. A null pointer dereference in jp2_decode in jp2_dec.c may lead to program crash and denial of service.'}] | 2021-03-24T01:04Z | 2021-02-23T20:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Michael Adams | 2021-02-07 12:31:55-08:00 | Fixes #264.
The JP2 decoder was allowing the decoding of a code stream to be
attempted when the stream has inconsistent values for the number of
components and/or the component types. For such invalid streams,
only a warning would be issued and decoding would proceed. This is
dangerous, however, as it can lead to many unexpected paths through
the code, which in some cases have been demonstrated to result in
security vulnerabilities. This code change makes decoding of these
types invalid code streams a hard error. | 41f214b121b837fa30d9ca5f2430212110f5cd9b | False | jasper-software/jasper | Official Repository for the JasPer Image Coding Toolkit | 2016-09-16 18:52:32 | 2022-08-24 16:06:43 | http://www.ece.uvic.ca/~mdadams/jasper | jasper-software | 171.0 | 86.0 | jp2_decode | jp2_decode( jas_stream_t * in , const char * optstr) | ['in', 'optstr'] | jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr)
{
jp2_box_t *box;
int found;
jas_image_t *image;
jp2_dec_t *dec;
bool samedtype;
int dtype;
unsigned int i;
jp2_cmap_t *cmapd;
jp2_pclr_t *pclrd;
jp2_cdef_t *cdefd;
unsigned int channo;
int newcmptno;
int_fast32_t *lutents;
#if 0
jp2_cdefchan_t *cdefent;
int cmptno;
#endif
jp2_cmapent_t *cmapent;
jas_icchdr_t icchdr;
jas_iccprof_t *iccprof;
dec = 0;
box = 0;
image = 0;
JAS_DBGLOG(100, ("jp2_decode(%p, \"%s\")\n", in, optstr));
if (!(dec = jp2_dec_create())) {
goto error;
}
/* Get the first box. This should be a JP box. */
if (!(box = jp2_box_get(in))) {
jas_eprintf("error: cannot get box\n");
goto error;
}
if (box->type != JP2_BOX_JP) {
jas_eprintf("error: expecting signature box\n");
goto error;
}
if (box->data.jp.magic != JP2_JP_MAGIC) {
jas_eprintf("incorrect magic number\n");
goto error;
}
jp2_box_destroy(box);
box = 0;
/* Get the second box. This should be a FTYP box. */
if (!(box = jp2_box_get(in))) {
goto error;
}
if (box->type != JP2_BOX_FTYP) {
jas_eprintf("expecting file type box\n");
goto error;
}
jp2_box_destroy(box);
box = 0;
/* Get more boxes... */
found = 0;
while ((box = jp2_box_get(in))) {
if (jas_getdbglevel() >= 1) {
jas_eprintf("got box type %s\n", box->info->name);
}
switch (box->type) {
case JP2_BOX_JP2C:
found = 1;
break;
case JP2_BOX_IHDR:
if (!dec->ihdr) {
dec->ihdr = box;
box = 0;
}
break;
case JP2_BOX_BPCC:
if (!dec->bpcc) {
dec->bpcc = box;
box = 0;
}
break;
case JP2_BOX_CDEF:
if (!dec->cdef) {
dec->cdef = box;
box = 0;
}
break;
case JP2_BOX_PCLR:
if (!dec->pclr) {
dec->pclr = box;
box = 0;
}
break;
case JP2_BOX_CMAP:
if (!dec->cmap) {
dec->cmap = box;
box = 0;
}
break;
case JP2_BOX_COLR:
if (!dec->colr) {
dec->colr = box;
box = 0;
}
break;
}
if (box) {
jp2_box_destroy(box);
box = 0;
}
if (found) {
break;
}
}
if (!found) {
jas_eprintf("error: no code stream found\n");
goto error;
}
if (!(dec->image = jpc_decode(in, optstr))) {
jas_eprintf("error: cannot decode code stream\n");
goto error;
}
/* An IHDR box must be present. */
if (!dec->ihdr) {
jas_eprintf("error: missing IHDR box\n");
goto error;
}
/* Does the number of components indicated in the IHDR box match
the value specified in the code stream? */
if (dec->ihdr->data.ihdr.numcmpts != JAS_CAST(jas_uint,
jas_image_numcmpts(dec->image))) {
jas_eprintf("warning: number of components mismatch\n");
}
/* At least one component must be present. */
if (!jas_image_numcmpts(dec->image)) {
jas_eprintf("error: no components\n");
goto error;
}
/* Determine if all components have the same data type. */
samedtype = true;
dtype = jas_image_cmptdtype(dec->image, 0);
for (i = 1; i < JAS_CAST(jas_uint, jas_image_numcmpts(dec->image)); ++i) {
if (jas_image_cmptdtype(dec->image, i) != dtype) {
samedtype = false;
break;
}
}
/* Is the component data type indicated in the IHDR box consistent
with the data in the code stream? */
if ((samedtype && dec->ihdr->data.ihdr.bpc != JP2_DTYPETOBPC(dtype)) ||
(!samedtype && dec->ihdr->data.ihdr.bpc != JP2_IHDR_BPCNULL)) {
jas_eprintf("warning: component data type mismatch (IHDR)\n");
}
/* Is the compression type supported? */
if (dec->ihdr->data.ihdr.comptype != JP2_IHDR_COMPTYPE) {
jas_eprintf("error: unsupported compression type\n");
goto error;
}
if (dec->bpcc) {
/* Is the number of components indicated in the BPCC box
consistent with the code stream data? */
if (dec->bpcc->data.bpcc.numcmpts != JAS_CAST(jas_uint, jas_image_numcmpts(
dec->image))) {
jas_eprintf("warning: number of components mismatch\n");
}
/* Is the component data type information indicated in the BPCC
box consistent with the code stream data? */
if (!samedtype) {
for (i = 0; i < JAS_CAST(jas_uint, jas_image_numcmpts(dec->image));
++i) {
if (jas_image_cmptdtype(dec->image, i) !=
JP2_BPCTODTYPE(dec->bpcc->data.bpcc.bpcs[i])) {
jas_eprintf("warning: component data type mismatch (BPCC)\n");
}
}
} else {
jas_eprintf("warning: superfluous BPCC box\n");
}
}
/* A COLR box must be present. */
if (!dec->colr) {
jas_eprintf("error: no COLR box\n");
goto error;
}
switch (dec->colr->data.colr.method) {
case JP2_COLR_ENUM:
jas_image_setclrspc(dec->image, jp2_getcs(&dec->colr->data.colr));
break;
case JP2_COLR_ICC:
iccprof = jas_iccprof_createfrombuf(dec->colr->data.colr.iccp,
dec->colr->data.colr.iccplen);
if (!iccprof) {
jas_eprintf("error: failed to parse ICC profile\n");
goto error;
}
jas_iccprof_gethdr(iccprof, &icchdr);
jas_eprintf("ICC Profile CS %08x\n", icchdr.colorspc);
jas_image_setclrspc(dec->image, fromiccpcs(icchdr.colorspc));
dec->image->cmprof_ = jas_cmprof_createfromiccprof(iccprof);
if (!dec->image->cmprof_) {
jas_iccprof_destroy(iccprof);
goto error;
}
jas_iccprof_destroy(iccprof);
break;
}
/* If a CMAP box is present, a PCLR box must also be present. */
if (dec->cmap && !dec->pclr) {
jas_eprintf("warning: missing PCLR box or superfluous CMAP box\n");
jp2_box_destroy(dec->cmap);
dec->cmap = 0;
}
/* If a CMAP box is not present, a PCLR box must not be present. */
if (!dec->cmap && dec->pclr) {
jas_eprintf("warning: missing CMAP box or superfluous PCLR box\n");
jp2_box_destroy(dec->pclr);
dec->pclr = 0;
}
/* Determine the number of channels (which is essentially the number
of components after any palette mappings have been applied). */
dec->numchans = dec->cmap ? dec->cmap->data.cmap.numchans :
JAS_CAST(jas_uint, jas_image_numcmpts(dec->image));
/* Perform a basic sanity check on the CMAP box if present. */
if (dec->cmap) {
for (i = 0; i < dec->numchans; ++i) {
/* Is the component number reasonable? */
if (dec->cmap->data.cmap.ents[i].cmptno >= JAS_CAST(jas_uint,
jas_image_numcmpts(dec->image))) {
jas_eprintf("error: invalid component number in CMAP box\n");
goto error;
}
/* Is the LUT index reasonable? */
if (dec->cmap->data.cmap.ents[i].pcol >=
dec->pclr->data.pclr.numchans) {
jas_eprintf("error: invalid CMAP LUT index\n");
goto error;
}
}
}
/* Allocate space for the channel-number to component-number LUT. */
if (!(dec->chantocmptlut = jas_alloc2(dec->numchans,
sizeof(uint_fast16_t)))) {
jas_eprintf("error: no memory\n");
goto error;
}
if (!dec->cmap) {
for (i = 0; i < dec->numchans; ++i) {
dec->chantocmptlut[i] = i;
}
} else {
cmapd = &dec->cmap->data.cmap;
pclrd = &dec->pclr->data.pclr;
cdefd = &dec->cdef->data.cdef;
for (channo = 0; channo < cmapd->numchans; ++channo) {
cmapent = &cmapd->ents[channo];
if (cmapent->map == JP2_CMAP_DIRECT) {
dec->chantocmptlut[channo] = channo;
} else if (cmapent->map == JP2_CMAP_PALETTE) {
if (!pclrd->numlutents) {
goto error;
}
lutents = jas_alloc2(pclrd->numlutents, sizeof(int_fast32_t));
if (!lutents) {
goto error;
}
for (i = 0; i < pclrd->numlutents; ++i) {
lutents[i] = pclrd->lutdata[cmapent->pcol + i * pclrd->numchans];
}
newcmptno = jas_image_numcmpts(dec->image);
jas_image_depalettize(dec->image, cmapent->cmptno,
pclrd->numlutents, lutents,
JP2_BPCTODTYPE(pclrd->bpc[cmapent->pcol]), newcmptno);
dec->chantocmptlut[channo] = newcmptno;
jas_free(lutents);
#if 0
if (dec->cdef) {
cdefent = jp2_cdef_lookup(cdefd, channo);
if (!cdefent) {
abort();
}
jas_image_setcmpttype(dec->image, newcmptno, jp2_getct(jas_image_clrspc(dec->image), cdefent->type, cdefent->assoc));
} else {
jas_image_setcmpttype(dec->image, newcmptno, jp2_getct(jas_image_clrspc(dec->image), 0, channo + 1));
}
#else
/* suppress -Wunused-but-set-variable */
(void)cdefd;
#endif
} else {
jas_eprintf("error: invalid MTYP in CMAP box\n");
goto error;
}
}
}
/* Ensure that the number of channels being used by the decoder
matches the number of image components. */
if (dec->numchans != jas_image_numcmpts(dec->image)) {
jas_eprintf("error: mismatch in number of components (%d != %d)\n",
dec->numchans, jas_image_numcmpts(dec->image));
goto error;
}
/* Mark all components as being of unknown type. */
for (i = 0; i < JAS_CAST(jas_uint, jas_image_numcmpts(dec->image)); ++i) {
jas_image_setcmpttype(dec->image, i, JAS_IMAGE_CT_UNKNOWN);
}
/* Determine the type of each component. */
if (dec->cdef) {
for (i = 0; i < dec->cdef->data.cdef.numchans; ++i) {
/* Is the channel number reasonable? */
if (dec->cdef->data.cdef.ents[i].channo >= dec->numchans) {
jas_eprintf("error: invalid channel number in CDEF box\n");
goto error;
}
jas_image_setcmpttype(dec->image,
dec->chantocmptlut[dec->cdef->data.cdef.ents[i].channo],
jp2_getct(jas_image_clrspc(dec->image),
dec->cdef->data.cdef.ents[i].type,
dec->cdef->data.cdef.ents[i].assoc));
}
} else {
for (i = 0; i < dec->numchans; ++i) {
jas_image_setcmpttype(dec->image, dec->chantocmptlut[i],
jp2_getct(jas_image_clrspc(dec->image), 0, i + 1));
}
}
/* Delete any components that are not of interest. */
for (i = jas_image_numcmpts(dec->image); i > 0; --i) {
if (jas_image_cmpttype(dec->image, i - 1) == JAS_IMAGE_CT_UNKNOWN) {
jas_image_delcmpt(dec->image, i - 1);
}
}
/* Ensure that some components survived. */
if (!jas_image_numcmpts(dec->image)) {
jas_eprintf("error: no components\n");
goto error;
}
#if 0
jas_eprintf("no of components is %d\n", jas_image_numcmpts(dec->image));
#endif
/* Prevent the image from being destroyed later. */
image = dec->image;
dec->image = 0;
jp2_dec_destroy(dec);
return image;
error:
if (box) {
jp2_box_destroy(box);
}
if (dec) {
jp2_dec_destroy(dec);
}
return 0;
} | 1929 | True | 1 |
CVE-2021-27135 | 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://www.openwall.com/lists/oss-security/2021/02/09/7', 'name': 'https://www.openwall.com/lists/oss-security/2021/02/09/7', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2021/02/09/9', 'name': 'https://www.openwall.com/lists/oss-security/2021/02/09/9', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2021/02/10/7', 'name': '[oss-security] 20210210 Re: Re: screen crash processing combining characters', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/02/msg00019.html', 'name': '[debian-lts-announce] 20210213 [SECURITY] [DLA 2558-1] xterm security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/35LK2ZXEIJUOGOA7FV2TJL3L6LFJ4X5S/', 'name': 'FEDORA-2021-e7a8e79fa8', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://invisible-island.net/xterm/xterm.log.html', 'name': 'https://invisible-island.net/xterm/xterm.log.html', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1927559', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1927559', 'refsource': 'MISC', 'tags': ['Issue Tracking']}, {'url': 'https://github.com/ThomasDickey/xterm-snapshots/commit/82ba55b8f994ab30ff561a347b82ea340ba7075c', 'name': 'https://github.com/ThomasDickey/xterm-snapshots/commit/82ba55b8f994ab30ff561a347b82ea340ba7075c', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://news.ycombinator.com/item?id=26524650', 'name': 'https://news.ycombinator.com/item?id=26524650', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-27135', 'name': 'https://access.redhat.com/security/cve/CVE-2021-27135', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugzilla.suse.com/show_bug.cgi?id=1182091', 'name': 'https://bugzilla.suse.com/show_bug.cgi?id=1182091', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking']}, {'url': 'http://seclists.org/fulldisclosure/2021/May/52', 'name': '20210520 CVE-2021-31535 libX11 Insufficient Length Checks PoC and Archeology', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202208-22', 'name': 'GLSA-202208-22', 'refsource': 'GENTOO', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-noinfo'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:invisible-island:xterm:*:*:*:*:*:*:*:*', 'versionEndExcluding': '366', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'xterm before Patch #366 allows remote attackers to execute arbitrary code or cause a denial of service (segmentation fault) via a crafted UTF-8 combining character sequence.'}] | 2022-08-15T11:15Z | 2021-02-10T16:15Z | Insufficient Information | There is insufficient information about the issue to classify it; details are unkown or unspecified. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | Thomas E. Dickey | 2021-02-09 23:04:41+00:00 | snapshot of project "xterm", label xterm-365d | 82ba55b8f994ab30ff561a347b82ea340ba7075c | False | ThomasDickey/xterm-snapshots | snapshots of releases and interim labels for "xterm" program (no pull requests) | 2016-08-07 10:42:17 | 2022-08-07 23:25:13 | http://invisible-island.net/xterm/xterm.html | ThomasDickey | 36.0 | 15.0 | SaltTextAway | SaltTextAway( XtermWidget xw , int which , CELL * cellc , CELL * cell) | ['xw', 'which', 'cellc', 'cell'] | SaltTextAway(XtermWidget xw,
int which,
CELL *cellc,
CELL *cell)
{
TScreen *screen = TScreenOf(xw);
SelectedCells *scp;
int i;
int eol;
int need = 0;
Char *line;
Char *lp;
CELL first = *cellc;
CELL last = *cell;
if (which < 0 || which >= MAX_SELECTIONS) {
TRACE(("SaltTextAway - which selection?\n"));
return;
}
scp = &(screen->selected_cells[which]);
TRACE(("SaltTextAway which=%d, first=%d,%d, last=%d,%d\n",
which, first.row, first.col, last.row, last.col));
if (isSameRow(&first, &last) && first.col > last.col) {
int tmp;
EXCHANGE(first.col, last.col, tmp);
}
--last.col;
/* first we need to know how long the string is before we can save it */
if (isSameRow(&last, &first)) {
need = Length(screen, first.row, first.col, last.col);
} else { /* two cases, cut is on same line, cut spans multiple lines */
need += Length(screen, first.row, first.col, screen->max_col) + 1;
for (i = first.row + 1; i < last.row; i++)
need += Length(screen, i, 0, screen->max_col) + 1;
if (last.col >= 0)
need += Length(screen, last.row, 0, last.col);
}
/* UTF-8 may require more space */
if_OPT_WIDE_CHARS(screen, {
need *= 4;
});
/* now get some memory to save it in */
if (need < 0)
return;
if (scp->data_limit <= (unsigned) need) {
if ((line = (Char *) malloc((size_t) need + 1)) == 0)
SysError(ERROR_BMALLOC2);
free(scp->data_buffer);
scp->data_buffer = line;
scp->data_limit = (size_t) (need + 1);
} else {
line = scp->data_buffer;
}
if (line == 0)
return;
line[need] = '\0'; /* make sure it is null terminated */
lp = line; /* lp points to where to save the text */
if (isSameRow(&last, &first)) {
lp = SaveText(screen, last.row, first.col, last.col, lp, &eol);
} else {
lp = SaveText(screen, first.row, first.col, screen->max_col, lp, &eol);
if (eol)
*lp++ = '\n'; /* put in newline at end of line */
for (i = first.row + 1; i < last.row; i++) {
lp = SaveText(screen, i, 0, screen->max_col, lp, &eol);
if (eol)
*lp++ = '\n';
}
if (last.col >= 0)
lp = SaveText(screen, last.row, 0, last.col, lp, &eol);
}
*lp = '\0'; /* make sure we have end marked */
TRACE(("Salted TEXT:%u:%s\n", (unsigned) (lp - line),
visibleChars(line, (unsigned) (lp - line))));
scp->data_length = (size_t) (lp - line);
} | 597 | True | 1 |
CVE-2021-27815 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/libexif/exif/issues/4', 'name': 'https://github.com/libexif/exif/issues/4', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/libexif/exif/commit/eb84b0e3c5f2a86013b6fcfb800d187896a648fa', 'name': 'https://github.com/libexif/exif/commit/eb84b0e3c5f2a86013b6fcfb800d187896a648fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libexif/exif/commit/f6334d9d32437ef13dc902f0a88a2be0063d9d1c', 'name': 'https://github.com/libexif/exif/commit/f6334d9d32437ef13dc902f0a88a2be0063d9d1c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/JSWAXZVNXYLV3E4R6YQTEGRGMGWEAR76/', 'name': 'FEDORA-2021-04f7b000fa', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YZQ3L45F7S7PQPG5HEHXOCGNOO64MJOS/', 'name': 'FEDORA-2021-477809f45f', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/QMC6OTXZRPCUD3LOSWO4ISR7CH7NJQDT/', 'name': 'FEDORA-2021-b2bd2b1d13', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libexif_project:exif:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.6.22', '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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'NULL Pointer Deference in the exif command line tool, when printing out XML formatted EXIF data, in exif v0.6.22 and earlier allows attackers to cause a Denial of Service (DoS) by uploading a malicious JPEG file, causing the application to crash.'}] | 2021-05-21T16:53Z | 2021-04-14T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Marcus Meissner | 2021-02-25 09:45:36+01:00 | actually return empty stringand not 'em,pty string' as expected | eb84b0e3c5f2a86013b6fcfb800d187896a648fa | False | libexif/exif | A small command-line utility to show EXIF information hidden in JPEG files | 2017-12-01 00:53:22 | 2021-10-05 11:54:09 | null | libexif | 33.0 | 16.0 | escape_xml | escape_xml( const char * text) | ['text'] | escape_xml(const char *text)
{
static char *escaped;
static size_t escaped_size;
char *out;
size_t len;
if (!strlen(text)) return "empty string";
for (out=escaped, len=0; *text; ++len, ++out, ++text) {
/* Make sure there's plenty of room for a quoted character */
if ((len + 8) > escaped_size) {
char *bigger_escaped;
escaped_size += 128;
bigger_escaped = realloc(escaped, escaped_size);
if (!bigger_escaped) {
free(escaped); /* avoid leaking memory */
escaped = NULL;
escaped_size = 0;
/* Error string is cleverly chosen to fail XML validation */
return ">>> out of memory <<<";
}
out = bigger_escaped + len;
escaped = bigger_escaped;
}
switch (*text) {
case '&':
strcpy(out, "&");
len += strlen(out) - 1;
out = escaped + len;
break;
case '<':
strcpy(out, "<");
len += strlen(out) - 1;
out = escaped + len;
break;
case '>':
strcpy(out, ">");
len += strlen(out) - 1;
out = escaped + len;
break;
default:
*out = *text;
break;
}
}
*out = '\x0'; /* NUL terminate the string */
return escaped;
} | 228 | True | 1 |
CVE-2021-28856 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/jsummers/deark/commit/62acb7753b0e3c0d3ab3c15057b0a65222313334', 'name': 'https://github.com/jsummers/deark/commit/62acb7753b0e3c0d3ab3c15057b0a65222313334', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://fatihhcelik.github.io/posts/Division-By-Zero-Deark/', 'name': 'https://fatihhcelik.github.io/posts/Division-By-Zero-Deark/', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-369'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:entropymine:deark:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.5.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In Deark before v1.5.8, a specially crafted input file can cause a division by zero in (src/fmtutil.c) because of the value of pixelsize.'}] | 2021-04-21T19:03Z | 2021-04-14T17:15Z | Divide By Zero | The product divides a value by zero. | This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.
| https://cwe.mitre.org/data/definitions/369.html | 0 | Jason Summers | 2021-03-13 07:35:56-05:00 | pict,macrsrc: Fixed a bug that could cause division by 0
Found by F. Çelik. | 62acb7753b0e3c0d3ab3c15057b0a65222313334 | False | jsummers/deark | A utility for file format and metadata analysis, data extraction, decompression, and image format decoding | 2014-04-20 20:14:04 | 2022-08-27 11:16:42 | https://entropymine.com/deark/ | jsummers | 99.0 | 9.0 | fmtutil_macbitmap_read_pixmap_only_fields | fmtutil_macbitmap_read_pixmap_only_fields( deark * c , dbuf * f , struct fmtutil_macbitmap_info * bi , i64 pos) | ['c', 'f', 'bi', 'pos'] | void fmtutil_macbitmap_read_pixmap_only_fields(deark *c, dbuf *f, struct fmtutil_macbitmap_info *bi,
i64 pos)
{
i64 pixmap_version;
i64 pack_size;
i64 plane_bytes;
i64 n;
de_dbg(c, "additional PixMap header fields, at %d", (int)pos);
de_dbg_indent(c, 1);
pixmap_version = dbuf_getu16be(f, pos+0);
de_dbg(c, "pixmap version: %d", (int)pixmap_version);
bi->packing_type = dbuf_getu16be(f, pos+2);
de_dbg(c, "packing type: %d", (int)bi->packing_type);
pack_size = dbuf_getu32be(f, pos+4);
de_dbg(c, "pixel data length: %d", (int)pack_size);
bi->hdpi = pict_read_fixed(f, pos+8);
bi->vdpi = pict_read_fixed(f, pos+12);
de_dbg(c, "dpi: %.2f"DE_CHAR_TIMES"%.2f", bi->hdpi, bi->vdpi);
bi->pixeltype = dbuf_getu16be(f, pos+16);
bi->pixelsize = dbuf_getu16be(f, pos+18);
bi->cmpcount = dbuf_getu16be(f, pos+20);
bi->cmpsize = dbuf_getu16be(f, pos+22);
de_dbg(c, "pixel type=%d, bits/pixel=%d, components/pixel=%d, bits/comp=%d",
(int)bi->pixeltype, (int)bi->pixelsize, (int)bi->cmpcount, (int)bi->cmpsize);
bi->pdwidth = (bi->rowbytes*8)/bi->pixelsize;
if(bi->pdwidth < bi->npwidth) {
bi->pdwidth = bi->npwidth;
}
plane_bytes = dbuf_getu32be(f, pos+24);
de_dbg(c, "plane bytes: %d", (int)plane_bytes);
bi->pmTable = (u32)dbuf_getu32be(f, pos+28);
de_dbg(c, "pmTable: 0x%08x", (unsigned int)bi->pmTable);
n = dbuf_getu32be(f, pos+32);
de_dbg(c, "pmReserved: 0x%08x", (unsigned int)n);
de_dbg_indent(c, -1);
} | 376 | True | 1 |
CVE-2021-30027 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/mity/md4c/commit/4fc808d8fe8d8904f8525bb4231d854f45e23a19', 'name': 'https://github.com/mity/md4c/commit/4fc808d8fe8d8904f8525bb4231d854f45e23a19', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/mity/md4c/issues/155', 'name': 'https://github.com/mity/md4c/issues/155', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-908'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:md4c_project:md4c:0.4.7:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'md_analyze_line in md4c.c in md4c 0.4.7 allows attackers to trigger use of uninitialized memory, and cause a denial of service via a malformed Markdown document.'}] | 2021-05-09T01:25Z | 2021-04-29T15:15Z | Use of Uninitialized Resource | The software uses or accesses a resource that has not been initialized. | When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
| https://cwe.mitre.org/data/definitions/908.html | 0 | Martin Mitas | 2021-03-29 12:51:48+02:00 | md_analyze_line: Avoid reading 1 byte beyond the input size.
Fixes #155. | 4fc808d8fe8d8904f8525bb4231d854f45e23a19 | False | mity/md4c | C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification. | 2016-10-03 18:23:22 | 2022-08-23 16:12:58 | mity | 491.0 | 98.0 | md_analyze_line | md_analyze_line( MD_CTX * ctx , OFF beg , OFF * p_end , const MD_LINE_ANALYSIS * pivot_line , MD_LINE_ANALYSIS * line) | ['ctx', 'beg', 'p_end', 'pivot_line', 'line'] | md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
const MD_LINE_ANALYSIS* pivot_line, MD_LINE_ANALYSIS* line)
{
unsigned total_indent = 0;
int n_parents = 0;
int n_brothers = 0;
int n_children = 0;
MD_CONTAINER container = { 0 };
int prev_line_has_list_loosening_effect = ctx->last_line_has_list_loosening_effect;
OFF off = beg;
OFF hr_killer = 0;
int ret = 0;
line->indent = md_line_indentation(ctx, total_indent, off, &off);
total_indent += line->indent;
line->beg = off;
/* Given the indentation and block quote marks '>', determine how many of
* the current containers are our parents. */
while(n_parents < ctx->n_containers) {
MD_CONTAINER* c = &ctx->containers[n_parents];
if(c->ch == _T('>') && line->indent < ctx->code_indent_offset &&
off < ctx->size && CH(off) == _T('>'))
{
/* Block quote mark. */
off++;
total_indent++;
line->indent = md_line_indentation(ctx, total_indent, off, &off);
total_indent += line->indent;
/* The optional 1st space after '>' is part of the block quote mark. */
if(line->indent > 0)
line->indent--;
line->beg = off;
} else if(c->ch != _T('>') && line->indent >= c->contents_indent) {
/* List. */
line->indent -= c->contents_indent;
} else {
break;
}
n_parents++;
}
if(off >= ctx->size || ISNEWLINE(off)) {
/* Blank line does not need any real indentation to be nested inside
* a list. */
if(n_brothers + n_children == 0) {
while(n_parents < ctx->n_containers && ctx->containers[n_parents].ch != _T('>'))
n_parents++;
}
}
while(TRUE) {
/* Check whether we are fenced code continuation. */
if(pivot_line->type == MD_LINE_FENCEDCODE) {
line->beg = off;
/* We are another MD_LINE_FENCEDCODE unless we are closing fence
* which we transform into MD_LINE_BLANK. */
if(line->indent < ctx->code_indent_offset) {
if(md_is_closing_code_fence(ctx, CH(pivot_line->beg), off, &off)) {
line->type = MD_LINE_BLANK;
ctx->last_line_has_list_loosening_effect = FALSE;
break;
}
}
/* Change indentation accordingly to the initial code fence. */
if(n_parents == ctx->n_containers) {
if(line->indent > pivot_line->indent)
line->indent -= pivot_line->indent;
else
line->indent = 0;
line->type = MD_LINE_FENCEDCODE;
break;
}
}
/* Check whether we are HTML block continuation. */
if(pivot_line->type == MD_LINE_HTML && ctx->html_block_type > 0) {
if(n_parents < ctx->n_containers) {
/* HTML block is implicitly ended if the enclosing container
* block ends. */
ctx->html_block_type = 0;
} else {
int html_block_type;
html_block_type = md_is_html_block_end_condition(ctx, off, &off);
if(html_block_type > 0) {
MD_ASSERT(html_block_type == ctx->html_block_type);
/* Make sure this is the last line of the block. */
ctx->html_block_type = 0;
/* Some end conditions serve as blank lines at the same time. */
if(html_block_type == 6 || html_block_type == 7) {
line->type = MD_LINE_BLANK;
line->indent = 0;
break;
}
}
line->type = MD_LINE_HTML;
n_parents = ctx->n_containers;
break;
}
}
/* Check for blank line. */
if(off >= ctx->size || ISNEWLINE(off)) {
if(pivot_line->type == MD_LINE_INDENTEDCODE && n_parents == ctx->n_containers) {
line->type = MD_LINE_INDENTEDCODE;
if(line->indent > ctx->code_indent_offset)
line->indent -= ctx->code_indent_offset;
else
line->indent = 0;
ctx->last_line_has_list_loosening_effect = FALSE;
} else {
line->type = MD_LINE_BLANK;
ctx->last_line_has_list_loosening_effect = (n_parents > 0 &&
n_brothers + n_children == 0 &&
ctx->containers[n_parents-1].ch != _T('>'));
#if 1
/* See https://github.com/mity/md4c/issues/6
*
* This ugly checking tests we are in (yet empty) list item but
* not its very first line (i.e. not the line with the list
* item mark).
*
* If we are such a blank line, then any following non-blank
* line which would be part of the list item actually has to
* end the list because according to the specification, "a list
* item can begin with at most one blank line."
*/
if(n_parents > 0 && ctx->containers[n_parents-1].ch != _T('>') &&
n_brothers + n_children == 0 && ctx->current_block == NULL &&
ctx->n_block_bytes > (int) sizeof(MD_BLOCK))
{
MD_BLOCK* top_block = (MD_BLOCK*) ((char*)ctx->block_bytes + ctx->n_block_bytes - sizeof(MD_BLOCK));
if(top_block->type == MD_BLOCK_LI)
ctx->last_list_item_starts_with_two_blank_lines = TRUE;
}
#endif
}
break;
} else {
#if 1
/* This is the 2nd half of the hack. If the flag is set (i.e. there
* was a 2nd blank line at the beginning of the list item) and if
* we would otherwise still belong to the list item, we enforce
* the end of the list. */
ctx->last_line_has_list_loosening_effect = FALSE;
if(ctx->last_list_item_starts_with_two_blank_lines) {
if(n_parents > 0 && ctx->containers[n_parents-1].ch != _T('>') &&
n_brothers + n_children == 0 && ctx->current_block == NULL &&
ctx->n_block_bytes > (int) sizeof(MD_BLOCK))
{
MD_BLOCK* top_block = (MD_BLOCK*) ((char*)ctx->block_bytes + ctx->n_block_bytes - sizeof(MD_BLOCK));
if(top_block->type == MD_BLOCK_LI)
n_parents--;
}
ctx->last_list_item_starts_with_two_blank_lines = FALSE;
}
#endif
}
/* Check whether we are Setext underline. */
if(line->indent < ctx->code_indent_offset && pivot_line->type == MD_LINE_TEXT
&& (CH(off) == _T('=') || CH(off) == _T('-'))
&& (n_parents == ctx->n_containers))
{
unsigned level;
if(md_is_setext_underline(ctx, off, &off, &level)) {
line->type = MD_LINE_SETEXTUNDERLINE;
line->data = level;
break;
}
}
/* Check for thematic break line. */
if(line->indent < ctx->code_indent_offset && ISANYOF(off, _T("-_*")) && off >= hr_killer) {
if(md_is_hr_line(ctx, off, &off, &hr_killer)) {
line->type = MD_LINE_HR;
break;
}
}
/* Check for "brother" container. I.e. whether we are another list item
* in already started list. */
if(n_parents < ctx->n_containers && n_brothers + n_children == 0) {
OFF tmp;
if(md_is_container_mark(ctx, line->indent, off, &tmp, &container) &&
md_is_container_compatible(&ctx->containers[n_parents], &container))
{
pivot_line = &md_dummy_blank_line;
off = tmp;
total_indent += container.contents_indent - container.mark_indent;
line->indent = md_line_indentation(ctx, total_indent, off, &off);
total_indent += line->indent;
line->beg = off;
/* Some of the following whitespace actually still belongs to the mark. */
if(off >= ctx->size || ISNEWLINE(off)) {
container.contents_indent++;
} else if(line->indent <= ctx->code_indent_offset) {
container.contents_indent += line->indent;
line->indent = 0;
} else {
container.contents_indent += 1;
line->indent--;
}
ctx->containers[n_parents].mark_indent = container.mark_indent;
ctx->containers[n_parents].contents_indent = container.contents_indent;
n_brothers++;
continue;
}
}
/* Check for indented code.
* Note indented code block cannot interrupt a paragraph. */
if(line->indent >= ctx->code_indent_offset &&
(pivot_line->type == MD_LINE_BLANK || pivot_line->type == MD_LINE_INDENTEDCODE))
{
line->type = MD_LINE_INDENTEDCODE;
MD_ASSERT(line->indent >= ctx->code_indent_offset);
line->indent -= ctx->code_indent_offset;
line->data = 0;
break;
}
/* Check for start of a new container block. */
if(line->indent < ctx->code_indent_offset &&
md_is_container_mark(ctx, line->indent, off, &off, &container))
{
if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers &&
(off >= ctx->size || ISNEWLINE(off)) && container.ch != _T('>'))
{
/* Noop. List mark followed by a blank line cannot interrupt a paragraph. */
} else if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers &&
(container.ch == _T('.') || container.ch == _T(')')) && container.start != 1)
{
/* Noop. Ordered list cannot interrupt a paragraph unless the start index is 1. */
} else {
total_indent += container.contents_indent - container.mark_indent;
line->indent = md_line_indentation(ctx, total_indent, off, &off);
total_indent += line->indent;
line->beg = off;
line->data = container.ch;
/* Some of the following whitespace actually still belongs to the mark. */
if(off >= ctx->size || ISNEWLINE(off)) {
container.contents_indent++;
} else if(line->indent <= ctx->code_indent_offset) {
container.contents_indent += line->indent;
line->indent = 0;
} else {
container.contents_indent += 1;
line->indent--;
}
if(n_brothers + n_children == 0)
pivot_line = &md_dummy_blank_line;
if(n_children == 0)
MD_CHECK(md_leave_child_containers(ctx, n_parents + n_brothers));
n_children++;
MD_CHECK(md_push_container(ctx, &container));
continue;
}
}
/* Check whether we are table continuation. */
if(pivot_line->type == MD_LINE_TABLE && n_parents == ctx->n_containers) {
line->type = MD_LINE_TABLE;
break;
}
/* Check for ATX header. */
if(line->indent < ctx->code_indent_offset && CH(off) == _T('#')) {
unsigned level;
if(md_is_atxheader_line(ctx, off, &line->beg, &off, &level)) {
line->type = MD_LINE_ATXHEADER;
line->data = level;
break;
}
}
/* Check whether we are starting code fence. */
if(CH(off) == _T('`') || CH(off) == _T('~')) {
if(md_is_opening_code_fence(ctx, off, &off)) {
line->type = MD_LINE_FENCEDCODE;
line->data = 1;
break;
}
}
/* Check for start of raw HTML block. */
if(CH(off) == _T('<') && !(ctx->parser.flags & MD_FLAG_NOHTMLBLOCKS))
{
ctx->html_block_type = md_is_html_block_start_condition(ctx, off);
/* HTML block type 7 cannot interrupt paragraph. */
if(ctx->html_block_type == 7 && pivot_line->type == MD_LINE_TEXT)
ctx->html_block_type = 0;
if(ctx->html_block_type > 0) {
/* The line itself also may immediately close the block. */
if(md_is_html_block_end_condition(ctx, off, &off) == ctx->html_block_type) {
/* Make sure this is the last line of the block. */
ctx->html_block_type = 0;
}
line->type = MD_LINE_HTML;
break;
}
}
/* Check for table underline. */
if((ctx->parser.flags & MD_FLAG_TABLES) && pivot_line->type == MD_LINE_TEXT &&
(CH(off) == _T('|') || CH(off) == _T('-') || CH(off) == _T(':')) &&
n_parents == ctx->n_containers)
{
unsigned col_count;
if(ctx->current_block != NULL && ctx->current_block->n_lines == 1 &&
md_is_table_underline(ctx, off, &off, &col_count))
{
line->data = col_count;
line->type = MD_LINE_TABLEUNDERLINE;
break;
}
}
/* By default, we are normal text line. */
line->type = MD_LINE_TEXT;
if(pivot_line->type == MD_LINE_TEXT && n_brothers + n_children == 0) {
/* Lazy continuation. */
n_parents = ctx->n_containers;
}
/* Check for task mark. */
if((ctx->parser.flags & MD_FLAG_TASKLISTS) && n_brothers + n_children > 0 &&
ISANYOF_(ctx->containers[ctx->n_containers-1].ch, _T("-+*.)")))
{
OFF tmp = off;
while(tmp < ctx->size && tmp < off + 3 && ISBLANK(tmp))
tmp++;
if(tmp + 2 < ctx->size && CH(tmp) == _T('[') &&
ISANYOF(tmp+1, _T("xX ")) && CH(tmp+2) == _T(']') &&
(tmp + 3 == ctx->size || ISBLANK(tmp+3) || ISNEWLINE(tmp+3)))
{
MD_CONTAINER* task_container = (n_children > 0 ? &ctx->containers[ctx->n_containers-1] : &container);
task_container->is_task = TRUE;
task_container->task_mark_off = tmp + 1;
off = tmp + 3;
while(ISWHITESPACE(off))
off++;
line->beg = off;
}
}
break;
}
/* Scan for end of the line.
*
* Note this is quite a bottleneck of the parsing as we here iterate almost
* over compete document.
*/
#if defined __linux__ && !defined MD4C_USE_UTF16
/* Recent glibc versions have superbly optimized strcspn(), even using
* vectorization if available. */
if(ctx->doc_ends_with_newline && off < ctx->size) {
while(TRUE) {
off += (OFF) strcspn(STR(off), "\r\n");
/* strcspn() can stop on zero terminator; but that can appear
* anywhere in the Markfown input... */
if(CH(off) == _T('\0'))
off++;
else
break;
}
} else
#endif
{
/* Optimization: Use some loop unrolling. */
while(off + 3 < ctx->size && !ISNEWLINE(off+0) && !ISNEWLINE(off+1)
&& !ISNEWLINE(off+2) && !ISNEWLINE(off+3))
off += 4;
while(off < ctx->size && !ISNEWLINE(off))
off++;
}
/* Set end of the line. */
line->end = off;
/* But for ATX header, we should exclude the optional trailing mark. */
if(line->type == MD_LINE_ATXHEADER) {
OFF tmp = line->end;
while(tmp > line->beg && CH(tmp-1) == _T(' '))
tmp--;
while(tmp > line->beg && CH(tmp-1) == _T('#'))
tmp--;
if(tmp == line->beg || CH(tmp-1) == _T(' ') || (ctx->parser.flags & MD_FLAG_PERMISSIVEATXHEADERS))
line->end = tmp;
}
/* Trim trailing spaces. */
if(line->type != MD_LINE_INDENTEDCODE && line->type != MD_LINE_FENCEDCODE) {
while(line->end > line->beg && CH(line->end-1) == _T(' '))
line->end--;
}
/* Eat also the new line. */
if(off < ctx->size && CH(off) == _T('\r'))
off++;
if(off < ctx->size && CH(off) == _T('\n'))
off++;
*p_end = off;
/* If we belong to a list after seeing a blank line, the list is loose. */
if(prev_line_has_list_loosening_effect && line->type != MD_LINE_BLANK && n_parents + n_brothers > 0) {
MD_CONTAINER* c = &ctx->containers[n_parents + n_brothers - 1];
if(c->ch != _T('>')) {
MD_BLOCK* block = (MD_BLOCK*) (((char*)ctx->block_bytes) + c->block_byte_off);
block->flags |= MD_BLOCK_LOOSE_LIST;
}
}
/* Leave any containers we are not part of anymore. */
if(n_children == 0 && n_parents + n_brothers < ctx->n_containers)
MD_CHECK(md_leave_child_containers(ctx, n_parents + n_brothers));
/* Enter any container we found a mark for. */
if(n_brothers > 0) {
MD_ASSERT(n_brothers == 1);
MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
ctx->containers[n_parents].task_mark_off,
(ctx->containers[n_parents].is_task ? CH(ctx->containers[n_parents].task_mark_off) : 0),
MD_BLOCK_CONTAINER_CLOSER));
MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
container.task_mark_off,
(container.is_task ? CH(container.task_mark_off) : 0),
MD_BLOCK_CONTAINER_OPENER));
ctx->containers[n_parents].is_task = container.is_task;
ctx->containers[n_parents].task_mark_off = container.task_mark_off;
}
if(n_children > 0)
MD_CHECK(md_enter_child_containers(ctx, n_children));
abort:
return ret;
} | 2609 | True | 1 |
|
CVE-2021-30218 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/michaelforney/samurai/commit/e84b6d99c85043fa1ba54851ee500540ec206918', 'name': 'https://github.com/michaelforney/samurai/commit/e84b6d99c85043fa1ba54851ee500540ec206918', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/michaelforney/samurai/issues/67', 'name': 'https://github.com/michaelforney/samurai/issues/67', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:samurai_project:samurai:1.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'samurai 1.2 has a NULL pointer dereference in writefile() in util.c via a crafted build file.'}] | 2021-05-03T18:02Z | 2021-04-29T15:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Michael Forney | 2021-04-02 17:27:48-07:00 | util: Check for NULL string in writefile
This check was there previously, but was removed in f549b757 with
the addition of a check during parse that every rule has rspfile
if and only if it has rspfile_content. However, this fails to
consider the possibility of those variables coming from the edge
or global environment. So, re-add the check.
Fixes #67. | e84b6d99c85043fa1ba54851ee500540ec206918 | False | michaelforney/samurai | ninja-compatible build tool written in C | 2017-07-15 23:17:43 | 2022-07-21 15:24:22 | michaelforney | 627.0 | 37.0 | writefile | writefile( const char * name , struct string * s) | ['name', 's'] | writefile(const char *name, struct string *s)
{
FILE *f;
int ret;
f = fopen(name, "w");
if (!f) {
warn("open %s:", name);
return -1;
}
ret = 0;
if (fwrite(s->s, 1, s->n, f) != s->n || fflush(f) != 0) {
warn("write %s:", name);
ret = -1;
}
fclose(f);
return ret;
} | 102 | True | 1 |
|
CVE-2021-3119 | 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.telekom.com/resource/blob/621186/3fb50ca7a4a97728be18717ed7b0062c/dl-210308-critical-dos-vulnerability-in-sqlcipher-sql-command-processing-data.pdf', 'name': 'https://www.telekom.com/resource/blob/621186/3fb50ca7a4a97728be18717ed7b0062c/dl-210308-critical-dos-vulnerability-in-sqlcipher-sql-command-processing-data.pdf', 'refsource': 'MISC', 'tags': ['Exploit', 'Vendor Advisory']}, {'url': 'https://github.com/sqlcipher/sqlcipher/commit/cb71f53e8cea4802509f182fa5bead0ac6ab0e7f#diff-9305215a9a0ea69300281fc4af90bc7f3437e34a0e1745d030213152993ddae4', 'name': 'https://github.com/sqlcipher/sqlcipher/commit/cb71f53e8cea4802509f182fa5bead0ac6ab0e7f#diff-9305215a9a0ea69300281fc4af90bc7f3437e34a0e1745d030213152993ddae4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:zetetic:sqlcipher:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.0', 'versionEndExcluding': '4.4.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Zetetic SQLCipher 4.x before 4.4.3 has a NULL pointer dereferencing issue related to sqlcipher_export in crypto.c and sqlite3StrICmp in sqlite3.c. This may allow an attacker to perform a remote denial of service attack. For example, an SQL injection can be used to execute the crafted SQL command sequence, which causes a segmentation fault.'}] | 2022-05-03T16:04Z | 2021-03-25T23:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Stephen Lombardo | 2021-01-13 17:24:33-05:00 | fix sqlcipher_export handling of NULL parameters | cb71f53e8cea4802509f182fa5bead0ac6ab0e7f | False | sqlcipher/sqlcipher | SQLCipher is a standalone fork of SQLite that adds 256 bit AES encryption of database files and other security features. | 2008-07-30 17:20:41 | 2022-08-03 14:27:58 | https://www.zetetic.net/sqlcipher/ | sqlcipher | 5113.0 | 1172.0 | sqlcipher_exportFunc | sqlcipher_exportFunc( sqlite3_context * context , int argc , sqlite3_value ** argv) | ['context', 'argc', 'argv'] | void sqlcipher_exportFunc(sqlite3_context *context, int argc, sqlite3_value **argv) {
sqlite3 *db = sqlite3_context_db_handle(context);
const char* targetDb, *sourceDb;
int targetDb_idx = 0;
u64 saved_flags = db->flags; /* Saved value of the db->flags */
u32 saved_mDbFlags = db->mDbFlags; /* Saved value of the db->mDbFlags */
int saved_nChange = db->nChange; /* Saved value of db->nChange */
int saved_nTotalChange = db->nTotalChange; /* Saved value of db->nTotalChange */
u8 saved_mTrace = db->mTrace; /* Saved value of db->mTrace */
int rc = SQLITE_OK; /* Return code from service routines */
char *zSql = NULL; /* SQL statements */
char *pzErrMsg = NULL;
if(argc != 1 && argc != 2) {
rc = SQLITE_ERROR;
pzErrMsg = sqlite3_mprintf("invalid number of arguments (%d) passed to sqlcipher_export", argc);
goto end_of_export;
}
targetDb = (const char*) sqlite3_value_text(argv[0]);
sourceDb = (argc == 2) ? (char *) sqlite3_value_text(argv[1]) : "main";
/* if the name of the target is not main, but the index returned is zero
there is a mismatch and we should not proceed */
targetDb_idx = sqlcipher_find_db_index(db, targetDb);
if(targetDb_idx == 0 && sqlite3StrICmp("main", targetDb) != 0) {
rc = SQLITE_ERROR;
pzErrMsg = sqlite3_mprintf("unknown database %s", targetDb);
goto end_of_export;
}
db->init.iDb = targetDb_idx;
db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks;
db->mDbFlags |= DBFLAG_PreferBuiltin | DBFLAG_Vacuum;
db->flags &= ~(u64)(SQLITE_ForeignKeys | SQLITE_ReverseOrder | SQLITE_Defensive | SQLITE_CountRows);
db->mTrace = 0;
/* Query the schema of the main database. Create a mirror schema
** in the temporary database.
*/
zSql = sqlite3_mprintf(
"SELECT sql "
" FROM %s.sqlite_master WHERE type='table' AND name!='sqlite_sequence'"
" AND rootpage>0"
, sourceDb);
rc = (zSql == NULL) ? SQLITE_NOMEM : sqlcipher_execExecSql(db, &pzErrMsg, zSql);
if( rc!=SQLITE_OK ) goto end_of_export;
sqlite3_free(zSql);
zSql = sqlite3_mprintf(
"SELECT sql "
" FROM %s.sqlite_master WHERE sql LIKE 'CREATE INDEX %%' "
, sourceDb);
rc = (zSql == NULL) ? SQLITE_NOMEM : sqlcipher_execExecSql(db, &pzErrMsg, zSql);
if( rc!=SQLITE_OK ) goto end_of_export;
sqlite3_free(zSql);
zSql = sqlite3_mprintf(
"SELECT sql "
" FROM %s.sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %%'"
, sourceDb);
rc = (zSql == NULL) ? SQLITE_NOMEM : sqlcipher_execExecSql(db, &pzErrMsg, zSql);
if( rc!=SQLITE_OK ) goto end_of_export;
sqlite3_free(zSql);
/* Loop through the tables in the main database. For each, do
** an "INSERT INTO rekey_db.xxx SELECT * FROM main.xxx;" to copy
** the contents to the temporary database.
*/
zSql = sqlite3_mprintf(
"SELECT 'INSERT INTO %s.' || quote(name) "
"|| ' SELECT * FROM %s.' || quote(name) || ';'"
"FROM %s.sqlite_master "
"WHERE type = 'table' AND name!='sqlite_sequence' "
" AND rootpage>0"
, targetDb, sourceDb, sourceDb);
rc = (zSql == NULL) ? SQLITE_NOMEM : sqlcipher_execExecSql(db, &pzErrMsg, zSql);
if( rc!=SQLITE_OK ) goto end_of_export;
sqlite3_free(zSql);
/* Copy over the contents of the sequence table
*/
zSql = sqlite3_mprintf(
"SELECT 'INSERT INTO %s.' || quote(name) "
"|| ' SELECT * FROM %s.' || quote(name) || ';' "
"FROM %s.sqlite_master WHERE name=='sqlite_sequence';"
, targetDb, sourceDb, targetDb);
rc = (zSql == NULL) ? SQLITE_NOMEM : sqlcipher_execExecSql(db, &pzErrMsg, zSql);
if( rc!=SQLITE_OK ) goto end_of_export;
sqlite3_free(zSql);
/* Copy the triggers, views, and virtual tables from the main database
** over to the temporary database. None of these objects has any
** associated storage, so all we have to do is copy their entries
** from the SQLITE_MASTER table.
*/
zSql = sqlite3_mprintf(
"INSERT INTO %s.sqlite_master "
" SELECT type, name, tbl_name, rootpage, sql"
" FROM %s.sqlite_master"
" WHERE type='view' OR type='trigger'"
" OR (type='table' AND rootpage=0)"
, targetDb, sourceDb);
rc = (zSql == NULL) ? SQLITE_NOMEM : sqlcipher_execSql(db, &pzErrMsg, zSql);
if( rc!=SQLITE_OK ) goto end_of_export;
sqlite3_free(zSql);
zSql = NULL;
end_of_export:
db->init.iDb = 0;
db->flags = saved_flags;
db->mDbFlags = saved_mDbFlags;
db->nChange = saved_nChange;
db->nTotalChange = saved_nTotalChange;
db->mTrace = saved_mTrace;
if(zSql) sqlite3_free(zSql);
if(rc) {
if(pzErrMsg != NULL) {
sqlite3_result_error(context, pzErrMsg, -1);
sqlite3DbFree(db, pzErrMsg);
} else {
sqlite3_result_error(context, sqlite3ErrStr(rc), -1);
}
}
} | 625 | True | 1 |
CVE-2021-32020 | 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/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'name': 'https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:amazon:freertos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.4.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The kernel in Amazon Web Services FreeRTOS before 10.4.3 has insufficient bounds checking during management of heap memory.'}] | 2021-05-12T13:23Z | 2021-05-03T22: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 | Cobus van Eeden | 2020-12-07 10:36:27-08:00 | Improve heap2 bounds checking (#224)
* Improve heap bounds checking in pvPortMalloc | c7a9a01c94987082b223d3e59969ede64363da63 | False | FreeRTOS/FreeRTOS-Kernel | FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos. | 2019-09-09 16:28:01 | 2022-08-27 17:10:07 | https://www.FreeRTOS.org | FreeRTOS | 1154.0 | 619.0 | pvPortMalloc | pvPortMalloc( size_t xWantedSize) | ['xWantedSize'] | void * pvPortMalloc( size_t xWantedSize )
{
void * pvReturn = NULL;
static uint8_t * pucAlignedHeap = NULL;
/* Ensure that blocks are always aligned to the required number of bytes. */
#if ( portBYTE_ALIGNMENT != 1 )
{
if( xWantedSize & portBYTE_ALIGNMENT_MASK )
{
/* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
}
}
#endif
vTaskSuspendAll();
{
if( pucAlignedHeap == NULL )
{
/* Ensure the heap starts on a correctly aligned boundary. */
pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap[ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
}
/* Check there is enough room left for the allocation. */
if( ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) &&
( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) ) /* Check for overflow. */
{
/* Return the next free byte then increment the index past this
* block. */
pvReturn = pucAlignedHeap + xNextFreeByte;
xNextFreeByte += xWantedSize;
}
traceMALLOC( pvReturn, xWantedSize );
}
( void ) xTaskResumeAll();
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
extern void vApplicationMallocFailedHook( void );
vApplicationMallocFailedHook();
}
}
#endif
return pvReturn;
}
| 156 | True | 1 |
CVE-2021-32020 | 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/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'name': 'https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:amazon:freertos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.4.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The kernel in Amazon Web Services FreeRTOS before 10.4.3 has insufficient bounds checking during management of heap memory.'}] | 2021-05-12T13:23Z | 2021-05-03T22: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 | Cobus van Eeden | 2020-12-07 10:36:27-08:00 | Improve heap2 bounds checking (#224)
* Improve heap bounds checking in pvPortMalloc | c7a9a01c94987082b223d3e59969ede64363da63 | False | FreeRTOS/FreeRTOS-Kernel | FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos. | 2019-09-09 16:28:01 | 2022-08-27 17:10:07 | https://www.FreeRTOS.org | FreeRTOS | 1154.0 | 619.0 | pvPortMalloc | pvPortMalloc(size_t xWantedSize) | [] | void * pvPortMalloc( size_t xWantedSize )
{
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
static BaseType_t xHeapHasBeenInitialised = pdFALSE;
void * pvReturn = NULL;
vTaskSuspendAll();
{
/* If this is the first call to malloc then the heap will require
* initialisation to setup the list of free blocks. */
if( xHeapHasBeenInitialised == pdFALSE )
{
prvHeapInit();
xHeapHasBeenInitialised = pdTRUE;
}
/* The wanted size is increased so it can contain a BlockLink_t
* structure in addition to the requested amount of bytes. */
if( xWantedSize > 0 )
{
xWantedSize += heapSTRUCT_SIZE;
/* Ensure that blocks are always aligned to the required number of bytes. */
if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0 )
{
/* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
}
}
if( ( xWantedSize > 0 ) && ( xWantedSize < configADJUSTED_HEAP_SIZE ) )
{
/* Blocks are stored in byte order - traverse the list from the start
* (smallest) block until one of adequate size is found. */
pxPreviousBlock = &xStart;
pxBlock = xStart.pxNextFreeBlock;
while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
{
pxPreviousBlock = pxBlock;
pxBlock = pxBlock->pxNextFreeBlock;
}
/* If we found the end marker then a block of adequate size was not found. */
if( pxBlock != &xEnd )
{
/* Return the memory space - jumping over the BlockLink_t structure
* at its start. */
pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + heapSTRUCT_SIZE );
/* This block is being returned for use so must be taken out of the
* list of free blocks. */
pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;
/* If the block is larger than required it can be split into two. */
if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
{
/* This block is to be split into two. Create a new block
* following the number of bytes requested. The void cast is
* used to prevent byte alignment warnings from the compiler. */
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
/* Calculate the sizes of two blocks split from the single
* block. */
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
pxBlock->xBlockSize = xWantedSize;
/* Insert the new block into the list of free blocks. */
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
}
xFreeBytesRemaining -= pxBlock->xBlockSize;
}
}
traceMALLOC( pvReturn, xWantedSize );
}
( void ) xTaskResumeAll();
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
extern void vApplicationMallocFailedHook( void );
vApplicationMallocFailedHook();
}
}
#endif
return pvReturn;
}
| 280 | True | 1 |
CVE-2021-32020 | 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/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'name': 'https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:amazon:freertos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.4.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The kernel in Amazon Web Services FreeRTOS before 10.4.3 has insufficient bounds checking during management of heap memory.'}] | 2021-05-12T13:23Z | 2021-05-03T22: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 | Cobus van Eeden | 2020-12-07 10:36:27-08:00 | Improve heap2 bounds checking (#224)
* Improve heap bounds checking in pvPortMalloc | c7a9a01c94987082b223d3e59969ede64363da63 | False | FreeRTOS/FreeRTOS-Kernel | FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos. | 2019-09-09 16:28:01 | 2022-08-27 17:10:07 | https://www.FreeRTOS.org | FreeRTOS | 1154.0 | 619.0 | pvPortMalloc | pvPortMalloc( size_t xWantedSize) | ['xWantedSize'] | void * pvPortMalloc( size_t xWantedSize )
{
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
void * pvReturn = NULL;
vTaskSuspendAll();
{
/* If this is the first call to malloc then the heap will require
* initialisation to setup the list of free blocks. */
if( pxEnd == NULL )
{
prvHeapInit();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
/* Check the requested block size is not so large that the top bit is
* set. The top bit of the block size member of the BlockLink_t structure
* is used to determine who owns the block - the application or the
* kernel, so it must be free. */
if( ( xWantedSize & xBlockAllocatedBit ) == 0 )
{
/* The wanted size is increased so it can contain a BlockLink_t
* structure in addition to the requested amount of bytes. */
if( xWantedSize > 0 )
{
xWantedSize += xHeapStructSize;
/* Ensure that blocks are always aligned to the required number
* of bytes. */
if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
{
/* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
{
/* Traverse the list from the start (lowest address) block until
* one of adequate size is found. */
pxPreviousBlock = &xStart;
pxBlock = xStart.pxNextFreeBlock;
while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
{
pxPreviousBlock = pxBlock;
pxBlock = pxBlock->pxNextFreeBlock;
}
/* If the end marker was reached then a block of adequate size
* was not found. */
if( pxBlock != pxEnd )
{
/* Return the memory space pointed to - jumping over the
* BlockLink_t structure at its start. */
pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
/* This block is being returned for use so must be taken out
* of the list of free blocks. */
pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;
/* If the block is larger than required it can be split into
* two. */
if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
{
/* This block is to be split into two. Create a new
* block following the number of bytes requested. The void
* cast is used to prevent byte alignment warnings from the
* compiler. */
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );
/* Calculate the sizes of two blocks split from the
* single block. */
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
pxBlock->xBlockSize = xWantedSize;
/* Insert the new block into the list of free blocks. */
prvInsertBlockIntoFreeList( pxNewBlockLink );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
xFreeBytesRemaining -= pxBlock->xBlockSize;
if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )
{
xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
/* The block is being returned - it is allocated and owned
* by the application and has no "next" block. */
pxBlock->xBlockSize |= xBlockAllocatedBit;
pxBlock->pxNextFreeBlock = NULL;
xNumberOfSuccessfulAllocations++;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
traceMALLOC( pvReturn, xWantedSize );
}
( void ) xTaskResumeAll();
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
extern void vApplicationMallocFailedHook( void );
vApplicationMallocFailedHook();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
#endif /* if ( configUSE_MALLOC_FAILED_HOOK == 1 ) */
configASSERT( ( ( ( size_t ) pvReturn ) & ( size_t ) portBYTE_ALIGNMENT_MASK ) == 0 );
return pvReturn;
}
| 414 | True | 1 |
CVE-2021-32020 | 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/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'name': 'https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/c7a9a01c94987082b223d3e59969ede64363da63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:amazon:freertos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.4.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The kernel in Amazon Web Services FreeRTOS before 10.4.3 has insufficient bounds checking during management of heap memory.'}] | 2021-05-12T13:23Z | 2021-05-03T22: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 | Cobus van Eeden | 2020-12-07 10:36:27-08:00 | Improve heap2 bounds checking (#224)
* Improve heap bounds checking in pvPortMalloc | c7a9a01c94987082b223d3e59969ede64363da63 | False | FreeRTOS/FreeRTOS-Kernel | FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos. | 2019-09-09 16:28:01 | 2022-08-27 17:10:07 | https://www.FreeRTOS.org | FreeRTOS | 1154.0 | 619.0 | pvPortMalloc | pvPortMalloc( size_t xWantedSize) | ['xWantedSize'] | void * pvPortMalloc( size_t xWantedSize )
{
BlockLink_t * pxBlock, * pxPreviousBlock, * pxNewBlockLink;
void * pvReturn = NULL;
/* The heap must be initialised before the first call to
* prvPortMalloc(). */
configASSERT( pxEnd );
vTaskSuspendAll();
{
/* Check the requested block size is not so large that the top bit is
* set. The top bit of the block size member of the BlockLink_t structure
* is used to determine who owns the block - the application or the
* kernel, so it must be free. */
if( ( xWantedSize & xBlockAllocatedBit ) == 0 )
{
/* The wanted size is increased so it can contain a BlockLink_t
* structure in addition to the requested amount of bytes. */
if( xWantedSize > 0 )
{
xWantedSize += xHeapStructSize;
/* Ensure that blocks are always aligned to the required number
* of bytes. */
if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
{
/* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
{
/* Traverse the list from the start (lowest address) block until
* one of adequate size is found. */
pxPreviousBlock = &xStart;
pxBlock = xStart.pxNextFreeBlock;
while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
{
pxPreviousBlock = pxBlock;
pxBlock = pxBlock->pxNextFreeBlock;
}
/* If the end marker was reached then a block of adequate size
* was not found. */
if( pxBlock != pxEnd )
{
/* Return the memory space pointed to - jumping over the
* BlockLink_t structure at its start. */
pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
/* This block is being returned for use so must be taken out
* of the list of free blocks. */
pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;
/* If the block is larger than required it can be split into
* two. */
if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
{
/* This block is to be split into two. Create a new
* block following the number of bytes requested. The void
* cast is used to prevent byte alignment warnings from the
* compiler. */
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
/* Calculate the sizes of two blocks split from the
* single block. */
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
pxBlock->xBlockSize = xWantedSize;
/* Insert the new block into the list of free blocks. */
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
xFreeBytesRemaining -= pxBlock->xBlockSize;
if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )
{
xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
/* The block is being returned - it is allocated and owned
* by the application and has no "next" block. */
pxBlock->xBlockSize |= xBlockAllocatedBit;
pxBlock->pxNextFreeBlock = NULL;
xNumberOfSuccessfulAllocations++;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
traceMALLOC( pvReturn, xWantedSize );
}
( void ) xTaskResumeAll();
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
{
if( pvReturn == NULL )
{
extern void vApplicationMallocFailedHook( void );
vApplicationMallocFailedHook();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
#endif /* if ( configUSE_MALLOC_FAILED_HOOK == 1 ) */
return pvReturn;
}
| 356 | True | 1 |
CVE-2021-31572 | 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/FreeRTOS/FreeRTOS-Kernel/commit/d05b9c123f2bf9090bce386a244fc934ae44db5b', 'name': 'https://github.com/FreeRTOS/FreeRTOS-Kernel/commit/d05b9c123f2bf9090bce386a244fc934ae44db5b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:amazon:freertos:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.4.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'The kernel in Amazon Web Services FreeRTOS before 10.4.3 has an integer overflow in stream_buffer.c for a stream buffer.'}] | 2021-06-02T18:33Z | 2021-04-22T18: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 | Cobus van Eeden | 2020-12-07 11:07:31-08:00 | Add addition overflow check for stream buffer (#226) | d05b9c123f2bf9090bce386a244fc934ae44db5b | False | FreeRTOS/FreeRTOS-Kernel | FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos. | 2019-09-09 16:28:01 | 2022-08-27 17:10:07 | https://www.FreeRTOS.org | FreeRTOS | 1154.0 | 619.0 | xStreamBufferGenericCreate | xStreamBufferGenericCreate( size_t xBufferSizeBytes , size_t xTriggerLevelBytes , BaseType_t xIsMessageBuffer) | ['xBufferSizeBytes', 'xTriggerLevelBytes', 'xIsMessageBuffer'] | StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
BaseType_t xIsMessageBuffer )
{
uint8_t * pucAllocatedMemory;
uint8_t ucFlags;
/* In case the stream buffer is going to be used as a message buffer
* (that is, it will hold discrete messages with a little meta data that
* says how big the next message is) check the buffer will be large enough
* to hold at least one message. */
if( xIsMessageBuffer == pdTRUE )
{
/* Is a message buffer but not statically allocated. */
ucFlags = sbFLAGS_IS_MESSAGE_BUFFER;
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
}
else
{
/* Not a message buffer and not statically allocated. */
ucFlags = 0;
configASSERT( xBufferSizeBytes > 0 );
}
configASSERT( xTriggerLevelBytes <= xBufferSizeBytes );
/* A trigger level of 0 would cause a waiting task to unblock even when
* the buffer was empty. */
if( xTriggerLevelBytes == ( size_t ) 0 )
{
xTriggerLevelBytes = ( size_t ) 1;
}
/* A stream buffer requires a StreamBuffer_t structure and a buffer.
* Both are allocated in a single call to pvPortMalloc(). The
* StreamBuffer_t structure is placed at the start of the allocated memory
* and the buffer follows immediately after. The requested size is
* incremented so the free space is returned as the user would expect -
* this is a quirk of the implementation that means otherwise the free
* space would be reported as one byte smaller than would be logically
* expected. */
xBufferSizeBytes++;
pucAllocatedMemory = ( uint8_t * ) pvPortMalloc( xBufferSizeBytes + sizeof( StreamBuffer_t ) ); /*lint !e9079 malloc() only returns void*. */
if( pucAllocatedMemory != NULL )
{
prvInitialiseNewStreamBuffer( ( StreamBuffer_t * ) pucAllocatedMemory, /* Structure at the start of the allocated memory. */ /*lint !e9087 Safe cast as allocated memory is aligned. */ /*lint !e826 Area is not too small and alignment is guaranteed provided malloc() behaves as expected and returns aligned buffer. */
pucAllocatedMemory + sizeof( StreamBuffer_t ), /* Storage area follows. */ /*lint !e9016 Indexing past structure valid for uint8_t pointer, also storage area has no alignment requirement. */
xBufferSizeBytes,
xTriggerLevelBytes,
ucFlags );
traceSTREAM_BUFFER_CREATE( ( ( StreamBuffer_t * ) pucAllocatedMemory ), xIsMessageBuffer );
}
else
{
traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer );
}
return ( StreamBufferHandle_t ) pucAllocatedMemory; /*lint !e9087 !e826 Safe cast as allocated memory is aligned. */
}
| 153 | True | 1 |
CVE-2021-32434 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/leesavide/abcm2ps/commit/2f56e1179cab6affeb8afa9d6c324008fe40d8e3', 'name': 'https://github.com/leesavide/abcm2ps/commit/2f56e1179cab6affeb8afa9d6c324008fe40d8e3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/leesavide/abcm2ps/issues/83', 'name': 'https://github.com/leesavide/abcm2ps/issues/83', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YTF4FXCW22FFB5HNQO3GK3F4FFBLTZKE/', 'name': 'FEDORA-2022-6b46927596', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/6333SXWMES3K22DBAOAW34G6EU6WIJEY/', 'name': 'FEDORA-2022-68d22975a4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EVGJH4HMXI3TWMHQJQCG3M7KSXJWJM7R/', 'name': 'FEDORA-2022-93025de981', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00015.html', 'name': '[debian-lts-announce] 20220417 [SECURITY] [DLA 2983-1] abcm2ps security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:abcm2ps_project:abcm2ps:8.14.11:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'abcm2ps v8.14.11 was discovered to contain an out-of-bounds read in the function calculate_beam at draw.c.'}] | 2022-04-25T20:48Z | 2022-03-10T17:42Z | 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 | Jean-Francois Moine | 2021-04-27 11:52:27+02:00 | fix: array overflow when wrong duration in voice overlay
Issue #83, | 2f56e1179cab6affeb8afa9d6c324008fe40d8e3 | False | visit repo url | visit repo url | visit repo url | visit repo url | visit repo url | leesavide | visit repo url | visit repo url | get_over | get_over( struct SYMBOL * s) | ['s'] | static void get_over(struct SYMBOL *s)
{
struct VOICE_S *p_voice, *p_voice2, *p_voice3;
int range, voice, voice2, voice3;
static char tx_wrong_dur[] = "Wrong duration in voice overlay";
static char txt_no_note[] = "No note in voice overlay";
/* treat the end of overlay */
p_voice = curvoice;
if (p_voice->ignore)
return;
if (s->abc_type == ABC_T_BAR
|| s->u.v_over.type == V_OVER_E) {
if (!p_voice->last_sym) {
error(1, s, txt_no_note);
return;
}
p_voice->last_sym->sflags |= S_BEAM_END;
over_bar = 0;
if (over_time < 0) {
error(1, s, "Erroneous end of voice overlap");
return;
}
if (p_voice->time != over_mxtime)
error(1, s, tx_wrong_dur);
curvoice = &voice_tb[over_voice];
over_mxtime = 0;
over_voice = -1;
over_time = -1;
return;
}
/* treat the full overlay start */
if (s->u.v_over.type == V_OVER_S) {
over_voice = p_voice - voice_tb;
over_time = p_voice->time;
return;
}
/* (here is treated a new overlay - '&') */
/* create the extra voice if not done yet */
if (!p_voice->last_sym) {
error(1, s, txt_no_note);
return;
}
p_voice->last_sym->sflags |= S_BEAM_END;
voice2 = s->u.v_over.voice;
p_voice2 = &voice_tb[voice2];
if (parsys->voice[voice2].range < 0) {
int clone;
if (cfmt.abc2pscompat) {
error(1, s, "Cannot have %%%%abc2pscompat");
cfmt.abc2pscompat = 0;
}
clone = p_voice->clone >= 0;
p_voice2->id[0] = '&';
p_voice2->id[1] = '\0';
p_voice2->second = 1;
parsys->voice[voice2].second = 1;
p_voice2->scale = p_voice->scale;
p_voice2->octave = p_voice->octave;
p_voice2->transpose = p_voice->transpose;
memcpy(&p_voice2->key, &p_voice->key,
sizeof p_voice2->key);
memcpy(&p_voice2->ckey, &p_voice->ckey,
sizeof p_voice2->ckey);
memcpy(&p_voice2->okey, &p_voice->okey,
sizeof p_voice2->okey);
p_voice2->posit = p_voice->posit;
p_voice2->staff = p_voice->staff;
p_voice2->cstaff = p_voice->cstaff;
p_voice2->color = p_voice->color;
p_voice2->map_name = p_voice->map_name;
range = parsys->voice[p_voice - voice_tb].range;
for (voice = 0; voice < MAXVOICE; voice++) {
if (parsys->voice[voice].range > range)
parsys->voice[voice].range += clone + 1;
}
parsys->voice[voice2].range = range + 1;
voice_link(p_voice2);
if (clone) {
for (voice3 = MAXVOICE; --voice3 >= 0; ) {
if (parsys->voice[voice3].range < 0)
break;
}
if (voice3 > 0) {
p_voice3 = &voice_tb[voice3];
strcpy(p_voice3->id, p_voice2->id);
p_voice3->second = 1;
parsys->voice[voice3].second = 1;
p_voice3->scale = voice_tb[p_voice->clone].scale;
parsys->voice[voice3].range = range + 2;
voice_link(p_voice3);
p_voice2->clone = voice3;
} else {
error(1, s,
"Too many voices for overlay cloning");
}
}
}
voice = p_voice - voice_tb;
// p_voice2->cstaff = p_voice2->staff = parsys->voice[voice2].staff
// = parsys->voice[voice].staff;
// if ((voice3 = p_voice2->clone) >= 0) {
// p_voice3 = &voice_tb[voice3];
// p_voice3->cstaff = p_voice3->staff
// = parsys->voice[voice3].staff
// = parsys->voice[p_voice->clone].staff;
// }
if (over_time < 0) { /* first '&' in a measure */
int time;
over_bar = 1;
over_mxtime = p_voice->time;
over_voice = voice;
time = p_voice2->time;
for (s = p_voice->last_sym; /*s*/; s = s->prev) {
if (s->type == BAR
|| s->time <= time) /* (if start of tune) */
break;
}
over_time = s->time;
} else {
if (over_mxtime == 0)
over_mxtime = p_voice->time;
else if (p_voice->time != over_mxtime)
error(1, s, tx_wrong_dur);
}
p_voice2->time = over_time;
curvoice = p_voice2;
} | 764 | True | 1 |
CVE-2021-32436 | 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/leesavide/abcm2ps/commit/2f56e1179cab6affeb8afa9d6c324008fe40d8e3', 'name': 'https://github.com/leesavide/abcm2ps/commit/2f56e1179cab6affeb8afa9d6c324008fe40d8e3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/leesavide/abcm2ps/issues/85', 'name': 'https://github.com/leesavide/abcm2ps/issues/85', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YTF4FXCW22FFB5HNQO3GK3F4FFBLTZKE/', 'name': 'FEDORA-2022-6b46927596', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/6333SXWMES3K22DBAOAW34G6EU6WIJEY/', 'name': 'FEDORA-2022-68d22975a4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EVGJH4HMXI3TWMHQJQCG3M7KSXJWJM7R/', 'name': 'FEDORA-2022-93025de981', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00015.html', 'name': '[debian-lts-announce] 20220417 [SECURITY] [DLA 2983-1] abcm2ps security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:abcm2ps_project:abcm2ps:8.14.11:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An out-of-bounds read in the function write_title() in subs.c of abcm2ps v8.14.11 allows remote attackers to cause a Denial of Service (DoS) via unspecified vectors.'}] | 2022-04-25T20:41Z | 2022-03-10T17:42Z | 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 | Jean-Francois Moine | 2021-04-27 11:52:27+02:00 | fix: array overflow when wrong duration in voice overlay
Issue #83, | 2f56e1179cab6affeb8afa9d6c324008fe40d8e3 | False | visit repo url | visit repo url | visit repo url | visit repo url | visit repo url | leesavide | visit repo url | visit repo url | get_over | get_over( struct SYMBOL * s) | ['s'] | static void get_over(struct SYMBOL *s)
{
struct VOICE_S *p_voice, *p_voice2, *p_voice3;
int range, voice, voice2, voice3;
static char tx_wrong_dur[] = "Wrong duration in voice overlay";
static char txt_no_note[] = "No note in voice overlay";
/* treat the end of overlay */
p_voice = curvoice;
if (p_voice->ignore)
return;
if (s->abc_type == ABC_T_BAR
|| s->u.v_over.type == V_OVER_E) {
if (!p_voice->last_sym) {
error(1, s, txt_no_note);
return;
}
p_voice->last_sym->sflags |= S_BEAM_END;
over_bar = 0;
if (over_time < 0) {
error(1, s, "Erroneous end of voice overlap");
return;
}
if (p_voice->time != over_mxtime)
error(1, s, tx_wrong_dur);
curvoice = &voice_tb[over_voice];
over_mxtime = 0;
over_voice = -1;
over_time = -1;
return;
}
/* treat the full overlay start */
if (s->u.v_over.type == V_OVER_S) {
over_voice = p_voice - voice_tb;
over_time = p_voice->time;
return;
}
/* (here is treated a new overlay - '&') */
/* create the extra voice if not done yet */
if (!p_voice->last_sym) {
error(1, s, txt_no_note);
return;
}
p_voice->last_sym->sflags |= S_BEAM_END;
voice2 = s->u.v_over.voice;
p_voice2 = &voice_tb[voice2];
if (parsys->voice[voice2].range < 0) {
int clone;
if (cfmt.abc2pscompat) {
error(1, s, "Cannot have %%%%abc2pscompat");
cfmt.abc2pscompat = 0;
}
clone = p_voice->clone >= 0;
p_voice2->id[0] = '&';
p_voice2->id[1] = '\0';
p_voice2->second = 1;
parsys->voice[voice2].second = 1;
p_voice2->scale = p_voice->scale;
p_voice2->octave = p_voice->octave;
p_voice2->transpose = p_voice->transpose;
memcpy(&p_voice2->key, &p_voice->key,
sizeof p_voice2->key);
memcpy(&p_voice2->ckey, &p_voice->ckey,
sizeof p_voice2->ckey);
memcpy(&p_voice2->okey, &p_voice->okey,
sizeof p_voice2->okey);
p_voice2->posit = p_voice->posit;
p_voice2->staff = p_voice->staff;
p_voice2->cstaff = p_voice->cstaff;
p_voice2->color = p_voice->color;
p_voice2->map_name = p_voice->map_name;
range = parsys->voice[p_voice - voice_tb].range;
for (voice = 0; voice < MAXVOICE; voice++) {
if (parsys->voice[voice].range > range)
parsys->voice[voice].range += clone + 1;
}
parsys->voice[voice2].range = range + 1;
voice_link(p_voice2);
if (clone) {
for (voice3 = MAXVOICE; --voice3 >= 0; ) {
if (parsys->voice[voice3].range < 0)
break;
}
if (voice3 > 0) {
p_voice3 = &voice_tb[voice3];
strcpy(p_voice3->id, p_voice2->id);
p_voice3->second = 1;
parsys->voice[voice3].second = 1;
p_voice3->scale = voice_tb[p_voice->clone].scale;
parsys->voice[voice3].range = range + 2;
voice_link(p_voice3);
p_voice2->clone = voice3;
} else {
error(1, s,
"Too many voices for overlay cloning");
}
}
}
voice = p_voice - voice_tb;
// p_voice2->cstaff = p_voice2->staff = parsys->voice[voice2].staff
// = parsys->voice[voice].staff;
// if ((voice3 = p_voice2->clone) >= 0) {
// p_voice3 = &voice_tb[voice3];
// p_voice3->cstaff = p_voice3->staff
// = parsys->voice[voice3].staff
// = parsys->voice[p_voice->clone].staff;
// }
if (over_time < 0) { /* first '&' in a measure */
int time;
over_bar = 1;
over_mxtime = p_voice->time;
over_voice = voice;
time = p_voice2->time;
for (s = p_voice->last_sym; /*s*/; s = s->prev) {
if (s->type == BAR
|| s->time <= time) /* (if start of tune) */
break;
}
over_time = s->time;
} else {
if (over_mxtime == 0)
over_mxtime = p_voice->time;
else if (p_voice->time != over_mxtime)
error(1, s, tx_wrong_dur);
}
p_voice2->time = over_time;
curvoice = p_voice2;
} | 764 | True | 1 |
CVE-2021-32435 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://github.com/leesavide/abcm2ps/commit/3169ace6d63f6f517a64e8df0298f44a490c4a15', 'name': 'https://github.com/leesavide/abcm2ps/commit/3169ace6d63f6f517a64e8df0298f44a490c4a15', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/leesavide/abcm2ps/issues/84', 'name': 'https://github.com/leesavide/abcm2ps/issues/84', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YTF4FXCW22FFB5HNQO3GK3F4FFBLTZKE/', 'name': 'FEDORA-2022-6b46927596', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/6333SXWMES3K22DBAOAW34G6EU6WIJEY/', 'name': 'FEDORA-2022-68d22975a4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EVGJH4HMXI3TWMHQJQCG3M7KSXJWJM7R/', 'name': 'FEDORA-2022-93025de981', 'refsource': 'FEDORA', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2022/04/msg00015.html', 'name': '[debian-lts-announce] 20220417 [SECURITY] [DLA 2983-1] abcm2ps security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:abcm2ps_project:abcm2ps:8.14.11:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Stack-based buffer overflow in the function get_key in parse.c of abcm2ps v8.14.11 allows remote attackers to cause a Denial of Service (DoS) via unspecified vectors.'}] | 2022-04-25T20:39Z | 2022-03-10T17:42Z | 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 | Jean-Francois Moine | 2021-04-27 16:39:19+02:00 | fix: crash when accidental without a note at start of line after K:
Issue #84. | 3169ace6d63f6f517a64e8df0298f44a490c4a15 | False | visit repo url | visit repo url | visit repo url | visit repo url | visit repo url | leesavide | visit repo url | visit repo url | parse_line | parse_line( char * p) | ['p'] | static int parse_line(char *p)
{
struct SYMBOL *s;
char *q, c;
char *dot = NULL;
struct SYMBOL *last_note_sav = NULL;
struct decos dc_sav;
int i, flags, flags_sav = 0, slur;
static char qtb[10] = {0, 1, 3, 2, 3, 0, 2, 0, 3, 0};
colnum = 0;
switch (*p) {
case '\0': /* blank line */
switch (parse.abc_state) {
case ABC_S_GLOBAL:
if (parse.last_sym
&& parse.last_sym->abc_type != ABC_T_NULL)
abc_new(ABC_T_NULL, NULL);
case ABC_S_HEAD: /*fixme: may have blank lines in headers?*/
return 0;
}
return 1;
case '%':
if (p[1] == '%') {
s = abc_new(ABC_T_PSCOM, p);
p += 2; /* skip '%%' */
if (strncasecmp(p, "decoration ", 11) == 0) {
p += 11;
while (isspace((unsigned char) *p))
p++;
switch (*p) {
case '!':
char_tb['!'] = CHAR_DECOS;
char_tb['+'] = CHAR_BAD;
break;
case '+':
char_tb['+'] = CHAR_DECOS;
char_tb['!'] = CHAR_BAD;
break;
}
return 0;
}
if (strncasecmp(p, "linebreak ", 10) == 0) {
for (i = 0; i < sizeof char_tb; i++) {
if (char_tb[i] == CHAR_LINEBREAK)
char_tb[i] = i != '!' ?
CHAR_BAD :
CHAR_DECOS;
}
p += 10;
for (;;) {
while (isspace((unsigned char) *p))
p++;
if (*p == '\0')
break;
switch (*p) {
case '!':
case '$':
case '*':
case ';':
case '?':
case '@':
char_tb[(unsigned char) *p++]
= CHAR_LINEBREAK;
break;
case '<':
if (strncmp(p, "<none>", 6) == 0)
return 0;
if (strncmp(p, "<EOL>", 5) == 0) {
char_tb['\n'] = CHAR_LINEBREAK;
p += 5;
break;
}
/* fall thru */
default:
if (strcmp(p, "lock") != 0)
syntax("Invalid character in %%%%linebreak",
p);
return 0;
}
}
return 0;
}
if (strncasecmp(p, "microscale ", 11) == 0) {
int v;
p += 11;
while (isspace((unsigned char) *p))
p++;
sscanf(p, "%d", &v);
if (v < 4 || v >= 256 || v & 1)
syntax("Invalid value in %%microscale", p);
else
microscale = v;
return 0;
}
if (strncasecmp(p, "user ", 5) == 0) {
p += 5;
while (isspace((unsigned char) *p))
p++;
get_user(p, s);
return 0;
}
return 0;
}
/* fall thru */
case '\\': /* abc2mtex specific lines */
return 0; /* skip */
}
/* header fields */
if (p[1] == ':'
&& *p != '|' && *p != ':') { /* not '|:' nor '::' */
int new_tune;
new_tune = parse_info(p);
/* handle BarFly voice definition */
/* 'V:n <note line ending with a bar>' */
if (*p != 'V'
|| parse.abc_state != ABC_S_TUNE)
return new_tune; /* (normal return) */
c = p[strlen(p) - 1];
if (c != '|' && c != ']')
return new_tune;
while (!isspace((unsigned char) *p) && *p != '\0')
p++;
while (isspace((unsigned char) *p))
p++;
}
if (parse.abc_state != ABC_S_TUNE)
return 0;
/* music */
flags = 0;
if (parse.abc_vers <= (2 << 16))
lyric_started = 0;
deco_start = deco_cont = NULL;
slur = 0;
while (*p != '\0') {
colnum = p - abc_line;
switch (char_tb[(unsigned char) *p++]) {
case CHAR_GCHORD: /* " */
if (flags & ABC_F_GRACE)
goto bad_char;
p = parse_gchord(p);
break;
case CHAR_GR_ST: /* '{' */
if (flags & ABC_F_GRACE)
goto bad_char;
last_note_sav = curvoice->last_note;
curvoice->last_note = NULL;
memcpy(&dc_sav, &dc, sizeof dc);
dc.n = 0;
flags_sav = flags;
flags = ABC_F_GRACE;
if (*p == '/') {
flags |= ABC_F_SAPPO;
p++;
}
break;
case CHAR_GR_EN: /* '}' */
if (!(flags & ABC_F_GRACE))
goto bad_char;
parse.last_sym->flags |= ABC_F_GR_END;
if (dc.n != 0)
syntax("Decoration ignored", p);
curvoice->last_note = last_note_sav;
memcpy(&dc, &dc_sav, sizeof dc);
flags = flags_sav;
break;
case CHAR_DECOS:
if (p[-1] == '!'
&& char_tb['\n'] == CHAR_LINEBREAK
&& check_nl(p)) {
s = abc_new(ABC_T_EOLN, NULL); /* abc2win EOL */
s->u.eoln.type = 2;
break;
}
/* fall thru */
case CHAR_DECO:
if (p[-1] == '.') {
if (*p == '(' || *p == '-') {
dot = p;
break;
}
// if (*p == '|') {
// p = parse_bar(p + 1);
// parse.last_sym->u.bar.dotted = 1;
// break;
// }
}
p = parse_deco(p - 1, &dc, -1);
break;
case CHAR_LINEBREAK:
s = abc_new(ABC_T_EOLN, NULL);
// s->u.eoln.type = 0;
break;
case CHAR_NOTE:
p = parse_note(p - 1, flags);
flags &= ABC_F_GRACE;
parse.last_sym->u.note.slur_st = slur;
slur = 0;
if (parse.last_sym->u.note.notes[0].len > 0) /* if not space */
curvoice->last_note = parse.last_sym;
break;
case CHAR_SLASH: /* '/' */
if (flags & ABC_F_GRACE)
goto bad_char;
if (char_tb[(unsigned char) p[-1]] != CHAR_BAR)
goto bad_char;
q = p;
while (*q == '/')
q++;
if (char_tb[(unsigned char) *q] != CHAR_BAR)
goto bad_char;
s = abc_new(ABC_T_MREP, NULL);
s->u.bar.type = 0;
s->u.bar.len = q - p + 1;
syntax("Non standard measure repeat syntax", p - 1);
p = q;
break;
case CHAR_BSLASH: /* '\\' */
if (*p == '\0')
break;
syntax("'\\' ignored", p - 1);
break;
case CHAR_OBRA: /* '[' */
if (*p == '|' || *p == ']' || *p == ':'
|| isdigit((unsigned char) *p) || *p == '"'
|| *p == ' ') {
if (flags & ABC_F_GRACE)
goto bad_char;
p = parse_bar(p);
break;
}
if (p[1] != ':') {
p = parse_note(p - 1, flags); /* chord */
flags &= ABC_F_GRACE;
parse.last_sym->u.note.slur_st = slur;
slur = 0;
curvoice->last_note = parse.last_sym;
break;
}
/* embedded information field */
#if 0
/*fixme:OK for [I:staff n], ?? for other headers*/
if (flags & ABC_F_GRACE)
goto bad_char;
#endif
while (p[2] == ' ') { /* remove the spaces */
p[2] = ':';
p[1] = *p;
p++;
}
c = ']';
q = p;
while (*p != '\0' && *p != c)
p++;
if (*p == '\0') {
syntax("Escape sequence [..] not closed", q);
c = '\0';
} else {
*p = '\0';
}
parse_info(q);
*p = c;
if (c != '\0')
p++;
break;
case CHAR_BAR: /* '|', ':' or ']' */
if (flags & ABC_F_GRACE)
goto bad_char;
p = parse_bar(p);
break;
case CHAR_OPAR: /* '(' */
if (*p > '0' && *p <= '9') {
int pplet, qplet, rplet;
pplet = strtol(p, &q, 10);
p = q;
if ((unsigned) pplet < sizeof qtb / sizeof qtb[0])
qplet = qtb[pplet];
else
qplet = qtb[0];
rplet = pplet;
if (*p == ':') {
p++;
if (isdigit((unsigned char) *p)) {
qplet = strtol(p, &q, 10);
p = q;
}
if (*p == ':') {
p++;
if (isdigit((unsigned char) *p)) {
rplet = strtol(p, &q, 10);
p = q;
}
}
}
if (rplet < 1) {
syntax("Invalid 'r' in tuplet", p);
break;
}
if (pplet >= 128 || qplet >= 128 || rplet >= 128) {
syntax("Invalid 'p:q:r' in tuplet", p);
break;
}
if (qplet == 0)
qplet = meter % 3 == 0 ? 3 : 2;
s = abc_new(ABC_T_TUPLET, NULL);
s->u.tuplet.p_plet = pplet;
s->u.tuplet.q_plet = qplet;
s->u.tuplet.r_plet = rplet;
s->flags |= flags;
break;
}
if (*p == '&') {
if (flags & ABC_F_GRACE)
goto bad_char;
p++;
if (vover != 0) {
syntax("Nested voice overlay", p - 1);
break;
}
s = abc_new(ABC_T_V_OVER, NULL);
s->u.v_over.type = V_OVER_S;
s->u.v_over.voice = curvoice - voice_tb;
vover = -1; /* multi-bars */
break;
}
slur <<= 4;
if (p == dot + 1 && dc.n == 0)
slur |= SL_DOTTED;
switch (*p) {
case '\'':
slur += SL_ABOVE;
p++;
break;
case ',':
slur += SL_BELOW;
p++;
break;
default:
slur += SL_AUTO;
break;
}
break;
case CHAR_CPAR: /* ')' */
switch (parse.last_sym->abc_type) {
case ABC_T_NOTE:
case ABC_T_REST:
break;
default:
goto bad_char;
}
parse.last_sym->u.note.slur_end++;
break;
case CHAR_VOV: /* '&' */
if (flags & ABC_F_GRACE)
goto bad_char;
if (*p != ')'
|| vover == 0) { /*??*/
if (!curvoice->last_note) {
syntax("Bad start of voice overlay", p);
break;
}
s = abc_new(ABC_T_V_OVER, NULL);
/*s->u.v_over.type = V_OVER_V; */
vover_new();
s->u.v_over.voice = curvoice - voice_tb;
if (vover == 0)
vover = 1; /* single bar */
break;
}
p++;
vover = 0;
s = abc_new(ABC_T_V_OVER, NULL);
s->u.v_over.type = V_OVER_E;
s->u.v_over.voice = curvoice->mvoice;
curvoice->last_note = NULL; /* ?? */
curvoice = &voice_tb[curvoice->mvoice];
break;
case CHAR_SPAC: /* ' ' and '\t' */
flags |= ABC_F_SPACE;
break;
case CHAR_MINUS: { /* '-' */
int tie_pos;
if (!curvoice->last_note
|| curvoice->last_note->abc_type != ABC_T_NOTE)
goto bad_char;
if (p == dot + 1 && dc.n == 0)
tie_pos = SL_DOTTED;
else
tie_pos = 0;
switch (*p) {
case '\'':
tie_pos += SL_ABOVE;
p++;
break;
case ',':
tie_pos += SL_BELOW;
p++;
break;
default:
tie_pos += SL_AUTO;
break;
}
for (i = 0; i <= curvoice->last_note->nhd; i++) {
if (curvoice->last_note->u.note.notes[i].ti1 == 0)
curvoice->last_note->u.note.notes[i].ti1 = tie_pos;
else if (curvoice->last_note->nhd == 0)
syntax("Too many ties", p);
}
break;
}
case CHAR_BRHY: /* '>' and '<' */
if (!curvoice->last_note)
goto bad_char;
i = 1;
while (*p == p[-1]) {
i++;
p++;
}
if (i > 3) {
syntax("Bad broken rhythm", p - 1);
i = 3;
}
if (p[-1] == '<')
i = -i;
broken_rhythm(curvoice->last_note, i);
curvoice->last_note->u.note.brhythm = i;
break;
case CHAR_IGN: /* '*' & '`' */
break;
default:
bad_char:
syntax((flags & ABC_F_GRACE)
? "Bad character in grace note sequence"
: "Bad character",
p - 1);
break;
}
}
/*fixme: may we have grace notes across lines?*/
if (flags & ABC_F_GRACE) {
syntax("EOLN in grace note sequence", p - 1);
if (curvoice->last_note)
curvoice->last_note->flags |= ABC_F_GR_END;
curvoice->last_note = last_note_sav;
memcpy(&dc, &dc_sav, sizeof dc);
}
/* add eoln */
s = abc_new(ABC_T_EOLN, NULL);
if (flags & ABC_F_SPACE)
s->flags |= ABC_F_SPACE;
if (p[-1] == '\\'
|| char_tb['\n'] != CHAR_LINEBREAK)
s->u.eoln.type = 1; /* no break */
return 0;
} | 2432 | True | 1 |
CVE-2021-33657 | 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/libsdl-org/SDL/commit/8c91cf7dba5193f5ce12d06db1336515851c9ee9', 'name': 'https://github.com/libsdl-org/SDL/commit/8c91cf7dba5193f5ce12d06db1336515851c9ee9', '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:libsdl:simple_directmedia_layer:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0.0', 'versionEndIncluding': '2.0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'There is a heap overflow problem in video/SDL_pixels.c in SDL (Simple DirectMedia Layer) 2.x to 2.0.18 versions. By crafting a malicious .BMP file, an attacker can cause the application using this library to crash, denial of service or Code execution.'}] | 2022-04-12T17:49Z | 2022-04-01T23: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 | Sam Lantinga | 2021-11-30 12:36:46-08:00 | Always create a full 256-entry map in case color values are out of range
Fixes https://github.com/libsdl-org/SDL/issues/5042 | 8c91cf7dba5193f5ce12d06db1336515851c9ee9 | False | libsdl-org/SDL | Simple Directmedia Layer | 2021-01-15 19:55:54 | 2022-08-28 02:01:14 | https://libsdl.org | libsdl-org | 3691.0 | 723.0 | Map1to1 | Map1to1( SDL_Palette * src , SDL_Palette * dst , int * identical) | ['src', 'dst', 'identical'] | Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical)
{
Uint8 *map;
int i;
if (identical) {
if (src->ncolors <= dst->ncolors) {
/* If an identical palette, no need to map */
if (src == dst
||
(SDL_memcmp
(src->colors, dst->colors,
src->ncolors * sizeof(SDL_Color)) == 0)) {
*identical = 1;
return (NULL);
}
}
*identical = 0;
}
map = (Uint8 *) SDL_malloc(src->ncolors);
if (map == NULL) {
SDL_OutOfMemory();
return (NULL);
}
for (i = 0; i < src->ncolors; ++i) {
map[i] = SDL_FindColor(dst,
src->colors[i].r, src->colors[i].g,
src->colors[i].b, src->colors[i].a);
}
return (map);
} | 186 | True | 1 |
CVE-2021-33657 | 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/libsdl-org/SDL/commit/8c91cf7dba5193f5ce12d06db1336515851c9ee9', 'name': 'https://github.com/libsdl-org/SDL/commit/8c91cf7dba5193f5ce12d06db1336515851c9ee9', '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:libsdl:simple_directmedia_layer:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0.0', 'versionEndIncluding': '2.0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'There is a heap overflow problem in video/SDL_pixels.c in SDL (Simple DirectMedia Layer) 2.x to 2.0.18 versions. By crafting a malicious .BMP file, an attacker can cause the application using this library to crash, denial of service or Code execution.'}] | 2022-04-12T17:49Z | 2022-04-01T23: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 | Sam Lantinga | 2021-11-30 12:36:46-08:00 | Always create a full 256-entry map in case color values are out of range
Fixes https://github.com/libsdl-org/SDL/issues/5042 | 8c91cf7dba5193f5ce12d06db1336515851c9ee9 | False | libsdl-org/SDL | Simple Directmedia Layer | 2021-01-15 19:55:54 | 2022-08-28 02:01:14 | https://libsdl.org | libsdl-org | 3691.0 | 723.0 | Map1toN | Map1toN( SDL_PixelFormat * src , Uint8 Rmod , Uint8 Gmod , Uint8 Bmod , Uint8 Amod , SDL_PixelFormat * dst) | ['src', 'Rmod', 'Gmod', 'Bmod', 'Amod', 'dst'] | Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod,
SDL_PixelFormat * dst)
{
Uint8 *map;
int i;
int bpp;
SDL_Palette *pal = src->palette;
bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
map = (Uint8 *) SDL_malloc(pal->ncolors * bpp);
if (map == NULL) {
SDL_OutOfMemory();
return (NULL);
}
/* We memory copy to the pixel map so the endianness is preserved */
for (i = 0; i < pal->ncolors; ++i) {
Uint8 R = (Uint8) ((pal->colors[i].r * Rmod) / 255);
Uint8 G = (Uint8) ((pal->colors[i].g * Gmod) / 255);
Uint8 B = (Uint8) ((pal->colors[i].b * Bmod) / 255);
Uint8 A = (Uint8) ((pal->colors[i].a * Amod) / 255);
ASSEMBLE_RGBA(&map[i * bpp], dst->BytesPerPixel, dst, (Uint32)R, (Uint32)G, (Uint32)B, (Uint32)A);
}
return (map);
} | 243 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | carray2Hex | carray2Hex( const unsigned char * d , uint64_t _len , char * _hexArray , uint64_t _hexArrayLen) | ['d', '_len', '_hexArray', '_hexArrayLen'] | void carray2Hex(const unsigned char *d, uint64_t _len, char *_hexArray,
uint64_t _hexArrayLen) {
CHECK_STATE(d);
CHECK_STATE(_hexArray);
char hexval[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
CHECK_STATE(_hexArrayLen > 2 * _len);
for (int j = 0; j < _len; j++) {
_hexArray[j * 2] = hexval[((d[j] >> 4) & 0xF)];
_hexArray[j * 2 + 1] = hexval[(d[j]) & 0x0F];
}
_hexArray[_len * 2] = 0;
} | 149 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | encryptBLSKeyShare2Hex | encryptBLSKeyShare2Hex( int * errStatus , char * err_string , const char * _key) | ['errStatus', 'err_string', '_key'] | string encryptBLSKeyShare2Hex(int *errStatus, char *err_string, const char *_key) {
CHECK_STATE(errStatus);
CHECK_STATE(err_string);
CHECK_STATE(_key);
auto keyArray = make_shared<vector<char>>(BUF_LEN, 0);
auto encryptedKey = make_shared<vector<uint8_t>>(BUF_LEN, 0);
vector<char> errMsg(BUF_LEN, 0);
strncpy(keyArray->data(), _key, BUF_LEN);
*errStatus = 0;
unsigned int encryptedLen = 0;
sgx_status_t status = trustedEncryptKeyAES(eid, errStatus, errMsg.data(), keyArray->data(), encryptedKey->data(), &encryptedLen);
HANDLE_TRUSTED_FUNCTION_ERROR(status, *errStatus, errMsg.data());
SAFE_CHAR_BUF(resultBuf, 2 * BUF_LEN + 1);
carray2Hex(encryptedKey->data(), encryptedLen, resultBuf, 2 * BUF_LEN + 1);
return string(resultBuf);
} | 180 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | hex2carray | hex2carray( const char * _hex , uint64_t * _bin_len , uint8_t * _bin , uint64_t _max_length) | ['_hex', '_bin_len', '_bin', '_max_length'] | bool hex2carray(const char *_hex, uint64_t *_bin_len,
uint8_t *_bin, uint64_t _max_length) {
CHECK_STATE(_hex);
CHECK_STATE(_bin);
CHECK_STATE(_bin_len)
int len = strnlen(_hex, 2 * _max_length + 1);
CHECK_STATE(len != 2 * _max_length + 1);
CHECK_STATE(len <= 2 * _max_length );
if (len == 0 && len % 2 == 1)
return false;
*_bin_len = len / 2;
for (int i = 0; i < len / 2; i++) {
int high = char2int((char) _hex[i * 2]);
int low = char2int((char) _hex[i * 2 + 1]);
if (high < 0 || low < 0) {
return false;
}
_bin[i] = (unsigned char) (high * 16 + low);
}
return true;
} | 177 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | createBLSShare | createBLSShare( const string & blsKeyName , const char * s_shares , const char * encryptedKeyHex) | ['blsKeyName', 's_shares', 'encryptedKeyHex'] | bool createBLSShare(const string &blsKeyName, const char *s_shares, const char *encryptedKeyHex) {
CHECK_STATE(s_shares);
CHECK_STATE(encryptedKeyHex);
vector<char> errMsg(BUF_LEN,0);
int errStatus = 0;
uint64_t decKeyLen;
SAFE_UINT8_BUF(encr_bls_key,BUF_LEN);
SAFE_UINT8_BUF(encr_key,BUF_LEN);
if (!hex2carray(encryptedKeyHex, &decKeyLen, encr_key, BUF_LEN)) {
throw SGXException(INVALID_HEX, "Invalid encryptedKeyHex");
}
uint32_t enc_bls_len = 0;
sgx_status_t status = trustedCreateBlsKeyAES(eid, &errStatus, errMsg.data(), s_shares, encr_key, decKeyLen, encr_bls_key,
&enc_bls_len);
HANDLE_TRUSTED_FUNCTION_ERROR(status, errStatus, errMsg.data());
SAFE_CHAR_BUF(hexBLSKey,2 * BUF_LEN)
carray2Hex(encr_bls_key, enc_bls_len, hexBLSKey, 2 * BUF_LEN);
SGXWalletServer::writeDataToDB(blsKeyName, hexBLSKey);
return true;
} | 166 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | gen_dkg_poly | gen_dkg_poly( int _t) | ['_t'] | string gen_dkg_poly(int _t) {
vector<char> errMsg(BUF_LEN, 0);
int errStatus = 0;
uint32_t enc_len = 0;
vector <uint8_t> encrypted_dkg_secret(BUF_LEN, 0);
sgx_status_t status = trustedGenDkgSecretAES(eid, &errStatus, errMsg.data(), encrypted_dkg_secret.data(), &enc_len, _t);
HANDLE_TRUSTED_FUNCTION_ERROR(status, errStatus, errMsg.data());
uint64_t length = enc_len;;
vector<char> hexEncrPoly(BUF_LEN, 0);
CHECK_STATE(encrypted_dkg_secret.size() >= length);
carray2Hex(encrypted_dkg_secret.data(), length, hexEncrPoly.data(), BUF_LEN);
string result(hexEncrPoly.data());
return result;
} | 140 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | getSecretShares | getSecretShares( const string & _polyName , const char * _encryptedPolyHex , const vector<string> & _publicKeys , int _t , int _n) | ['_polyName', '_encryptedPolyHex', '_publicKeys', '_t', '_n'] | getSecretShares(const string &_polyName, const char *_encryptedPolyHex, const vector <string> &_publicKeys,
int _t,
int _n) {
CHECK_STATE(_encryptedPolyHex);
vector<char> hexEncrKey(BUF_LEN, 0);
vector<char> errMsg1(BUF_LEN, 0);
vector <uint8_t> encrDKGPoly(BUF_LEN, 0);
int errStatus = 0;
uint64_t encLen = 0;
if (!hex2carray(_encryptedPolyHex, &encLen, encrDKGPoly.data(), BUF_LEN)) {
throw SGXException(INVALID_HEX, "Invalid encryptedPolyHex");
}
sgx_status_t status = trustedSetEncryptedDkgPolyAES(eid, &errStatus, errMsg1.data(), encrDKGPoly.data(), encLen);
HANDLE_TRUSTED_FUNCTION_ERROR(status, errStatus, errMsg1.data());
string result;
for (int i = 0; i < _n; i++) {
vector <uint8_t> encryptedSkey(BUF_LEN, 0);
uint32_t decLen;
vector<char> currentShare(193, 0);
vector<char> sShareG2(320, 0);
string pub_keyB = _publicKeys.at(i);
vector<char> pubKeyB(129, 0);
strncpy(pubKeyB.data(), pub_keyB.c_str(), 128);
pubKeyB.at(128) = 0;
spdlog::debug("pubKeyB is {}", pub_keyB);
sgx_status_t status = trustedGetEncryptedSecretShareAES(eid, &errStatus, errMsg1.data(), encryptedSkey.data(), &decLen,
currentShare.data(), sShareG2.data(), pubKeyB.data(), _t, _n, i + 1);
HANDLE_TRUSTED_FUNCTION_ERROR(status, errStatus, errMsg1.data());
spdlog::debug("cur_share is {}", currentShare.data());
result += string(currentShare.data());
spdlog::debug("dec len is {}", decLen);
carray2Hex(encryptedSkey.data(), decLen, hexEncrKey.data(), BUF_LEN);
string dhKeyName = "DKG_DH_KEY_" + _polyName + "_" + to_string(i) + ":";
spdlog::debug("hexEncr DH Key: { }", hexEncrKey.data());
spdlog::debug("name to write to db is {}", dhKeyName);
SGXWalletServer::writeDataToDB(dhKeyName, hexEncrKey.data());
string shareG2_name = "shareG2_" + _polyName + "_" + to_string(i) + ":";
spdlog::debug("name to write to db is {}", shareG2_name);
spdlog::debug("s_shareG2: {}", sShareG2.data());
SGXWalletServer::writeDataToDB(shareG2_name, sShareG2.data());
}
return result;
} | 476 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | genECDSAKey | genECDSAKey() | [] | vector <string> genECDSAKey() {
vector<char> errMsg(BUF_LEN, 0);
int errStatus = 0;
vector <uint8_t> encr_pr_key(BUF_LEN, 0);
vector<char> pub_key_x(BUF_LEN, 0);
vector<char> pub_key_y(BUF_LEN, 0);
uint32_t enc_len = 0;
sgx_status_t status = trustedGenerateEcdsaKeyAES(eid, &errStatus,
errMsg.data(), encr_pr_key.data(), &enc_len,
pub_key_x.data(), pub_key_y.data());
HANDLE_TRUSTED_FUNCTION_ERROR(status, errStatus,errMsg.data());
vector <string> keys(3);
vector<char> hexEncrKey(BUF_LEN * 2, 0);
carray2Hex(encr_pr_key.data(), enc_len, hexEncrKey.data(),
BUF_LEN * 2);
keys.at(0) = hexEncrKey.data();
keys.at(1) = string(pub_key_x.data()) + string(pub_key_y.data());
vector<unsigned char> randBuffer(32, 0);
fillRandomBuffer(randBuffer);
vector<char> rand_str(BUF_LEN, 0);
carray2Hex(randBuffer.data(), 32, rand_str.data(), BUF_LEN);
keys.at(2) = rand_str.data();
CHECK_STATE(keys.at(2).size() == 64);
return keys;
} | 270 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | check_and_set_SEK | check_and_set_SEK( const string & SEK) | ['SEK'] | shared_ptr <vector<uint8_t>> check_and_set_SEK(const string &SEK) {
vector<char> decr_key(BUF_LEN, 0);
vector<char> errMsg(BUF_LEN, 0);
int err_status = 0;
auto encrypted_SEK = make_shared < vector < uint8_t >> (BUF_LEN, 0);
uint32_t l = 0;
sgx_status_t status = trustedSetSEK_backup(eid, &err_status, errMsg.data(), encrypted_SEK->data(), &l,
SEK.c_str());
encrypted_SEK->resize(l);
HANDLE_TRUSTED_FUNCTION_ERROR(status, err_status, errMsg.data());
validate_SEK();
return encrypted_SEK;
} | 116 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | create_test_key | create_test_key() | [] | void create_test_key() {
int errStatus = 0;
vector<char> errMsg(1024, 0);
uint32_t enc_len;
SAFE_UINT8_BUF(encrypted_key, BUF_LEN);
string key = TEST_VALUE;
sgx_status_t status = trustedEncryptKeyAES(eid, &errStatus, errMsg.data(), key.c_str(), encrypted_key, &enc_len);
HANDLE_TRUSTED_FUNCTION_ERROR(status, errStatus, errMsg.data());
vector<char> hexEncrKey(2 * enc_len + 1, 0);
carray2Hex(encrypted_key, enc_len, hexEncrKey.data(), 2 * enc_len + 1);
LevelDB::getLevelDb()->writeDataUnique("TEST_KEY", hexEncrKey.data());
} | 128 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | gen_SEK | gen_SEK() | [] | void gen_SEK() {
vector<char> errMsg(1024, 0);
int err_status = 0;
vector <uint8_t> encrypted_SEK(1024, 0);
uint32_t enc_len = 0;
SAFE_CHAR_BUF(SEK, 65);
spdlog::info("Generating backup key. Will be stored in backup_key.txt ... ");
sgx_status_t status = trustedGenerateSEK(eid, &err_status, errMsg.data(), encrypted_SEK.data(), &enc_len, SEK);
HANDLE_TRUSTED_FUNCTION_ERROR(status, err_status, errMsg.data());
if (strnlen(SEK, 33) != 32) {
throw SGXException(-1, "strnlen(SEK,33) != 32");
}
vector<char> hexEncrKey(2 * enc_len + 1, 0);
carray2Hex(encrypted_SEK.data(), enc_len, hexEncrKey.data(), 2 * enc_len + 1);
spdlog::info(string("Encrypted storage encryption key:") + hexEncrKey.data());
ofstream sek_file(BACKUP_PATH);
sek_file.clear();
sek_file << SEK;
cout << "ATTENTION! YOUR BACKUP KEY HAS BEEN WRITTEN INTO sgx_data/backup_key.txt \n" <<
"PLEASE COPY IT TO THE SAFE PLACE AND THEN DELETE THE FILE MANUALLY BY RUNNING THE FOLLOWING COMMAND:\n" <<
"apt-get install secure-delete && srm -vz sgx_data/backup_key.txt" << endl;
if (!autoconfirm) {
string confirm_str = "I confirm";
string buffer;
do {
cout << " DO YOU CONFIRM THAT YOU COPIED THE KEY? (if you confirm type - I confirm)"
<< endl;
getline(cin, buffer);
} while (case_insensitive_match(confirm_str, buffer));
}
LevelDB::getLevelDb()->writeDataUnique("SEK", hexEncrKey.data());
create_test_key();
validate_SEK();
shared_ptr <string> encrypted_SEK_ptr = LevelDB::getLevelDb()->readString("SEK");
setSEK(encrypted_SEK_ptr);
validate_SEK();
} | 293 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | SGXWalletServer::calculateAllBLSPublicKeysImpl | SGXWalletServer::calculateAllBLSPublicKeysImpl( const Json :: Value & publicShares , int t , int n) | ['publicShares', 't', 'n'] | Json::Value SGXWalletServer::calculateAllBLSPublicKeysImpl(const Json::Value& publicShares, int t, int n) {
spdlog::info("Entering {}", __FUNCTION__);
INIT_RESULT(result)
try {
if (!check_n_t(t, n)) {
throw SGXException(INVALID_DKG_PARAMS, "Invalid DKG parameters: n or t ");
}
if (!publicShares.isArray()) {
throw SGXException(INVALID_DKG_PARAMS, "Invalid public shares format");
}
if (publicShares.size() != (uint64_t) n) {
throw SGXException(INVALID_DKG_PARAMS, "Invalid length of public shares");
}
for (int i = 0; i < n; ++i) {
if (!publicShares[i].isString()) {
throw SGXException(INVALID_DKG_PARAMS, "Invalid public shares parts format");
}
if (publicShares[i].asString().length() != (uint64_t) 256 * t) {
throw SGXException(INVALID_DKG_PARAMS, "Invalid length of public shares parts");
}
}
vector<string> public_shares(n);
for (int i = 0; i < n; ++i) {
public_shares[i] = publicShares[i].asString();
}
vector<string> public_keys = calculateAllBlsPublicKeys(public_shares);
if (public_keys.size() != n) {
throw SGXException(UNKNOWN_ERROR, "");
}
for (int i = 0; i < n; ++i) {
result["publicKeys"][i] = public_keys[i];
}
} HANDLE_SGX_EXCEPTION(result)
RETURN_SUCCESS(result);
} | 275 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | AES_decrypt | AES_decrypt( uint8_t * encr_message , uint64_t length , char * message , uint64_t msgLen) | ['encr_message', 'length', 'message', 'msgLen'] | int AES_decrypt(uint8_t *encr_message, uint64_t length, char *message, uint64_t msgLen) {
if (!message) {
LOG_ERROR("Null message in AES_encrypt");
return -1;
}
if (!encr_message) {
LOG_ERROR("Null encr message in AES_encrypt");
return -2;
}
if (length < SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE) {
LOG_ERROR("length < SGX_AESGCM_MAC_SIZE - SGX_AESGCM_IV_SIZE");
return -1;
}
uint64_t len = length - SGX_AESGCM_MAC_SIZE - SGX_AESGCM_IV_SIZE;
if (msgLen < len) {
LOG_ERROR("Output buffer not large enough");
return -2;
}
sgx_status_t status = sgx_rijndael128GCM_decrypt(&AES_key,
encr_message + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE, len,
(unsigned char*) message,
encr_message + SGX_AESGCM_MAC_SIZE, SGX_AESGCM_IV_SIZE,
NULL, 0,
(sgx_aes_gcm_128bit_tag_t *)encr_message);
return status;
} | 138 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | AES_decrypt_DH | AES_decrypt_DH( uint8_t * encr_message , uint64_t length , char * message , uint64_t msgLen) | ['encr_message', 'length', 'message', 'msgLen'] | int AES_decrypt_DH(uint8_t *encr_message, uint64_t length, char *message, uint64_t msgLen) {
if (!message) {
LOG_ERROR("Null message in AES_encrypt_DH");
return -1;
}
if (!encr_message) {
LOG_ERROR("Null encr message in AES_encrypt_DH");
return -2;
}
if (length < SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE) {
LOG_ERROR("length < SGX_AESGCM_MAC_SIZE - SGX_AESGCM_IV_SIZE");
return -1;
}
uint64_t len = length - SGX_AESGCM_MAC_SIZE - SGX_AESGCM_IV_SIZE;
if (msgLen < len) {
LOG_ERROR("Output buffer not large enough");
return -2;
}
sgx_status_t status = sgx_rijndael128GCM_decrypt(&AES_DH_key,
encr_message + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE, len,
(unsigned char*) message,
encr_message + SGX_AESGCM_MAC_SIZE, SGX_AESGCM_IV_SIZE,
NULL, 0,
(sgx_aes_gcm_128bit_tag_t *)encr_message);
return status;
} | 138 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | AES_encrypt | AES_encrypt( char * message , uint8_t * encr_message , uint64_t encrLen) | ['message', 'encr_message', 'encrLen'] | int AES_encrypt(char *message, uint8_t *encr_message, uint64_t encrLen) {
if (!message) {
LOG_ERROR("Null message in AES_encrypt");
return -1;
}
if (!encr_message) {
LOG_ERROR("Null encr message in AES_encrypt");
return -2;
}
uint64_t len = strlen(message) + 1;
if (len + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE > encrLen ) {
LOG_ERROR("Output buffer too small");
return -3;
}
sgx_read_rand(encr_message + SGX_AESGCM_MAC_SIZE, SGX_AESGCM_IV_SIZE);
sgx_status_t status = sgx_rijndael128GCM_encrypt(&AES_key, (uint8_t*)message, strlen(message),
encr_message + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE,
encr_message + SGX_AESGCM_MAC_SIZE, SGX_AESGCM_IV_SIZE,
NULL, 0,
(sgx_aes_gcm_128bit_tag_t *) encr_message);
return status;
} | 132 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | AES_encrypt_DH | AES_encrypt_DH( char * message , uint8_t * encr_message , uint64_t encrLen) | ['message', 'encr_message', 'encrLen'] | int AES_encrypt_DH(char *message, uint8_t *encr_message, uint64_t encrLen) {
if (!message) {
LOG_ERROR("Null message in AES_encrypt_DH");
return -1;
}
if (!encr_message) {
LOG_ERROR("Null encr message in AES_encrypt_DH");
return -2;
}
uint64_t len = strlen(message) + 1;
if (len + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE > encrLen ) {
LOG_ERROR("Output buffer too small");
return -3;
}
sgx_read_rand(encr_message + SGX_AESGCM_MAC_SIZE, SGX_AESGCM_IV_SIZE);
sgx_status_t status = sgx_rijndael128GCM_encrypt(&AES_DH_key, (uint8_t*)message, strlen(message),
encr_message + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE,
encr_message + SGX_AESGCM_MAC_SIZE, SGX_AESGCM_IV_SIZE,
NULL, 0,
(sgx_aes_gcm_128bit_tag_t *) encr_message);
return status;
} | 132 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | sealHexSEK | sealHexSEK( int * errStatus , char * errString , uint8_t * encrypted_sek , uint32_t * enc_len , char * sek_hex) | ['errStatus', 'errString', 'encrypted_sek', 'enc_len', 'sek_hex'] | void sealHexSEK(int *errStatus, char *errString,
uint8_t *encrypted_sek, uint32_t *enc_len, char *sek_hex) {
CALL_ONCE
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_sek);
CHECK_STATE(sek_hex);
CHECK_STATE(strnlen(sek_hex, 33) == 32)
uint64_t plaintextLen = strlen(sek_hex) + 1;
uint64_t sealedLen = sgx_calc_sealed_data_size(0, plaintextLen);
sgx_attributes_t attribute_mask;
attribute_mask.flags = 0xfffffffffffffff3;
attribute_mask.xfrm = 0x0;
sgx_misc_select_t misc = 0xF0000000;
sgx_status_t status = sgx_seal_data_ex(SGX_KEYPOLICY_MRENCLAVE, attribute_mask, misc, 0, NULL, plaintextLen, (uint8_t *) sek_hex, sealedLen,
(sgx_sealed_data_t *) encrypted_sek);
CHECK_STATUS("seal SEK failed after SEK generation");
uint32_t encrypt_text_length = sgx_get_encrypt_txt_len((const sgx_sealed_data_t *)encrypted_sek);
CHECK_STATE(encrypt_text_length = plaintextLen);
SAFE_CHAR_BUF(unsealedKey, BUF_LEN);
uint32_t decLen = BUF_LEN;
uint32_t add_text_length = sgx_get_add_mac_txt_len((const sgx_sealed_data_t *)encrypted_sek);
CHECK_STATE(add_text_length == 0);
CHECK_STATE(sgx_is_within_enclave(encrypted_sek,sizeof(sgx_sealed_data_t)));
status = sgx_unseal_data((const sgx_sealed_data_t *)encrypted_sek, NULL, NULL,
(uint8_t *) unsealedKey, &decLen );
CHECK_STATUS("seal/unseal SEK failed after SEK generation in unseal");
*enc_len = sealedLen;
SET_SUCCESS
clean:
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 242 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedBlsSignMessageAES | trustedBlsSignMessageAES( int * errStatus , char * errString , uint8_t * encryptedPrivateKey , uint32_t enc_len , char * _hashX , char * _hashY , char * signature) | ['errStatus', 'errString', 'encryptedPrivateKey', 'enc_len', '_hashX', '_hashY', 'signature'] | void trustedBlsSignMessageAES(int *errStatus, char *errString, uint8_t *encryptedPrivateKey,
uint32_t enc_len, char *_hashX,
char *_hashY, char *signature) {
LOG_DEBUG(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encryptedPrivateKey);
CHECK_STATE(_hashX);
CHECK_STATE(_hashY);
CHECK_STATE(signature);
SAFE_CHAR_BUF(key, BUF_LEN);SAFE_CHAR_BUF(sig, BUF_LEN);
int status = AES_decrypt(encryptedPrivateKey, enc_len, key, BUF_LEN);
CHECK_STATUS("AES decrypt failed")
if (!enclave_sign(key, _hashX, _hashY, sig)) {
strncpy(errString, "Enclave failed to create bls signature", BUF_LEN);
LOG_ERROR(errString);
*errStatus = -1;
goto clean;
}
strncpy(signature, sig, BUF_LEN);
if (strnlen(signature, BUF_LEN) < 10) {
strncpy(errString, "Signature too short", BUF_LEN);
LOG_ERROR(errString);
*errStatus = -1;
goto clean;
}
SET_SUCCESS
LOG_DEBUG("SGX call completed");
clean:
;
LOG_DEBUG("SGX call completed");
} | 187 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedCreateBlsKeyAES | trustedCreateBlsKeyAES( int * errStatus , char * errString , const char * s_shares , uint8_t * encryptedPrivateKey , uint64_t key_len , uint8_t * encr_bls_key , uint32_t * enc_bls_key_len) | ['errStatus', 'errString', 's_shares', 'encryptedPrivateKey', 'key_len', 'encr_bls_key', 'enc_bls_key_len'] | void trustedCreateBlsKeyAES(int *errStatus, char *errString, const char *s_shares,
uint8_t *encryptedPrivateKey, uint64_t key_len, uint8_t *encr_bls_key,
uint32_t *enc_bls_key_len) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(s_shares);
CHECK_STATE(encryptedPrivateKey);
CHECK_STATE(encr_bls_key);
SAFE_CHAR_BUF(skey, ECDSA_SKEY_LEN);
mpz_t sum;
mpz_init(sum);
mpz_set_ui(sum, 0);
mpz_t q;
mpz_init(q);
mpz_set_str(q, "21888242871839275222246405745257275088548364400416034343698204186575808495617", 10);
mpz_t bls_key;
mpz_init(bls_key);
int status = AES_decrypt(encryptedPrivateKey, key_len, skey, ECDSA_SKEY_LEN);
CHECK_STATUS2("aes decrypt failed with status %d");
skey[ECDSA_SKEY_LEN - 1] = 0;
int num_shares = strlen(s_shares) / 192;
for (int i = 0; i < num_shares; i++) { SAFE_CHAR_BUF(encr_sshare, 65);
strncpy(encr_sshare, s_shares + 192 * i, 64);
encr_sshare[64] = 0;
SAFE_CHAR_BUF(s_share, 193);
strncpy(s_share, s_shares + 192 * i, 192);
s_share[192] = 0;
SAFE_CHAR_BUF(common_key, 65);
status = session_key_recover(skey, s_share, common_key);
CHECK_STATUS("session_key_recover failed");
common_key[64] = 0;
SAFE_CHAR_BUF(decr_sshare, 65);
status = xor_decrypt(common_key, encr_sshare, decr_sshare);
CHECK_STATUS("xor_decrypt failed");
decr_sshare[64] = 0;
mpz_t decr_secret_share;
mpz_init(decr_secret_share);
if (mpz_set_str(decr_secret_share, decr_sshare, 16) == -1) {
*errStatus = 111;
snprintf(errString, BUF_LEN, "invalid decrypted secret share");
LOG_ERROR(errString);
mpz_clear(decr_secret_share);
goto clean;
}
mpz_addmul_ui(sum, decr_secret_share, 1);
mpz_clear(decr_secret_share);
}
mpz_mod(bls_key, sum, q);
SAFE_CHAR_BUF(key_share, BLS_KEY_LENGTH);
SAFE_CHAR_BUF(arr_skey_str, BUF_LEN);
mpz_get_str(arr_skey_str, 16, bls_key);
int n_zeroes = 64 - strlen(arr_skey_str);
for (int i = 0; i < n_zeroes; i++) {
key_share[i] = '0';
}
strncpy(key_share + n_zeroes, arr_skey_str, 65 - n_zeroes);
key_share[BLS_KEY_LENGTH - 1] = 0;
status = AES_encrypt(key_share, encr_bls_key, BUF_LEN);
CHECK_STATUS2("aes encrypt bls private key failed with status %d ");
*enc_bls_key_len = strlen(key_share) + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE;
SET_SUCCESS
clean:
mpz_clear(bls_key);
mpz_clear(sum);
mpz_clear(q);
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 476 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedDecryptDkgSecretAES | trustedDecryptDkgSecretAES( int * errStatus , char * errString , uint8_t * encrypted_dkg_secret , uint32_t enc_len , uint8_t * decrypted_dkg_secret) | ['errStatus', 'errString', 'encrypted_dkg_secret', 'enc_len', 'decrypted_dkg_secret'] | trustedDecryptDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_secret,
uint32_t enc_len,
uint8_t *decrypted_dkg_secret) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_dkg_secret);
CHECK_STATE(decrypted_dkg_secret);
int status = AES_decrypt(encrypted_dkg_secret, enc_len, (char *) decrypted_dkg_secret,
3072);
CHECK_STATUS2("aes decrypt data - encrypted_dkg_secret failed with status %d")
SET_SUCCESS
clean:
;
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 75 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedDecryptKeyAES | trustedDecryptKeyAES( int * errStatus , char * errString , uint8_t * encryptedPrivateKey , uint32_t enc_len , char * key) | ['errStatus', 'errString', 'encryptedPrivateKey', 'enc_len', 'key'] | void trustedDecryptKeyAES(int *errStatus, char *errString, uint8_t *encryptedPrivateKey,
uint32_t enc_len, char *key) {
LOG_DEBUG(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encryptedPrivateKey);
CHECK_STATE(key);
*errStatus = -9;
int status = AES_decrypt_DH(encryptedPrivateKey, enc_len, key, 3072);
if (status != 0) {
*errStatus = status;
snprintf(errString, BUF_LEN, "aes decrypt failed with status %d", status);
LOG_ERROR(errString);
goto clean;
}
*errStatus = -10;
uint64_t keyLen = strnlen(key, MAX_KEY_LENGTH);
if (keyLen == MAX_KEY_LENGTH) {
snprintf(errString, BUF_LEN, "Key is not null terminated");
LOG_ERROR(errString);
goto clean;
}
SET_SUCCESS
clean:
;
} | 136 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedDkgVerifyAES | trustedDkgVerifyAES( int * errStatus , char * errString , const char * public_shares , const char * s_share , uint8_t * encryptedPrivateKey , uint64_t enc_len , unsigned _t , int _ind , int * result) | ['errStatus', 'errString', 'public_shares', 's_share', 'encryptedPrivateKey', 'enc_len', '_t', '_ind', 'result'] | void trustedDkgVerifyAES(int *errStatus, char *errString, const char *public_shares, const char *s_share,
uint8_t *encryptedPrivateKey, uint64_t enc_len, unsigned _t, int _ind, int *result) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(public_shares);
CHECK_STATE(s_share);
CHECK_STATE(encryptedPrivateKey);
SAFE_CHAR_BUF(skey, ECDSA_SKEY_LEN);
mpz_t s;
mpz_init(s);
int status = AES_decrypt(encryptedPrivateKey, enc_len, skey, ECDSA_SKEY_LEN);
CHECK_STATUS2("AES_decrypt failed (in trustedDkgVerifyAES) with status %d");
SAFE_CHAR_BUF(encr_sshare, ECDSA_SKEY_LEN);
strncpy(encr_sshare, s_share, ECDSA_SKEY_LEN - 1);
SAFE_CHAR_BUF(common_key, ECDSA_SKEY_LEN);
status = session_key_recover(skey, s_share, common_key);
CHECK_STATUS("session_key_recover failed");
SAFE_CHAR_BUF(decr_sshare, ECDSA_SKEY_LEN);
status=xor_decrypt(common_key, encr_sshare, decr_sshare);
CHECK_STATUS("xor_decrypt failed")
status = mpz_set_str(s, decr_sshare, 16);
CHECK_STATUS("invalid decr secret share");
*result = Verification(public_shares, s, _t, _ind);
SET_SUCCESS
clean:
mpz_clear(s);
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 205 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedEcdsaSignAES | trustedEcdsaSignAES( int * errStatus , char * errString , uint8_t * encryptedPrivateKey , uint32_t enc_len , const char * hash , char * sigR , char * sigS , uint8_t * sig_v , int base) | ['errStatus', 'errString', 'encryptedPrivateKey', 'enc_len', 'hash', 'sigR', 'sigS', 'sig_v', 'base'] | void trustedEcdsaSignAES(int *errStatus, char *errString, uint8_t *encryptedPrivateKey, uint32_t enc_len,
const char *hash, char *sigR, char *sigS, uint8_t *sig_v, int base) {
LOG_DEBUG(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encryptedPrivateKey);
CHECK_STATE(hash);
CHECK_STATE(sigR);
CHECK_STATE(sigS);
SAFE_CHAR_BUF(skey, ECDSA_SKEY_LEN);
mpz_t privateKeyMpz;
mpz_init(privateKeyMpz);
mpz_t msgMpz;
mpz_init(msgMpz);
signature sign = signature_init();
int status = AES_decrypt(encryptedPrivateKey, enc_len, skey, ECDSA_SKEY_LEN);
CHECK_STATUS2("aes decrypt failed with status %d");
skey[enc_len - SGX_AESGCM_MAC_SIZE - SGX_AESGCM_IV_SIZE] = '\0';
if (mpz_set_str(privateKeyMpz, skey, ECDSA_SKEY_BASE) == -1) {
*errStatus = -1;
snprintf(errString, BUF_LEN, "invalid secret key");
LOG_ERROR(errString);
goto clean;
}
if (mpz_set_str(msgMpz, hash, 16) == -1) {
*errStatus = -1;
snprintf(errString, BUF_LEN, "invalid message hash");
LOG_ERROR(errString);
goto clean;
}
signature_sign(sign, msgMpz, privateKeyMpz, curve);
sigCounter++;
if (sigCounter % 1000 == 0) {
point Pkey = point_init();
signature_extract_public_key(Pkey, privateKeyMpz, curve);
if (!signature_verify(msgMpz, sign, Pkey, curve)) {
*errStatus = -2;
snprintf(errString, BUF_LEN, "signature is not verified! ");
point_clear(Pkey);
goto clean;
}
point_clear(Pkey);
}
SAFE_CHAR_BUF(arrM, BUF_LEN);
mpz_get_str(arrM, 16, msgMpz);
snprintf(errString, BUF_LEN, "message is %s ", arrM);
SAFE_CHAR_BUF(arrR, BUF_LEN);
mpz_get_str(arrR, base, sign->r);
strncpy(sigR, arrR, 1024);
SAFE_CHAR_BUF(arrS, BUF_LEN);
mpz_get_str(arrS, base, sign->s);
strncpy(sigS, arrS, 1024);
*sig_v = sign->v;
SET_SUCCESS
clean:
mpz_clear(privateKeyMpz);
mpz_clear(msgMpz);
signature_free(sign);
LOG_DEBUG(__FUNCTION__ );
LOG_DEBUG("SGX call completed");
} | 403 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedEnclaveInit | trustedEnclaveInit( uint32_t _logLevel) | ['_logLevel'] | void trustedEnclaveInit(uint32_t _logLevel) {
CALL_ONCE
LOG_INFO(__FUNCTION__);
globalLogLevel_ = _logLevel;
oc_realloc_func = &reallocate_function;
oc_free_func = &free_function;
LOG_INFO("Setting memory functions");
mp_get_memory_functions(NULL, &gmp_realloc_func, &gmp_free_func);
mp_set_memory_functions(NULL, oc_realloc_func, oc_free_func);
LOG_INFO("Calling enclave init");
enclave_init();
LOG_INFO("Reading random");
globalRandom = calloc(32,1);
int ret = sgx_read_rand(globalRandom, 32);
if(ret != SGX_SUCCESS)
{
LOG_ERROR("sgx_read_rand failed. Aboring enclave.");
abort();
}
LOG_INFO("Successfully inited enclave. Signed enclave version:" SIGNED_ENCLAVE_VERSION );
#ifndef SGX_DEBUG
LOG_INFO("SECURITY WARNING: sgxwallet is running in INSECURE DEBUG MODE! NEVER USE IN PRODUCTION!");
#endif
#if SGX_DEBUG != 0
LOG_INFO("SECURITY WARNING: sgxwallet is running in INSECURE DEBUG MODE! NEVER USE IN PRODUCTION!");
#endif
#if SGX_MODE == SIM
LOG_INFO("SECURITY WARNING: sgxwallet is running in INSECURE SIMULATION MODE! NEVER USE IN PRODUCTION!");
#endif
} | 123 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedEncryptKeyAES | trustedEncryptKeyAES( int * errStatus , char * errString , const char * key , uint8_t * encryptedPrivateKey , uint32_t * enc_len) | ['errStatus', 'errString', 'key', 'encryptedPrivateKey', 'enc_len'] | void trustedEncryptKeyAES(int *errStatus, char *errString, const char *key,
uint8_t *encryptedPrivateKey, uint32_t *enc_len) {
LOG_INFO(__FUNCTION__);
*errString = 0;
*errStatus = UNKNOWN_ERROR;
CHECK_STATE(key);
CHECK_STATE(encryptedPrivateKey);
*errStatus = UNKNOWN_ERROR;
int status = AES_encrypt_DH((char *)key, encryptedPrivateKey, BUF_LEN);
CHECK_STATUS2("AES encrypt failed with status %d");
*enc_len = strlen(key) + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE;
SAFE_CHAR_BUF(decryptedKey, BUF_LEN);
status = AES_decrypt_DH(encryptedPrivateKey, *enc_len, decryptedKey, BUF_LEN);
CHECK_STATUS2("trustedDecryptKey failed with status %d");
uint64_t decryptedKeyLen = strnlen(decryptedKey, MAX_KEY_LENGTH);
if (decryptedKeyLen == MAX_KEY_LENGTH) {
snprintf(errString, BUF_LEN, "Decrypted key is not null terminated");
LOG_ERROR(errString);
goto clean;
}
*errStatus = -8;
if (strncmp(key, decryptedKey, MAX_KEY_LENGTH) != 0) {
snprintf(errString, BUF_LEN, "Decrypted key does not match original key");
LOG_ERROR(errString);
goto clean;
}
SET_SUCCESS
clean:
;
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 201 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGenDkgSecretAES | trustedGenDkgSecretAES( int * errStatus , char * errString , uint8_t * encrypted_dkg_secret , uint32_t * enc_len , size_t _t) | ['errStatus', 'errString', 'encrypted_dkg_secret', 'enc_len', '_t'] | trustedGenDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_secret, uint32_t *enc_len, size_t _t) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_dkg_secret);
SAFE_CHAR_BUF(dkg_secret, DKG_BUFER_LENGTH);
int status = gen_dkg_poly(dkg_secret, _t);
CHECK_STATUS("gen_dkg_poly failed")
status = AES_encrypt(dkg_secret, encrypted_dkg_secret, 3 * BUF_LEN);
CHECK_STATUS("SGX AES encrypt DKG poly failed");
*enc_len = strlen(dkg_secret) + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE;
SAFE_CHAR_BUF(decr_dkg_secret, DKG_BUFER_LENGTH);
status = AES_decrypt(encrypted_dkg_secret, *enc_len, decr_dkg_secret,
DKG_BUFER_LENGTH);
CHECK_STATUS("aes decrypt dkg poly failed");
if (strcmp(dkg_secret, decr_dkg_secret) != 0) {
snprintf(errString, BUF_LEN,
"encrypted poly is not equal to decrypted poly");
LOG_ERROR(errString);
*errStatus = -333;
goto clean;
}
SET_SUCCESS
clean:
;
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 161 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGenerateEcdsaKeyAES | trustedGenerateEcdsaKeyAES( int * errStatus , char * errString , uint8_t * encryptedPrivateKey , uint32_t * enc_len , char * pub_key_x , char * pub_key_y) | ['errStatus', 'errString', 'encryptedPrivateKey', 'enc_len', 'pub_key_x', 'pub_key_y'] | void trustedGenerateEcdsaKeyAES(int *errStatus, char *errString,
uint8_t *encryptedPrivateKey, uint32_t *enc_len, char *pub_key_x, char *pub_key_y) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encryptedPrivateKey);
CHECK_STATE(pub_key_x);
CHECK_STATE(pub_key_y);
RANDOM_CHAR_BUF(rand_char, 32);
mpz_t seed;
mpz_init(seed);
mpz_t skey;
mpz_init(skey);
point Pkey = point_init();
mpz_import(seed, 32, 1, sizeof(rand_char[0]), 0, 0, rand_char);
mpz_mod(skey, seed, curve->p);
signature_extract_public_key(Pkey, skey, curve);
SAFE_CHAR_BUF(arr_x, BUF_LEN);
mpz_get_str(arr_x, ECDSA_SKEY_BASE, Pkey->x);
int n_zeroes = 64 - strlen(arr_x);
for (int i = 0; i < n_zeroes; i++) {
pub_key_x[i] = '0';
}
strncpy(pub_key_x + n_zeroes, arr_x, 1024 - n_zeroes);
SAFE_CHAR_BUF(arr_y, BUF_LEN);
mpz_get_str(arr_y, ECDSA_SKEY_BASE, Pkey->y);
n_zeroes = 64 - strlen(arr_y);
for (int i = 0; i < n_zeroes; i++) {
pub_key_y[i] = '0';
}
strncpy(pub_key_y + n_zeroes, arr_y, 1024 - n_zeroes);
SAFE_CHAR_BUF(skey_str, ECDSA_SKEY_LEN);SAFE_CHAR_BUF(arr_skey_str, mpz_sizeinbase(skey, ECDSA_SKEY_BASE) + 2);
mpz_get_str(arr_skey_str, ECDSA_SKEY_BASE, skey);
n_zeroes = 64 - strlen(arr_skey_str);
for (int i = 0; i < n_zeroes; i++) {
skey_str[i] = '0';
}
strncpy(skey_str + n_zeroes, arr_skey_str, 65 - n_zeroes);
skey_str[ECDSA_SKEY_LEN - 1] = 0;
snprintf(errString, BUF_LEN, "skey len is %d\n", (int) strlen(skey_str));
int status = AES_encrypt((char *) skey_str, encryptedPrivateKey, BUF_LEN);
CHECK_STATUS("ecdsa private key encryption failed");
*enc_len = strlen(skey_str) + SGX_AESGCM_MAC_SIZE + SGX_AESGCM_IV_SIZE;
status = AES_decrypt(encryptedPrivateKey, *enc_len, skey_str, ECDSA_SKEY_LEN);
CHECK_STATUS2("ecdsa private key decr failed with status %d");
SET_SUCCESS
clean:
mpz_clear(seed);
mpz_clear(skey);
point_clear(Pkey);
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 430 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGenerateSEK | trustedGenerateSEK( int * errStatus , char * errString , uint8_t * encrypted_sek , uint32_t * enc_len , char * sek_hex) | ['errStatus', 'errString', 'encrypted_sek', 'enc_len', 'sek_hex'] | void trustedGenerateSEK(int *errStatus, char *errString,
uint8_t *encrypted_sek, uint32_t *enc_len, char *sek_hex) {
CALL_ONCE
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_sek);
CHECK_STATE(sek_hex);
RANDOM_CHAR_BUF(SEK_raw, SGX_AESGCM_KEY_SIZE);
carray2Hex((uint8_t*) SEK_raw, SGX_AESGCM_KEY_SIZE, sek_hex);
memcpy(AES_key, SEK_raw, SGX_AESGCM_KEY_SIZE);
derive_DH_Key();
sealHexSEK(errStatus, errString, encrypted_sek, enc_len, sek_hex);
if (*errStatus != 0) {
LOG_ERROR("sealHexSEK failed");
goto clean;
}
SET_SUCCESS
clean:
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 117 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGetBlsPubKeyAES | trustedGetBlsPubKeyAES( int * errStatus , char * errString , uint8_t * encryptedPrivateKey , uint64_t key_len , char * bls_pub_key) | ['errStatus', 'errString', 'encryptedPrivateKey', 'key_len', 'bls_pub_key'] | trustedGetBlsPubKeyAES(int *errStatus, char *errString, uint8_t *encryptedPrivateKey, uint64_t key_len,
char *bls_pub_key) {
LOG_DEBUG(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(bls_pub_key);
CHECK_STATE(encryptedPrivateKey);
SAFE_CHAR_BUF(skey_hex, ECDSA_SKEY_LEN);
int status = AES_decrypt(encryptedPrivateKey, key_len, skey_hex, ECDSA_SKEY_LEN);
CHECK_STATUS2("AES decrypt failed %d");
skey_hex[ECDSA_SKEY_LEN - 1] = 0;
status = calc_bls_public_key(skey_hex, bls_pub_key);
CHECK_STATUS("could not calculate bls public key");
SET_SUCCESS
static uint64_t counter = 0;
clean:
if (counter % 1000 == 0) {
LOG_INFO(__FUNCTION__);
LOG_INFO("Thousand SGX calls completed");
}
counter++;
} | 120 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGetEncryptedSecretShareAES | trustedGetEncryptedSecretShareAES( int * errStatus , char * errString , uint8_t * encrypted_skey , uint32_t * dec_len , char * result_str , char * s_shareG2 , char * pub_keyB , uint8_t _t , uint8_t _n , uint8_t ind) | ['errStatus', 'errString', 'encrypted_skey', 'dec_len', 'result_str', 's_shareG2', 'pub_keyB', '_t', '_n', 'ind'] | void trustedGetEncryptedSecretShareAES(int *errStatus, char *errString, uint8_t *encrypted_skey, uint32_t *dec_len,
char *result_str, char *s_shareG2, char *pub_keyB, uint8_t _t, uint8_t _n,
uint8_t ind) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
uint32_t enc_len;
int status;
CHECK_STATE(encrypted_skey);
CHECK_STATE(result_str);
CHECK_STATE(s_shareG2);
CHECK_STATE(pub_keyB);
LOG_DEBUG(__FUNCTION__);
SAFE_CHAR_BUF(skey, ECDSA_SKEY_LEN);
SAFE_CHAR_BUF(pub_key_x, BUF_LEN);SAFE_CHAR_BUF(pub_key_y, BUF_LEN);
trustedGenerateEcdsaKeyAES(&status, errString, encrypted_skey, &enc_len, pub_key_x, pub_key_y);
CHECK_STATUS("trustedGenerateEcdsaKeyAES failed");
status = AES_decrypt(encrypted_skey, enc_len, skey, ECDSA_SKEY_LEN);
skey[ECDSA_SKEY_LEN - 1] = 0;
CHECK_STATUS2("AES_decrypt failed (in trustedGetEncryptedSecretShareAES) with status %d");
*dec_len = enc_len;
SAFE_CHAR_BUF(common_key, ECDSA_SKEY_LEN);
status = gen_session_key(skey, pub_keyB, common_key);
CHECK_STATUS("gen_session_key failed")
SAFE_CHAR_BUF(s_share, ECDSA_SKEY_LEN);
status = calc_secret_share(getThreadLocalDecryptedDkgPoly(), s_share, _t, _n, ind);
CHECK_STATUS("calc secret share failed")
status = calc_secret_shareG2(s_share, s_shareG2);
CHECK_STATUS("invalid decr secret share");
SAFE_CHAR_BUF(cypher, ECDSA_SKEY_LEN);
status=xor_encrypt(common_key, s_share, cypher);
CHECK_STATUS("xor_encrypt failed")
strncpy(result_str, cypher, strlen(cypher));
strncpy(result_str + strlen(cypher), pub_key_x, strlen(pub_key_x));
strncpy(result_str + strlen(pub_key_x) + strlen(pub_key_y), pub_key_y, strlen(pub_key_y));
SET_SUCCESS
clean:
;
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 304 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGetPublicEcdsaKeyAES | trustedGetPublicEcdsaKeyAES( int * errStatus , char * errString , uint8_t * encryptedPrivateKey , uint32_t enc_len , char * pub_key_x , char * pub_key_y) | ['errStatus', 'errString', 'encryptedPrivateKey', 'enc_len', 'pub_key_x', 'pub_key_y'] | void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
uint8_t *encryptedPrivateKey, uint32_t enc_len, char *pub_key_x, char *pub_key_y) {
LOG_DEBUG(__FUNCTION__);
INIT_ERROR_STATE
SAFE_CHAR_BUF(skey, ECDSA_SKEY_LEN);
mpz_t privateKeyMpz;
mpz_init(privateKeyMpz);
point pKey = point_init();
point pKey_test = point_init();
CHECK_STATE(encryptedPrivateKey);
CHECK_STATE(pub_key_x);
CHECK_STATE(pub_key_y);
int status = AES_decrypt(encryptedPrivateKey, enc_len, skey, ECDSA_SKEY_LEN);
CHECK_STATUS2("AES_decrypt failed with status %d");
skey[enc_len - SGX_AESGCM_MAC_SIZE - SGX_AESGCM_IV_SIZE] = '\0';
strncpy(errString, skey, 1024);
status = mpz_set_str(privateKeyMpz, skey, ECDSA_SKEY_BASE);
CHECK_STATUS("mpz_set_str failed for private key");
signature_extract_public_key(pKey, privateKeyMpz, curve);
point_multiplication(pKey_test, privateKeyMpz, curve->G, curve);
if (!point_cmp(pKey, pKey_test)) {
snprintf(errString, BUF_LEN, "Points are not equal");
LOG_ERROR(errString);
*errStatus = -11;
goto clean;
}
SAFE_CHAR_BUF(arr_x, BUF_LEN);
mpz_get_str(arr_x, ECDSA_SKEY_BASE, pKey->x);
int n_zeroes = 64 - strlen(arr_x);
for (int i = 0; i < n_zeroes; i++) {
pub_key_x[i] = '0';
}
strncpy(pub_key_x + n_zeroes, arr_x, 1024 - n_zeroes);
SAFE_CHAR_BUF(arr_y, BUF_LEN);
mpz_get_str(arr_y, ECDSA_SKEY_BASE, pKey->y);
n_zeroes = 64 - strlen(arr_y);
for (int i = 0; i < n_zeroes; i++) {
pub_key_y[i] = '0';
}
strncpy(pub_key_y + n_zeroes, arr_y, 1024 - n_zeroes);
SET_SUCCESS
clean:
mpz_clear(privateKeyMpz);
point_clear(pKey);
point_clear(pKey_test);
static uint64_t counter = 0;
if (counter % 1000 == 0) {
LOG_INFO(__FUNCTION__);
LOG_INFO("Thousand SGX calls completed");
}
counter++;
} | 363 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedGetPublicSharesAES | trustedGetPublicSharesAES( int * errStatus , char * errString , uint8_t * encrypted_dkg_secret , uint32_t enc_len , char * public_shares , unsigned _t , unsigned _n) | ['errStatus', 'errString', 'encrypted_dkg_secret', 'enc_len', 'public_shares', '_t', '_n'] | void trustedGetPublicSharesAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_secret, uint32_t enc_len,
char *public_shares,
unsigned _t, unsigned _n) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_dkg_secret);
CHECK_STATE(public_shares);
CHECK_STATE(_t <= _n && _n > 0)
SAFE_CHAR_BUF(decrypted_dkg_secret, DKG_MAX_SEALED_LEN);
int status = AES_decrypt(encrypted_dkg_secret, enc_len, decrypted_dkg_secret,
DKG_MAX_SEALED_LEN);
CHECK_STATUS2("aes decrypt data - encrypted_dkg_secret failed with status %d");
status = calc_public_shares(decrypted_dkg_secret, public_shares, _t) != 0;
CHECK_STATUS("t does not match polynomial in db");
SET_SUCCESS
clean:
;
LOG_INFO("SGX call completed");
} | 108 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedSetEncryptedDkgPolyAES | trustedSetEncryptedDkgPolyAES( int * errStatus , char * errString , uint8_t * encrypted_poly , uint32_t enc_len) | ['errStatus', 'errString', 'encrypted_poly', 'enc_len'] | void trustedSetEncryptedDkgPolyAES(int *errStatus, char *errString, uint8_t *encrypted_poly, uint32_t enc_len) {
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_poly);
memset(getThreadLocalDecryptedDkgPoly(), 0, DKG_BUFER_LENGTH);
int status = AES_decrypt(encrypted_poly, enc_len, (char *) getThreadLocalDecryptedDkgPoly(),
DKG_BUFER_LENGTH);
CHECK_STATUS2("sgx_unseal_data - encrypted_poly failed with status %d")
SET_SUCCESS
clean:
;
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 79 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | trustedSetSEK_backup | trustedSetSEK_backup( int * errStatus , char * errString , uint8_t * encrypted_sek , uint32_t * enc_len , const char * sek_hex) | ['errStatus', 'errString', 'encrypted_sek', 'enc_len', 'sek_hex'] | void trustedSetSEK_backup(int *errStatus, char *errString,
uint8_t *encrypted_sek, uint32_t *enc_len, const char *sek_hex) {
CALL_ONCE
LOG_INFO(__FUNCTION__);
INIT_ERROR_STATE
CHECK_STATE(encrypted_sek);
CHECK_STATE(sek_hex);
uint64_t len;
hex2carray(sek_hex, &len, (uint8_t *) AES_key);
derive_DH_Key();
sealHexSEK(errStatus, errString, encrypted_sek, enc_len, (char *)sek_hex);
if (*errStatus != 0) {
LOG_ERROR("sealHexSEK failed");
goto clean;
}
SET_SUCCESS
clean:
;
LOG_INFO(__FUNCTION__ );
LOG_INFO("SGX call completed");
} | 111 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "AES encrypt/decrypt" , "[aes-encrypt-decrypt]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "AES encrypt/decrypt", "[aes-encrypt-decrypt]") {
int errStatus = 0;
vector<char> errMsg(BUF_LEN, 0);
uint32_t encLen;
string key = SAMPLE_AES_KEY;
vector <uint8_t> encrypted_key(BUF_LEN, 0);
PRINT_SRC_LINE
auto status = trustedEncryptKeyAES(eid, &errStatus, errMsg.data(), key.c_str(), encrypted_key.data(), &encLen);
REQUIRE(status == 0);
REQUIRE(errStatus == 0);
vector<char> decr_key(BUF_LEN, 0);
PRINT_SRC_LINE
status = trustedDecryptKeyAES(eid, &errStatus, errMsg.data(), encrypted_key.data(), encLen, decr_key.data());
REQUIRE(status == 0);
REQUIRE(errStatus == 0);
REQUIRE(key.compare(decr_key.data()) == 0);
} | 164 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "DKG AES encrypted secret shares test" , "[dkg-aes-encr-sshares]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "DKG AES encrypted secret shares test", "[dkg-aes-encr-sshares]") {
vector<char> errMsg(BUF_LEN, 0);
vector<char> result(BUF_LEN, 0);
int errStatus = 0;
uint32_t encLen = 0;
vector <uint8_t> encryptedDKGSecret(BUF_LEN, 0);
PRINT_SRC_LINE
auto status = trustedGenDkgSecretAES(eid, &errStatus, errMsg.data(), encryptedDKGSecret.data(), &encLen, 2);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
uint64_t enc_len = encLen;
PRINT_SRC_LINE
status = trustedSetEncryptedDkgPolyAES(eid, &errStatus, errMsg.data(), encryptedDKGSecret.data(), enc_len);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
vector <uint8_t> encrPRDHKey(BUF_LEN, 0);
string pub_keyB = SAMPLE_PUBLIC_KEY_B;
vector<char> s_shareG2(BUF_LEN, 0);
PRINT_SRC_LINE
status = trustedGetEncryptedSecretShareAES(eid, &errStatus, errMsg.data(), encrPRDHKey.data(), &encLen,
result.data(),
s_shareG2.data(),
(char *) pub_keyB.data(), 2, 2, 1);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
} | 235 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "DKG AES gen test" , "[dkg-aes-gen]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "DKG AES gen test", "[dkg-aes-gen]") {
vector <uint8_t> encryptedDKGSecret(BUF_LEN, 0);
vector<char> errMsg(BUF_LEN, 0);
int errStatus = 0;
uint32_t encLen = 0;
PRINT_SRC_LINE
auto status = trustedGenDkgSecretAES(eid, &errStatus, errMsg.data(), encryptedDKGSecret.data(), &encLen, 32);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
vector<char> secret(BUF_LEN, 0);
vector<char> errMsg1(BUF_LEN, 0);
status = trustedDecryptDkgSecretAES(eid, &errStatus, errMsg1.data(), encryptedDKGSecret.data(),
encLen, (uint8_t *) secret.data());
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
} | 155 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "DKG AES public shares test" , "[dkg-aes-pub-shares]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "DKG AES public shares test", "[dkg-aes-pub-shares]") {
vector <uint8_t> encryptedDKGSecret(BUF_LEN, 0);
vector<char> errMsg(BUF_LEN, 0);
int errStatus = 0;
uint32_t encLen = 0;
unsigned t = 32, n = 32;
PRINT_SRC_LINE
auto status = trustedGenDkgSecretAES(eid, &errStatus, errMsg.data(), encryptedDKGSecret.data(), &encLen, n);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
vector<char> errMsg1(BUF_LEN, 0);
char colon = ':';
vector<char> pubShares(10000, 0);
PRINT_SRC_LINE
status = trustedGetPublicSharesAES(eid, &errStatus, errMsg1.data(),
encryptedDKGSecret.data(), encLen, pubShares.data(), t, n);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
vector <string> g2Strings = splitString(pubShares.data(), ',');
vector <libff::alt_bn128_G2> pubSharesG2;
for (u_int64_t i = 0; i < g2Strings.size(); i++) {
vector <string> coeffStr = splitString(g2Strings.at(i).c_str(), ':');
pubSharesG2.push_back(TestUtils::vectStringToG2(coeffStr));
}
vector<char> secret(BUF_LEN, 0);
PRINT_SRC_LINE
status = trustedDecryptDkgSecretAES(eid, &errStatus, errMsg1.data(), encryptedDKGSecret.data(), encLen,
(uint8_t *) secret.data());
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
signatures::Dkg dkgObj(t, n);
vector <libff::alt_bn128_Fr> poly = TestUtils::splitStringToFr(secret.data(), colon);
vector <libff::alt_bn128_G2> pubSharesDkg = dkgObj.VerificationVector(poly);
for (uint32_t i = 0; i < pubSharesDkg.size(); i++) {
libff::alt_bn128_G2 el = pubSharesDkg.at(i);
el.to_affine_coordinates();
}
REQUIRE(pubSharesG2 == pubSharesDkg);
} | 400 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "ECDSA AES get public key" , "[ecdsa-aes-get-pub-key]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "ECDSA AES get public key", "[ecdsa-aes-get-pub-key]") {
int errStatus = 0;
vector<char> errMsg(BUF_LEN, 0);
vector <uint8_t> encPrivKey(BUF_LEN, 0);
vector<char> pubKeyX(BUF_LEN, 0);
vector<char> pubKeyY(BUF_LEN, 0);
uint32_t encLen = 0;
PRINT_SRC_LINE
auto status = trustedGenerateEcdsaKeyAES(eid, &errStatus, errMsg.data(), encPrivKey.data(), &encLen, pubKeyX.data(),
pubKeyY.data());
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
vector<char> receivedPubKeyX(BUF_LEN, 0);
vector<char> receivedPubKeyY(BUF_LEN, 0);
PRINT_SRC_LINE
status = trustedGetPublicEcdsaKeyAES(eid, &errStatus, errMsg.data(), encPrivKey.data(), encLen,
receivedPubKeyX.data(),
receivedPubKeyY.data());
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
} | 190 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "ECDSA AES key gen" , "[ecdsa-aes-key-gen]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "ECDSA AES key gen", "[ecdsa-aes-key-gen]") {
vector<char> errMsg(BUF_LEN, 0);
int errStatus = 0;
vector <uint8_t> encrPrivKey(BUF_LEN, 0);
vector<char> pubKeyX(BUF_LEN, 0);
vector<char> pubKeyY(BUF_LEN, 0);
uint32_t encLen = 0;
PRINT_SRC_LINE
auto status = trustedGenerateEcdsaKeyAES(eid, &errStatus, errMsg.data(), encrPrivKey.data(), &encLen,
pubKeyX.data(),
pubKeyY.data());
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
} | 117 | True | 1 |
CVE-2021-36218 | 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/skalenetwork/sgxwallet/releases', 'name': 'https://github.com/skalenetwork/sgxwallet/releases', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', 'name': 'https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195', '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:skale:sgxwallet:1.58.3:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in SKALE sgxwallet 1.58.3. sgx_disp_ippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0'}] | 2021-10-02T02:05Z | 2021-09-27T14: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 | kladko | 2020-09-08 15:30:59+03:00 | SKALE-3205-restart | 77425c862ad20cd270d42c54f3d63e1eb4e02195 | False | skalenetwork/sgxwallet | sgxwallet is the first-ever opensource high-performance hardware secure crypto wallet that is based on Intel SGX technology. First opensource product on Intel SGX whitelist. Scales to 100,000+ transactions per second. Currently supports ETH and SKALE, and will support BTC in the future. Sgxwallet is under heavy development and use by SKALE network. | 2019-09-04 07:46:31 | 2022-08-17 10:56:12 | https://skale.network | skalenetwork | 49.0 | 25.0 | TEST_CASE_METHOD | TEST_CASE_METHOD( TestFixture , "ECDSA AES keygen and signature test" , "[ecdsa-aes-key-sig-gen]") | ['TestFixture'] | TEST_CASE_METHOD(TestFixture, "ECDSA AES keygen and signature test", "[ecdsa-aes-key-sig-gen]") {
vector<char> errMsg(BUF_LEN, 0);
int errStatus = 0;
vector <uint8_t> encrPrivKey(BUF_LEN, 0);
vector<char> pubKeyX(BUF_LEN, 0);
vector<char> pubKeyY(BUF_LEN, 0);
uint32_t encLen = 0;
PRINT_SRC_LINE
auto status = trustedGenerateEcdsaKeyAES(eid, &errStatus, errMsg.data(), encrPrivKey.data(), &encLen,
pubKeyX.data(),
pubKeyY.data());
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
string hex = SAMPLE_HEX_HASH;
vector<char> signatureR(BUF_LEN, 0);
vector<char> signatureS(BUF_LEN, 0);
uint8_t signatureV = 0;
for (int i = 0; i < 50; i++) {
PRINT_SRC_LINE
status = trustedEcdsaSignAES(eid, &errStatus, errMsg.data(), encrPrivKey.data(), encLen,
hex.data(),
signatureR.data(),
signatureS.data(), &signatureV, 16);
REQUIRE(status == SGX_SUCCESS);
REQUIRE(errStatus == SGX_SUCCESS);
}
} | 227 | True | 1 |
CVE-2021-36357 | 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/open-power/skiboot/commit/5be38b672c1410e2f10acd3ad2eecfdc81d5daf7', 'name': 'https://github.com/open-power/skiboot/commit/5be38b672c1410e2f10acd3ad2eecfdc81d5daf7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-681'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:openpowerfoundation:skiboot:2.6:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in OpenPOWER 2.6 firmware. unpack_timestamp() calls le32_to_cpu() for endian conversion of a uint16_t "year" value, resulting in a type mismatch that can truncate a higher integer value to a smaller one, and bypass a timestamp check. The fix is to use the right endian conversion function.'}] | 2021-10-27T12:30Z | 2021-10-22T12:15Z | Incorrect Conversion between Numeric Types | When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur. | https://cwe.mitre.org/data/definitions/681.html | 0 | Nayna Jain | 2021-06-20 11:13:47-04:00 | secvar: fix endian conversion
unpack_timestamp() calls le32_to_cpu() for endian conversion of
uint16_t "year" value. This patch fixes the code to use le16_to_cpu().
Signed-off-by: Nayna Jain <[email protected]>
Reviewed-by: Daniel Axtens <[email protected]>
Signed-off-by: Vasant Hegde <[email protected]> | 5be38b672c1410e2f10acd3ad2eecfdc81d5daf7 | False | open-power/skiboot | OPAL boot and runtime firmware for POWER | 2014-07-02 06:42:26 | 2022-08-23 15:41:07 | open-power | 93.0 | 127.0 | unpack_timestamp | unpack_timestamp( const struct efi_time * timestamp) | ['timestamp'] | static uint64_t unpack_timestamp(const struct efi_time *timestamp)
{
uint64_t val = 0;
uint16_t year = le32_to_cpu(timestamp->year);
/* pad1, nanosecond, timezone, daylight and pad2 are meant to be zero */
val |= ((uint64_t) timestamp->pad1 & 0xFF) << 0;
val |= ((uint64_t) timestamp->second & 0xFF) << (1*8);
val |= ((uint64_t) timestamp->minute & 0xFF) << (2*8);
val |= ((uint64_t) timestamp->hour & 0xFF) << (3*8);
val |= ((uint64_t) timestamp->day & 0xFF) << (4*8);
val |= ((uint64_t) timestamp->month & 0xFF) << (5*8);
val |= ((uint64_t) year) << (6*8);
return val;
} | 160 | True | 1 |
||
CVE-2021-36979 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30391', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30391', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unicorn/OSV-2020-2305.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/unicorn/OSV-2020-2305.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/bf1713d9e011b55ca1f502a6779fc4722b4bb077', 'name': 'https://github.com/unicorn-engine/unicorn/commit/bf1713d9e011b55ca1f502a6779fc4722b4bb077', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MZ6LOCJXHQVU6SCJLFDJINBOVJYYENLX/', 'name': 'FEDORA-2021-53dd27bb86', '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:unicorn-engine:unicorn_engine:1.0.2:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Unicorn Engine 1.0.2 has an out-of-bounds write in tb_flush_armeb (called from cpu_arm_exec_armeb and tcg_cpu_exec_armeb).'}] | 2021-12-03T13:48Z | 2021-07-20T07:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | lazymio | 2021-03-30 12:06:26+08:00 | Add arm ite blocks samples from #853 (#1381) | bf1713d9e011b55ca1f502a6779fc4722b4bb077 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | main | main( int argc , char ** argv , char ** envp) | ['argc', 'argv', 'envp'] | int main(int argc, char **argv, char **envp)
{
// dynamically load shared library
#ifdef DYNLOAD
if (!uc_dyn_load(NULL, 0)) {
printf("Error dynamically loading shared library.\n");
printf("Please check that unicorn.dll/unicorn.so is available as well as\n");
printf("any other dependent dll/so files.\n");
printf("The easiest way is to place them in the same directory as this app.\n");
return 1;
}
#endif
test_arm();
printf("==========================\n");
test_thumb();
// dynamically free shared library
#ifdef DYNLOAD
uc_dyn_free();
#endif
return 0;
} | 70 | True | 1 |
CVE-2021-44078 | 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:N/UI:N/S:C/C:H/I:H/A:H | LOCAL | HIGH | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 8.1 | HIGH | 1.4 | 6.0 | False | [{'url': 'https://gist.github.com/jwang-a/cb4b6e9551457aa299066076b836a2cd', 'name': 'https://gist.github.com/jwang-a/cb4b6e9551457aa299066076b836a2cd', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/compare/2.0.0-rc4...2.0.0-rc5', 'name': 'https://github.com/unicorn-engine/unicorn/compare/2.0.0-rc4...2.0.0-rc5', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/jwang-a/CTF/blob/master/MyChallenges/Pwn/Unicorns_Aisle/UnicornsAisle.pdf', 'name': 'https://github.com/jwang-a/CTF/blob/master/MyChallenges/Pwn/Unicorns_Aisle/UnicornsAisle.pdf', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/c733bbada356b0373fa8aa72c044574bb855fd24', 'name': 'https://github.com/unicorn-engine/unicorn/commit/c733bbada356b0373fa8aa72c044574bb855fd24', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.unicorn-engine.org/changelog/', 'name': 'https://www.unicorn-engine.org/changelog/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-697'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.0.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in split_region in uc.c in Unicorn Engine before 2.0.0-rc5. It allows local attackers to escape the sandbox. An attacker must first obtain the ability to execute crafted code in the target sandbox in order to exploit this vulnerability. The specific flaw exists within the virtual memory manager. The issue results from the faulty comparison of GVA and GPA while calling uc_mem_map_ptr to free part of a claimed memory block. An attacker can leverage this vulnerability to escape the sandbox and execute arbitrary code on the host machine.'}] | 2022-01-07T18:29Z | 2021-12-26T05:15Z | Incorrect Comparison | The software compares two entities in a security-relevant context, but the comparison is incorrect, which may lead to resultant weaknesses. |
This weakness class covers several possibilities:
the comparison checks one factor incorrectly;
the comparison should consider multiple factors, but it does not check some of those factors at all;
the comparison checks the wrong factor.
| https://cwe.mitre.org/data/definitions/697.html | 0 | lazymio | 2021-11-23 23:22:53+01:00 | Fix wrong offset used in split_region | c733bbada356b0373fa8aa72c044574bb855fd24 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | uc_invalidate_tb | uc_invalidate_tb( struct uc_struct * uc , uint64_t start_addr , size_t len) | ['uc', 'start_addr', 'len'] | static void uc_invalidate_tb(struct uc_struct *uc, uint64_t start_addr, size_t len)
{
tb_page_addr_t start, end;
// GVA to GPA (GPA -> HVA via page_find, HVA->HPA via host mmu)
start = get_page_addr_code(uc->cpu->env_ptr, start_addr) & (target_ulong)(-1);
// For 32bit target.
end = (start + len) & (target_ulong)(-1);
// We get a wrap?
if (start > end) {
return;
}
tb_invalidate_phys_range(uc, start, end);
} | 76 | True | 1 |
CVE-2021-44078 | 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:N/UI:N/S:C/C:H/I:H/A:H | LOCAL | HIGH | NONE | NONE | CHANGED | HIGH | HIGH | HIGH | 8.1 | HIGH | 1.4 | 6.0 | False | [{'url': 'https://gist.github.com/jwang-a/cb4b6e9551457aa299066076b836a2cd', 'name': 'https://gist.github.com/jwang-a/cb4b6e9551457aa299066076b836a2cd', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/compare/2.0.0-rc4...2.0.0-rc5', 'name': 'https://github.com/unicorn-engine/unicorn/compare/2.0.0-rc4...2.0.0-rc5', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/jwang-a/CTF/blob/master/MyChallenges/Pwn/Unicorns_Aisle/UnicornsAisle.pdf', 'name': 'https://github.com/jwang-a/CTF/blob/master/MyChallenges/Pwn/Unicorns_Aisle/UnicornsAisle.pdf', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/c733bbada356b0373fa8aa72c044574bb855fd24', 'name': 'https://github.com/unicorn-engine/unicorn/commit/c733bbada356b0373fa8aa72c044574bb855fd24', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.unicorn-engine.org/changelog/', 'name': 'https://www.unicorn-engine.org/changelog/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-697'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.0.3', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in split_region in uc.c in Unicorn Engine before 2.0.0-rc5. It allows local attackers to escape the sandbox. An attacker must first obtain the ability to execute crafted code in the target sandbox in order to exploit this vulnerability. The specific flaw exists within the virtual memory manager. The issue results from the faulty comparison of GVA and GPA while calling uc_mem_map_ptr to free part of a claimed memory block. An attacker can leverage this vulnerability to escape the sandbox and execute arbitrary code on the host machine.'}] | 2022-01-07T18:29Z | 2021-12-26T05:15Z | Incorrect Comparison | The software compares two entities in a security-relevant context, but the comparison is incorrect, which may lead to resultant weaknesses. |
This weakness class covers several possibilities:
the comparison checks one factor incorrectly;
the comparison should consider multiple factors, but it does not check some of those factors at all;
the comparison checks the wrong factor.
| https://cwe.mitre.org/data/definitions/697.html | 0 | lazymio | 2021-11-23 23:22:53+01:00 | Fix wrong offset used in split_region | c733bbada356b0373fa8aa72c044574bb855fd24 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | split_region | split_region( struct uc_struct * uc , MemoryRegion * mr , uint64_t address , size_t size , bool do_delete) | ['uc', 'mr', 'address', 'size', 'do_delete'] | static bool split_region(struct uc_struct *uc, MemoryRegion *mr,
uint64_t address, size_t size, bool do_delete)
{
uint8_t *backup;
uint32_t perms;
uint64_t begin, end, chunk_end;
size_t l_size, m_size, r_size;
RAMBlock *block = NULL;
bool prealloc = false;
chunk_end = address + size;
// if this region belongs to area [address, address+size],
// then there is no work to do.
if (address <= mr->addr && chunk_end >= mr->end) {
return true;
}
if (size == 0) {
// trivial case
return true;
}
if (address >= mr->end || chunk_end <= mr->addr) {
// impossible case
return false;
}
QLIST_FOREACH(block, &uc->ram_list.blocks, next)
{
if (block->offset <= mr->addr &&
block->used_length >= (mr->end - mr->addr)) {
break;
}
}
if (block == NULL) {
return false;
}
// RAM_PREALLOC is not defined outside exec.c and I didn't feel like
// moving it
prealloc = !!(block->flags & 1);
if (block->flags & 1) {
backup = block->host;
} else {
backup = copy_region(uc, mr);
if (backup == NULL) {
return false;
}
}
// save the essential information required for the split before mr gets
// deleted
perms = mr->perms;
begin = mr->addr;
end = mr->end;
// unmap this region first, then do split it later
if (uc_mem_unmap(uc, mr->addr, (size_t)int128_get64(mr->size)) !=
UC_ERR_OK) {
goto error;
}
/* overlapping cases
* |------mr------|
* case 1 |---size--|
* case 2 |--size--|
* case 3 |---size--|
*/
// adjust some things
if (address < begin) {
address = begin;
}
if (chunk_end > end) {
chunk_end = end;
}
// compute sub region sizes
l_size = (size_t)(address - begin);
r_size = (size_t)(end - chunk_end);
m_size = (size_t)(chunk_end - address);
// If there are error in any of the below operations, things are too far
// gone at that point to recover. Could try to remap orignal region, but
// these smaller allocation just failed so no guarantee that we can recover
// the original allocation at this point
if (l_size > 0) {
if (!prealloc) {
if (uc_mem_map(uc, begin, l_size, perms) != UC_ERR_OK) {
goto error;
}
if (uc_mem_write(uc, begin, backup, l_size) != UC_ERR_OK) {
goto error;
}
} else {
if (uc_mem_map_ptr(uc, begin, l_size, perms, backup) != UC_ERR_OK) {
goto error;
}
}
}
if (m_size > 0 && !do_delete) {
if (!prealloc) {
if (uc_mem_map(uc, address, m_size, perms) != UC_ERR_OK) {
goto error;
}
if (uc_mem_write(uc, address, backup + l_size, m_size) !=
UC_ERR_OK) {
goto error;
}
} else {
if (uc_mem_map_ptr(uc, address, m_size, perms, backup + l_size) !=
UC_ERR_OK) {
goto error;
}
}
}
if (r_size > 0) {
if (!prealloc) {
if (uc_mem_map(uc, chunk_end, r_size, perms) != UC_ERR_OK) {
goto error;
}
if (uc_mem_write(uc, chunk_end, backup + l_size + m_size, r_size) !=
UC_ERR_OK) {
goto error;
}
} else {
if (uc_mem_map_ptr(uc, chunk_end, r_size, perms,
backup + l_size + m_size) != UC_ERR_OK) {
goto error;
}
}
}
if (!prealloc) {
free(backup);
}
return true;
error:
if (!prealloc) {
free(backup);
}
return false;
} | 604 | True | 1 |
CVE-2022-29694 | 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/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'name': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'name': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'name': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Unicorn Engine v2.0.0-rc7 and below was discovered to contain a NULL pointer dereference via qemu_ram_free.'}] | 2022-06-13T13:47Z | 2022-06-02T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | lazymio | 2022-04-16 19:17:41+02:00 | Fix crash when mapping a big memory and calling uc_close | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | find_ram_offset | find_ram_offset( struct uc_struct * uc , ram_addr_t size) | ['uc', 'size'] | static ram_addr_t find_ram_offset(struct uc_struct *uc, ram_addr_t size)
{
RAMBlock *block, *next_block;
ram_addr_t offset = RAM_ADDR_MAX, mingap = RAM_ADDR_MAX;
assert(size != 0); /* it would hand out same offset multiple times */
if (QLIST_EMPTY(&uc->ram_list.blocks)) {
return 0;
}
RAMBLOCK_FOREACH(block) {
ram_addr_t candidate, next = RAM_ADDR_MAX;
/* Align blocks to start on a 'long' in the bitmap
* which makes the bitmap sync'ing take the fast path.
*/
candidate = block->offset + block->max_length;
candidate = ROUND_UP(candidate, BITS_PER_LONG << TARGET_PAGE_BITS);
/* Search for the closest following block
* and find the gap.
*/
RAMBLOCK_FOREACH(next_block) {
if (next_block->offset >= candidate) {
next = MIN(next, next_block->offset);
}
}
/* If it fits remember our place and remember the size
* of gap, but keep going so that we might find a smaller
* gap to fill so avoiding fragmentation.
*/
if (next - candidate >= size && next - candidate < mingap) {
offset = candidate;
mingap = next - candidate;
}
}
if (offset == RAM_ADDR_MAX) {
fprintf(stderr, "Failed to find gap of requested size: %" PRIu64 "\n",
(uint64_t)size);
abort();
}
return offset;
} | 169 | True | 1 |
CVE-2022-29694 | 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/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'name': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'name': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'name': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Unicorn Engine v2.0.0-rc7 and below was discovered to contain a NULL pointer dereference via qemu_ram_free.'}] | 2022-06-13T13:47Z | 2022-06-02T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | lazymio | 2022-04-16 19:17:41+02:00 | Fix crash when mapping a big memory and calling uc_close | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | qemu_ram_free | qemu_ram_free( struct uc_struct * uc , RAMBlock * block) | ['uc', 'block'] | void qemu_ram_free(struct uc_struct *uc, RAMBlock *block)
{
if (!block) {
return;
}
//if (block->host) {
// ram_block_notify_remove(block->host, block->max_length);
//}
QLIST_REMOVE(block, next);
uc->ram_list.mru_block = NULL;
/* Write list before version */
//smp_wmb();
// call_rcu(block, reclaim_ramblock, rcu);
reclaim_ramblock(uc, block);
} | 44 | True | 1 |
CVE-2022-29694 | 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/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'name': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'name': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'name': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Unicorn Engine v2.0.0-rc7 and below was discovered to contain a NULL pointer dereference via qemu_ram_free.'}] | 2022-06-13T13:47Z | 2022-06-02T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | lazymio | 2022-04-16 19:17:41+02:00 | Fix crash when mapping a big memory and calling uc_close | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | ram_block_add | ram_block_add( struct uc_struct * uc , RAMBlock * new_block) | ['uc', 'new_block'] | static void ram_block_add(struct uc_struct *uc, RAMBlock *new_block)
{
RAMBlock *block;
RAMBlock *last_block = NULL;
new_block->offset = find_ram_offset(uc, new_block->max_length);
if (!new_block->host) {
new_block->host = phys_mem_alloc(uc, new_block->max_length,
&new_block->mr->align);
if (!new_block->host) {
// error_setg_errno(errp, errno,
// "cannot set up guest memory '%s'",
// memory_region_name(new_block->mr));
return;
}
// memory_try_enable_merging(new_block->host, new_block->max_length);
}
/* Keep the list sorted from biggest to smallest block. Unlike QTAILQ,
* QLIST (which has an RCU-friendly variant) does not have insertion at
* tail, so save the last element in last_block.
*/
RAMBLOCK_FOREACH(block) {
last_block = block;
if (block->max_length < new_block->max_length) {
break;
}
}
if (block) {
QLIST_INSERT_BEFORE(block, new_block, next);
} else if (last_block) {
QLIST_INSERT_AFTER(last_block, new_block, next);
} else { /* list is empty */
QLIST_INSERT_HEAD(&uc->ram_list.blocks, new_block, next);
}
uc->ram_list.mru_block = NULL;
/* Write list before version */
//smp_wmb();
cpu_physical_memory_set_dirty_range(new_block->offset,
new_block->used_length,
DIRTY_CLIENTS_ALL);
} | 169 | True | 1 |
CVE-2022-29694 | 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/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'name': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'name': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'name': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Unicorn Engine v2.0.0-rc7 and below was discovered to contain a NULL pointer dereference via qemu_ram_free.'}] | 2022-06-13T13:47Z | 2022-06-02T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | lazymio | 2022-04-16 19:17:41+02:00 | Fix crash when mapping a big memory and calling uc_close | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | memory_map | memory_map( struct uc_struct * uc , hwaddr begin , size_t size , uint32_t perms) | ['uc', 'begin', 'size', 'perms'] | MemoryRegion *memory_map(struct uc_struct *uc, hwaddr begin, size_t size, uint32_t perms)
{
MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram(uc, ram, size, perms);
if (ram->addr == -1) {
// out of memory
return NULL;
}
memory_region_add_subregion(uc->system_memory, begin, ram);
if (uc->cpu) {
tlb_flush(uc->cpu);
}
return ram;
} | 83 | True | 1 |
CVE-2022-29694 | 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/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/6a879a082d4d67a5d13f1233ae0334cde0a7f844', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'name': 'https://github.com/unicorn-engine/unicorn/pull/1593/commits/31389e59457f304be3809f9679f91a42daa7ebaa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'name': 'https://violentbinary.github.io/posts/2-simple-analysis-of-software-virtualization-of-memory-in-unicorn-engine/', 'refsource': 'MISC', 'tags': ['Exploit', 'Technical Description', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'name': 'https://github.com/unicorn-engine/unicorn/commit/3d3deac5e6d38602b689c4fef5dac004f07a2e63', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'name': 'https://github.com/unicorn-engine/unicorn/issues/1588', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:2.0.0:rc6:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:unicorn-engine:unicorn_engine:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.0.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Unicorn Engine v2.0.0-rc7 and below was discovered to contain a NULL pointer dereference via qemu_ram_free.'}] | 2022-06-13T13:47Z | 2022-06-02T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | lazymio | 2022-04-16 19:17:41+02:00 | Fix crash when mapping a big memory and calling uc_close | 3d3deac5e6d38602b689c4fef5dac004f07a2e63 | False | unicorn-engine/unicorn | Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86) | 2015-08-20 16:35:45 | 2022-08-19 05:10:44 | http://www.unicorn-engine.org | unicorn-engine | 5539.0 | 1110.0 | memory_map_ptr | memory_map_ptr( struct uc_struct * uc , hwaddr begin , size_t size , uint32_t perms , void * ptr) | ['uc', 'begin', 'size', 'perms', 'ptr'] | MemoryRegion *memory_map_ptr(struct uc_struct *uc, hwaddr begin, size_t size, uint32_t perms, void *ptr)
{
MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram_ptr(uc, ram, size, ptr);
ram->perms = perms;
if (ram->addr == -1) {
// out of memory
return NULL;
}
memory_region_add_subregion(uc->system_memory, begin, ram);
if (uc->cpu) {
tlb_flush(uc->cpu);
}
return ram;
} | 93 | True | 1 |
CVE-2021-37232 | 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/wez/atomicparsley/issues/32', 'name': 'https://github.com/wez/atomicparsley/issues/32', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/wez/atomicparsley/commit/d72ccf06c98259d7261e0f3ac4fd8717778782c1', 'name': 'https://github.com/wez/atomicparsley/commit/d72ccf06c98259d7261e0f3ac4fd8717778782c1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:atomicparsley_project:atomicparsley:*:*:*:*:*:*:*:*', 'versionEndIncluding': '20210124.204813.840499f', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A stack overflow vulnerability occurs in Atomicparsley 20210124.204813.840499f through APar_read64() in src/util.cpp due to the lack of buffer size of uint32_buffer while reading more bytes in APar_read64.'}] | 2021-08-11T23:35Z | 2021-08-04T10: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 | Wez Furlong | 2021-07-12 23:10:28-07:00 | Avoid stack overflow
refs: https://github.com/wez/atomicparsley/issues/32 | d72ccf06c98259d7261e0f3ac4fd8717778782c1 | False | wez/atomicparsley | AtomicParsley is a lightweight command line program for reading, parsing and setting metadata into MPEG-4 files, in particular, iTunes-style metadata. | 2011-03-12 23:13:08 | 2022-03-31 17:01:32 | https://github.com/wez/atomicparsley | wez | 383.0 | 51.0 | APar_ExtractDetails | APar_ExtractDetails( FILE * isofile , uint8_t optional_output) | ['isofile', 'optional_output'] | void APar_ExtractDetails(FILE *isofile, uint8_t optional_output) {
char uint32_buffer[5];
Trackage track = {0};
AtomicInfo *mvhdAtom = APar_FindAtom("moov.mvhd", false, VERSIONED_ATOM, 0);
if (mvhdAtom != NULL) {
APar_ExtractMovieDetails(uint32_buffer, isofile, mvhdAtom);
fprintf(stdout,
"Movie duration: %.3lf seconds (%s) - %.2lf* kbp/sec bitrate "
"(*=approximate)\n",
movie_info.seconds,
secsTOtime(movie_info.seconds),
movie_info.simple_bitrate_calc);
if (optional_output & SHOW_DATE_INFO) {
fprintf(stdout,
" Presentation Creation Date (UTC): %s\n",
APar_extract_UTC(movie_info.creation_time));
fprintf(stdout,
" Presentation Modification Date (UTC): %s\n",
APar_extract_UTC(movie_info.modified_time));
}
}
AtomicInfo *iodsAtom = APar_FindAtom("moov.iods", false, VERSIONED_ATOM, 0);
if (iodsAtom != NULL) {
movie_info.contains_iods = true;
APar_Extract_iods_Info(isofile, iodsAtom);
}
if (optional_output & SHOW_TRACK_INFO) {
APar_TrackLevelInfo(&track,
NULL); // With track_num set to 0, it will return the
// total trak atom into total_tracks here.
fprintf(
stdout, "Low-level details. Total tracks: %u\n", track.total_tracks);
fprintf(stdout,
"Trk Type Handler Kind Lang Bytes\n");
if (track.total_tracks > 0) {
while (track.total_tracks > track.track_num) {
track.track_num += 1;
TrackInfo track_info = {0};
// tracknum, handler type, handler name
APar_ExtractTrackDetails(uint32_buffer, isofile, &track, &track_info);
uint16_t more_whitespace =
purge_extraneous_characters(track_info.track_hdlr_name);
if (strlen(track_info.track_hdlr_name) == 0) {
memcpy(track_info.track_hdlr_name, "[none listed]", 13);
}
fprintf(stdout,
"%u %s %s",
track.track_num,
uint32tochar4(track_info.track_type, uint32_buffer),
track_info.track_hdlr_name);
uint16_t handler_len = strlen(track_info.track_hdlr_name);
if (handler_len < 25 + more_whitespace) {
for (uint16_t i = handler_len; i < 25 + more_whitespace; i++) {
fprintf(stdout, " ");
}
}
// codec, language
fprintf(stdout,
" %s %s %" PRIu64,
uint32tochar4(track_info.track_codec, uint32_buffer),
track_info.unpacked_lang,
track_info.sample_aggregate);
if (track_info.encoder_name[0] != 0 && track_info.contains_esds) {
purge_extraneous_characters(track_info.encoder_name);
fprintf(stdout, " Encoder: %s", track_info.encoder_name);
}
if (track_info.type_of_track & DRM_PROTECTED_TRACK) {
fprintf(stdout,
" (protected %s)",
uint32tochar4(track_info.protected_codec, uint32_buffer));
}
fprintf(stdout, "\n");
/*---------------------------------*/
if (track_info.type_of_track & VIDEO_TRACK ||
track_info.type_of_track & AUDIO_TRACK) {
APar_Print_TrackDetails(&track_info);
}
if (optional_output & SHOW_DATE_INFO) {
fprintf(stdout,
" Creation Date (UTC): %s\n",
APar_extract_UTC(track_info.creation_time));
fprintf(stdout,
" Modification Date (UTC): %s\n",
APar_extract_UTC(track_info.modified_time));
}
}
}
}
} | 487 | True | 1 |
CVE-2022-29788 | 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/bfabiszewski/libmobi/commit/ce0ab6586069791b1e8e2a42f44318e581c39939', 'name': 'https://github.com/bfabiszewski/libmobi/commit/ce0ab6586069791b1e8e2a42f44318e581c39939', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.10', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmobi before v0.10 contains a NULL pointer dereference via the component mobi_buffer_getpointer. This vulnerability allows attackers to cause a Denial of Service (DoS) via a crafted mobi file.'}] | 2022-06-10T02:04Z | 2022-06-02T14:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Bartek Fabiszewski | 2022-04-23 16:30:01+02:00 | Fix issue with corrupt files with tagvalues_count = 0 that caused null pointer dereference | ce0ab6586069791b1e8e2a42f44318e581c39939 | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_trie_insert_infl | mobi_trie_insert_infl( MOBITrie ** root , const MOBIIndx * indx , size_t i) | ['root', 'indx', 'i'] | MOBI_RET mobi_trie_insert_infl(MOBITrie **root, const MOBIIndx *indx, size_t i) {
MOBIIndexEntry e = indx->entries[i];
char *inflected = e.label;
for (size_t j = 0; j < e.tags_count; j++) {
MOBIIndexTag t = e.tags[j];
if (t.tagid == INDX_TAGARR_INFL_PARTS_V1) {
for (size_t k = 0; k < t.tagvalues_count - 1; k += 2) {
uint32_t len = t.tagvalues[k];
uint32_t offset = t.tagvalues[k + 1];
char *base = mobi_get_cncx_string_flat(indx->cncx_record, offset, len);
if (base == NULL) {
return MOBI_MALLOC_FAILED;
}
MOBI_RET ret = mobi_trie_insert_reversed(root, base, inflected);
free(base);
if (ret != MOBI_SUCCESS) {
return ret;
}
}
}
}
return MOBI_SUCCESS;
} | 172 | True | 1 |
|
CVE-2022-1533 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://huntr.dev/bounties/cb574ce1-fbf7-42ea-9e6a-91e17adecdc3', 'name': 'https://huntr.dev/bounties/cb574ce1-fbf7-42ea-9e6a-91e17adecdc3', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/eafc415bc6067e72577f70d6dd5acbf057ce6e6f', 'name': 'https://github.com/bfabiszewski/libmobi/commit/eafc415bc6067e72577f70d6dd5acbf057ce6e6f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11. This vulnerability is capable of arbitrary code execution.'}] | 2022-05-11T14:13Z | 2022-04-29T11: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 | Bartek Fabiszewski | 2022-04-27 12:31:59+02:00 | Fix wrong boundary checks in inflections parser resulting in stack buffer over-read with corrupt input | eafc415bc6067e72577f70d6dd5acbf057ce6e6f | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_decode_infl | mobi_decode_infl( unsigned char * decoded , int * decoded_size , const unsigned char * rule) | ['decoded', 'decoded_size', 'rule'] | MOBI_RET mobi_decode_infl(unsigned char *decoded, int *decoded_size, const unsigned char *rule) {
int pos = *decoded_size;
char mod = 'i';
char dir = '<';
char olddir;
unsigned char c;
while ((c = *rule++)) {
if (c <= 4) {
mod = (c <= 2) ? 'i' : 'd'; /* insert, delete */
olddir = dir;
dir = (c & 2) ? '<' : '>'; /* left, right */
if (olddir != dir && olddir) {
pos = (c & 2) ? *decoded_size : 0;
}
}
else if (c > 10 && c < 20) {
if (dir == '>') {
pos = *decoded_size;
}
pos -= c - 10;
dir = 0;
if (pos < 0 || pos > *decoded_size) {
debug_print("Position setting failed (%s)\n", decoded);
return MOBI_DATA_CORRUPT;
}
}
else {
if (mod == 'i') {
const unsigned char *s = decoded + pos;
unsigned char *d = decoded + pos + 1;
const int l = *decoded_size - pos;
if (l < 0 || d + l > decoded + INDX_INFLBUF_SIZEMAX) {
debug_print("Out of buffer in %s at pos: %i\n", decoded, pos);
return MOBI_DATA_CORRUPT;
}
memmove(d, s, (size_t) l);
decoded[pos] = c;
(*decoded_size)++;
if (dir == '>') { pos++; }
} else {
if (dir == '<') { pos--; }
const unsigned char *s = decoded + pos + 1;
unsigned char *d = decoded + pos;
const int l = *decoded_size - pos;
if (l < 0 || d + l > decoded + INDX_INFLBUF_SIZEMAX) {
debug_print("Out of buffer in %s at pos: %i\n", decoded, pos);
return MOBI_DATA_CORRUPT;
}
if (decoded[pos] != c) {
debug_print("Character mismatch in %s at pos: %i (%c != %c)\n", decoded, pos, decoded[pos], c);
return MOBI_DATA_CORRUPT;
}
memmove(d, s, (size_t) l);
(*decoded_size)--;
}
}
}
return MOBI_SUCCESS;
} | 400 | True | 1 |
|
CVE-2022-2279 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://huntr.dev/bounties/68c249e2-779d-4871-b7e3-851f03aca2de', 'name': 'https://huntr.dev/bounties/68c249e2-779d-4871-b7e3-851f03aca2de', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/c0699c8693c47f14a2e57dec7292e862ac7adf9c', 'name': 'https://github.com/bfabiszewski/libmobi/commit/c0699c8693c47f14a2e57dec7292e862ac7adf9c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'NULL Pointer Dereference in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-07-08T15:32Z | 2022-07-01T09:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Bartek Fabiszewski | 2022-04-27 12:35:39+02:00 | Fix undefined behavior when passing null to strdup | c0699c8693c47f14a2e57dec7292e862ac7adf9c | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_build_opf_metadata | mobi_build_opf_metadata( OPF * opf , const MOBIData * m , const MOBIRawml * rawml) | ['opf', 'm', 'rawml'] | MOBI_RET mobi_build_opf_metadata(OPF *opf, const MOBIData *m, const MOBIRawml *rawml) {
if (m == NULL) {
debug_print("%s\n", "Initialization failed");
return MOBI_INIT_FAILED;
}
opf->metadata = calloc(1, sizeof(OPFmetadata));
if (opf->metadata == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
/* initialize metadata sub-elements */
opf->metadata->meta = calloc(OPF_META_MAX_TAGS, sizeof(OPFmeta*));
if (opf->metadata->meta == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
opf->metadata->dc_meta = calloc(1, sizeof(OPFdcmeta));
if (opf->metadata->dc_meta == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
opf->metadata->x_meta = calloc(1, sizeof(OPFxmeta));
if (opf->metadata->x_meta == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
if (m->eh) {
MOBI_RET ret = mobi_get_opf_from_exth(opf->metadata, m);
if (ret != MOBI_SUCCESS) {
return ret;
}
}
/* check for required elements */
if (opf->metadata->dc_meta->identifier == NULL) {
/* default id will be "0" */
char uid_string[11] = "0";
if (m->mh && m->mh->uid) {
snprintf(uid_string, 11, "%u", *m->mh->uid);
}
mobi_opf_set_tagtype(OPFidentifier, opf->metadata->dc_meta->identifier, value, uid_string);
mobi_opf_set_tagtype(OPFidentifier, opf->metadata->dc_meta->identifier, id, "uid");
} else {
opf->metadata->dc_meta->identifier[0]->id = strdup("uid");
}
if (opf->metadata->dc_meta->title == NULL) {
opf->metadata->dc_meta->title = calloc(OPF_META_MAX_TAGS, sizeof(char*));
if (opf->metadata->dc_meta->title == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
char *title = mobi_meta_get_title(m);
if (title == NULL) {
title = strdup("Unknown");
}
opf->metadata->dc_meta->title[0] = title;
}
if (opf->metadata->dc_meta->language == NULL) {
opf->metadata->dc_meta->language = calloc(OPF_META_MAX_TAGS, sizeof(char*));
if (opf->metadata->dc_meta->language == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
const char *lang_string = NULL;
if (m->mh && m->mh->locale) {
uint32_t lang_code = *m->mh->locale;
lang_string = mobi_get_locale_string(lang_code);
}
if (lang_string) {
opf->metadata->dc_meta->language[0] = strdup(lang_string);
} else {
opf->metadata->dc_meta->language[0] = strdup("en");
}
}
/* write optional elements */
if (mobi_is_dictionary(m)) {
if (opf->metadata->x_meta->dictionary_in_lang == NULL) {
if (m->mh && m->mh->dict_input_lang) {
opf->metadata->x_meta->dictionary_in_lang = calloc(OPF_META_MAX_TAGS, sizeof(char*));
if (opf->metadata->x_meta->dictionary_in_lang == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
uint32_t dict_lang_in = *m->mh->dict_input_lang;
opf->metadata->x_meta->dictionary_in_lang[0] = strdup(mobi_get_locale_string(dict_lang_in));
}
}
if (opf->metadata->x_meta->dictionary_out_lang == NULL) {
if (m->mh && m->mh->dict_output_lang) {
opf->metadata->x_meta->dictionary_out_lang = calloc(OPF_META_MAX_TAGS, sizeof(char*));
if (opf->metadata->x_meta->dictionary_out_lang == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
uint32_t dict_lang_in = *m->mh->dict_output_lang;
opf->metadata->x_meta->dictionary_out_lang[0] = strdup(mobi_get_locale_string(dict_lang_in));
}
}
if (rawml->orth->orth_index_name) {
opf->metadata->x_meta->default_lookup_index = calloc(OPF_META_MAX_TAGS, sizeof(char*));
if (opf->metadata->x_meta->default_lookup_index == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
opf->metadata->x_meta->default_lookup_index[0] = strdup(rawml->orth->orth_index_name);
}
}
return MOBI_SUCCESS;
} | 838 | True | 1 |
|
CVE-2022-2279 | False | False | False | True | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | NONE | NONE | HIGH | 5.5 | MEDIUM | 1.8 | 3.6 | False | [{'url': 'https://huntr.dev/bounties/68c249e2-779d-4871-b7e3-851f03aca2de', 'name': 'https://huntr.dev/bounties/68c249e2-779d-4871-b7e3-851f03aca2de', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/c0699c8693c47f14a2e57dec7292e862ac7adf9c', 'name': 'https://github.com/bfabiszewski/libmobi/commit/c0699c8693c47f14a2e57dec7292e862ac7adf9c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'NULL Pointer Dereference in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-07-08T15:32Z | 2022-07-01T09:15Z | NULL Pointer Dereference | A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit. | NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
| https://cwe.mitre.org/data/definitions/476.html | 0 | Bartek Fabiszewski | 2022-04-27 12:35:39+02:00 | Fix undefined behavior when passing null to strdup | c0699c8693c47f14a2e57dec7292e862ac7adf9c | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | print_summary | print_summary( const MOBIData * m) | ['m'] | void print_summary(const MOBIData *m) {
char *title = mobi_meta_get_title(m);
if (title) {
printf("Title: %s\n", title);
free(title);
}
char *author = mobi_meta_get_author(m);
if (author) {
printf("Author: %s\n", author);
free(author);
}
char *contributor = mobi_meta_get_contributor(m);
uint32_t major = 0, minor = 0, build = 0;
bool is_calibre = false;
if (contributor) {
const char *calibre_contributor = "calibre (";
if (strncmp(contributor, calibre_contributor, strlen(calibre_contributor)) == 0) {
is_calibre = true;
sscanf(contributor, "calibre (%u.%u.%u)", &major, &minor, &build);
} else {
printf("Contributor: %s\n", contributor);
}
free(contributor);
}
char *subject = mobi_meta_get_subject(m);
if (subject) {
printf("Subject: %s\n", subject);
free(subject);
}
char *publisher = mobi_meta_get_publisher(m);
if (publisher) {
printf("Publisher: %s\n", publisher);
free(publisher);
}
char *date = mobi_meta_get_publishdate(m);
if (date) {
printf("Publishing date: %s\n", date);
free(date);
}
char *description = mobi_meta_get_description(m);
if (description) {
printf("Description: %s\n", description);
free(description);
}
char *review = mobi_meta_get_review(m);
if (review) {
printf("Review: %s\n", review);
free(review);
}
char *imprint = mobi_meta_get_imprint(m);
if (imprint) {
printf("Imprint: %s\n", imprint);
free(imprint);
}
char *copyright = mobi_meta_get_copyright(m);
if (copyright) {
printf("Copyright: %s\n", copyright);
free(copyright);
}
char *isbn = mobi_meta_get_isbn(m);
if (isbn) {
printf("ISBN: %s\n", isbn);
free(isbn);
}
char *asin = mobi_meta_get_asin(m);
if (asin) {
printf("ASIN: %s\n", asin);
free(asin);
}
char *language = mobi_meta_get_language(m);
if (language) {
printf("Language: %s", language);
free(language);
if (m->mh && m->mh->text_encoding) {
uint32_t encoding = *m->mh->text_encoding;
if (encoding == MOBI_CP1252) {
printf(" (cp1252)");
} else if (encoding == MOBI_UTF8) {
printf(" (utf8)");
}
}
printf("\n");
}
if (mobi_is_dictionary(m)) {
printf("Dictionary");
if (m->mh && m->mh->dict_input_lang && m->mh->dict_output_lang &&
*m->mh->dict_input_lang && *m->mh->dict_output_lang) {
const char *locale_in = mobi_get_locale_string(*m->mh->dict_input_lang);
const char *locale_out = mobi_get_locale_string(*m->mh->dict_output_lang);
printf(": %s => %s", locale_in, locale_out);
}
printf("\n");
}
printf("__\n");
if (strcmp(m->ph->type, "TEXt") == 0) {
if (strcmp(m->ph->creator, "TlDc") == 0) {
printf("TealDoc\n");
} else {
printf("PalmDoc\n");
}
} else {
printf("Mobi version: %zu", mobi_get_fileversion(m));
if (mobi_is_hybrid(m)) {
size_t version = mobi_get_fileversion(m->next);
if (version != MOBI_NOTSET) {
printf(" (hybrid with version %zu)", version);
}
}
printf("\n");
}
if (mobi_is_replica(m)) {
printf("Print Replica\n");
}
if (mobi_is_encrypted(m)) {
printf("Document is encrypted\n");
}
if (is_calibre) {
printf("Creator software: calibre %u.%u.%u\n", major, minor, build);
} else {
MOBIExthHeader *exth = mobi_get_exthrecord_by_tag(m, EXTH_CREATORSOFT);
if (exth) {
printf("Creator software: ");
uint32_t creator = mobi_decode_exthvalue(exth->data, exth->size);
exth = mobi_get_exthrecord_by_tag(m, EXTH_CREATORMAJOR);
if (exth) {
major = mobi_decode_exthvalue(exth->data, exth->size);
}
exth = mobi_get_exthrecord_by_tag(m, EXTH_CREATORMINOR);
if (exth) {
minor = mobi_decode_exthvalue(exth->data, exth->size);
}
exth = mobi_get_exthrecord_by_tag(m, EXTH_CREATORBUILD);
if (exth) {
build = mobi_decode_exthvalue(exth->data, exth->size);
}
exth = mobi_get_exthrecord_by_tag(m, EXTH_CREATORBUILDREV);
if (major == 2 && minor == 9 && build == 0 && exth) {
char *rev = mobi_decode_exthstring(m, exth->data, exth->size);
if (rev) {
if (strcmp(rev, "0730-890adc2") == 0) {
is_calibre = true;
}
free(rev);
}
}
switch (creator) {
case 0:
printf("mobipocket reader %u.%u.%u", major, minor, build);
break;
case 1:
case 101:
printf("mobigen %u.%u.%u", major, minor, build);
break;
case 2:
printf("mobipocket creator %u.%u.%u", major, minor, build);
break;
case 200:
printf("kindlegen %u.%u.%u (windows)", major, minor, build);
if (is_calibre) {
printf(" or calibre");
}
break;
case 201:
printf("kindlegen %u.%u.%u (linux)", major, minor, build);
if ((major == 1 && minor == 2 && build == 33307) ||
(major == 2 && minor == 0 && build == 101) ||
is_calibre) {
printf(" or calibre");
}
break;
case 202:
printf("kindlegen %u.%u.%u (mac)", major, minor, build);
if (is_calibre) {
printf(" or calibre");
}
break;
default:
printf("unknown");
break;
}
printf("\n");
}
}
} | 1098 | True | 1 |
|
CVE-2022-1907 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/4eb0fa3e-4480-4fb5-8ec0-fbcd71de6012', 'name': 'https://huntr.dev/bounties/4eb0fa3e-4480-4fb5-8ec0-fbcd71de6012', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'name': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-03T15:15Z | 2022-05-27T09: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 | Bartek Fabiszewski | 2022-05-03 09:10:25+02:00 | Fix boundary checking error in markup search, that could cause buffer over-read with corrupt input | 1e0378e6f9e4ae415cedc9eb10850888897c5dba | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_find_attrvalue | mobi_find_attrvalue( MOBIResult * result , const unsigned char * data_start , const unsigned char * data_end , const MOBIFiletype type , const char * needle) | ['result', 'data_start', 'data_end', 'type', 'needle'] | MOBI_RET mobi_find_attrvalue(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end, const MOBIFiletype type, const char *needle) {
if (!result) {
debug_print("Result structure is null%s", "\n");
return MOBI_PARAM_ERR;
}
result->start = result->end = NULL;
*(result->value) = '\0';
if (!data_start || !data_end) {
debug_print("Data is null%s", "\n");
return MOBI_PARAM_ERR;
}
size_t needle_length = strlen(needle);
if (needle_length > MOBI_ATTRNAME_MAXSIZE) {
debug_print("Attribute too long: %zu\n", needle_length);
return MOBI_PARAM_ERR;
}
if (data_start + needle_length > data_end) {
return MOBI_SUCCESS;
}
unsigned char *data = (unsigned char *) data_start;
unsigned char tag_open;
unsigned char tag_close;
if (type == T_CSS) {
tag_open = '{';
tag_close = '}';
} else {
tag_open = '<';
tag_close = '>';
}
unsigned char last_border = tag_close;
while (data <= data_end) {
if (*data == tag_open || *data == tag_close) {
last_border = *data;
}
if (data + needle_length <= data_end && memcmp(data, needle, needle_length) == 0) {
/* found match */
if (last_border != tag_open) {
/* opening char not found, not an attribute */
data += needle_length;
continue;
}
/* go to attribute value beginning */
while (data >= data_start && !isspace(*data) && *data != tag_open && *data != '=' && *data != '(') {
data--;
}
result->is_url = (*data == '(');
result->start = ++data;
/* now go forward */
int i = 0;
while (data <= data_end && !isspace(*data) && *data != tag_close && *data != ')' && i < MOBI_ATTRVALUE_MAXSIZE) {
result->value[i++] = (char) *data++;
}
/* self closing tag '/>' */
if (*(data - 1) == '/' && *data == '>') {
--data; --i;
}
result->end = data;
result->value[i] = '\0';
return MOBI_SUCCESS;
}
data++;
}
return MOBI_SUCCESS;
} | 387 | True | 1 |
|
CVE-2022-1908 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/a7436e88-0488-4bd4-816f-2e2c803e93e8', 'name': 'https://huntr.dev/bounties/a7436e88-0488-4bd4-816f-2e2c803e93e8', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'name': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-03T15:14Z | 2022-05-27T09: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 | Bartek Fabiszewski | 2022-05-03 09:10:25+02:00 | Fix boundary checking error in markup search, that could cause buffer over-read with corrupt input | 1e0378e6f9e4ae415cedc9eb10850888897c5dba | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_find_attrvalue | mobi_find_attrvalue( MOBIResult * result , const unsigned char * data_start , const unsigned char * data_end , const MOBIFiletype type , const char * needle) | ['result', 'data_start', 'data_end', 'type', 'needle'] | MOBI_RET mobi_find_attrvalue(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end, const MOBIFiletype type, const char *needle) {
if (!result) {
debug_print("Result structure is null%s", "\n");
return MOBI_PARAM_ERR;
}
result->start = result->end = NULL;
*(result->value) = '\0';
if (!data_start || !data_end) {
debug_print("Data is null%s", "\n");
return MOBI_PARAM_ERR;
}
size_t needle_length = strlen(needle);
if (needle_length > MOBI_ATTRNAME_MAXSIZE) {
debug_print("Attribute too long: %zu\n", needle_length);
return MOBI_PARAM_ERR;
}
if (data_start + needle_length > data_end) {
return MOBI_SUCCESS;
}
unsigned char *data = (unsigned char *) data_start;
unsigned char tag_open;
unsigned char tag_close;
if (type == T_CSS) {
tag_open = '{';
tag_close = '}';
} else {
tag_open = '<';
tag_close = '>';
}
unsigned char last_border = tag_close;
while (data <= data_end) {
if (*data == tag_open || *data == tag_close) {
last_border = *data;
}
if (data + needle_length <= data_end && memcmp(data, needle, needle_length) == 0) {
/* found match */
if (last_border != tag_open) {
/* opening char not found, not an attribute */
data += needle_length;
continue;
}
/* go to attribute value beginning */
while (data >= data_start && !isspace(*data) && *data != tag_open && *data != '=' && *data != '(') {
data--;
}
result->is_url = (*data == '(');
result->start = ++data;
/* now go forward */
int i = 0;
while (data <= data_end && !isspace(*data) && *data != tag_close && *data != ')' && i < MOBI_ATTRVALUE_MAXSIZE) {
result->value[i++] = (char) *data++;
}
/* self closing tag '/>' */
if (*(data - 1) == '/' && *data == '>') {
--data; --i;
}
result->end = data;
result->value[i] = '\0';
return MOBI_SUCCESS;
}
data++;
}
return MOBI_SUCCESS;
} | 387 | True | 1 |
|
CVE-2022-1907 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/4eb0fa3e-4480-4fb5-8ec0-fbcd71de6012', 'name': 'https://huntr.dev/bounties/4eb0fa3e-4480-4fb5-8ec0-fbcd71de6012', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'name': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-03T15:15Z | 2022-05-27T09: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 | Bartek Fabiszewski | 2022-05-03 09:10:25+02:00 | Fix boundary checking error in markup search, that could cause buffer over-read with corrupt input | 1e0378e6f9e4ae415cedc9eb10850888897c5dba | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_get_attribute_value | mobi_get_attribute_value( char * value , const unsigned char * data , const size_t size , const char * attribute , bool only_quoted) | ['value', 'data', 'size', 'attribute', 'only_quoted'] | size_t mobi_get_attribute_value(char *value, const unsigned char *data, const size_t size, const char *attribute, bool only_quoted) {
/* FIXME: this function could be replaced by mobi_find_attrvalue()? */
if (!data) {
debug_print("Data is null%s", "\n");
return SIZE_MAX;
}
size_t length = size;
size_t attr_length = strlen(attribute);
if (attr_length > MOBI_ATTRNAME_MAXSIZE) {
debug_print("Attribute too long: %zu\n", attr_length);
return SIZE_MAX;
}
char attr[MOBI_ATTRNAME_MAXSIZE + 2];
strcpy(attr, attribute);
strcat(attr, "=");
attr_length++;
if (size < attr_length) {
return SIZE_MAX;
}
/* FIXME: search may start inside tag, so it is a safer option */
unsigned char last_border = '\0';
do {
if (*data == '<' || *data == '>') {
last_border = *data;
}
if (length > attr_length + 1 && memcmp(data, attr, attr_length) == 0) {
/* found match */
size_t offset = size - length;
if (last_border == '>') {
/* We are in tag contents */
data += attr_length;
length -= attr_length - 1;
continue;
}
/* previous character should be white space or opening tag */
if (offset > 0) {
if (data[-1] != '<' && !isspace(data[-1])) {
data += attr_length;
length -= attr_length - 1;
continue;
}
}
/* now go forward */
data += attr_length;
length -= attr_length;
unsigned char separator;
if (*data != '\'' && *data != '"') {
if (only_quoted) {
continue;
}
separator = ' ';
} else {
separator = *data;
data++;
length--;
}
size_t j;
for (j = 0; j < MOBI_ATTRVALUE_MAXSIZE && length && *data != separator && *data != '>'; j++) {
*value++ = (char) *data++;
length--;
}
/* self closing tag '/>' */
if (*(data - 1) == '/' && *data == '>') {
value--;
}
*value = '\0';
/* return offset to the beginning of the attribute value string */
return size - length - j;
}
data++;
} while (--length);
value[0] = '\0';
return SIZE_MAX;
} | 376 | True | 1 |
|
CVE-2022-1908 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/a7436e88-0488-4bd4-816f-2e2c803e93e8', 'name': 'https://huntr.dev/bounties/a7436e88-0488-4bd4-816f-2e2c803e93e8', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'name': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-03T15:14Z | 2022-05-27T09: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 | Bartek Fabiszewski | 2022-05-03 09:10:25+02:00 | Fix boundary checking error in markup search, that could cause buffer over-read with corrupt input | 1e0378e6f9e4ae415cedc9eb10850888897c5dba | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_get_attribute_value | mobi_get_attribute_value( char * value , const unsigned char * data , const size_t size , const char * attribute , bool only_quoted) | ['value', 'data', 'size', 'attribute', 'only_quoted'] | size_t mobi_get_attribute_value(char *value, const unsigned char *data, const size_t size, const char *attribute, bool only_quoted) {
/* FIXME: this function could be replaced by mobi_find_attrvalue()? */
if (!data) {
debug_print("Data is null%s", "\n");
return SIZE_MAX;
}
size_t length = size;
size_t attr_length = strlen(attribute);
if (attr_length > MOBI_ATTRNAME_MAXSIZE) {
debug_print("Attribute too long: %zu\n", attr_length);
return SIZE_MAX;
}
char attr[MOBI_ATTRNAME_MAXSIZE + 2];
strcpy(attr, attribute);
strcat(attr, "=");
attr_length++;
if (size < attr_length) {
return SIZE_MAX;
}
/* FIXME: search may start inside tag, so it is a safer option */
unsigned char last_border = '\0';
do {
if (*data == '<' || *data == '>') {
last_border = *data;
}
if (length > attr_length + 1 && memcmp(data, attr, attr_length) == 0) {
/* found match */
size_t offset = size - length;
if (last_border == '>') {
/* We are in tag contents */
data += attr_length;
length -= attr_length - 1;
continue;
}
/* previous character should be white space or opening tag */
if (offset > 0) {
if (data[-1] != '<' && !isspace(data[-1])) {
data += attr_length;
length -= attr_length - 1;
continue;
}
}
/* now go forward */
data += attr_length;
length -= attr_length;
unsigned char separator;
if (*data != '\'' && *data != '"') {
if (only_quoted) {
continue;
}
separator = ' ';
} else {
separator = *data;
data++;
length--;
}
size_t j;
for (j = 0; j < MOBI_ATTRVALUE_MAXSIZE && length && *data != separator && *data != '>'; j++) {
*value++ = (char) *data++;
length--;
}
/* self closing tag '/>' */
if (*(data - 1) == '/' && *data == '>') {
value--;
}
*value = '\0';
/* return offset to the beginning of the attribute value string */
return size - length - j;
}
data++;
} while (--length);
value[0] = '\0';
return SIZE_MAX;
} | 376 | True | 1 |
|
CVE-2022-1907 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/4eb0fa3e-4480-4fb5-8ec0-fbcd71de6012', 'name': 'https://huntr.dev/bounties/4eb0fa3e-4480-4fb5-8ec0-fbcd71de6012', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'name': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-03T15:15Z | 2022-05-27T09: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 | Bartek Fabiszewski | 2022-05-03 09:10:25+02:00 | Fix boundary checking error in markup search, that could cause buffer over-read with corrupt input | 1e0378e6f9e4ae415cedc9eb10850888897c5dba | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_search_links_kf7 | mobi_search_links_kf7( MOBIResult * result , const unsigned char * data_start , const unsigned char * data_end) | ['result', 'data_start', 'data_end'] | MOBI_RET mobi_search_links_kf7(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end) {
if (!result) {
debug_print("Result structure is null%s", "\n");
return MOBI_PARAM_ERR;
}
result->start = result->end = NULL;
*(result->value) = '\0';
if (!data_start || !data_end) {
debug_print("Data is null%s", "\n");
return MOBI_PARAM_ERR;
}
const char *needle1 = "filepos=";
const char *needle2 = "recindex=";
const size_t needle1_length = strlen(needle1);
const size_t needle2_length = strlen(needle2);
const size_t needle_length = max(needle1_length,needle2_length);
if (data_start + needle_length > data_end) {
return MOBI_SUCCESS;
}
unsigned char *data = (unsigned char *) data_start;
const unsigned char tag_open = '<';
const unsigned char tag_close = '>';
unsigned char last_border = tag_open;
while (data <= data_end) {
if (*data == tag_open || *data == tag_close) {
last_border = *data;
}
if (data + needle_length <= data_end &&
(memcmp(data, needle1, needle1_length) == 0 ||
memcmp(data, needle2, needle2_length) == 0)) {
/* found match */
if (last_border != tag_open) {
/* opening char not found, not an attribute */
data += needle_length;
continue;
}
/* go to attribute beginning */
while (data >= data_start && !isspace(*data) && *data != tag_open) {
data--;
}
result->start = ++data;
/* now go forward */
int i = 0;
while (data <= data_end && !isspace(*data) && *data != tag_close && i < MOBI_ATTRVALUE_MAXSIZE) {
result->value[i++] = (char) *data++;
}
/* self closing tag '/>' */
if (*(data - 1) == '/' && *data == '>') {
--data; --i;
}
result->end = data;
result->value[i] = '\0';
return MOBI_SUCCESS;
}
data++;
}
return MOBI_SUCCESS;
} | 361 | True | 1 |
|
CVE-2022-1908 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/a7436e88-0488-4bd4-816f-2e2c803e93e8', 'name': 'https://huntr.dev/bounties/a7436e88-0488-4bd4-816f-2e2c803e93e8', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'name': 'https://github.com/bfabiszewski/libmobi/commit/1e0378e6f9e4ae415cedc9eb10850888897c5dba', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-03T15:14Z | 2022-05-27T09: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 | Bartek Fabiszewski | 2022-05-03 09:10:25+02:00 | Fix boundary checking error in markup search, that could cause buffer over-read with corrupt input | 1e0378e6f9e4ae415cedc9eb10850888897c5dba | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_search_links_kf7 | mobi_search_links_kf7( MOBIResult * result , const unsigned char * data_start , const unsigned char * data_end) | ['result', 'data_start', 'data_end'] | MOBI_RET mobi_search_links_kf7(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end) {
if (!result) {
debug_print("Result structure is null%s", "\n");
return MOBI_PARAM_ERR;
}
result->start = result->end = NULL;
*(result->value) = '\0';
if (!data_start || !data_end) {
debug_print("Data is null%s", "\n");
return MOBI_PARAM_ERR;
}
const char *needle1 = "filepos=";
const char *needle2 = "recindex=";
const size_t needle1_length = strlen(needle1);
const size_t needle2_length = strlen(needle2);
const size_t needle_length = max(needle1_length,needle2_length);
if (data_start + needle_length > data_end) {
return MOBI_SUCCESS;
}
unsigned char *data = (unsigned char *) data_start;
const unsigned char tag_open = '<';
const unsigned char tag_close = '>';
unsigned char last_border = tag_open;
while (data <= data_end) {
if (*data == tag_open || *data == tag_close) {
last_border = *data;
}
if (data + needle_length <= data_end &&
(memcmp(data, needle1, needle1_length) == 0 ||
memcmp(data, needle2, needle2_length) == 0)) {
/* found match */
if (last_border != tag_open) {
/* opening char not found, not an attribute */
data += needle_length;
continue;
}
/* go to attribute beginning */
while (data >= data_start && !isspace(*data) && *data != tag_open) {
data--;
}
result->start = ++data;
/* now go forward */
int i = 0;
while (data <= data_end && !isspace(*data) && *data != tag_close && i < MOBI_ATTRVALUE_MAXSIZE) {
result->value[i++] = (char) *data++;
}
/* self closing tag '/>' */
if (*(data - 1) == '/' && *data == '>') {
--data; --i;
}
result->end = data;
result->value[i] = '\0';
return MOBI_SUCCESS;
}
data++;
}
return MOBI_SUCCESS;
} | 361 | True | 1 |
|
CVE-2022-1987 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/e8197737-7557-443e-a59f-2a86e8dda75f', 'name': 'https://huntr.dev/bounties/e8197737-7557-443e-a59f-2a86e8dda75f', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/612562bc1ea38f1708b044e7a079c47a05b1291d', 'name': 'https://github.com/bfabiszewski/libmobi/commit/612562bc1ea38f1708b044e7a079c47a05b1291d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Buffer Over-read in GitHub repository bfabiszewski/libmobi prior to 0.11.'}] | 2022-06-12T02:47Z | 2022-06-03T08: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 | Bartek Fabiszewski | 2022-05-05 20:54:11+02:00 | Fix: index entry label not being zero-terminated with corrupt input | 612562bc1ea38f1708b044e7a079c47a05b1291d | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_parse_index_entry | mobi_parse_index_entry( MOBIIndx * indx , const MOBIIdxt idxt , const MOBITagx * tagx , const MOBIOrdt * ordt , MOBIBuffer * buf , const size_t curr_number) | ['indx', 'idxt', 'tagx', 'ordt', 'buf', 'curr_number'] | static MOBI_RET mobi_parse_index_entry(MOBIIndx *indx, const MOBIIdxt idxt, const MOBITagx *tagx, const MOBIOrdt *ordt, MOBIBuffer *buf, const size_t curr_number) {
if (indx == NULL) {
debug_print("%s", "INDX structure not initialized\n");
return MOBI_INIT_FAILED;
}
const size_t entry_offset = indx->entries_count;
const size_t entry_length = idxt.offsets[curr_number + 1] - idxt.offsets[curr_number];
mobi_buffer_setpos(buf, idxt.offsets[curr_number]);
size_t entry_number = curr_number + entry_offset;
if (entry_number >= indx->total_entries_count) {
debug_print("Entry number beyond array: %zu\n", entry_number);
return MOBI_DATA_CORRUPT;
}
/* save original record maxlen */
const size_t buf_maxlen = buf->maxlen;
if (buf->offset + entry_length >= buf_maxlen) {
debug_print("Entry length too long: %zu\n", entry_length);
return MOBI_DATA_CORRUPT;
}
buf->maxlen = buf->offset + entry_length;
size_t label_length = mobi_buffer_get8(buf);
if (label_length > entry_length) {
debug_print("Label length too long: %zu\n", label_length);
return MOBI_DATA_CORRUPT;
}
char text[INDX_LABEL_SIZEMAX];
/* FIXME: what is ORDT1 for? */
if (ordt->ordt2) {
label_length = mobi_getstring_ordt(ordt, buf, (unsigned char*) text, label_length);
} else {
label_length = mobi_indx_get_label((unsigned char*) text, buf, label_length, indx->ligt_entries_count);
}
indx->entries[entry_number].label = malloc(label_length + 1);
if (indx->entries[entry_number].label == NULL) {
debug_print("Memory allocation failed (%zu bytes)\n", label_length);
return MOBI_MALLOC_FAILED;
}
strncpy(indx->entries[entry_number].label, text, label_length + 1);
//debug_print("tag label[%zu]: %s\n", entry_number, indx->entries[entry_number].label);
unsigned char *control_bytes;
control_bytes = buf->data + buf->offset;
mobi_buffer_seek(buf, (int) tagx->control_byte_count);
indx->entries[entry_number].tags_count = 0;
indx->entries[entry_number].tags = NULL;
if (tagx->tags_count > 0) {
typedef struct {
uint8_t tag;
uint8_t tag_value_count;
uint32_t value_count;
uint32_t value_bytes;
} MOBIPtagx;
MOBIPtagx *ptagx = malloc(tagx->tags_count * sizeof(MOBIPtagx));
if (ptagx == NULL) {
debug_print("Memory allocation failed (%zu bytes)\n", tagx->tags_count * sizeof(MOBIPtagx));
return MOBI_MALLOC_FAILED;
}
uint32_t ptagx_count = 0;
size_t len;
size_t i = 0;
while (i < tagx->tags_count) {
if (tagx->tags[i].control_byte == 1) {
control_bytes++;
i++;
continue;
}
uint32_t value = control_bytes[0] & tagx->tags[i].bitmask;
if (value != 0) {
/* FIXME: is it safe to use MOBI_NOTSET? */
uint32_t value_count = MOBI_NOTSET;
uint32_t value_bytes = MOBI_NOTSET;
/* all bits of masked value are set */
if (value == tagx->tags[i].bitmask) {
/* more than 1 bit set */
if (mobi_bitcount(tagx->tags[i].bitmask) > 1) {
/* read value bytes from entry */
len = 0;
value_bytes = mobi_buffer_get_varlen(buf, &len);
} else {
value_count = 1;
}
} else {
uint8_t mask = tagx->tags[i].bitmask;
while ((mask & 1) == 0) {
mask >>= 1;
value >>= 1;
}
value_count = value;
}
ptagx[ptagx_count].tag = tagx->tags[i].tag;
ptagx[ptagx_count].tag_value_count = tagx->tags[i].values_count;
ptagx[ptagx_count].value_count = value_count;
ptagx[ptagx_count].value_bytes = value_bytes;
ptagx_count++;
}
i++;
}
indx->entries[entry_number].tags = malloc(tagx->tags_count * sizeof(MOBIIndexTag));
if (indx->entries[entry_number].tags == NULL) {
debug_print("Memory allocation failed (%zu bytes)\n", tagx->tags_count * sizeof(MOBIIndexTag));
free(ptagx);
return MOBI_MALLOC_FAILED;
}
i = 0;
while (i < ptagx_count) {
uint32_t tagvalues_count = 0;
/* FIXME: is it safe to use MOBI_NOTSET? */
/* value count is set */
uint32_t tagvalues[INDX_TAGVALUES_MAX];
if (ptagx[i].value_count != MOBI_NOTSET) {
size_t count = ptagx[i].value_count * ptagx[i].tag_value_count;
while (count-- && tagvalues_count < INDX_TAGVALUES_MAX) {
len = 0;
const uint32_t value_bytes = mobi_buffer_get_varlen(buf, &len);
tagvalues[tagvalues_count++] = value_bytes;
}
/* value count is not set */
} else {
/* read value_bytes bytes */
len = 0;
while (len < ptagx[i].value_bytes && tagvalues_count < INDX_TAGVALUES_MAX) {
const uint32_t value_bytes = mobi_buffer_get_varlen(buf, &len);
tagvalues[tagvalues_count++] = value_bytes;
}
}
if (tagvalues_count) {
const size_t arr_size = tagvalues_count * sizeof(*indx->entries[entry_number].tags[i].tagvalues);
indx->entries[entry_number].tags[i].tagvalues = malloc(arr_size);
if (indx->entries[entry_number].tags[i].tagvalues == NULL) {
debug_print("Memory allocation failed (%zu bytes)\n", arr_size);
free(ptagx);
return MOBI_MALLOC_FAILED;
}
memcpy(indx->entries[entry_number].tags[i].tagvalues, tagvalues, arr_size);
} else {
indx->entries[entry_number].tags[i].tagvalues = NULL;
}
indx->entries[entry_number].tags[i].tagid = ptagx[i].tag;
indx->entries[entry_number].tags[i].tagvalues_count = tagvalues_count;
indx->entries[entry_number].tags_count++;
i++;
}
free(ptagx);
}
/* restore buffer maxlen */
buf->maxlen = buf_maxlen;
return MOBI_SUCCESS;
} | 1021 | True | 1 |
|
CVE-2021-3751 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://huntr.dev/bounties/fcb4383c-bc27-4b89-bfce-6b041f0cb769', 'name': 'https://huntr.dev/bounties/fcb4383c-bc27-4b89-bfce-6b041f0cb769', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/ab5bf0e37e540eac682a14e628853b918626e72b', 'name': 'https://github.com/bfabiszewski/libmobi/commit/ab5bf0e37e540eac682a14e628853b918626e72b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmobi is vulnerable to Out-of-bounds Write'}] | 2021-09-24T19:15Z | 2021-09-15T07: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 | Cen Zhang | 2021-09-09 14:21:58+08:00 | fix oob write bug inside libmobi | ab5bf0e37e540eac682a14e628853b918626e72b | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_buffer_move | mobi_buffer_move( MOBIBuffer * buf , const int offset , const size_t len) | ['buf', 'offset', 'len'] | void mobi_buffer_move(MOBIBuffer *buf, const int offset, const size_t len) {
size_t aoffset = (size_t) abs(offset);
unsigned char *source = buf->data + buf->offset;
if (offset >= 0) {
if (buf->offset + aoffset + len > buf->maxlen) {
debug_print("%s", "End of buffer\n");
buf->error = MOBI_BUFFER_END;
return;
}
source += aoffset;
} else {
if (buf->offset < aoffset) {
debug_print("%s", "End of buffer\n");
buf->error = MOBI_BUFFER_END;
return;
}
source -= aoffset;
}
memmove(buf->data + buf->offset, source, len);
buf->offset += len;
} | 136 | True | 1 |
|
CVE-2021-3881 | 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/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'name': 'https://github.com/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/540fd115-7de4-4e19-a918-5ee61f5157c1', 'name': 'https://huntr.dev/bounties/540fd115-7de4-4e19-a918-5ee61f5157c1', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmobi is vulnerable to Out-of-bounds Read'}] | 2021-10-22T12:29Z | 2021-10-15T14: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 | Bartek Fabiszewski | 2021-09-18 21:55:27+02:00 | Fix potential out-of-buffer read while parsing corrupt file, closes #35, #36 | bec783e6212439a335ba6e8df7ab8ed610ca9a21 | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_decompress_huffman_internal | mobi_decompress_huffman_internal( MOBIBuffer * buf_out , MOBIBuffer * buf_in , const MOBIHuffCdic * huffcdic , size_t depth) | ['buf_out', 'buf_in', 'huffcdic', 'depth'] | static MOBI_RET mobi_decompress_huffman_internal(MOBIBuffer *buf_out, MOBIBuffer *buf_in, const MOBIHuffCdic *huffcdic, size_t depth) {
if (depth > MOBI_HUFFMAN_MAXDEPTH) {
debug_print("Too many levels of recursion: %zu\n", depth);
return MOBI_DATA_CORRUPT;
}
MOBI_RET ret = MOBI_SUCCESS;
int8_t bitcount = 32;
/* this cast should be safe: max record size is 4096 */
int bitsleft = (int) (buf_in->maxlen * 8);
uint8_t code_length = 0;
uint64_t buffer = mobi_buffer_fill64(buf_in);
while (ret == MOBI_SUCCESS) {
if (bitcount <= 0) {
bitcount += 32;
buffer = mobi_buffer_fill64(buf_in);
}
uint32_t code = (buffer >> bitcount) & 0xffffffffU;
/* lookup code in table1 */
uint32_t t1 = huffcdic->table1[code >> 24];
/* get maxcode and codelen from t1 */
code_length = t1 & 0x1f;
uint32_t maxcode = (((t1 >> 8) + 1) << (32 - code_length)) - 1;
/* check termination bit */
if (!(t1 & 0x80)) {
/* get offset from mincode, maxcode tables */
while (code < huffcdic->mincode_table[code_length]) {
code_length++;
}
maxcode = huffcdic->maxcode_table[code_length];
}
bitcount -= code_length;
bitsleft -= code_length;
if (bitsleft < 0) {
break;
}
/* get index for symbol offset */
uint32_t index = (uint32_t) (maxcode - code) >> (32 - code_length);
/* check which part of cdic to use */
uint16_t cdic_index = (uint16_t) ((uint32_t)index >> huffcdic->code_length);
if (index >= huffcdic->index_count) {
debug_print("Wrong symbol offsets index: %u\n", index);
return MOBI_DATA_CORRUPT;
}
/* get offset */
uint32_t offset = huffcdic->symbol_offsets[index];
uint32_t symbol_length = (uint32_t) huffcdic->symbols[cdic_index][offset] << 8 | (uint32_t) huffcdic->symbols[cdic_index][offset + 1];
/* 1st bit is is_decompressed flag */
int is_decompressed = symbol_length >> 15;
/* get rid of flag */
symbol_length &= 0x7fff;
if (is_decompressed) {
/* symbol is at (offset + 2), 2 bytes used earlier for symbol length */
mobi_buffer_addraw(buf_out, (huffcdic->symbols[cdic_index] + offset + 2), symbol_length);
ret = buf_out->error;
} else {
/* symbol is compressed */
/* TODO cache uncompressed symbols? */
MOBIBuffer buf_sym;
buf_sym.data = huffcdic->symbols[cdic_index] + offset + 2;
buf_sym.offset = 0;
buf_sym.maxlen = symbol_length;
buf_sym.error = MOBI_SUCCESS;
ret = mobi_decompress_huffman_internal(buf_out, &buf_sym, huffcdic, depth + 1);
}
}
return ret;
} | 415 | True | 1 |
|
CVE-2021-3889 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/efb3e261-3f7d-4a45-8114-e0ace6b21516', 'name': 'https://huntr.dev/bounties/efb3e261-3f7d-4a45-8114-e0ace6b21516', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'name': 'https://github.com/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmobi is vulnerable to Use of Out-of-range Pointer Offset'}] | 2021-10-25T17:53Z | 2021-10-19T13: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 | Bartek Fabiszewski | 2021-09-18 21:55:27+02:00 | Fix potential out-of-buffer read while parsing corrupt file, closes #35, #36 | bec783e6212439a335ba6e8df7ab8ed610ca9a21 | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_decompress_huffman_internal | mobi_decompress_huffman_internal( MOBIBuffer * buf_out , MOBIBuffer * buf_in , const MOBIHuffCdic * huffcdic , size_t depth) | ['buf_out', 'buf_in', 'huffcdic', 'depth'] | static MOBI_RET mobi_decompress_huffman_internal(MOBIBuffer *buf_out, MOBIBuffer *buf_in, const MOBIHuffCdic *huffcdic, size_t depth) {
if (depth > MOBI_HUFFMAN_MAXDEPTH) {
debug_print("Too many levels of recursion: %zu\n", depth);
return MOBI_DATA_CORRUPT;
}
MOBI_RET ret = MOBI_SUCCESS;
int8_t bitcount = 32;
/* this cast should be safe: max record size is 4096 */
int bitsleft = (int) (buf_in->maxlen * 8);
uint8_t code_length = 0;
uint64_t buffer = mobi_buffer_fill64(buf_in);
while (ret == MOBI_SUCCESS) {
if (bitcount <= 0) {
bitcount += 32;
buffer = mobi_buffer_fill64(buf_in);
}
uint32_t code = (buffer >> bitcount) & 0xffffffffU;
/* lookup code in table1 */
uint32_t t1 = huffcdic->table1[code >> 24];
/* get maxcode and codelen from t1 */
code_length = t1 & 0x1f;
uint32_t maxcode = (((t1 >> 8) + 1) << (32 - code_length)) - 1;
/* check termination bit */
if (!(t1 & 0x80)) {
/* get offset from mincode, maxcode tables */
while (code < huffcdic->mincode_table[code_length]) {
code_length++;
}
maxcode = huffcdic->maxcode_table[code_length];
}
bitcount -= code_length;
bitsleft -= code_length;
if (bitsleft < 0) {
break;
}
/* get index for symbol offset */
uint32_t index = (uint32_t) (maxcode - code) >> (32 - code_length);
/* check which part of cdic to use */
uint16_t cdic_index = (uint16_t) ((uint32_t)index >> huffcdic->code_length);
if (index >= huffcdic->index_count) {
debug_print("Wrong symbol offsets index: %u\n", index);
return MOBI_DATA_CORRUPT;
}
/* get offset */
uint32_t offset = huffcdic->symbol_offsets[index];
uint32_t symbol_length = (uint32_t) huffcdic->symbols[cdic_index][offset] << 8 | (uint32_t) huffcdic->symbols[cdic_index][offset + 1];
/* 1st bit is is_decompressed flag */
int is_decompressed = symbol_length >> 15;
/* get rid of flag */
symbol_length &= 0x7fff;
if (is_decompressed) {
/* symbol is at (offset + 2), 2 bytes used earlier for symbol length */
mobi_buffer_addraw(buf_out, (huffcdic->symbols[cdic_index] + offset + 2), symbol_length);
ret = buf_out->error;
} else {
/* symbol is compressed */
/* TODO cache uncompressed symbols? */
MOBIBuffer buf_sym;
buf_sym.data = huffcdic->symbols[cdic_index] + offset + 2;
buf_sym.offset = 0;
buf_sym.maxlen = symbol_length;
buf_sym.error = MOBI_SUCCESS;
ret = mobi_decompress_huffman_internal(buf_out, &buf_sym, huffcdic, depth + 1);
}
}
return ret;
} | 415 | True | 1 |
|
CVE-2021-3881 | 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/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'name': 'https://github.com/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://huntr.dev/bounties/540fd115-7de4-4e19-a918-5ee61f5157c1', 'name': 'https://huntr.dev/bounties/540fd115-7de4-4e19-a918-5ee61f5157c1', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.7', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmobi is vulnerable to Out-of-bounds Read'}] | 2021-10-22T12:29Z | 2021-10-15T14: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 | Bartek Fabiszewski | 2021-09-18 21:55:27+02:00 | Fix potential out-of-buffer read while parsing corrupt file, closes #35, #36 | bec783e6212439a335ba6e8df7ab8ed610ca9a21 | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_parse_huff | mobi_parse_huff( MOBIHuffCdic * huffcdic , const MOBIPdbRecord * record) | ['huffcdic', 'record'] | MOBI_RET mobi_parse_huff(MOBIHuffCdic *huffcdic, const MOBIPdbRecord *record) {
MOBIBuffer *buf = mobi_buffer_init_null(record->data, record->size);
if (buf == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
char huff_magic[5];
mobi_buffer_getstring(huff_magic, buf, 4);
const size_t header_length = mobi_buffer_get32(buf);
if (strncmp(huff_magic, HUFF_MAGIC, 4) != 0 || header_length < HUFF_HEADER_LEN) {
debug_print("HUFF wrong magic: %s\n", huff_magic);
mobi_buffer_free_null(buf);
return MOBI_DATA_CORRUPT;
}
const size_t data1_offset = mobi_buffer_get32(buf);
const size_t data2_offset = mobi_buffer_get32(buf);
/* skip little-endian table offsets */
mobi_buffer_setpos(buf, data1_offset);
if (buf->offset + (256 * 4) > buf->maxlen) {
debug_print("%s", "HUFF data1 too short\n");
mobi_buffer_free_null(buf);
return MOBI_DATA_CORRUPT;
}
/* read 256 indices from data1 big-endian */
for (int i = 0; i < 256; i++) {
huffcdic->table1[i] = mobi_buffer_get32(buf);
}
mobi_buffer_setpos(buf, data2_offset);
if (buf->offset + (64 * 4) > buf->maxlen) {
debug_print("%s", "HUFF data2 too short\n");
mobi_buffer_free_null(buf);
return MOBI_DATA_CORRUPT;
}
/* read 32 mincode-maxcode pairs from data2 big-endian */
huffcdic->mincode_table[0] = 0;
huffcdic->maxcode_table[0] = 0xFFFFFFFF;
for (int i = 1; i < 33; i++) {
const uint32_t mincode = mobi_buffer_get32(buf);
const uint32_t maxcode = mobi_buffer_get32(buf);
huffcdic->mincode_table[i] = mincode << (32 - i);
huffcdic->maxcode_table[i] = ((maxcode + 1) << (32 - i)) - 1;
}
mobi_buffer_free_null(buf);
return MOBI_SUCCESS;
} | 330 | True | 1 |
|
CVE-2021-3889 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:N/A:P | NETWORK | MEDIUM | NONE | PARTIAL | NONE | PARTIAL | 5.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | NONE | HIGH | 8.1 | HIGH | 2.8 | 5.2 | False | [{'url': 'https://huntr.dev/bounties/efb3e261-3f7d-4a45-8114-e0ace6b21516', 'name': 'https://huntr.dev/bounties/efb3e261-3f7d-4a45-8114-e0ace6b21516', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'name': 'https://github.com/bfabiszewski/libmobi/commit/bec783e6212439a335ba6e8df7ab8ed610ca9a21', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-119'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmobi_project:libmobi:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'libmobi is vulnerable to Use of Out-of-range Pointer Offset'}] | 2021-10-25T17:53Z | 2021-10-19T13: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 | Bartek Fabiszewski | 2021-09-18 21:55:27+02:00 | Fix potential out-of-buffer read while parsing corrupt file, closes #35, #36 | bec783e6212439a335ba6e8df7ab8ed610ca9a21 | False | bfabiszewski/libmobi | C library for handling Kindle (MOBI) formats of ebook documents | 2014-05-14 10:23:18 | 2022-07-21 22:42:39 | bfabiszewski | 329.0 | 61.0 | mobi_parse_huff | mobi_parse_huff( MOBIHuffCdic * huffcdic , const MOBIPdbRecord * record) | ['huffcdic', 'record'] | MOBI_RET mobi_parse_huff(MOBIHuffCdic *huffcdic, const MOBIPdbRecord *record) {
MOBIBuffer *buf = mobi_buffer_init_null(record->data, record->size);
if (buf == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
char huff_magic[5];
mobi_buffer_getstring(huff_magic, buf, 4);
const size_t header_length = mobi_buffer_get32(buf);
if (strncmp(huff_magic, HUFF_MAGIC, 4) != 0 || header_length < HUFF_HEADER_LEN) {
debug_print("HUFF wrong magic: %s\n", huff_magic);
mobi_buffer_free_null(buf);
return MOBI_DATA_CORRUPT;
}
const size_t data1_offset = mobi_buffer_get32(buf);
const size_t data2_offset = mobi_buffer_get32(buf);
/* skip little-endian table offsets */
mobi_buffer_setpos(buf, data1_offset);
if (buf->offset + (256 * 4) > buf->maxlen) {
debug_print("%s", "HUFF data1 too short\n");
mobi_buffer_free_null(buf);
return MOBI_DATA_CORRUPT;
}
/* read 256 indices from data1 big-endian */
for (int i = 0; i < 256; i++) {
huffcdic->table1[i] = mobi_buffer_get32(buf);
}
mobi_buffer_setpos(buf, data2_offset);
if (buf->offset + (64 * 4) > buf->maxlen) {
debug_print("%s", "HUFF data2 too short\n");
mobi_buffer_free_null(buf);
return MOBI_DATA_CORRUPT;
}
/* read 32 mincode-maxcode pairs from data2 big-endian */
huffcdic->mincode_table[0] = 0;
huffcdic->maxcode_table[0] = 0xFFFFFFFF;
for (int i = 1; i < 33; i++) {
const uint32_t mincode = mobi_buffer_get32(buf);
const uint32_t maxcode = mobi_buffer_get32(buf);
huffcdic->mincode_table[i] = mincode << (32 - i);
huffcdic->maxcode_table[i] = ((maxcode + 1) << (32 - i)) - 1;
}
mobi_buffer_free_null(buf);
return MOBI_SUCCESS;
} | 330 | True | 1 |
|
CVE-2021-37847 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/saschahauer/barebox/commit/0a9f9a7410681e55362f8311537ebc7be9ad0fbe', 'name': 'https://github.com/saschahauer/barebox/commit/0a9f9a7410681e55362f8311537ebc7be9ad0fbe', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://gist.github.com/gquere/816dfadbad98745090034100a8a651eb', 'name': 'https://gist.github.com/gquere/816dfadbad98745090034100a8a651eb', '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:pengutronix:barebox:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2021.07.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'crypto/digest.c in Pengutronix barebox through 2021.07.0 leaks timing information because memcmp is used during digest verification.'}] | 2021-09-21T19:24Z | 2021-08-02T20: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 | Sascha Hauer | 2021-03-05 09:27:22+01:00 | crypto: digest: use crypto_memneq()
When verifying a digest it is important not to leak timing information
through memcmp(). Use crypto_memneq() instead.
Signed-off-by: Sascha Hauer <[email protected]> | 0a9f9a7410681e55362f8311537ebc7be9ad0fbe | False | saschahauer/barebox | The barebox bootloader | 2016-02-19 14:14:39 | 2022-08-25 10:03:28 | null | saschahauer | 77.0 | 35.0 | digest_generic_verify | digest_generic_verify( struct digest * d , const unsigned char * md) | ['d', 'md'] | int digest_generic_verify(struct digest *d, const unsigned char *md)
{
int ret;
int len = digest_length(d);
unsigned char *tmp;
tmp = xmalloc(len);
ret = digest_final(d, tmp);
if (ret)
goto end;
ret = memcmp(md, tmp, len);
ret = ret ? -EINVAL : 0;
end:
free(tmp);
return ret;
} | 84 | True | 1 |
CVE-2021-37848 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/saschahauer/barebox/commit/a3337563c705bc8e0cf32f910b3e9e3c43d962ff', 'name': 'https://github.com/saschahauer/barebox/commit/a3337563c705bc8e0cf32f910b3e9e3c43d962ff', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://gist.github.com/gquere/816dfadbad98745090034100a8a651eb', 'name': 'https://gist.github.com/gquere/816dfadbad98745090034100a8a651eb', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-203'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pengutronix:barebox:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2021.07.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'common/password.c in Pengutronix barebox through 2021.07.0 leaks timing information because strncmp is used during hash comparison.'}] | 2022-07-12T17:42Z | 2021-08-02T20: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 | Sascha Hauer | 2021-03-05 10:08:04+01:00 | password: Use crypto_memneq() to compare hashes
Cryptographic verifications should be time-constant so that an attacker
cannot get information about the secrets used by observing the system,
so use crypto_memneq() rather than memcmp() to compare password hashes.
Signed-off-by: Sascha Hauer <[email protected]> | a3337563c705bc8e0cf32f910b3e9e3c43d962ff | False | saschahauer/barebox | The barebox bootloader | 2016-02-19 14:14:39 | 2022-08-25 10:03:28 | null | saschahauer | 77.0 | 35.0 | check_passwd | check_passwd( unsigned char * passwd , size_t length) | ['passwd', 'length'] | static int check_passwd(unsigned char *passwd, size_t length)
{
struct digest *d = NULL;
unsigned char *passwd1_sum;
unsigned char *passwd2_sum;
int ret = 0;
int hash_len;
if (IS_ENABLED(CONFIG_PASSWD_CRYPTO_PBKDF2)) {
hash_len = PBKDF2_LENGTH;
} else {
d = digest_alloc(PASSWD_SUM);
if (!d) {
pr_err("No such digest: %s\n",
PASSWD_SUM ? PASSWD_SUM : "NULL");
return -ENOENT;
}
hash_len = digest_length(d);
}
passwd1_sum = calloc(hash_len * 2, sizeof(unsigned char));
if (!passwd1_sum)
return -ENOMEM;
passwd2_sum = passwd1_sum + hash_len;
if (is_passwd_env_enable())
ret = read_env_passwd(passwd2_sum, hash_len);
else if (is_passwd_default_enable())
ret = read_default_passwd(passwd2_sum, hash_len);
else
ret = -EINVAL;
if (ret < 0)
goto err;
if (IS_ENABLED(CONFIG_PASSWD_CRYPTO_PBKDF2)) {
char *key = passwd2_sum + PBKDF2_SALT_LEN;
char *salt = passwd2_sum;
int keylen = PBKDF2_LENGTH - PBKDF2_SALT_LEN;
ret = pkcs5_pbkdf2_hmac_sha1(passwd, length, salt,
PBKDF2_SALT_LEN, PBKDF2_COUNT, keylen, passwd1_sum);
if (ret)
goto err;
if (strncmp(passwd1_sum, key, keylen) == 0)
ret = 1;
} else {
ret = digest_digest(d, passwd, length, passwd1_sum);
if (ret)
goto err;
if (strncmp(passwd1_sum, passwd2_sum, hash_len) == 0)
ret = 1;
}
err:
free(passwd1_sum);
digest_free(d);
return ret;
} | 293 | True | 1 |
CVE-2021-38383 | 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/owntone/owntone-server/commit/246d8ae0cef27377e5dfe9ee3ad87e864d6b6266', 'name': 'https://github.com/owntone/owntone-server/commit/246d8ae0cef27377e5dfe9ee3ad87e864d6b6266', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:owntone_project:owntone:*:*:*:*:*:*:*:*', 'versionEndIncluding': '28.1', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'OwnTone (aka owntone-server) through 28.1 has a use-after-free in net_bind() in misc.c.'}] | 2021-08-17T19:21Z | 2021-08-10T18:15Z | Use After Free | Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. |
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for freeing the memory.
In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.
| https://cwe.mitre.org/data/definitions/416.html | 0 | ejurgensen | 2021-07-31 00:55:48+02:00 | [misc] Fix use-after-free in net_bind()
Thanks to Ba Jinsheng for reporting this bug | 246d8ae0cef27377e5dfe9ee3ad87e864d6b6266 | False | owntone/owntone-server | OwnTone is forked-daapd's new name. Linux/FreeBSD DAAP (iTunes) and MPD media server with support for AirPlay devices (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio. | 2013-05-24 09:42:14 | 2022-08-21 08:22:45 | https://owntone.github.io/owntone-server | owntone | 1471.0 | 202.0 | net_bind | net_bind( short unsigned * port , int type , const char * log_service_name) | ['port', 'type', 'log_service_name'] | net_bind(short unsigned *port, int type, const char *log_service_name)
{
struct addrinfo hints = { 0 };
struct addrinfo *servinfo;
struct addrinfo *ptr;
const char *cfgaddr;
char addr[INET6_ADDRSTRLEN];
char strport[8];
int yes = 1;
int no = 0;
int fd;
int ret;
cfgaddr = cfg_getstr(cfg_getsec(cfg, "general"), "bind_address");
hints.ai_socktype = (type & (SOCK_STREAM | SOCK_DGRAM)); // filter since type can be SOCK_STREAM | SOCK_NONBLOCK
hints.ai_family = (cfg_getbool(cfg_getsec(cfg, "general"), "ipv6")) ? AF_INET6 : AF_INET;
hints.ai_flags = cfgaddr ? 0 : AI_PASSIVE;
snprintf(strport, sizeof(strport), "%hu", *port);
ret = getaddrinfo(cfgaddr, strport, &hints, &servinfo);
if (ret < 0)
{
DPRINTF(E_LOG, L_MISC, "Failure creating '%s' service, could not resolve '%s' (port %s): %s\n", log_service_name, cfgaddr ? cfgaddr : "(ANY)", strport, gai_strerror(ret));
return -1;
}
for (ptr = servinfo, fd = -1; ptr != NULL; ptr = ptr->ai_next)
{
if (fd >= 0)
close(fd);
fd = socket(ptr->ai_family, type | SOCK_CLOEXEC, ptr->ai_protocol);
if (fd < 0)
continue;
// TODO libevent sets this, we do the same?
ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
if (ret < 0)
continue;
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
if (ret < 0)
continue;
if (ptr->ai_family == AF_INET6)
{
// We want to be sure the service is dual stack
ret = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no));
if (ret < 0)
continue;
}
ret = bind(fd, ptr->ai_addr, ptr->ai_addrlen);
if (ret < 0)
continue;
break;
}
freeaddrinfo(servinfo);
if (!ptr)
{
DPRINTF(E_LOG, L_MISC, "Could not create service '%s' with address %s, port %hu: %s\n", log_service_name, cfgaddr ? cfgaddr : "(ANY)", *port, strerror(errno));
goto error;
}
// Get the port that was assigned
ret = getsockname(fd, ptr->ai_addr, &ptr->ai_addrlen);
if (ret < 0)
{
DPRINTF(E_LOG, L_MISC, "Could not find address of service '%s': %s\n", log_service_name, strerror(errno));
goto error;
}
net_port_get(port, (union net_sockaddr *)ptr->ai_addr);
net_address_get(addr, sizeof(addr), (union net_sockaddr *)ptr->ai_addr);
DPRINTF(E_DBG, L_MISC, "Service '%s' bound to %s, port %hu, socket %d\n", log_service_name, addr, *port, fd);
return fd;
error:
close(fd);
return -1;
} | 517 | True | 1 |
CVE-2021-38593 | 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/google/oss-fuzz-vulns/blob/main/vulns/qt/OSV-2021-903.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/qt/OSV-2021-903.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/qt/qtbase/commit/6b400e3147dcfd8cc3a393ace1bd118c93762e0c', 'name': 'https://github.com/qt/qtbase/commit/6b400e3147dcfd8cc3a393ace1bd118c93762e0c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtbase/commit/1ca02cf2879a5e1511a2f2109f0925cf4c892862', 'name': 'https://github.com/qt/qtbase/commit/1ca02cf2879a5e1511a2f2109f0925cf4c892862', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/qt/qtbase/commit/202143ba41f6ac574f1858214ed8bf4a38b73ccd', 'name': 'https://github.com/qt/qtbase/commit/202143ba41f6ac574f1858214ed8bf4a38b73ccd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35566', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35566', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders', 'name': 'https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders', 'refsource': 'MISC', 'tags': ['Release Notes']}, {'url': 'https://wiki.qt.io/Qt_5.15_Release#Known_Issues', 'name': 'https://wiki.qt.io/Qt_5.15_Release#Known_Issues', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Release Notes', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/36VN2WKMNQUSTF6ZW2X52NPAJVXJ4S5I/', 'name': 'FEDORA-2022-54760f7fa4', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/HY5YCSDCTLHVMP3OXOM6HNTWHV6DBHDX/', 'name': 'FEDORA-2022-4131ced81a', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:qt:qt:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.0.0', 'versionEndIncluding': '6.1.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:qt:qt:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0.0', 'versionEndExcluding': '5.15.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Qt 5.x before 5.15.6 and 6.x through 6.1.2 has an out-of-bounds write in QOutlineMapper::convertPath (called from QRasterPaintEngine::fill and QPaintEngineEx::stroke).'}] | 2022-06-16T04:15Z | 2021-08-12T02:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Eirik Aavitsland | 2021-07-23 15:53:56+02:00 | Improve fix for avoiding huge number of tiny dashes
Some pathological cases were not caught by the previous fix.
Fixes: QTBUG-95239
Pick-to: 6.2 6.1 5.15
Change-Id: I0337ee3923ff93ccb36c4d7b810a9c0667354cc5
Reviewed-by: Robert Löhning <[email protected]> | 6b400e3147dcfd8cc3a393ace1bd118c93762e0c | False | qt/qtbase | Qt Base (Core, Gui, Widgets, Network, ...) | 2013-05-06 06:01:22 | 2022-08-27 21:27:01 | null | qt | 1756.0 | 842.0 | QPaintEngineEx::stroke | QPaintEngineEx::stroke( const QVectorPath & path , const QPen & inPen) | ['path', 'inPen'] | void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &inPen)
{
#ifdef QT_DEBUG_DRAW
qDebug() << "QPaintEngineEx::stroke()" << pen;
#endif
Q_D(QPaintEngineEx);
if (path.isEmpty())
return;
if (!d->strokeHandler) {
d->strokeHandler = new StrokeHandler(path.elementCount()+4);
d->stroker.setMoveToHook(qpaintengineex_moveTo);
d->stroker.setLineToHook(qpaintengineex_lineTo);
d->stroker.setCubicToHook(qpaintengineex_cubicTo);
}
QRectF clipRect;
QPen pen = inPen;
if (pen.style() > Qt::SolidLine) {
QRectF cpRect = path.controlPointRect();
const QTransform &xf = state()->matrix;
if (pen.isCosmetic()) {
clipRect = d->exDeviceRect;
cpRect.translate(xf.dx(), xf.dy());
} else {
clipRect = xf.inverted().mapRect(QRectF(d->exDeviceRect));
}
// Check to avoid generating unwieldy amount of dashes that will not be visible anyway
QRectF extentRect = cpRect & clipRect;
qreal extent = qMax(extentRect.width(), extentRect.height());
qreal patternLength = 0;
const QList<qreal> pattern = pen.dashPattern();
const int patternSize = qMin(pattern.size(), 32);
for (int i = 0; i < patternSize; i++)
patternLength += qMax(pattern.at(i), qreal(0));
if (pen.widthF())
patternLength *= pen.widthF();
if (qFuzzyIsNull(patternLength)) {
pen.setStyle(Qt::NoPen);
} else if (extent / patternLength > 10000) {
// approximate stream of tiny dashes with semi-transparent solid line
pen.setStyle(Qt::SolidLine);
QColor color(pen.color());
color.setAlpha(color.alpha() / 2);
pen.setColor(color);
}
}
if (!qpen_fast_equals(pen, d->strokerPen)) {
d->strokerPen = pen;
d->stroker.setJoinStyle(pen.joinStyle());
d->stroker.setCapStyle(pen.capStyle());
d->stroker.setMiterLimit(pen.miterLimit());
qreal penWidth = pen.widthF();
if (penWidth == 0)
d->stroker.setStrokeWidth(1);
else
d->stroker.setStrokeWidth(penWidth);
Qt::PenStyle style = pen.style();
if (style == Qt::SolidLine) {
d->activeStroker = &d->stroker;
} else if (style == Qt::NoPen) {
d->activeStroker = nullptr;
} else {
d->dasher.setDashPattern(pen.dashPattern());
d->dasher.setDashOffset(pen.dashOffset());
d->activeStroker = &d->dasher;
}
}
if (!d->activeStroker) {
return;
}
if (!clipRect.isNull())
d->activeStroker->setClipRect(clipRect);
if (d->activeStroker == &d->stroker)
d->stroker.setForceOpen(path.hasExplicitOpen());
const QPainterPath::ElementType *types = path.elements();
const qreal *points = path.points();
int pointCount = path.elementCount();
const qreal *lastPoint = points + (pointCount<<1);
d->strokeHandler->types.reset();
d->strokeHandler->pts.reset();
// Some engines might decide to optimize for the non-shape hint later on...
uint flags = QVectorPath::WindingFill;
if (path.elementCount() > 2)
flags |= QVectorPath::NonConvexShapeMask;
if (d->stroker.capStyle() == Qt::RoundCap || d->stroker.joinStyle() == Qt::RoundJoin)
flags |= QVectorPath::CurvedShapeMask;
// ### Perspective Xforms are currently not supported...
if (!pen.isCosmetic()) {
// We include cosmetic pens in this case to avoid having to
// change the current transform. Normal transformed,
// non-cosmetic pens will be transformed as part of fill
// later, so they are also covered here..
d->activeStroker->setCurveThresholdFromTransform(state()->matrix);
d->activeStroker->begin(d->strokeHandler);
if (types) {
while (points < lastPoint) {
switch (*types) {
case QPainterPath::MoveToElement:
d->activeStroker->moveTo(points[0], points[1]);
points += 2;
++types;
break;
case QPainterPath::LineToElement:
d->activeStroker->lineTo(points[0], points[1]);
points += 2;
++types;
break;
case QPainterPath::CurveToElement:
d->activeStroker->cubicTo(points[0], points[1],
points[2], points[3],
points[4], points[5]);
points += 6;
types += 3;
flags |= QVectorPath::CurvedShapeMask;
break;
default:
break;
}
}
if (path.hasImplicitClose())
d->activeStroker->lineTo(path.points()[0], path.points()[1]);
} else {
d->activeStroker->moveTo(points[0], points[1]);
points += 2;
while (points < lastPoint) {
d->activeStroker->lineTo(points[0], points[1]);
points += 2;
}
if (path.hasImplicitClose())
d->activeStroker->lineTo(path.points()[0], path.points()[1]);
}
d->activeStroker->end();
if (!d->strokeHandler->types.size()) // an empty path...
return;
QVectorPath strokePath(d->strokeHandler->pts.data(),
d->strokeHandler->types.size(),
d->strokeHandler->types.data(),
flags);
fill(strokePath, pen.brush());
} else {
// For cosmetic pens we need a bit of trickery... We to process xform the input points
if (state()->matrix.type() >= QTransform::TxProject) {
QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());
d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform());
} else {
d->activeStroker->setCurveThresholdFromTransform(QTransform());
d->activeStroker->begin(d->strokeHandler);
if (types) {
while (points < lastPoint) {
switch (*types) {
case QPainterPath::MoveToElement: {
QPointF pt = (*(const QPointF *) points) * state()->matrix;
d->activeStroker->moveTo(pt.x(), pt.y());
points += 2;
++types;
break;
}
case QPainterPath::LineToElement: {
QPointF pt = (*(const QPointF *) points) * state()->matrix;
d->activeStroker->lineTo(pt.x(), pt.y());
points += 2;
++types;
break;
}
case QPainterPath::CurveToElement: {
QPointF c1 = ((const QPointF *) points)[0] * state()->matrix;
QPointF c2 = ((const QPointF *) points)[1] * state()->matrix;
QPointF e = ((const QPointF *) points)[2] * state()->matrix;
d->activeStroker->cubicTo(c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y());
points += 6;
types += 3;
flags |= QVectorPath::CurvedShapeMask;
break;
}
default:
break;
}
}
if (path.hasImplicitClose()) {
QPointF pt = * ((const QPointF *) path.points()) * state()->matrix;
d->activeStroker->lineTo(pt.x(), pt.y());
}
} else {
QPointF p = ((const QPointF *)points)[0] * state()->matrix;
d->activeStroker->moveTo(p.x(), p.y());
points += 2;
while (points < lastPoint) {
QPointF p = ((const QPointF *)points)[0] * state()->matrix;
d->activeStroker->lineTo(p.x(), p.y());
points += 2;
}
if (path.hasImplicitClose())
d->activeStroker->lineTo(p.x(), p.y());
}
d->activeStroker->end();
}
QVectorPath strokePath(d->strokeHandler->pts.data(),
d->strokeHandler->types.size(),
d->strokeHandler->types.data(),
flags);
QTransform xform = state()->matrix;
state()->matrix = QTransform();
transformChanged();
QBrush brush = pen.brush();
if (qbrush_style(brush) != Qt::SolidPattern)
brush.setTransform(brush.transform() * xform);
fill(strokePath, brush);
state()->matrix = xform;
transformChanged();
}
} | 1725 | True | 1 |
CVE-2021-3996 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'name': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'name': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'refsource': 'MISC', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': "A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows a local user on a vulnerable system to unmount other users' filesystems that are either world-writable themselves (like /tmp) or mounted in a world-writable directory. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems."}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2022-01-04 10:37:55+01:00 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount too.
Signed-off-by: Karel Zak <[email protected]> | 166e87368ae88bf31112a30e078cceae637f4cdb | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | mnt_fs_is_deleted | mnt_fs_is_deleted( struct libmnt_fs * fs) | ['fs'] | int mnt_fs_is_deleted(struct libmnt_fs *fs)
{
return mnt_fs_get_flags(fs) & MNT_FS_DELETED;
} | 17 | True | 1 |
CVE-2021-3996 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'name': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'name': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'refsource': 'MISC', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': "A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows a local user on a vulnerable system to unmount other users' filesystems that are either world-writable themselves (like /tmp) or mounted in a world-writable directory. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems."}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2022-01-04 10:37:55+01:00 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount too.
Signed-off-by: Karel Zak <[email protected]> | 166e87368ae88bf31112a30e078cceae637f4cdb | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | mnt_parse_mountinfo_line | mnt_parse_mountinfo_line( struct libmnt_fs * fs , const char * s) | ['fs', 's'] | static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s)
{
int rc = 0;
unsigned int maj, min;
char *p;
fs->flags |= MNT_FS_KERNEL;
/* (1) id */
s = next_s32(s, &fs->id, &rc);
if (!s || !*s || rc) {
DBG(TAB, ul_debug("tab parse error: [id]"));
goto fail;
}
s = skip_separator(s);
/* (2) parent */
s = next_s32(s, &fs->parent, &rc);
if (!s || !*s || rc) {
DBG(TAB, ul_debug("tab parse error: [parent]"));
goto fail;
}
s = skip_separator(s);
/* (3) maj:min */
if (sscanf(s, "%u:%u", &maj, &min) != 2) {
DBG(TAB, ul_debug("tab parse error: [maj:min]"));
goto fail;
}
fs->devno = makedev(maj, min);
s = skip_nonspearator(s);
s = skip_separator(s);
/* (4) mountroot */
fs->root = unmangle(s, &s);
if (!fs->root) {
DBG(TAB, ul_debug("tab parse error: [mountroot]"));
goto fail;
}
s = skip_separator(s);
/* (5) target */
fs->target = unmangle(s, &s);
if (!fs->target) {
DBG(TAB, ul_debug("tab parse error: [target]"));
goto fail;
}
/* remove "\040(deleted)" suffix */
p = (char *) endswith(fs->target, PATH_DELETED_SUFFIX);
if (p && *p) {
*p = '\0';
fs->flags |= MNT_FS_DELETED;
}
s = skip_separator(s);
/* (6) vfs options (fs-independent) */
fs->vfs_optstr = unmangle(s, &s);
if (!fs->vfs_optstr) {
DBG(TAB, ul_debug("tab parse error: [VFS options]"));
goto fail;
}
/* (7) optional fields, terminated by " - " */
p = strstr(s, " - ");
if (!p) {
DBG(TAB, ul_debug("mountinfo parse error: separator not found"));
return -EINVAL;
}
if (p > s + 1)
fs->opt_fields = strndup(s + 1, p - s - 1);
s = skip_separator(p + 3);
/* (8) FS type */
p = unmangle(s, &s);
if (!p || (rc = __mnt_fs_set_fstype_ptr(fs, p))) {
DBG(TAB, ul_debug("tab parse error: [fstype]"));
free(p);
goto fail;
}
/* (9) source -- maybe empty string */
if (!s || !*s) {
DBG(TAB, ul_debug("tab parse error: [source]"));
goto fail;
} else if (*s == ' ' && *(s+1) == ' ') {
if ((rc = mnt_fs_set_source(fs, ""))) {
DBG(TAB, ul_debug("tab parse error: [empty source]"));
goto fail;
}
} else {
s = skip_separator(s);
p = unmangle(s, &s);
if (!p || (rc = __mnt_fs_set_source_ptr(fs, p))) {
DBG(TAB, ul_debug("tab parse error: [regular source]"));
free(p);
goto fail;
}
}
s = skip_separator(s);
/* (10) fs options (fs specific) */
fs->fs_optstr = unmangle(s, &s);
if (!fs->fs_optstr) {
DBG(TAB, ul_debug("tab parse error: [FS options]"));
goto fail;
}
/* merge VFS and FS options to one string */
fs->optstr = mnt_fs_strdup_options(fs);
if (!fs->optstr) {
rc = -ENOMEM;
DBG(TAB, ul_debug("tab parse error: [merge VFS and FS options]"));
goto fail;
}
return 0;
fail:
if (rc == 0)
rc = -EINVAL;
DBG(TAB, ul_debug("tab parse error on: '%s' [rc=%d]", s, rc));
return rc;
} | 686 | True | 1 |
CVE-2021-3996 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'name': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'name': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'refsource': 'MISC', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': "A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows a local user on a vulnerable system to unmount other users' filesystems that are either world-writable themselves (like /tmp) or mounted in a world-writable directory. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems."}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2022-01-04 10:37:55+01:00 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount too.
Signed-off-by: Karel Zak <[email protected]> | 166e87368ae88bf31112a30e078cceae637f4cdb | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | get_data | get_data( struct libmnt_fs * fs , int num) | ['fs', 'num'] | static char *get_data(struct libmnt_fs *fs, int num)
{
char *str = NULL;
const char *t = NULL, *v = NULL;
int col_id = get_column_id(num);
switch (col_id) {
case COL_SOURCES:
/* print all devices with the same tag (LABEL, UUID) */
if ((flags & FL_EVALUATE) &&
mnt_fs_get_tag(fs, &t, &v) == 0) {
blkid_dev_iterate iter;
blkid_dev dev;
blkid_cache cache = NULL;
struct ul_buffer buf = UL_INIT_BUFFER;
int i = 0;
if (blkid_get_cache(&cache, NULL) < 0)
break;
blkid_probe_all(cache);
iter = blkid_dev_iterate_begin(cache);
blkid_dev_set_search(iter, t, v);
while (blkid_dev_next(iter, &dev) == 0) {
dev = blkid_verify(cache, dev);
if (!dev)
continue;
if (i != 0)
ul_buffer_append_data(&buf, "\n", 1);
ul_buffer_append_string(&buf, blkid_dev_devname(dev));
i++;
}
blkid_dev_iterate_end(iter);
str = ul_buffer_get_data(&buf, NULL, NULL);
break;
}
/* fallthrough */
case COL_SOURCE:
{
const char *root = mnt_fs_get_root(fs);
const char *spec = mnt_fs_get_srcpath(fs);
char *cn = NULL;
if (spec && (flags & FL_CANONICALIZE))
spec = cn = mnt_resolve_path(spec, cache);
if (!spec) {
spec = mnt_fs_get_source(fs);
if (spec && (flags & FL_EVALUATE))
spec = cn = mnt_resolve_spec(spec, cache);
}
if (root && spec && !(flags & FL_NOFSROOT) && strcmp(root, "/") != 0)
xasprintf(&str, "%s[%s]", spec, root);
else if (spec)
str = xstrdup(spec);
if (!cache)
free(cn);
break;
}
case COL_TARGET:
if (mnt_fs_get_target(fs))
str = xstrdup(mnt_fs_get_target(fs));
break;
case COL_FSTYPE:
if (mnt_fs_get_fstype(fs))
str = xstrdup(mnt_fs_get_fstype(fs));
break;
case COL_OPTIONS:
if (mnt_fs_get_options(fs))
str = xstrdup(mnt_fs_get_options(fs));
break;
case COL_VFS_OPTIONS:
if (flags & FL_VFS_ALL)
str = mnt_fs_get_vfs_options_all(fs);
else if (mnt_fs_get_vfs_options(fs))
str = xstrdup(mnt_fs_get_vfs_options(fs));
break;
case COL_FS_OPTIONS:
if (mnt_fs_get_fs_options(fs))
str = xstrdup(mnt_fs_get_fs_options(fs));
break;
case COL_OPT_FIELDS:
if (mnt_fs_get_optional_fields(fs))
str = xstrdup(mnt_fs_get_optional_fields(fs));
break;
case COL_UUID:
str = get_tag(fs, "UUID", col_id);
break;
case COL_PARTUUID:
str = get_tag(fs, "PARTUUID", col_id);
break;
case COL_LABEL:
str = get_tag(fs, "LABEL", col_id);
break;
case COL_PARTLABEL:
str = get_tag(fs, "PARTLABEL", col_id);
break;
case COL_MAJMIN:
{
dev_t devno = mnt_fs_get_devno(fs);
if (!devno)
break;
if ((flags & FL_RAW) || (flags & FL_EXPORT) || (flags & FL_JSON))
xasprintf(&str, "%u:%u", major(devno), minor(devno));
else
xasprintf(&str, "%3u:%-3u", major(devno), minor(devno));
break;
}
case COL_SIZE:
case COL_AVAIL:
case COL_USED:
case COL_USEPERC:
str = get_vfs_attr(fs, col_id);
break;
case COL_FSROOT:
if (mnt_fs_get_root(fs))
str = xstrdup(mnt_fs_get_root(fs));
break;
case COL_TID:
if (mnt_fs_get_tid(fs))
xasprintf(&str, "%d", mnt_fs_get_tid(fs));
break;
case COL_ID:
if (mnt_fs_get_id(fs))
xasprintf(&str, "%d", mnt_fs_get_id(fs));
break;
case COL_PARENT:
if (mnt_fs_get_parent_id(fs))
xasprintf(&str, "%d", mnt_fs_get_parent_id(fs));
break;
case COL_PROPAGATION:
if (mnt_fs_is_kernel(fs)) {
unsigned long fl = 0;
char *n = NULL;
if (mnt_fs_get_propagation(fs, &fl) != 0)
break;
n = xstrdup((fl & MS_SHARED) ? "shared" : "private");
if (fl & MS_SLAVE) {
xasprintf(&str, "%s,slave", n);
free(n);
n = str;
}
if (fl & MS_UNBINDABLE) {
xasprintf(&str, "%s,unbindable", n);
free(n);
n = str;
}
str = n;
}
break;
case COL_FREQ:
if (!mnt_fs_is_kernel(fs))
xasprintf(&str, "%d", mnt_fs_get_freq(fs));
break;
case COL_PASSNO:
if (!mnt_fs_is_kernel(fs))
xasprintf(&str, "%d", mnt_fs_get_passno(fs));
break;
case COL_DELETED:
str = xstrdup(mnt_fs_is_deleted(fs) ? "1" : "0");
break;
default:
break;
}
return str;
} | 951 | True | 1 |
CVE-2021-3996 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'name': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'name': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'refsource': 'MISC', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': "A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows a local user on a vulnerable system to unmount other users' filesystems that are either world-writable themselves (like /tmp) or mounted in a world-writable directory. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems."}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2022-01-04 10:37:55+01:00 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount too.
Signed-off-by: Karel Zak <[email protected]> | 166e87368ae88bf31112a30e078cceae637f4cdb | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
struct libmnt_table *tb = NULL;
char **tabfiles = NULL;
int direction = MNT_ITER_FORWARD;
int verify = 0;
int c, rc = -1, timeout = -1;
int ntabfiles = 0, tabtype = 0;
char *outarg = NULL;
size_t i;
int force_tree = 0, istree = 0;
struct libscols_table *table = NULL;
enum {
FINDMNT_OPT_VERBOSE = CHAR_MAX + 1,
FINDMNT_OPT_TREE,
FINDMNT_OPT_OUTPUT_ALL,
FINDMNT_OPT_PSEUDO,
FINDMNT_OPT_REAL,
FINDMNT_OPT_VFS_ALL,
FINDMNT_OPT_SHADOWED,
FINDMNT_OPT_DELETED,
};
static const struct option longopts[] = {
{ "all", no_argument, NULL, 'A' },
{ "ascii", no_argument, NULL, 'a' },
{ "bytes", no_argument, NULL, 'b' },
{ "canonicalize", no_argument, NULL, 'c' },
{ "deleted", no_argument, NULL, FINDMNT_OPT_DELETED },
{ "direction", required_argument, NULL, 'd' },
{ "df", no_argument, NULL, 'D' },
{ "evaluate", no_argument, NULL, 'e' },
{ "first-only", no_argument, NULL, 'f' },
{ "fstab", no_argument, NULL, 's' },
{ "help", no_argument, NULL, 'h' },
{ "invert", no_argument, NULL, 'i' },
{ "json", no_argument, NULL, 'J' },
{ "kernel", no_argument, NULL, 'k' },
{ "list", no_argument, NULL, 'l' },
{ "mountpoint", required_argument, NULL, 'M' },
{ "mtab", no_argument, NULL, 'm' },
{ "noheadings", no_argument, NULL, 'n' },
{ "notruncate", no_argument, NULL, 'u' },
{ "options", required_argument, NULL, 'O' },
{ "output", required_argument, NULL, 'o' },
{ "output-all", no_argument, NULL, FINDMNT_OPT_OUTPUT_ALL },
{ "poll", optional_argument, NULL, 'p' },
{ "pairs", no_argument, NULL, 'P' },
{ "raw", no_argument, NULL, 'r' },
{ "types", required_argument, NULL, 't' },
{ "nocanonicalize", no_argument, NULL, 'C' },
{ "nofsroot", no_argument, NULL, 'v' },
{ "submounts", no_argument, NULL, 'R' },
{ "source", required_argument, NULL, 'S' },
{ "tab-file", required_argument, NULL, 'F' },
{ "task", required_argument, NULL, 'N' },
{ "target", required_argument, NULL, 'T' },
{ "timeout", required_argument, NULL, 'w' },
{ "uniq", no_argument, NULL, 'U' },
{ "verify", no_argument, NULL, 'x' },
{ "version", no_argument, NULL, 'V' },
{ "verbose", no_argument, NULL, FINDMNT_OPT_VERBOSE },
{ "tree", no_argument, NULL, FINDMNT_OPT_TREE },
{ "real", no_argument, NULL, FINDMNT_OPT_REAL },
{ "pseudo", no_argument, NULL, FINDMNT_OPT_PSEUDO },
{ "vfs-all", no_argument, NULL, FINDMNT_OPT_VFS_ALL },
{ "shadowed", no_argument, NULL, FINDMNT_OPT_SHADOWED },
{ NULL, 0, NULL, 0 }
};
static const ul_excl_t excl[] = { /* rows and cols in ASCII order */
{ 'C', 'c'}, /* [no]canonicalize */
{ 'C', 'e' }, /* nocanonicalize, evaluate */
{ 'J', 'P', 'r','x' }, /* json,pairs,raw,verify */
{ 'M', 'T' }, /* mountpoint, target */
{ 'N','k','m','s' }, /* task,kernel,mtab,fstab */
{ 'P','l','r','x' }, /* pairs,list,raw,verify */
{ 'p','x' }, /* poll,verify */
{ 'm','p','s' }, /* mtab,poll,fstab */
{ FINDMNT_OPT_PSEUDO, FINDMNT_OPT_REAL },
{ 0 }
};
int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
close_stdout_atexit();
/* default output format */
flags |= FL_TREE;
while ((c = getopt_long(argc, argv,
"AabCcDd:ehiJfF:o:O:p::PklmM:nN:rst:uvRS:T:Uw:Vx",
longopts, NULL)) != -1) {
err_exclusive_options(c, longopts, excl, excl_st);
switch(c) {
case 'A':
flags |= FL_ALL;
break;
case 'a':
flags |= FL_ASCII;
break;
case 'b':
flags |= FL_BYTES;
break;
case 'C':
flags |= FL_NOCACHE;
break;
case 'c':
flags |= FL_CANONICALIZE;
break;
case 'D':
flags &= ~FL_TREE;
flags |= FL_DF;
break;
case 'd':
if (!strcmp(optarg, "forward"))
direction = MNT_ITER_FORWARD;
else if (!strcmp(optarg, "backward"))
direction = MNT_ITER_BACKWARD;
else
errx(EXIT_FAILURE,
_("unknown direction '%s'"), optarg);
break;
case 'e':
flags |= FL_EVALUATE;
break;
case 'i':
flags |= FL_INVERT;
break;
case 'J':
flags |= FL_JSON;
break;
case 'f':
flags |= FL_FIRSTONLY;
break;
case 'F':
tabfiles = append_tabfile(tabfiles, &ntabfiles, optarg);
break;
case 'u':
disable_columns_truncate();
break;
case 'o':
outarg = optarg;
break;
case FINDMNT_OPT_OUTPUT_ALL:
for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) {
if (is_tabdiff_column(ncolumns))
continue;
columns[ncolumns] = ncolumns;
}
break;
case 'O':
set_match(COL_OPTIONS, optarg);
break;
case 'p':
if (optarg) {
nactions = string_to_idarray(optarg,
actions, ARRAY_SIZE(actions),
poll_action_name_to_id);
if (nactions < 0)
exit(EXIT_FAILURE);
}
flags |= FL_POLL;
flags &= ~FL_TREE;
break;
case 'P':
flags |= FL_EXPORT;
flags &= ~FL_TREE;
break;
case 'm': /* mtab */
tabtype = TABTYPE_MTAB;
flags &= ~FL_TREE;
break;
case 's': /* fstab */
tabtype = TABTYPE_FSTAB;
flags &= ~FL_TREE;
break;
case 'k': /* kernel (mountinfo) */
tabtype = TABTYPE_KERNEL;
break;
case 't':
set_match(COL_FSTYPE, optarg);
break;
case 'r':
flags &= ~FL_TREE; /* disable the default */
flags |= FL_RAW; /* enable raw */
break;
case 'l':
flags &= ~FL_TREE; /* disable the default */
break;
case 'n':
flags |= FL_NOHEADINGS;
break;
case 'N':
tabtype = TABTYPE_KERNEL;
tabfiles = append_pid_tabfile(tabfiles, &ntabfiles,
strtou32_or_err(optarg,
_("invalid TID argument")));
break;
case 'v':
flags |= FL_NOFSROOT;
break;
case 'R':
flags |= FL_SUBMOUNTS;
break;
case 'S':
set_source_match(optarg);
flags |= FL_NOSWAPMATCH;
break;
case 'M':
flags |= FL_STRICTTARGET;
/* fallthrough */
case 'T':
set_match(COL_TARGET, optarg);
flags |= FL_NOSWAPMATCH;
break;
case 'U':
flags |= FL_UNIQ;
break;
case 'w':
timeout = strtos32_or_err(optarg, _("invalid timeout argument"));
break;
case 'x':
verify = 1;
break;
case FINDMNT_OPT_VERBOSE:
flags |= FL_VERBOSE;
break;
case FINDMNT_OPT_TREE:
force_tree = 1;
break;
case FINDMNT_OPT_PSEUDO:
flags |= FL_PSEUDO;
break;
case FINDMNT_OPT_REAL:
flags |= FL_REAL;
break;
case FINDMNT_OPT_VFS_ALL:
flags |= FL_VFS_ALL;
break;
case FINDMNT_OPT_SHADOWED:
flags |= FL_SHADOWED;
break;
case FINDMNT_OPT_DELETED:
flags |= FL_DELETED;
break;
case 'h':
usage();
case 'V':
print_version(EXIT_SUCCESS);
default:
errtryhelp(EXIT_FAILURE);
}
}
if (!ncolumns && (flags & FL_DF)) {
add_column(columns, ncolumns++, COL_SOURCE);
add_column(columns, ncolumns++, COL_FSTYPE);
add_column(columns, ncolumns++, COL_SIZE);
add_column(columns, ncolumns++, COL_USED);
add_column(columns, ncolumns++, COL_AVAIL);
add_column(columns, ncolumns++, COL_USEPERC);
add_column(columns, ncolumns++, COL_TARGET);
}
/* default columns */
if (!ncolumns) {
if (flags & FL_POLL)
add_column(columns, ncolumns++, COL_ACTION);
add_column(columns, ncolumns++, COL_TARGET);
add_column(columns, ncolumns++, COL_SOURCE);
add_column(columns, ncolumns++, COL_FSTYPE);
add_column(columns, ncolumns++, COL_OPTIONS);
}
if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns),
&ncolumns, column_name_to_id) < 0)
return EXIT_FAILURE;
if (!tabtype)
tabtype = verify ? TABTYPE_FSTAB : TABTYPE_KERNEL;
if ((flags & FL_POLL) && ntabfiles > 1)
errx(EXIT_FAILURE, _("--poll accepts only one file, but more specified by --tab-file"));
if (optind < argc && (get_match(COL_SOURCE) || get_match(COL_TARGET)))
errx(EXIT_FAILURE, _(
"options --target and --source can't be used together "
"with command line element that is not an option"));
if (optind < argc)
set_source_match(argv[optind++]); /* dev/tag/mountpoint/maj:min */
if (optind < argc)
set_match(COL_TARGET, argv[optind++]); /* mountpoint */
if ((flags & FL_SUBMOUNTS) && is_listall_mode())
/* don't care about submounts if list all mounts */
flags &= ~FL_SUBMOUNTS;
if (!(flags & FL_SUBMOUNTS) && ((flags & FL_FIRSTONLY)
|| get_match(COL_TARGET)
|| get_match(COL_SOURCE)
|| get_match(COL_MAJMIN)))
flags &= ~FL_TREE;
if (!(flags & FL_NOSWAPMATCH) &&
!get_match(COL_TARGET) && get_match(COL_SOURCE)) {
/*
* Check if we can swap source and target, it's
* not possible if the source is LABEL=/UUID=
*/
const char *x = get_match(COL_SOURCE);
if (!strncmp(x, "LABEL=", 6) || !strncmp(x, "UUID=", 5) ||
!strncmp(x, "PARTLABEL=", 10) || !strncmp(x, "PARTUUID=", 9))
flags |= FL_NOSWAPMATCH;
}
/*
* initialize libmount
*/
mnt_init_debug(0);
tb = parse_tabfiles(tabfiles, ntabfiles, tabtype);
if (!tb)
goto leave;
if (tabtype == TABTYPE_MTAB && tab_is_kernel(tb))
tabtype = TABTYPE_KERNEL;
istree = tab_is_tree(tb);
if (istree && force_tree)
flags |= FL_TREE;
if ((flags & FL_TREE) && (ntabfiles > 1 || !istree))
flags &= ~FL_TREE;
if (!(flags & FL_NOCACHE)) {
cache = mnt_new_cache();
if (!cache) {
warn(_("failed to initialize libmount cache"));
goto leave;
}
mnt_table_set_cache(tb, cache);
if (tabtype != TABTYPE_KERNEL)
cache_set_targets(cache);
}
if (flags & FL_UNIQ)
mnt_table_uniq_fs(tb, MNT_UNIQ_KEEPTREE, uniq_fs_target_cmp);
if (verify) {
rc = verify_table(tb);
goto leave;
}
/*
* initialize libsmartcols
*/
scols_init_debug(0);
table = scols_new_table();
if (!table) {
warn(_("failed to allocate output table"));
goto leave;
}
scols_table_enable_raw(table, !!(flags & FL_RAW));
scols_table_enable_export(table, !!(flags & FL_EXPORT));
scols_table_enable_json(table, !!(flags & FL_JSON));
scols_table_enable_ascii(table, !!(flags & FL_ASCII));
scols_table_enable_noheadings(table, !!(flags & FL_NOHEADINGS));
if (flags & FL_JSON)
scols_table_set_name(table, "filesystems");
for (i = 0; i < ncolumns; i++) {
struct libscols_column *cl;
int fl = get_column_flags(i);
int id = get_column_id(i);
if (!(flags & FL_TREE))
fl &= ~SCOLS_FL_TREE;
if (!(flags & FL_POLL) && is_tabdiff_column(id)) {
warnx(_("%s column is requested, but --poll "
"is not enabled"), get_column_name(i));
goto leave;
}
cl = scols_table_new_column(table, get_column_name(i),
get_column_whint(i), fl);
if (!cl) {
warn(_("failed to allocate output column"));
goto leave;
}
/* multi-line cells (now used for SOURCES) */
if (fl & SCOLS_FL_WRAP) {
scols_column_set_wrapfunc(cl,
scols_wrapnl_chunksize,
scols_wrapnl_nextchunk,
NULL);
scols_column_set_safechars(cl, "\n");
}
if (flags & FL_JSON) {
switch (id) {
case COL_SIZE:
case COL_AVAIL:
case COL_USED:
if (!(flags & FL_BYTES))
break;
/* fallthrough */
case COL_ID:
case COL_PARENT:
case COL_FREQ:
case COL_PASSNO:
case COL_TID:
scols_column_set_json_type(cl, SCOLS_JSON_NUMBER);
break;
case COL_DELETED:
scols_column_set_json_type(cl, SCOLS_JSON_BOOLEAN);
break;
default:
if (fl & SCOLS_FL_WRAP)
scols_column_set_json_type(cl, SCOLS_JSON_ARRAY_STRING);
else
scols_column_set_json_type(cl, SCOLS_JSON_STRING);
break;
}
}
}
/*
* Fill in data to the output table
*/
if (flags & FL_POLL) {
/* poll mode (accept the first tabfile only) */
rc = poll_table(tb, tabfiles ? *tabfiles : _PATH_PROC_MOUNTINFO, timeout, table, direction);
} else if ((flags & FL_TREE) && !(flags & FL_SUBMOUNTS)) {
/* whole tree */
rc = create_treenode(table, tb, NULL, NULL);
} else {
/* whole list of sub-tree */
rc = add_matching_lines(tb, table, direction);
if (rc != 0
&& tabtype == TABTYPE_KERNEL
&& (flags & FL_NOSWAPMATCH)
&& !(flags & FL_STRICTTARGET)
&& get_match(COL_TARGET)) {
/*
* Found nothing, maybe the --target is regular file,
* try it again with extra functionality for target
* match
*/
enable_extra_target_match(tb);
rc = add_matching_lines(tb, table, direction);
}
}
/*
* Print the output table for non-poll modes
*/
if (!rc && !(flags & FL_POLL))
scols_print_table(table);
leave:
scols_unref_table(table);
mnt_unref_table(tb);
mnt_unref_cache(cache);
free(tabfiles);
#ifdef HAVE_LIBUDEV
udev_unref(udev);
#endif
return rc ? EXIT_FAILURE : EXIT_SUCCESS;
} | 2361 | True | 1 |
CVE-2021-3996 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'name': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'name': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'refsource': 'MISC', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': "A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows a local user on a vulnerable system to unmount other users' filesystems that are either world-writable themselves (like /tmp) or mounted in a world-writable directory. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems."}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2022-01-04 10:37:55+01:00 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount too.
Signed-off-by: Karel Zak <[email protected]> | 166e87368ae88bf31112a30e078cceae637f4cdb | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | match_func | match_func( struct libmnt_fs * fs , void * data __attribute__((__unused__))) | ['fs', '__attribute__'] | static int match_func(struct libmnt_fs *fs,
void *data __attribute__ ((__unused__)))
{
int rc = flags & FL_INVERT ? 1 : 0;
const char *m;
void *md;
m = get_match(COL_FSTYPE);
if (m && !mnt_fs_match_fstype(fs, m))
return rc;
m = get_match(COL_OPTIONS);
if (m && !mnt_fs_match_options(fs, m))
return rc;
md = get_match_data(COL_MAJMIN);
if (md && mnt_fs_get_devno(fs) != *((dev_t *) md))
return rc;
m = get_match(COL_TARGET);
if (m && !mnt_fs_match_target(fs, m, cache))
return rc;
m = get_match(COL_SOURCE);
if (m && !mnt_fs_match_source(fs, m, cache))
return rc;
if ((flags & FL_DF) && !(flags & FL_ALL)) {
const char *type = mnt_fs_get_fstype(fs);
if (type && strstr(type, "tmpfs")) /* tmpfs is wanted */
return !rc;
if (mnt_fs_is_pseudofs(fs))
return rc;
}
if ((flags & FL_REAL) && mnt_fs_is_pseudofs(fs))
return rc;
if ((flags & FL_PSEUDO) && !mnt_fs_is_pseudofs(fs))
return rc;
if ((flags & FL_SHADOWED)) {
struct libmnt_table *tb = NULL;
mnt_fs_get_table(fs, &tb);
if (tb && mnt_table_over_fs(tb, fs, NULL) != 0)
return rc;
}
if ((flags & FL_DELETED) && !mnt_fs_is_deleted(fs))
return rc;
return !rc;
} | 308 | True | 1 |
CVE-2021-3996 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'name': 'https://github.com/util-linux/util-linux/commit/166e87368ae88bf31112a30e078cceae637f4cdb', 'refsource': 'MISC', 'tags': []}, {'url': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'name': 'https://access.redhat.com/security/cve/CVE-2021-3996', 'refsource': 'MISC', 'tags': []}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024628', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': "A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows a local user on a vulnerable system to unmount other users' filesystems that are either world-writable themselves (like /tmp) or mounted in a world-writable directory. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems."}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2022-01-04 10:37:55+01:00 | libmount: remove support for deleted mount table entries
The "(deleted)" suffix has been originally used by kernel for deleted
mountpoints. Since kernel commit 9d4d65748a5ca26ea8650e50ba521295549bf4e3
(Dec 2014) kernel does not use this suffix for mount stuff in /proc at
all. Let's remove this support from libmount too.
Signed-off-by: Karel Zak <[email protected]> | 166e87368ae88bf31112a30e078cceae637f4cdb | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | usage | usage( void) | ['void'] | static void __attribute__((__noreturn__)) usage(void)
{
FILE *out = stdout;
size_t i;
fputs(USAGE_HEADER, out);
fprintf(out, _(
" %1$s [options]\n"
" %1$s [options] <device> | <mountpoint>\n"
" %1$s [options] <device> <mountpoint>\n"
" %1$s [options] [--source <device>] [--target <path> | --mountpoint <dir>]\n"),
program_invocation_short_name);
fputs(USAGE_SEPARATOR, out);
fputs(_("Find a (mounted) filesystem.\n"), out);
fputs(USAGE_OPTIONS, out);
fputs(_(" -s, --fstab search in static table of filesystems\n"), out);
fputs(_(" -m, --mtab search in table of mounted filesystems\n"
" (includes user space mount options)\n"), out);
fputs(_(" -k, --kernel search in kernel table of mounted\n"
" filesystems (default)\n"), out);
fputc('\n', out);
fputs(_(" -p, --poll[=<list>] monitor changes in table of mounted filesystems\n"), out);
fputs(_(" -w, --timeout <num> upper limit in milliseconds that --poll will block\n"), out);
fputc('\n', out);
fputs(_(" -A, --all disable all built-in filters, print all filesystems\n"), out);
fputs(_(" -a, --ascii use ASCII chars for tree formatting\n"), out);
fputs(_(" -b, --bytes print sizes in bytes rather than in human readable format\n"), out);
fputs(_(" -C, --nocanonicalize don't canonicalize when comparing paths\n"), out);
fputs(_(" -c, --canonicalize canonicalize printed paths\n"), out);
fputs(_(" --deleted print filesystems with mountpoint marked as deleted\n"), out);
fputs(_(" -D, --df imitate the output of df(1)\n"), out);
fputs(_(" -d, --direction <word> direction of search, 'forward' or 'backward'\n"), out);
fputs(_(" -e, --evaluate convert tags (LABEL,UUID,PARTUUID,PARTLABEL) \n"
" to device names\n"), out);
fputs(_(" -F, --tab-file <path> alternative file for -s, -m or -k options\n"), out);
fputs(_(" -f, --first-only print the first found filesystem only\n"), out);
fputs(_(" -i, --invert invert the sense of matching\n"), out);
fputs(_(" -J, --json use JSON output format\n"), out);
fputs(_(" -l, --list use list format output\n"), out);
fputs(_(" -N, --task <tid> use alternative namespace (/proc/<tid>/mountinfo file)\n"), out);
fputs(_(" -n, --noheadings don't print column headings\n"), out);
fputs(_(" -O, --options <list> limit the set of filesystems by mount options\n"), out);
fputs(_(" -o, --output <list> the output columns to be shown\n"), out);
fputs(_(" --output-all output all available columns\n"), out);
fputs(_(" -P, --pairs use key=\"value\" output format\n"), out);
fputs(_(" --pseudo print only pseudo-filesystems\n"), out);
fputs(_(" --shadowed print only filesystems over-mounted by another filesystem\n"), out);
fputs(_(" -R, --submounts print all submounts for the matching filesystems\n"), out);
fputs(_(" -r, --raw use raw output format\n"), out);
fputs(_(" --real print only real filesystems\n"), out);
fputs(_(" -S, --source <string> the device to mount (by name, maj:min, \n"
" LABEL=, UUID=, PARTUUID=, PARTLABEL=)\n"), out);
fputs(_(" -T, --target <path> the path to the filesystem to use\n"), out);
fputs(_(" --tree enable tree format output if possible\n"), out);
fputs(_(" -M, --mountpoint <dir> the mountpoint directory\n"), out);
fputs(_(" -t, --types <list> limit the set of filesystems by FS types\n"), out);
fputs(_(" -U, --uniq ignore filesystems with duplicate target\n"), out);
fputs(_(" -u, --notruncate don't truncate text in columns\n"), out);
fputs(_(" -v, --nofsroot don't print [/dir] for bind or btrfs mounts\n"), out);
fputc('\n', out);
fputs(_(" -x, --verify verify mount table content (default is fstab)\n"), out);
fputs(_(" --verbose print more details\n"), out);
fputs(_(" --vfs-all print all VFS options\n"), out);
fputs(USAGE_SEPARATOR, out);
printf(USAGE_HELP_OPTIONS(24));
fputs(USAGE_COLUMNS, out);
for (i = 0; i < ARRAY_SIZE(infos); i++)
fprintf(out, " %11s %s\n", infos[i].name, _(infos[i].help));
printf(USAGE_MAN_TAIL("findmnt(8)"));
exit(EXIT_SUCCESS);
} | 570 | True | 1 |
CVE-2021-3995 | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | nan | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024631https://access.redhat.com/security/cve/CVE-2021-3995', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2024631https://access.redhat.com/security/cve/CVE-2021-3995', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/util-linux/util-linux/commit/57202f5713afa2af20ffbb6ab5331481d0396f8d', 'name': 'https://github.com/util-linux/util-linux/commit/57202f5713afa2af20ffbb6ab5331481d0396f8d', 'refsource': 'MISC', 'tags': []}, {'url': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'name': 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37.3-ReleaseNotes', 'refsource': 'MISC', 'tags': []}, {'url': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'name': 'https://www.openwall.com/lists/oss-security/2022/01/24/2', 'refsource': 'MISC', 'tags': []}] | [{'description': []}] | nan | [] | [{'lang': 'en', 'value': 'A logic error was found in the libmount library of util-linux in the function that allows an unprivileged user to unmount a FUSE filesystem. This flaw allows an unprivileged local attacker to unmount FUSE filesystems that belong to certain other users who have a UID that is a prefix of the UID of the attacker in its string form. An attacker may use this flaw to cause a denial of service to applications that use the affected filesystems.'}] | 2022-08-24T11:43Z | 2022-08-23T20: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 | Karel Zak | 2021-11-24 13:53:25+01:00 | libmount: fix UID check for FUSE umount [CVE-2021-3995]
Improper UID check allows an unprivileged user to unmount FUSE
filesystems of users with similar UID.
Signed-off-by: Karel Zak <[email protected]> | 57202f5713afa2af20ffbb6ab5331481d0396f8d | False | util-linux/util-linux | null | 2011-09-07 05:08:38 | 2022-08-26 09:29:14 | http://en.wikipedia.org/wiki/Util-linux | util-linux | 1836.0 | 994.0 | is_fuse_usermount | is_fuse_usermount( struct libmnt_context * cxt , int * errsv) | ['cxt', 'errsv'] | static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv)
{
struct libmnt_ns *ns_old;
const char *type = mnt_fs_get_fstype(cxt->fs);
const char *optstr;
char *user_id = NULL;
size_t sz;
uid_t uid;
char uidstr[sizeof(stringify_value(ULONG_MAX))];
*errsv = 0;
if (!type)
return 0;
if (strcmp(type, "fuse") != 0 &&
strcmp(type, "fuseblk") != 0 &&
strncmp(type, "fuse.", 5) != 0 &&
strncmp(type, "fuseblk.", 8) != 0)
return 0;
/* get user_id= from mount table */
optstr = mnt_fs_get_fs_options(cxt->fs);
if (!optstr)
return 0;
if (mnt_optstr_get_option(optstr, "user_id", &user_id, &sz) != 0)
return 0;
if (sz == 0 || user_id == NULL)
return 0;
/* get current user */
ns_old = mnt_context_switch_origin_ns(cxt);
if (!ns_old) {
*errsv = -MNT_ERR_NAMESPACE;
return 0;
}
uid = getuid();
if (!mnt_context_switch_ns(cxt, ns_old)) {
*errsv = -MNT_ERR_NAMESPACE;
return 0;
}
snprintf(uidstr, sizeof(uidstr), "%lu", (unsigned long) uid);
return strncmp(user_id, uidstr, sz) == 0;
} | 247 | True | 1 |
CVE-2021-40346 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:P/A:N | NETWORK | LOW | NONE | NONE | PARTIAL | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://git.haproxy.org/?p=haproxy.git', 'name': 'https://git.haproxy.org/?p=haproxy.git', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4968', 'name': 'DSA-4968', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://www.mail-archive.com/[email protected]', 'name': 'https://www.mail-archive.com/[email protected]', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.mail-archive.com/[email protected]/msg41114.html', 'name': 'https://www.mail-archive.com/[email protected]/msg41114.html', 'refsource': 'MISC', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://jfrog.com/blog/critical-vulnerability-in-haproxy-cve-2021-40346-integer-overflow-enables-http-smuggling/', 'name': 'https://jfrog.com/blog/critical-vulnerability-in-haproxy-cve-2021-40346-integer-overflow-enables-http-smuggling/', 'refsource': 'MISC', 'tags': ['Exploit', 'Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/haproxy/haproxy/commit/3b69886f7dcc3cfb3d166309018e6cfec9ce2c95', 'name': 'https://github.com/haproxy/haproxy/commit/3b69886f7dcc3cfb3d166309018e6cfec9ce2c95', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/r284567dd7523f5823e2ce995f787ccd37b1cc4108779c50a97c79120@%3Cdev.cloudstack.apache.org%3E', 'name': '[cloudstack-dev] 20210910 CVE-2021-40346 (haproxy 2.x)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/r8a58fd7a29808e5d27ee56877745e58dc4bb041b9af94601554e2a5a@%3Cdev.cloudstack.apache.org%3E', 'name': '[cloudstack-dev] 20210910 Re: CVE-2021-40346 (haproxy 2.x)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A7V2IYO22LWVBGUNZWVKNTMDV4KINLFO/', 'name': 'FEDORA-2021-3493f9f6ab', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MXTSBY2TEAXWZVFQM3CXHJFRONX7PEMN/', 'name': 'FEDORA-2021-cd5ee418f6', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.4.0', 'versionEndExcluding': '2.4.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.3.0', 'versionEndExcluding': '2.3.14', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.2.0', 'versionEndExcluding': '2.2.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0.0', 'versionEndExcluding': '2.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev0:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev6:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An integer overflow exists in HAProxy 2.0 through 2.5 in htx_add_header that can be exploited to perform an HTTP request smuggling attack, allowing an attacker to bypass all configured http-request HAProxy ACLs and possibly other ACLs.'}] | 2021-12-02T20:43Z | 2021-09-08T17: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 | Willy Tarreau | 2021-08-26 16:23:37+02:00 | BUG/MAJOR: htx: fix missing header name length check in htx_add_header/trailer
Ori Hollander of JFrog Security reported that htx_add_header() and
htx_add_trailer() were missing a length check on the header name. While
this does not allow to overwrite any memory area, it results in bits of
the header name length to slip into the header value length and may
result in forging certain header names on the input. The sad thing here
is that a FIXME comment was present suggesting to add the required length
checks :-(
The injected headers are visible to the HTTP internals and to the config
rules, so haproxy will generally stay synchronized with the server. But
there is one exception which is the content-length header field, because
it is already deduplicated on the input, but before being indexed. As
such, injecting a content-length header after the deduplication stage
may be abused to present a different, shorter one on the other side and
help build a request smuggling attack, or even maybe a response splitting
attack. CVE-2021-40346 was assigned to this problem.
As a mitigation measure, it is sufficient to verify that no more than
one such header is present in any message, which is normally the case
thanks to the duplicate checks:
http-request deny if { req.hdr_cnt(content-length) gt 1 }
http-response deny if { res.hdr_cnt(content-length) gt 1 }
This must be backported to all HTX-enabled versions, hence as far as 2.0.
In 2.3 and earlier, the functions are in src/htx.c instead.
Many thanks to Ori for his work and his responsible report! | 3b69886f7dcc3cfb3d166309018e6cfec9ce2c95 | False | haproxy/haproxy | HAProxy Load Balancer's development branch (mirror of git.haproxy.org) | 2018-04-09 15:17:42 | 2022-08-27 17:33:26 | https://git.haproxy.org/ | haproxy | 3043.0 | 598.0 | htx_add_header | htx_add_header( struct htx * htx , const struct ist name , const struct ist value) | ['htx', 'name', 'value'] | static inline struct htx_blk *htx_add_header(struct htx *htx, const struct ist name,
const struct ist value)
{
struct htx_blk *blk;
/* FIXME: check name.len (< 256B) and value.len (< 1MB) */
blk = htx_add_blk(htx, HTX_BLK_HDR, name.len + value.len);
if (!blk)
return NULL;
blk->info += (value.len << 8) + name.len;
ist2bin_lc(htx_get_blk_ptr(htx, blk), name);
memcpy(htx_get_blk_ptr(htx, blk) + name.len, value.ptr, value.len);
return blk;
} | 103 | True | 1 |
CVE-2021-40346 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:P/A:N | NETWORK | LOW | NONE | NONE | PARTIAL | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://git.haproxy.org/?p=haproxy.git', 'name': 'https://git.haproxy.org/?p=haproxy.git', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4968', 'name': 'DSA-4968', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://www.mail-archive.com/[email protected]', 'name': 'https://www.mail-archive.com/[email protected]', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.mail-archive.com/[email protected]/msg41114.html', 'name': 'https://www.mail-archive.com/[email protected]/msg41114.html', 'refsource': 'MISC', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://jfrog.com/blog/critical-vulnerability-in-haproxy-cve-2021-40346-integer-overflow-enables-http-smuggling/', 'name': 'https://jfrog.com/blog/critical-vulnerability-in-haproxy-cve-2021-40346-integer-overflow-enables-http-smuggling/', 'refsource': 'MISC', 'tags': ['Exploit', 'Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/haproxy/haproxy/commit/3b69886f7dcc3cfb3d166309018e6cfec9ce2c95', 'name': 'https://github.com/haproxy/haproxy/commit/3b69886f7dcc3cfb3d166309018e6cfec9ce2c95', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/r284567dd7523f5823e2ce995f787ccd37b1cc4108779c50a97c79120@%3Cdev.cloudstack.apache.org%3E', 'name': '[cloudstack-dev] 20210910 CVE-2021-40346 (haproxy 2.x)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.apache.org/thread.html/r8a58fd7a29808e5d27ee56877745e58dc4bb041b9af94601554e2a5a@%3Cdev.cloudstack.apache.org%3E', 'name': '[cloudstack-dev] 20210910 Re: CVE-2021-40346 (haproxy 2.x)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/A7V2IYO22LWVBGUNZWVKNTMDV4KINLFO/', 'name': 'FEDORA-2021-3493f9f6ab', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/MXTSBY2TEAXWZVFQM3CXHJFRONX7PEMN/', 'name': 'FEDORA-2021-cd5ee418f6', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.4.0', 'versionEndExcluding': '2.4.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.3.0', 'versionEndExcluding': '2.3.14', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.2.0', 'versionEndExcluding': '2.2.17', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0.0', 'versionEndExcluding': '2.0.25', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev3:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev4:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev0:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:2.5:dev6:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An integer overflow exists in HAProxy 2.0 through 2.5 in htx_add_header that can be exploited to perform an HTTP request smuggling attack, allowing an attacker to bypass all configured http-request HAProxy ACLs and possibly other ACLs.'}] | 2021-12-02T20:43Z | 2021-09-08T17: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 | Willy Tarreau | 2021-08-26 16:23:37+02:00 | BUG/MAJOR: htx: fix missing header name length check in htx_add_header/trailer
Ori Hollander of JFrog Security reported that htx_add_header() and
htx_add_trailer() were missing a length check on the header name. While
this does not allow to overwrite any memory area, it results in bits of
the header name length to slip into the header value length and may
result in forging certain header names on the input. The sad thing here
is that a FIXME comment was present suggesting to add the required length
checks :-(
The injected headers are visible to the HTTP internals and to the config
rules, so haproxy will generally stay synchronized with the server. But
there is one exception which is the content-length header field, because
it is already deduplicated on the input, but before being indexed. As
such, injecting a content-length header after the deduplication stage
may be abused to present a different, shorter one on the other side and
help build a request smuggling attack, or even maybe a response splitting
attack. CVE-2021-40346 was assigned to this problem.
As a mitigation measure, it is sufficient to verify that no more than
one such header is present in any message, which is normally the case
thanks to the duplicate checks:
http-request deny if { req.hdr_cnt(content-length) gt 1 }
http-response deny if { res.hdr_cnt(content-length) gt 1 }
This must be backported to all HTX-enabled versions, hence as far as 2.0.
In 2.3 and earlier, the functions are in src/htx.c instead.
Many thanks to Ori for his work and his responsible report! | 3b69886f7dcc3cfb3d166309018e6cfec9ce2c95 | False | haproxy/haproxy | HAProxy Load Balancer's development branch (mirror of git.haproxy.org) | 2018-04-09 15:17:42 | 2022-08-27 17:33:26 | https://git.haproxy.org/ | haproxy | 3043.0 | 598.0 | htx_add_trailer | htx_add_trailer( struct htx * htx , const struct ist name , const struct ist value) | ['htx', 'name', 'value'] | static inline struct htx_blk *htx_add_trailer(struct htx *htx, const struct ist name,
const struct ist value)
{
struct htx_blk *blk;
/* FIXME: check name.len (< 256B) and value.len (< 1MB) */
blk = htx_add_blk(htx, HTX_BLK_TLR, name.len + value.len);
if (!blk)
return NULL;
blk->info += (value.len << 8) + name.len;
ist2bin_lc(htx_get_blk_ptr(htx, blk), name);
memcpy(htx_get_blk_ptr(htx, blk) + name.len, value.ptr, value.len);
return blk;
} | 103 | True | 1 |
CVE-2022-0711 | 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://access.redhat.com/security/cve/cve-2022-0711', 'name': 'https://access.redhat.com/security/cve/cve-2022-0711', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/haproxy/haproxy/commit/bfb15ab34ead85f64cd6da0e9fb418c9cd14cee8', 'name': 'https://github.com/haproxy/haproxy/commit/bfb15ab34ead85f64cd6da0e9fb418c9cd14cee8', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.mail-archive.com/[email protected]/msg41833.html', 'name': 'https://www.mail-archive.com/[email protected]/msg41833.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5102', 'name': 'DSA-5102', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-835'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.2.0', 'versionEndExcluding': '2.5.2', 'cpe_name': []}]}, {'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': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:software_collections:-:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openshift_container_platform:4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw was found in the way HAProxy processed HTTP responses containing the "Set-Cookie2" header. This flaw could allow an attacker to send crafted HTTP response packets which lead to an infinite loop, eventually resulting in a denial of service condition. The highest threat from this vulnerability is availability.'}] | 2022-07-21T12:30Z | 2022-03-02T22:15Z | 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 | Andrew McDermott | 2022-02-11 18:26:49+00:00 | BUG/MAJOR: http/htx: prevent unbounded loop in http_manage_server_side_cookies
Ensure calls to http_find_header() terminate. If a "Set-Cookie2"
header is found then the while(1) loop in
http_manage_server_side_cookies() will never terminate, resulting in
the watchdog firing and the process terminating via SIGABRT.
The while(1) loop becomes unbounded because an unmatched call to
http_find_header("Set-Cookie") will leave ctx->blk=NULL. Subsequent
calls to check for "Set-Cookie2" will now enumerate from the beginning
of all the blocks and will once again match on subsequent
passes (assuming a match first time around), hence the loop becoming
unbounded.
This issue was introduced with HTX and this fix should be backported
to all versions supporting HTX.
Many thanks to Grant Spence ([email protected]) for working through
this issue with me. | bfb15ab34ead85f64cd6da0e9fb418c9cd14cee8 | False | haproxy/haproxy | HAProxy Load Balancer's development branch (mirror of git.haproxy.org) | 2018-04-09 15:17:42 | 2022-08-27 17:33:26 | https://git.haproxy.org/ | haproxy | 3043.0 | 598.0 | http_manage_server_side_cookies | http_manage_server_side_cookies( struct stream * s , struct channel * res) | ['s', 'res'] | static void http_manage_server_side_cookies(struct stream *s, struct channel *res)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
struct htx *htx;
struct http_hdr_ctx ctx;
struct server *srv;
char *hdr_beg, *hdr_end;
char *prev, *att_beg, *att_end, *equal, *val_beg, *val_end, *next;
int is_cookie2 = 0;
htx = htxbuf(&res->buf);
ctx.blk = NULL;
while (1) {
int is_first = 1;
if (!http_find_header(htx, ist("Set-Cookie"), &ctx, 1)) {
if (!http_find_header(htx, ist("Set-Cookie2"), &ctx, 1))
break;
is_cookie2 = 1;
}
/* OK, right now we know we have a Set-Cookie* at hdr_beg, and
* <prev> points to the colon.
*/
txn->flags |= TX_SCK_PRESENT;
/* Maybe we only wanted to see if there was a Set-Cookie (eg:
* check-cache is enabled) and we are not interested in checking
* them. Warning, the cookie capture is declared in the frontend.
*/
if (s->be->cookie_name == NULL && sess->fe->capture_name == NULL)
break;
/* OK so now we know we have to process this response cookie.
* The format of the Set-Cookie header is slightly different
* from the format of the Cookie header in that it does not
* support the comma as a cookie delimiter (thus the header
* cannot be folded) because the Expires attribute described in
* the original Netscape's spec may contain an unquoted date
* with a comma inside. We have to live with this because
* many browsers don't support Max-Age and some browsers don't
* support quoted strings. However the Set-Cookie2 header is
* clean.
*
* We have to keep multiple pointers in order to support cookie
* removal at the beginning, middle or end of header without
* corrupting the header (in case of set-cookie2). A special
* pointer, <scav> points to the beginning of the set-cookie-av
* fields after the first semi-colon. The <next> pointer points
* either to the end of line (set-cookie) or next unquoted comma
* (set-cookie2). All of these headers are valid :
*
* hdr_beg hdr_end
* | |
* v |
* NAME1 = VALUE 1 ; Secure; Path="/" |
* NAME=VALUE; Secure; Expires=Thu, 01-Jan-1970 00:00:01 GMT v
* NAME = VALUE ; Secure; Expires=Thu, 01-Jan-1970 00:00:01 GMT
* NAME1 = VALUE 1 ; Max-Age=0, NAME2=VALUE2; Discard
* | | | | | | | |
* | | | | | | | +-> next
* | | | | | | +------------> scav
* | | | | | +--------------> val_end
* | | | | +--------------------> val_beg
* | | | +----------------------> equal
* | | +------------------------> att_end
* | +----------------------------> att_beg
* +------------------------------> prev
* -------------------------------> hdr_beg
*/
hdr_beg = ctx.value.ptr;
hdr_end = hdr_beg + ctx.value.len;
for (prev = hdr_beg; prev < hdr_end; prev = next) {
/* Iterate through all cookies on this line */
/* find att_beg */
att_beg = prev;
if (!is_first)
att_beg++;
is_first = 0;
while (att_beg < hdr_end && HTTP_IS_SPHT(*att_beg))
att_beg++;
/* find att_end : this is the first character after the last non
* space before the equal. It may be equal to hdr_end.
*/
equal = att_end = att_beg;
while (equal < hdr_end) {
if (*equal == '=' || *equal == ';' || (is_cookie2 && *equal == ','))
break;
if (HTTP_IS_SPHT(*equal++))
continue;
att_end = equal;
}
/* here, <equal> points to '=', a delimiter or the end. <att_end>
* is between <att_beg> and <equal>, both may be identical.
*/
/* look for end of cookie if there is an equal sign */
if (equal < hdr_end && *equal == '=') {
/* look for the beginning of the value */
val_beg = equal + 1;
while (val_beg < hdr_end && HTTP_IS_SPHT(*val_beg))
val_beg++;
/* find the end of the value, respecting quotes */
next = http_find_cookie_value_end(val_beg, hdr_end);
/* make val_end point to the first white space or delimiter after the value */
val_end = next;
while (val_end > val_beg && HTTP_IS_SPHT(*(val_end - 1)))
val_end--;
}
else {
/* <equal> points to next comma, semi-colon or EOL */
val_beg = val_end = next = equal;
}
if (next < hdr_end) {
/* Set-Cookie2 supports multiple cookies, and <next> points to
* a colon or semi-colon before the end. So skip all attr-value
* pairs and look for the next comma. For Set-Cookie, since
* commas are permitted in values, skip to the end.
*/
if (is_cookie2)
next = http_find_hdr_value_end(next, hdr_end);
else
next = hdr_end;
}
/* Now everything is as on the diagram above */
/* Ignore cookies with no equal sign */
if (equal == val_end)
continue;
/* If there are spaces around the equal sign, we need to
* strip them otherwise we'll get trouble for cookie captures,
* or even for rewrites. Since this happens extremely rarely,
* it does not hurt performance.
*/
if (unlikely(att_end != equal || val_beg > equal + 1)) {
int stripped_before = 0;
int stripped_after = 0;
if (att_end != equal) {
memmove(att_end, equal, hdr_end - equal);
stripped_before = (att_end - equal);
equal += stripped_before;
val_beg += stripped_before;
}
if (val_beg > equal + 1) {
memmove(equal + 1, val_beg, hdr_end + stripped_before - val_beg);
stripped_after = (equal + 1) - val_beg;
val_beg += stripped_after;
stripped_before += stripped_after;
}
val_end += stripped_before;
next += stripped_before;
hdr_end += stripped_before;
htx_change_blk_value_len(htx, ctx.blk, hdr_end - hdr_beg);
ctx.value.len = hdr_end - hdr_beg;
}
/* First, let's see if we want to capture this cookie. We check
* that we don't already have a server side cookie, because we
* can only capture one. Also as an optimisation, we ignore
* cookies shorter than the declared name.
*/
if (sess->fe->capture_name != NULL &&
txn->srv_cookie == NULL &&
(val_end - att_beg >= sess->fe->capture_namelen) &&
memcmp(att_beg, sess->fe->capture_name, sess->fe->capture_namelen) == 0) {
int log_len = val_end - att_beg;
if ((txn->srv_cookie = pool_alloc(pool_head_capture)) == NULL) {
ha_alert("HTTP logging : out of memory.\n");
}
else {
if (log_len > sess->fe->capture_len)
log_len = sess->fe->capture_len;
memcpy(txn->srv_cookie, att_beg, log_len);
txn->srv_cookie[log_len] = 0;
}
}
srv = objt_server(s->target);
/* now check if we need to process it for persistence */
if (!(s->flags & SF_IGNORE_PRST) &&
(att_end - att_beg == s->be->cookie_len) && (s->be->cookie_name != NULL) &&
(memcmp(att_beg, s->be->cookie_name, att_end - att_beg) == 0)) {
/* assume passive cookie by default */
txn->flags &= ~TX_SCK_MASK;
txn->flags |= TX_SCK_FOUND;
/* If the cookie is in insert mode on a known server, we'll delete
* this occurrence because we'll insert another one later.
* We'll delete it too if the "indirect" option is set and we're in
* a direct access.
*/
if (s->be->ck_opts & PR_CK_PSV) {
/* The "preserve" flag was set, we don't want to touch the
* server's cookie.
*/
}
else if ((srv && (s->be->ck_opts & PR_CK_INS)) ||
((s->flags & SF_DIRECT) && (s->be->ck_opts & PR_CK_IND))) {
/* this cookie must be deleted */
if (prev == hdr_beg && next == hdr_end) {
/* whole header */
http_remove_header(htx, &ctx);
/* note: while both invalid now, <next> and <hdr_end>
* are still equal, so the for() will stop as expected.
*/
} else {
/* just remove the value */
int delta = http_del_hdr_value(hdr_beg, hdr_end, &prev, next);
next = prev;
hdr_end += delta;
}
txn->flags &= ~TX_SCK_MASK;
txn->flags |= TX_SCK_DELETED;
/* and go on with next cookie */
}
else if (srv && srv->cookie && (s->be->ck_opts & PR_CK_RW)) {
/* replace bytes val_beg->val_end with the cookie name associated
* with this server since we know it.
*/
int sliding, delta;
ctx.value = ist2(val_beg, val_end - val_beg);
ctx.lws_before = ctx.lws_after = 0;
http_replace_header_value(htx, &ctx, ist2(srv->cookie, srv->cklen));
delta = srv->cklen - (val_end - val_beg);
sliding = (ctx.value.ptr - val_beg);
hdr_beg += sliding;
val_beg += sliding;
next += sliding + delta;
hdr_end += sliding + delta;
txn->flags &= ~TX_SCK_MASK;
txn->flags |= TX_SCK_REPLACED;
}
else if (srv && srv->cookie && (s->be->ck_opts & PR_CK_PFX)) {
/* insert the cookie name associated with this server
* before existing cookie, and insert a delimiter between them..
*/
int sliding, delta;
ctx.value = ist2(val_beg, 0);
ctx.lws_before = ctx.lws_after = 0;
http_replace_header_value(htx, &ctx, ist2(srv->cookie, srv->cklen + 1));
delta = srv->cklen + 1;
sliding = (ctx.value.ptr - val_beg);
hdr_beg += sliding;
val_beg += sliding;
next += sliding + delta;
hdr_end += sliding + delta;
val_beg[srv->cklen] = COOKIE_DELIM;
txn->flags &= ~TX_SCK_MASK;
txn->flags |= TX_SCK_REPLACED;
}
}
/* that's done for this cookie, check the next one on the same
* line when next != hdr_end (only if is_cookie2).
*/
}
}
} | 1101 | True | 1 |
CVE-2021-4076 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2029814', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2029814', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/latchset/tang/pull/81', 'name': 'https://github.com/latchset/tang/pull/81', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/latchset/tang/commit/e82459fda10f0630c3414ed2afbc6320bb9ea7c9', 'name': 'https://github.com/latchset/tang/commit/e82459fda10f0630c3414ed2afbc6320bb9ea7c9', '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:tang_project:tang:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8', 'versionEndExcluding': '11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw exists in tang, a network-based cryptographic binding server, which could result in leak of private keys.'}] | 2022-03-09T19:45Z | 2022-03-02T23: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 | Sergio Correia | 2021-12-14 08:18:41-03:00 | keys: move signing part out of find_by_thp() and to find_jws() (#81)
Handle just signing keys in find_jws(), to make sure we are
responding only to proper queries.
Tests were also failing to detect this issue and were updated
accordingly.
Issue discovered by Twitter Kernel and OS team during a source
code audit while evaluating Tang/Clevis for their needs.
Fixes CVE-2021-4076 | e82459fda10f0630c3414ed2afbc6320bb9ea7c9 | False | latchset/tang | Tang binding daemon | 2015-11-13 16:47:53 | 2022-08-08 11:14:54 | null | latchset | 303.0 | 49.0 | find_by_thp | find_by_thp( struct tang_keys_info * tki , const char * target) | ['tki', 'target'] | find_by_thp(struct tang_keys_info* tki, const char* target)
{
if (!tki) {
return NULL;
}
json_auto_t* keys = json_deep_copy(tki->m_keys);
json_array_extend(keys, tki->m_rotated_keys);
size_t idx;
json_t* jwk;
const char** hashes = supported_hashes();
json_array_foreach(keys, idx, jwk) {
for (int i = 0; hashes[i]; i++) {
__attribute__ ((__cleanup__(cleanup_str))) char* thumbprint = jwk_thumbprint(jwk, hashes[i]);
if (!thumbprint || strcmp(thumbprint, target) != 0) {
continue;
}
if (jwk_valid_for_deriving_keys(jwk)) {
return json_incref(jwk);
} else if (jwk_valid_for_signing(jwk)) {
json_auto_t* sign = json_deep_copy(tki->m_sign);
if (json_array_append(sign, jwk) == -1) {
return NULL;
}
json_auto_t* jws = jwk_sign(tki->m_payload, sign);
if (!jws) {
return NULL;
}
return json_incref(jws);
}
}
}
return NULL;
} | 213 | True | 1 |
CVE-2021-4076 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:N | NETWORK | LOW | NONE | PARTIAL | NONE | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=2029814', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=2029814', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/latchset/tang/pull/81', 'name': 'https://github.com/latchset/tang/pull/81', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/latchset/tang/commit/e82459fda10f0630c3414ed2afbc6320bb9ea7c9', 'name': 'https://github.com/latchset/tang/commit/e82459fda10f0630c3414ed2afbc6320bb9ea7c9', '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:tang_project:tang:*:*:*:*:*:*:*:*', 'versionStartIncluding': '8', 'versionEndExcluding': '11', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A flaw exists in tang, a network-based cryptographic binding server, which could result in leak of private keys.'}] | 2022-03-09T19:45Z | 2022-03-02T23: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 | Sergio Correia | 2021-12-14 08:18:41-03:00 | keys: move signing part out of find_by_thp() and to find_jws() (#81)
Handle just signing keys in find_jws(), to make sure we are
responding only to proper queries.
Tests were also failing to detect this issue and were updated
accordingly.
Issue discovered by Twitter Kernel and OS team during a source
code audit while evaluating Tang/Clevis for their needs.
Fixes CVE-2021-4076 | e82459fda10f0630c3414ed2afbc6320bb9ea7c9 | False | latchset/tang | Tang binding daemon | 2015-11-13 16:47:53 | 2022-08-08 11:14:54 | null | latchset | 303.0 | 49.0 | find_jws | find_jws( struct tang_keys_info * tki , const char * thp) | ['tki', 'thp'] | find_jws(struct tang_keys_info* tki, const char* thp)
{
if (!tki) {
return NULL;
}
if (thp == NULL) {
/* Default advertisement. */
json_auto_t* jws = jwk_sign(tki->m_payload, tki->m_sign);
if (!jws) {
return NULL;
}
return json_incref(jws);
}
return find_by_thp(tki, thp);
} | 71 | True | 1 |