cve_id
stringlengths 13
16
| obtain_all_privilege
stringclasses 3
values | obtain_user_privilege
stringclasses 2
values | obtain_other_privilege
stringclasses 2
values | user_interaction_required
stringclasses 3
values | cvss2_vector_string
stringclasses 106
values | cvss2_access_vector
stringclasses 4
values | cvss2_access_complexity
stringclasses 4
values | cvss2_authentication
stringclasses 3
values | cvss2_confidentiality_impact
stringclasses 4
values | cvss2_integrity_impact
stringclasses 4
values | cvss2_availability_impact
stringclasses 4
values | cvss2_base_score
stringclasses 50
values | cvss3_vector_string
stringclasses 226
values | cvss3_attack_vector
stringclasses 5
values | cvss3_attack_complexity
stringclasses 3
values | cvss3_privileges_required
stringclasses 4
values | cvss3_user_interaction
stringclasses 3
values | cvss3_scope
stringclasses 3
values | cvss3_confidentiality_impact
stringclasses 4
values | cvss3_integrity_impact
stringclasses 4
values | cvss3_availability_impact
stringclasses 4
values | cvss3_base_score
stringclasses 55
values | cvss3_base_severity
stringclasses 5
values | exploitability_score
stringclasses 22
values | impact_score
stringclasses 15
values | ac_insuf_info
stringclasses 3
values | reference_json
stringlengths 221
23.3k
| problemtype_json
stringclasses 200
values | severity
stringclasses 4
values | cve_nodes
stringlengths 2
33.1k
| cve_description
stringlengths 64
1.99k
| cve_last_modified_date
stringlengths 17
17
| cve_published_date
stringlengths 17
17
| cwe_name
stringclasses 125
values | cwe_description
stringclasses 124
values | cwe_extended_description
stringclasses 95
values | cwe_url
stringclasses 124
values | cwe_is_category
int64 0
1
| commit_author
stringlengths 0
34
| commit_author_date
stringlengths 25
25
| commit_msg
stringlengths 0
13.3k
| commit_hash
stringlengths 40
40
| commit_is_merge
stringclasses 1
value | repo_name
stringclasses 467
values | repo_description
stringclasses 459
values | repo_date_created
stringclasses 467
values | repo_date_last_push
stringclasses 467
values | repo_homepage
stringclasses 294
values | repo_owner
stringclasses 470
values | repo_stars
stringclasses 406
values | repo_forks
stringclasses 352
values | function_name
stringlengths 3
120
| function_signature
stringlengths 6
640
| function_parameters
stringlengths 2
302
| function
stringlengths 12
114k
| function_token_count
stringlengths 1
5
| function_before_change
stringclasses 1
value | labels
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2019-20911 | 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/LibreDWG/libredwg/commit/c6f6668b82bfe595899cc820279ac37bb9ef16f5', 'name': 'https://github.com/LibreDWG/libredwg/commit/c6f6668b82bfe595899cc820279ac37bb9ef16f5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibreDWG/libredwg/issues/178', 'name': 'https://github.com/LibreDWG/libredwg/issues/178', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-835'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:libredwg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in GNU LibreDWG through 0.9.3. Crafted input will lead to denial of service in bit_calc_CRC in bits.c, related to a for loop.'}] | 2020-07-22T17:59Z | 2020-07-16T18: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 | Reini Urban | 2019-12-31 21:59:36+01:00 | cleanup tio.unknown
not needed anymore, we only have UNKNOWN_OBJ or UNKNOWN_ENT with full common
entity_data.
Fixes GH #178 heap_overflow2 | c6f6668b82bfe595899cc820279ac37bb9ef16f5 | False | LibreDWG/libredwg | Official mirror of libredwg. With CI hooks and nightly releases. PR's ok | 2018-05-06 13:01:25 | 2022-08-15 11:59:34 | https://savannah.gnu.org/projects/libredwg/ | LibreDWG | 508.0 | 150.0 | dwg_decode_add_object | dwg_decode_add_object( Dwg_Data * restrict dwg , Bit_Chain * dat , Bit_Chain * hdl_dat , long unsigned int address) | ['dwg', 'dat', 'hdl_dat', 'address'] | dwg_decode_add_object (Dwg_Data *restrict dwg, Bit_Chain *dat,
Bit_Chain *hdl_dat, long unsigned int address)
{
long unsigned int objpos, restartpos;
Bit_Chain abs_dat = { NULL };
unsigned char previous_bit;
Dwg_Object *restrict obj;
BITCODE_BL num = dwg->num_objects;
int error = 0;
int realloced = 0;
/* Keep the previous full chain */
abs_dat = *dat;
/* Use the indicated address for the object
*/
dat->byte = address;
dat->bit = 0;
// DEBUG_HERE;
/*
* Reserve memory space for objects. A realloc violates all internal
* pointers.
*/
realloced = dwg_add_object (dwg);
if (realloced > 0)
{
*dat = abs_dat;
return realloced; // i.e. DWG_ERR_OUTOFMEM
}
obj = &dwg->object[num];
LOG_INFO ("==========================================\n"
"Object number: %lu/%lX",
(unsigned long)num, (unsigned long)num)
obj->size = bit_read_MS (dat);
LOG_INFO (", Size: %d [MS]", obj->size)
SINCE (R_2010)
{
/* This is not counted in the object size */
obj->handlestream_size = bit_read_UMC (dat);
LOG_INFO (", Hdlsize: " FORMAT_UMC " [UMC] ", obj->handlestream_size);
obj->bitsize = obj->size * 8 - obj->handlestream_size;
// TODO boundscheck
}
objpos = bit_position (dat); // absolute
obj->address = dat->byte;
/* Until here dat is absolute. now restrict it */
bit_reset_chain (dat);
if (obj->size > dat->size)
{
LOG_ERROR ("\nInvalid object size. Would overflow");
*dat = abs_dat;
return DWG_ERR_VALUEOUTOFBOUNDS;
}
dat->size = obj->size;
SINCE (R_2010) { obj->type = bit_read_BOT (dat); }
else { obj->type = bit_read_BS (dat); }
LOG_INFO (", Type: %d [%s]\n", obj->type, dat->version >= R_2010 ? "BOT" : "BS");
restartpos = bit_position (dat); // relative
/* Check the type of the object
*/
switch (obj->type)
{
case DWG_TYPE_TEXT:
error = dwg_decode_TEXT (dat, obj);
break;
case DWG_TYPE_ATTRIB:
error = dwg_decode_ATTRIB (dat, obj);
break;
case DWG_TYPE_ATTDEF:
error = dwg_decode_ATTDEF (dat, obj);
break;
case DWG_TYPE_BLOCK:
error = dwg_decode_BLOCK (dat, obj);
break;
case DWG_TYPE_ENDBLK:
error = dwg_decode_ENDBLK (dat, obj);
break;
case DWG_TYPE_SEQEND:
error = dwg_decode_SEQEND (dat, obj);
if (dat->version >= R_13 && obj->tio.entity->ownerhandle)
{
Dwg_Object *restrict owner = dwg_resolve_handle (
dwg, obj->tio.entity->ownerhandle->absolute_ref);
if (!owner)
{
LOG_WARN ("no SEQEND.ownerhandle")
}
else if (owner->fixedtype == DWG_TYPE_INSERT
|| owner->fixedtype == DWG_TYPE_MINSERT)
{
/* SEQEND handle for the owner needed in validate_INSERT */
hash_set (dwg->object_map, obj->handle.value, (uint32_t)num);
(void)dwg_validate_INSERT (owner);
}
else if (owner->fixedtype == DWG_TYPE_POLYLINE_2D
|| owner->fixedtype == DWG_TYPE_POLYLINE_3D
|| owner->fixedtype == DWG_TYPE_POLYLINE_PFACE
|| owner->fixedtype == DWG_TYPE_POLYLINE_MESH)
{
Dwg_Entity_POLYLINE_2D *restrict _obj
= owner->tio.entity->tio.POLYLINE_2D;
if (!_obj->seqend)
/* SEQEND handle for the owner needed in validate_POLYLINE */
hash_set (dwg->object_map, obj->handle.value, (uint32_t)num);
(void)dwg_validate_POLYLINE (owner);
}
}
break;
case DWG_TYPE_INSERT:
error = dwg_decode_INSERT (dat, obj);
break;
case DWG_TYPE_MINSERT:
error = dwg_decode_MINSERT (dat, obj);
break;
case DWG_TYPE_VERTEX_2D:
error = dwg_decode_VERTEX_2D (dat, obj);
break;
case DWG_TYPE_VERTEX_3D:
error = dwg_decode_VERTEX_3D (dat, obj);
break;
case DWG_TYPE_VERTEX_MESH:
error = dwg_decode_VERTEX_MESH (dat, obj);
break;
case DWG_TYPE_VERTEX_PFACE:
error = dwg_decode_VERTEX_PFACE (dat, obj);
break;
case DWG_TYPE_VERTEX_PFACE_FACE:
error = dwg_decode_VERTEX_PFACE_FACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_2D:
error = dwg_decode_POLYLINE_2D (dat, obj);
if (dat->version >= R_2010)
check_POLYLINE_handles (obj);
break;
case DWG_TYPE_POLYLINE_3D:
error = dwg_decode_POLYLINE_3D (dat, obj);
if (dat->version >= R_2010)
check_POLYLINE_handles (obj);
break;
case DWG_TYPE_ARC:
error = dwg_decode_ARC (dat, obj);
break;
case DWG_TYPE_CIRCLE:
error = dwg_decode_CIRCLE (dat, obj);
break;
case DWG_TYPE_LINE:
error = dwg_decode_LINE (dat, obj);
break;
case DWG_TYPE_DIMENSION_ORDINATE:
error = dwg_decode_DIMENSION_ORDINATE (dat, obj);
break;
case DWG_TYPE_DIMENSION_LINEAR:
error = dwg_decode_DIMENSION_LINEAR (dat, obj);
break;
case DWG_TYPE_DIMENSION_ALIGNED:
error = dwg_decode_DIMENSION_ALIGNED (dat, obj);
break;
case DWG_TYPE_DIMENSION_ANG3PT:
error = dwg_decode_DIMENSION_ANG3PT (dat, obj);
break;
case DWG_TYPE_DIMENSION_ANG2LN:
error = dwg_decode_DIMENSION_ANG2LN (dat, obj);
break;
case DWG_TYPE_DIMENSION_RADIUS:
error = dwg_decode_DIMENSION_RADIUS (dat, obj);
break;
case DWG_TYPE_DIMENSION_DIAMETER:
error = dwg_decode_DIMENSION_DIAMETER (dat, obj);
break;
case DWG_TYPE_POINT:
error = dwg_decode_POINT (dat, obj);
break;
case DWG_TYPE__3DFACE:
error = dwg_decode__3DFACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_PFACE:
error = dwg_decode_POLYLINE_PFACE (dat, obj);
if (dat->version >= R_2010)
check_POLYLINE_handles (obj);
break;
case DWG_TYPE_POLYLINE_MESH:
error = dwg_decode_POLYLINE_MESH (dat, obj);
if (dat->version >= R_2010)
check_POLYLINE_handles (obj);
break;
case DWG_TYPE_SOLID:
error = dwg_decode_SOLID (dat, obj);
break;
case DWG_TYPE_TRACE:
error = dwg_decode_TRACE (dat, obj);
break;
case DWG_TYPE_SHAPE:
error = dwg_decode_SHAPE (dat, obj);
break;
case DWG_TYPE_VIEWPORT:
error = dwg_decode_VIEWPORT (dat, obj);
break;
case DWG_TYPE_ELLIPSE:
error = dwg_decode_ELLIPSE (dat, obj);
break;
case DWG_TYPE_SPLINE:
error = dwg_decode_SPLINE (dat, obj);
break;
case DWG_TYPE_REGION:
error = dwg_decode_REGION (dat, obj);
break;
case DWG_TYPE__3DSOLID:
error = dwg_decode__3DSOLID (dat, obj);
break;
case DWG_TYPE_BODY:
error = dwg_decode_BODY (dat, obj);
break;
case DWG_TYPE_RAY:
error = dwg_decode_RAY (dat, obj);
break;
case DWG_TYPE_XLINE:
error = dwg_decode_XLINE (dat, obj);
break;
case DWG_TYPE_DICTIONARY:
error = dwg_decode_DICTIONARY (dat, obj);
break;
case DWG_TYPE_MTEXT:
error = dwg_decode_MTEXT (dat, obj);
break;
case DWG_TYPE_LEADER:
error = dwg_decode_LEADER (dat, obj);
break;
case DWG_TYPE_TOLERANCE:
error = dwg_decode_TOLERANCE (dat, obj);
break;
case DWG_TYPE_MLINE:
error = dwg_decode_MLINE (dat, obj);
break;
case DWG_TYPE_BLOCK_CONTROL:
error = dwg_decode_BLOCK_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.BLOCK_CONTROL)
{
obj->tio.object->tio.BLOCK_CONTROL->objid = num;
if (!dwg->block_control.parent) // only once
dwg->block_control = *obj->tio.object->tio.BLOCK_CONTROL;
else
LOG_WARN ("Second BLOCK_CONTROL object ignored");
}
break;
case DWG_TYPE_BLOCK_HEADER:
error = dwg_decode_BLOCK_HEADER (dat, obj);
/*
* We cannot cache dwg->*space_block here as dwg->objects might get
* realloc'ed. See dwg_model_space_object() and dwg_paper_space_object()
* instead.
*/
break;
case DWG_TYPE_LAYER_CONTROL:
error = dwg_decode_LAYER_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.LAYER_CONTROL)
{
obj->tio.object->tio.LAYER_CONTROL->objid = num;
dwg->layer_control = *obj->tio.object->tio.LAYER_CONTROL;
}
break;
case DWG_TYPE_LAYER:
error = dwg_decode_LAYER (dat, obj);
break;
case DWG_TYPE_STYLE_CONTROL:
error = dwg_decode_STYLE_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.STYLE_CONTROL)
{
obj->tio.object->tio.STYLE_CONTROL->objid = num;
dwg->style_control = *obj->tio.object->tio.STYLE_CONTROL;
}
break;
case DWG_TYPE_STYLE:
error = dwg_decode_STYLE (dat, obj);
break;
case DWG_TYPE_LTYPE_CONTROL:
error = dwg_decode_LTYPE_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.LTYPE_CONTROL)
{
obj->tio.object->tio.LTYPE_CONTROL->objid = num;
dwg->ltype_control = *obj->tio.object->tio.LTYPE_CONTROL;
}
break;
case DWG_TYPE_LTYPE:
error = dwg_decode_LTYPE (dat, obj);
break;
case DWG_TYPE_VIEW_CONTROL:
error = dwg_decode_VIEW_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.VIEW_CONTROL)
{
obj->tio.object->tio.VIEW_CONTROL->objid = num;
dwg->view_control = *obj->tio.object->tio.VIEW_CONTROL;
}
break;
case DWG_TYPE_VIEW:
error = dwg_decode_VIEW (dat, obj);
break;
case DWG_TYPE_UCS_CONTROL:
error = dwg_decode_UCS_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.UCS_CONTROL)
{
obj->tio.object->tio.UCS_CONTROL->objid = num;
dwg->ucs_control = *obj->tio.object->tio.UCS_CONTROL;
}
break;
case DWG_TYPE_UCS:
error = dwg_decode_UCS (dat, obj);
break;
case DWG_TYPE_VPORT_CONTROL:
error = dwg_decode_VPORT_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.VPORT_CONTROL)
{
obj->tio.object->tio.VPORT_CONTROL->objid = num;
dwg->vport_control = *obj->tio.object->tio.VPORT_CONTROL;
}
break;
case DWG_TYPE_VPORT:
error = dwg_decode_VPORT (dat, obj);
break;
case DWG_TYPE_APPID_CONTROL:
error = dwg_decode_APPID_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.APPID_CONTROL)
{
obj->tio.object->tio.APPID_CONTROL->objid = num;
dwg->appid_control = *obj->tio.object->tio.APPID_CONTROL;
}
break;
case DWG_TYPE_APPID:
error = dwg_decode_APPID (dat, obj);
break;
case DWG_TYPE_DIMSTYLE_CONTROL:
error = dwg_decode_DIMSTYLE_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.DIMSTYLE_CONTROL)
{
obj->tio.object->tio.DIMSTYLE_CONTROL->objid = num;
dwg->dimstyle_control = *obj->tio.object->tio.DIMSTYLE_CONTROL;
}
break;
case DWG_TYPE_DIMSTYLE:
error = dwg_decode_DIMSTYLE (dat, obj);
break;
case DWG_TYPE_VPORT_ENTITY_CONTROL:
error = dwg_decode_VPORT_ENTITY_CONTROL (dat, obj);
if (!error && obj->tio.object->tio.VPORT_ENTITY_CONTROL)
{
obj->tio.object->tio.VPORT_ENTITY_CONTROL->objid = num;
dwg->vport_entity_control
= *obj->tio.object->tio.VPORT_ENTITY_CONTROL;
}
break;
case DWG_TYPE_VPORT_ENTITY_HEADER:
error = dwg_decode_VPORT_ENTITY_HEADER (dat, obj);
break;
case DWG_TYPE_GROUP:
error = dwg_decode_GROUP (dat, obj);
break;
case DWG_TYPE_MLINESTYLE:
error = dwg_decode_MLINESTYLE (dat, obj);
break;
case DWG_TYPE_OLE2FRAME:
error = dwg_decode_OLE2FRAME (dat, obj);
break;
case DWG_TYPE_DUMMY:
error = dwg_decode_DUMMY (dat, obj);
break;
case DWG_TYPE_LONG_TRANSACTION:
error = dwg_decode_LONG_TRANSACTION (dat, obj);
break;
case DWG_TYPE_LWPOLYLINE:
error = dwg_decode_LWPOLYLINE (dat, obj);
break;
case DWG_TYPE_HATCH:
error = dwg_decode_HATCH (dat, obj);
break;
case DWG_TYPE_XRECORD:
error = dwg_decode_XRECORD (dat, obj);
break;
case DWG_TYPE_PLACEHOLDER:
error = dwg_decode_PLACEHOLDER (dat, obj);
break;
case DWG_TYPE_OLEFRAME:
error = dwg_decode_OLEFRAME (dat, obj);
break;
case DWG_TYPE_VBA_PROJECT:
LOG_ERROR ("Unhandled Object VBA_PROJECT. Has its own section");
// dwg_decode_VBA_PROJECT(dat, obj);
error = DWG_ERR_UNHANDLEDCLASS;
break;
case DWG_TYPE_LAYOUT:
error = dwg_decode_LAYOUT (dat, obj);
break;
case DWG_TYPE_PROXY_ENTITY:
error = dwg_decode_PROXY_ENTITY (dat, obj);
break;
case DWG_TYPE_PROXY_OBJECT:
error = dwg_decode_PROXY_OBJECT (dat, obj);
break;
default:
if (obj->type == dwg->layout_type)
error = dwg_decode_LAYOUT (dat, obj);
/* > 500 */
else if ((error = dwg_decode_variable_type (dwg, dat, hdl_dat, obj))
& DWG_ERR_UNHANDLEDCLASS)
{
int is_entity = 0;
int i = obj->type - 500;
Dwg_Class *klass = NULL;
/* restart and read into the UNKNOWN_OBJ object */
/* the relative offset from type after common_entity_data */
// obj->common_size = bit_position(dat) - restartpos;
// LOG_HANDLE("common_size: %lu\n", obj->common_size); // needed for
// unknown
bit_set_position (dat, restartpos);
// obj->unknown_off = obj->unknown_pos - restartpos;
// LOG_TRACE("Unknown pos %lu, offset %lu\n", obj->unknown_pos,
// obj->unknown_off);
if (i >= 0 && i < (int)dwg->num_classes)
{
klass = &dwg->dwg_class[i];
is_entity = dwg_class_is_entity (klass);
}
else
{
if (i < 0)
{
LOG_ERROR ("Invalid class index %d <0", i);
}
else
{
LOG_ERROR ("Invalid class index %d >%d", i,
(int)dwg->num_classes);
}
obj->supertype = DWG_SUPERTYPE_UNKNOWN;
obj->type = 0;
*dat = abs_dat;
return error | DWG_ERR_VALUEOUTOFBOUNDS;
}
// properly dwg_decode_object/_entity for eed, reactors, xdic
if (klass && !is_entity)
{
int err = dwg_decode_UNKNOWN_OBJ (dat, obj);
error |= err;
obj->supertype = DWG_SUPERTYPE_UNKNOWN;
if (!dat)
return error;
if (err >= DWG_ERR_CRITICAL)
*dat = abs_dat;
}
else if (klass) // is_entity
{
int err;
#if 0 && !defined(IS_RELEASE)
if (strEQc(klass->dxfname, "MULTILEADER")) { //debug CED
char *mleader = bit_read_TF(dat, obj->size);
LOG_INSANE_TF(mleader, (int)obj->size)
bit_set_position(dat, restartpos);
free (mleader);
}
#endif
err = dwg_decode_UNKNOWN_ENT (dat, obj);
error |= err;
obj->supertype = DWG_SUPERTYPE_UNKNOWN;
if (!dat)
return error;
if (err >= DWG_ERR_CRITICAL)
*dat = abs_dat;
}
else // not a class
{
LOG_WARN ("Unknown object, skipping eed/reactors/xdic");
SINCE (R_2000)
{
obj->bitsize = bit_read_RL (dat);
LOG_TRACE ("bitsize: " FORMAT_RL " [RL] @%lu.%u\n",
obj->bitsize, dat->byte-2, dat->bit);
if (obj->bitsize > obj->size * 8)
{
LOG_ERROR ("Invalid bitsize " FORMAT_RL " => " FORMAT_RL,
obj->bitsize, obj->size * 8);
obj->bitsize = obj->size * 8;
error |= DWG_ERR_VALUEOUTOFBOUNDS;
}
}
if (!bit_read_H (dat, &obj->handle))
{
LOG_TRACE ("handle: " FORMAT_H " [H 5]\n",
ARGS_H (obj->handle));
}
restartpos = dat->byte;
obj->supertype = DWG_SUPERTYPE_UNKNOWN;
obj->tio.unknown = bit_read_TF (dat, obj->size);
dat->byte = restartpos;
}
}
}
if (obj->handle.value)
{ // empty only with UNKNOWN
LOG_HANDLE (" object_map{%lX} = %lu\n", obj->handle.value,
(unsigned long)num);
hash_set (dwg->object_map, obj->handle.value, (uint32_t)num);
}
if (dat->byte > 8 * dat->size)
{
LOG_ERROR ("Invalid object address (overflow): %lu > %lu", dat->byte,
8 * dat->size);
*dat = abs_dat;
return error | DWG_ERR_INVALIDDWG;
}
/* Restore the old absolute chain.
CRC needs to be calculated from address, which is before our 0 position.
*/
restartpos = bit_position (dat);
*dat = abs_dat;
bit_set_position (dat, objpos + restartpos);
/* Now 1 padding bits until next byte, and then a RS CRC */
if (dat->bit)
{
unsigned char r = 8 - dat->bit;
LOG_HANDLE (" padding: %X/%X (%d bits)\n", dat->chain[dat->byte],
dat->chain[dat->byte] & ((1 << r) - 1), r);
bit_advance_position (dat, r);
}
bit_set_position (dat, (obj->address + obj->size) * 8 - 2);
if (!bit_check_CRC (dat, address, 0xC0C1))
error |= DWG_ERR_WRONGCRC;
/* Reset to previous addresses for return */
*dat = abs_dat;
return realloced ? -1 : error; // re-alloced or not
} | 2774 | True | 1 |
CVE-2019-20911 | 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/LibreDWG/libredwg/commit/c6f6668b82bfe595899cc820279ac37bb9ef16f5', 'name': 'https://github.com/LibreDWG/libredwg/commit/c6f6668b82bfe595899cc820279ac37bb9ef16f5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibreDWG/libredwg/issues/178', 'name': 'https://github.com/LibreDWG/libredwg/issues/178', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-835'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:libredwg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in GNU LibreDWG through 0.9.3. Crafted input will lead to denial of service in bit_calc_CRC in bits.c, related to a for loop.'}] | 2020-07-22T17:59Z | 2020-07-16T18: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 | Reini Urban | 2019-12-31 21:59:36+01:00 | cleanup tio.unknown
not needed anymore, we only have UNKNOWN_OBJ or UNKNOWN_ENT with full common
entity_data.
Fixes GH #178 heap_overflow2 | c6f6668b82bfe595899cc820279ac37bb9ef16f5 | False | LibreDWG/libredwg | Official mirror of libredwg. With CI hooks and nightly releases. PR's ok | 2018-05-06 13:01:25 | 2022-08-15 11:59:34 | https://savannah.gnu.org/projects/libredwg/ | LibreDWG | 508.0 | 150.0 | dwg_encode_add_object | dwg_encode_add_object( Dwg_Object * restrict obj , Bit_Chain * restrict dat , unsigned long address) | ['obj', 'dat', 'address'] | dwg_encode_add_object (Dwg_Object *restrict obj, Bit_Chain *restrict dat,
unsigned long address)
{
int error = 0;
unsigned long oldpos;
unsigned long end_address = address + obj->size;
oldpos = bit_position (dat);
assert (address);
dat->byte = address;
dat->bit = 0;
LOG_INFO ("Object number: %lu", (unsigned long)obj->index);
if (obj->size > 0x100000)
{
LOG_ERROR ("Object size %u overflow", obj->size);
return DWG_ERR_VALUEOUTOFBOUNDS;
}
while (dat->byte + obj->size >= dat->size)
bit_chain_alloc (dat);
// TODO: calculate size from the fields. either <0x7fff or more
// patch it afterwards and check old<>new size if enough space allocated.
bit_write_MS (dat, obj->size);
obj->address = dat->byte;
PRE (R_2010) {
bit_write_BS (dat, obj->type);
LOG_INFO (", Size: %d [MS], Type: %d [BS]\n", obj->size, obj->type)
}
LATER_VERSIONS
{
if (!obj->handlestream_size && obj->bitsize)
obj->handlestream_size = obj->size * 8 - obj->bitsize;
bit_write_UMC (dat, obj->handlestream_size);
obj->address = dat->byte;
bit_write_BOT (dat, obj->type);
LOG_INFO (", Size: %d [MS], Hdlsize: %lu [UMC], Type: %d [BOT]\n",
obj->size, (unsigned long)obj->handlestream_size, obj->type)
}
/* Write the specific type to dat */
switch (obj->type)
{
case DWG_TYPE_TEXT:
error = dwg_encode_TEXT (dat, obj);
break;
case DWG_TYPE_ATTRIB:
error = dwg_encode_ATTRIB (dat, obj);
break;
case DWG_TYPE_ATTDEF:
error = dwg_encode_ATTDEF (dat, obj);
break;
case DWG_TYPE_BLOCK:
error = dwg_encode_BLOCK (dat, obj);
break;
case DWG_TYPE_ENDBLK:
error = dwg_encode_ENDBLK (dat, obj);
break;
case DWG_TYPE_SEQEND:
error = dwg_encode_SEQEND (dat, obj);
break;
case DWG_TYPE_INSERT:
error = dwg_encode_INSERT (dat, obj);
break;
case DWG_TYPE_MINSERT:
error = dwg_encode_MINSERT (dat, obj);
break;
case DWG_TYPE_VERTEX_2D:
error = dwg_encode_VERTEX_2D (dat, obj);
break;
case DWG_TYPE_VERTEX_3D:
error = dwg_encode_VERTEX_3D (dat, obj);
break;
case DWG_TYPE_VERTEX_MESH:
error = dwg_encode_VERTEX_MESH (dat, obj);
break;
case DWG_TYPE_VERTEX_PFACE:
error = dwg_encode_VERTEX_PFACE (dat, obj);
break;
case DWG_TYPE_VERTEX_PFACE_FACE:
error = dwg_encode_VERTEX_PFACE_FACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_2D:
error = dwg_encode_POLYLINE_2D (dat, obj);
break;
case DWG_TYPE_POLYLINE_3D:
error = dwg_encode_POLYLINE_3D (dat, obj);
break;
case DWG_TYPE_ARC:
error = dwg_encode_ARC (dat, obj);
break;
case DWG_TYPE_CIRCLE:
error = dwg_encode_CIRCLE (dat, obj);
break;
case DWG_TYPE_LINE:
error = dwg_encode_LINE (dat, obj);
break;
case DWG_TYPE_DIMENSION_ORDINATE:
error = dwg_encode_DIMENSION_ORDINATE (dat, obj);
break;
case DWG_TYPE_DIMENSION_LINEAR:
error = dwg_encode_DIMENSION_LINEAR (dat, obj);
break;
case DWG_TYPE_DIMENSION_ALIGNED:
error = dwg_encode_DIMENSION_ALIGNED (dat, obj);
break;
case DWG_TYPE_DIMENSION_ANG3PT:
error = dwg_encode_DIMENSION_ANG3PT (dat, obj);
break;
case DWG_TYPE_DIMENSION_ANG2LN:
error = dwg_encode_DIMENSION_ANG2LN (dat, obj);
break;
case DWG_TYPE_DIMENSION_RADIUS:
error = dwg_encode_DIMENSION_RADIUS (dat, obj);
break;
case DWG_TYPE_DIMENSION_DIAMETER:
error = dwg_encode_DIMENSION_DIAMETER (dat, obj);
break;
case DWG_TYPE_POINT:
error = dwg_encode_POINT (dat, obj);
break;
case DWG_TYPE__3DFACE:
error = dwg_encode__3DFACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_PFACE:
error = dwg_encode_POLYLINE_PFACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_MESH:
error = dwg_encode_POLYLINE_MESH (dat, obj);
break;
case DWG_TYPE_SOLID:
error = dwg_encode_SOLID (dat, obj);
break;
case DWG_TYPE_TRACE:
error = dwg_encode_TRACE (dat, obj);
break;
case DWG_TYPE_SHAPE:
error = dwg_encode_SHAPE (dat, obj);
break;
case DWG_TYPE_VIEWPORT:
error = dwg_encode_VIEWPORT (dat, obj);
break;
case DWG_TYPE_ELLIPSE:
error = dwg_encode_ELLIPSE (dat, obj);
break;
case DWG_TYPE_SPLINE:
error = dwg_encode_SPLINE (dat, obj);
break;
case DWG_TYPE_REGION:
error = dwg_encode_REGION (dat, obj);
break;
case DWG_TYPE__3DSOLID:
error = dwg_encode__3DSOLID (dat, obj);
break;
case DWG_TYPE_BODY:
error = dwg_encode_BODY (dat, obj);
break;
case DWG_TYPE_RAY:
error = dwg_encode_RAY (dat, obj);
break;
case DWG_TYPE_XLINE:
error = dwg_encode_XLINE (dat, obj);
break;
case DWG_TYPE_DICTIONARY:
error = dwg_encode_DICTIONARY (dat, obj);
break;
case DWG_TYPE_MTEXT:
error = dwg_encode_MTEXT (dat, obj);
break;
case DWG_TYPE_LEADER:
error = dwg_encode_LEADER (dat, obj);
break;
case DWG_TYPE_TOLERANCE:
error = dwg_encode_TOLERANCE (dat, obj);
break;
case DWG_TYPE_MLINE:
error = dwg_encode_MLINE (dat, obj);
break;
case DWG_TYPE_BLOCK_CONTROL:
error = dwg_encode_BLOCK_CONTROL (dat, obj);
break;
case DWG_TYPE_BLOCK_HEADER:
error = dwg_encode_BLOCK_HEADER (dat, obj);
break;
case DWG_TYPE_LAYER_CONTROL:
error = dwg_encode_LAYER_CONTROL (dat, obj);
break;
case DWG_TYPE_LAYER:
error = dwg_encode_LAYER (dat, obj);
break;
case DWG_TYPE_STYLE_CONTROL:
error = dwg_encode_STYLE_CONTROL (dat, obj);
break;
case DWG_TYPE_STYLE:
error = dwg_encode_STYLE (dat, obj);
break;
case DWG_TYPE_LTYPE_CONTROL:
error = dwg_encode_LTYPE_CONTROL (dat, obj);
break;
case DWG_TYPE_LTYPE:
error = dwg_encode_LTYPE (dat, obj);
break;
case DWG_TYPE_VIEW_CONTROL:
error = dwg_encode_VIEW_CONTROL (dat, obj);
break;
case DWG_TYPE_VIEW:
error = dwg_encode_VIEW (dat, obj);
break;
case DWG_TYPE_UCS_CONTROL:
error = dwg_encode_UCS_CONTROL (dat, obj);
break;
case DWG_TYPE_UCS:
error = dwg_encode_UCS (dat, obj);
break;
case DWG_TYPE_VPORT_CONTROL:
error = dwg_encode_VPORT_CONTROL (dat, obj);
break;
case DWG_TYPE_VPORT:
error = dwg_encode_VPORT (dat, obj);
break;
case DWG_TYPE_APPID_CONTROL:
error = dwg_encode_APPID_CONTROL (dat, obj);
break;
case DWG_TYPE_APPID:
error = dwg_encode_APPID (dat, obj);
break;
case DWG_TYPE_DIMSTYLE_CONTROL:
error = dwg_encode_DIMSTYLE_CONTROL (dat, obj);
break;
case DWG_TYPE_DIMSTYLE:
error = dwg_encode_DIMSTYLE (dat, obj);
break;
case DWG_TYPE_VPORT_ENTITY_CONTROL:
error = dwg_encode_VPORT_ENTITY_CONTROL (dat, obj);
break;
case DWG_TYPE_VPORT_ENTITY_HEADER:
error = dwg_encode_VPORT_ENTITY_HEADER (dat, obj);
break;
case DWG_TYPE_GROUP:
error = dwg_encode_GROUP (dat, obj);
break;
case DWG_TYPE_MLINESTYLE:
error = dwg_encode_MLINESTYLE (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_OLE2FRAME:
error = dwg_encode_OLE2FRAME (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_DUMMY:
error = dwg_encode_DUMMY (dat, obj);
break;
case DWG_TYPE_LONG_TRANSACTION:
error = dwg_encode_LONG_TRANSACTION (dat, obj);
break;
case DWG_TYPE_LWPOLYLINE:
error = dwg_encode_LWPOLYLINE (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_HATCH:
error = dwg_encode_HATCH (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_XRECORD:
error = dwg_encode_XRECORD (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_PLACEHOLDER:
error = dwg_encode_PLACEHOLDER (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_OLEFRAME:
error = dwg_encode_OLEFRAME (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_VBA_PROJECT:
LOG_ERROR ("Unhandled Object VBA_PROJECT. Has its own section");
// dwg_encode_VBA_PROJECT(dat, obj);
break;
case DWG_TYPE_LAYOUT:
error |= dwg_encode_LAYOUT (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
break;
case DWG_TYPE_PROXY_ENTITY:
error = dwg_encode_PROXY_ENTITY (dat, obj);
break;
case DWG_TYPE_PROXY_OBJECT:
error = dwg_encode_PROXY_OBJECT (dat, obj);
break;
default:
if (obj->type == obj->parent->layout_type
&& obj->fixedtype == DWG_TYPE_LAYOUT)
{
error = dwg_encode_LAYOUT (dat, obj);
(void)dwg_encode_get_class (obj->parent, obj);
}
else if ((error = dwg_encode_variable_type (obj->parent, dat, obj))
& DWG_ERR_UNHANDLEDCLASS)
{
Dwg_Data *dwg = obj->parent;
int is_entity;
int i = obj->type - 500;
Dwg_Class *klass = dwg_encode_get_class (dwg, obj);
assert (address);
dat->byte = address; // restart and write into the UNKNOWN_OBJ object
dat->bit = 0;
bit_write_MS (dat, obj->size); // unknown blobs have a known size
if (dat->version >= R_2010)
{
bit_write_UMC (dat, obj->handlestream_size);
bit_write_BOT (dat, obj->type);
}
else
bit_write_BS (dat, obj->type);
if (klass && obj->supertype == DWG_SUPERTYPE_UNKNOWN)
is_entity = dwg_class_is_entity (klass);
else
is_entity = obj->supertype == DWG_SUPERTYPE_ENTITY;
// properly dwg_decode_object/_entity for eed, reactors, xdic
if (klass && !is_entity)
error = dwg_encode_UNKNOWN_OBJ (dat, obj);
else if (klass)
error = dwg_encode_UNKNOWN_ENT (dat, obj);
else // not a class
{
LOG_WARN ("Unknown object, skipping eed/reactors/xdic");
error = DWG_ERR_UNHANDLEDCLASS;
SINCE (R_2000)
{
bit_write_RL (dat, obj->bitsize);
LOG_INFO ("bitsize: " FORMAT_RL " [RL] (@%lu.%u)\n", obj->bitsize,
dat->byte - 4, dat->bit);
}
bit_write_H (dat, &obj->handle);
LOG_INFO ("handle: " FORMAT_H " [H 5]\n", ARGS_H (obj->handle));
// write obj->size bytes, excl. bitsize and handle.
// overshoot the bitsize and handle size.
bit_write_TF (dat, obj->tio.unknown, obj->size);
}
}
}
/* DXF: patchup size and bitsize */
if (!obj->size)
{
BITCODE_BL pos = bit_position (dat);
assert (address);
obj->size = dat->byte - address - 2; // excludes the CRC
if (dat->bit)
obj->size++;
//assert (obj->bitsize); // on errors
if (!obj->bitsize)
{
LOG_TRACE ("-bitsize calc from address (no handle) @%lu.%u\n",
dat->byte, dat->bit);
obj->bitsize = pos - (obj->address * 8);
}
bit_set_position (dat, address * 8);
if (obj->size > 0x7fff)
// TODO: with overlarge sizes >0x7fff memmove dat
LOG_ERROR ("Unhandled size %u > 0x7fff", (unsigned)obj->size);
bit_write_MS (dat, obj->size);
LOG_TRACE ("-size: %u [MS] @%lu\n", obj->size, address);
SINCE (R_2013)
{
if (!obj->handlestream_size && obj->bitsize)
obj->handlestream_size = obj->size * 8 - obj->bitsize;
bit_write_UMC (dat, obj->handlestream_size);
LOG_TRACE ("-handlestream_size: %lu [UMC]\n", obj->handlestream_size);
}
SINCE (R_2000)
{
if (obj->bitsize_pos && obj->bitsize)
{
bit_set_position (dat, obj->bitsize_pos);
bit_write_RL (dat, obj->bitsize);
LOG_TRACE ("-bitsize: %u [RL] @%lu.%lu\n", obj->bitsize,
obj->bitsize_pos / 8, obj->bitsize_pos % 8);
}
}
bit_set_position (dat, pos);
}
/*
if (obj->supertype != DWG_SUPERTYPE_UNKNOWN)
{
fprintf (stderr, "Begin address:\t%10lu\n", address);
fprintf (stderr, "Last address:\t%10lu\tSize: %10lu\n", dat->byte,
obj->size); fprintf (stderr, "End address:\t%10lu (calculated)\n", address +
2 + obj->size);
}
*/
/* Now 1 padding bits until next byte, and then a RS CRC */
if (dat->bit)
LOG_TRACE ("padding: +%d [*B]\n", 8 - dat->bit)
while (dat->bit)
bit_write_B (dat, 1);
end_address = obj->address + obj->size;
if (end_address != dat->byte)
{
if (obj->size)
LOG_WARN ("Wrong object size: %lu + %u = %lu != %lu: %ld off", obj->address,
obj->size, end_address, dat->byte, (long)(end_address - dat->byte));
dat->byte = end_address;
}
assert (!dat->bit);
bit_write_CRC (dat, address, 0xC0C1);
return error;
} | 2096 | True | 1 |
CVE-2019-20911 | 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/LibreDWG/libredwg/commit/c6f6668b82bfe595899cc820279ac37bb9ef16f5', 'name': 'https://github.com/LibreDWG/libredwg/commit/c6f6668b82bfe595899cc820279ac37bb9ef16f5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/LibreDWG/libredwg/issues/178', 'name': 'https://github.com/LibreDWG/libredwg/issues/178', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-835'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:libredwg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.9.3', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in GNU LibreDWG through 0.9.3. Crafted input will lead to denial of service in bit_calc_CRC in bits.c, related to a for loop.'}] | 2020-07-22T17:59Z | 2020-07-16T18: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 | Reini Urban | 2019-12-31 21:59:36+01:00 | cleanup tio.unknown
not needed anymore, we only have UNKNOWN_OBJ or UNKNOWN_ENT with full common
entity_data.
Fixes GH #178 heap_overflow2 | c6f6668b82bfe595899cc820279ac37bb9ef16f5 | False | LibreDWG/libredwg | Official mirror of libredwg. With CI hooks and nightly releases. PR's ok | 2018-05-06 13:01:25 | 2022-08-15 11:59:34 | https://savannah.gnu.org/projects/libredwg/ | LibreDWG | 508.0 | 150.0 | dwg_free_object | dwg_free_object( Dwg_Object * obj) | ['obj'] | dwg_free_object (Dwg_Object *obj)
{
int error = 0;
long unsigned int j;
Dwg_Data *dwg;
Bit_Chain *dat = &pdat;
if (obj && obj->parent)
{
dwg = obj->parent;
dat->version = dwg->header.version;
}
else
return;
if (obj->type == DWG_TYPE_FREED || obj->tio.object == NULL)
return;
dat->from_version = dat->version;
if (obj->supertype == DWG_SUPERTYPE_UNKNOWN)
goto unhandled;
switch (obj->type)
{
case DWG_TYPE_TEXT:
dwg_free_TEXT (dat, obj);
break;
case DWG_TYPE_ATTRIB:
dwg_free_ATTRIB (dat, obj);
break;
case DWG_TYPE_ATTDEF:
dwg_free_ATTDEF (dat, obj);
break;
case DWG_TYPE_BLOCK:
dwg_free_BLOCK (dat, obj);
break;
case DWG_TYPE_ENDBLK:
dwg_free_ENDBLK (dat, obj);
break;
case DWG_TYPE_SEQEND:
dwg_free_SEQEND (dat, obj);
break;
case DWG_TYPE_INSERT:
dwg_free_INSERT (dat, obj);
break;
case DWG_TYPE_MINSERT:
dwg_free_MINSERT (dat, obj);
break;
case DWG_TYPE_VERTEX_2D:
dwg_free_VERTEX_2D (dat, obj);
break;
case DWG_TYPE_VERTEX_3D:
dwg_free_VERTEX_3D (dat, obj);
break;
case DWG_TYPE_VERTEX_MESH:
dwg_free_VERTEX_MESH (dat, obj);
break;
case DWG_TYPE_VERTEX_PFACE:
dwg_free_VERTEX_PFACE (dat, obj);
break;
case DWG_TYPE_VERTEX_PFACE_FACE:
dwg_free_VERTEX_PFACE_FACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_2D:
dwg_free_POLYLINE_2D (dat, obj);
break;
case DWG_TYPE_POLYLINE_3D:
dwg_free_POLYLINE_3D (dat, obj);
break;
case DWG_TYPE_ARC:
dwg_free_ARC (dat, obj);
break;
case DWG_TYPE_CIRCLE:
dwg_free_CIRCLE (dat, obj);
break;
case DWG_TYPE_LINE:
dwg_free_LINE (dat, obj);
break;
case DWG_TYPE_DIMENSION_ORDINATE:
dwg_free_DIMENSION_ORDINATE (dat, obj);
break;
case DWG_TYPE_DIMENSION_LINEAR:
dwg_free_DIMENSION_LINEAR (dat, obj);
break;
case DWG_TYPE_DIMENSION_ALIGNED:
dwg_free_DIMENSION_ALIGNED (dat, obj);
break;
case DWG_TYPE_DIMENSION_ANG3PT:
dwg_free_DIMENSION_ANG3PT (dat, obj);
break;
case DWG_TYPE_DIMENSION_ANG2LN:
dwg_free_DIMENSION_ANG2LN (dat, obj);
break;
case DWG_TYPE_DIMENSION_RADIUS:
dwg_free_DIMENSION_RADIUS (dat, obj);
break;
case DWG_TYPE_DIMENSION_DIAMETER:
dwg_free_DIMENSION_DIAMETER (dat, obj);
break;
case DWG_TYPE_POINT:
dwg_free_POINT (dat, obj);
break;
case DWG_TYPE__3DFACE:
dwg_free__3DFACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_PFACE:
dwg_free_POLYLINE_PFACE (dat, obj);
break;
case DWG_TYPE_POLYLINE_MESH:
dwg_free_POLYLINE_MESH (dat, obj);
break;
case DWG_TYPE_SOLID:
dwg_free_SOLID (dat, obj);
break;
case DWG_TYPE_TRACE:
dwg_free_TRACE (dat, obj);
break;
case DWG_TYPE_SHAPE:
dwg_free_SHAPE (dat, obj);
break;
case DWG_TYPE_VIEWPORT:
dwg_free_VIEWPORT (dat, obj);
break;
case DWG_TYPE_ELLIPSE:
dwg_free_ELLIPSE (dat, obj);
break;
case DWG_TYPE_SPLINE:
dwg_free_SPLINE (dat, obj);
break;
case DWG_TYPE_REGION:
dwg_free_REGION (dat, obj);
break;
case DWG_TYPE__3DSOLID:
dwg_free__3DSOLID (dat, obj);
break; /* Check the type of the object */
case DWG_TYPE_BODY:
dwg_free_BODY (dat, obj);
break;
case DWG_TYPE_RAY:
dwg_free_RAY (dat, obj);
break;
case DWG_TYPE_XLINE:
dwg_free_XLINE (dat, obj);
break;
case DWG_TYPE_DICTIONARY:
dwg_free_DICTIONARY (dat, obj);
break;
case DWG_TYPE_MTEXT:
dwg_free_MTEXT (dat, obj);
break;
case DWG_TYPE_LEADER:
dwg_free_LEADER (dat, obj);
break;
case DWG_TYPE_TOLERANCE:
dwg_free_TOLERANCE (dat, obj);
break;
case DWG_TYPE_MLINE:
dwg_free_MLINE (dat, obj);
break;
case DWG_TYPE_BLOCK_CONTROL:
dwg_free_BLOCK_CONTROL (dat, obj);
break;
case DWG_TYPE_BLOCK_HEADER:
dwg_free_BLOCK_HEADER (dat, obj);
break;
case DWG_TYPE_LAYER_CONTROL:
dwg_free_LAYER_CONTROL (dat, obj);
break;
case DWG_TYPE_LAYER:
dwg_free_LAYER (dat, obj);
break;
case DWG_TYPE_STYLE_CONTROL:
dwg_free_STYLE_CONTROL (dat, obj);
break;
case DWG_TYPE_STYLE:
dwg_free_STYLE (dat, obj);
break;
case DWG_TYPE_LTYPE_CONTROL:
dwg_free_LTYPE_CONTROL (dat, obj);
break;
case DWG_TYPE_LTYPE:
dwg_free_LTYPE (dat, obj);
break;
case DWG_TYPE_VIEW_CONTROL:
dwg_free_VIEW_CONTROL (dat, obj);
break;
case DWG_TYPE_VIEW:
dwg_free_VIEW (dat, obj);
break;
case DWG_TYPE_UCS_CONTROL:
dwg_free_UCS_CONTROL (dat, obj);
break;
case DWG_TYPE_UCS:
dwg_free_UCS (dat, obj);
break;
case DWG_TYPE_VPORT_CONTROL:
dwg_free_VPORT_CONTROL (dat, obj);
break;
case DWG_TYPE_VPORT:
dwg_free_VPORT (dat, obj);
break;
case DWG_TYPE_APPID_CONTROL:
dwg_free_APPID_CONTROL (dat, obj);
break;
case DWG_TYPE_APPID:
dwg_free_APPID (dat, obj);
break;
case DWG_TYPE_DIMSTYLE_CONTROL:
dwg_free_DIMSTYLE_CONTROL (dat, obj);
break;
case DWG_TYPE_DIMSTYLE:
dwg_free_DIMSTYLE (dat, obj);
break;
case DWG_TYPE_VPORT_ENTITY_CONTROL:
dwg_free_VPORT_ENTITY_CONTROL (dat, obj);
break;
case DWG_TYPE_VPORT_ENTITY_HEADER:
dwg_free_VPORT_ENTITY_HEADER (dat, obj);
break;
case DWG_TYPE_GROUP:
dwg_free_GROUP (dat, obj);
break;
case DWG_TYPE_MLINESTYLE:
dwg_free_MLINESTYLE (dat, obj);
break;
case DWG_TYPE_OLE2FRAME:
dwg_free_OLE2FRAME (dat, obj);
break;
case DWG_TYPE_DUMMY:
dwg_free_DUMMY (dat, obj);
break;
case DWG_TYPE_LONG_TRANSACTION:
dwg_free_LONG_TRANSACTION (dat, obj);
break;
case DWG_TYPE_LWPOLYLINE:
dwg_free_LWPOLYLINE (dat, obj);
break;
case DWG_TYPE_HATCH:
dwg_free_HATCH (dat, obj);
break;
case DWG_TYPE_XRECORD:
dwg_free_XRECORD (dat, obj);
break;
case DWG_TYPE_PLACEHOLDER:
dwg_free_PLACEHOLDER (dat, obj);
break;
case DWG_TYPE_OLEFRAME:
dwg_free_OLEFRAME (dat, obj);
break;
#ifdef DEBUG_VBA_PROJECT
case DWG_TYPE_VBA_PROJECT:
dwg_free_VBA_PROJECT (dat, obj);
break;
#endif
case DWG_TYPE_LAYOUT:
dwg_free_LAYOUT (dat, obj);
break;
case DWG_TYPE_PROXY_ENTITY:
dwg_free_PROXY_ENTITY (dat, obj);
break;
case DWG_TYPE_PROXY_OBJECT:
dwg_free_PROXY_OBJECT (dat, obj);
break;
default:
if (obj->type == obj->parent->layout_type)
{
SINCE (R_13)
{
dwg_free_LAYOUT (dat, obj); // XXX avoid double-free, esp. in eed
}
}
else if ((error = dwg_free_variable_type (obj->parent, obj))
& DWG_ERR_UNHANDLEDCLASS)
{
int is_entity;
int i;
Dwg_Class *klass;
unhandled:
is_entity = 0;
i = obj->type - 500;
klass = NULL;
dwg = obj->parent;
if (dwg->dwg_class && i >= 0 && i < (int)dwg->num_classes)
{
klass = &dwg->dwg_class[i];
is_entity = klass ? dwg_class_is_entity (klass) : 0;
}
// indxf (and later injson) already creates some DEBUGGING classes
if (obj->fixedtype == DWG_TYPE_TABLE)
{
// just the preview, i.e. common. plus some colors: leak
dwg_free_UNKNOWN_ENT (dat, obj);
}
else if (obj->fixedtype == DWG_TYPE_DATATABLE)
{
dwg_free_UNKNOWN_OBJ (dat, obj);
}
else if (klass && !is_entity)
{
dwg_free_UNKNOWN_OBJ (dat, obj);
}
else if (klass && is_entity)
{
dwg_free_UNKNOWN_ENT (dat, obj);
}
else // not a class
{
FREE_IF (obj->tio.unknown);
}
}
}
/* With this importer the dxfname is dynamic, just the name is const */
if (dwg->opts & DWG_OPTS_INDXF)
FREE_IF (obj->dxfname);
obj->type = DWG_TYPE_FREED;
} | 1277 | True | 1 |
CVE-2019-25016 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'name': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/issues/45', 'name': 'https://github.com/Duncaen/OpenDoas/issues/45', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'name': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'name': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202107-11', 'name': 'GLSA-202107-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-459'}, {'lang': 'en', 'value': 'CWE-909'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opendoas_project:opendoas:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.6', 'versionEndIncluding': '6.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In OpenDoas from 6.6 to 6.8 the users PATH variable was incorrectly inherited by authenticated executions if the authenticating rule allowed the user to execute any command. Rules that only allowed to authenticated user to execute specific commands were not affected by this issue.'}] | 2022-04-26T16:14Z | 2021-01-28T20:15Z | Incomplete Cleanup | The software does not properly "clean up" and remove temporary or supporting resources after they have been used. | https://cwe.mitre.org/data/definitions/459.html | 0 | tedu | 2019-06-16 18:16:34+00:00 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. | 01c658f8c45cb92a343be5f32aa6da70b2032168 | False | Duncaen/OpenDoas | A portable fork of the OpenBSD `doas` command | 2016-05-04 21:44:11 | 2022-07-16 18:19:10 | Duncaen | 435.0 | 32.0 | main | main( int argc , char ** argv) | ['argc', 'argv'] | main(int argc, char **argv)
{
const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:"
"/usr/local/bin:/usr/local/sbin";
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
const char *cmd;
char cmdline[LINE_MAX];
#ifdef __OpenBSD__
char mypwbuf[_PW_BUF_LEN], targpwbuf[_PW_BUF_LEN];
#else
char *mypwbuf = NULL, *targpwbuf = NULL;
#endif
struct passwd mypwstore, targpwstore;
struct passwd *mypw, *targpw;
const struct rule *rule;
uid_t uid;
uid_t target = 0;
gid_t groups[NGROUPS_MAX + 1];
int ngroups;
int i, ch, rv;
int sflag = 0;
int nflag = 0;
char cwdpath[PATH_MAX];
const char *cwd;
char **envp;
#ifdef USE_BSD_AUTH
char *login_style = NULL;
#endif
setprogname("doas");
closefrom(STDERR_FILENO + 1);
uid = getuid();
#ifdef USE_BSD_AUTH
# define OPTSTRING "a:C:Lnsu:"
#else
# define OPTSTRING "+C:Lnsu:"
#endif
while ((ch = getopt(argc, argv, OPTSTRING)) != -1) {
switch (ch) {
#ifdef USE_BSD_AUTH
case 'a':
login_style = optarg;
break;
#endif
case 'C':
confpath = optarg;
break;
case 'L':
#if defined(USE_BSD_AUTH)
i = open("/dev/tty", O_RDWR);
if (i != -1)
ioctl(i, TIOCCLRVERAUTH);
exit(i == -1);
#elif defined(USE_TIMESTAMP)
exit(timestamp_clear() == -1);
#else
exit(0);
#endif
case 'u':
if (parseuid(optarg, &target) != 0)
errx(1, "unknown user");
break;
case 'n':
nflag = 1;
break;
case 's':
sflag = 1;
break;
default:
usage();
break;
}
}
argv += optind;
argc -= optind;
if (confpath) {
if (sflag)
usage();
} else if ((!sflag && !argc) || (sflag && argc))
usage();
#ifdef __OpenBSD__
rv = getpwuid_r(uid, &mypwstore, mypwbuf, sizeof(mypwbuf), &mypw);
if (rv != 0)
err(1, "getpwuid_r failed");
#else
for (size_t sz = 1024; sz <= 16*1024; sz *= 2) {
mypwbuf = reallocarray(mypwbuf, sz, sizeof (char));
if (mypwbuf == NULL)
errx(1, "can't allocate mypwbuf");
rv = getpwuid_r(uid, &mypwstore, mypwbuf, sz, &mypw);
if (rv != ERANGE)
break;
}
if (rv != 0)
err(1, "getpwuid_r failed");
#endif
if (mypw == NULL)
errx(1, "no passwd entry for self");
ngroups = getgroups(NGROUPS_MAX, groups);
if (ngroups == -1)
err(1, "can't get groups");
groups[ngroups++] = getgid();
if (sflag) {
sh = getenv("SHELL");
if (sh == NULL || *sh == '\0') {
shargv[0] = mypw->pw_shell;
} else
shargv[0] = sh;
argv = shargv;
argc = 1;
}
if (confpath) {
checkconfig(confpath, argc, argv, uid, groups, ngroups,
target);
exit(1); /* fail safe */
}
if (geteuid())
errx(1, "not installed setuid");
parseconfig("/etc/doas.conf", 1);
/* cmdline is used only for logging, no need to abort on truncate */
(void)strlcpy(cmdline, argv[0], sizeof(cmdline));
for (i = 1; i < argc; i++) {
if (strlcat(cmdline, " ", sizeof(cmdline)) >= sizeof(cmdline))
break;
if (strlcat(cmdline, argv[i], sizeof(cmdline)) >= sizeof(cmdline))
break;
}
cmd = argv[0];
if (!permit(uid, groups, ngroups, &rule, target, cmd,
(const char **)argv + 1)) {
syslog(LOG_AUTHPRIV | LOG_NOTICE,
"failed command for %s: %s", mypw->pw_name, cmdline);
errc(1, EPERM, NULL);
}
#if defined(__OpenBSD__) || defined(USE_SHADOW)
if (!(rule->options & NOPASS)) {
if (nflag)
errx(1, "Authorization required");
# ifdef __OpenBSD__
authuser(mypw->pw_name, login_style, rule->options & PERSIST);
# else
shadowauth(mypw->pw_name, rule->options & PERSIST);
# endif
}
# ifdef __OpenBSD__
if (pledge("stdio rpath getpw exec id", NULL) == -1)
err(1, "pledge");
# endif
#elif !defined(USE_PAM)
(void) nflag;
if (!(rule->options & NOPASS)) {
errx(1, "Authorization required");
}
#endif /* !(__OpenBSD__ || USE_SHADOW) && !USE_PAM */
#ifdef __OpenBSD__
rv = getpwuid_r(target, &targpwstore, targpwbuf, sizeof(targpwbuf), &targpw);
if (rv != 0)
errx(1, "no passwd entry for target");
#else
for (size_t sz = 1024; sz <= 16*1024; sz *= 2) {
targpwbuf = reallocarray(targpwbuf, sz, sizeof (char));
if (targpwbuf == NULL)
errx(1, "can't allocate targpwbuf");
rv = getpwuid_r(target, &targpwstore, targpwbuf, sz, &targpw);
if (rv != ERANGE)
break;
}
if (rv != 0)
err(1, "getpwuid_r failed");
#endif
if (targpw == NULL)
err(1, "getpwuid_r failed");
#if defined(USE_PAM)
pamauth(targpw->pw_name, mypw->pw_name, !nflag, rule->options & NOPASS,
rule->options & PERSIST);
#endif
#ifdef HAVE_SETUSERCONTEXT
if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP |
LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK |
LOGIN_SETUSER) != 0)
errx(1, "failed to set user context for target");
#else
if (setresgid(targpw->pw_gid, targpw->pw_gid, targpw->pw_gid) != 0)
err(1, "setresgid");
if (initgroups(targpw->pw_name, targpw->pw_gid) != 0)
err(1, "initgroups");
if (setresuid(target, target, target) != 0)
err(1, "setresuid");
#endif
#ifdef __OpenBSD__
if (pledge("stdio rpath exec", NULL) == -1)
err(1, "pledge");
#endif
if (getcwd(cwdpath, sizeof(cwdpath)) == NULL)
cwd = "(failed)";
else
cwd = cwdpath;
#ifdef __OpenBSD__
if (pledge("stdio exec", NULL) == -1)
err(1, "pledge");
#endif
syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s",
mypw->pw_name, cmdline, targpw->pw_name, cwd);
envp = prepenv(rule);
if (rule->cmd) {
if (setenv("PATH", safepath, 1) == -1)
err(1, "failed to set PATH '%s'", safepath);
}
execvpe(cmd, argv, envp);
if (errno == ENOENT)
errx(1, "%s: command not found", cmd);
err(1, "%s", cmd);
} | 1262 | True | 1 |
||
CVE-2019-25016 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'name': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/issues/45', 'name': 'https://github.com/Duncaen/OpenDoas/issues/45', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'name': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'name': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202107-11', 'name': 'GLSA-202107-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-459'}, {'lang': 'en', 'value': 'CWE-909'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opendoas_project:opendoas:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.6', 'versionEndIncluding': '6.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In OpenDoas from 6.6 to 6.8 the users PATH variable was incorrectly inherited by authenticated executions if the authenticating rule allowed the user to execute any command. Rules that only allowed to authenticated user to execute specific commands were not affected by this issue.'}] | 2022-04-26T16:14Z | 2021-01-28T20:15Z | Missing Initialization of Resource | The software does not initialize a critical resource. | Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.
| https://cwe.mitre.org/data/definitions/909.html | 0 | tedu | 2019-06-16 18:16:34+00:00 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. | 01c658f8c45cb92a343be5f32aa6da70b2032168 | False | Duncaen/OpenDoas | A portable fork of the OpenBSD `doas` command | 2016-05-04 21:44:11 | 2022-07-16 18:19:10 | Duncaen | 435.0 | 32.0 | main | main( int argc , char ** argv) | ['argc', 'argv'] | main(int argc, char **argv)
{
const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:"
"/usr/local/bin:/usr/local/sbin";
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
const char *cmd;
char cmdline[LINE_MAX];
#ifdef __OpenBSD__
char mypwbuf[_PW_BUF_LEN], targpwbuf[_PW_BUF_LEN];
#else
char *mypwbuf = NULL, *targpwbuf = NULL;
#endif
struct passwd mypwstore, targpwstore;
struct passwd *mypw, *targpw;
const struct rule *rule;
uid_t uid;
uid_t target = 0;
gid_t groups[NGROUPS_MAX + 1];
int ngroups;
int i, ch, rv;
int sflag = 0;
int nflag = 0;
char cwdpath[PATH_MAX];
const char *cwd;
char **envp;
#ifdef USE_BSD_AUTH
char *login_style = NULL;
#endif
setprogname("doas");
closefrom(STDERR_FILENO + 1);
uid = getuid();
#ifdef USE_BSD_AUTH
# define OPTSTRING "a:C:Lnsu:"
#else
# define OPTSTRING "+C:Lnsu:"
#endif
while ((ch = getopt(argc, argv, OPTSTRING)) != -1) {
switch (ch) {
#ifdef USE_BSD_AUTH
case 'a':
login_style = optarg;
break;
#endif
case 'C':
confpath = optarg;
break;
case 'L':
#if defined(USE_BSD_AUTH)
i = open("/dev/tty", O_RDWR);
if (i != -1)
ioctl(i, TIOCCLRVERAUTH);
exit(i == -1);
#elif defined(USE_TIMESTAMP)
exit(timestamp_clear() == -1);
#else
exit(0);
#endif
case 'u':
if (parseuid(optarg, &target) != 0)
errx(1, "unknown user");
break;
case 'n':
nflag = 1;
break;
case 's':
sflag = 1;
break;
default:
usage();
break;
}
}
argv += optind;
argc -= optind;
if (confpath) {
if (sflag)
usage();
} else if ((!sflag && !argc) || (sflag && argc))
usage();
#ifdef __OpenBSD__
rv = getpwuid_r(uid, &mypwstore, mypwbuf, sizeof(mypwbuf), &mypw);
if (rv != 0)
err(1, "getpwuid_r failed");
#else
for (size_t sz = 1024; sz <= 16*1024; sz *= 2) {
mypwbuf = reallocarray(mypwbuf, sz, sizeof (char));
if (mypwbuf == NULL)
errx(1, "can't allocate mypwbuf");
rv = getpwuid_r(uid, &mypwstore, mypwbuf, sz, &mypw);
if (rv != ERANGE)
break;
}
if (rv != 0)
err(1, "getpwuid_r failed");
#endif
if (mypw == NULL)
errx(1, "no passwd entry for self");
ngroups = getgroups(NGROUPS_MAX, groups);
if (ngroups == -1)
err(1, "can't get groups");
groups[ngroups++] = getgid();
if (sflag) {
sh = getenv("SHELL");
if (sh == NULL || *sh == '\0') {
shargv[0] = mypw->pw_shell;
} else
shargv[0] = sh;
argv = shargv;
argc = 1;
}
if (confpath) {
checkconfig(confpath, argc, argv, uid, groups, ngroups,
target);
exit(1); /* fail safe */
}
if (geteuid())
errx(1, "not installed setuid");
parseconfig("/etc/doas.conf", 1);
/* cmdline is used only for logging, no need to abort on truncate */
(void)strlcpy(cmdline, argv[0], sizeof(cmdline));
for (i = 1; i < argc; i++) {
if (strlcat(cmdline, " ", sizeof(cmdline)) >= sizeof(cmdline))
break;
if (strlcat(cmdline, argv[i], sizeof(cmdline)) >= sizeof(cmdline))
break;
}
cmd = argv[0];
if (!permit(uid, groups, ngroups, &rule, target, cmd,
(const char **)argv + 1)) {
syslog(LOG_AUTHPRIV | LOG_NOTICE,
"failed command for %s: %s", mypw->pw_name, cmdline);
errc(1, EPERM, NULL);
}
#if defined(__OpenBSD__) || defined(USE_SHADOW)
if (!(rule->options & NOPASS)) {
if (nflag)
errx(1, "Authorization required");
# ifdef __OpenBSD__
authuser(mypw->pw_name, login_style, rule->options & PERSIST);
# else
shadowauth(mypw->pw_name, rule->options & PERSIST);
# endif
}
# ifdef __OpenBSD__
if (pledge("stdio rpath getpw exec id", NULL) == -1)
err(1, "pledge");
# endif
#elif !defined(USE_PAM)
(void) nflag;
if (!(rule->options & NOPASS)) {
errx(1, "Authorization required");
}
#endif /* !(__OpenBSD__ || USE_SHADOW) && !USE_PAM */
#ifdef __OpenBSD__
rv = getpwuid_r(target, &targpwstore, targpwbuf, sizeof(targpwbuf), &targpw);
if (rv != 0)
errx(1, "no passwd entry for target");
#else
for (size_t sz = 1024; sz <= 16*1024; sz *= 2) {
targpwbuf = reallocarray(targpwbuf, sz, sizeof (char));
if (targpwbuf == NULL)
errx(1, "can't allocate targpwbuf");
rv = getpwuid_r(target, &targpwstore, targpwbuf, sz, &targpw);
if (rv != ERANGE)
break;
}
if (rv != 0)
err(1, "getpwuid_r failed");
#endif
if (targpw == NULL)
err(1, "getpwuid_r failed");
#if defined(USE_PAM)
pamauth(targpw->pw_name, mypw->pw_name, !nflag, rule->options & NOPASS,
rule->options & PERSIST);
#endif
#ifdef HAVE_SETUSERCONTEXT
if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP |
LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK |
LOGIN_SETUSER) != 0)
errx(1, "failed to set user context for target");
#else
if (setresgid(targpw->pw_gid, targpw->pw_gid, targpw->pw_gid) != 0)
err(1, "setresgid");
if (initgroups(targpw->pw_name, targpw->pw_gid) != 0)
err(1, "initgroups");
if (setresuid(target, target, target) != 0)
err(1, "setresuid");
#endif
#ifdef __OpenBSD__
if (pledge("stdio rpath exec", NULL) == -1)
err(1, "pledge");
#endif
if (getcwd(cwdpath, sizeof(cwdpath)) == NULL)
cwd = "(failed)";
else
cwd = cwdpath;
#ifdef __OpenBSD__
if (pledge("stdio exec", NULL) == -1)
err(1, "pledge");
#endif
syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s",
mypw->pw_name, cmdline, targpw->pw_name, cwd);
envp = prepenv(rule);
if (rule->cmd) {
if (setenv("PATH", safepath, 1) == -1)
err(1, "failed to set PATH '%s'", safepath);
}
execvpe(cmd, argv, envp);
if (errno == ENOENT)
errx(1, "%s: command not found", cmd);
err(1, "%s", cmd);
} | 1262 | True | 1 |
|
CVE-2019-25016 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'name': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/issues/45', 'name': 'https://github.com/Duncaen/OpenDoas/issues/45', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'name': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'name': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202107-11', 'name': 'GLSA-202107-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-459'}, {'lang': 'en', 'value': 'CWE-909'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opendoas_project:opendoas:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.6', 'versionEndIncluding': '6.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In OpenDoas from 6.6 to 6.8 the users PATH variable was incorrectly inherited by authenticated executions if the authenticating rule allowed the user to execute any command. Rules that only allowed to authenticated user to execute specific commands were not affected by this issue.'}] | 2022-04-26T16:14Z | 2021-01-28T20:15Z | Incomplete Cleanup | The software does not properly "clean up" and remove temporary or supporting resources after they have been used. | https://cwe.mitre.org/data/definitions/459.html | 0 | tedu | 2019-06-16 18:16:34+00:00 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. | 01c658f8c45cb92a343be5f32aa6da70b2032168 | False | Duncaen/OpenDoas | A portable fork of the OpenBSD `doas` command | 2016-05-04 21:44:11 | 2022-07-16 18:19:10 | Duncaen | 435.0 | 32.0 | createenv | createenv( const struct rule * rule) | ['rule'] | createenv(const struct rule *rule)
{
struct env *env;
u_int i;
env = malloc(sizeof(*env));
if (!env)
err(1, NULL);
RB_INIT(&env->root);
env->count = 0;
if (rule->options & KEEPENV) {
extern char **environ;
for (i = 0; environ[i] != NULL; i++) {
struct envnode *node;
const char *e, *eq;
size_t len;
char keybuf[1024];
e = environ[i];
/* ignore invalid or overlong names */
if ((eq = strchr(e, '=')) == NULL || eq == e)
continue;
len = eq - e;
if (len > sizeof(keybuf) - 1)
continue;
memcpy(keybuf, e, len);
keybuf[len] = '\0';
node = createnode(keybuf, eq + 1);
if (RB_INSERT(envtree, &env->root, node)) {
/* ignore any later duplicates */
freenode(node);
} else {
env->count++;
}
}
}
return env;
} | 216 | True | 1 |
||
CVE-2019-25016 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'name': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/issues/45', 'name': 'https://github.com/Duncaen/OpenDoas/issues/45', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'name': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'name': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202107-11', 'name': 'GLSA-202107-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-459'}, {'lang': 'en', 'value': 'CWE-909'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opendoas_project:opendoas:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.6', 'versionEndIncluding': '6.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In OpenDoas from 6.6 to 6.8 the users PATH variable was incorrectly inherited by authenticated executions if the authenticating rule allowed the user to execute any command. Rules that only allowed to authenticated user to execute specific commands were not affected by this issue.'}] | 2022-04-26T16:14Z | 2021-01-28T20:15Z | Missing Initialization of Resource | The software does not initialize a critical resource. | Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.
| https://cwe.mitre.org/data/definitions/909.html | 0 | tedu | 2019-06-16 18:16:34+00:00 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. | 01c658f8c45cb92a343be5f32aa6da70b2032168 | False | Duncaen/OpenDoas | A portable fork of the OpenBSD `doas` command | 2016-05-04 21:44:11 | 2022-07-16 18:19:10 | Duncaen | 435.0 | 32.0 | createenv | createenv( const struct rule * rule) | ['rule'] | createenv(const struct rule *rule)
{
struct env *env;
u_int i;
env = malloc(sizeof(*env));
if (!env)
err(1, NULL);
RB_INIT(&env->root);
env->count = 0;
if (rule->options & KEEPENV) {
extern char **environ;
for (i = 0; environ[i] != NULL; i++) {
struct envnode *node;
const char *e, *eq;
size_t len;
char keybuf[1024];
e = environ[i];
/* ignore invalid or overlong names */
if ((eq = strchr(e, '=')) == NULL || eq == e)
continue;
len = eq - e;
if (len > sizeof(keybuf) - 1)
continue;
memcpy(keybuf, e, len);
keybuf[len] = '\0';
node = createnode(keybuf, eq + 1);
if (RB_INSERT(envtree, &env->root, node)) {
/* ignore any later duplicates */
freenode(node);
} else {
env->count++;
}
}
}
return env;
} | 216 | True | 1 |
|
CVE-2019-25016 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'name': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/issues/45', 'name': 'https://github.com/Duncaen/OpenDoas/issues/45', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'name': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'name': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202107-11', 'name': 'GLSA-202107-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-459'}, {'lang': 'en', 'value': 'CWE-909'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opendoas_project:opendoas:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.6', 'versionEndIncluding': '6.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In OpenDoas from 6.6 to 6.8 the users PATH variable was incorrectly inherited by authenticated executions if the authenticating rule allowed the user to execute any command. Rules that only allowed to authenticated user to execute specific commands were not affected by this issue.'}] | 2022-04-26T16:14Z | 2021-01-28T20:15Z | Incomplete Cleanup | The software does not properly "clean up" and remove temporary or supporting resources after they have been used. | https://cwe.mitre.org/data/definitions/459.html | 0 | tedu | 2019-06-16 18:16:34+00:00 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. | 01c658f8c45cb92a343be5f32aa6da70b2032168 | False | Duncaen/OpenDoas | A portable fork of the OpenBSD `doas` command | 2016-05-04 21:44:11 | 2022-07-16 18:19:10 | Duncaen | 435.0 | 32.0 | prepenv | prepenv( const struct rule * rule) | ['rule'] | prepenv(const struct rule *rule)
{
static const char *safeset[] = {
"DISPLAY", "HOME", "LOGNAME", "MAIL",
"PATH", "TERM", "USER", "USERNAME",
NULL
};
struct env *env;
env = createenv(rule);
/* if we started with blank, fill some defaults then apply rules */
if (!(rule->options & KEEPENV))
fillenv(env, safeset);
if (rule->envlist)
fillenv(env, rule->envlist);
return flattenenv(env);
} | 89 | True | 1 |
||
CVE-2019-25016 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'name': 'https://github.com/Duncaen/OpenDoas/commit/01c658f8c45cb92a343be5f32aa6da70b2032168', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/issues/45', 'name': 'https://github.com/Duncaen/OpenDoas/issues/45', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'name': 'https://github.com/Duncaen/OpenDoas/releases/tag/v6.8.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'name': 'https://github.com/Duncaen/OpenDoas/commit/d5acd52e2a15c36a8e06f9103d35622933aa422d', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202107-11', 'name': 'GLSA-202107-11', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-459'}, {'lang': 'en', 'value': 'CWE-909'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:opendoas_project:opendoas:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.6', 'versionEndIncluding': '6.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In OpenDoas from 6.6 to 6.8 the users PATH variable was incorrectly inherited by authenticated executions if the authenticating rule allowed the user to execute any command. Rules that only allowed to authenticated user to execute specific commands were not affected by this issue.'}] | 2022-04-26T16:14Z | 2021-01-28T20:15Z | Missing Initialization of Resource | The software does not initialize a critical resource. | Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.
| https://cwe.mitre.org/data/definitions/909.html | 0 | tedu | 2019-06-16 18:16:34+00:00 | redo the environment inheritance to not inherit. it was intended to make life easier, but it can be surprising or even unsafe. instead, reset just about everything to the target user's values. ok deraadt martijn Thanks to Sander Bos in particular for pointing out some nasty edge cases. | 01c658f8c45cb92a343be5f32aa6da70b2032168 | False | Duncaen/OpenDoas | A portable fork of the OpenBSD `doas` command | 2016-05-04 21:44:11 | 2022-07-16 18:19:10 | Duncaen | 435.0 | 32.0 | prepenv | prepenv( const struct rule * rule) | ['rule'] | prepenv(const struct rule *rule)
{
static const char *safeset[] = {
"DISPLAY", "HOME", "LOGNAME", "MAIL",
"PATH", "TERM", "USER", "USERNAME",
NULL
};
struct env *env;
env = createenv(rule);
/* if we started with blank, fill some defaults then apply rules */
if (!(rule->options & KEEPENV))
fillenv(env, safeset);
if (rule->envlist)
fillenv(env, rule->envlist);
return flattenenv(env);
} | 89 | True | 1 |
|
CVE-2019-25048 | 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/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'name': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13914', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13914', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1923.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1923.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openbsd:libressl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.9.1', 'versionEndIncluding': '3.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'LibreSSL 2.9.1 through 3.2.1 has a heap-based buffer over-read in do_print_ex (called from asn1_item_print_ctx and ASN1_item_print).'}] | 2021-07-08T12:31Z | 2021-07-01T03: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 | Joel Sing | 2020-09-20 02:09:35+10:00 | Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.
bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h). | 17c88164016df821df2dff4b2b1291291ec4f28a | False | libressl-portable/portable | LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to [email protected] are welcome. | 2014-07-11 12:14:29 | 2022-08-15 08:44:54 | libressl-portable | 1137.0 | 240.0 | pthread_mutex_init | pthread_mutex_init( pthread_mutex_t * mutex , const pthread_mutexattr_t * attr) | ['mutex', 'attr'] | pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
{
InitializeCriticalSection(mutex);
return 0;
} | 21 | True | 1 |
|
CVE-2019-25049 | 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://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13920', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13920', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'name': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1965.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1965.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openbsd:libressl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.9.1', 'versionEndIncluding': '3.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'LibreSSL 2.9.1 through 3.2.1 has an out-of-bounds read in asn1_item_print_ctx (called from asn1_template_print_ctx).'}] | 2021-07-08T17:03Z | 2021-07-01T03: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 | Joel Sing | 2020-09-20 02:09:35+10:00 | Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.
bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h). | 17c88164016df821df2dff4b2b1291291ec4f28a | False | libressl-portable/portable | LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to [email protected] are welcome. | 2014-07-11 12:14:29 | 2022-08-15 08:44:54 | libressl-portable | 1137.0 | 240.0 | pthread_mutex_init | pthread_mutex_init( pthread_mutex_t * mutex , const pthread_mutexattr_t * attr) | ['mutex', 'attr'] | pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
{
InitializeCriticalSection(mutex);
return 0;
} | 21 | True | 1 |
|
CVE-2019-25048 | 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/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'name': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13914', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13914', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1923.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1923.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openbsd:libressl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.9.1', 'versionEndIncluding': '3.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'LibreSSL 2.9.1 through 3.2.1 has a heap-based buffer over-read in do_print_ex (called from asn1_item_print_ctx and ASN1_item_print).'}] | 2021-07-08T12:31Z | 2021-07-01T03: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 | Joel Sing | 2020-09-20 02:09:35+10:00 | Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.
bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h). | 17c88164016df821df2dff4b2b1291291ec4f28a | False | libressl-portable/portable | LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to [email protected] are welcome. | 2014-07-11 12:14:29 | 2022-08-15 08:44:54 | libressl-portable | 1137.0 | 240.0 | pthread_mutex_lock | pthread_mutex_lock( pthread_mutex_t * mutex) | ['mutex'] | pthread_mutex_lock(pthread_mutex_t *mutex)
{
EnterCriticalSection(mutex);
return 0;
} | 16 | True | 1 |
|
CVE-2019-25049 | 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://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13920', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13920', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'name': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1965.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1965.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openbsd:libressl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.9.1', 'versionEndIncluding': '3.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'LibreSSL 2.9.1 through 3.2.1 has an out-of-bounds read in asn1_item_print_ctx (called from asn1_template_print_ctx).'}] | 2021-07-08T17:03Z | 2021-07-01T03: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 | Joel Sing | 2020-09-20 02:09:35+10:00 | Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.
bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h). | 17c88164016df821df2dff4b2b1291291ec4f28a | False | libressl-portable/portable | LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to [email protected] are welcome. | 2014-07-11 12:14:29 | 2022-08-15 08:44:54 | libressl-portable | 1137.0 | 240.0 | pthread_mutex_lock | pthread_mutex_lock( pthread_mutex_t * mutex) | ['mutex'] | pthread_mutex_lock(pthread_mutex_t *mutex)
{
EnterCriticalSection(mutex);
return 0;
} | 16 | True | 1 |
|
CVE-2019-25048 | 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/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'name': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13914', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13914', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1923.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1923.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openbsd:libressl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.9.1', 'versionEndIncluding': '3.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'LibreSSL 2.9.1 through 3.2.1 has a heap-based buffer over-read in do_print_ex (called from asn1_item_print_ctx and ASN1_item_print).'}] | 2021-07-08T12:31Z | 2021-07-01T03: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 | Joel Sing | 2020-09-20 02:09:35+10:00 | Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.
bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h). | 17c88164016df821df2dff4b2b1291291ec4f28a | False | libressl-portable/portable | LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to [email protected] are welcome. | 2014-07-11 12:14:29 | 2022-08-15 08:44:54 | libressl-portable | 1137.0 | 240.0 | pthread_mutex_unlock | pthread_mutex_unlock( pthread_mutex_t * mutex) | ['mutex'] | pthread_mutex_unlock(pthread_mutex_t *mutex)
{
LeaveCriticalSection(mutex);
return 0;
} | 16 | True | 1 |
|
CVE-2019-25049 | 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://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13920', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13920', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'name': 'https://github.com/libressl-portable/portable/commit/17c88164016df821df2dff4b2b1291291ec4f28a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1965.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libressl/OSV-2020-1965.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openbsd:libressl:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.9.1', 'versionEndIncluding': '3.2.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'LibreSSL 2.9.1 through 3.2.1 has an out-of-bounds read in asn1_item_print_ctx (called from asn1_template_print_ctx).'}] | 2021-07-08T17:03Z | 2021-07-01T03: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 | Joel Sing | 2020-09-20 02:09:35+10:00 | Make pthread_mutex static initialisation work on Windows.
This takes the dynamic initialisation code added to CRYPTO_lock() in e5081719
and applies it to the Window's pthread_mutex implementation. This allows for
PTHREAD_MUTEX_INITIALIZER to be used on Windows.
bcook has agreed to place this code in the public domain (as per the rest of
the code in pthread.h). | 17c88164016df821df2dff4b2b1291291ec4f28a | False | libressl-portable/portable | LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to [email protected] are welcome. | 2014-07-11 12:14:29 | 2022-08-15 08:44:54 | libressl-portable | 1137.0 | 240.0 | pthread_mutex_unlock | pthread_mutex_unlock( pthread_mutex_t * mutex) | ['mutex'] | pthread_mutex_unlock(pthread_mutex_t *mutex)
{
LeaveCriticalSection(mutex);
return 0;
} | 16 | True | 1 |
|
CVE-2019-25051 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'name': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/07/msg00021.html', 'name': '[debian-lts-announce] 20210725 [SECURITY] [DLA 2720-1] aspell security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/H7E4EI7F6TVN7K6XWU6HSANMCOKKEREE/', 'name': 'FEDORA-2021-69de7c7ca4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4948', 'name': 'DSA-4948', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:aspell:0.60.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'objstack in GNU Aspell 0.60.8 has a heap-based buffer overflow in acommon::ObjStack::dup_top (called from acommon::StringMap::add and acommon::Config::lookup_list).'}] | 2021-09-20T12:22Z | 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 | Kevin Atkinson | 2019-12-21 20:32:47+00:00 | objstack: assert that the alloc size will fit within a chunk
to prevent a buffer overflow
Bug found using OSS-Fuze. | 0718b375425aad8e54e1150313b862e4c6fd324a | False | GNUAspell/aspell | null | 2016-12-11 04:01:31 | 2022-06-15 21:12:03 | http://aspell.net | gnuaspell | 193.0 | 48.0 | acommon::ObjStack::alloc_bottom | acommon::ObjStack::alloc_bottom( size_t size , size_t align) | ['size', 'align'] | void * alloc_bottom(size_t size, size_t align)
{loop:
align_bottom(align);
byte * tmp = bottom;
bottom += size;
if (bottom > top) {new_chunk(); goto loop;}
return tmp;
} | 45 | True | 1 |
CVE-2019-25051 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'name': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/07/msg00021.html', 'name': '[debian-lts-announce] 20210725 [SECURITY] [DLA 2720-1] aspell security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/H7E4EI7F6TVN7K6XWU6HSANMCOKKEREE/', 'name': 'FEDORA-2021-69de7c7ca4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4948', 'name': 'DSA-4948', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:aspell:0.60.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'objstack in GNU Aspell 0.60.8 has a heap-based buffer overflow in acommon::ObjStack::dup_top (called from acommon::StringMap::add and acommon::Config::lookup_list).'}] | 2021-09-20T12:22Z | 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 | Kevin Atkinson | 2019-12-21 20:32:47+00:00 | objstack: assert that the alloc size will fit within a chunk
to prevent a buffer overflow
Bug found using OSS-Fuze. | 0718b375425aad8e54e1150313b862e4c6fd324a | False | GNUAspell/aspell | null | 2016-12-11 04:01:31 | 2022-06-15 21:12:03 | http://aspell.net | gnuaspell | 193.0 | 48.0 | acommon::ObjStack::alloc_bottom | acommon::ObjStack::alloc_bottom( size_t size) | ['size'] | void * alloc_bottom(size_t size) {
byte * tmp = bottom;
bottom += size;
if (bottom > top) {new_chunk(); tmp = bottom; bottom += size;}
return tmp;
} | 40 | True | 1 |
CVE-2019-25051 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'name': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/07/msg00021.html', 'name': '[debian-lts-announce] 20210725 [SECURITY] [DLA 2720-1] aspell security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/H7E4EI7F6TVN7K6XWU6HSANMCOKKEREE/', 'name': 'FEDORA-2021-69de7c7ca4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4948', 'name': 'DSA-4948', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:aspell:0.60.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'objstack in GNU Aspell 0.60.8 has a heap-based buffer overflow in acommon::ObjStack::dup_top (called from acommon::StringMap::add and acommon::Config::lookup_list).'}] | 2021-09-20T12:22Z | 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 | Kevin Atkinson | 2019-12-21 20:32:47+00:00 | objstack: assert that the alloc size will fit within a chunk
to prevent a buffer overflow
Bug found using OSS-Fuze. | 0718b375425aad8e54e1150313b862e4c6fd324a | False | GNUAspell/aspell | null | 2016-12-11 04:01:31 | 2022-06-15 21:12:03 | http://aspell.net | gnuaspell | 193.0 | 48.0 | acommon::ObjStack::alloc_top | acommon::ObjStack::alloc_top( size_t size , size_t align) | ['size', 'align'] | void * alloc_top(size_t size, size_t align)
{loop:
top -= size;
align_top(align);
if (top < bottom) {new_chunk(); goto loop;}
return top;
} | 39 | True | 1 |
CVE-2019-25051 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:P | LOCAL | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 4.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'name': 'https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18462', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/aspell/OSV-2020-521.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/07/msg00021.html', 'name': '[debian-lts-announce] 20210725 [SECURITY] [DLA 2720-1] aspell security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/H7E4EI7F6TVN7K6XWU6HSANMCOKKEREE/', 'name': 'FEDORA-2021-69de7c7ca4', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4948', 'name': 'DSA-4948', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:gnu:aspell:0.60.8:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'objstack in GNU Aspell 0.60.8 has a heap-based buffer overflow in acommon::ObjStack::dup_top (called from acommon::StringMap::add and acommon::Config::lookup_list).'}] | 2021-09-20T12:22Z | 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 | Kevin Atkinson | 2019-12-21 20:32:47+00:00 | objstack: assert that the alloc size will fit within a chunk
to prevent a buffer overflow
Bug found using OSS-Fuze. | 0718b375425aad8e54e1150313b862e4c6fd324a | False | GNUAspell/aspell | null | 2016-12-11 04:01:31 | 2022-06-15 21:12:03 | http://aspell.net | gnuaspell | 193.0 | 48.0 | acommon::ObjStack::alloc_top | acommon::ObjStack::alloc_top( size_t size) | ['size'] | void * alloc_top(size_t size) {
top -= size;
if (top < bottom) {new_chunk(); top -= size;}
return top;
} | 30 | True | 1 |
CVE-2019-3554 | False | False | False | False | AV:N/AC:M/Au:N/C:N/I:N/A:P | NETWORK | MEDIUM | NONE | NONE | NONE | PARTIAL | 4.3 | CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/facebook/wangle/commit/3b17ba10a82c71e7808760e027ac6af687e06074', 'name': 'https://github.com/facebook/wangle/commit/3b17ba10a82c71e7808760e027ac6af687e06074', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-19'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:facebook:wangle:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.01.14.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Wangle's AcceptRoutingHandler incorrectly casts a socket when accepting a TLS 1.3 connection, leading to a potential denial of service attack against systems accepting such connections. This affects versions of Wangle prior to v2019.01.14.00"}] | 2019-10-09T23:49Z | 2019-01-15T22:29Z | Data Processing Errors | Weaknesses in this category are typically found in functionality that processes data. Data processing is the manipulation of input to retrieve or save information. | https://cwe.mitre.org/data/definitions/19.html | 1 | Mingtao Yang | 2019-01-10 15:27:00-08:00 | AcceptRoutingHandler should not assume a folly::AsyncSocket
Summary:
There is no reason to perform a cast to folly::AsyncSocket, when all of the
required behavior is in folly::AsyncTransportWrapper.
CVE-2019-3554
Reviewed By: avasylev
Differential Revision: D13599212
fbshipit-source-id: 3bb5475fe464c04cf5c04115f34e1bcf237cb4aa | 3b17ba10a82c71e7808760e027ac6af687e06074 | False | facebook/wangle | Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way. | 2014-12-11 20:12:30 | 2022-08-27 06:16:31 | facebook | 2887.0 | 527.0 | wangle::AcceptRoutingHandler<Pipeline,R>::onRoutingData | wangle::AcceptRoutingHandler<Pipeline,R>::onRoutingData( uint64_t connId , typename RoutingDataHandler<R> :: RoutingData & routingData) | ['connId', 'routingData'] | void AcceptRoutingHandler<Pipeline, R>::onRoutingData(
uint64_t connId,
typename RoutingDataHandler<R>::RoutingData& routingData) {
// Get the routing pipeline corresponding to this connection
auto routingPipelineIter = routingPipelines_.find(connId);
if (routingPipelineIter == routingPipelines_.end()) {
VLOG(2) << "Connection has already been closed, "
"or routed to a worker thread.";
return;
}
auto routingPipeline = std::move(routingPipelineIter->second);
routingPipelines_.erase(routingPipelineIter);
// Fetch the socket from the pipeline and pause reading from the
// socket
auto socket = std::dynamic_pointer_cast<folly::AsyncSocket>(
routingPipeline->getTransport());
routingPipeline->transportInactive();
socket->detachEventBase();
// Hash based on routing data to pick a new acceptor
uint64_t hash = std::hash<R>()(routingData.routingData);
auto acceptor = acceptors_[hash % acceptors_.size()];
// Switch to the new acceptor's thread
acceptor->getEventBase()->runInEventBaseThread(
[ =, routingData = std::move(routingData) ]() mutable {
socket->attachEventBase(acceptor->getEventBase());
auto routingHandler =
routingPipeline->template getHandler<RoutingDataHandler<R>>();
DCHECK(routingHandler);
auto transportInfo = routingPipeline->getTransportInfo();
auto pipeline = childPipelineFactory_->newPipeline(
socket, routingData.routingData, routingHandler, transportInfo);
auto connection =
new typename ServerAcceptor<Pipeline>::ServerConnection(pipeline);
acceptor->addConnection(connection);
pipeline->transportActive();
// Pass in the buffered bytes to the pipeline
pipeline->read(routingData.bufQueue);
});
} | 261 | True | 1 |
||
CVE-2019-3563 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/facebook/wangle/commit/5b3bceca875e4ea4ed9d14c20b20ce46c92c13c6', 'name': 'https://github.com/facebook/wangle/commit/5b3bceca875e4ea4ed9d14c20b20ce46c92c13c6', '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:facebook:wangle:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2019.04.22.00', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Wangle's LineBasedFrameDecoder contains logic for identifying newlines which incorrectly advances a buffer, leading to a potential underflow. This affects versions of Wangle prior to v2019.04.22.00"}] | 2020-10-16T18:08Z | 2019-04-29T16:29Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Kyle Nekritz | 2019-04-16 09:20:51-07:00 | Peek for \n in LineBasedFrameDecoder.
Summary:
Previously this could underflow if there was not a following \n.
CVE-2019-3563
Reviewed By: siyengar
Differential Revision: D14935715
fbshipit-source-id: 25c3eecf373f89efa1232456aeeb092f13b7fa06 | 5b3bceca875e4ea4ed9d14c20b20ce46c92c13c6 | False | facebook/wangle | Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way. | 2014-12-11 20:12:30 | 2022-08-27 06:16:31 | facebook | 2887.0 | 527.0 | wangle::LineBasedFrameDecoder::findEndOfLine | wangle::LineBasedFrameDecoder::findEndOfLine( IOBufQueue & buf) | ['buf'] | int64_t LineBasedFrameDecoder::findEndOfLine(IOBufQueue& buf) {
Cursor c(buf.front());
for (uint32_t i = 0; i < maxLength_ && i < buf.chainLength(); i++) {
auto b = c.read<char>();
if (b == '\n' && terminatorType_ != TerminatorType::CARRIAGENEWLINE) {
return i;
} else if (terminatorType_ != TerminatorType::NEWLINE &&
b == '\r' && !c.isAtEnd() && c.read<char>() == '\n') {
return i;
}
}
return -1;
} | 113 | True | 1 |
|
CVE-2019-3817 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/rpm-software-management/libcomps/issues/41', 'name': 'https://github.com/rpm-software-management/libcomps/issues/41', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'name': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Vendor Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3583', 'name': 'RHSA-2019:3583', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3898', 'name': 'RHSA-2019:3898', 'refsource': 'REDHAT', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rpm:libcomps:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.1.10', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A use-after-free flaw has been discovered in libcomps before version 0.1.10 in the way ObjMRTrees are merged. An attacker, who is able to make an application read a crafted comps XML file, may be able to crash the application or execute malicious code.'}] | 2019-10-09T23:49Z | 2019-03-27T13:29Z | 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 | Riccardo Schirone | 2019-01-21 18:11:42+01:00 | Fix UAF in comps_objmrtree_unite function
The added field is not used at all in many places and it is probably the
left-over of some copy-paste. | e3a5d056633677959ad924a51758876d415e7046 | False | rpm-software-management/libcomps | Libcomps is alternative for yum.comps library. It's written in pure C as library and there's bindings for python2 and python3. | 2013-06-24 11:30:49 | 2022-08-25 10:04:33 | rpm-software-management | 27.0 | 36.0 | comps_mrtree_unite | comps_mrtree_unite( COMPS_MRTree * rt1 , COMPS_MRTree * rt2) | ['rt1', 'rt2'] | void comps_mrtree_unite(COMPS_MRTree *rt1, COMPS_MRTree *rt2) {
COMPS_HSList *tmplist, *tmp_subnodes;
COMPS_HSListItem *it, *it2;
struct Pair {
COMPS_HSList * subnodes;
char * key;
char added;
} *pair, *parent_pair;
pair = malloc(sizeof(struct Pair));
pair->subnodes = rt2->subnodes;
pair->key = NULL;
tmplist = comps_hslist_create();
comps_hslist_init(tmplist, NULL, NULL, &free);
comps_hslist_append(tmplist, pair, 0);
while (tmplist->first != NULL) {
it = tmplist->first;
comps_hslist_remove(tmplist, tmplist->first);
tmp_subnodes = ((struct Pair*)it->data)->subnodes;
parent_pair = (struct Pair*) it->data;
free(it);
pair->added = 0;
for (it = tmp_subnodes->first; it != NULL; it=it->next) {
pair = malloc(sizeof(struct Pair));
pair->subnodes = ((COMPS_MRTreeData*)it->data)->subnodes;
if (parent_pair->key != NULL) {
pair->key =
malloc(sizeof(char)
* (strlen(((COMPS_MRTreeData*)it->data)->key)
+ strlen(parent_pair->key) + 1));
memcpy(pair->key, parent_pair->key,
sizeof(char) * strlen(parent_pair->key));
memcpy(pair->key+strlen(parent_pair->key),
((COMPS_MRTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_MRTreeData*)it->data)->key)+1));
} else {
pair->key = malloc(sizeof(char)*
(strlen(((COMPS_MRTreeData*)it->data)->key) +
1));
memcpy(pair->key, ((COMPS_MRTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_MRTreeData*)it->data)->key)+1));
}
/* current node has data */
if (((COMPS_MRTreeData*)it->data)->data->first != NULL) {
for (it2 = ((COMPS_MRTreeData*)it->data)->data->first;
it2 != NULL; it2 = it2->next) {
comps_mrtree_set(rt1, pair->key, it2->data);
}
if (((COMPS_MRTreeData*)it->data)->subnodes->first) {
comps_hslist_append(tmplist, pair, 0);
} else {
free(pair->key);
free(pair);
}
/* current node hasn't data */
} else {
if (((COMPS_MRTreeData*)it->data)->subnodes->first) {
comps_hslist_append(tmplist, pair, 0);
} else {
free(pair->key);
free(pair);
}
}
}
free(parent_pair->key);
free(parent_pair);
}
comps_hslist_destroy(&tmplist);
} | 574 | True | 1 |
|
CVE-2019-3817 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/rpm-software-management/libcomps/issues/41', 'name': 'https://github.com/rpm-software-management/libcomps/issues/41', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'name': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Vendor Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3583', 'name': 'RHSA-2019:3583', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3898', 'name': 'RHSA-2019:3898', 'refsource': 'REDHAT', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rpm:libcomps:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.1.10', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A use-after-free flaw has been discovered in libcomps before version 0.1.10 in the way ObjMRTrees are merged. An attacker, who is able to make an application read a crafted comps XML file, may be able to crash the application or execute malicious code.'}] | 2019-10-09T23:49Z | 2019-03-27T13:29Z | 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 | Riccardo Schirone | 2019-01-21 18:11:42+01:00 | Fix UAF in comps_objmrtree_unite function
The added field is not used at all in many places and it is probably the
left-over of some copy-paste. | e3a5d056633677959ad924a51758876d415e7046 | False | rpm-software-management/libcomps | Libcomps is alternative for yum.comps library. It's written in pure C as library and there's bindings for python2 and python3. | 2013-06-24 11:30:49 | 2022-08-25 10:04:33 | rpm-software-management | 27.0 | 36.0 | comps_objmrtree_unite | comps_objmrtree_unite( COMPS_ObjMRTree * rt1 , COMPS_ObjMRTree * rt2) | ['rt1', 'rt2'] | void comps_objmrtree_unite(COMPS_ObjMRTree *rt1, COMPS_ObjMRTree *rt2) {
COMPS_HSList *tmplist, *tmp_subnodes;
COMPS_HSListItem *it;
COMPS_ObjListIt *it2;
struct Pair {
COMPS_HSList * subnodes;
char * key;
char added;
} *pair, *parent_pair;
pair = malloc(sizeof(struct Pair));
pair->subnodes = rt2->subnodes;
pair->key = NULL;
tmplist = comps_hslist_create();
comps_hslist_init(tmplist, NULL, NULL, &free);
comps_hslist_append(tmplist, pair, 0);
while (tmplist->first != NULL) {
it = tmplist->first;
comps_hslist_remove(tmplist, tmplist->first);
tmp_subnodes = ((struct Pair*)it->data)->subnodes;
parent_pair = (struct Pair*) it->data;
free(it);
pair->added = 0;
for (it = tmp_subnodes->first; it != NULL; it=it->next) {
pair = malloc(sizeof(struct Pair));
pair->subnodes = ((COMPS_ObjMRTreeData*)it->data)->subnodes;
if (parent_pair->key != NULL) {
pair->key =
malloc(sizeof(char)
* (strlen(((COMPS_ObjMRTreeData*)it->data)->key)
+ strlen(parent_pair->key) + 1));
memcpy(pair->key, parent_pair->key,
sizeof(char) * strlen(parent_pair->key));
memcpy(pair->key+strlen(parent_pair->key),
((COMPS_ObjMRTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_ObjMRTreeData*)it->data)->key)+1));
} else {
pair->key = malloc(sizeof(char)*
(strlen(((COMPS_ObjMRTreeData*)it->data)->key) +
1));
memcpy(pair->key, ((COMPS_ObjMRTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_ObjMRTreeData*)it->data)->key)+1));
}
/* current node has data */
if (((COMPS_ObjMRTreeData*)it->data)->data->first != NULL) {
for (it2 = ((COMPS_ObjMRTreeData*)it->data)->data->first;
it2 != NULL; it2 = it2->next) {
comps_objmrtree_set(rt1, pair->key, it2->comps_obj);
}
if (((COMPS_ObjMRTreeData*)it->data)->subnodes->first) {
comps_hslist_append(tmplist, pair, 0);
} else {
free(pair->key);
free(pair);
}
/* current node hasn't data */
} else {
if (((COMPS_ObjMRTreeData*)it->data)->subnodes->first) {
comps_hslist_append(tmplist, pair, 0);
} else {
free(pair->key);
free(pair);
}
}
}
free(parent_pair->key);
free(parent_pair);
}
comps_hslist_destroy(&tmplist);
} | 575 | True | 1 |
|
CVE-2019-3817 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/rpm-software-management/libcomps/issues/41', 'name': 'https://github.com/rpm-software-management/libcomps/issues/41', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'name': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Vendor Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3583', 'name': 'RHSA-2019:3583', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3898', 'name': 'RHSA-2019:3898', 'refsource': 'REDHAT', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rpm:libcomps:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.1.10', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A use-after-free flaw has been discovered in libcomps before version 0.1.10 in the way ObjMRTrees are merged. An attacker, who is able to make an application read a crafted comps XML file, may be able to crash the application or execute malicious code.'}] | 2019-10-09T23:49Z | 2019-03-27T13:29Z | 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 | Riccardo Schirone | 2019-01-21 18:11:42+01:00 | Fix UAF in comps_objmrtree_unite function
The added field is not used at all in many places and it is probably the
left-over of some copy-paste. | e3a5d056633677959ad924a51758876d415e7046 | False | rpm-software-management/libcomps | Libcomps is alternative for yum.comps library. It's written in pure C as library and there's bindings for python2 and python3. | 2013-06-24 11:30:49 | 2022-08-25 10:04:33 | rpm-software-management | 27.0 | 36.0 | comps_objrtree_unite | comps_objrtree_unite( COMPS_ObjRTree * rt1 , COMPS_ObjRTree * rt2) | ['rt1', 'rt2'] | void comps_objrtree_unite(COMPS_ObjRTree *rt1, COMPS_ObjRTree *rt2) {
COMPS_HSList *tmplist, *tmp_subnodes;
COMPS_HSListItem *it;
struct Pair {
COMPS_HSList * subnodes;
char * key;
char added;
} *pair, *parent_pair;
pair = malloc(sizeof(struct Pair));
pair->subnodes = rt2->subnodes;
pair->key = NULL;
tmplist = comps_hslist_create();
comps_hslist_init(tmplist, NULL, NULL, &free);
comps_hslist_append(tmplist, pair, 0);
while (tmplist->first != NULL) {
it = tmplist->first;
comps_hslist_remove(tmplist, tmplist->first);
tmp_subnodes = ((struct Pair*)it->data)->subnodes;
parent_pair = (struct Pair*) it->data;
//printf("key-part:%s\n", parent_pair->key);
free(it);
//pair->added = 0;
for (it = tmp_subnodes->first; it != NULL; it=it->next) {
pair = malloc(sizeof(struct Pair));
pair->subnodes = ((COMPS_ObjRTreeData*)it->data)->subnodes;
if (parent_pair->key != NULL) {
pair->key = malloc(sizeof(char)
* (strlen(((COMPS_ObjRTreeData*)it->data)->key)
+ strlen(parent_pair->key) + 1));
memcpy(pair->key, parent_pair->key,
sizeof(char) * strlen(parent_pair->key));
memcpy(pair->key + strlen(parent_pair->key),
((COMPS_ObjRTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_ObjRTreeData*)it->data)->key)+1));
} else {
pair->key = malloc(sizeof(char)*
(strlen(((COMPS_ObjRTreeData*)it->data)->key) +1));
memcpy(pair->key, ((COMPS_ObjRTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_ObjRTreeData*)it->data)->key)+1));
}
/* current node has data */
if (((COMPS_ObjRTreeData*)it->data)->data != NULL) {
comps_objrtree_set(rt1, pair->key,
(((COMPS_ObjRTreeData*)it->data)->data));
}
if (((COMPS_ObjRTreeData*)it->data)->subnodes->first) {
comps_hslist_append(tmplist, pair, 0);
} else {
free(pair->key);
free(pair);
}
}
free(parent_pair->key);
free(parent_pair);
}
comps_hslist_destroy(&tmplist);
} | 498 | True | 1 |
|
CVE-2019-3817 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/rpm-software-management/libcomps/issues/41', 'name': 'https://github.com/rpm-software-management/libcomps/issues/41', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'name': 'https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-3817', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Issue Tracking', 'Vendor Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3583', 'name': 'RHSA-2019:3583', 'refsource': 'REDHAT', 'tags': []}, {'url': 'https://access.redhat.com/errata/RHSA-2019:3898', 'name': 'RHSA-2019:3898', 'refsource': 'REDHAT', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rpm:libcomps:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.1.10', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A use-after-free flaw has been discovered in libcomps before version 0.1.10 in the way ObjMRTrees are merged. An attacker, who is able to make an application read a crafted comps XML file, may be able to crash the application or execute malicious code.'}] | 2019-10-09T23:49Z | 2019-03-27T13:29Z | 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 | Riccardo Schirone | 2019-01-21 18:11:42+01:00 | Fix UAF in comps_objmrtree_unite function
The added field is not used at all in many places and it is probably the
left-over of some copy-paste. | e3a5d056633677959ad924a51758876d415e7046 | False | rpm-software-management/libcomps | Libcomps is alternative for yum.comps library. It's written in pure C as library and there's bindings for python2 and python3. | 2013-06-24 11:30:49 | 2022-08-25 10:04:33 | rpm-software-management | 27.0 | 36.0 | comps_rtree_unite | comps_rtree_unite( COMPS_RTree * rt1 , COMPS_RTree * rt2) | ['rt1', 'rt2'] | void comps_rtree_unite(COMPS_RTree *rt1, COMPS_RTree *rt2) {
COMPS_HSList *tmplist, *tmp_subnodes;
COMPS_HSListItem *it;
struct Pair {
COMPS_HSList * subnodes;
char * key;
char added;
} *pair, *parent_pair;
pair = malloc(sizeof(struct Pair));
pair->subnodes = rt2->subnodes;
pair->key = NULL;
tmplist = comps_hslist_create();
comps_hslist_init(tmplist, NULL, NULL, &free);
comps_hslist_append(tmplist, pair, 0);
while (tmplist->first != NULL) {
it = tmplist->first;
comps_hslist_remove(tmplist, tmplist->first);
tmp_subnodes = ((struct Pair*)it->data)->subnodes;
parent_pair = (struct Pair*) it->data;
free(it);
for (it = tmp_subnodes->first; it != NULL; it=it->next) {
pair = malloc(sizeof(struct Pair));
pair->subnodes = ((COMPS_RTreeData*)it->data)->subnodes;
if (parent_pair->key != NULL) {
pair->key = malloc(sizeof(char)
* (strlen(((COMPS_RTreeData*)it->data)->key)
+ strlen(parent_pair->key) + 1));
memcpy(pair->key, parent_pair->key,
sizeof(char) * strlen(parent_pair->key));
memcpy(pair->key + strlen(parent_pair->key),
((COMPS_RTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_RTreeData*)it->data)->key)+1));
} else {
pair->key = malloc(sizeof(char)*
(strlen(((COMPS_RTreeData*)it->data)->key) +1));
memcpy(pair->key, ((COMPS_RTreeData*)it->data)->key,
sizeof(char)*(strlen(((COMPS_RTreeData*)it->data)->key)+1));
}
/* current node has data */
if (((COMPS_RTreeData*)it->data)->data != NULL) {
comps_rtree_set(rt1,
pair->key,
rt2->data_cloner(((COMPS_RTreeData*)it->data)->data));
}
if (((COMPS_RTreeData*)it->data)->subnodes->first) {
comps_hslist_append(tmplist, pair, 0);
} else {
free(pair->key);
free(pair);
}
}
free(parent_pair->key);
free(parent_pair);
}
comps_hslist_destroy(&tmplist);
} | 501 | True | 1 |
|
CVE-2019-5892 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:N/A:P | NETWORK | LOW | SINGLE | NONE | NONE | PARTIAL | 4.0 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://lists.frrouting.org/pipermail/frog/2019-January/000404.html', 'name': 'https://lists.frrouting.org/pipermail/frog/2019-January/000404.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-6.0.2', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-6.0.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-5.0.2', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-5.0.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-4.0.1', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-4.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-3.0.4', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-3.0.4', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a', 'name': 'https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://frrouting.org/community/security/cve-2019-5892.html', 'name': 'https://frrouting.org/community/security/cve-2019-5892.html', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-436'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.0', 'versionEndExcluding': '6.0.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0', 'versionEndExcluding': '5.0.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0', 'versionEndExcluding': '3.0.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0', 'versionEndIncluding': '2.0.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bgpd in FRRouting FRR (aka Free Range Routing) 2.x and 3.x before 3.0.4, 4.x before 4.0.1, 5.x before 5.0.2, and 6.x before 6.0.2 (not affecting Cumulus Linux or VyOS), when ENABLE_BGP_VNC is used for Virtual Network Control, allows remote attackers to cause a denial of service (peering session flap) via attribute 255 in a BGP UPDATE packet. This occurred during Disco in January 2019 because FRR does not implement RFC 7606, and therefore the packets with 255 were considered invalid VNC data and the BGP session was closed.'}] | 2020-08-24T17:37Z | 2019-01-10T17:29Z | Interpretation Conflict | Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state. | This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that monitor, allow, deny, or modify traffic based on how the client or server is expected to behave.
| https://cwe.mitre.org/data/definitions/436.html | 0 | Lou Berger | 2019-01-07 11:32:54-05:00 | bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Signed-off-by: Lou Berger <[email protected]> | 943d595a018e69b550db08cccba1d0778a86705a | False | FRRouting/frr | The FRRouting Protocol Suite | 2016-12-15 21:56:38 | 2022-08-27 22:00:43 | https://frrouting.org/ | FRRouting | 2265.0 | 941.0 | bgp_attr_parse | bgp_attr_parse( struct peer * peer , struct attr * attr , bgp_size_t size , struct bgp_nlri * mp_update , struct bgp_nlri * mp_withdraw) | ['peer', 'attr', 'size', 'mp_update', 'mp_withdraw'] | bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
bgp_size_t size, struct bgp_nlri *mp_update,
struct bgp_nlri *mp_withdraw)
{
bgp_attr_parse_ret_t ret;
uint8_t flag = 0;
uint8_t type = 0;
bgp_size_t length;
uint8_t *startp, *endp;
uint8_t *attr_endp;
uint8_t seen[BGP_ATTR_BITMAP_SIZE];
/* we need the as4_path only until we have synthesized the as_path with
* it */
/* same goes for as4_aggregator */
struct aspath *as4_path = NULL;
as_t as4_aggregator = 0;
struct in_addr as4_aggregator_addr = {.s_addr = 0};
/* Initialize bitmap. */
memset(seen, 0, BGP_ATTR_BITMAP_SIZE);
/* End pointer of BGP attribute. */
endp = BGP_INPUT_PNT(peer) + size;
/* Get attributes to the end of attribute length. */
while (BGP_INPUT_PNT(peer) < endp) {
/* Check remaining length check.*/
if (endp - BGP_INPUT_PNT(peer) < BGP_ATTR_MIN_LEN) {
/* XXX warning: long int format, int arg (arg 5) */
flog_warn(
EC_BGP_ATTRIBUTE_TOO_SMALL,
"%s: error BGP attribute length %lu is smaller than min len",
peer->host,
(unsigned long)(endp
- stream_pnt(BGP_INPUT(peer))));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR);
return BGP_ATTR_PARSE_ERROR;
}
/* Fetch attribute flag and type. */
startp = BGP_INPUT_PNT(peer);
/* "The lower-order four bits of the Attribute Flags octet are
unused. They MUST be zero when sent and MUST be ignored when
received." */
flag = 0xF0 & stream_getc(BGP_INPUT(peer));
type = stream_getc(BGP_INPUT(peer));
/* Check whether Extended-Length applies and is in bounds */
if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN)
&& ((endp - startp) < (BGP_ATTR_MIN_LEN + 1))) {
flog_warn(
EC_BGP_EXT_ATTRIBUTE_TOO_SMALL,
"%s: Extended length set, but just %lu bytes of attr header",
peer->host,
(unsigned long)(endp
- stream_pnt(BGP_INPUT(peer))));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR);
return BGP_ATTR_PARSE_ERROR;
}
/* Check extended attribue length bit. */
if (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN))
length = stream_getw(BGP_INPUT(peer));
else
length = stream_getc(BGP_INPUT(peer));
/* If any attribute appears more than once in the UPDATE
message, then the Error Subcode is set to Malformed Attribute
List. */
if (CHECK_BITMAP(seen, type)) {
flog_warn(
EC_BGP_ATTRIBUTE_REPEATED,
"%s: error BGP attribute type %d appears twice in a message",
peer->host, type);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR);
return BGP_ATTR_PARSE_ERROR;
}
/* Set type to bitmap to check duplicate attribute. `type' is
unsigned char so it never overflow bitmap range. */
SET_BITMAP(seen, type);
/* Overflow check. */
attr_endp = BGP_INPUT_PNT(peer) + length;
if (attr_endp > endp) {
flog_warn(
EC_BGP_ATTRIBUTE_TOO_LARGE,
"%s: BGP type %d length %d is too large, attribute total length is %d. attr_endp is %p. endp is %p",
peer->host, type, length, size, attr_endp,
endp);
/*
* RFC 4271 6.3
* If any recognized attribute has an Attribute
* Length that conflicts with the expected length
* (based on the attribute type code), then the
* Error Subcode MUST be set to Attribute Length
* Error. The Data field MUST contain the erroneous
* attribute (type, length, and value).
* ----------
* We do not currently have a good way to determine the
* length of the attribute independent of the length
* received in the message. Instead we send the
* minimum between the amount of data we have and the
* amount specified by the attribute length field.
*
* Instead of directly passing in the packet buffer and
* offset we use the stream_get* functions to read into
* a stack buffer, since they perform bounds checking
* and we are working with untrusted data.
*/
unsigned char ndata[BGP_MAX_PACKET_SIZE];
memset(ndata, 0x00, sizeof(ndata));
size_t lfl =
CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN) ? 2 : 1;
/* Rewind to end of flag field */
stream_forward_getp(BGP_INPUT(peer), -(1 + lfl));
/* Type */
stream_get(&ndata[0], BGP_INPUT(peer), 1);
/* Length */
stream_get(&ndata[1], BGP_INPUT(peer), lfl);
/* Value */
size_t atl = attr_endp - startp;
size_t ndl = MIN(atl, STREAM_READABLE(BGP_INPUT(peer)));
stream_get(&ndata[lfl + 1], BGP_INPUT(peer), ndl);
bgp_notify_send_with_data(
peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, ndata,
ndl + lfl + 1);
return BGP_ATTR_PARSE_ERROR;
}
struct bgp_attr_parser_args attr_args = {
.peer = peer,
.length = length,
.attr = attr,
.type = type,
.flags = flag,
.startp = startp,
.total = attr_endp - startp,
};
/* If any recognized attribute has Attribute Flags that conflict
with the Attribute Type Code, then the Error Subcode is set
to
Attribute Flags Error. The Data field contains the erroneous
attribute (type, length and value). */
if (bgp_attr_flag_invalid(&attr_args)) {
ret = bgp_attr_malformed(
&attr_args, BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR,
attr_args.total);
if (ret == BGP_ATTR_PARSE_PROCEED)
continue;
return ret;
}
/* OK check attribute and store it's value. */
switch (type) {
case BGP_ATTR_ORIGIN:
ret = bgp_attr_origin(&attr_args);
break;
case BGP_ATTR_AS_PATH:
ret = bgp_attr_aspath(&attr_args);
break;
case BGP_ATTR_AS4_PATH:
ret = bgp_attr_as4_path(&attr_args, &as4_path);
break;
case BGP_ATTR_NEXT_HOP:
ret = bgp_attr_nexthop(&attr_args);
break;
case BGP_ATTR_MULTI_EXIT_DISC:
ret = bgp_attr_med(&attr_args);
break;
case BGP_ATTR_LOCAL_PREF:
ret = bgp_attr_local_pref(&attr_args);
break;
case BGP_ATTR_ATOMIC_AGGREGATE:
ret = bgp_attr_atomic(&attr_args);
break;
case BGP_ATTR_AGGREGATOR:
ret = bgp_attr_aggregator(&attr_args);
break;
case BGP_ATTR_AS4_AGGREGATOR:
ret = bgp_attr_as4_aggregator(&attr_args,
&as4_aggregator,
&as4_aggregator_addr);
break;
case BGP_ATTR_COMMUNITIES:
ret = bgp_attr_community(&attr_args);
break;
case BGP_ATTR_LARGE_COMMUNITIES:
ret = bgp_attr_large_community(&attr_args);
break;
case BGP_ATTR_ORIGINATOR_ID:
ret = bgp_attr_originator_id(&attr_args);
break;
case BGP_ATTR_CLUSTER_LIST:
ret = bgp_attr_cluster_list(&attr_args);
break;
case BGP_ATTR_MP_REACH_NLRI:
ret = bgp_mp_reach_parse(&attr_args, mp_update);
break;
case BGP_ATTR_MP_UNREACH_NLRI:
ret = bgp_mp_unreach_parse(&attr_args, mp_withdraw);
break;
case BGP_ATTR_EXT_COMMUNITIES:
ret = bgp_attr_ext_communities(&attr_args);
break;
#if ENABLE_BGP_VNC
case BGP_ATTR_VNC:
#endif
case BGP_ATTR_ENCAP:
ret = bgp_attr_encap(type, peer, length, attr, flag,
startp);
break;
case BGP_ATTR_PREFIX_SID:
ret = bgp_attr_prefix_sid(length,
&attr_args, mp_update);
break;
case BGP_ATTR_PMSI_TUNNEL:
ret = bgp_attr_pmsi_tunnel(&attr_args);
break;
default:
ret = bgp_attr_unknown(&attr_args);
break;
}
if (ret == BGP_ATTR_PARSE_ERROR_NOTIFYPLS) {
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR);
ret = BGP_ATTR_PARSE_ERROR;
}
if (ret == BGP_ATTR_PARSE_EOR) {
if (as4_path)
aspath_unintern(&as4_path);
return ret;
}
/* If hard error occurred immediately return to the caller. */
if (ret == BGP_ATTR_PARSE_ERROR) {
flog_warn(EC_BGP_ATTRIBUTE_PARSE_ERROR,
"%s: Attribute %s, parse error", peer->host,
lookup_msg(attr_str, type, NULL));
if (as4_path)
aspath_unintern(&as4_path);
return ret;
}
if (ret == BGP_ATTR_PARSE_WITHDRAW) {
flog_warn(
EC_BGP_ATTRIBUTE_PARSE_WITHDRAW,
"%s: Attribute %s, parse error - treating as withdrawal",
peer->host, lookup_msg(attr_str, type, NULL));
if (as4_path)
aspath_unintern(&as4_path);
return ret;
}
/* Check the fetched length. */
if (BGP_INPUT_PNT(peer) != attr_endp) {
flog_warn(EC_BGP_ATTRIBUTE_FETCH_ERROR,
"%s: BGP attribute %s, fetch error",
peer->host, lookup_msg(attr_str, type, NULL));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR);
if (as4_path)
aspath_unintern(&as4_path);
return BGP_ATTR_PARSE_ERROR;
}
}
/* Check final read pointer is same as end pointer. */
if (BGP_INPUT_PNT(peer) != endp) {
flog_warn(EC_BGP_ATTRIBUTES_MISMATCH,
"%s: BGP attribute %s, length mismatch", peer->host,
lookup_msg(attr_str, type, NULL));
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_ATTR_LENG_ERR);
if (as4_path)
aspath_unintern(&as4_path);
return BGP_ATTR_PARSE_ERROR;
}
/* Check all mandatory well-known attributes are present */
if ((ret = bgp_attr_check(peer, attr)) < 0) {
if (as4_path)
aspath_unintern(&as4_path);
return ret;
}
/*
* At this place we can see whether we got AS4_PATH and/or
* AS4_AGGREGATOR from a 16Bit peer and act accordingly.
* We can not do this before we've read all attributes because
* the as4 handling does not say whether AS4_PATH has to be sent
* after AS_PATH or not - and when AS4_AGGREGATOR will be send
* in relationship to AGGREGATOR.
* So, to be defensive, we are not relying on any order and read
* all attributes first, including these 32bit ones, and now,
* afterwards, we look what and if something is to be done for as4.
*
* It is possible to not have AS_PATH, e.g. GR EoR and sole
* MP_UNREACH_NLRI.
*/
/* actually... this doesn't ever return failure currently, but
* better safe than sorry */
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AS_PATH))
&& bgp_attr_munge_as4_attrs(peer, attr, as4_path, as4_aggregator,
&as4_aggregator_addr)) {
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_MAL_ATTR);
if (as4_path)
aspath_unintern(&as4_path);
return BGP_ATTR_PARSE_ERROR;
}
/* At this stage, we have done all fiddling with as4, and the
* resulting info is in attr->aggregator resp. attr->aspath
* so we can chuck as4_aggregator and as4_path alltogether in
* order to save memory
*/
if (as4_path) {
aspath_unintern(&as4_path); /* unintern - it is in the hash */
/* The flag that we got this is still there, but that does not
* do any trouble
*/
}
/*
* The "rest" of the code does nothing with as4_aggregator.
* there is no memory attached specifically which is not part
* of the attr.
* so ignoring just means do nothing.
*/
/*
* Finally do the checks on the aspath we did not do yet
* because we waited for a potentially synthesized aspath.
*/
if (attr->flag & (ATTR_FLAG_BIT(BGP_ATTR_AS_PATH))) {
ret = bgp_attr_aspath_check(peer, attr);
if (ret != BGP_ATTR_PARSE_PROCEED)
return ret;
}
/* Finally intern unknown attribute. */
if (attr->transit)
attr->transit = transit_intern(attr->transit);
if (attr->encap_subtlvs)
attr->encap_subtlvs =
encap_intern(attr->encap_subtlvs, ENCAP_SUBTLV_TYPE);
#if ENABLE_BGP_VNC
if (attr->vnc_subtlvs)
attr->vnc_subtlvs =
encap_intern(attr->vnc_subtlvs, VNC_SUBTLV_TYPE);
#endif
return BGP_ATTR_PARSE_PROCEED;
} | 1297 | True | 1 |
CVE-2019-5892 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:N/A:P | NETWORK | LOW | SINGLE | NONE | NONE | PARTIAL | 4.0 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://lists.frrouting.org/pipermail/frog/2019-January/000404.html', 'name': 'https://lists.frrouting.org/pipermail/frog/2019-January/000404.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-6.0.2', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-6.0.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-5.0.2', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-5.0.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-4.0.1', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-4.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-3.0.4', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-3.0.4', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a', 'name': 'https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://frrouting.org/community/security/cve-2019-5892.html', 'name': 'https://frrouting.org/community/security/cve-2019-5892.html', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-436'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.0', 'versionEndExcluding': '6.0.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0', 'versionEndExcluding': '5.0.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0', 'versionEndExcluding': '3.0.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0', 'versionEndIncluding': '2.0.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bgpd in FRRouting FRR (aka Free Range Routing) 2.x and 3.x before 3.0.4, 4.x before 4.0.1, 5.x before 5.0.2, and 6.x before 6.0.2 (not affecting Cumulus Linux or VyOS), when ENABLE_BGP_VNC is used for Virtual Network Control, allows remote attackers to cause a denial of service (peering session flap) via attribute 255 in a BGP UPDATE packet. This occurred during Disco in January 2019 because FRR does not implement RFC 7606, and therefore the packets with 255 were considered invalid VNC data and the BGP session was closed.'}] | 2020-08-24T17:37Z | 2019-01-10T17:29Z | Interpretation Conflict | Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state. | This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that monitor, allow, deny, or modify traffic based on how the client or server is expected to behave.
| https://cwe.mitre.org/data/definitions/436.html | 0 | Lou Berger | 2019-01-07 11:32:54-05:00 | bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Signed-off-by: Lou Berger <[email protected]> | 943d595a018e69b550db08cccba1d0778a86705a | False | FRRouting/frr | The FRRouting Protocol Suite | 2016-12-15 21:56:38 | 2022-08-27 22:00:43 | https://frrouting.org/ | FRRouting | 2265.0 | 941.0 | bgp_packet_attribute | bgp_packet_attribute( struct bgp * bgp , struct peer * peer , struct stream * s , struct attr * attr , struct bpacket_attr_vec_arr * vecarr , struct prefix * p , afi_t afi , safi_t safi , struct peer * from , struct prefix_rd * prd , mpls_label_t * label , uint32_t num_labels , int addpath_encode , uint32_t addpath_tx_id) | ['bgp', 'peer', 's', 'attr', 'vecarr', 'p', 'afi', 'safi', 'from', 'prd', 'label', 'num_labels', 'addpath_encode', 'addpath_tx_id'] | bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
struct stream *s, struct attr *attr,
struct bpacket_attr_vec_arr *vecarr,
struct prefix *p, afi_t afi, safi_t safi,
struct peer *from, struct prefix_rd *prd,
mpls_label_t *label, uint32_t num_labels,
int addpath_encode, uint32_t addpath_tx_id)
{
size_t cp;
size_t aspath_sizep;
struct aspath *aspath;
int send_as4_path = 0;
int send_as4_aggregator = 0;
int use32bit = (CHECK_FLAG(peer->cap, PEER_CAP_AS4_RCV)) ? 1 : 0;
if (!bgp)
bgp = peer->bgp;
/* Remember current pointer. */
cp = stream_get_endp(s);
if (p
&& !((afi == AFI_IP && safi == SAFI_UNICAST)
&& !peer_cap_enhe(peer, afi, safi))) {
size_t mpattrlen_pos = 0;
mpattrlen_pos = bgp_packet_mpattr_start(s, peer, afi, safi,
vecarr, attr);
bgp_packet_mpattr_prefix(s, afi, safi, p, prd, label,
num_labels, addpath_encode,
addpath_tx_id, attr);
bgp_packet_mpattr_end(s, mpattrlen_pos);
}
/* Origin attribute. */
stream_putc(s, BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_ORIGIN);
stream_putc(s, 1);
stream_putc(s, attr->origin);
/* AS path attribute. */
/* If remote-peer is EBGP */
if (peer->sort == BGP_PEER_EBGP
&& (!CHECK_FLAG(peer->af_flags[afi][safi],
PEER_FLAG_AS_PATH_UNCHANGED)
|| attr->aspath->segments == NULL)
&& (!CHECK_FLAG(peer->af_flags[afi][safi],
PEER_FLAG_RSERVER_CLIENT))) {
aspath = aspath_dup(attr->aspath);
/* Even though we may not be configured for confederations we
* may have
* RXed an AS_PATH with AS_CONFED_SEQUENCE or AS_CONFED_SET */
aspath = aspath_delete_confed_seq(aspath);
if (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION)) {
/* Stuff our path CONFED_ID on the front */
aspath = aspath_add_seq(aspath, bgp->confed_id);
} else {
if (peer->change_local_as) {
/* If replace-as is specified, we only use the
change_local_as when
advertising routes. */
if (!CHECK_FLAG(
peer->flags,
PEER_FLAG_LOCAL_AS_REPLACE_AS)) {
aspath = aspath_add_seq(aspath,
peer->local_as);
}
aspath = aspath_add_seq(aspath,
peer->change_local_as);
} else {
aspath = aspath_add_seq(aspath, peer->local_as);
}
}
} else if (peer->sort == BGP_PEER_CONFED) {
/* A confed member, so we need to do the AS_CONFED_SEQUENCE
* thing */
aspath = aspath_dup(attr->aspath);
aspath = aspath_add_confed_seq(aspath, peer->local_as);
} else
aspath = attr->aspath;
/* If peer is not AS4 capable, then:
* - send the created AS_PATH out as AS4_PATH (optional, transitive),
* but ensure that no AS_CONFED_SEQUENCE and AS_CONFED_SET path
* segment
* types are in it (i.e. exclude them if they are there)
* AND do this only if there is at least one asnum > 65535 in the
* path!
* - send an AS_PATH out, but put 16Bit ASnums in it, not 32bit, and
* change
* all ASnums > 65535 to BGP_AS_TRANS
*/
stream_putc(s, BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_EXTLEN);
stream_putc(s, BGP_ATTR_AS_PATH);
aspath_sizep = stream_get_endp(s);
stream_putw(s, 0);
stream_putw_at(s, aspath_sizep, aspath_put(s, aspath, use32bit));
/* OLD session may need NEW_AS_PATH sent, if there are 4-byte ASNs
* in the path
*/
if (!use32bit && aspath_has_as4(aspath))
send_as4_path =
1; /* we'll do this later, at the correct place */
/* Nexthop attribute. */
if (afi == AFI_IP && safi == SAFI_UNICAST
&& !peer_cap_enhe(peer, afi, safi)) {
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP)) {
stream_putc(s, BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_NEXT_HOP);
bpacket_attr_vec_arr_set_vec(vecarr, BGP_ATTR_VEC_NH, s,
attr);
stream_putc(s, 4);
stream_put_ipv4(s, attr->nexthop.s_addr);
} else if (peer_cap_enhe(from, afi, safi)) {
/*
* Likely this is the case when an IPv4 prefix was
* received with
* Extended Next-hop capability and now being advertised
* to
* non-ENHE peers.
* Setting the mandatory (ipv4) next-hop attribute here
* to enable
* implicit next-hop self with correct (ipv4 address
* family).
*/
stream_putc(s, BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_NEXT_HOP);
bpacket_attr_vec_arr_set_vec(vecarr, BGP_ATTR_VEC_NH, s,
NULL);
stream_putc(s, 4);
stream_put_ipv4(s, 0);
}
}
/* MED attribute. */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)
|| bgp->maxmed_active) {
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL);
stream_putc(s, BGP_ATTR_MULTI_EXIT_DISC);
stream_putc(s, 4);
stream_putl(s, (bgp->maxmed_active ? bgp->maxmed_value
: attr->med));
}
/* Local preference. */
if (peer->sort == BGP_PEER_IBGP || peer->sort == BGP_PEER_CONFED) {
stream_putc(s, BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_LOCAL_PREF);
stream_putc(s, 4);
stream_putl(s, attr->local_pref);
}
/* Atomic aggregate. */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE)) {
stream_putc(s, BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_ATOMIC_AGGREGATE);
stream_putc(s, 0);
}
/* Aggregator. */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR)) {
/* Common to BGP_ATTR_AGGREGATOR, regardless of ASN size */
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_AGGREGATOR);
if (use32bit) {
/* AS4 capable peer */
stream_putc(s, 8);
stream_putl(s, attr->aggregator_as);
} else {
/* 2-byte AS peer */
stream_putc(s, 6);
/* Is ASN representable in 2-bytes? Or must AS_TRANS be
* used? */
if (attr->aggregator_as > 65535) {
stream_putw(s, BGP_AS_TRANS);
/* we have to send AS4_AGGREGATOR, too.
* we'll do that later in order to send
* attributes in ascending
* order.
*/
send_as4_aggregator = 1;
} else
stream_putw(s, (uint16_t)attr->aggregator_as);
}
stream_put_ipv4(s, attr->aggregator_addr.s_addr);
}
/* Community attribute. */
if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY)
&& (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES))) {
if (attr->community->size * 4 > 255) {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS
| BGP_ATTR_FLAG_EXTLEN);
stream_putc(s, BGP_ATTR_COMMUNITIES);
stream_putw(s, attr->community->size * 4);
} else {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_COMMUNITIES);
stream_putc(s, attr->community->size * 4);
}
stream_put(s, attr->community->val, attr->community->size * 4);
}
/*
* Large Community attribute.
*/
if (CHECK_FLAG(peer->af_flags[afi][safi],
PEER_FLAG_SEND_LARGE_COMMUNITY)
&& (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES))) {
if (lcom_length(attr->lcommunity) > 255) {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS
| BGP_ATTR_FLAG_EXTLEN);
stream_putc(s, BGP_ATTR_LARGE_COMMUNITIES);
stream_putw(s, lcom_length(attr->lcommunity));
} else {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_LARGE_COMMUNITIES);
stream_putc(s, lcom_length(attr->lcommunity));
}
stream_put(s, attr->lcommunity->val,
lcom_length(attr->lcommunity));
}
/* Route Reflector. */
if (peer->sort == BGP_PEER_IBGP && from
&& from->sort == BGP_PEER_IBGP) {
/* Originator ID. */
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL);
stream_putc(s, BGP_ATTR_ORIGINATOR_ID);
stream_putc(s, 4);
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
stream_put_in_addr(s, &attr->originator_id);
else
stream_put_in_addr(s, &from->remote_id);
/* Cluster list. */
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL);
stream_putc(s, BGP_ATTR_CLUSTER_LIST);
if (attr->cluster) {
stream_putc(s, attr->cluster->length + 4);
/* If this peer configuration's parent BGP has
* cluster_id. */
if (bgp->config & BGP_CONFIG_CLUSTER_ID)
stream_put_in_addr(s, &bgp->cluster_id);
else
stream_put_in_addr(s, &bgp->router_id);
stream_put(s, attr->cluster->list,
attr->cluster->length);
} else {
stream_putc(s, 4);
/* If this peer configuration's parent BGP has
* cluster_id. */
if (bgp->config & BGP_CONFIG_CLUSTER_ID)
stream_put_in_addr(s, &bgp->cluster_id);
else
stream_put_in_addr(s, &bgp->router_id);
}
}
/* Extended Communities attribute. */
if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
&& (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES))) {
if (peer->sort == BGP_PEER_IBGP
|| peer->sort == BGP_PEER_CONFED) {
if (attr->ecommunity->size * 8 > 255) {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS
| BGP_ATTR_FLAG_EXTLEN);
stream_putc(s, BGP_ATTR_EXT_COMMUNITIES);
stream_putw(s, attr->ecommunity->size * 8);
} else {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_EXT_COMMUNITIES);
stream_putc(s, attr->ecommunity->size * 8);
}
stream_put(s, attr->ecommunity->val,
attr->ecommunity->size * 8);
} else {
uint8_t *pnt;
int tbit;
int ecom_tr_size = 0;
int i;
for (i = 0; i < attr->ecommunity->size; i++) {
pnt = attr->ecommunity->val + (i * 8);
tbit = *pnt;
if (CHECK_FLAG(tbit,
ECOMMUNITY_FLAG_NON_TRANSITIVE))
continue;
ecom_tr_size++;
}
if (ecom_tr_size) {
if (ecom_tr_size * 8 > 255) {
stream_putc(
s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS
| BGP_ATTR_FLAG_EXTLEN);
stream_putc(s,
BGP_ATTR_EXT_COMMUNITIES);
stream_putw(s, ecom_tr_size * 8);
} else {
stream_putc(
s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS);
stream_putc(s,
BGP_ATTR_EXT_COMMUNITIES);
stream_putc(s, ecom_tr_size * 8);
}
for (i = 0; i < attr->ecommunity->size; i++) {
pnt = attr->ecommunity->val + (i * 8);
tbit = *pnt;
if (CHECK_FLAG(
tbit,
ECOMMUNITY_FLAG_NON_TRANSITIVE))
continue;
stream_put(s, pnt, 8);
}
}
}
}
/* Label index attribute. */
if (safi == SAFI_LABELED_UNICAST) {
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID)) {
uint32_t label_index;
label_index = attr->label_index;
if (label_index != BGP_INVALID_LABEL_INDEX) {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_PREFIX_SID);
stream_putc(s, 10);
stream_putc(s, BGP_PREFIX_SID_LABEL_INDEX);
stream_putw(s,
BGP_PREFIX_SID_LABEL_INDEX_LENGTH);
stream_putc(s, 0); // reserved
stream_putw(s, 0); // flags
stream_putl(s, label_index);
}
}
}
if (send_as4_path) {
/* If the peer is NOT As4 capable, AND */
/* there are ASnums > 65535 in path THEN
* give out AS4_PATH */
/* Get rid of all AS_CONFED_SEQUENCE and AS_CONFED_SET
* path segments!
* Hm, I wonder... confederation things *should* only be at
* the beginning of an aspath, right? Then we should use
* aspath_delete_confed_seq for this, because it is already
* there! (JK)
* Folks, talk to me: what is reasonable here!?
*/
aspath = aspath_delete_confed_seq(aspath);
stream_putc(s,
BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_EXTLEN);
stream_putc(s, BGP_ATTR_AS4_PATH);
aspath_sizep = stream_get_endp(s);
stream_putw(s, 0);
stream_putw_at(s, aspath_sizep, aspath_put(s, aspath, 1));
}
if (aspath != attr->aspath)
aspath_free(aspath);
if (send_as4_aggregator) {
/* send AS4_AGGREGATOR, at this place */
/* this section of code moved here in order to ensure the
* correct
* *ascending* order of attributes
*/
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_AS4_AGGREGATOR);
stream_putc(s, 8);
stream_putl(s, attr->aggregator_as);
stream_put_ipv4(s, attr->aggregator_addr.s_addr);
}
if (((afi == AFI_IP || afi == AFI_IP6)
&& (safi == SAFI_ENCAP || safi == SAFI_MPLS_VPN))
|| (afi == AFI_L2VPN && safi == SAFI_EVPN)) {
/* Tunnel Encap attribute */
bgp_packet_mpattr_tea(bgp, peer, s, attr, BGP_ATTR_ENCAP);
#if ENABLE_BGP_VNC
/* VNC attribute */
bgp_packet_mpattr_tea(bgp, peer, s, attr, BGP_ATTR_VNC);
#endif
}
/* PMSI Tunnel */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL)) {
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL | BGP_ATTR_FLAG_TRANS);
stream_putc(s, BGP_ATTR_PMSI_TUNNEL);
stream_putc(s, 9); // Length
stream_putc(s, 0); // Flags
stream_putc(s, PMSI_TNLTYPE_INGR_REPL); // IR (6)
stream_put(s, &(attr->label),
BGP_LABEL_BYTES); // MPLS Label / VXLAN VNI
stream_put_ipv4(s, attr->nexthop.s_addr);
// Unicast tunnel endpoint IP address
}
/* Unknown transit attribute. */
if (attr->transit)
stream_put(s, attr->transit->val, attr->transit->length);
/* Return total size of attribute. */
return stream_get_endp(s) - cp;
} | 2025 | True | 1 |
CVE-2019-5892 | False | False | False | False | AV:N/AC:L/Au:S/C:N/I:N/A:P | NETWORK | LOW | SINGLE | NONE | NONE | PARTIAL | 4.0 | CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | NONE | NONE | HIGH | 6.5 | MEDIUM | 2.8 | 3.6 | False | [{'url': 'https://lists.frrouting.org/pipermail/frog/2019-January/000404.html', 'name': 'https://lists.frrouting.org/pipermail/frog/2019-January/000404.html', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-6.0.2', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-6.0.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-5.0.2', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-5.0.2', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-4.0.1', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-4.0.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/releases/tag/frr-3.0.4', 'name': 'https://github.com/FRRouting/frr/releases/tag/frr-3.0.4', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a', 'name': 'https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://frrouting.org/community/security/cve-2019-5892.html', 'name': 'https://frrouting.org/community/security/cve-2019-5892.html', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-436'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '6.0', 'versionEndExcluding': '6.0.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '5.0', 'versionEndExcluding': '5.0.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.0', 'versionEndExcluding': '3.0.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:frrouting:frrouting:*:*:*:*:*:*:*:*', 'versionStartIncluding': '2.0', 'versionEndIncluding': '2.0.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bgpd in FRRouting FRR (aka Free Range Routing) 2.x and 3.x before 3.0.4, 4.x before 4.0.1, 5.x before 5.0.2, and 6.x before 6.0.2 (not affecting Cumulus Linux or VyOS), when ENABLE_BGP_VNC is used for Virtual Network Control, allows remote attackers to cause a denial of service (peering session flap) via attribute 255 in a BGP UPDATE packet. This occurred during Disco in January 2019 because FRR does not implement RFC 7606, and therefore the packets with 255 were considered invalid VNC data and the BGP session was closed.'}] | 2020-08-24T17:37Z | 2019-01-10T17:29Z | Interpretation Conflict | Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state. | This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that monitor, allow, deny, or modify traffic based on how the client or server is expected to behave.
| https://cwe.mitre.org/data/definitions/436.html | 0 | Lou Berger | 2019-01-07 11:32:54-05:00 | bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Signed-off-by: Lou Berger <[email protected]> | 943d595a018e69b550db08cccba1d0778a86705a | False | FRRouting/frr | The FRRouting Protocol Suite | 2016-12-15 21:56:38 | 2022-08-27 22:00:43 | https://frrouting.org/ | FRRouting | 2265.0 | 941.0 | bgp_packet_mpattr_tea | bgp_packet_mpattr_tea( struct bgp * bgp , struct peer * peer , struct stream * s , struct attr * attr , uint8_t attrtype) | ['bgp', 'peer', 's', 'attr', 'attrtype'] | static void bgp_packet_mpattr_tea(struct bgp *bgp, struct peer *peer,
struct stream *s, struct attr *attr,
uint8_t attrtype)
{
unsigned int attrlenfield = 0;
unsigned int attrhdrlen = 0;
struct bgp_attr_encap_subtlv *subtlvs;
struct bgp_attr_encap_subtlv *st;
const char *attrname;
if (!attr || (attrtype == BGP_ATTR_ENCAP
&& (!attr->encap_tunneltype
|| attr->encap_tunneltype == BGP_ENCAP_TYPE_MPLS)))
return;
switch (attrtype) {
case BGP_ATTR_ENCAP:
attrname = "Tunnel Encap";
subtlvs = attr->encap_subtlvs;
if (subtlvs == NULL) /* nothing to do */
return;
/*
* The tunnel encap attr has an "outer" tlv.
* T = tunneltype,
* L = total length of subtlvs,
* V = concatenated subtlvs.
*/
attrlenfield = 2 + 2; /* T + L */
attrhdrlen = 1 + 1; /* subTLV T + L */
break;
#if ENABLE_BGP_VNC
case BGP_ATTR_VNC:
attrname = "VNC";
subtlvs = attr->vnc_subtlvs;
if (subtlvs == NULL) /* nothing to do */
return;
attrlenfield = 0; /* no outer T + L */
attrhdrlen = 2 + 2; /* subTLV T + L */
break;
#endif
default:
assert(0);
}
/* compute attr length */
for (st = subtlvs; st; st = st->next) {
attrlenfield += (attrhdrlen + st->length);
}
if (attrlenfield > 0xffff) {
zlog_info("%s attribute is too long (length=%d), can't send it",
attrname, attrlenfield);
return;
}
if (attrlenfield > 0xff) {
/* 2-octet length field */
stream_putc(s,
BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL
| BGP_ATTR_FLAG_EXTLEN);
stream_putc(s, attrtype);
stream_putw(s, attrlenfield & 0xffff);
} else {
/* 1-octet length field */
stream_putc(s, BGP_ATTR_FLAG_TRANS | BGP_ATTR_FLAG_OPTIONAL);
stream_putc(s, attrtype);
stream_putc(s, attrlenfield & 0xff);
}
if (attrtype == BGP_ATTR_ENCAP) {
/* write outer T+L */
stream_putw(s, attr->encap_tunneltype);
stream_putw(s, attrlenfield - 4);
}
/* write each sub-tlv */
for (st = subtlvs; st; st = st->next) {
if (attrtype == BGP_ATTR_ENCAP) {
stream_putc(s, st->type);
stream_putc(s, st->length);
#if ENABLE_BGP_VNC
} else {
stream_putw(s, st->type);
stream_putw(s, st->length);
#endif
}
stream_put(s, st->value, st->length);
}
} | 371 | True | 1 |
CVE-2019-9578 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/Yubico/libu2f-host/commit/e4bb58cc8b6202a421e65f8230217d8ae6e16eb5', 'name': 'https://github.com/Yubico/libu2f-host/commit/e4bb58cc8b6202a421e65f8230217d8ae6e16eb5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://developers.yubico.com/libu2f-host/Release_Notes.html', 'name': 'https://developers.yubico.com/libu2f-host/Release_Notes.html', 'refsource': 'MISC', 'tags': ['Vendor Advisory', 'Release Notes']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/S4YCFMSNMXZ7XC4U6WXPQA7JCXC6VOAJ/', 'name': 'FEDORA-2019-fe6d1fbffa', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/GMA4H6AZFYIR3LA5VKKEJZNCCIVMUCFQ/', 'name': 'FEDORA-2019-4d83e78ad8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00012.html', 'name': 'openSUSE-SU-2019:1708', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00018.html', 'name': 'openSUSE-SU-2019:1725', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://blog.inhq.net/posts/yubico-libu2f-host-vuln-part2/', 'name': 'https://blog.inhq.net/posts/yubico-libu2f-host-vuln-part2/', 'refsource': 'MISC', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202004-15', 'name': 'GLSA-202004-15', 'refsource': 'GENTOO', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-908'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:yubico:libu2f-host:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.1.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In devs.c in Yubico libu2f-host before 1.1.8, the response to init is misparsed, leaking uninitialized stack memory back to the device.'}] | 2020-08-24T17:37Z | 2019-03-05T23:29Z | 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 | Klas Lindfors | 2019-02-22 10:59:01+01:00 | fix filling out of initresp | e4bb58cc8b6202a421e65f8230217d8ae6e16eb5 | False | Yubico/libu2f-host | Yubico Universal 2nd Factor (U2F) Host C Library | 2014-09-16 08:12:52 | 2020-10-14 12:43:06 | https://developers.yubico.com/libu2f-host/ | Yubico | 323.0 | 201.0 | init_device | init_device( u2fh_devs * devs , struct u2fdevice * dev) | ['devs', 'dev'] | init_device (u2fh_devs * devs, struct u2fdevice *dev)
{
unsigned char resp[1024];
unsigned char nonce[8];
if (obtain_nonce(nonce) != 0)
{
return U2FH_TRANSPORT_ERROR;
}
size_t resplen = sizeof (resp);
dev->cid = CID_BROADCAST;
if (u2fh_sendrecv
(devs, dev->id, U2FHID_INIT, nonce, sizeof (nonce), resp,
&resplen) == U2FH_OK)
{
U2FHID_INIT_RESP initresp;
if (resplen > sizeof (initresp))
{
return U2FH_MEMORY_ERROR;
}
memcpy (&initresp, resp, resplen);
dev->cid = initresp.cid;
dev->versionInterface = initresp.versionInterface;
dev->versionMajor = initresp.versionMajor;
dev->versionMinor = initresp.versionMinor;
dev->capFlags = initresp.capFlags;
}
else
{
return U2FH_TRANSPORT_ERROR;
}
return U2FH_OK;
} | 160 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onDelete | Envoy::Extensions::Common::Wasm::Context::onDelete() | [] | void Context::onDelete() {
if (wasm_->onDelete_) {
wasm_->onDelete_(this, id_);
}
} | 24 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onDone | Envoy::Extensions::Common::Wasm::Context::onDone() | [] | void Context::onDone() {
if (wasm_->onDone_) {
wasm_->onDone_(this, id_);
}
} | 24 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onDownstreamConnectionClose | Envoy::Extensions::Common::Wasm::Context::onDownstreamConnectionClose( PeerType peer_type) | ['peer_type'] | void Context::onDownstreamConnectionClose(PeerType peer_type) {
if (wasm_->onDownstreamConnectionClose_) {
wasm_->onDownstreamConnectionClose_(this, id_, static_cast<uint32_t>(peer_type));
}
} | 34 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onDownstreamData | Envoy::Extensions::Common::Wasm::Context::onDownstreamData( int data_length , bool end_of_stream) | ['data_length', 'end_of_stream'] | Network::FilterStatus Context::onDownstreamData(int data_length, bool end_of_stream) {
if (!wasm_->onDownstreamData_) {
return Network::FilterStatus::Continue;
}
auto result = wasm_->onDownstreamData_(this, id_, static_cast<uint32_t>(data_length),
static_cast<uint32_t>(end_of_stream));
// TODO(PiotrSikora): pull Proxy-WASM's FilterStatus values.
return result.u64_ == 0 ? Network::FilterStatus::Continue : Network::FilterStatus::StopIteration;
} | 75 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onLog | Envoy::Extensions::Common::Wasm::Context::onLog() | [] | void Context::onLog() {
if (wasm_->onLog_) {
wasm_->onLog_(this, id_);
}
} | 24 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onRequestBody | Envoy::Extensions::Common::Wasm::Context::onRequestBody( int body_buffer_length , bool end_of_stream) | ['body_buffer_length', 'end_of_stream'] | Http::FilterDataStatus Context::onRequestBody(int body_buffer_length, bool end_of_stream) {
if (!wasm_->onRequestBody_) {
return Http::FilterDataStatus::Continue;
}
switch (wasm_
->onRequestBody_(this, id_, static_cast<uint32_t>(body_buffer_length),
static_cast<uint32_t>(end_of_stream))
.u64_) {
case 0:
return Http::FilterDataStatus::Continue;
case 1:
return Http::FilterDataStatus::StopIterationAndBuffer;
case 2:
return Http::FilterDataStatus::StopIterationAndWatermark;
default:
return Http::FilterDataStatus::StopIterationNoBuffer;
}
} | 98 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onRequestMetadata | Envoy::Extensions::Common::Wasm::Context::onRequestMetadata() | [] | Http::FilterMetadataStatus Context::onRequestMetadata() {
if (!wasm_->onRequestMetadata_) {
return Http::FilterMetadataStatus::Continue;
}
if (wasm_->onRequestMetadata_(this, id_).u64_ == 0) {
return Http::FilterMetadataStatus::Continue;
}
return Http::FilterMetadataStatus::Continue; // This is currently the only return code.
} | 54 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onRequestTrailers | Envoy::Extensions::Common::Wasm::Context::onRequestTrailers() | [] | Http::FilterTrailersStatus Context::onRequestTrailers() {
if (!wasm_->onRequestTrailers_) {
return Http::FilterTrailersStatus::Continue;
}
if (wasm_->onRequestTrailers_(this, id_).u64_ == 0) {
return Http::FilterTrailersStatus::Continue;
}
return Http::FilterTrailersStatus::StopIteration;
} | 54 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onResponseBody | Envoy::Extensions::Common::Wasm::Context::onResponseBody( int body_buffer_length , bool end_of_stream) | ['body_buffer_length', 'end_of_stream'] | Http::FilterDataStatus Context::onResponseBody(int body_buffer_length, bool end_of_stream) {
if (!wasm_->onResponseBody_) {
return Http::FilterDataStatus::Continue;
}
switch (wasm_
->onResponseBody_(this, id_, static_cast<uint32_t>(body_buffer_length),
static_cast<uint32_t>(end_of_stream))
.u64_) {
case 0:
return Http::FilterDataStatus::Continue;
case 1:
return Http::FilterDataStatus::StopIterationAndBuffer;
case 2:
return Http::FilterDataStatus::StopIterationAndWatermark;
default:
return Http::FilterDataStatus::StopIterationNoBuffer;
}
} | 98 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onResponseMetadata | Envoy::Extensions::Common::Wasm::Context::onResponseMetadata() | [] | Http::FilterMetadataStatus Context::onResponseMetadata() {
if (!wasm_->onResponseMetadata_) {
return Http::FilterMetadataStatus::Continue;
}
if (wasm_->onResponseMetadata_(this, id_).u64_ == 0) {
return Http::FilterMetadataStatus::Continue;
}
return Http::FilterMetadataStatus::Continue; // This is currently the only return code.
} | 54 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onResponseTrailers | Envoy::Extensions::Common::Wasm::Context::onResponseTrailers() | [] | Http::FilterTrailersStatus Context::onResponseTrailers() {
if (!wasm_->onResponseTrailers_) {
return Http::FilterTrailersStatus::Continue;
}
if (wasm_->onResponseTrailers_(this, id_).u64_ == 0) {
return Http::FilterTrailersStatus::Continue;
}
return Http::FilterTrailersStatus::StopIteration;
} | 54 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onUpstreamConnectionClose | Envoy::Extensions::Common::Wasm::Context::onUpstreamConnectionClose( PeerType peer_type) | ['peer_type'] | void Context::onUpstreamConnectionClose(PeerType peer_type) {
if (wasm_->onUpstreamConnectionClose_) {
wasm_->onUpstreamConnectionClose_(this, id_, static_cast<uint32_t>(peer_type));
}
} | 34 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Common::Wasm::Context::onUpstreamData | Envoy::Extensions::Common::Wasm::Context::onUpstreamData( int data_length , bool end_of_stream) | ['data_length', 'end_of_stream'] | Network::FilterStatus Context::onUpstreamData(int data_length, bool end_of_stream) {
if (!wasm_->onUpstreamData_) {
return Network::FilterStatus::Continue;
}
auto result = wasm_->onUpstreamData_(this, id_, static_cast<uint32_t>(data_length),
static_cast<uint32_t>(end_of_stream));
// TODO(PiotrSikora): pull Proxy-WASM's FilterStatus values.
return result.u64_ == 0 ? Network::FilterStatus::Continue : Network::FilterStatus::StopIteration;
} | 75 | True | 1 |
CVE-2020-10739 | 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://istio.io/news/security/istio-security-2020-005/', 'name': 'https://istio.io/news/security/istio-security-2020-005/', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Vendor Advisory']}, {'url': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'name': 'https://github.com/istio/envoy/commit/8788a3cf255b647fd14e6b5e2585abaaedb28153#diff-fcf2cf5dd389b5285f882ba4a8708633', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-10739', 'refsource': 'CONFIRM', 'tags': ['Broken Link', 'Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-476'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.5.0', 'versionEndExcluding': '1.5.4', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:istio:istio:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.4.0', 'versionEndExcluding': '1.4.9', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Istio 1.4.x before 1.4.9 and Istio 1.5.x before 1.5.4 contain the following vulnerability when telemetry v2 is enabled: by sending a specially crafted packet, an attacker could trigger a Null Pointer Exception resulting in a Denial of Service. This could be sent to the ingress gateway or a sidecar, triggering a null pointer exception which results in a denial of service. This also affects servicemesh-proxy where a null pointer exception flaw was found in servicemesh-proxy. When running Telemetry v2 (not on by default in version 1.4.x), an attacker could send a specially crafted packet to the ingress gateway or proxy sidecar, triggering a denial of service.'}] | 2020-06-02T19:26Z | 2020-06-02T13: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 | John Plevyak | 2020-05-08 19:05:05-07:00 | 1.4 - Do not call into the VM unless the VM Context has been created. (#24)
* Ensure that the in VM Context is created before onDone is called.
Signed-off-by: John Plevyak <[email protected]>
* Update as per offline discussion.
Signed-off-by: John Plevyak <[email protected]>
* Set in_vm_context_created_ in onNetworkNewConnection.
Signed-off-by: John Plevyak <[email protected]>
* Add guards to other network calls.
Signed-off-by: John Plevyak <[email protected]>
* Fix common/wasm tests.
Signed-off-by: John Plevyak <[email protected]>
* Patch tests.
Signed-off-by: John Plevyak <[email protected]>
* Remove unecessary file from cherry-pick.
Signed-off-by: John Plevyak <[email protected]> | 8788a3cf255b647fd14e6b5e2585abaaedb28153 | False | istio/envoy | Fork of Envoy used for testing and tinkering as part of the Istio dev process | 2017-10-20 16:25:41 | 2022-08-18 13:46:30 | https://envoyproxy.github.io/ | istio | 33.0 | 54.0 | Envoy::Extensions::Wasm::TEST_P | Envoy::Extensions::Wasm::TEST_P( WasmTest , DivByZero) | ['WasmTest', 'DivByZero'] | TEST_P(WasmTest, DivByZero) {
Stats::IsolatedStoreImpl stats_store;
Api::ApiPtr api = Api::createApiForTest(stats_store);
Upstream::MockClusterManager cluster_manager;
Event::DispatcherPtr dispatcher(api->allocateDispatcher());
auto scope = Stats::ScopeSharedPtr(stats_store.createScope("wasm."));
NiceMock<LocalInfo::MockLocalInfo> local_info;
auto name = "";
auto root_id = "";
auto vm_id = "";
auto vm_configuration = "";
auto plugin = std::make_shared<Extensions::Common::Wasm::Plugin>(
name, root_id, vm_id, envoy::api::v2::core::TrafficDirection::UNSPECIFIED, local_info,
nullptr);
auto wasm = std::make_unique<Extensions::Common::Wasm::Wasm>(
absl::StrCat("envoy.wasm.runtime.", GetParam()), vm_id, vm_configuration, plugin, scope,
cluster_manager, *dispatcher);
EXPECT_NE(wasm, nullptr);
const auto code = TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/wasm/test_data/segv_cpp.wasm"));
EXPECT_FALSE(code.empty());
auto context = std::make_unique<TestContext>(wasm.get());
EXPECT_CALL(*context, scriptLog_(spdlog::level::err, Eq("before div by zero")));
EXPECT_TRUE(wasm->initialize(code, false));
wasm->setContext(context.get());
if (GetParam() == "v8") {
EXPECT_THROW_WITH_MESSAGE(
context->onLog(), Extensions::Common::Wasm::WasmException,
"Function: proxy_onLog failed: Uncaught RuntimeError: divide by zero");
} else if (GetParam() == "wavm") {
EXPECT_THROW_WITH_REGEX(context->onLog(), Extensions::Common::Wasm::WasmException,
"Function: proxy_onLog failed: wavm.integerDivideByZeroOrOverflow.*");
} else {
ASSERT_FALSE(true); // Neither of the above was matched.
}
} | 324 | True | 1 |
CVE-2020-11068 | False | False | False | False | AV:N/AC:L/Au:S/C:P/I:P/A:P | NETWORK | LOW | SINGLE | PARTIAL | PARTIAL | PARTIAL | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 8.8 | HIGH | 2.8 | 5.9 | False | [{'url': 'https://github.com/Lora-net/LoRaMac-node/security/advisories/GHSA-559p-6xgm-fpv9', 'name': 'https://github.com/Lora-net/LoRaMac-node/security/advisories/GHSA-559p-6xgm-fpv9', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Lora-net/LoRaMac-node/commit/e3063a91daa7ad8a687223efa63079f0c24568e4', 'name': 'https://github.com/Lora-net/LoRaMac-node/commit/e3063a91daa7ad8a687223efa63079f0c24568e4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-120'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:semtech:loramac-node:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.4.4', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In LoRaMac-node before 4.4.4, a reception buffer overflow can happen due to the received buffer size not being checked. This has been fixed in 4.4.4.'}] | 2020-07-01T18:38Z | 2020-06-23T17:15Z | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. | A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
| https://cwe.mitre.org/data/definitions/120.html | 0 | Miguel Luis | 2020-04-16 17:05:15+02:00 | Added received buffer size checks. | e3063a91daa7ad8a687223efa63079f0c24568e4 | False | Lora-net/LoRaMac-node | Reference implementation and documentation of a LoRa network node. | 2014-01-29 14:20:23 | 2022-08-08 18:34:12 | null | Lora-net | 1579.0 | 998.0 | ProcessRadioRxDone | ProcessRadioRxDone( void) | ['void'] | static void ProcessRadioRxDone( void )
{
LoRaMacHeader_t macHdr;
ApplyCFListParams_t applyCFList;
GetPhyParams_t getPhy;
PhyParam_t phyParam;
LoRaMacCryptoStatus_t macCryptoStatus = LORAMAC_CRYPTO_ERROR;
LoRaMacMessageData_t macMsgData;
LoRaMacMessageJoinAccept_t macMsgJoinAccept;
uint8_t *payload = RxDoneParams.Payload;
uint16_t size = RxDoneParams.Size;
int16_t rssi = RxDoneParams.Rssi;
int8_t snr = RxDoneParams.Snr;
uint8_t pktHeaderLen = 0;
uint32_t downLinkCounter = 0;
uint32_t address = MacCtx.NvmCtx->DevAddr;
uint8_t multicast = 0;
AddressIdentifier_t addrID = UNICAST_DEV_ADDR;
FCntIdentifier_t fCntID;
MacCtx.McpsConfirm.AckReceived = false;
MacCtx.McpsIndication.Rssi = rssi;
MacCtx.McpsIndication.Snr = snr;
MacCtx.McpsIndication.RxSlot = MacCtx.RxSlot;
MacCtx.McpsIndication.Port = 0;
MacCtx.McpsIndication.Multicast = 0;
MacCtx.McpsIndication.FramePending = 0;
MacCtx.McpsIndication.Buffer = NULL;
MacCtx.McpsIndication.BufferSize = 0;
MacCtx.McpsIndication.RxData = false;
MacCtx.McpsIndication.AckReceived = false;
MacCtx.McpsIndication.DownLinkCounter = 0;
MacCtx.McpsIndication.McpsIndication = MCPS_UNCONFIRMED;
MacCtx.McpsIndication.DevAddress = 0;
MacCtx.McpsIndication.DeviceTimeAnsReceived = false;
Radio.Sleep( );
TimerStop( &MacCtx.RxWindowTimer2 );
// This function must be called even if we are not in class b mode yet.
if( LoRaMacClassBRxBeacon( payload, size ) == true )
{
MacCtx.MlmeIndication.BeaconInfo.Rssi = rssi;
MacCtx.MlmeIndication.BeaconInfo.Snr = snr;
return;
}
// Check if we expect a ping or a multicast slot.
if( MacCtx.NvmCtx->DeviceClass == CLASS_B )
{
if( LoRaMacClassBIsPingExpected( ) == true )
{
LoRaMacClassBSetPingSlotState( PINGSLOT_STATE_CALC_PING_OFFSET );
LoRaMacClassBPingSlotTimerEvent( NULL );
MacCtx.McpsIndication.RxSlot = RX_SLOT_WIN_CLASS_B_PING_SLOT;
}
else if( LoRaMacClassBIsMulticastExpected( ) == true )
{
LoRaMacClassBSetMulticastSlotState( PINGSLOT_STATE_CALC_PING_OFFSET );
LoRaMacClassBMulticastSlotTimerEvent( NULL );
MacCtx.McpsIndication.RxSlot = RX_SLOT_WIN_CLASS_B_MULTICAST_SLOT;
}
}
macHdr.Value = payload[pktHeaderLen++];
switch( macHdr.Bits.MType )
{
case FRAME_TYPE_JOIN_ACCEPT:
macMsgJoinAccept.Buffer = payload;
macMsgJoinAccept.BufSize = size;
// Abort in case if the device isn't joined yet and no rejoin request is ongoing.
if( MacCtx.NvmCtx->NetworkActivation != ACTIVATION_TYPE_NONE )
{
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
return;
}
macCryptoStatus = LoRaMacCryptoHandleJoinAccept( JOIN_REQ, SecureElementGetJoinEui( ), &macMsgJoinAccept );
if( LORAMAC_CRYPTO_SUCCESS == macCryptoStatus )
{
// Network ID
MacCtx.NvmCtx->NetID = ( uint32_t ) macMsgJoinAccept.NetID[0];
MacCtx.NvmCtx->NetID |= ( ( uint32_t ) macMsgJoinAccept.NetID[1] << 8 );
MacCtx.NvmCtx->NetID |= ( ( uint32_t ) macMsgJoinAccept.NetID[2] << 16 );
// Device Address
MacCtx.NvmCtx->DevAddr = macMsgJoinAccept.DevAddr;
// DLSettings
MacCtx.NvmCtx->MacParams.Rx1DrOffset = macMsgJoinAccept.DLSettings.Bits.RX1DRoffset;
MacCtx.NvmCtx->MacParams.Rx2Channel.Datarate = macMsgJoinAccept.DLSettings.Bits.RX2DataRate;
MacCtx.NvmCtx->MacParams.RxCChannel.Datarate = macMsgJoinAccept.DLSettings.Bits.RX2DataRate;
// RxDelay
MacCtx.NvmCtx->MacParams.ReceiveDelay1 = macMsgJoinAccept.RxDelay;
if( MacCtx.NvmCtx->MacParams.ReceiveDelay1 == 0 )
{
MacCtx.NvmCtx->MacParams.ReceiveDelay1 = 1;
}
MacCtx.NvmCtx->MacParams.ReceiveDelay1 *= 1000;
MacCtx.NvmCtx->MacParams.ReceiveDelay2 = MacCtx.NvmCtx->MacParams.ReceiveDelay1 + 1000;
MacCtx.NvmCtx->Version.Fields.Minor = 0;
// Apply CF list
applyCFList.Payload = macMsgJoinAccept.CFList;
// Size of the regular payload is 12. Plus 1 byte MHDR and 4 bytes MIC
applyCFList.Size = size - 17;
RegionApplyCFList( MacCtx.NvmCtx->Region, &applyCFList );
MacCtx.NvmCtx->NetworkActivation = ACTIVATION_TYPE_OTAA;
// MLME handling
if( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true )
{
LoRaMacConfirmQueueSetStatus( LORAMAC_EVENT_INFO_STATUS_OK, MLME_JOIN );
}
}
else
{
// MLME handling
if( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true )
{
LoRaMacConfirmQueueSetStatus( LORAMAC_EVENT_INFO_STATUS_JOIN_FAIL, MLME_JOIN );
}
}
break;
case FRAME_TYPE_DATA_CONFIRMED_DOWN:
MacCtx.McpsIndication.McpsIndication = MCPS_CONFIRMED;
// Intentional fall through
case FRAME_TYPE_DATA_UNCONFIRMED_DOWN:
// Check if the received payload size is valid
getPhy.UplinkDwellTime = MacCtx.NvmCtx->MacParams.DownlinkDwellTime;
getPhy.Datarate = MacCtx.McpsIndication.RxDatarate;
getPhy.Attribute = PHY_MAX_PAYLOAD;
phyParam = RegionGetPhyParam( MacCtx.NvmCtx->Region, &getPhy );
if( MAX( 0, ( int16_t )( ( int16_t ) size - ( int16_t ) LORA_MAC_FRMPAYLOAD_OVERHEAD ) ) > ( int16_t )phyParam.Value )
{
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
return;
}
macMsgData.Buffer = payload;
macMsgData.BufSize = size;
macMsgData.FRMPayload = MacCtx.RxPayload;
macMsgData.FRMPayloadSize = LORAMAC_PHY_MAXPAYLOAD;
if( LORAMAC_PARSER_SUCCESS != LoRaMacParserData( &macMsgData ) )
{
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
return;
}
// Store device address
MacCtx.McpsIndication.DevAddress = macMsgData.FHDR.DevAddr;
FType_t fType;
if( LORAMAC_STATUS_OK != DetermineFrameType( &macMsgData, &fType ) )
{
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
return;
}
//Check if it is a multicast message
multicast = 0;
downLinkCounter = 0;
for( uint8_t i = 0; i < LORAMAC_MAX_MC_CTX; i++ )
{
if( ( MacCtx.NvmCtx->MulticastChannelList[i].ChannelParams.Address == macMsgData.FHDR.DevAddr ) &&
( MacCtx.NvmCtx->MulticastChannelList[i].ChannelParams.IsEnabled == true ) )
{
multicast = 1;
addrID = MacCtx.NvmCtx->MulticastChannelList[i].ChannelParams.GroupID;
downLinkCounter = *( MacCtx.NvmCtx->MulticastChannelList[i].DownLinkCounter );
address = MacCtx.NvmCtx->MulticastChannelList[i].ChannelParams.Address;
if( MacCtx.NvmCtx->DeviceClass == CLASS_C )
{
MacCtx.McpsIndication.RxSlot = RX_SLOT_WIN_CLASS_C_MULTICAST;
}
break;
}
}
// Filter messages according to multicast downlink exceptions
if( ( multicast == 1 ) && ( ( fType != FRAME_TYPE_D ) ||
( macMsgData.FHDR.FCtrl.Bits.Ack == true ) ||
( macMsgData.FHDR.FCtrl.Bits.AdrAckReq == true ) ) )
{
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
return;
}
// Get maximum allowed counter difference
getPhy.Attribute = PHY_MAX_FCNT_GAP;
phyParam = RegionGetPhyParam( MacCtx.NvmCtx->Region, &getPhy );
// Get downlink frame counter value
macCryptoStatus = GetFCntDown( addrID, fType, &macMsgData, MacCtx.NvmCtx->Version, phyParam.Value, &fCntID, &downLinkCounter );
if( macCryptoStatus != LORAMAC_CRYPTO_SUCCESS )
{
if( macCryptoStatus == LORAMAC_CRYPTO_FAIL_FCNT_DUPLICATED )
{
// Catch the case of repeated downlink frame counter
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_DOWNLINK_REPEATED;
if( ( MacCtx.NvmCtx->Version.Fields.Minor == 0 ) && ( macHdr.Bits.MType == FRAME_TYPE_DATA_CONFIRMED_DOWN ) && ( MacCtx.NvmCtx->LastRxMic == macMsgData.MIC ) )
{
MacCtx.NvmCtx->SrvAckRequested = true;
}
}
else if( macCryptoStatus == LORAMAC_CRYPTO_FAIL_MAX_GAP_FCNT )
{
// Lost too many frames
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_DOWNLINK_TOO_MANY_FRAMES_LOSS;
}
else
{
// Other errors
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
}
MacCtx.McpsIndication.DownLinkCounter = downLinkCounter;
PrepareRxDoneAbort( );
return;
}
macCryptoStatus = LoRaMacCryptoUnsecureMessage( addrID, address, fCntID, downLinkCounter, &macMsgData );
if( macCryptoStatus != LORAMAC_CRYPTO_SUCCESS )
{
if( macCryptoStatus == LORAMAC_CRYPTO_FAIL_ADDRESS )
{
// We are not the destination of this frame.
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ADDRESS_FAIL;
}
else
{
// MIC calculation fail
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_MIC_FAIL;
}
PrepareRxDoneAbort( );
return;
}
// Frame is valid
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_OK;
MacCtx.McpsIndication.Multicast = multicast;
MacCtx.McpsIndication.FramePending = macMsgData.FHDR.FCtrl.Bits.FPending;
MacCtx.McpsIndication.Buffer = NULL;
MacCtx.McpsIndication.BufferSize = 0;
MacCtx.McpsIndication.DownLinkCounter = downLinkCounter;
MacCtx.McpsIndication.AckReceived = macMsgData.FHDR.FCtrl.Bits.Ack;
MacCtx.McpsConfirm.Status = LORAMAC_EVENT_INFO_STATUS_OK;
MacCtx.McpsConfirm.AckReceived = macMsgData.FHDR.FCtrl.Bits.Ack;
// Reset ADR ACK Counter only, when RX1 or RX2 slot
if( ( MacCtx.McpsIndication.RxSlot == RX_SLOT_WIN_1 ) ||
( MacCtx.McpsIndication.RxSlot == RX_SLOT_WIN_2 ) )
{
MacCtx.NvmCtx->AdrAckCounter = 0;
}
// MCPS Indication and ack requested handling
if( multicast == 1 )
{
MacCtx.McpsIndication.McpsIndication = MCPS_MULTICAST;
}
else
{
if( macHdr.Bits.MType == FRAME_TYPE_DATA_CONFIRMED_DOWN )
{
MacCtx.NvmCtx->SrvAckRequested = true;
if( MacCtx.NvmCtx->Version.Fields.Minor == 0 )
{
MacCtx.NvmCtx->LastRxMic = macMsgData.MIC;
}
MacCtx.McpsIndication.McpsIndication = MCPS_CONFIRMED;
}
else
{
MacCtx.NvmCtx->SrvAckRequested = false;
MacCtx.McpsIndication.McpsIndication = MCPS_UNCONFIRMED;
}
}
RemoveMacCommands( MacCtx.McpsIndication.RxSlot, macMsgData.FHDR.FCtrl, MacCtx.McpsConfirm.McpsRequest );
switch( fType )
{
case FRAME_TYPE_A:
{ /* +----------+------+-------+--------------+
* | FOptsLen | Fopt | FPort | FRMPayload |
* +----------+------+-------+--------------+
* | > 0 | X | > 0 | X |
* +----------+------+-------+--------------+
*/
// Decode MAC commands in FOpts field
ProcessMacCommands( macMsgData.FHDR.FOpts, 0, macMsgData.FHDR.FCtrl.Bits.FOptsLen, snr, MacCtx.McpsIndication.RxSlot );
MacCtx.McpsIndication.Port = macMsgData.FPort;
MacCtx.McpsIndication.Buffer = macMsgData.FRMPayload;
MacCtx.McpsIndication.BufferSize = macMsgData.FRMPayloadSize;
MacCtx.McpsIndication.RxData = true;
break;
}
case FRAME_TYPE_B:
{ /* +----------+------+-------+--------------+
* | FOptsLen | Fopt | FPort | FRMPayload |
* +----------+------+-------+--------------+
* | > 0 | X | - | - |
* +----------+------+-------+--------------+
*/
// Decode MAC commands in FOpts field
ProcessMacCommands( macMsgData.FHDR.FOpts, 0, macMsgData.FHDR.FCtrl.Bits.FOptsLen, snr, MacCtx.McpsIndication.RxSlot );
MacCtx.McpsIndication.Port = macMsgData.FPort;
break;
}
case FRAME_TYPE_C:
{ /* +----------+------+-------+--------------+
* | FOptsLen | Fopt | FPort | FRMPayload |
* +----------+------+-------+--------------+
* | = 0 | - | = 0 | MAC commands |
* +----------+------+-------+--------------+
*/
// Decode MAC commands in FRMPayload
ProcessMacCommands( macMsgData.FRMPayload, 0, macMsgData.FRMPayloadSize, snr, MacCtx.McpsIndication.RxSlot );
MacCtx.McpsIndication.Port = macMsgData.FPort;
break;
}
case FRAME_TYPE_D:
{ /* +----------+------+-------+--------------+
* | FOptsLen | Fopt | FPort | FRMPayload |
* +----------+------+-------+--------------+
* | = 0 | - | > 0 | X |
* +----------+------+-------+--------------+
*/
// No MAC commands just application payload
MacCtx.McpsIndication.Port = macMsgData.FPort;
MacCtx.McpsIndication.Buffer = macMsgData.FRMPayload;
MacCtx.McpsIndication.BufferSize = macMsgData.FRMPayloadSize;
MacCtx.McpsIndication.RxData = true;
break;
}
default:
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
break;
}
// Provide always an indication, skip the callback to the user application,
// in case of a confirmed downlink retransmission.
MacCtx.MacFlags.Bits.McpsInd = 1;
break;
case FRAME_TYPE_PROPRIETARY:
memcpy1( MacCtx.RxPayload, &payload[pktHeaderLen], size - pktHeaderLen );
MacCtx.McpsIndication.McpsIndication = MCPS_PROPRIETARY;
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_OK;
MacCtx.McpsIndication.Buffer = MacCtx.RxPayload;
MacCtx.McpsIndication.BufferSize = size - pktHeaderLen;
MacCtx.MacFlags.Bits.McpsInd = 1;
break;
default:
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
break;
}
// Verify if we need to disable the AckTimeoutTimer
if( MacCtx.NodeAckRequested == true )
{
if( MacCtx.McpsConfirm.AckReceived == true )
{
OnAckTimeoutTimerEvent( NULL );
}
}
else
{
if( MacCtx.NvmCtx->DeviceClass == CLASS_C )
{
OnAckTimeoutTimerEvent( NULL );
}
}
MacCtx.MacFlags.Bits.MacDone = 1;
UpdateRxSlotIdleState( );
}
| 1924 | True | 1 |
CVE-2021-41136 | False | False | False | True | AV:N/AC:H/Au:S/C:P/I:P/A:N | NETWORK | HIGH | SINGLE | PARTIAL | PARTIAL | NONE | 3.6 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N | NETWORK | HIGH | LOW | REQUIRED | UNCHANGED | LOW | LOW | NONE | 3.7 | LOW | 1.2 | 2.5 | False | [{'url': 'https://github.com/puma/puma/security/advisories/GHSA-48w2-rm65-62xx', 'name': 'https://github.com/puma/puma/security/advisories/GHSA-48w2-rm65-62xx', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/puma/puma/commit/acdc3ae571dfae0e045cf09a295280127db65c7f', 'name': 'https://github.com/puma/puma/commit/acdc3ae571dfae0e045cf09a295280127db65c7f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2022/dsa-5146', 'name': 'DSA-5146', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202208-28', 'name': 'GLSA-202208-28', 'refsource': 'GENTOO', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-444'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:puma:puma:*:*:*:*:*:ruby:*:*', 'versionEndIncluding': '4.3.8', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:puma:puma:*:*:*:*:*:ruby:*:*', 'versionStartIncluding': '5.0.0', 'versionEndIncluding': '5.5.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Puma is a HTTP 1.1 server for Ruby/Rack applications. Prior to versions 5.5.1 and 4.3.9, using `puma` with a proxy which forwards HTTP header values which contain the LF character could allow HTTP request smugggling. A client could smuggle a request through a proxy, causing the proxy to send a response back to another unknown client. The only proxy which has this behavior, as far as the Puma team is aware of, is Apache Traffic Server. If the proxy uses persistent connections and the client adds another request in via HTTP pipelining, the proxy may mistake it as the first request's body. Puma, however, would see it as two requests, and when processing the second request, send back a response that the proxy does not expect. If the proxy has reused the persistent connection to Puma to send another request for a different client, the second response from the first client will be sent to the second client. This vulnerability was patched in Puma 5.5.1 and 4.3.9. As a workaround, do not use Apache Traffic Server with `puma`."}] | 2022-08-15T11:15Z | 2021-10-12T16:15Z | Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') | The product acts as an intermediary HTTP agent
(such as a proxy or firewall) in the data flow between two
entities such as a client and server, but it does not
interpret malformed HTTP requests or responses in ways that
are consistent with how the messages will be processed by
those entities that are at the ultimate destination. |
HTTP requests or responses ("messages") can be
malformed or unexpected in ways that cause web servers or
clients to interpret the messages in different ways than
intermediary HTTP agents such as load balancers, reverse
proxies, web caching proxies, application firewalls,
etc. For example, an adversary may be able to add duplicate
or different header fields that a client or server might
interpret as one set of messages, whereas the intermediary
might interpret the same sequence of bytes as a different
set of messages. For example, discrepancies can arise in
how to handle duplicate headers like two Transfer-encoding
(TE) or two Content-length (CL), or the malicious HTTP
message will have different headers for TE and
CL.
The inconsistent parsing and interpretation of messages
can allow the adversary to "smuggle" a message to the
client/server without the intermediary being aware of it.
This weakness is usually the result of the usage
of outdated or incompatible HTTP protocol versions in the
HTTP agents.
| https://cwe.mitre.org/data/definitions/444.html | 0 | Nate Berkopec | 2021-10-12 08:38:40-06:00 | Merge pull request from GHSA-48w2-rm65-62xx
* Fix HTTP request smuggling vulnerability
See GHSA-48w2-rm65-62xx or CVE-2021-41136 for more info.
* 4.3.9 release note
* 5.5.1 release note
* 5.5.1 | acdc3ae571dfae0e045cf09a295280127db65c7f | False | puma/puma | A Ruby/Rack web server built for parallelism | 2011-09-23 02:26:08 | 2022-08-27 21:14:26 | https://puma.io | puma | 7128.0 | 1334.0 | puma_parser_execute | puma_parser_execute( puma_parser * parser , const char * buffer , size_t len , size_t off) | ['parser', 'buffer', 'len', 'off'] | size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len, size_t off) {
const char *p, *pe;
int cs = parser->cs;
assert(off <= len && "offset past end of buffer");
p = buffer+off;
pe = buffer+len;
/* assert(*pe == '\0' && "pointer does not end on NUL"); */
assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
#line 87 "ext/puma_http11/http11_parser.c"
{
if ( p == pe )
goto _test_eof;
switch ( cs )
{
case 1:
switch( (*p) ) {
case 36: goto tr0;
case 95: goto tr0;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto tr0;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto tr0;
} else
goto tr0;
goto st0;
st0:
cs = 0;
goto _out;
tr0:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st2;
st2:
if ( ++p == pe )
goto _test_eof2;
case 2:
#line 118 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st27;
case 95: goto st27;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st27;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st27;
} else
goto st27;
goto st0;
tr2:
#line 50 "ext/puma_http11/http11_parser.rl"
{
parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
}
goto st3;
st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
#line 143 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 42: goto tr4;
case 43: goto tr5;
case 47: goto tr6;
case 58: goto tr7;
}
if ( (*p) < 65 ) {
if ( 45 <= (*p) && (*p) <= 57 )
goto tr5;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr5;
} else
goto tr5;
goto st0;
tr4:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
#line 167 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr8;
case 35: goto tr9;
}
goto st0;
tr8:
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr31:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
#line 56 "ext/puma_http11/http11_parser.rl"
{
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr33:
#line 56 "ext/puma_http11/http11_parser.rl"
{
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr37:
#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr41:
#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr44:
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
st5:
if ( ++p == pe )
goto _test_eof5;
case 5:
#line 229 "ext/puma_http11/http11_parser.c"
if ( (*p) == 72 )
goto tr10;
goto st0;
tr10:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st6;
st6:
if ( ++p == pe )
goto _test_eof6;
case 6:
#line 241 "ext/puma_http11/http11_parser.c"
if ( (*p) == 84 )
goto st7;
goto st0;
st7:
if ( ++p == pe )
goto _test_eof7;
case 7:
if ( (*p) == 84 )
goto st8;
goto st0;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
if ( (*p) == 80 )
goto st9;
goto st0;
st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
if ( (*p) == 47 )
goto st10;
goto st0;
st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
if ( 48 <= (*p) && (*p) <= 57 )
goto st11;
goto st0;
st11:
if ( ++p == pe )
goto _test_eof11;
case 11:
if ( (*p) == 46 )
goto st12;
if ( 48 <= (*p) && (*p) <= 57 )
goto st11;
goto st0;
st12:
if ( ++p == pe )
goto _test_eof12;
case 12:
if ( 48 <= (*p) && (*p) <= 57 )
goto st13;
goto st0;
st13:
if ( ++p == pe )
goto _test_eof13;
case 13:
if ( (*p) == 13 )
goto tr18;
if ( 48 <= (*p) && (*p) <= 57 )
goto st13;
goto st0;
tr18:
#line 65 "ext/puma_http11/http11_parser.rl"
{
parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
}
goto st14;
tr26:
#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
#line 47 "ext/puma_http11/http11_parser.rl"
{
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
}
goto st14;
tr29:
#line 47 "ext/puma_http11/http11_parser.rl"
{
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
}
goto st14;
st14:
if ( ++p == pe )
goto _test_eof14;
case 14:
#line 322 "ext/puma_http11/http11_parser.c"
if ( (*p) == 10 )
goto st15;
goto st0;
st15:
if ( ++p == pe )
goto _test_eof15;
case 15:
switch( (*p) ) {
case 13: goto st16;
case 33: goto tr21;
case 124: goto tr21;
case 126: goto tr21;
}
if ( (*p) < 45 ) {
if ( (*p) > 39 ) {
if ( 42 <= (*p) && (*p) <= 43 )
goto tr21;
} else if ( (*p) >= 35 )
goto tr21;
} else if ( (*p) > 46 ) {
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr21;
} else if ( (*p) > 90 ) {
if ( 94 <= (*p) && (*p) <= 122 )
goto tr21;
} else
goto tr21;
} else
goto tr21;
goto st0;
st16:
if ( ++p == pe )
goto _test_eof16;
case 16:
if ( (*p) == 10 )
goto tr22;
goto st0;
tr22:
#line 73 "ext/puma_http11/http11_parser.rl"
{
parser->body_start = p - buffer + 1;
parser->header_done(parser, p + 1, pe - p - 1);
{p++; cs = 46; goto _out;}
}
goto st46;
st46:
if ( ++p == pe )
goto _test_eof46;
case 46:
#line 373 "ext/puma_http11/http11_parser.c"
goto st0;
tr21:
#line 40 "ext/puma_http11/http11_parser.rl"
{ MARK(field_start, p); }
#line 41 "ext/puma_http11/http11_parser.rl"
{ snake_upcase_char((char *)p); }
goto st17;
tr23:
#line 41 "ext/puma_http11/http11_parser.rl"
{ snake_upcase_char((char *)p); }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
#line 389 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 33: goto tr23;
case 58: goto tr24;
case 124: goto tr23;
case 126: goto tr23;
}
if ( (*p) < 45 ) {
if ( (*p) > 39 ) {
if ( 42 <= (*p) && (*p) <= 43 )
goto tr23;
} else if ( (*p) >= 35 )
goto tr23;
} else if ( (*p) > 46 ) {
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr23;
} else if ( (*p) > 90 ) {
if ( 94 <= (*p) && (*p) <= 122 )
goto tr23;
} else
goto tr23;
} else
goto tr23;
goto st0;
tr24:
#line 42 "ext/puma_http11/http11_parser.rl"
{
parser->field_len = LEN(field_start, p);
}
goto st18;
tr27:
#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st18;
st18:
if ( ++p == pe )
goto _test_eof18;
case 18:
#line 428 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 13: goto tr26;
case 32: goto tr27;
}
goto tr25;
tr25:
#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st19;
st19:
if ( ++p == pe )
goto _test_eof19;
case 19:
#line 442 "ext/puma_http11/http11_parser.c"
if ( (*p) == 13 )
goto tr29;
goto st19;
tr9:
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr38:
#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr42:
#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr45:
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
st20:
if ( ++p == pe )
goto _test_eof20;
case 20:
#line 488 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr31;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( (*p) > 31 ) {
if ( 34 <= (*p) && (*p) <= 35 )
goto st0;
} else if ( (*p) >= 0 )
goto st0;
goto tr30;
tr30:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st21;
st21:
if ( ++p == pe )
goto _test_eof21;
case 21:
#line 509 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr33;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( (*p) > 31 ) {
if ( 34 <= (*p) && (*p) <= 35 )
goto st0;
} else if ( (*p) >= 0 )
goto st0;
goto st21;
tr5:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st22;
st22:
if ( ++p == pe )
goto _test_eof22;
case 22:
#line 530 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 43: goto st22;
case 58: goto st23;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st22;
} else if ( (*p) > 57 ) {
if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto st22;
} else if ( (*p) >= 65 )
goto st22;
} else
goto st22;
goto st0;
tr7:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st23;
st23:
if ( ++p == pe )
goto _test_eof23;
case 23:
#line 555 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr8;
case 34: goto st0;
case 35: goto tr9;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st23;
tr6:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st24;
st24:
if ( ++p == pe )
goto _test_eof24;
case 24:
#line 575 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr37;
case 34: goto st0;
case 35: goto tr38;
case 60: goto st0;
case 62: goto st0;
case 63: goto tr39;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st24;
tr39:
#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
goto st25;
st25:
if ( ++p == pe )
goto _test_eof25;
case 25:
#line 598 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr41;
case 34: goto st0;
case 35: goto tr42;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto tr40;
tr40:
#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
goto st26;
st26:
if ( ++p == pe )
goto _test_eof26;
case 26:
#line 618 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr44;
case 34: goto st0;
case 35: goto tr45;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st26;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st28;
case 95: goto st28;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st28;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st28;
} else
goto st28;
goto st0;
st28:
if ( ++p == pe )
goto _test_eof28;
case 28:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st29;
case 95: goto st29;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st29;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st29;
} else
goto st29;
goto st0;
st29:
if ( ++p == pe )
goto _test_eof29;
case 29:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st30;
case 95: goto st30;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st30;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st30;
} else
goto st30;
goto st0;
st30:
if ( ++p == pe )
goto _test_eof30;
case 30:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st31;
case 95: goto st31;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st31;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st31;
} else
goto st31;
goto st0;
st31:
if ( ++p == pe )
goto _test_eof31;
case 31:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st32;
case 95: goto st32;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st32;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st32;
} else
goto st32;
goto st0;
st32:
if ( ++p == pe )
goto _test_eof32;
case 32:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st33;
case 95: goto st33;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st33;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st33;
} else
goto st33;
goto st0;
st33:
if ( ++p == pe )
goto _test_eof33;
case 33:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st34;
case 95: goto st34;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st34;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st34;
} else
goto st34;
goto st0;
st34:
if ( ++p == pe )
goto _test_eof34;
case 34:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st35;
case 95: goto st35;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st35;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st35;
} else
goto st35;
goto st0;
st35:
if ( ++p == pe )
goto _test_eof35;
case 35:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st36;
case 95: goto st36;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st36;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st36;
} else
goto st36;
goto st0;
st36:
if ( ++p == pe )
goto _test_eof36;
case 36:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st37;
case 95: goto st37;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st37;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st37;
} else
goto st37;
goto st0;
st37:
if ( ++p == pe )
goto _test_eof37;
case 37:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st38;
case 95: goto st38;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st38;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st38;
} else
goto st38;
goto st0;
st38:
if ( ++p == pe )
goto _test_eof38;
case 38:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st39;
case 95: goto st39;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st39;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st39;
} else
goto st39;
goto st0;
st39:
if ( ++p == pe )
goto _test_eof39;
case 39:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st40;
case 95: goto st40;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st40;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st40;
} else
goto st40;
goto st0;
st40:
if ( ++p == pe )
goto _test_eof40;
case 40:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st41;
case 95: goto st41;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st41;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st41;
} else
goto st41;
goto st0;
st41:
if ( ++p == pe )
goto _test_eof41;
case 41:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st42;
case 95: goto st42;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st42;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st42;
} else
goto st42;
goto st0;
st42:
if ( ++p == pe )
goto _test_eof42;
case 42:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st43;
case 95: goto st43;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st43;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st43;
} else
goto st43;
goto st0;
st43:
if ( ++p == pe )
goto _test_eof43;
case 43:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st44;
case 95: goto st44;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st44;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st44;
} else
goto st44;
goto st0;
st44:
if ( ++p == pe )
goto _test_eof44;
case 44:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st45;
case 95: goto st45;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st45;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st45;
} else
goto st45;
goto st0;
st45:
if ( ++p == pe )
goto _test_eof45;
case 45:
if ( (*p) == 32 )
goto tr2;
goto st0;
}
_test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof;
_test_eof11: cs = 11; goto _test_eof;
_test_eof12: cs = 12; goto _test_eof;
_test_eof13: cs = 13; goto _test_eof;
_test_eof14: cs = 14; goto _test_eof;
_test_eof15: cs = 15; goto _test_eof;
_test_eof16: cs = 16; goto _test_eof;
_test_eof46: cs = 46; goto _test_eof;
_test_eof17: cs = 17; goto _test_eof;
_test_eof18: cs = 18; goto _test_eof;
_test_eof19: cs = 19; goto _test_eof;
_test_eof20: cs = 20; goto _test_eof;
_test_eof21: cs = 21; goto _test_eof;
_test_eof22: cs = 22; goto _test_eof;
_test_eof23: cs = 23; goto _test_eof;
_test_eof24: cs = 24; goto _test_eof;
_test_eof25: cs = 25; goto _test_eof;
_test_eof26: cs = 26; goto _test_eof;
_test_eof27: cs = 27; goto _test_eof;
_test_eof28: cs = 28; goto _test_eof;
_test_eof29: cs = 29; goto _test_eof;
_test_eof30: cs = 30; goto _test_eof;
_test_eof31: cs = 31; goto _test_eof;
_test_eof32: cs = 32; goto _test_eof;
_test_eof33: cs = 33; goto _test_eof;
_test_eof34: cs = 34; goto _test_eof;
_test_eof35: cs = 35; goto _test_eof;
_test_eof36: cs = 36; goto _test_eof;
_test_eof37: cs = 37; goto _test_eof;
_test_eof38: cs = 38; goto _test_eof;
_test_eof39: cs = 39; goto _test_eof;
_test_eof40: cs = 40; goto _test_eof;
_test_eof41: cs = 41; goto _test_eof;
_test_eof42: cs = 42; goto _test_eof;
_test_eof43: cs = 43; goto _test_eof;
_test_eof44: cs = 44; goto _test_eof;
_test_eof45: cs = 45; goto _test_eof;
_test_eof: {}
_out: {}
}
#line 117 "ext/puma_http11/http11_parser.rl"
if (!puma_parser_has_error(parser))
parser->cs = cs;
parser->nread += p - (buffer + off);
assert(p <= pe && "buffer overflow after parsing execute");
assert(parser->nread <= len && "nread longer than length");
assert(parser->body_start <= len && "body starts after buffer end");
assert(parser->mark < len && "mark is after buffer end");
assert(parser->field_len <= len && "field has length longer than whole buffer");
assert(parser->field_start < len && "field starts after buffer end");
return(parser->nread);
} | 5282 | True | 1 |
CVE-2020-26273 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:N | LOCAL | LOW | NONE | PARTIAL | PARTIAL | NONE | 3.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N | LOCAL | LOW | LOW | NONE | CHANGED | LOW | LOW | NONE | 5.2 | MEDIUM | 2.0 | 2.7 | False | [{'url': 'https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#remote-command-execution-using-sqlite-command---load_extension', 'name': 'https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#remote-command-execution-using-sqlite-command---load_extension', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/osquery/osquery/commit/c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c', 'name': 'https://github.com/osquery/osquery/commit/c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/osquery/osquery/security/advisories/GHSA-4g56-2482-x7q8', 'name': 'https://github.com/osquery/osquery/security/advisories/GHSA-4g56-2482-x7q8', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/osquery/osquery/releases/tag/4.6.0', 'name': 'https://github.com/osquery/osquery/releases/tag/4.6.0', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-77'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:linuxfoundation:osquery:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.6.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "osquery is a SQL powered operating system instrumentation, monitoring, and analytics framework. In osquery before version 4.6.0, by using sqlite's ATTACH verb, someone with administrative access to osquery can cause reads and writes to arbitrary sqlite databases on disk. This _does_ allow arbitrary files to be created, but they will be sqlite databases. It does not appear to allow existing non-sqlite files to be overwritten. This has been patched in osquery 4.6.0. There are several mitigating factors and possible workarounds. In some deployments, the people with access to these interfaces may be considered administrators. In some deployments, configuration is managed by a central tool. This tool can filter for the `ATTACH` keyword. osquery can be run as non-root user. Because this also limits the desired access levels, this requires deployment specific testing and configuration."}] | 2020-12-18T15:59Z | 2020-12-16T02:15Z | Improper Neutralization of Special Elements used in a Command ('Command Injection') | The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. |
Command injection vulnerabilities typically occur when:
1. Data enters the application from an untrusted source.
2. The data is part of a string that is executed as a command by the application.
3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.
Many protocols and products have their own custom command language. While OS or shell command strings are frequently discovered and targeted, developers may not realize that these other command languages might also be vulnerable to attacks.
Command injection is a common problem with wrapper programs.
| https://cwe.mitre.org/data/definitions/77.html | 0 | Zach Wasserman | 2020-12-14 20:41:57+00:00 | Merge pull request from GHSA-4g56-2482-x7q8
* Proposed fix for attach tables vulnerability
* Add authorizer to ATC tables and cleanups
- Add unit test for authorizer function | c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c | False | osquery/osquery | SQL powered operating system instrumentation, monitoring, and analytics. | 2014-07-29 20:27:33 | 2022-08-24 19:01:28 | https://osquery.io | osquery | 19197.0 | 2338.0 | osquery::TEST_F | osquery::TEST_F( SQLiteUtilTests , test_column_type_determination) | ['SQLiteUtilTests', 'test_column_type_determination'] | TEST_F(SQLiteUtilTests, test_column_type_determination) {
// Correct identification of text and ints
testTypesExpected("select path, inode from file where path like '%'",
TypeMap({{"path", TEXT_TYPE}, {"inode", INTEGER_TYPE}}));
// Correctly treating BLOBs as text
testTypesExpected("select CAST(seconds AS BLOB) as seconds FROM time",
TypeMap({{"seconds", TEXT_TYPE}}));
// Correctly treating ints cast as double as doubles
testTypesExpected("select CAST(seconds AS DOUBLE) as seconds FROM time",
TypeMap({{"seconds", DOUBLE_TYPE}}));
// Correctly treating bools as ints
testTypesExpected("select CAST(seconds AS BOOLEAN) as seconds FROM time",
TypeMap({{"seconds", INTEGER_TYPE}}));
// Correctly recognizing values from columns declared double as double, even
// if they happen to have integer value. And also test multi-statement
// queries.
testTypesExpected(
"CREATE TABLE test_types_table (username varchar(30) primary key, age "
"double);INSERT INTO test_types_table VALUES (\"mike\", 23); SELECT age "
"from test_types_table",
TypeMap({{"age", DOUBLE_TYPE}}));
} | 96 | True | 1 |
CVE-2020-26273 | False | False | False | False | AV:L/AC:L/Au:N/C:P/I:P/A:N | LOCAL | LOW | NONE | PARTIAL | PARTIAL | NONE | 3.6 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N | LOCAL | LOW | LOW | NONE | CHANGED | LOW | LOW | NONE | 5.2 | MEDIUM | 2.0 | 2.7 | False | [{'url': 'https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#remote-command-execution-using-sqlite-command---load_extension', 'name': 'https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/SQLite%20Injection.md#remote-command-execution-using-sqlite-command---load_extension', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/osquery/osquery/commit/c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c', 'name': 'https://github.com/osquery/osquery/commit/c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/osquery/osquery/security/advisories/GHSA-4g56-2482-x7q8', 'name': 'https://github.com/osquery/osquery/security/advisories/GHSA-4g56-2482-x7q8', 'refsource': 'CONFIRM', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/osquery/osquery/releases/tag/4.6.0', 'name': 'https://github.com/osquery/osquery/releases/tag/4.6.0', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-77'}]}] | LOW | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:linuxfoundation:osquery:*:*:*:*:*:*:*:*', 'versionEndExcluding': '4.6.0', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "osquery is a SQL powered operating system instrumentation, monitoring, and analytics framework. In osquery before version 4.6.0, by using sqlite's ATTACH verb, someone with administrative access to osquery can cause reads and writes to arbitrary sqlite databases on disk. This _does_ allow arbitrary files to be created, but they will be sqlite databases. It does not appear to allow existing non-sqlite files to be overwritten. This has been patched in osquery 4.6.0. There are several mitigating factors and possible workarounds. In some deployments, the people with access to these interfaces may be considered administrators. In some deployments, configuration is managed by a central tool. This tool can filter for the `ATTACH` keyword. osquery can be run as non-root user. Because this also limits the desired access levels, this requires deployment specific testing and configuration."}] | 2020-12-18T15:59Z | 2020-12-16T02:15Z | Improper Neutralization of Special Elements used in a Command ('Command Injection') | The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. |
Command injection vulnerabilities typically occur when:
1. Data enters the application from an untrusted source.
2. The data is part of a string that is executed as a command by the application.
3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.
Many protocols and products have their own custom command language. While OS or shell command strings are frequently discovered and targeted, developers may not realize that these other command languages might also be vulnerable to attacks.
Command injection is a common problem with wrapper programs.
| https://cwe.mitre.org/data/definitions/77.html | 0 | Zach Wasserman | 2020-12-14 20:41:57+00:00 | Merge pull request from GHSA-4g56-2482-x7q8
* Proposed fix for attach tables vulnerability
* Add authorizer to ATC tables and cleanups
- Add unit test for authorizer function | c3f9a3dae22d43ed3b4f6a403cbf89da4cba7c3c | False | osquery/osquery | SQL powered operating system instrumentation, monitoring, and analytics. | 2014-07-29 20:27:33 | 2022-08-24 19:01:28 | https://osquery.io | osquery | 19197.0 | 2338.0 | osquery::getTestDBC | osquery::getTestDBC() | [] | std::shared_ptr<SQLiteDBInstance> getTestDBC() {
auto dbc = SQLiteDBManager::getUnique();
char* err = nullptr;
std::vector<std::string> queries = {
"CREATE TABLE test_table (username varchar(30) primary key, age int)",
"INSERT INTO test_table VALUES (\"mike\", 23)",
"INSERT INTO test_table VALUES (\"matt\", 24)"};
for (auto q : queries) {
sqlite3_exec(dbc->db(), q.c_str(), nullptr, nullptr, &err);
if (err != nullptr) {
throw std::domain_error(std::string("Cannot create testing DBC's db: ") +
err);
}
}
return dbc;
} | 95 | True | 1 |
CVE-2020-11683 | 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:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | PHYSICAL | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 6.8 | MEDIUM | 0.9 | 5.9 | False | [{'url': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'name': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/linux4sam/at91bootstrap/commit/7753914c9a622c245f3a3cf2af5e24b6a9904213', 'name': 'https://github.com/linux4sam/at91bootstrap/commit/7753914c9a622c245f3a3cf2af5e24b6a9904213', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-203'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:linux4sam:at91bootstrap:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.2', 'versionEndExcluding': '3.9.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'A timing side channel was discovered in AT91bootstrap before 3.9.2. It can be exploited by attackers with physical access to forge CMAC values and subsequently boot arbitrary code on an affected system.'}] | 2021-04-08T14:47Z | 2020-09-14T14: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 | Eugen Hristev | 2020-03-10 09:40:02+02:00 | driver: secure: use consttime_memequal for memory comparison
Do not use memcmp() to compare security critical data, such as
cryptographic secrets, because the required CPU time depends on the
number of equal bytes.
Instead, a function that performs comparisons in constant time is required.
Warning: consttime_memequal returns 0 if data are NOT equal, and 1 if they are
equal.
Signed-off-by: Eugen Hristev <[email protected]>
Reviewed-by: Nicolas Ferre <[email protected]> | 7753914c9a622c245f3a3cf2af5e24b6a9904213 | False | linux4sam/at91bootstrap | Second level bootloader for Microchip SoC (aka AT91) | 2011-10-03 12:25:41 | 2022-08-23 05:52:19 | http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap | linux4sam | 95.0 | 213.0 | secure_decrypt | secure_decrypt( void * data , unsigned int data_length , int is_signed) | ['data', 'data_length', 'is_signed'] | int secure_decrypt(void *data, unsigned int data_length, int is_signed)
{
at91_aes_key_size_t key_size;
unsigned int cmac_key[8], cipher_key[8];
unsigned int iv[AT91_AES_IV_SIZE_WORD];
unsigned int computed_cmac[AT91_AES_BLOCK_SIZE_WORD];
unsigned int fixed_length;
const unsigned int *cmac;
int rc = -1;
/* Init keys */
init_keys(&key_size, cipher_key, cmac_key, iv);
/* Init periph */
at91_aes_init();
/* Check signature if required */
if (is_signed) {
/* Compute the CMAC */
if (at91_aes_cmac(data_length, data, computed_cmac,
key_size, cmac_key))
goto exit;
/* Check the CMAC */
fixed_length = at91_aes_roundup(data_length);
cmac = (const unsigned int *)((char *)data + fixed_length);
if (memcmp(cmac, computed_cmac, AT91_AES_BLOCK_SIZE_BYTE))
goto exit;
}
/* Decrypt the whole file */
if (at91_aes_cbc(data_length, data, data, 0,
key_size, cipher_key, iv))
goto exit;
rc = 0;
exit:
/* Reset periph */
at91_aes_cleanup();
/* Reset keys */
memset(cmac_key, 0, sizeof(cmac_key));
memset(cipher_key, 0, sizeof(cipher_key));
memset(iv, 0, sizeof(iv));
return rc;
} | 210 | True | 1 |
CVE-2020-11684 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'name': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/linux4sam/at91bootstrap/commit/45419497309ffbf27c17ea7938499aca99168927', 'name': 'https://github.com/linux4sam/at91bootstrap/commit/45419497309ffbf27c17ea7938499aca99168927', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-212'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:linux4sam:at91bootstrap:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.2', 'versionEndExcluding': '3.9.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'AT91bootstrap before 3.9.2 does not properly wipe encryption and authentication keys from memory before passing control to a less privileged software component. This can be exploited to disclose these keys and subsequently encrypt and sign the next boot stage (such as the bootloader).'}] | 2021-07-21T11:39Z | 2020-09-14T14:15Z | Improper Removal of Sensitive Information Before Storage or Transfer | The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors. |
Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.
| https://cwe.mitre.org/data/definitions/212.html | 0 | Eugen Hristev | 2020-03-17 16:44:00+02:00 | driver: secure: move keys into static arrays
Move the keys into static arrays. This will avoid copying the keys
from the code section to the stack on the previous init_keys implementation.
Like this, the keys are hardcoded into data section at compile time,
and can be completely wiped after use.
Signed-off-by: Eugen Hristev <[email protected]>
Tested-by: Nicolas Ferre <[email protected]> | 45419497309ffbf27c17ea7938499aca99168927 | False | linux4sam/at91bootstrap | Second level bootloader for Microchip SoC (aka AT91) | 2011-10-03 12:25:41 | 2022-08-23 05:52:19 | http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap | linux4sam | 95.0 | 213.0 | init_keys | init_keys( at91_aes_key_size_t * key_size , unsigned int * cipher_key , unsigned int * cmac_key , unsigned int * iv) | ['key_size', 'cipher_key', 'cmac_key', 'iv'] | static inline void init_keys(at91_aes_key_size_t *key_size,
unsigned int *cipher_key,
unsigned int *cmac_key,
unsigned int *iv)
{
#if defined(CONFIG_AES_KEY_SIZE_128)
*key_size = AT91_AES_KEY_SIZE_128;
#elif defined(CONFIG_AES_KEY_SIZE_192)
*key_size = AT91_AES_KEY_SIZE_192;
#elif defined(CONFIG_AES_KEY_SIZE_256)
*key_size = AT91_AES_KEY_SIZE_256;
#else
#error "bad AES key size"
#endif
iv[0] = CONFIG_AES_IV_WORD0;
iv[1] = CONFIG_AES_IV_WORD1;
iv[2] = CONFIG_AES_IV_WORD2;
iv[3] = CONFIG_AES_IV_WORD3;
cipher_key[0] = CONFIG_AES_CIPHER_KEY_WORD0;
cmac_key[0] = CONFIG_AES_CMAC_KEY_WORD0;
cipher_key[1] = CONFIG_AES_CIPHER_KEY_WORD1;
cmac_key[1] = CONFIG_AES_CMAC_KEY_WORD1;
cipher_key[2] = CONFIG_AES_CIPHER_KEY_WORD2;
cmac_key[2] = CONFIG_AES_CMAC_KEY_WORD2;
cipher_key[3] = CONFIG_AES_CIPHER_KEY_WORD3;
cmac_key[3] = CONFIG_AES_CMAC_KEY_WORD3;
#if defined(CONFIG_AES_KEY_SIZE_192) || defined(CONFIG_AES_KEY_SIZE_256)
cipher_key[4] = CONFIG_AES_CIPHER_KEY_WORD4;
cmac_key[4] = CONFIG_AES_CMAC_KEY_WORD4;
cipher_key[5] = CONFIG_AES_CIPHER_KEY_WORD5;
cmac_key[5] = CONFIG_AES_CMAC_KEY_WORD5;
#endif
#if defined(CONFIG_AES_KEY_SIZE_256)
cipher_key[6] = CONFIG_AES_CIPHER_KEY_WORD6;
cmac_key[6] = CONFIG_AES_CMAC_KEY_WORD6;
cipher_key[7] = CONFIG_AES_CIPHER_KEY_WORD7;
cmac_key[7] = CONFIG_AES_CMAC_KEY_WORD7;
#endif
} | 178 | True | 1 |
CVE-2020-11684 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'name': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/linux4sam/at91bootstrap/commit/45419497309ffbf27c17ea7938499aca99168927', 'name': 'https://github.com/linux4sam/at91bootstrap/commit/45419497309ffbf27c17ea7938499aca99168927', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-212'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:linux4sam:at91bootstrap:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.2', 'versionEndExcluding': '3.9.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'AT91bootstrap before 3.9.2 does not properly wipe encryption and authentication keys from memory before passing control to a less privileged software component. This can be exploited to disclose these keys and subsequently encrypt and sign the next boot stage (such as the bootloader).'}] | 2021-07-21T11:39Z | 2020-09-14T14:15Z | Improper Removal of Sensitive Information Before Storage or Transfer | The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors. |
Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.
| https://cwe.mitre.org/data/definitions/212.html | 0 | Eugen Hristev | 2020-03-17 16:44:00+02:00 | driver: secure: move keys into static arrays
Move the keys into static arrays. This will avoid copying the keys
from the code section to the stack on the previous init_keys implementation.
Like this, the keys are hardcoded into data section at compile time,
and can be completely wiped after use.
Signed-off-by: Eugen Hristev <[email protected]>
Tested-by: Nicolas Ferre <[email protected]> | 45419497309ffbf27c17ea7938499aca99168927 | False | linux4sam/at91bootstrap | Second level bootloader for Microchip SoC (aka AT91) | 2011-10-03 12:25:41 | 2022-08-23 05:52:19 | http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap | linux4sam | 95.0 | 213.0 | secure_check | secure_check( void * data) | ['data'] | int secure_check(void *data)
{
const at91_secure_header_t *header;
void *file;
if (secure_decrypt(data, sizeof(*header), 0))
return -1;
header = (const at91_secure_header_t *)data;
if (header->magic != AT91_SECURE_MAGIC)
return -1;
file = (unsigned char *)data + sizeof(*header);
return secure_decrypt(file, header->file_size, 1);
} | 84 | True | 1 |
CVE-2020-11684 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:N | NETWORK | LOW | NONE | PARTIAL | PARTIAL | NONE | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | NONE | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'name': 'https://labs.f-secure.com/advisories/microchip-at91bootstrap/', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/linux4sam/at91bootstrap/commit/45419497309ffbf27c17ea7938499aca99168927', 'name': 'https://github.com/linux4sam/at91bootstrap/commit/45419497309ffbf27c17ea7938499aca99168927', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-212'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:linux4sam:at91bootstrap:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.7.2', 'versionEndExcluding': '3.9.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'AT91bootstrap before 3.9.2 does not properly wipe encryption and authentication keys from memory before passing control to a less privileged software component. This can be exploited to disclose these keys and subsequently encrypt and sign the next boot stage (such as the bootloader).'}] | 2021-07-21T11:39Z | 2020-09-14T14:15Z | Improper Removal of Sensitive Information Before Storage or Transfer | The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors. |
Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.
| https://cwe.mitre.org/data/definitions/212.html | 0 | Eugen Hristev | 2020-03-17 16:44:00+02:00 | driver: secure: move keys into static arrays
Move the keys into static arrays. This will avoid copying the keys
from the code section to the stack on the previous init_keys implementation.
Like this, the keys are hardcoded into data section at compile time,
and can be completely wiped after use.
Signed-off-by: Eugen Hristev <[email protected]>
Tested-by: Nicolas Ferre <[email protected]> | 45419497309ffbf27c17ea7938499aca99168927 | False | linux4sam/at91bootstrap | Second level bootloader for Microchip SoC (aka AT91) | 2011-10-03 12:25:41 | 2022-08-23 05:52:19 | http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap | linux4sam | 95.0 | 213.0 | secure_decrypt | secure_decrypt( void * data , unsigned int data_length , int is_signed) | ['data', 'data_length', 'is_signed'] | int secure_decrypt(void *data, unsigned int data_length, int is_signed)
{
at91_aes_key_size_t key_size;
unsigned int cmac_key[8], cipher_key[8];
unsigned int iv[AT91_AES_IV_SIZE_WORD];
unsigned int computed_cmac[AT91_AES_BLOCK_SIZE_WORD];
unsigned int fixed_length;
const unsigned int *cmac;
int rc = -1;
/* Init keys */
init_keys(&key_size, cipher_key, cmac_key, iv);
/* Init periph */
at91_aes_init();
/* Check signature if required */
if (is_signed) {
/* Compute the CMAC */
if (at91_aes_cmac(data_length, data, computed_cmac,
key_size, cmac_key))
goto exit;
/* Check the CMAC */
fixed_length = at91_aes_roundup(data_length);
cmac = (const unsigned int *)((char *)data + fixed_length);
if (!consttime_memequal(cmac, computed_cmac, AT91_AES_BLOCK_SIZE_BYTE))
goto exit;
}
/* Decrypt the whole file */
if (at91_aes_cbc(data_length, data, data, 0,
key_size, cipher_key, iv))
goto exit;
rc = 0;
exit:
/* Reset periph */
at91_aes_cleanup();
/* Reset keys */
memset(cmac_key, 0, sizeof(cmac_key));
memset(cipher_key, 0, sizeof(cipher_key));
memset(iv, 0, sizeof(iv));
return rc;
} | 211 | True | 1 |
CVE-2020-11724 | 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://github.com/openresty/openresty/blob/4e8b4c395f842a078e429c80dd063b2323999957/patches/ngx_http_lua-0.10.15-fix_location_capture_content_length_chunked.patch', 'name': 'https://github.com/openresty/openresty/blob/4e8b4c395f842a078e429c80dd063b2323999957/patches/ngx_http_lua-0.10.15-fix_location_capture_content_length_chunked.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openresty/lua-nginx-module/commit/9ab38e8ee35fc08a57636b1b6190dca70b0076fa', 'name': 'https://github.com/openresty/lua-nginx-module/commit/9ab38e8ee35fc08a57636b1b6190dca70b0076fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/07/msg00014.html', 'name': '[debian-lts-announce] 20200720 [SECURITY] [DLA 2283-1] nginx security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4750', 'name': 'DSA-4750', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210129-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20210129-0002/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-444'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openresty:openresty:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.15.8.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in OpenResty before 1.15.8.4. ngx_http_lua_subrequest.c allows HTTP request smuggling, as demonstrated by the ngx.location.capture API.'}] | 2021-01-29T16:33Z | 2020-04-12T21:15Z | Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') | The product acts as an intermediary HTTP agent
(such as a proxy or firewall) in the data flow between two
entities such as a client and server, but it does not
interpret malformed HTTP requests or responses in ways that
are consistent with how the messages will be processed by
those entities that are at the ultimate destination. |
HTTP requests or responses ("messages") can be
malformed or unexpected in ways that cause web servers or
clients to interpret the messages in different ways than
intermediary HTTP agents such as load balancers, reverse
proxies, web caching proxies, application firewalls,
etc. For example, an adversary may be able to add duplicate
or different header fields that a client or server might
interpret as one set of messages, whereas the intermediary
might interpret the same sequence of bytes as a different
set of messages. For example, discrepancies can arise in
how to handle duplicate headers like two Transfer-encoding
(TE) or two Content-length (CL), or the malicious HTTP
message will have different headers for TE and
CL.
The inconsistent parsing and interpretation of messages
can allow the adversary to "smuggle" a message to the
client/server without the intermediary being aware of it.
This weakness is usually the result of the usage
of outdated or incompatible HTTP protocol versions in the
HTTP agents.
| https://cwe.mitre.org/data/definitions/444.html | 0 | Thibault Charbonnier | 2020-03-23 19:40:47-07:00 | bugfix: prevented request smuggling in the ngx.location.capture API.
Signed-off-by: Yichun Zhang (agentzh) <[email protected]> | 9ab38e8ee35fc08a57636b1b6190dca70b0076fa | False | openresty/lua-nginx-module | Embed the Power of Lua into NGINX HTTP servers | 2010-04-16 15:59:01 | 2022-08-26 08:15:38 | https://openresty.org/ | openresty | 10206.0 | 1960.0 | ngx_http_lua_adjust_subrequest | ngx_http_lua_adjust_subrequest( ngx_http_request_t * sr , ngx_uint_t method , int always_forward_body , ngx_http_request_body_t * body , unsigned vars_action , ngx_array_t * extra_vars) | ['sr', 'method', 'always_forward_body', 'body', 'vars_action', 'extra_vars'] | ngx_http_lua_adjust_subrequest(ngx_http_request_t *sr, ngx_uint_t method,
int always_forward_body, ngx_http_request_body_t *body,
unsigned vars_action, ngx_array_t *extra_vars)
{
ngx_http_request_t *r;
ngx_int_t rc;
ngx_http_core_main_conf_t *cmcf;
size_t size;
r = sr->parent;
sr->header_in = r->header_in;
if (body) {
sr->request_body = body;
rc = ngx_http_lua_set_content_length_header(sr,
body->buf
? ngx_buf_size(body->buf)
: 0);
if (rc != NGX_OK) {
return NGX_ERROR;
}
} else if (!always_forward_body
&& method != NGX_HTTP_PUT
&& method != NGX_HTTP_POST
&& r->headers_in.content_length_n > 0)
{
rc = ngx_http_lua_set_content_length_header(sr, 0);
if (rc != NGX_OK) {
return NGX_ERROR;
}
#if 1
sr->request_body = NULL;
#endif
} else {
if (ngx_http_lua_copy_request_headers(sr, r) != NGX_OK) {
return NGX_ERROR;
}
if (sr->request_body) {
/* deep-copy the request body */
if (sr->request_body->temp_file) {
if (ngx_http_lua_copy_in_file_request_body(sr) != NGX_OK) {
return NGX_ERROR;
}
}
}
}
sr->method = method;
switch (method) {
case NGX_HTTP_GET:
sr->method_name = ngx_http_lua_get_method;
break;
case NGX_HTTP_POST:
sr->method_name = ngx_http_lua_post_method;
break;
case NGX_HTTP_PUT:
sr->method_name = ngx_http_lua_put_method;
break;
case NGX_HTTP_HEAD:
sr->method_name = ngx_http_lua_head_method;
break;
case NGX_HTTP_DELETE:
sr->method_name = ngx_http_lua_delete_method;
break;
case NGX_HTTP_OPTIONS:
sr->method_name = ngx_http_lua_options_method;
break;
case NGX_HTTP_MKCOL:
sr->method_name = ngx_http_lua_mkcol_method;
break;
case NGX_HTTP_COPY:
sr->method_name = ngx_http_lua_copy_method;
break;
case NGX_HTTP_MOVE:
sr->method_name = ngx_http_lua_move_method;
break;
case NGX_HTTP_PROPFIND:
sr->method_name = ngx_http_lua_propfind_method;
break;
case NGX_HTTP_PROPPATCH:
sr->method_name = ngx_http_lua_proppatch_method;
break;
case NGX_HTTP_LOCK:
sr->method_name = ngx_http_lua_lock_method;
break;
case NGX_HTTP_UNLOCK:
sr->method_name = ngx_http_lua_unlock_method;
break;
case NGX_HTTP_PATCH:
sr->method_name = ngx_http_lua_patch_method;
break;
case NGX_HTTP_TRACE:
sr->method_name = ngx_http_lua_trace_method;
break;
default:
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"unsupported HTTP method: %u", (unsigned) method);
return NGX_ERROR;
}
if (!(vars_action & NGX_HTTP_LUA_SHARE_ALL_VARS)) {
/* we do not inherit the parent request's variables */
cmcf = ngx_http_get_module_main_conf(sr, ngx_http_core_module);
size = cmcf->variables.nelts * sizeof(ngx_http_variable_value_t);
if (vars_action & NGX_HTTP_LUA_COPY_ALL_VARS) {
sr->variables = ngx_palloc(sr->pool, size);
if (sr->variables == NULL) {
return NGX_ERROR;
}
ngx_memcpy(sr->variables, r->variables, size);
} else {
/* we do not inherit the parent request's variables */
sr->variables = ngx_pcalloc(sr->pool, size);
if (sr->variables == NULL) {
return NGX_ERROR;
}
}
}
return ngx_http_lua_subrequest_add_extra_vars(sr, extra_vars);
} | 516 | True | 1 |
CVE-2020-11724 | 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://github.com/openresty/openresty/blob/4e8b4c395f842a078e429c80dd063b2323999957/patches/ngx_http_lua-0.10.15-fix_location_capture_content_length_chunked.patch', 'name': 'https://github.com/openresty/openresty/blob/4e8b4c395f842a078e429c80dd063b2323999957/patches/ngx_http_lua-0.10.15-fix_location_capture_content_length_chunked.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openresty/lua-nginx-module/commit/9ab38e8ee35fc08a57636b1b6190dca70b0076fa', 'name': 'https://github.com/openresty/lua-nginx-module/commit/9ab38e8ee35fc08a57636b1b6190dca70b0076fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/07/msg00014.html', 'name': '[debian-lts-announce] 20200720 [SECURITY] [DLA 2283-1] nginx security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4750', 'name': 'DSA-4750', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210129-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20210129-0002/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-444'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openresty:openresty:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.15.8.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in OpenResty before 1.15.8.4. ngx_http_lua_subrequest.c allows HTTP request smuggling, as demonstrated by the ngx.location.capture API.'}] | 2021-01-29T16:33Z | 2020-04-12T21:15Z | Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') | The product acts as an intermediary HTTP agent
(such as a proxy or firewall) in the data flow between two
entities such as a client and server, but it does not
interpret malformed HTTP requests or responses in ways that
are consistent with how the messages will be processed by
those entities that are at the ultimate destination. |
HTTP requests or responses ("messages") can be
malformed or unexpected in ways that cause web servers or
clients to interpret the messages in different ways than
intermediary HTTP agents such as load balancers, reverse
proxies, web caching proxies, application firewalls,
etc. For example, an adversary may be able to add duplicate
or different header fields that a client or server might
interpret as one set of messages, whereas the intermediary
might interpret the same sequence of bytes as a different
set of messages. For example, discrepancies can arise in
how to handle duplicate headers like two Transfer-encoding
(TE) or two Content-length (CL), or the malicious HTTP
message will have different headers for TE and
CL.
The inconsistent parsing and interpretation of messages
can allow the adversary to "smuggle" a message to the
client/server without the intermediary being aware of it.
This weakness is usually the result of the usage
of outdated or incompatible HTTP protocol versions in the
HTTP agents.
| https://cwe.mitre.org/data/definitions/444.html | 0 | Thibault Charbonnier | 2020-03-23 19:40:47-07:00 | bugfix: prevented request smuggling in the ngx.location.capture API.
Signed-off-by: Yichun Zhang (agentzh) <[email protected]> | 9ab38e8ee35fc08a57636b1b6190dca70b0076fa | False | openresty/lua-nginx-module | Embed the Power of Lua into NGINX HTTP servers | 2010-04-16 15:59:01 | 2022-08-26 08:15:38 | https://openresty.org/ | openresty | 10206.0 | 1960.0 | ngx_http_lua_copy_request_headers | ngx_http_lua_copy_request_headers( ngx_http_request_t * sr , ngx_http_request_t * r) | ['sr', 'r'] | ngx_http_lua_copy_request_headers(ngx_http_request_t *sr, ngx_http_request_t *r)
{
ngx_table_elt_t *header;
ngx_list_part_t *part;
ngx_uint_t i;
if (ngx_list_init(&sr->headers_in.headers, sr->pool, 20,
sizeof(ngx_table_elt_t)) != NGX_OK)
{
return NGX_ERROR;
}
dd("before: parent req headers count: %d",
(int) r->headers_in.headers.part.nelts);
part = &r->headers_in.headers.part;
header = part->elts;
for (i = 0; /* void */; i++) {
if (i >= part->nelts) {
if (part->next == NULL) {
break;
}
part = part->next;
header = part->elts;
i = 0;
}
dd("setting request header %.*s: %.*s", (int) header[i].key.len,
header[i].key.data, (int) header[i].value.len,
header[i].value.data);
if (ngx_http_lua_set_input_header(sr, header[i].key,
header[i].value, 0) == NGX_ERROR)
{
return NGX_ERROR;
}
}
dd("after: parent req headers count: %d",
(int) r->headers_in.headers.part.nelts);
return NGX_OK;
} | 236 | True | 1 |
CVE-2020-11724 | 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://github.com/openresty/openresty/blob/4e8b4c395f842a078e429c80dd063b2323999957/patches/ngx_http_lua-0.10.15-fix_location_capture_content_length_chunked.patch', 'name': 'https://github.com/openresty/openresty/blob/4e8b4c395f842a078e429c80dd063b2323999957/patches/ngx_http_lua-0.10.15-fix_location_capture_content_length_chunked.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/openresty/lua-nginx-module/commit/9ab38e8ee35fc08a57636b1b6190dca70b0076fa', 'name': 'https://github.com/openresty/lua-nginx-module/commit/9ab38e8ee35fc08a57636b1b6190dca70b0076fa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/07/msg00014.html', 'name': '[debian-lts-announce] 20200720 [SECURITY] [DLA 2283-1] nginx security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4750', 'name': 'DSA-4750', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20210129-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20210129-0002/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-444'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:openresty:openresty:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.15.8.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in OpenResty before 1.15.8.4. ngx_http_lua_subrequest.c allows HTTP request smuggling, as demonstrated by the ngx.location.capture API.'}] | 2021-01-29T16:33Z | 2020-04-12T21:15Z | Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') | The product acts as an intermediary HTTP agent
(such as a proxy or firewall) in the data flow between two
entities such as a client and server, but it does not
interpret malformed HTTP requests or responses in ways that
are consistent with how the messages will be processed by
those entities that are at the ultimate destination. |
HTTP requests or responses ("messages") can be
malformed or unexpected in ways that cause web servers or
clients to interpret the messages in different ways than
intermediary HTTP agents such as load balancers, reverse
proxies, web caching proxies, application firewalls,
etc. For example, an adversary may be able to add duplicate
or different header fields that a client or server might
interpret as one set of messages, whereas the intermediary
might interpret the same sequence of bytes as a different
set of messages. For example, discrepancies can arise in
how to handle duplicate headers like two Transfer-encoding
(TE) or two Content-length (CL), or the malicious HTTP
message will have different headers for TE and
CL.
The inconsistent parsing and interpretation of messages
can allow the adversary to "smuggle" a message to the
client/server without the intermediary being aware of it.
This weakness is usually the result of the usage
of outdated or incompatible HTTP protocol versions in the
HTTP agents.
| https://cwe.mitre.org/data/definitions/444.html | 0 | Thibault Charbonnier | 2020-03-23 19:40:47-07:00 | bugfix: prevented request smuggling in the ngx.location.capture API.
Signed-off-by: Yichun Zhang (agentzh) <[email protected]> | 9ab38e8ee35fc08a57636b1b6190dca70b0076fa | False | openresty/lua-nginx-module | Embed the Power of Lua into NGINX HTTP servers | 2010-04-16 15:59:01 | 2022-08-26 08:15:38 | https://openresty.org/ | openresty | 10206.0 | 1960.0 | ngx_http_lua_set_content_length_header | ngx_http_lua_set_content_length_header( ngx_http_request_t * r , off_t len) | ['r', 'len'] | ngx_http_lua_set_content_length_header(ngx_http_request_t *r, off_t len)
{
ngx_table_elt_t *h, *header;
u_char *p;
ngx_list_part_t *part;
ngx_http_request_t *pr;
ngx_uint_t i;
r->headers_in.content_length_n = len;
if (ngx_list_init(&r->headers_in.headers, r->pool, 20,
sizeof(ngx_table_elt_t)) != NGX_OK)
{
return NGX_ERROR;
}
h = ngx_list_push(&r->headers_in.headers);
if (h == NULL) {
return NGX_ERROR;
}
h->key = ngx_http_lua_content_length_header_key;
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
if (h->lowcase_key == NULL) {
return NGX_ERROR;
}
ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
r->headers_in.content_length = h;
p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
if (p == NULL) {
return NGX_ERROR;
}
h->value.data = p;
h->value.len = ngx_sprintf(h->value.data, "%O", len) - h->value.data;
h->hash = ngx_http_lua_content_length_hash;
#if 0
dd("content length hash: %lu == %lu", (unsigned long) h->hash,
ngx_hash_key_lc((u_char *) "Content-Length",
sizeof("Content-Length") - 1));
#endif
dd("r content length: %.*s",
(int) r->headers_in.content_length->value.len,
r->headers_in.content_length->value.data);
pr = r->parent;
if (pr == NULL) {
return NGX_OK;
}
/* forward the parent request's all other request headers */
part = &pr->headers_in.headers.part;
header = part->elts;
for (i = 0; /* void */; i++) {
if (i >= part->nelts) {
if (part->next == NULL) {
break;
}
part = part->next;
header = part->elts;
i = 0;
}
if (header[i].key.len == sizeof("Content-Length") - 1
&& ngx_strncasecmp(header[i].key.data, (u_char *) "Content-Length",
sizeof("Content-Length") - 1) == 0)
{
continue;
}
if (ngx_http_lua_set_input_header(r, header[i].key,
header[i].value, 0) == NGX_ERROR)
{
return NGX_ERROR;
}
}
return NGX_OK;
} | 441 | True | 1 |
CVE-2021-36082 | 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://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30393', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30393', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ndpi/OSV-2021-304.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ndpi/OSV-2021-304.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/ntop/nDPI/commit/1ec621c85b9411cc611652fd57a892cfef478af3', 'name': 'https://github.com/ntop/nDPI/commit/1ec621c85b9411cc611652fd57a892cfef478af3', '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:ntop:ndpi:3.4:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'ntop nDPI 3.4 has a stack-based buffer overflow in processClientServerHello.'}] | 2021-07-08T17:28Z | 2021-07-01T03: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 | Luca Deri | 2021-05-15 19:53:46+02:00 | Added further checks | 1ec621c85b9411cc611652fd57a892cfef478af3 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | ndpi_netbios_name_interpret | ndpi_netbios_name_interpret( char * in , size_t in_len , char * out , u_int out_len) | ['in', 'in_len', 'out', 'out_len'] | int ndpi_netbios_name_interpret(char *in, size_t in_len, char *out, u_int out_len) {
u_int ret = 0, len, idx = in_len, out_idx = 0;
len = (*in++)/2;
out_len--;
out[out_idx] = 0;
if((len > out_len) || (len < 1) || ((2*len) > in_len))
return(-1);
while((len--) && (out_idx < out_len)) {
if((idx < 2) || (in[0] < 'A') || (in[0] > 'P') || (in[1] < 'A') || (in[1] > 'P')) {
out[out_idx] = 0;
break;
}
out[out_idx] = ((in[0] - 'A') << 4) + (in[1] - 'A');
in += 2, idx -= 2;
if(isprint(out[out_idx]))
out_idx++, ret++;
}
/* Trim trailing whitespace from the returned string */
if(out_idx > 0) {
out[out_idx] = 0;
out_idx--;
while((out_idx > 0) && (out[out_idx] == ' ')) {
out[out_idx] = 0;
out_idx--;
}
}
return(ret);
} | 257 | True | 1 |
CVE-2021-36082 | 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://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30393', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30393', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ndpi/OSV-2021-304.yaml', 'name': 'https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ndpi/OSV-2021-304.yaml', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/ntop/nDPI/commit/1ec621c85b9411cc611652fd57a892cfef478af3', 'name': 'https://github.com/ntop/nDPI/commit/1ec621c85b9411cc611652fd57a892cfef478af3', '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:ntop:ndpi:3.4:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'ntop nDPI 3.4 has a stack-based buffer overflow in processClientServerHello.'}] | 2021-07-08T17:28Z | 2021-07-01T03: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 | Luca Deri | 2021-05-15 19:53:46+02:00 | Added further checks | 1ec621c85b9411cc611652fd57a892cfef478af3 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | processClientServerHello | processClientServerHello( struct ndpi_detection_module_struct * ndpi_struct , struct ndpi_flow_struct * flow , uint32_t quic_version) | ['ndpi_struct', 'flow', 'quic_version'] | int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, uint32_t quic_version) {
struct ndpi_packet_struct *packet = &flow->packet;
union ja3_info ja3;
u_int8_t invalid_ja3 = 0;
u_int16_t tls_version, ja3_str_len;
char ja3_str[JA3_STR_LEN];
ndpi_MD5_CTX ctx;
u_char md5_hash[16];
int i;
u_int16_t total_len;
u_int8_t handshake_type;
char buffer[64] = { '\0' };
int is_quic = (quic_version != 0);
int is_dtls = packet->udp && (!is_quic);
#ifdef DEBUG_TLS
printf("TLS %s() called\n", __FUNCTION__);
#endif
memset(&ja3, 0, sizeof(ja3));
handshake_type = packet->payload[0];
total_len = (packet->payload[1] << 16) + (packet->payload[2] << 8) + packet->payload[3];
if((total_len > packet->payload_packet_len) || (packet->payload[1] != 0x0))
return(0); /* Not found */
total_len = packet->payload_packet_len;
/* At least "magic" 3 bytes, null for string end, otherwise no need to waste cpu cycles */
if(total_len > 4) {
u_int16_t base_offset = (!is_dtls) ? 38 : 46;
u_int16_t version_offset = (!is_dtls) ? 4 : 12;
u_int16_t offset = (!is_dtls) ? 38 : 46, extension_len, j;
u_int8_t session_id_len = 0;
if((base_offset >= total_len) ||
(version_offset + 1) >= total_len)
return 0; /* Not found */
session_id_len = packet->payload[base_offset];
#ifdef DEBUG_TLS
printf("TLS [len: %u][handshake_type: %02X]\n", packet->payload_packet_len, handshake_type);
#endif
tls_version = ntohs(*((u_int16_t*)&packet->payload[version_offset]));
if(handshake_type == 0x02 /* Server Hello */) {
int i, rc;
ja3.server.tls_handshake_version = tls_version;
#ifdef DEBUG_TLS
printf("TLS Server Hello [version: 0x%04X]\n", tls_version);
#endif
/*
The server hello decides about the TLS version of this flow
https://networkengineering.stackexchange.com/questions/55752/why-does-wireshark-show-version-tls-1-2-here-instead-of-tls-1-3
*/
if(packet->udp)
offset += session_id_len + 1;
else {
if(tls_version < 0x7F15 /* TLS 1.3 lacks of session id */)
offset += session_id_len+1;
}
if((offset+3) > packet->payload_packet_len)
return(0); /* Not found */
ja3.server.num_cipher = 1, ja3.server.cipher[0] = ntohs(*((u_int16_t*)&packet->payload[offset]));
if((flow->protos.tls_quic_stun.tls_quic.server_unsafe_cipher = ndpi_is_safe_ssl_cipher(ja3.server.cipher[0])) == 1)
ndpi_set_risk(flow, NDPI_TLS_WEAK_CIPHER);
flow->protos.tls_quic_stun.tls_quic.server_cipher = ja3.server.cipher[0];
#ifdef DEBUG_TLS
printf("TLS [server][session_id_len: %u][cipher: %04X]\n", session_id_len, ja3.server.cipher[0]);
#endif
offset += 2 + 1;
if((offset + 1) < packet->payload_packet_len) /* +1 because we are goint to read 2 bytes */
extension_len = ntohs(*((u_int16_t*)&packet->payload[offset]));
else
extension_len = 0;
#ifdef DEBUG_TLS
printf("TLS [server][extension_len: %u]\n", extension_len);
#endif
offset += 2;
for(i=0; i<extension_len; ) {
u_int16_t extension_id, extension_len;
if((offset+4) > packet->payload_packet_len) break;
extension_id = ntohs(*((u_int16_t*)&packet->payload[offset]));
extension_len = ntohs(*((u_int16_t*)&packet->payload[offset+2]));
if(ja3.server.num_tls_extension < MAX_NUM_JA3)
ja3.server.tls_extension[ja3.server.num_tls_extension++] = extension_id;
#ifdef DEBUG_TLS
printf("TLS [server][extension_id: %u/0x%04X][len: %u]\n",
extension_id, extension_id, extension_len);
#endif
if(extension_id == 43 /* supported versions */) {
if(extension_len >= 2) {
u_int16_t tls_version = ntohs(*((u_int16_t*)&packet->payload[offset+4]));
#ifdef DEBUG_TLS
printf("TLS [server] [TLS version: 0x%04X]\n", tls_version);
#endif
flow->protos.tls_quic_stun.tls_quic.ssl_version = ja3.server.tls_supported_version = tls_version;
}
} else if(extension_id == 16 /* application_layer_protocol_negotiation (ALPN) */) {
u_int16_t s_offset = offset+4;
u_int16_t tot_alpn_len = ntohs(*((u_int16_t*)&packet->payload[s_offset]));
char alpn_str[256];
u_int8_t alpn_str_len = 0, i;
#ifdef DEBUG_TLS
printf("Server TLS [ALPN: block_len=%u/len=%u]\n", extension_len, tot_alpn_len);
#endif
s_offset += 2;
tot_alpn_len += s_offset;
while(s_offset < tot_alpn_len && s_offset < total_len) {
u_int8_t alpn_i, alpn_len = packet->payload[s_offset++];
if((s_offset + alpn_len) <= tot_alpn_len) {
#ifdef DEBUG_TLS
printf("Server TLS [ALPN: %u]\n", alpn_len);
#endif
if((alpn_str_len+alpn_len+1) < (sizeof(alpn_str)-1)) {
if(alpn_str_len > 0) {
alpn_str[alpn_str_len] = ',';
alpn_str_len++;
}
for(alpn_i=0; alpn_i<alpn_len; alpn_i++)
{
alpn_str[alpn_str_len+alpn_i] = packet->payload[s_offset+alpn_i];
}
s_offset += alpn_len, alpn_str_len += alpn_len;;
} else {
ndpi_set_risk(flow, NDPI_TLS_UNCOMMON_ALPN);
break;
}
} else {
ndpi_set_risk(flow, NDPI_TLS_UNCOMMON_ALPN);
break;
}
} /* while */
alpn_str[alpn_str_len] = '\0';
#ifdef DEBUG_TLS
printf("Server TLS [ALPN: %s][len: %u]\n", alpn_str, alpn_str_len);
#endif
if(flow->protos.tls_quic_stun.tls_quic.alpn == NULL)
flow->protos.tls_quic_stun.tls_quic.alpn = ndpi_strdup(alpn_str);
if(flow->protos.tls_quic_stun.tls_quic.alpn != NULL)
tlsCheckUncommonALPN(flow);
snprintf(ja3.server.alpn, sizeof(ja3.server.alpn), "%s", alpn_str);
/* Replace , with - as in JA3 */
for(i=0; ja3.server.alpn[i] != '\0'; i++)
if(ja3.server.alpn[i] == ',') ja3.server.alpn[i] = '-';
} else if(extension_id == 11 /* ec_point_formats groups */) {
u_int16_t s_offset = offset+4 + 1;
#ifdef DEBUG_TLS
printf("Server TLS [EllipticCurveFormat: len=%u]\n", extension_len);
#endif
if((s_offset+extension_len-1) <= total_len) {
for(i=0; i<extension_len-1; i++) {
u_int8_t s_group = packet->payload[s_offset+i];
#ifdef DEBUG_TLS
printf("Server TLS [EllipticCurveFormat: %u]\n", s_group);
#endif
if(ja3.server.num_elliptic_curve_point_format < MAX_NUM_JA3)
ja3.server.elliptic_curve_point_format[ja3.server.num_elliptic_curve_point_format++] = s_group;
else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Server TLS Invalid num elliptic %u\n", ja3.server.num_elliptic_curve_point_format);
#endif
}
}
} else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Server TLS Invalid len %u vs %u\n", s_offset+extension_len, total_len);
#endif
}
}
i += 4 + extension_len, offset += 4 + extension_len;
} /* for */
ja3_str_len = snprintf(ja3_str, sizeof(ja3_str), "%u,", ja3.server.tls_handshake_version);
for(i=0; i<ja3.server.num_cipher; i++) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u", (i > 0) ? "-" : "", ja3.server.cipher[i]);
if(rc <= 0) break; else ja3_str_len += rc;
}
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc;
/* ********** */
for(i=0; i<ja3.server.num_tls_extension; i++) {
int rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u", (i > 0) ? "-" : "", ja3.server.tls_extension[i]);
if(rc <= 0) break; else ja3_str_len += rc;
}
if(ndpi_struct->enable_ja3_plus) {
for(i=0; i<ja3.server.num_elliptic_curve_point_format; i++) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.server.elliptic_curve_point_format[i]);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc; else break;
}
if(ja3.server.alpn[0] != '\0') {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",%s", ja3.server.alpn);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc;
}
#ifdef DEBUG_TLS
printf("[JA3+] Server: %s \n", ja3_str);
#endif
} else {
#ifdef DEBUG_TLS
printf("[JA3] Server: %s \n", ja3_str);
#endif
}
ndpi_MD5Init(&ctx);
ndpi_MD5Update(&ctx, (const unsigned char *)ja3_str, strlen(ja3_str));
ndpi_MD5Final(md5_hash, &ctx);
for(i=0, j=0; i<16; i++) {
int rc = snprintf(&flow->protos.tls_quic_stun.tls_quic.ja3_server[j],
sizeof(flow->protos.tls_quic_stun.tls_quic.ja3_server)-j, "%02x", md5_hash[i]);
if(rc <= 0) break; else j += rc;
}
#ifdef DEBUG_TLS
printf("[JA3] Server: %s \n", flow->protos.tls_quic_stun.tls_quic.ja3_server);
#endif
} else if(handshake_type == 0x01 /* Client Hello */) {
u_int16_t cipher_len, cipher_offset;
u_int8_t cookie_len = 0;
flow->protos.tls_quic_stun.tls_quic.ssl_version = ja3.client.tls_handshake_version = tls_version;
if(flow->protos.tls_quic_stun.tls_quic.ssl_version < 0x0302) /* TLSv1.1 */
ndpi_set_risk(flow, NDPI_TLS_OBSOLETE_VERSION);
if((session_id_len+base_offset+3) > packet->payload_packet_len)
return(0); /* Not found */
if(!is_dtls) {
cipher_len = packet->payload[session_id_len+base_offset+2] + (packet->payload[session_id_len+base_offset+1] << 8);
cipher_offset = base_offset + session_id_len + 3;
} else {
cookie_len = packet->payload[base_offset+session_id_len+1];
#ifdef DEBUG_TLS
printf("[JA3] Client: DTLS cookie len %d\n", cookie_len);
#endif
if((session_id_len+base_offset+cookie_len+4) > packet->payload_packet_len)
return(0); /* Not found */
cipher_len = ntohs(*((u_int16_t*)&packet->payload[base_offset+session_id_len+cookie_len+2]));
cipher_offset = base_offset + session_id_len + cookie_len + 4;
}
#ifdef DEBUG_TLS
printf("Client TLS [client cipher_len: %u][tls_version: 0x%04X]\n", cipher_len, tls_version);
#endif
if((cipher_offset+cipher_len) <= total_len) {
u_int8_t safari_ciphers = 0, chrome_ciphers = 0;
for(i=0; i<cipher_len;) {
u_int16_t *id = (u_int16_t*)&packet->payload[cipher_offset+i];
#ifdef DEBUG_TLS
printf("Client TLS [cipher suite: %u/0x%04X] [%d/%u]\n", ntohs(*id), ntohs(*id), i, cipher_len);
#endif
if((*id == 0) || (packet->payload[cipher_offset+i] != packet->payload[cipher_offset+i+1])) {
u_int16_t cipher_id = ntohs(*id);
/*
Skip GREASE [https://tools.ietf.org/id/draft-ietf-tls-grease-01.html]
https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967
*/
if(ja3.client.num_cipher < MAX_NUM_JA3)
ja3.client.cipher[ja3.client.num_cipher++] = cipher_id;
else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid cipher %u\n", ja3.client.num_cipher);
#endif
}
switch(cipher_id) {
case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:
safari_ciphers++;
break;
case TLS_CIPHER_GREASE_RESERVED_0:
case TLS_AES_128_GCM_SHA256:
case TLS_AES_256_GCM_SHA384:
case TLS_CHACHA20_POLY1305_SHA256:
chrome_ciphers++;
break;
case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:
case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:
case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
case TLS_RSA_WITH_AES_128_CBC_SHA:
case TLS_RSA_WITH_AES_256_CBC_SHA:
case TLS_RSA_WITH_AES_128_GCM_SHA256:
case TLS_RSA_WITH_AES_256_GCM_SHA384:
safari_ciphers++, chrome_ciphers++;
break;
}
}
i += 2;
} /* for */
if(chrome_ciphers == 13)
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_chrome_tls = 1;
else if(safari_ciphers == 12)
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_safari_tls = 1;
} else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid len %u vs %u\n", (cipher_offset+cipher_len), total_len);
#endif
}
offset = base_offset + session_id_len + cookie_len + cipher_len + 2;
offset += (!is_dtls) ? 1 : 2;
if(offset < total_len) {
u_int16_t compression_len;
u_int16_t extensions_len;
compression_len = packet->payload[offset];
offset++;
#ifdef DEBUG_TLS
printf("Client TLS [compression_len: %u]\n", compression_len);
#endif
// offset += compression_len + 3;
offset += compression_len;
if(offset+1 < total_len) {
extensions_len = ntohs(*((u_int16_t*)&packet->payload[offset]));
offset += 2;
#ifdef DEBUG_TLS
printf("Client TLS [extensions_len: %u]\n", extensions_len);
#endif
if((extensions_len+offset) <= total_len) {
/* Move to the first extension
Type is u_int to avoid possible overflow on extension_len addition */
u_int extension_offset = 0;
u_int32_t j;
while(extension_offset < extensions_len &&
offset+extension_offset+4 <= total_len) {
u_int16_t extension_id, extension_len, extn_off = offset+extension_offset;
extension_id = ntohs(*((u_int16_t*)&packet->payload[offset+extension_offset]));
extension_offset += 2;
extension_len = ntohs(*((u_int16_t*)&packet->payload[offset+extension_offset]));
extension_offset += 2;
#ifdef DEBUG_TLS
printf("Client TLS [extension_id: %u][extension_len: %u]\n", extension_id, extension_len);
#endif
if((extension_id == 0) || (packet->payload[extn_off] != packet->payload[extn_off+1])) {
/* Skip GREASE */
if(ja3.client.num_tls_extension < MAX_NUM_JA3)
ja3.client.tls_extension[ja3.client.num_tls_extension++] = extension_id;
else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid extensions %u\n", ja3.client.num_tls_extension);
#endif
}
}
if(extension_id == 0 /* server name */) {
u_int16_t len;
#ifdef DEBUG_TLS
printf("[TLS] Extensions: found server name\n");
#endif
if((offset+extension_offset+4) < packet->payload_packet_len) {
len = (packet->payload[offset+extension_offset+3] << 8) + packet->payload[offset+extension_offset+4];
len = (u_int)ndpi_min(len, sizeof(buffer)-1);
if((offset+extension_offset+5+len) <= packet->payload_packet_len) {
strncpy(buffer, (char*)&packet->payload[offset+extension_offset+5], len);
buffer[len] = '\0';
cleanupServerName(buffer, sizeof(buffer));
snprintf(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name,
sizeof(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name),
"%s", buffer);
#ifdef DEBUG_TLS
printf("[TLS] SNI: [%s]\n", buffer);
#endif
if(!is_quic) {
if(ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TLS, buffer, strlen(buffer)))
flow->l4.tcp.tls.subprotocol_detected = 1;
} else {
if(ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUIC, buffer, strlen(buffer)))
flow->l4.tcp.tls.subprotocol_detected = 1;
}
if(ndpi_check_dga_name(ndpi_struct, flow,
flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, 1)) {
char *sni = flow->protos.tls_quic_stun.tls_quic.client_requested_server_name;
int len = strlen(sni);
#ifdef DEBUG_TLS
printf("[TLS] SNI: (DGA) [%s]\n", flow->protos.tls_quic_stun.tls_quic.client_requested_server_name);
#endif
if((len >= 4)
/* Check if it ends in .com or .net */
&& ((strcmp(&sni[len-4], ".com") == 0) || (strcmp(&sni[len-4], ".net") == 0))
&& (strncmp(sni, "www.", 4) == 0)) /* Not starting with www.... */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TOR, NDPI_PROTOCOL_TLS);
} else {
#ifdef DEBUG_TLS
printf("[TLS] SNI: (NO DGA) [%s]\n", flow->protos.tls_quic_stun.tls_quic.client_requested_server_name);
#endif
}
} else {
#ifdef DEBUG_TLS
printf("[TLS] Extensions server len too short: %u vs %u\n",
offset+extension_offset+5+len,
packet->payload_packet_len);
#endif
}
}
} else if(extension_id == 10 /* supported groups */) {
u_int16_t s_offset = offset+extension_offset + 2;
#ifdef DEBUG_TLS
printf("Client TLS [EllipticCurveGroups: len=%u]\n", extension_len);
#endif
if((s_offset+extension_len-2) <= total_len) {
for(i=0; i<extension_len-2;) {
u_int16_t s_group = ntohs(*((u_int16_t*)&packet->payload[s_offset+i]));
#ifdef DEBUG_TLS
printf("Client TLS [EllipticCurve: %u/0x%04X]\n", s_group, s_group);
#endif
if((s_group == 0) || (packet->payload[s_offset+i] != packet->payload[s_offset+i+1])) {
/* Skip GREASE */
if(ja3.client.num_elliptic_curve < MAX_NUM_JA3)
ja3.client.elliptic_curve[ja3.client.num_elliptic_curve++] = s_group;
else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid num elliptic %u\n", ja3.client.num_elliptic_curve);
#endif
}
}
i += 2;
}
} else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid len %u vs %u\n", (s_offset+extension_len-1), total_len);
#endif
}
} else if(extension_id == 11 /* ec_point_formats groups */) {
u_int16_t s_offset = offset+extension_offset + 1;
#ifdef DEBUG_TLS
printf("Client TLS [EllipticCurveFormat: len=%u]\n", extension_len);
#endif
if((s_offset+extension_len-1) <= total_len) {
for(i=0; i<extension_len-1; i++) {
u_int8_t s_group = packet->payload[s_offset+i];
#ifdef DEBUG_TLS
printf("Client TLS [EllipticCurveFormat: %u]\n", s_group);
#endif
if(ja3.client.num_elliptic_curve_point_format < MAX_NUM_JA3)
ja3.client.elliptic_curve_point_format[ja3.client.num_elliptic_curve_point_format++] = s_group;
else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid num elliptic %u\n", ja3.client.num_elliptic_curve_point_format);
#endif
}
}
} else {
invalid_ja3 = 1;
#ifdef DEBUG_TLS
printf("Client TLS Invalid len %u vs %u\n", s_offset+extension_len, total_len);
#endif
}
} else if(extension_id == 13 /* signature algorithms */) {
u_int16_t s_offset = offset+extension_offset, safari_signature_algorithms = 0, chrome_signature_algorithms = 0;
u_int16_t tot_signature_algorithms_len = ntohs(*((u_int16_t*)&packet->payload[s_offset]));
#ifdef DEBUG_TLS
printf("Client TLS [SIGNATURE_ALGORITHMS: block_len=%u/len=%u]\n", extension_len, tot_signature_algorithms_len);
#endif
s_offset += 2;
tot_signature_algorithms_len = ndpi_min((sizeof(ja3.client.signature_algorithms) / 2) - 1, tot_signature_algorithms_len);
#ifdef TLS_HANDLE_SIGNATURE_ALGORITMS
flow->protos.tls_quic_stun.tls_quic.num_tls_signature_algorithms = ndpi_min(tot_signature_algorithms_len / 2, MAX_NUM_TLS_SIGNATURE_ALGORITHMS);
memcpy(flow->protos.tls_quic_stun.tls_quic.client_signature_algorithms,
&packet->payload[s_offset], 2 /* 16 bit */*flow->protos.tls_quic_stun.tls_quic.num_tls_signature_algorithms);
#endif
for(i=0; i<tot_signature_algorithms_len; i++) {
int rc = snprintf(&ja3.client.signature_algorithms[i*2], sizeof(ja3.client.signature_algorithms)-i*2, "%02X", packet->payload[s_offset+i]);
if(rc < 0) break;
}
for(i=0; i<tot_signature_algorithms_len; i+=2) {
u_int16_t cipher_id = (u_int16_t)ntohs(*((u_int16_t*)&packet->payload[s_offset+i]));
// printf("=>> %04X\n", cipher_id);
switch(cipher_id) {
case ECDSA_SECP521R1_SHA512:
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_firefox_tls = 1;
break;
case ECDSA_SECP256R1_SHA256:
case ECDSA_SECP384R1_SHA384:
case RSA_PKCS1_SHA256:
case RSA_PKCS1_SHA384:
case RSA_PKCS1_SHA512:
case RSA_PSS_RSAE_SHA256:
case RSA_PSS_RSAE_SHA384:
case RSA_PSS_RSAE_SHA512:
chrome_signature_algorithms++, safari_signature_algorithms++;
break;
}
}
if(flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_firefox_tls)
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_safari_tls = 0,
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_chrome_tls = 0;
if(safari_signature_algorithms != 8)
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_safari_tls = 0;
if(chrome_signature_algorithms != 8)
flow->protos.tls_quic_stun.tls_quic.browser_euristics.is_chrome_tls = 0;
ja3.client.signature_algorithms[i*2] = '\0';
#ifdef DEBUG_TLS
printf("Client TLS [SIGNATURE_ALGORITHMS: %s]\n", ja3.client.signature_algorithms);
#endif
} else if(extension_id == 16 /* application_layer_protocol_negotiation */) {
u_int16_t s_offset = offset+extension_offset;
u_int16_t tot_alpn_len = ntohs(*((u_int16_t*)&packet->payload[s_offset]));
char alpn_str[256];
u_int8_t alpn_str_len = 0, i;
#ifdef DEBUG_TLS
printf("Client TLS [ALPN: block_len=%u/len=%u]\n", extension_len, tot_alpn_len);
#endif
s_offset += 2;
tot_alpn_len += s_offset;
while(s_offset < tot_alpn_len && s_offset < total_len) {
u_int8_t alpn_i, alpn_len = packet->payload[s_offset++];
if((s_offset + alpn_len) <= tot_alpn_len &&
(s_offset + alpn_len) <= total_len) {
#ifdef DEBUG_TLS
printf("Client TLS [ALPN: %u]\n", alpn_len);
#endif
if((alpn_str_len+alpn_len+1) < (sizeof(alpn_str)-1)) {
if(alpn_str_len > 0) {
alpn_str[alpn_str_len] = ',';
alpn_str_len++;
}
for(alpn_i=0; alpn_i<alpn_len; alpn_i++)
alpn_str[alpn_str_len+alpn_i] = packet->payload[s_offset+alpn_i];
s_offset += alpn_len, alpn_str_len += alpn_len;;
} else
break;
} else
break;
} /* while */
alpn_str[alpn_str_len] = '\0';
#ifdef DEBUG_TLS
printf("Client TLS [ALPN: %s][len: %u]\n", alpn_str, alpn_str_len);
#endif
if(flow->protos.tls_quic_stun.tls_quic.alpn == NULL)
flow->protos.tls_quic_stun.tls_quic.alpn = ndpi_strdup(alpn_str);
snprintf(ja3.client.alpn, sizeof(ja3.client.alpn), "%s", alpn_str);
/* Replace , with - as in JA3 */
for(i=0; ja3.client.alpn[i] != '\0'; i++)
if(ja3.client.alpn[i] == ',') ja3.client.alpn[i] = '-';
} else if(extension_id == 43 /* supported versions */) {
u_int16_t s_offset = offset+extension_offset;
u_int8_t version_len = packet->payload[s_offset];
char version_str[256];
u_int8_t version_str_len = 0;
version_str[0] = 0;
#ifdef DEBUG_TLS
printf("Client TLS [TLS version len: %u]\n", version_len);
#endif
if(version_len == (extension_len-1)) {
u_int8_t j;
u_int16_t supported_versions_offset = 0;
s_offset++;
// careful not to overflow and loop forever with u_int8_t
for(j=0; j+1<version_len; j += 2) {
u_int16_t tls_version = ntohs(*((u_int16_t*)&packet->payload[s_offset+j]));
u_int8_t unknown_tls_version;
#ifdef DEBUG_TLS
printf("Client TLS [TLS version: %s/0x%04X]\n",
ndpi_ssl_version2str(flow, tls_version, &unknown_tls_version), tls_version);
#endif
if((version_str_len+8) < sizeof(version_str)) {
int rc = snprintf(&version_str[version_str_len],
sizeof(version_str) - version_str_len, "%s%s",
(version_str_len > 0) ? "," : "",
ndpi_ssl_version2str(flow, tls_version, &unknown_tls_version));
if(rc <= 0)
break;
else
version_str_len += rc;
rc = snprintf(&ja3.client.supported_versions[supported_versions_offset],
sizeof(ja3.client.supported_versions)-supported_versions_offset,
"%s%04X", (j > 0) ? "-" : "", tls_version);
if(rc > 0)
supported_versions_offset += rc;
}
}
#ifdef DEBUG_TLS
printf("Client TLS [SUPPORTED_VERSIONS: %s]\n", ja3.client.supported_versions);
#endif
if(flow->protos.tls_quic_stun.tls_quic.tls_supported_versions == NULL)
flow->protos.tls_quic_stun.tls_quic.tls_supported_versions = ndpi_strdup(version_str);
}
} else if(extension_id == 65486 /* encrypted server name */) {
/*
- https://tools.ietf.org/html/draft-ietf-tls-esni-06
- https://blog.cloudflare.com/encrypted-sni/
*/
u_int16_t e_offset = offset+extension_offset;
u_int16_t initial_offset = e_offset;
u_int16_t e_sni_len, cipher_suite = ntohs(*((u_int16_t*)&packet->payload[e_offset]));
flow->protos.tls_quic_stun.tls_quic.encrypted_sni.cipher_suite = cipher_suite;
e_offset += 2; /* Cipher suite len */
/* Key Share Entry */
e_offset += 2; /* Group */
e_offset += ntohs(*((u_int16_t*)&packet->payload[e_offset])) + 2; /* Lenght */
if((e_offset+4) < packet->payload_packet_len) {
/* Record Digest */
e_offset += ntohs(*((u_int16_t*)&packet->payload[e_offset])) + 2; /* Lenght */
if((e_offset+4) < packet->payload_packet_len) {
e_sni_len = ntohs(*((u_int16_t*)&packet->payload[e_offset]));
e_offset += 2;
if((e_offset+e_sni_len-extension_len-initial_offset) >= 0 &&
e_offset+e_sni_len < packet->payload_packet_len) {
#ifdef DEBUG_ENCRYPTED_SNI
printf("Client TLS [Encrypted Server Name len: %u]\n", e_sni_len);
#endif
if(flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni == NULL) {
flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni = (char*)ndpi_malloc(e_sni_len*2+1);
if(flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni) {
u_int16_t i, off;
for(i=e_offset, off=0; i<(e_offset+e_sni_len); i++) {
int rc = sprintf(&flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni[off], "%02X", packet->payload[i] & 0XFF);
if(rc <= 0) {
flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni[off] = '\0';
break;
} else
off += rc;
}
}
}
}
}
}
} else if(extension_id == 65445 || /* QUIC transport parameters (drafts version) */
extension_id == 57) { /* QUIC transport parameters (final version) */
u_int16_t s_offset = offset+extension_offset;
uint16_t final_offset;
int using_var_int = is_version_with_var_int_transport_params(quic_version);
if(!using_var_int) {
if(s_offset+1 >= total_len) {
final_offset = 0; /* Force skipping extension */
} else {
u_int16_t seq_len = ntohs(*((u_int16_t*)&packet->payload[s_offset]));
s_offset += 2;
final_offset = MIN(total_len, s_offset + seq_len);
}
} else {
final_offset = MIN(total_len, s_offset + extension_len);
}
while(s_offset < final_offset) {
u_int64_t param_type, param_len;
if(!using_var_int) {
if(s_offset+3 >= final_offset)
break;
param_type = ntohs(*((u_int16_t*)&packet->payload[s_offset]));
param_len = ntohs(*((u_int16_t*)&packet->payload[s_offset + 2]));
s_offset += 4;
} else {
if(s_offset >= final_offset ||
(s_offset + quic_len_buffer_still_required(packet->payload[s_offset])) >= final_offset)
break;
s_offset += quic_len(&packet->payload[s_offset], ¶m_type);
if(s_offset >= final_offset ||
(s_offset + quic_len_buffer_still_required(packet->payload[s_offset])) >= final_offset)
break;
s_offset += quic_len(&packet->payload[s_offset], ¶m_len);
}
#ifdef DEBUG_TLS
printf("Client TLS [QUIC TP: Param 0x%x Len %d]\n", (int)param_type, (int)param_len);
#endif
if(s_offset+param_len > final_offset)
break;
if(param_type==0x3129) {
#ifdef DEBUG_TLS
printf("UA [%.*s]\n", (int)param_len, &packet->payload[s_offset]);
#endif
http_process_user_agent(ndpi_struct, flow,
&packet->payload[s_offset], param_len);
break;
}
s_offset += param_len;
}
}
extension_offset += extension_len; /* Move to the next extension */
#ifdef DEBUG_TLS
printf("Client TLS [extension_offset/len: %u/%u]\n", extension_offset, extension_len);
#endif
} /* while */
if(!invalid_ja3) {
int rc;
compute_ja3c:
ja3_str_len = snprintf(ja3_str, sizeof(ja3_str), "%u,", ja3.client.tls_handshake_version);
for(i=0; i<ja3.client.num_cipher; i++) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.client.cipher[i]);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc; else break;
}
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc;
/* ********** */
for(i=0; i<ja3.client.num_tls_extension; i++) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.client.tls_extension[i]);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc; else break;
}
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc;
/* ********** */
for(i=0; i<ja3.client.num_elliptic_curve; i++) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.client.elliptic_curve[i]);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc; else break;
}
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc;
for(i=0; i<ja3.client.num_elliptic_curve_point_format; i++) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.client.elliptic_curve_point_format[i]);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc; else break;
}
if(ndpi_struct->enable_ja3_plus) {
rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len,
",%s,%s,%s", ja3.client.signature_algorithms, ja3.client.supported_versions, ja3.client.alpn);
if((rc > 0) && (ja3_str_len + rc < JA3_STR_LEN)) ja3_str_len += rc;
}
#ifdef DEBUG_JA3C
printf("[JA3+] Client: %s \n", ja3_str);
#endif
ndpi_MD5Init(&ctx);
ndpi_MD5Update(&ctx, (const unsigned char *)ja3_str, strlen(ja3_str));
ndpi_MD5Final(md5_hash, &ctx);
for(i=0, j=0; i<16; i++) {
rc = snprintf(&flow->protos.tls_quic_stun.tls_quic.ja3_client[j],
sizeof(flow->protos.tls_quic_stun.tls_quic.ja3_client)-j, "%02x",
md5_hash[i]);
if(rc > 0) j += rc; else break;
}
#ifdef DEBUG_JA3C
printf("[JA3] Client: %s \n", flow->protos.tls_quic_stun.tls_quic.ja3_client);
#endif
if(ndpi_struct->malicious_ja3_automa.ac_automa != NULL) {
u_int16_t rc1 = ndpi_match_string(ndpi_struct->malicious_ja3_automa.ac_automa,
flow->protos.tls_quic_stun.tls_quic.ja3_client);
if(rc1 > 0)
ndpi_set_risk(flow, NDPI_MALICIOUS_JA3);
}
}
/* Before returning to the caller we need to make a final check */
if((flow->protos.tls_quic_stun.tls_quic.ssl_version >= 0x0303) /* >= TLSv1.2 */
&& (flow->protos.tls_quic_stun.tls_quic.alpn == NULL) /* No ALPN */) {
ndpi_set_risk(flow, NDPI_TLS_NOT_CARRYING_HTTPS);
}
/* Suspicious Domain Fronting:
https://github.com/SixGenInc/Noctilucent/blob/master/docs/ */
if(flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni &&
flow->protos.tls_quic_stun.tls_quic.client_requested_server_name[0] != '\0') {
ndpi_set_risk(flow, NDPI_TLS_SUSPICIOUS_ESNI_USAGE);
}
/* Add check for missing SNI */
if((flow->protos.tls_quic_stun.tls_quic.client_requested_server_name[0] == 0)
&& (flow->protos.tls_quic_stun.tls_quic.ssl_version >= 0x0302) /* TLSv1.1 */
&& (flow->protos.tls_quic_stun.tls_quic.encrypted_sni.esni == NULL) /* No ESNI */
) {
/* This is a bit suspicious */
ndpi_set_risk(flow, NDPI_TLS_MISSING_SNI);
}
return(2 /* Client Certificate */);
} else {
#ifdef DEBUG_TLS
printf("[TLS] Client: too short [%u vs %u]\n",
(extensions_len+offset), total_len);
#endif
}
} else if(offset == total_len) {
/* TLS does not have extensions etc */
goto compute_ja3c;
}
} else {
#ifdef DEBUG_TLS
printf("[JA3] Client: invalid length detected\n");
#endif
}
}
}
return(0); /* Not found */
} | 5813 | True | 1 |
CVE-2020-11939 | 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/ntop/nDPI/commit/7ce478a58b4dd29a8d1e6f4e9df2f778613d9202', 'name': 'https://github.com/ntop/nDPI/commit/7ce478a58b4dd29a8d1e6f4e9df2f778613d9202', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://securitylab.github.com/advisories/GHSL-2020-051_052-ntop-ndpi', 'name': 'https://securitylab.github.com/advisories/GHSL-2020-051_052-ntop-ndpi', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-190'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "In nDPI through 3.2 Stable, the SSH protocol dissector has multiple KEXINIT integer overflows that result in a controlled remote heap overflow in concat_hash_string in ssh.c. Due to the granular nature of the overflow primitive and the ability to control both the contents and layout of the nDPI library's heap memory through remote input, this vulnerability may be abused to achieve full Remote Code Execution against any network inspection stack that is linked against nDPI and uses it to perform network traffic analysis."}] | 2021-07-21T11:39Z | 2020-04-23T15: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 | Philippe Antoine | 2020-04-02 16:48:35+02:00 | ssh: fixing unsigned overflow leading to heap overflow
cf GHSL-2020-051 | 7ce478a58b4dd29a8d1e6f4e9df2f778613d9202 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | concat_hash_string | concat_hash_string( struct ndpi_packet_struct * packet , char * buf , u_int8_t client_hash) | ['packet', 'buf', 'client_hash'] | static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet,
char *buf, u_int8_t client_hash) {
u_int16_t offset = 22, buf_out_len = 0;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]);
offset += 4;
/* -1 for ';' */
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
/* ssh.kex_algorithms [C/S] */
strncpy(buf, (const char *)&packet->payload[offset], buf_out_len = len);
buf[buf_out_len++] = ';';
offset += len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.server_host_key_algorithms [None] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.encryption_algorithms_client_to_server [C] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.encryption_algorithms_server_to_client [S] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(!client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.mac_algorithms_client_to_server [C] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.mac_algorithms_server_to_client [S] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(!client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
/* ssh.compression_algorithms_client_to_server [C] */
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.compression_algorithms_server_to_client [S] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(!client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
offset += len;
} else
offset += 4 + len;
/* ssh.languages_client_to_server [None] */
/* ssh.languages_server_to_client [None] */
#ifdef SSH_DEBUG
printf("[SSH] %s\n", buf);
#endif
return(buf_out_len);
invalid_payload:
#ifdef SSH_DEBUG
printf("[SSH] Invalid packet payload\n");
#endif
return(0);
} | 870 | True | 1 |
CVE-2020-11939 | 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/ntop/nDPI/commit/7ce478a58b4dd29a8d1e6f4e9df2f778613d9202', 'name': 'https://github.com/ntop/nDPI/commit/7ce478a58b4dd29a8d1e6f4e9df2f778613d9202', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://securitylab.github.com/advisories/GHSL-2020-051_052-ntop-ndpi', 'name': 'https://securitylab.github.com/advisories/GHSL-2020-051_052-ntop-ndpi', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-190'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "In nDPI through 3.2 Stable, the SSH protocol dissector has multiple KEXINIT integer overflows that result in a controlled remote heap overflow in concat_hash_string in ssh.c. Due to the granular nature of the overflow primitive and the ability to control both the contents and layout of the nDPI library's heap memory through remote input, this vulnerability may be abused to achieve full Remote Code Execution against any network inspection stack that is linked against nDPI and uses it to perform network traffic analysis."}] | 2021-07-21T11:39Z | 2020-04-23T15: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 | Philippe Antoine | 2020-04-02 16:48:35+02:00 | ssh: fixing unsigned overflow leading to heap overflow
cf GHSL-2020-051 | 7ce478a58b4dd29a8d1e6f4e9df2f778613d9202 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | concat_hash_string | concat_hash_string( struct ndpi_packet_struct * packet , char * buf , u_int8_t client_hash) | ['packet', 'buf', 'client_hash'] | static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet,
char *buf, u_int8_t client_hash) {
u_int16_t offset = 22, buf_out_len = 0;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]);
offset += 4;
/* -1 for ';' */
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
/* ssh.kex_algorithms [C/S] */
strncpy(buf, (const char *)&packet->payload[offset], buf_out_len = len);
buf[buf_out_len++] = ';';
offset += len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.server_host_key_algorithms [None] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.encryption_algorithms_client_to_server [C] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.encryption_algorithms_server_to_client [S] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(!client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.mac_algorithms_client_to_server [C] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.mac_algorithms_server_to_client [S] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(!client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
buf[buf_out_len++] = ';';
offset += len;
} else
offset += 4 + len;
/* ssh.compression_algorithms_client_to_server [C] */
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
offset += len;
} else
offset += 4 + len;
if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)
goto invalid_payload;
/* ssh.compression_algorithms_server_to_client [S] */
len = ntohl(*(u_int32_t*)&packet->payload[offset]);
if(!client_hash) {
offset += 4;
if((offset >= packet->payload_packet_len) || (len >= packet->payload_packet_len-offset-1))
goto invalid_payload;
strncpy(&buf[buf_out_len], (const char *)&packet->payload[offset], len);
buf_out_len += len;
offset += len;
} else
offset += 4 + len;
/* ssh.languages_client_to_server [None] */
/* ssh.languages_server_to_client [None] */
#ifdef SSH_DEBUG
printf("[SSH] %s\n", buf);
#endif
return(buf_out_len);
invalid_payload:
#ifdef SSH_DEBUG
printf("[SSH] Invalid packet payload\n");
#endif
return(0);
} | 870 | True | 1 |
CVE-2020-15476 | 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://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21780', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21780', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/ntop/nDPI/commit/b69177be2fbe01c2442239a61832c44e40136c05', 'name': 'https://github.com/ntop/nDPI/commit/b69177be2fbe01c2442239a61832c44e40136c05', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00052.html', 'name': '[debian-lts-announce] 20200829 [SECURITY] [DLA 2354-1] ndpi security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, the Oracle protocol dissector has a heap-based buffer over-read in ndpi_search_oracle in lib/protocols/oracle.c.'}] | 2020-08-30T00:15Z | 2020-07-01T11: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 | Philippe Antoine | 2020-05-10 15:04:23+02:00 | Adds bound check in oracle protocol
Found by oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21780 | b69177be2fbe01c2442239a61832c44e40136c05 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | ndpi_search_oracle | ndpi_search_oracle( struct ndpi_detection_module_struct * ndpi_struct , struct ndpi_flow_struct * flow) | ['ndpi_struct', 'flow'] | void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &flow->packet;
u_int16_t dport = 0, sport = 0;
NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n");
if(packet->tcp != NULL) {
sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest);
NDPI_LOG_DBG2(ndpi_struct, "calculating ORACLE over tcp\n");
/* Oracle Database 9g,10g,11g */
if ((dport == 1521 || sport == 1521)
&& (((packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))
|| ((packet->payload_packet_len >= 232) && ((packet->payload[0] == 0x00) || (packet->payload[0] == 0x01))
&& (packet->payload[1] != 0x00)
&& (packet->payload[2] == 0x00)
&& (packet->payload[3] == 0x00)))) {
NDPI_LOG_INFO(ndpi_struct, "found oracle\n");
ndpi_int_oracle_add_connection(ndpi_struct, flow);
} else if (packet->payload_packet_len == 213 && packet->payload[0] == 0x00 &&
packet->payload[1] == 0xd5 && packet->payload[2] == 0x00 &&
packet->payload[3] == 0x00 ) {
NDPI_LOG_INFO(ndpi_struct, "found oracle\n");
ndpi_int_oracle_add_connection(ndpi_struct, flow);
}
} else {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
} | 282 | True | 1 |
CVE-2020-15473 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/ntop/nDPI/commit/8e7b1ea7a136cc4e4aa9880072ec2d69900a825e', 'name': 'https://github.com/ntop/nDPI/commit/8e7b1ea7a136cc4e4aa9880072ec2d69900a825e', '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:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, the OpenVPN dissector is vulnerable to a heap-based buffer over-read in ndpi_search_openvpn in lib/protocols/openvpn.c.'}] | 2020-07-06T19:23Z | 2020-07-01T11: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 | Luca Deri | 2020-05-15 21:10:37+02:00 | Fix for potential heap-buffer-overflow in ndpi_search_openvpn | 8e7b1ea7a136cc4e4aa9880072ec2d69900a825e | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | ndpi_search_openvpn | ndpi_search_openvpn( struct ndpi_detection_module_struct * ndpi_struct , struct ndpi_flow_struct * flow) | ['ndpi_struct', 'flow'] | void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
struct ndpi_flow_struct* flow) {
struct ndpi_packet_struct* packet = &flow->packet;
const u_int8_t * ovpn_payload = packet->payload;
const u_int8_t * session_remote;
u_int8_t opcode;
u_int8_t alen;
int8_t hmac_size;
int8_t failed = 0;
if(packet->payload_packet_len >= 40) {
// skip openvpn TCP transport packet size
if(packet->tcp != NULL)
ovpn_payload += 2;
opcode = ovpn_payload[0] & P_OPCODE_MASK;
if(packet->udp) {
#ifdef DEBUG
printf("[packet_id: %u][opcode: %u][Packet ID: %d][%u <-> %u][len: %u]\n",
flow->num_processed_pkts,
opcode, check_pkid_and_detect_hmac_size(ovpn_payload),
htons(packet->udp->source), htons(packet->udp->dest), packet->payload_packet_len);
#endif
if(
(flow->num_processed_pkts == 1)
&& (
((packet->payload_packet_len == 112)
&& ((opcode == 168) || (opcode == 192))
)
|| ((packet->payload_packet_len == 80)
&& ((opcode == 184) || (opcode == 88) || (opcode == 160) || (opcode == 168) || (opcode == 200)))
)) {
NDPI_LOG_INFO(ndpi_struct,"found openvpn\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, NDPI_PROTOCOL_UNKNOWN);
return;
}
}
if(flow->ovpn_counter < P_HARD_RESET_CLIENT_MAX_COUNT && (opcode == P_CONTROL_HARD_RESET_CLIENT_V1 ||
opcode == P_CONTROL_HARD_RESET_CLIENT_V2)) {
if(check_pkid_and_detect_hmac_size(ovpn_payload) > 0) {
memcpy(flow->ovpn_session_id, ovpn_payload+1, 8);
NDPI_LOG_DBG2(ndpi_struct,
"session key: %02x%02x%02x%02x%02x%02x%02x%02x\n",
flow->ovpn_session_id[0], flow->ovpn_session_id[1], flow->ovpn_session_id[2], flow->ovpn_session_id[3],
flow->ovpn_session_id[4], flow->ovpn_session_id[5], flow->ovpn_session_id[6], flow->ovpn_session_id[7]);
}
} else if(flow->ovpn_counter >= 1 && flow->ovpn_counter <= P_HARD_RESET_CLIENT_MAX_COUNT &&
(opcode == P_CONTROL_HARD_RESET_SERVER_V1 || opcode == P_CONTROL_HARD_RESET_SERVER_V2)) {
hmac_size = check_pkid_and_detect_hmac_size(ovpn_payload);
if(hmac_size > 0) {
alen = ovpn_payload[P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size)];
if (alen > 0) {
session_remote = ovpn_payload + P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size) + 1 + alen * 4;
if(memcmp(flow->ovpn_session_id, session_remote, 8) == 0) {
NDPI_LOG_INFO(ndpi_struct,"found openvpn\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, NDPI_PROTOCOL_UNKNOWN);
return;
} else {
NDPI_LOG_DBG2(ndpi_struct,
"key mismatch: %02x%02x%02x%02x%02x%02x%02x%02x\n",
session_remote[0], session_remote[1], session_remote[2], session_remote[3],
session_remote[4], session_remote[5], session_remote[6], session_remote[7]);
failed = 1;
}
} else
failed = 1;
} else
failed = 1;
} else
failed = 1;
flow->ovpn_counter++;
if(failed) {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
}
} | 535 | True | 1 |
CVE-2020-15472 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/ntop/nDPI/commit/b7e666e465f138ae48ab81976726e67deed12701', 'name': 'https://github.com/ntop/nDPI/commit/b7e666e465f138ae48ab81976726e67deed12701', '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:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, the H.323 dissector is vulnerable to a heap-based buffer over-read in ndpi_search_h323 in lib/protocols/h323.c, as demonstrated by a payload packet length that is too short.'}] | 2020-07-06T19:21Z | 2020-07-01T11: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 | Luca Deri | 2020-05-19 08:31:05+02:00 | Added fix to avoid potential heap buffer overflow in H.323 dissector
Modified HTTP report information to make it closer to the HTTP field names | b7e666e465f138ae48ab81976726e67deed12701 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | printFlow | printFlow( u_int16_t id , struct ndpi_flow_info * flow , u_int16_t thread_id) | ['id', 'flow', 'thread_id'] | static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t thread_id) {
FILE *out = results_file ? results_file : stdout;
u_int8_t known_tls;
char buf[32], buf1[64];
u_int i;
double dos_ge_score;
double dos_slow_score;
double dos_hulk_score;
double ddos_score;
double hearthbleed_score;
double ftp_patator_score;
double ssh_patator_score;
double inf_score;
if(csv_fp != NULL) {
float data_ratio = ndpi_data_ratio(flow->src2dst_bytes, flow->dst2src_bytes);
double f = (double)flow->first_seen, l = (double)flow->last_seen;
/* PLEASE KEEP IN SYNC WITH printCSVHeader() */
dos_ge_score = Dos_goldeneye_score(flow);
dos_slow_score = Dos_slow_score(flow);
dos_hulk_score = Dos_hulk_score(flow);
ddos_score = Ddos_score(flow);
hearthbleed_score = Hearthbleed_score(flow);
ftp_patator_score = Ftp_patator_score(flow);
ssh_patator_score = Ssh_patator_score(flow);
inf_score = Infiltration_score(flow);
double benign_score = dos_ge_score < 1 && dos_slow_score < 1 && \
dos_hulk_score < 1 && ddos_score < 1 && hearthbleed_score < 1 && \
ftp_patator_score < 1 && ssh_patator_score < 1 && inf_score < 1 ? 1.1 : 0;
fprintf(csv_fp, "%u,%u,%.3f,%.3f,%.3f,%s,%u,%s,%u,",
flow->flow_id,
flow->protocol,
f/1000.0, l/1000.0,
(l-f)/1000.0,
flow->src_name, ntohs(flow->src_port),
flow->dst_name, ntohs(flow->dst_port)
);
fprintf(csv_fp, "%s,",
ndpi_protocol2id(ndpi_thread_info[thread_id].workflow->ndpi_struct,
flow->detected_protocol, buf, sizeof(buf)));
fprintf(csv_fp, "%s,%s,",
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
flow->detected_protocol, buf, sizeof(buf)),
flow->host_server_name);
fprintf(csv_fp, "%.4lf,%.4lf,%.4lf,%.4lf,%.4lf,%.4lf,%.4lf,%.4lf,%.4lf,", \
benign_score, dos_slow_score, dos_ge_score, dos_hulk_score, \
ddos_score, hearthbleed_score, ftp_patator_score, \
ssh_patator_score, inf_score);
fprintf(csv_fp, "%u,%llu,%llu,", flow->src2dst_packets,
(long long unsigned int) flow->src2dst_bytes, (long long unsigned int) flow->src2dst_goodput_bytes);
fprintf(csv_fp, "%u,%llu,%llu,", flow->dst2src_packets,
(long long unsigned int) flow->dst2src_bytes, (long long unsigned int) flow->dst2src_goodput_bytes);
fprintf(csv_fp, "%.3f,%s,", data_ratio, ndpi_data_ratio2str(data_ratio));
fprintf(csv_fp, "%.1f,%.1f,", 100.0*((float)flow->src2dst_goodput_bytes / (float)(flow->src2dst_bytes+1)),
100.0*((float)flow->dst2src_goodput_bytes / (float)(flow->dst2src_bytes+1)));
/* IAT (Inter Arrival Time) */
fprintf(csv_fp, "%u,%.1f,%u,%.1f,",
ndpi_data_min(flow->iat_flow), ndpi_data_average(flow->iat_flow), ndpi_data_max(flow->iat_flow), ndpi_data_stddev(flow->iat_flow));
fprintf(csv_fp, "%u,%.1f,%u,%.1f,%u,%.1f,%u,%.1f,",
ndpi_data_min(flow->iat_c_to_s), ndpi_data_average(flow->iat_c_to_s), ndpi_data_max(flow->iat_c_to_s), ndpi_data_stddev(flow->iat_c_to_s),
ndpi_data_min(flow->iat_s_to_c), ndpi_data_average(flow->iat_s_to_c), ndpi_data_max(flow->iat_s_to_c), ndpi_data_stddev(flow->iat_s_to_c));
/* Packet Length */
fprintf(csv_fp, "%u,%.1f,%u,%.1f,%u,%.1f,%u,%.1f,",
ndpi_data_min(flow->pktlen_c_to_s), ndpi_data_average(flow->pktlen_c_to_s), ndpi_data_max(flow->pktlen_c_to_s), ndpi_data_stddev(flow->pktlen_c_to_s),
ndpi_data_min(flow->pktlen_s_to_c), ndpi_data_average(flow->pktlen_s_to_c), ndpi_data_max(flow->pktlen_s_to_c), ndpi_data_stddev(flow->pktlen_s_to_c));
/* TCP flags */
fprintf(csv_fp, "%d,%d,%d,%d,%d,%d,%d,%d,", flow->cwr_count, flow->ece_count, flow->urg_count, flow->ack_count, flow->psh_count, flow->rst_count, flow->syn_count, flow->fin_count);
fprintf(csv_fp, "%d,%d,%d,%d,%d,%d,%d,%d,", flow->src2dst_cwr_count, flow->src2dst_ece_count, flow->src2dst_urg_count, flow->src2dst_ack_count, flow->src2dst_psh_count, flow->src2dst_rst_count, flow->src2dst_syn_count, flow->src2dst_fin_count);
fprintf(csv_fp, "%d,%d,%d,%d,%d,%d,%d,%d,", flow->dst2src_cwr_count, flow->ece_count, flow->urg_count, flow->ack_count, flow->psh_count, flow->rst_count, flow->syn_count, flow->fin_count);
/* TCP window */
fprintf(csv_fp, "%u,%u,", flow->c_to_s_init_win, flow->s_to_c_init_win);
fprintf(csv_fp, "%s,%s,",
(flow->ssh_tls.client_requested_server_name[0] != '\0') ? flow->ssh_tls.client_requested_server_name : "",
(flow->ssh_tls.server_info[0] != '\0') ? flow->ssh_tls.server_info : "");
fprintf(csv_fp, "%s,%s,%s,%s,%s,",
(flow->ssh_tls.ssl_version != 0) ? ndpi_ssl_version2str(flow->ssh_tls.ssl_version, &known_tls) : "0",
(flow->ssh_tls.ja3_client[0] != '\0') ? flow->ssh_tls.ja3_client : "",
(flow->ssh_tls.ja3_client[0] != '\0') ? is_unsafe_cipher(flow->ssh_tls.client_unsafe_cipher) : "0",
(flow->ssh_tls.ja3_server[0] != '\0') ? flow->ssh_tls.ja3_server : "",
(flow->ssh_tls.ja3_server[0] != '\0') ? is_unsafe_cipher(flow->ssh_tls.server_unsafe_cipher) : "0");
fprintf(csv_fp, "%s,%s,",
flow->ssh_tls.tls_alpn ? flow->ssh_tls.tls_alpn : "",
flow->ssh_tls.tls_supported_versions ? flow->ssh_tls.tls_supported_versions : ""
);
fprintf(csv_fp, "%s,%s,",
flow->ssh_tls.tls_issuerDN ? flow->ssh_tls.tls_issuerDN : "",
flow->ssh_tls.tls_subjectDN ? flow->ssh_tls.tls_subjectDN : ""
);
fprintf(csv_fp, "%s,%s",
(flow->ssh_tls.client_hassh[0] != '\0') ? flow->ssh_tls.client_hassh : "",
(flow->ssh_tls.server_hassh[0] != '\0') ? flow->ssh_tls.server_hassh : ""
);
fprintf(csv_fp, ",%s", flow->info);
}
if((verbose != 1) && (verbose != 2)) {
if(csv_fp && enable_joy_stats) {
flowGetBDMeanandVariance(flow);
}
if(csv_fp)
fprintf(csv_fp, "\n");
return;
}
if(csv_fp || (verbose > 1)) {
#if 1
fprintf(out, "\t%u", id);
#else
fprintf(out, "\t%u(%u)", id, flow->flow_id);
#endif
fprintf(out, "\t%s ", ipProto2Name(flow->protocol));
fprintf(out, "%s%s%s:%u %s %s%s%s:%u ",
(flow->ip_version == 6) ? "[" : "",
flow->src_name, (flow->ip_version == 6) ? "]" : "", ntohs(flow->src_port),
flow->bidirectional ? "<->" : "->",
(flow->ip_version == 6) ? "[" : "",
flow->dst_name, (flow->ip_version == 6) ? "]" : "", ntohs(flow->dst_port)
);
if(flow->vlan_id > 0) fprintf(out, "[VLAN: %u]", flow->vlan_id);
if(enable_payload_analyzer) fprintf(out, "[flowId: %u]", flow->flow_id);
}
if(enable_joy_stats) {
/* Print entropy values for monitored flows. */
flowGetBDMeanandVariance(flow);
fflush(out);
fprintf(out, "[score: %.4f]", flow->entropy.score);
}
if(csv_fp) fprintf(csv_fp, "\n");
fprintf(out, "[proto: ");
if(flow->tunnel_type != ndpi_no_tunnel)
fprintf(out, "%s:", ndpi_tunnel2str(flow->tunnel_type));
fprintf(out, "%s/%s]",
ndpi_protocol2id(ndpi_thread_info[thread_id].workflow->ndpi_struct,
flow->detected_protocol, buf, sizeof(buf)),
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
flow->detected_protocol, buf1, sizeof(buf1)));
if(flow->detected_protocol.category != 0)
fprintf(out, "[cat: %s/%u]",
ndpi_category_get_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
flow->detected_protocol.category),
(unsigned int)flow->detected_protocol.category);
fprintf(out, "[%u pkts/%llu bytes ", flow->src2dst_packets, (long long unsigned int) flow->src2dst_bytes);
fprintf(out, "%s %u pkts/%llu bytes]",
(flow->dst2src_packets > 0) ? "<->" : "->",
flow->dst2src_packets, (long long unsigned int) flow->dst2src_bytes);
fprintf(out, "[Goodput ratio: %.0f/%.0f]",
100.0*((float)flow->src2dst_goodput_bytes / (float)(flow->src2dst_bytes+1)),
100.0*((float)flow->dst2src_goodput_bytes / (float)(flow->dst2src_bytes+1)));
if(flow->last_seen > flow->first_seen)
fprintf(out, "[%.2f sec]", ((float)(flow->last_seen - flow->first_seen))/(float)1000);
else
fprintf(out, "[< 1 sec]");
if(flow->telnet.username[0] != '\0') fprintf(out, "[Username: %s]", flow->telnet.username);
if(flow->telnet.password[0] != '\0') fprintf(out, "[Password: %s]", flow->telnet.password);
if(flow->host_server_name[0] != '\0') fprintf(out, "[Host: %s]", flow->host_server_name);
if(flow->info[0] != '\0') fprintf(out, "[%s]", flow->info);
if(flow->flow_extra_info[0] != '\0') fprintf(out, "[%s]", flow->flow_extra_info);
if((flow->src2dst_packets+flow->dst2src_packets) > 5) {
if(flow->iat_c_to_s && flow->iat_s_to_c) {
float data_ratio = ndpi_data_ratio(flow->src2dst_bytes, flow->dst2src_bytes);
fprintf(out, "[bytes ratio: %.3f (%s)]", data_ratio, ndpi_data_ratio2str(data_ratio));
/* IAT (Inter Arrival Time) */
fprintf(out, "[IAT c2s/s2c min/avg/max/stddev: %u/%u %.0f/%.0f %u/%u %.0f/%.0f]",
ndpi_data_min(flow->iat_c_to_s), ndpi_data_min(flow->iat_s_to_c),
(float)ndpi_data_average(flow->iat_c_to_s), (float)ndpi_data_average(flow->iat_s_to_c),
ndpi_data_max(flow->iat_c_to_s), ndpi_data_max(flow->iat_s_to_c),
(float)ndpi_data_stddev(flow->iat_c_to_s), (float)ndpi_data_stddev(flow->iat_s_to_c));
/* Packet Length */
fprintf(out, "[Pkt Len c2s/s2c min/avg/max/stddev: %u/%u %.0f/%.0f %u/%u %.0f/%.0f]",
ndpi_data_min(flow->pktlen_c_to_s), ndpi_data_min(flow->pktlen_s_to_c),
ndpi_data_average(flow->pktlen_c_to_s), ndpi_data_average(flow->pktlen_s_to_c),
ndpi_data_max(flow->pktlen_c_to_s), ndpi_data_max(flow->pktlen_s_to_c),
ndpi_data_stddev(flow->pktlen_c_to_s), ndpi_data_stddev(flow->pktlen_s_to_c));
}
}
if(flow->http.url[0] != '\0') {
ndpi_risk_enum risk = ndpi_validate_url(flow->http.url);
if(risk != NDPI_NO_RISK)
NDPI_SET_BIT(flow->risk, risk);
fprintf(out, "[URL: %s[StatusCode: %u]",
flow->http.url, flow->http.response_status_code);
if(flow->http.content_type[0] != '\0')
fprintf(out, "[ContentType: %s]", flow->http.content_type);
if(flow->http.user_agent[0] != '\0')
fprintf(out, "[UserAgent: %s]", flow->http.user_agent);
}
if(flow->risk) {
u_int i;
fprintf(out, "[Risk: ");
for(i=0; i<NDPI_MAX_RISK; i++)
if(NDPI_ISSET_BIT(flow->risk, i))
fprintf(out, "** %s **", ndpi_risk2str(i));
fprintf(out, "]");
}
if(flow->ssh_tls.ssl_version != 0) fprintf(out, "[%s]", ndpi_ssl_version2str(flow->ssh_tls.ssl_version, &known_tls));
if(flow->ssh_tls.client_requested_server_name[0] != '\0') fprintf(out, "[Client: %s]", flow->ssh_tls.client_requested_server_name);
if(flow->ssh_tls.client_hassh[0] != '\0') fprintf(out, "[HASSH-C: %s]", flow->ssh_tls.client_hassh);
if(flow->ssh_tls.ja3_client[0] != '\0') fprintf(out, "[JA3C: %s%s]", flow->ssh_tls.ja3_client,
print_cipher(flow->ssh_tls.client_unsafe_cipher));
if(flow->ssh_tls.server_info[0] != '\0') fprintf(out, "[Server: %s]", flow->ssh_tls.server_info);
if(flow->ssh_tls.server_names) fprintf(out, "[ServerNames: %s]", flow->ssh_tls.server_names);
if(flow->ssh_tls.server_hassh[0] != '\0') fprintf(out, "[HASSH-S: %s]", flow->ssh_tls.server_hassh);
if(flow->ssh_tls.ja3_server[0] != '\0') fprintf(out, "[JA3S: %s%s]", flow->ssh_tls.ja3_server,
print_cipher(flow->ssh_tls.server_unsafe_cipher));
if(flow->ssh_tls.tls_issuerDN) fprintf(out, "[Issuer: %s]", flow->ssh_tls.tls_issuerDN);
if(flow->ssh_tls.tls_subjectDN) fprintf(out, "[Subject: %s]", flow->ssh_tls.tls_subjectDN);
if((flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|| (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_TLS)) {
if(flow->ssh_tls.sha1_cert_fingerprint_set) {
fprintf(out, "[Certificate SHA-1: ");
for(i=0; i<20; i++)
fprintf(out, "%s%02X", (i > 0) ? ":" : "",
flow->ssh_tls.sha1_cert_fingerprint[i] & 0xFF);
fprintf(out, "]");
}
}
if(flow->ssh_tls.notBefore && flow->ssh_tls.notAfter) {
char notBefore[32], notAfter[32];
struct tm a, b;
struct tm *before = gmtime_r(&flow->ssh_tls.notBefore, &a);
struct tm *after = gmtime_r(&flow->ssh_tls.notAfter, &b);
strftime(notBefore, sizeof(notBefore), "%F %T", before);
strftime(notAfter, sizeof(notAfter), "%F %T", after);
fprintf(out, "[Validity: %s - %s]", notBefore, notAfter);
}
if(flow->ssh_tls.server_cipher != '\0') fprintf(out, "[Cipher: %s]", ndpi_cipher2str(flow->ssh_tls.server_cipher));
if(flow->bittorent_hash[0] != '\0') fprintf(out, "[BT Hash: %s]", flow->bittorent_hash);
if(flow->dhcp_fingerprint[0] != '\0') fprintf(out, "[DHCP Fingerprint: %s]", flow->dhcp_fingerprint);
if(flow->has_human_readeable_strings) fprintf(out, "[PLAIN TEXT (%s)]", flow->human_readeable_string_buffer);
fprintf(out, "\n");
} | 2654 | True | 1 |
CVE-2020-15472 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/ntop/nDPI/commit/b7e666e465f138ae48ab81976726e67deed12701', 'name': 'https://github.com/ntop/nDPI/commit/b7e666e465f138ae48ab81976726e67deed12701', '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:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, the H.323 dissector is vulnerable to a heap-based buffer over-read in ndpi_search_h323 in lib/protocols/h323.c, as demonstrated by a payload packet length that is too short.'}] | 2020-07-06T19:21Z | 2020-07-01T11: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 | Luca Deri | 2020-05-19 08:31:05+02:00 | Added fix to avoid potential heap buffer overflow in H.323 dissector
Modified HTTP report information to make it closer to the HTTP field names | b7e666e465f138ae48ab81976726e67deed12701 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | ndpi_search_h323 | ndpi_search_h323( struct ndpi_detection_module_struct * ndpi_struct , struct ndpi_flow_struct * flow) | ['ndpi_struct', 'flow'] | void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &flow->packet;
u_int16_t dport = 0, sport = 0;
NDPI_LOG_DBG(ndpi_struct, "search H323\n");
/*
The TPKT protocol is used by ISO 8072 (on port 102)
and H.323. So this check below is to avoid ambiguities
*/
if((packet->tcp != NULL) && (packet->tcp->dest != ntohs(102))) {
NDPI_LOG_DBG2(ndpi_struct, "calculated dport over tcp\n");
/* H323 */
if(packet->payload_packet_len >= 4
&& (packet->payload[0] == 0x03)
&& (packet->payload[1] == 0x00)) {
struct tpkt *t = (struct tpkt*)packet->payload;
u_int16_t len = ntohs(t->len);
if(packet->payload_packet_len == len) {
/*
We need to check if this packet is in reality
a RDP (Remote Desktop) packet encapsulated on TPTK
*/
if(packet->payload[4] == (packet->payload_packet_len - sizeof(struct tpkt) - 1)) {
/* ISO 8073/X.224 */
if((packet->payload[5] == 0xE0 /* CC Connect Request */)
|| (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) {
NDPI_LOG_INFO(ndpi_struct, "found RDP\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN);
return;
}
}
flow->l4.tcp.h323_valid_packets++;
if(flow->l4.tcp.h323_valid_packets >= 2) {
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
}
} else {
/* This is not H.323 */
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
return;
}
}
} else if(packet->udp != NULL) {
sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
NDPI_LOG_DBG2(ndpi_struct, "calculated dport over udp\n");
if(packet->payload_packet_len >= 6 && packet->payload[0] == 0x80 && packet->payload[1] == 0x08 &&
(packet->payload[2] == 0xe7 || packet->payload[2] == 0x26) &&
packet->payload[4] == 0x00 && packet->payload[5] == 0x00)
{
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
return;
}
/* H323 */
if(sport == 1719 || dport == 1719)
{
if(packet->payload[0] == 0x16 && packet->payload[1] == 0x80 && packet->payload[4] == 0x06 && packet->payload[5] == 0x00)
{
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
return;
}
else if(packet->payload_packet_len >= 20 && packet->payload_packet_len <= 117)
{
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
return;
}
else
{
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
return;
}
}
}
} | 509 | True | 1 |
CVE-2020-15471 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:N/A:P | NETWORK | LOW | NONE | PARTIAL | NONE | PARTIAL | 6.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | NONE | HIGH | 9.1 | CRITICAL | 3.9 | 5.2 | False | [{'url': 'https://github.com/ntop/nDPI/commit/61066fb106efa6d3d95b67e47b662de208b2b622', 'name': 'https://github.com/ntop/nDPI/commit/61066fb106efa6d3d95b67e47b662de208b2b622', '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:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, the packet parsing code is vulnerable to a heap-based buffer over-read in ndpi_parse_packet_line_info in lib/ndpi_main.c.'}] | 2020-07-06T18:51Z | 2020-07-01T11: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 | Luca Deri | 2020-05-29 21:43:06+02:00 | Added check for heap buffer overflow read | 61066fb106efa6d3d95b67e47b662de208b2b622 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | ndpi_parse_packet_line_info | ndpi_parse_packet_line_info( struct ndpi_detection_module_struct * ndpi_str , struct ndpi_flow_struct * flow) | ['ndpi_str', 'flow'] | void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow) {
u_int32_t a;
struct ndpi_packet_struct *packet = &flow->packet;
if((packet->payload_packet_len < 3) || (packet->payload == NULL))
return;
if(packet->packet_lines_parsed_complete != 0)
return;
packet->packet_lines_parsed_complete = 1;
ndpi_reset_packet_line_info(packet);
packet->line[packet->parsed_lines].ptr = packet->payload;
packet->line[packet->parsed_lines].len = 0;
for (a = 0; (a < packet->payload_packet_len) && (packet->parsed_lines < NDPI_MAX_PARSE_LINES_PER_PACKET); a++) {
if((a + 1) >= packet->payload_packet_len)
return; /* Return if only one byte remains (prevent invalid reads past end-of-buffer) */
if(get_u_int16_t(packet->payload, a) == ntohs(0x0d0a)) {
/* If end of line char sequence CR+NL "\r\n", process line */
if(((a + 3) <= packet->payload_packet_len)
&& (get_u_int16_t(packet->payload, a+2) == ntohs(0x0d0a))) {
/* \r\n\r\n */
int diff; /* No unsigned ! */
u_int32_t a1 = a + 4;
diff = ndpi_min(packet->payload_packet_len-a1, sizeof(flow->initial_binary_bytes));
if(diff > 0) {
memcpy(&flow->initial_binary_bytes, &packet->payload[a1], diff);
flow->initial_binary_bytes_len = diff;
}
}
packet->line[packet->parsed_lines].len =
(u_int16_t)(((unsigned long) &packet->payload[a]) - ((unsigned long) packet->line[packet->parsed_lines].ptr));
/* First line of a HTTP response parsing. Expected a "HTTP/1.? ???" */
if(packet->parsed_lines == 0 && packet->line[0].len >= NDPI_STATICSTRING_LEN("HTTP/1.X 200 ") &&
strncasecmp((const char *) packet->line[0].ptr, "HTTP/1.", NDPI_STATICSTRING_LEN("HTTP/1.")) == 0 &&
packet->line[0].ptr[NDPI_STATICSTRING_LEN("HTTP/1.X ")] > '0' && /* response code between 000 and 699 */
packet->line[0].ptr[NDPI_STATICSTRING_LEN("HTTP/1.X ")] < '6') {
packet->http_response.ptr = &packet->line[0].ptr[NDPI_STATICSTRING_LEN("HTTP/1.1 ")];
packet->http_response.len = packet->line[0].len - NDPI_STATICSTRING_LEN("HTTP/1.1 ");
packet->http_num_headers++;
/* Set server HTTP response code */
if(packet->payload_packet_len >= 12) {
char buf[4];
/* Set server HTTP response code */
strncpy(buf, (char *) &packet->payload[9], 3);
buf[3] = '\0';
flow->http.response_status_code = atoi(buf);
/* https://en.wikipedia.org/wiki/List_of_HTTP_status_codes */
if((flow->http.response_status_code < 100) || (flow->http.response_status_code > 509))
flow->http.response_status_code = 0; /* Out of range */
}
}
/* "Server:" header line in HTTP response */
if(packet->line[packet->parsed_lines].len > NDPI_STATICSTRING_LEN("Server:") + 1 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr,
"Server:", NDPI_STATICSTRING_LEN("Server:")) == 0) {
// some stupid clients omit a space and place the servername directly after the colon
if(packet->line[packet->parsed_lines].ptr[NDPI_STATICSTRING_LEN("Server:")] == ' ') {
packet->server_line.ptr =
&packet->line[packet->parsed_lines].ptr[NDPI_STATICSTRING_LEN("Server:") + 1];
packet->server_line.len =
packet->line[packet->parsed_lines].len - (NDPI_STATICSTRING_LEN("Server:") + 1);
} else {
packet->server_line.ptr = &packet->line[packet->parsed_lines].ptr[NDPI_STATICSTRING_LEN("Server:")];
packet->server_line.len = packet->line[packet->parsed_lines].len - NDPI_STATICSTRING_LEN("Server:");
}
packet->http_num_headers++;
}
/* "Host:" header line in HTTP request */
if(packet->line[packet->parsed_lines].len > 6 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Host:", 5) == 0) {
// some stupid clients omit a space and place the hostname directly after the colon
if(packet->line[packet->parsed_lines].ptr[5] == ' ') {
packet->host_line.ptr = &packet->line[packet->parsed_lines].ptr[6];
packet->host_line.len = packet->line[packet->parsed_lines].len - 6;
} else {
packet->host_line.ptr = &packet->line[packet->parsed_lines].ptr[5];
packet->host_line.len = packet->line[packet->parsed_lines].len - 5;
}
packet->http_num_headers++;
}
/* "X-Forwarded-For:" header line in HTTP request. Commonly used for HTTP proxies. */
if(packet->line[packet->parsed_lines].len > 17 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "X-Forwarded-For:", 16) == 0) {
// some stupid clients omit a space and place the hostname directly after the colon
if(packet->line[packet->parsed_lines].ptr[16] == ' ') {
packet->forwarded_line.ptr = &packet->line[packet->parsed_lines].ptr[17];
packet->forwarded_line.len = packet->line[packet->parsed_lines].len - 17;
} else {
packet->forwarded_line.ptr = &packet->line[packet->parsed_lines].ptr[16];
packet->forwarded_line.len = packet->line[packet->parsed_lines].len - 16;
}
packet->http_num_headers++;
}
/* "Content-Type:" header line in HTTP. */
if(packet->line[packet->parsed_lines].len > 14 &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-Type: ", 14) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-type: ", 14) == 0)) {
packet->content_line.ptr = &packet->line[packet->parsed_lines].ptr[14];
packet->content_line.len = packet->line[packet->parsed_lines].len - 14;
while ((packet->content_line.len > 0) && (packet->content_line.ptr[0] == ' '))
packet->content_line.len--, packet->content_line.ptr++;
packet->http_num_headers++;
}
/* "Content-Type:" header line in HTTP AGAIN. Probably a bogus response without space after ":" */
if((packet->content_line.len == 0) && (packet->line[packet->parsed_lines].len > 13) &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-type:", 13) == 0)) {
packet->content_line.ptr = &packet->line[packet->parsed_lines].ptr[13];
packet->content_line.len = packet->line[packet->parsed_lines].len - 13;
packet->http_num_headers++;
}
if(packet->content_line.len > 0) {
/* application/json; charset=utf-8 */
char separator[] = {';', '\r', '\0'};
int i;
for (i = 0; separator[i] != '\0'; i++) {
char *c = memchr((char *) packet->content_line.ptr, separator[i], packet->content_line.len);
if(c != NULL)
packet->content_line.len = c - (char *) packet->content_line.ptr;
}
}
/* "Accept:" header line in HTTP request. */
if(packet->line[packet->parsed_lines].len > 8 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Accept: ", 8) == 0) {
packet->accept_line.ptr = &packet->line[packet->parsed_lines].ptr[8];
packet->accept_line.len = packet->line[packet->parsed_lines].len - 8;
packet->http_num_headers++;
}
/* "Referer:" header line in HTTP request. */
if(packet->line[packet->parsed_lines].len > 9 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Referer: ", 9) == 0) {
packet->referer_line.ptr = &packet->line[packet->parsed_lines].ptr[9];
packet->referer_line.len = packet->line[packet->parsed_lines].len - 9;
packet->http_num_headers++;
}
/* "User-Agent:" header line in HTTP request. */
if(packet->line[packet->parsed_lines].len > 12 &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "User-Agent: ", 12) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "User-agent: ", 12) == 0)) {
packet->user_agent_line.ptr = &packet->line[packet->parsed_lines].ptr[12];
packet->user_agent_line.len = packet->line[packet->parsed_lines].len - 12;
packet->http_num_headers++;
}
/* "Content-Encoding:" header line in HTTP response (and request?). */
if(packet->line[packet->parsed_lines].len > 18 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-Encoding: ", 18) == 0) {
packet->http_encoding.ptr = &packet->line[packet->parsed_lines].ptr[18];
packet->http_encoding.len = packet->line[packet->parsed_lines].len - 18;
packet->http_num_headers++;
}
/* "Transfer-Encoding:" header line in HTTP. */
if(packet->line[packet->parsed_lines].len > 19 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Transfer-Encoding: ", 19) == 0) {
packet->http_transfer_encoding.ptr = &packet->line[packet->parsed_lines].ptr[19];
packet->http_transfer_encoding.len = packet->line[packet->parsed_lines].len - 19;
packet->http_num_headers++;
}
/* "Content-Length:" header line in HTTP. */
if(packet->line[packet->parsed_lines].len > 16 &&
((strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-Length: ", 16) == 0) ||
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "content-length: ", 16) == 0))) {
packet->http_contentlen.ptr = &packet->line[packet->parsed_lines].ptr[16];
packet->http_contentlen.len = packet->line[packet->parsed_lines].len - 16;
packet->http_num_headers++;
}
/* "Content-Disposition"*/
if(packet->line[packet->parsed_lines].len > 21 &&
((strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Content-Disposition: ", 21) == 0))) {
packet->content_disposition_line.ptr = &packet->line[packet->parsed_lines].ptr[21];
packet->content_disposition_line.len = packet->line[packet->parsed_lines].len - 21;
packet->http_num_headers++;
}
/* "Cookie:" header line in HTTP. */
if(packet->line[packet->parsed_lines].len > 8 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Cookie: ", 8) == 0) {
packet->http_cookie.ptr = &packet->line[packet->parsed_lines].ptr[8];
packet->http_cookie.len = packet->line[packet->parsed_lines].len - 8;
packet->http_num_headers++;
}
/* "Origin:" header line in HTTP. */
if(packet->line[packet->parsed_lines].len > 8 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Origin: ", 8) == 0) {
packet->http_origin.ptr = &packet->line[packet->parsed_lines].ptr[8];
packet->http_origin.len = packet->line[packet->parsed_lines].len - 8;
packet->http_num_headers++;
}
/* "X-Session-Type:" header line in HTTP. */
if(packet->line[packet->parsed_lines].len > 16 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "X-Session-Type: ", 16) == 0) {
packet->http_x_session_type.ptr = &packet->line[packet->parsed_lines].ptr[16];
packet->http_x_session_type.len = packet->line[packet->parsed_lines].len - 16;
packet->http_num_headers++;
}
/* Identification and counting of other HTTP headers.
* We consider the most common headers, but there are many others,
* which can be seen at references below:
* - https://tools.ietf.org/html/rfc7230
* - https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
*/
if((packet->line[packet->parsed_lines].len > 6 &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Date: ", 6) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Vary: ", 6) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "ETag: ", 6) == 0)) ||
(packet->line[packet->parsed_lines].len > 8 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Pragma: ", 8) == 0) ||
(packet->line[packet->parsed_lines].len > 9 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Expires: ", 9) == 0) ||
(packet->line[packet->parsed_lines].len > 12 &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Set-Cookie: ", 12) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Keep-Alive: ", 12) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Connection: ", 12) == 0)) ||
(packet->line[packet->parsed_lines].len > 15 &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Last-Modified: ", 15) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Accept-Ranges: ", 15) == 0)) ||
(packet->line[packet->parsed_lines].len > 17 &&
(strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Accept-Language: ", 17) == 0 ||
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr, "Accept-Encoding: ", 17) == 0)) ||
(packet->line[packet->parsed_lines].len > 27 &&
strncasecmp((const char *) packet->line[packet->parsed_lines].ptr,
"Upgrade-Insecure-Requests: ", 27) == 0)) {
/* Just count. In the future, if needed, this if can be splited to parse these headers */
packet->http_num_headers++;
}
if(packet->line[packet->parsed_lines].len == 0) {
packet->empty_line_position = a;
packet->empty_line_position_set = 1;
}
if(packet->parsed_lines >= (NDPI_MAX_PARSE_LINES_PER_PACKET - 1))
return;
packet->parsed_lines++;
packet->line[packet->parsed_lines].ptr = &packet->payload[a + 2];
packet->line[packet->parsed_lines].len = 0;
a++; /* next char in the payload */
}
}
if(packet->parsed_lines >= 1) {
packet->line[packet->parsed_lines].len =
(u_int16_t)(((unsigned long) &packet->payload[packet->payload_packet_len]) -
((unsigned long) packet->line[packet->parsed_lines].ptr));
packet->parsed_lines++;
}
} | 2869 | True | 1 |
CVE-2020-15474 | 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/ntop/nDPI/commit/23594f036536468072198a57c59b6e9d63caf6ce', 'name': 'https://github.com/ntop/nDPI/commit/23594f036536468072198a57c59b6e9d63caf6ce', '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:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, there is a stack overflow in extractRDNSequence in lib/protocols/tls.c.'}] | 2020-07-06T19:36Z | 2020-07-01T11: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 | Toni Uhlig | 2020-06-17 23:00:20+02:00 | Fixed stack overflow caused by missing length check
Signed-off-by: Toni Uhlig <[email protected]> | 23594f036536468072198a57c59b6e9d63caf6ce | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | processCertificateElements | processCertificateElements( struct ndpi_detection_module_struct * ndpi_struct , struct ndpi_flow_struct * flow , u_int16_t p_offset , u_int16_t certificate_len) | ['ndpi_struct', 'flow', 'p_offset', 'certificate_len'] | static void processCertificateElements(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t p_offset, u_int16_t certificate_len) {
struct ndpi_packet_struct *packet = &flow->packet;
u_int num_found = 0, i;
char buffer[64] = { '\0' }, rdnSeqBuf[1024] = { '\0' };
u_int rdn_len = 0;
#ifdef DEBUG_TLS
printf("[TLS] %s() [offset: %u][certificate_len: %u]\n", __FUNCTION__, p_offset, certificate_len);
#endif
/* Check after handshake protocol header (5 bytes) and message header (4 bytes) */
for(i = p_offset; i < certificate_len; i++) {
/*
See https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.sec.doc/q009860_.htm
for X.509 certificate labels
*/
if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x04) && (packet->payload[i+2] == 0x03)) {
/* Common Name */
int rc = extractRDNSequence(packet, i, buffer, sizeof(buffer), rdnSeqBuf, &rdn_len, sizeof(rdnSeqBuf), "CN");
if(rc == -1) break;
#ifdef DEBUG_TLS
printf("[TLS] %s() [%s][%s: %s]\n", __FUNCTION__, (num_found == 0) ? "Subject" : "Issuer", "Common Name", buffer);
#endif
} else if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x04) && (packet->payload[i+2] == 0x06)) {
/* Country */
int rc = extractRDNSequence(packet, i, buffer, sizeof(buffer), rdnSeqBuf, &rdn_len, sizeof(rdnSeqBuf), "C");
if(rc == -1) break;
#ifdef DEBUG_TLS
printf("[TLS] %s() [%s][%s: %s]\n", __FUNCTION__, (num_found == 0) ? "Subject" : "Issuer", "Country", buffer);
#endif
} else if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x04) && (packet->payload[i+2] == 0x07)) {
/* Locality */
int rc = extractRDNSequence(packet, i, buffer, sizeof(buffer), rdnSeqBuf, &rdn_len, sizeof(rdnSeqBuf), "L");
if(rc == -1) break;
#ifdef DEBUG_TLS
printf("[TLS] %s() [%s][%s: %s]\n", __FUNCTION__, (num_found == 0) ? "Subject" : "Issuer", "Locality", buffer);
#endif
} else if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x04) && (packet->payload[i+2] == 0x08)) {
/* State or Province */
int rc = extractRDNSequence(packet, i, buffer, sizeof(buffer), rdnSeqBuf, &rdn_len, sizeof(rdnSeqBuf), "ST");
if(rc == -1) break;
#ifdef DEBUG_TLS
printf("[TLS] %s() [%s][%s: %s]\n", __FUNCTION__, (num_found == 0) ? "Subject" : "Issuer", "State or Province", buffer);
#endif
} else if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x04) && (packet->payload[i+2] == 0x0a)) {
/* Organization Name */
int rc = extractRDNSequence(packet, i, buffer, sizeof(buffer), rdnSeqBuf, &rdn_len, sizeof(rdnSeqBuf), "O");
if(rc == -1) break;
#ifdef DEBUG_TLS
printf("[TLS] %s() [%s][%s: %s]\n", __FUNCTION__, (num_found == 0) ? "Subject" : "Issuer", "Organization Name", buffer);
#endif
} else if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x04) && (packet->payload[i+2] == 0x0b)) {
/* Organization Unit */
int rc = extractRDNSequence(packet, i, buffer, sizeof(buffer), rdnSeqBuf, &rdn_len, sizeof(rdnSeqBuf), "OU");
if(rc == -1) break;
#ifdef DEBUG_TLS
printf("[TLS] %s() [%s][%s: %s]\n", __FUNCTION__, (num_found == 0) ? "Subject" : "Issuer", "Organization Unit", buffer);
#endif
} else if((packet->payload[i] == 0x30) && (packet->payload[i+1] == 0x1e) && (packet->payload[i+2] == 0x17)) {
/* Certificate Validity */
u_int8_t len = packet->payload[i+3];
u_int offset = i+4;
if(num_found == 0) {
num_found++;
#ifdef DEBUG_TLS
printf("[TLS] %s() IssuerDN [%s]\n", __FUNCTION__, rdnSeqBuf);
#endif
if(rdn_len) flow->protos.stun_ssl.ssl.issuerDN = ndpi_strdup(rdnSeqBuf);
rdn_len = 0; /* Reset buffer */
}
if((offset+len) < packet->payload_packet_len) {
char utcDate[32];
#ifdef DEBUG_TLS
u_int j;
printf("[CERTIFICATE] notBefore [len: %u][", len);
for(j=0; j<len; j++) printf("%c", packet->payload[i+4+j]);
printf("]\n");
#endif
if(len < (sizeof(utcDate)-1)) {
struct tm utc;
utc.tm_isdst = -1; /* Not set by strptime */
strncpy(utcDate, (const char*)&packet->payload[i+4], len);
utcDate[len] = '\0';
/* 141021000000Z */
if(strptime(utcDate, "%y%m%d%H%M%SZ", &utc) != NULL) {
flow->protos.stun_ssl.ssl.notBefore = timegm(&utc);
#ifdef DEBUG_TLS
printf("[CERTIFICATE] notBefore %u [%s]\n",
flow->protos.stun_ssl.ssl.notBefore, utcDate);
#endif
}
}
offset += len;
if((offset+1) < packet->payload_packet_len) {
len = packet->payload[offset+1];
offset += 2;
if((offset+len) < packet->payload_packet_len) {
u_int32_t time_sec = flow->packet.current_time_ms / 1000;
#ifdef DEBUG_TLS
u_int j;
printf("[CERTIFICATE] notAfter [len: %u][", len);
for(j=0; j<len; j++) printf("%c", packet->payload[offset+j]);
printf("]\n");
#endif
if(len < (sizeof(utcDate)-1)) {
struct tm utc;
utc.tm_isdst = -1; /* Not set by strptime */
strncpy(utcDate, (const char*)&packet->payload[offset], len);
utcDate[len] = '\0';
/* 141021000000Z */
if(strptime(utcDate, "%y%m%d%H%M%SZ", &utc) != NULL) {
flow->protos.stun_ssl.ssl.notAfter = timegm(&utc);
#ifdef DEBUG_TLS
printf("[CERTIFICATE] notAfter %u [%s]\n",
flow->protos.stun_ssl.ssl.notAfter, utcDate);
#endif
}
}
if((time_sec < flow->protos.stun_ssl.ssl.notBefore)
|| (time_sec > flow->protos.stun_ssl.ssl.notAfter))
NDPI_SET_BIT(flow->risk, NDPI_TLS_CERTIFICATE_EXPIRED); /* Certificate expired */
}
}
}
} else if((packet->payload[i] == 0x55) && (packet->payload[i+1] == 0x1d) && (packet->payload[i+2] == 0x11)) {
/* Organization OID: 2.5.29.17 (subjectAltName) */
u_int8_t matched_name = 0;
#ifdef DEBUG_TLS
printf("******* [TLS] Found subjectAltName\n");
#endif
i += 3 /* skip the initial patten 55 1D 11 */;
i++; /* skip the first type, 0x04 == BIT STRING, and jump to it's length */
if(i < packet->payload_packet_len) {
i += (packet->payload[i] & 0x80) ? (packet->payload[i] & 0x7F) : 0; /* skip BIT STRING length */
if(i < packet->payload_packet_len) {
i += 2; /* skip the second type, 0x30 == SEQUENCE, and jump to it's length */
if(i < packet->payload_packet_len) {
i += (packet->payload[i] & 0x80) ? (packet->payload[i] & 0x7F) : 0; /* skip SEQUENCE length */
i++;
while(i < packet->payload_packet_len) {
if(packet->payload[i] == 0x82) {
if((i < (packet->payload_packet_len - 1))
&& ((i + packet->payload[i + 1] + 2) < packet->payload_packet_len)) {
u_int8_t len = packet->payload[i + 1];
char dNSName[256];
i += 2;
/* The check "len > sizeof(dNSName) - 1" will be always false. If we add it,
the compiler is smart enough to detect it and throws a warning */
if(len == 0 /* Looks something went wrong */)
break;
strncpy(dNSName, (const char*)&packet->payload[i], len);
dNSName[len] = '\0';
cleanupServerName(dNSName, len);
#if DEBUG_TLS
printf("[TLS] dNSName %s [%s]\n", dNSName, flow->protos.stun_ssl.ssl.client_requested_server_name);
#endif
if(matched_name == 0) {
if((dNSName[0] == '*') && strstr(flow->protos.stun_ssl.ssl.client_requested_server_name, &dNSName[1]))
matched_name = 1;
else if(strcmp(flow->protos.stun_ssl.ssl.client_requested_server_name, dNSName) == 0)
matched_name = 1;
}
if(flow->protos.stun_ssl.ssl.server_names == NULL)
flow->protos.stun_ssl.ssl.server_names = ndpi_strdup(dNSName),
flow->protos.stun_ssl.ssl.server_names_len = strlen(dNSName);
else {
u_int16_t dNSName_len = strlen(dNSName);
u_int16_t newstr_len = flow->protos.stun_ssl.ssl.server_names_len + dNSName_len + 1;
char *newstr = (char*)ndpi_realloc(flow->protos.stun_ssl.ssl.server_names,
flow->protos.stun_ssl.ssl.server_names_len+1, newstr_len+1);
if(newstr) {
flow->protos.stun_ssl.ssl.server_names = newstr;
flow->protos.stun_ssl.ssl.server_names[flow->protos.stun_ssl.ssl.server_names_len] = ',';
strncpy(&flow->protos.stun_ssl.ssl.server_names[flow->protos.stun_ssl.ssl.server_names_len+1],
dNSName, dNSName_len+1);
flow->protos.stun_ssl.ssl.server_names[newstr_len] = '\0';
flow->protos.stun_ssl.ssl.server_names_len = newstr_len;
}
}
if(!flow->l4.tcp.tls.subprotocol_detected)
if(ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TLS, dNSName, len))
flow->l4.tcp.tls.subprotocol_detected = 1;
i += len;
} else {
#if DEBUG_TLS
printf("[TLS] Leftover %u bytes", packet->payload_packet_len - i);
#endif
break;
}
} else {
break;
}
} /* while */
if(!matched_name)
NDPI_SET_BIT(flow->risk, NDPI_TLS_CERTIFICATE_MISMATCH); /* Certificate mismatch */
}
}
}
}
}
if(rdn_len) flow->protos.stun_ssl.ssl.subjectDN = ndpi_strdup(rdnSeqBuf);
if(flow->protos.stun_ssl.ssl.subjectDN && flow->protos.stun_ssl.ssl.issuerDN
&& (!strcmp(flow->protos.stun_ssl.ssl.subjectDN, flow->protos.stun_ssl.ssl.issuerDN)))
NDPI_SET_BIT(flow->risk, NDPI_TLS_SELFSIGNED_CERTIFICATE);
#if DEBUG_TLS
printf("[TLS] %s() SubjectDN [%s]\n", __FUNCTION__, rdnSeqBuf);
#endif
} | 1934 | True | 1 |
CVE-2020-15475 | 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/ntop/nDPI/commit/6a9f5e4f7c3fd5ddab3e6727b071904d76773952', 'name': 'https://github.com/ntop/nDPI/commit/6a9f5e4f7c3fd5ddab3e6727b071904d76773952', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-416'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ntop:ndpi:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In nDPI through 3.2, ndpi_reset_packet_line_info in lib/ndpi_main.c omits certain reinitialization, leading to a use-after-free.'}] | 2020-07-06T19:45Z | 2020-07-01T11: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 | Toni Uhlig | 2020-06-21 20:05:38+02:00 | Fixed use after free caused by dangling pointer
* This fix also improved RCE Injection detection
Signed-off-by: Toni Uhlig <[email protected]> | 6a9f5e4f7c3fd5ddab3e6727b071904d76773952 | False | ntop/nDPI | Open Source Deep Packet Inspection Software Toolkit | 2015-04-19 04:56:52 | 2022-08-27 22:01:08 | http://www.ntop.org | ntop | 2979.0 | 788.0 | ndpi_reset_packet_line_info | ndpi_reset_packet_line_info( struct ndpi_packet_struct * packet) | ['packet'] | static void ndpi_reset_packet_line_info(struct ndpi_packet_struct *packet) {
packet->parsed_lines = 0, packet->empty_line_position_set = 0, packet->host_line.ptr = NULL,
packet->host_line.len = 0, packet->referer_line.ptr = NULL, packet->referer_line.len = 0,
packet->content_line.ptr = NULL, packet->content_line.len = 0, packet->accept_line.ptr = NULL,
packet->accept_line.len = 0, packet->user_agent_line.ptr = NULL, packet->user_agent_line.len = 0,
packet->http_url_name.ptr = NULL, packet->http_url_name.len = 0, packet->http_encoding.ptr = NULL,
packet->http_encoding.len = 0, packet->http_transfer_encoding.ptr = NULL, packet->http_transfer_encoding.len = 0,
packet->http_contentlen.ptr = NULL, packet->http_contentlen.len = 0, packet->http_cookie.ptr = NULL,
packet->http_cookie.len = 0, packet->http_origin.len = 0, packet->http_origin.ptr = NULL,
packet->http_x_session_type.ptr = NULL, packet->http_x_session_type.len = 0, packet->server_line.ptr = NULL,
packet->server_line.len = 0, packet->http_method.ptr = NULL, packet->http_method.len = 0,
packet->http_response.ptr = NULL, packet->http_response.len = 0, packet->http_num_headers = 0;
} | 267 | True | 1 |
CVE-2020-11958 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://blogs.gentoo.org/ago/2020/04/19/re2c-heap-overflow-in-scannerfill-scanner-cc/', 'name': 'https://blogs.gentoo.org/ago/2020/04/19/re2c-heap-overflow-in-scannerfill-scanner-cc/', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2020/04/19/1', 'name': 'https://www.openwall.com/lists/oss-security/2020/04/19/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/skvadrik/re2c/commit/c4603ba5ce229db83a2a4fb93e6d4b4e3ec3776a', 'name': 'https://github.com/skvadrik/re2c/commit/c4603ba5ce229db83a2a4fb93e6d4b4e3ec3776a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/04/21/1', 'name': '[oss-security] 20200421 Re: re2c: heap overflow in Scanner::fill (scanner.cc)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4338-1/', 'name': 'USN-4338-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4338-2/', 'name': 'USN-4338-2', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202007-28', 'name': 'GLSA-202007-28', 'refsource': 'GENTOO', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:re2c:re2c:1.3:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 're2c 1.3 has a heap-based buffer overflow in Scanner::fill in parse/scanner.cc via a long lexeme.'}] | 2020-07-27T02:15Z | 2020-04-21T01: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 | Ulya Trofimovich | 2020-04-17 22:47:14+01:00 | Fix crash in lexer refill (reported by Agostino Sarubbo).
The crash happened in a rare case of a very long lexeme that doen't fit
into the buffer, forcing buffer reallocation.
The crash was caused by an incorrect calculation of the shift offset
(it was smaller than necessary). As a consequence, the data from buffer
start and up to the beginning of the current lexeme was not discarded
(as it should have been), resulting in less free space for new data than
expected. | c4603ba5ce229db83a2a4fb93e6d4b4e3ec3776a | False | skvadrik/re2c | Lexer generator for C, C++, Go and Rust. | 2014-01-06 18:56:19 | 2022-08-25 07:46:42 | https://re2c.org | skvadrik | 795.0 | 140.0 | re2c::Scanner::fill | re2c::Scanner::fill( size_t need) | ['need'] | bool Scanner::fill(size_t need)
{
if (eof) return false;
pop_finished_files();
DASSERT(bot <= tok && tok <= lim);
size_t free = static_cast<size_t>(tok - bot);
size_t copy = static_cast<size_t>(lim - tok);
if (free >= need) {
memmove(bot, tok, copy);
shift_ptrs_and_fpos(-static_cast<ptrdiff_t>(free));
}
else {
BSIZE += std::max(BSIZE, need);
char * buf = new char[BSIZE + YYMAXFILL];
if (!buf) fatal("out of memory");
memmove(buf, tok, copy);
shift_ptrs_and_fpos(buf - bot);
delete [] bot;
bot = buf;
free = BSIZE - copy;
}
if (!read(free)) {
eof = lim;
memset(lim, 0, YYMAXFILL);
lim += YYMAXFILL;
}
return true;
} | 183 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_bcon_with_state | bson_append_bcon_with_state( bson * b , const bcon * bc , bcon_state_t start_state) | ['b', 'bc', 'start_state'] | static bcon_error_t bson_append_bcon_with_state(bson *b, const bcon *bc, bcon_state_t start_state) {
bcon_error_t ret = BCON_OK;
bcon_state_t state = start_state;
char *key = 0;
char *typespec = 0;
unsigned char doc_stack[DOC_STACK_SIZE];
size_t doc_stack_pointer = 0;
size_t array_index = 0;
unsigned int array_index_stack[ARRAY_INDEX_STACK_SIZE];
size_t array_index_stack_pointer = 0;
char array_index_buffer[ARRAY_INDEX_BUFFER_SIZE]; /* max BSON size */
int end_of_data;
const bcon *bcp;
for (end_of_data = 0, bcp = bc; ret == BCON_OK && !end_of_data; bcp++) {
bcon bci = *bcp;
char *s = bci.s;
switch (state) {
case State_Element:
switch (bcon_token(s)) {
case Token_CloseBrace:
bson_append_finish_object( b );
DOC_POP_STATE; /* state = ...; */
break;
case Token_End:
end_of_data = 1;
break;
default:
key = s;
state = State_DocSpecValue;
break;
}
break;
case State_DocSpecValue:
switch (bcon_token(s)) {
case Token_Typespec:
typespec = s;
state = State_DocValue;
break;
case Token_OpenBrace:
bson_append_start_object( b, key );
DOC_PUSH_STATE(State_Element);
state = State_Element;
break;
case Token_OpenBracket:
bson_append_start_array( b, key );
ARRAY_PUSH_RESET_INDEX_STATE(State_Element);
state = State_ArraySpecValue;
break;
case Token_End:
end_of_data = 1;
break;
default:
ret = bson_bcon_key_value(b, key, typespec, bci);
state = State_Element;
break;
}
break;
case State_DocValue:
ret = bson_bcon_key_value(b, key, typespec, bci);
state = State_Element;
typespec = 0;
break;
case State_ArraySpecValue:
switch (bcon_token(s)) {
case Token_Typespec:
typespec = s;
state = State_ArrayValue;
break;
case Token_OpenBrace:
key = ARRAY_KEY_STRING(array_index++);
bson_append_start_object( b, key );
DOC_PUSH_STATE(State_ArraySpecValue);
state = State_Element;
break;
case Token_OpenBracket:
key = ARRAY_KEY_STRING(array_index++);
bson_append_start_array( b, key );
ARRAY_PUSH_RESET_INDEX_STATE(State_ArraySpecValue);
/* state = State_ArraySpecValue; */
break;
case Token_CloseBracket:
bson_append_finish_array( b );
ARRAY_POP_INDEX_STATE; /* state = ...; */
break;
case Token_End:
end_of_data = 1;
break;
default:
key = ARRAY_KEY_STRING(array_index++);
ret = bson_bcon_key_value(b, key, typespec, bci);
/* state = State_ArraySpecValue; */
break;
}
break;
case State_ArrayValue:
key = ARRAY_KEY_STRING(array_index++);
ret = bson_bcon_key_value(b, key, typespec, bci);
state = State_ArraySpecValue;
typespec = 0;
break;
default: assert(NOT_REACHED); break;
}
}
return state == start_state ? BCON_OK : BCON_DOCUMENT_INCOMPLETE;
} | 474 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append | bson_append( bson * b , const void * data , int len) | ['b', 'data', 'len'] | static void bson_append( bson *b, const void *data, int len ) {
memcpy( b->cur , data , len );
b->cur += len;
} | 33 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_binary | bson_append_binary( bson * b , const char * name , char type , const char * str , int len) | ['b', 'name', 'type', 'str', 'len'] | MONGO_EXPORT int bson_append_binary( bson *b, const char *name, char type, const char *str, int len ) {
if ( type == BSON_BIN_BINARY_OLD ) {
int subtwolen = len + 4;
if ( bson_append_estart( b, BSON_BINDATA, name, 4+1+4+len ) == BSON_ERROR )
return BSON_ERROR;
bson_append32( b, &subtwolen );
bson_append_byte( b, type );
bson_append32( b, &len );
bson_append( b, str, len );
}
else {
if ( bson_append_estart( b, BSON_BINDATA, name, 4+1+len ) == BSON_ERROR )
return BSON_ERROR;
bson_append32( b, &len );
bson_append_byte( b, type );
bson_append( b, str, len );
}
return BSON_OK;
} | 147 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_code_n | bson_append_code_n( bson * b , const char * name , const char * value , int len) | ['b', 'name', 'value', 'len'] | MONGO_EXPORT int bson_append_code_n( bson *b, const char *name, const char *value, int len ) {
return bson_append_string_base( b, name, value, len, BSON_CODE );
} | 35 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_code_w_scope_n | bson_append_code_w_scope_n( bson * b , const char * name , const char * code , int len , const bson * scope) | ['b', 'name', 'code', 'len', 'scope'] | MONGO_EXPORT int bson_append_code_w_scope_n( bson *b, const char *name,
const char *code, int len, const bson *scope ) {
int sl, size;
if ( !scope ) return BSON_ERROR;
sl = len + 1;
size = 4 + 4 + sl + bson_size( scope );
if ( bson_append_estart( b, BSON_CODEWSCOPE, name, size ) == BSON_ERROR )
return BSON_ERROR;
bson_append32( b, &size );
bson_append32( b, &sl );
bson_append( b, code, sl );
bson_append( b, scope->data, bson_size( scope ) );
return BSON_OK;
} | 118 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_element | bson_append_element( bson * b , const char * name_or_null , const bson_iterator * elem) | ['b', 'name_or_null', 'elem'] | MONGO_EXPORT int bson_append_element( bson *b, const char *name_or_null, const bson_iterator *elem ) {
bson_iterator next = *elem;
int size;
bson_iterator_next( &next );
size = next.cur - elem->cur;
if ( name_or_null == NULL ) {
if( bson_ensure_space( b, size ) == BSON_ERROR )
return BSON_ERROR;
bson_append( b, elem->cur, size );
}
else {
int data_size = size - 2 - strlen( bson_iterator_key( elem ) );
bson_append_estart( b, elem->cur[0], name_or_null, data_size );
bson_append( b, bson_iterator_value( elem ), data_size );
}
return BSON_OK;
} | 125 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_estart | bson_append_estart( bson * b , int type , const char * name , const int dataSize) | ['b', 'type', 'name', 'dataSize'] | static int bson_append_estart( bson *b, int type, const char *name, const int dataSize ) {
const int len = strlen( name ) + 1;
if ( b->finished ) {
b->err |= BSON_ALREADY_FINISHED;
return BSON_ERROR;
}
if ( bson_ensure_space( b, 1 + len + dataSize ) == BSON_ERROR ) {
return BSON_ERROR;
}
if( bson_check_field_name( b, ( const char * )name, len - 1 ) == BSON_ERROR ) {
bson_builder_error( b );
return BSON_ERROR;
}
bson_append_byte( b, ( char )type );
bson_append( b, name, len );
return BSON_OK;
} | 120 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_finish_object | bson_append_finish_object( bson * b) | ['b'] | MONGO_EXPORT int bson_append_finish_object( bson *b ) {
char *start;
int i;
if ( bson_ensure_space( b, 1 ) == BSON_ERROR ) return BSON_ERROR;
bson_append_byte( b , 0 );
start = b->data + b->stack[ --b->stackPos ];
i = b->cur - start;
bson_little_endian32( start, &i );
return BSON_OK;
} | 71 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_regex | bson_append_regex( bson * b , const char * name , const char * pattern , const char * opts) | ['b', 'name', 'pattern', 'opts'] | MONGO_EXPORT int bson_append_regex( bson *b, const char *name, const char *pattern, const char *opts ) {
const int plen = strlen( pattern )+1;
const int olen = strlen( opts )+1;
if ( bson_append_estart( b, BSON_REGEX, name, plen + olen ) == BSON_ERROR )
return BSON_ERROR;
if ( bson_check_string( b, pattern, plen - 1 ) == BSON_ERROR )
return BSON_ERROR;
bson_append( b , pattern , plen );
bson_append( b , opts , olen );
return BSON_OK;
} | 104 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_string_base | bson_append_string_base( bson * b , const char * name , const char * value , int len , bson_type type) | ['b', 'name', 'value', 'len', 'type'] | static int bson_append_string_base( bson *b, const char *name,
const char *value, int len, bson_type type ) {
int sl = len + 1;
if ( bson_check_string( b, ( const char * )value, sl - 1 ) == BSON_ERROR )
return BSON_ERROR;
if ( bson_append_estart( b, type, name, 4 + sl ) == BSON_ERROR ) {
return BSON_ERROR;
}
bson_append32( b , &sl );
bson_append( b , value , sl - 1 );
bson_append( b , "\0" , 1 );
return BSON_OK;
} | 107 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_string_n | bson_append_string_n( bson * b , const char * name , const char * value , int len) | ['b', 'name', 'value', 'len'] | MONGO_EXPORT int bson_append_string_n( bson *b, const char *name, const char *value, int len ) {
return bson_append_string_base( b, name, value, len, BSON_STRING );
} | 35 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_append_symbol_n | bson_append_symbol_n( bson * b , const char * name , const char * value , int len) | ['b', 'name', 'value', 'len'] | MONGO_EXPORT int bson_append_symbol_n( bson *b, const char *name, const char *value, int len ) {
return bson_append_string_base( b, name, value, len, BSON_SYMBOL );
} | 35 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_buffer_size | bson_buffer_size( const bson * b) | ['b'] | MONGO_EXPORT int bson_buffer_size( const bson *b ) {
return (b->cur - b->data + 1);
} | 22 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_ensure_space | bson_ensure_space( bson * b , const int bytesNeeded) | ['b', 'bytesNeeded'] | int bson_ensure_space( bson *b, const int bytesNeeded ) {
int pos = b->cur - b->data;
char *orig = b->data;
int new_size;
if ( pos + bytesNeeded <= b->dataSize )
return BSON_OK;
new_size = 1.5 * ( b->dataSize + bytesNeeded );
if( new_size < b->dataSize ) {
if( ( b->dataSize + bytesNeeded ) < INT_MAX )
new_size = INT_MAX;
else {
b->err = BSON_SIZE_OVERFLOW;
return BSON_ERROR;
}
}
b->data = bson_realloc( b->data, new_size );
if ( !b->data )
bson_fatal_msg( !!b->data, "realloc() failed" );
b->dataSize = new_size;
b->cur += b->data - orig;
return BSON_OK;
} | 149 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_finish | bson_finish( bson * b) | ['b'] | MONGO_EXPORT int bson_finish( bson *b ) {
int i;
if( b->err & BSON_NOT_UTF8 )
return BSON_ERROR;
if ( ! b->finished ) {
if ( bson_ensure_space( b, 1 ) == BSON_ERROR ) return BSON_ERROR;
bson_append_byte( b, 0 );
i = b->cur - b->data;
bson_little_endian32( b->data, &i );
b->finished = 1;
}
return BSON_OK;
} | 81 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_iterator_int | bson_iterator_int( const bson_iterator * i) | ['i'] | MONGO_EXPORT int bson_iterator_int( const bson_iterator *i ) {
switch ( bson_iterator_type( i ) ) {
case BSON_INT:
return bson_iterator_int_raw( i );
case BSON_LONG:
return bson_iterator_long_raw( i );
case BSON_DOUBLE:
return bson_iterator_double_raw( i );
default:
return 0;
}
} | 50 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_iterator_next | bson_iterator_next( bson_iterator * i) | ['i'] | MONGO_EXPORT bson_type bson_iterator_next( bson_iterator *i ) {
int ds;
if ( i->first ) {
i->first = 0;
return ( bson_type )( *i->cur );
}
switch ( bson_iterator_type( i ) ) {
case BSON_EOO:
return BSON_EOO; /* don't advance */
case BSON_UNDEFINED:
case BSON_NULL:
ds = 0;
break;
case BSON_BOOL:
ds = 1;
break;
case BSON_INT:
ds = 4;
break;
case BSON_LONG:
case BSON_DOUBLE:
case BSON_TIMESTAMP:
case BSON_DATE:
ds = 8;
break;
case BSON_OID:
ds = 12;
break;
case BSON_STRING:
case BSON_SYMBOL:
case BSON_CODE:
ds = 4 + bson_iterator_int_raw( i );
break;
case BSON_BINDATA:
ds = 5 + bson_iterator_int_raw( i );
break;
case BSON_OBJECT:
case BSON_ARRAY:
case BSON_CODEWSCOPE:
ds = bson_iterator_int_raw( i );
break;
case BSON_DBREF:
ds = 4+12 + bson_iterator_int_raw( i );
break;
case BSON_REGEX: {
const char *s = bson_iterator_value( i );
const char *p = s;
p += strlen( p )+1;
p += strlen( p )+1;
ds = p-s;
break;
}
default: {
char msg[] = "unknown type: 000000000000";
bson_numstr( msg+14, ( unsigned )( i->cur[0] ) );
bson_fatal_msg( 0, msg );
return 0;
}
}
i->cur += 1 + strlen( i->cur + 1 ) + 1 + ds;
return ( bson_type )( *i->cur );
} | 294 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_malloc | bson_malloc( int size) | ['size'] | MONGO_EXPORT void *bson_malloc( int size ) {
void *p;
p = bson_malloc_func( size );
bson_fatal_msg( !!p, "malloc() failed" );
return p;
} | 30 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_realloc | bson_realloc( void * ptr , int size) | ['ptr', 'size'] | void *bson_realloc( void *ptr, int size ) {
void *p;
p = bson_realloc_func( ptr, size );
bson_fatal_msg( !!p, "realloc() failed" );
return p;
} | 36 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_check_field_name | bson_check_field_name( bson * b , const char * string , const int length) | ['b', 'string', 'length'] | int bson_check_field_name( bson *b, const char *string,
const int length ) {
return bson_validate_string( b, ( const unsigned char * )string, length, 1, 1, 1 );
} | 39 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_check_string | bson_check_string( bson * b , const char * string , const int length) | ['b', 'string', 'length'] | int bson_check_string( bson *b, const char *string,
const int length ) {
return bson_validate_string( b, ( const unsigned char * )string, length, 1, 0, 0 );
} | 39 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_string_is_db_ref | bson_string_is_db_ref( const unsigned char * string , const int length) | ['string', 'length'] | static int bson_string_is_db_ref( const unsigned char *string, const int length ) {
int result = 0;
if( length >= 4 ) {
if( string[1] == 'r' && string[2] == 'e' && string[3] == 'f' )
result = 1;
}
else if( length >= 3 ) {
if( string[1] == 'i' && string[2] == 'd' )
result = 1;
else if( string[1] == 'd' && string[2] == 'b' )
result = 1;
}
return result;
} | 107 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | bson_validate_string | bson_validate_string( bson * b , const unsigned char * string , const int length , const char check_utf8 , const char check_dot , const char check_dollar) | ['b', 'string', 'length', 'check_utf8', 'check_dot', 'check_dollar'] | static int bson_validate_string( bson *b, const unsigned char *string,
const int length, const char check_utf8, const char check_dot,
const char check_dollar ) {
int position = 0;
int sequence_length = 1;
if( check_dollar && string[0] == '$' ) {
if( !bson_string_is_db_ref( string, length ) )
b->err |= BSON_FIELD_INIT_DOLLAR;
}
while ( position < length ) {
if ( check_dot && *( string + position ) == '.' ) {
b->err |= BSON_FIELD_HAS_DOT;
}
if ( check_utf8 ) {
sequence_length = trailingBytesForUTF8[*( string + position )] + 1;
if ( ( position + sequence_length ) > length ) {
b->err |= BSON_NOT_UTF8;
return BSON_ERROR;
}
if ( !isLegalUTF8( string + position, sequence_length ) ) {
b->err |= BSON_NOT_UTF8;
return BSON_ERROR;
}
}
position += sequence_length;
}
return BSON_OK;
} | 169 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_env_read_socket | mongo_env_read_socket( mongo * conn , void * buf , int len) | ['conn', 'buf', 'len'] | int mongo_env_read_socket( mongo *conn, void *buf, int len ) {
char *cbuf = buf;
while ( len ) {
int sent = recv( conn->sock, cbuf, len, 0 );
if ( sent == 0 || sent == -1 ) {
__mongo_set_error( conn, MONGO_IO_ERROR, NULL, WSAGetLastError() );
return MONGO_ERROR;
}
cbuf += sent;
len -= sent;
}
return MONGO_OK;
} | 83 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_env_write_socket | mongo_env_write_socket( mongo * conn , const void * buf , int len) | ['conn', 'buf', 'len'] | int mongo_env_write_socket( mongo *conn, const void *buf, int len ) {
const char *cbuf = buf;
int flags = 0;
while ( len ) {
int sent = send( conn->sock, cbuf, len, flags );
if ( sent == -1 ) {
__mongo_set_error( conn, MONGO_IO_ERROR, NULL, WSAGetLastError() );
conn->connected = 0;
return MONGO_ERROR;
}
cbuf += sent;
len -= sent;
}
return MONGO_OK;
} | 92 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | gridfile_get_chunks | gridfile_get_chunks( gridfile * gfile , int start , int size) | ['gfile', 'start', 'size'] | MONGO_EXPORT mongo_cursor *gridfile_get_chunks( gridfile *gfile, int start, int size ) {
bson_iterator it;
bson_oid_t id;
bson gte;
bson query;
bson orderby;
bson command;
mongo_cursor *cursor;
bson_find( &it, gfile->meta, "_id" );
id = *bson_iterator_oid( &it );
bson_init( &query );
bson_append_oid( &query, "files_id", &id );
if ( size == 1 ) {
bson_append_int( &query, "n", start );
}
else {
bson_init( >e );
bson_append_int( >e, "$gte", start );
bson_finish( >e );
bson_append_bson( &query, "n", >e );
bson_destroy( >e );
}
bson_finish( &query );
bson_init( &orderby );
bson_append_int( &orderby, "n", 1 );
bson_finish( &orderby );
bson_init( &command );
bson_append_bson( &command, "query", &query );
bson_append_bson( &command, "orderby", &orderby );
bson_finish( &command );
cursor = mongo_find( gfile->gfs->client, gfile->gfs->chunks_ns,
&command, NULL, size, 0, 0 );
bson_destroy( &command );
bson_destroy( &query );
bson_destroy( &orderby );
return cursor;
} | 245 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | gridfile_read | gridfile_read( gridfile * gfile , gridfs_offset size , char * buf) | ['gfile', 'size', 'buf'] | MONGO_EXPORT gridfs_offset gridfile_read( gridfile *gfile, gridfs_offset size, char *buf ) {
mongo_cursor *chunks;
bson chunk;
int first_chunk;
int last_chunk;
int total_chunks;
gridfs_offset chunksize;
gridfs_offset contentlength;
gridfs_offset bytes_left;
int i;
bson_iterator it;
gridfs_offset chunk_len;
const char *chunk_data;
contentlength = gridfile_get_contentlength( gfile );
chunksize = gridfile_get_chunksize( gfile );
size = ( contentlength - gfile->pos < size )
? contentlength - gfile->pos
: size;
bytes_left = size;
first_chunk = ( gfile->pos )/chunksize;
last_chunk = ( gfile->pos+size-1 )/chunksize;
total_chunks = last_chunk - first_chunk + 1;
chunks = gridfile_get_chunks( gfile, first_chunk, total_chunks );
for ( i = 0; i < total_chunks; i++ ) {
mongo_cursor_next( chunks );
chunk = chunks->current;
bson_find( &it, &chunk, "data" );
chunk_len = bson_iterator_bin_len( &it );
chunk_data = bson_iterator_bin_data( &it );
if ( i == 0 ) {
chunk_data += ( gfile->pos )%chunksize;
chunk_len -= ( gfile->pos )%chunksize;
}
if ( bytes_left > chunk_len ) {
memcpy( buf, chunk_data, chunk_len );
bytes_left -= chunk_len;
buf += chunk_len;
}
else {
memcpy( buf, chunk_data, bytes_left );
}
}
mongo_cursor_destroy( chunks );
gfile->pos = gfile->pos + size;
return size;
} | 271 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | gridfile_write_buffer | gridfile_write_buffer( gridfile * gfile , const char * data , gridfs_offset length) | ['gfile', 'data', 'length'] | MONGO_EXPORT void gridfile_write_buffer( gridfile *gfile, const char *data,
gridfs_offset length ) {
int bytes_left = 0;
int data_partial_len = 0;
int chunks_to_write = 0;
char *buffer;
bson *oChunk;
gridfs_offset to_write = length + gfile->pending_len;
if ( to_write < DEFAULT_CHUNK_SIZE ) { /* Less than one chunk to write */
if( gfile->pending_data ) {
gfile->pending_data = ( char * )bson_realloc( ( void * )gfile->pending_data, gfile->pending_len + to_write );
memcpy( gfile->pending_data + gfile->pending_len, data, length );
}
else if ( to_write > 0 ) {
gfile->pending_data = ( char * )bson_malloc( to_write );
memcpy( gfile->pending_data, data, length );
}
gfile->pending_len += length;
}
else { /* At least one chunk of data to write */
chunks_to_write = to_write / DEFAULT_CHUNK_SIZE;
bytes_left = to_write % DEFAULT_CHUNK_SIZE;
/* If there's a pending chunk to be written, we need to combine
* the buffer provided up to DEFAULT_CHUNK_SIZE.
*/
if ( gfile->pending_len > 0 ) {
data_partial_len = DEFAULT_CHUNK_SIZE - gfile->pending_len;
buffer = ( char * )bson_malloc( DEFAULT_CHUNK_SIZE );
memcpy( buffer, gfile->pending_data, gfile->pending_len );
memcpy( buffer + gfile->pending_len, data, data_partial_len );
oChunk = chunk_new( gfile->id, gfile->chunk_num, buffer, DEFAULT_CHUNK_SIZE );
mongo_insert( gfile->gfs->client, gfile->gfs->chunks_ns, oChunk, NULL );
chunk_free( oChunk );
gfile->chunk_num++;
gfile->length += DEFAULT_CHUNK_SIZE;
data += data_partial_len;
chunks_to_write--;
bson_free( buffer );
}
while( chunks_to_write > 0 ) {
oChunk = chunk_new( gfile->id, gfile->chunk_num, data, DEFAULT_CHUNK_SIZE );
mongo_insert( gfile->gfs->client, gfile->gfs->chunks_ns, oChunk, NULL );
chunk_free( oChunk );
gfile->chunk_num++;
chunks_to_write--;
gfile->length += DEFAULT_CHUNK_SIZE;
data += DEFAULT_CHUNK_SIZE;
}
bson_free( gfile->pending_data );
/* If there are any leftover bytes, store them as pending data. */
if( bytes_left == 0 )
gfile->pending_data = NULL;
else {
gfile->pending_data = ( char * )bson_malloc( bytes_left );
memcpy( gfile->pending_data, data, bytes_left );
}
gfile->pending_len = bytes_left;
}
} | 396 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | __mongo_set_error | __mongo_set_error( mongo * conn , mongo_error_t err , const char * str , int errcode) | ['conn', 'err', 'str', 'errcode'] | MONGO_EXPORT void __mongo_set_error( mongo *conn, mongo_error_t err, const char *str,
int errcode ) {
int errstr_size, str_size;
conn->err = err;
conn->errcode = errcode;
if( str ) {
str_size = strlen( str ) + 1;
errstr_size = str_size > MONGO_ERR_LEN ? MONGO_ERR_LEN : str_size;
memcpy( conn->errstr, str, errstr_size );
conn->errstr[errstr_size-1] = '\0';
}
} | 83 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_cmd_authenticate | mongo_cmd_authenticate( mongo * conn , const char * db , const char * user , const char * pass) | ['conn', 'db', 'user', 'pass'] | MONGO_EXPORT bson_bool_t mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const char *pass ) {
bson from_db;
bson cmd;
const char *nonce;
int result;
mongo_md5_state_t st;
mongo_md5_byte_t digest[16];
char hex_digest[33];
if( mongo_simple_int_command( conn, db, "getnonce", 1, &from_db ) == MONGO_OK ) {
bson_iterator it;
bson_find( &it, &from_db, "nonce" );
nonce = bson_iterator_string( &it );
}
else {
return MONGO_ERROR;
}
mongo_pass_digest( user, pass, hex_digest );
mongo_md5_init( &st );
mongo_md5_append( &st, ( const mongo_md5_byte_t * )nonce, strlen( nonce ) );
mongo_md5_append( &st, ( const mongo_md5_byte_t * )user, strlen( user ) );
mongo_md5_append( &st, ( const mongo_md5_byte_t * )hex_digest, 32 );
mongo_md5_finish( &st, digest );
digest2hex( digest, hex_digest );
bson_init( &cmd );
bson_append_int( &cmd, "authenticate", 1 );
bson_append_string( &cmd, "user", user );
bson_append_string( &cmd, "nonce", nonce );
bson_append_string( &cmd, "key", hex_digest );
bson_finish( &cmd );
bson_destroy( &from_db );
result = mongo_run_command( conn, db, &cmd, NULL );
bson_destroy( &cmd );
return result;
} | 262 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_cursor_get_more | mongo_cursor_get_more( mongo_cursor * cursor) | ['cursor'] | static int mongo_cursor_get_more( mongo_cursor *cursor ) {
int res;
if( cursor->limit > 0 && cursor->seen >= cursor->limit ) {
cursor->err = MONGO_CURSOR_EXHAUSTED;
return MONGO_ERROR;
}
else if( ! cursor->reply ) {
cursor->err = MONGO_CURSOR_INVALID;
return MONGO_ERROR;
}
else if( ! cursor->reply->fields.cursorID ) {
cursor->err = MONGO_CURSOR_EXHAUSTED;
return MONGO_ERROR;
}
else {
char *data;
int sl = strlen( cursor->ns )+1;
int limit = 0;
mongo_message *mm;
if( cursor->limit > 0 )
limit = cursor->limit - cursor->seen;
mm = mongo_message_create( 16 /*header*/
+4 /*ZERO*/
+sl
+4 /*numToReturn*/
+8 /*cursorID*/
, 0, 0, MONGO_OP_GET_MORE );
data = &mm->data;
data = mongo_data_append32( data, &ZERO );
data = mongo_data_append( data, cursor->ns, sl );
data = mongo_data_append32( data, &limit );
mongo_data_append64( data, &cursor->reply->fields.cursorID );
bson_free( cursor->reply );
res = mongo_message_send( cursor->conn, mm );
if( res != MONGO_OK ) {
mongo_cursor_destroy( cursor );
return MONGO_ERROR;
}
res = mongo_read_response( cursor->conn, &( cursor->reply ) );
if( res != MONGO_OK ) {
mongo_cursor_destroy( cursor );
return MONGO_ERROR;
}
cursor->current.data = NULL;
cursor->seen += cursor->reply->fields.num;
return MONGO_OK;
}
} | 290 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_data_append | mongo_data_append( char * start , const void * data , int len) | ['start', 'data', 'len'] | static char *mongo_data_append( char *start , const void *data , int len ) {
memcpy( start , data , len );
return start + len;
} | 30 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_insert_batch | mongo_insert_batch( mongo * conn , const char * ns , const bson ** bsons , int count , mongo_write_concern * custom_write_concern , int flags) | ['conn', 'ns', 'bsons', 'count', 'custom_write_concern', 'flags'] | MONGO_EXPORT int mongo_insert_batch( mongo *conn, const char *ns,
const bson **bsons, int count, mongo_write_concern *custom_write_concern,
int flags ) {
mongo_message *mm;
mongo_write_concern *write_concern = NULL;
int i;
char *data;
int overhead = 16 + 4 + strlen( ns ) + 1;
int size = overhead;
if( mongo_validate_ns( conn, ns ) != MONGO_OK )
return MONGO_ERROR;
for( i=0; i<count; i++ ) {
size += bson_size( bsons[i] );
if( mongo_bson_valid( conn, bsons[i], 1 ) != MONGO_OK )
return MONGO_ERROR;
}
if( ( size - overhead ) > conn->max_bson_size ) {
conn->err = MONGO_BSON_TOO_LARGE;
return MONGO_ERROR;
}
if( mongo_choose_write_concern( conn, custom_write_concern,
&write_concern ) == MONGO_ERROR ) {
return MONGO_ERROR;
}
mm = mongo_message_create( size , 0 , 0 , MONGO_OP_INSERT );
data = &mm->data;
if( flags & MONGO_CONTINUE_ON_ERROR )
data = mongo_data_append32( data, &ONE );
else
data = mongo_data_append32( data, &ZERO );
data = mongo_data_append( data, ns, strlen( ns ) + 1 );
for( i=0; i<count; i++ ) {
data = mongo_data_append( data, bsons[i]->data, bson_size( bsons[i] ) );
}
/* TODO: refactor so that we can send the insert message
* and the getlasterror messages together. */
if( write_concern ) {
if( mongo_message_send( conn, mm ) == MONGO_ERROR ) {
return MONGO_ERROR;
}
return mongo_check_last_error( conn, ns, write_concern );
}
else {
return mongo_message_send( conn, mm );
}
} | 307 | True | 1 |
CVE-2020-12135 | 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://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'name': 'https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'name': 'https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'name': 'https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4450-1/', 'name': 'USN-4450-1', 'refsource': 'UBUNTU', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:whoopsie_project:whoopsie:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.2.69', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.'}] | 2020-08-12T17:15Z | 2020-04-24T01: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 | Jérôme Lebel | 2013-01-07 22:30:02+01:00 | don't mix up int and size_t (first pass to fix that) | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | False | 10gen-archive/mongo-c-driver-legacy | C Driver for MongoDB | 2009-10-06 03:54:36 | 2020-12-21 12:20:04 | http://www.mongodb.org/ | 10gen-archive | 294.0 | 184.0 | mongo_message_create | mongo_message_create( int len , int id , int responseTo , int op) | ['len', 'id', 'responseTo', 'op'] | static mongo_message *mongo_message_create( int len , int id , int responseTo , int op ) {
mongo_message *mm = ( mongo_message * )bson_malloc( len );
if ( !id )
id = rand();
/* native endian (converted on send) */
mm->head.len = len;
mm->head.id = id;
mm->head.responseTo = responseTo;
mm->head.op = op;
return mm;
} | 75 | True | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.