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-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | get_object | get_object( FILE * fp , int obj_id , const xref_t * xref , size_t * size , int * is_stream) | ['fp', 'obj_id', 'xref', 'size', 'is_stream'] | static char *get_object(
FILE *fp,
int obj_id,
const xref_t *xref,
size_t *size,
int *is_stream)
{
static const int blk_sz = 256;
int i, total_sz, read_sz, n_blks, search, stream;
size_t obj_sz;
char *c, *data;
long start;
const xref_entry_t *entry;
if (size)
*size = 0;
if (is_stream)
*is_stream = 0;
start = ftell(fp);
/* Find object */
entry = NULL;
for (i=0; i<xref->n_entries; i++)
if (xref->entries[i].obj_id == obj_id)
{
entry = &xref->entries[i];
break;
}
if (!entry)
return NULL;
/* Jump to object start */
fseek(fp, entry->offset, SEEK_SET);
/* Initial allocate */
obj_sz = 0; /* Bytes in object */
total_sz = 0; /* Bytes read in */
n_blks = 1;
data = malloc(blk_sz * n_blks);
memset(data, 0, blk_sz * n_blks);
/* Suck in data */
stream = 0;
while ((read_sz = fread(data+total_sz, 1, blk_sz-1, fp)) && !ferror(fp))
{
total_sz += read_sz;
*(data + total_sz) = '\0';
if (total_sz + blk_sz >= (blk_sz * n_blks))
data = realloc(data, blk_sz * (++n_blks));
search = total_sz - read_sz;
if (search < 0)
search = 0;
if ((c = strstr(data + search, "endobj")))
{
*(c + strlen("endobj") + 1) = '\0';
obj_sz = (void *)strstr(data + search, "endobj") - (void *)data;
obj_sz += strlen("endobj") + 1;
break;
}
else if (strstr(data, "stream"))
stream = 1;
}
clearerr(fp);
fseek(fp, start, SEEK_SET);
if (size)
*size = obj_sz;
if (is_stream)
*is_stream = stream;
return data;
} | 384 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | load_xref_from_plaintext | load_xref_from_plaintext( FILE * fp , xref_t * xref) | ['fp', 'xref'] | static void load_xref_from_plaintext(FILE *fp, xref_t *xref)
{
int i, buf_idx, obj_id, added_entries;
char c, buf[32] = {0};
long start, pos;
start = ftell(fp);
/* Get number of entries */
pos = xref->end;
fseek(fp, pos, SEEK_SET);
while (ftell(fp) != 0)
if (SAFE_F(fp, (fgetc(fp) == '/' && fgetc(fp) == 'S')))
break;
else
SAFE_E(fseek(fp, --pos, SEEK_SET), 0, "Failed seek to xref /Size.\n");
SAFE_E(fread(buf, 1, 21, fp), 21, "Failed to load entry Size string.\n");
xref->n_entries = atoi(buf + strlen("ize "));
xref->entries = calloc(1, xref->n_entries * sizeof(struct _xref_entry));
/* Load entry data */
obj_id = 0;
fseek(fp, xref->start + strlen("xref"), SEEK_SET);
added_entries = 0;
for (i=0; i<xref->n_entries; i++)
{
/* Advance past newlines. */
c = fgetc(fp);
while (c == '\n' || c == '\r')
c = fgetc(fp);
/* Collect data up until the following newline. */
buf_idx = 0;
while (c != '\n' && c != '\r' && !feof(fp) &&
!ferror(fp) && buf_idx < sizeof(buf))
{
buf[buf_idx++] = c;
c = fgetc(fp);
}
if (buf_idx >= sizeof(buf))
{
ERR("Failed to locate newline character. "
"This might be a corrupt PDF.\n");
exit(EXIT_FAILURE);
}
buf[buf_idx] = '\0';
/* Went to far and hit start of trailer */
if (strchr(buf, 't'))
break;
/* Entry or object id */
if (strlen(buf) > 17)
{
xref->entries[i].obj_id = obj_id++;
xref->entries[i].offset = atol(strtok(buf, " "));
xref->entries[i].gen_num = atoi(strtok(NULL, " "));
xref->entries[i].f_or_n = buf[17];
++added_entries;
}
else
{
obj_id = atoi(buf);
--i;
}
}
xref->n_entries = added_entries;
fseek(fp, start, SEEK_SET);
} | 424 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | new_creator | new_creator( int * n_elements) | ['n_elements'] | static pdf_creator_t *new_creator(int *n_elements)
{
pdf_creator_t *daddy;
static const pdf_creator_t creator_template[] =
{
{"Title", ""},
{"Author", ""},
{"Subject", ""},
{"Keywords", ""},
{"Creator", ""},
{"Producer", ""},
{"CreationDate", ""},
{"ModDate", ""},
{"Trapped", ""},
};
daddy = malloc(sizeof(creator_template));
memcpy(daddy, creator_template, sizeof(creator_template));
if (n_elements)
*n_elements = sizeof(creator_template) / sizeof(creator_template[0]);
return daddy;
} | 121 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | pdf_load_pages_kids | pdf_load_pages_kids( FILE * fp , pdf_t * pdf) | ['fp', 'pdf'] | void pdf_load_pages_kids(FILE *fp, pdf_t *pdf)
{
int i, id, dummy;
char *buf, *c;
long start, sz;
start = ftell(fp);
/* Load all kids for all xref tables (versions) */
for (i=0; i<pdf->n_xrefs; i++)
{
if (pdf->xrefs[i].version && (pdf->xrefs[i].end != 0))
{
fseek(fp, pdf->xrefs[i].start, SEEK_SET);
while (SAFE_F(fp, (fgetc(fp) != 't')))
; /* Iterate to trailer */
/* Get root catalog */
sz = pdf->xrefs[i].end - ftell(fp);
buf = malloc(sz + 1);
SAFE_E(fread(buf, 1, sz, fp), sz, "Failed to load /Root.\n");
buf[sz] = '\0';
if (!(c = strstr(buf, "/Root")))
{
free(buf);
continue;
}
/* Jump to catalog (root) */
id = atoi(c + strlen("/Root") + 1);
free(buf);
buf = get_object(fp, id, &pdf->xrefs[i], NULL, &dummy);
if (!buf || !(c = strstr(buf, "/Pages")))
{
free(buf);
continue;
}
/* Start at the first Pages obj and get kids */
id = atoi(c + strlen("/Pages") + 1);
load_kids(fp, id, &pdf->xrefs[i]);
free(buf);
}
}
fseek(fp, start, SEEK_SET);
} | 297 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | pdf_load_xrefs | pdf_load_xrefs( FILE * fp , pdf_t * pdf) | ['fp', 'pdf'] | int pdf_load_xrefs(FILE *fp, pdf_t *pdf)
{
int i, ver, is_linear;
long pos, pos_count;
char x, *c, buf[256];
c = NULL;
/* Count number of xrefs */
pdf->n_xrefs = 0;
fseek(fp, 0, SEEK_SET);
while (get_next_eof(fp) >= 0)
++pdf->n_xrefs;
if (!pdf->n_xrefs)
return 0;
/* Load in the start/end positions */
fseek(fp, 0, SEEK_SET);
pdf->xrefs = calloc(1, sizeof(xref_t) * pdf->n_xrefs);
ver = 1;
for (i=0; i<pdf->n_xrefs; i++)
{
/* Seek to %%EOF */
if ((pos = get_next_eof(fp)) < 0)
break;
/* Set and increment the version */
pdf->xrefs[i].version = ver++;
/* Rewind until we find end of "startxref" */
pos_count = 0;
while (SAFE_F(fp, ((x = fgetc(fp)) != 'f')))
fseek(fp, pos - (++pos_count), SEEK_SET);
/* Suck in end of "startxref" to start of %%EOF */
if (pos_count >= sizeof(buf)) {
ERR("Failed to locate the startxref token. "
"This might be a corrupt PDF.\n");
return -1;
}
memset(buf, 0, sizeof(buf));
SAFE_E(fread(buf, 1, pos_count, fp), pos_count,
"Failed to read startxref.\n");
c = buf;
while (*c == ' ' || *c == '\n' || *c == '\r')
++c;
/* xref start position */
pdf->xrefs[i].start = atol(c);
/* If xref is 0 handle linear xref table */
if (pdf->xrefs[i].start == 0)
get_xref_linear_skipped(fp, &pdf->xrefs[i]);
/* Non-linear, normal operation, so just find the end of the xref */
else
{
/* xref end position */
pos = ftell(fp);
fseek(fp, pdf->xrefs[i].start, SEEK_SET);
pdf->xrefs[i].end = get_next_eof(fp);
/* Look for next EOF and xref data */
fseek(fp, pos, SEEK_SET);
}
/* Check validity */
if (!is_valid_xref(fp, pdf, &pdf->xrefs[i]))
{
is_linear = pdf->xrefs[i].is_linear;
memset(&pdf->xrefs[i], 0, sizeof(xref_t));
pdf->xrefs[i].is_linear = is_linear;
rewind(fp);
get_next_eof(fp);
continue;
}
/* Load the entries from the xref */
load_xref_entries(fp, &pdf->xrefs[i]);
}
/* Now we have all xref tables, if this is linearized, we need
* to make adjustments so that things spit out properly
*/
if (pdf->xrefs[0].is_linear)
resolve_linearized_pdf(pdf);
/* Ok now we have all xref data. Go through those versions of the
* PDF and try to obtain creator information
*/
load_creator(fp, pdf);
return pdf->n_xrefs;
} | 468 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | pdf_new | pdf_new( const char * name) | ['name'] | pdf_t *pdf_new(const char *name)
{
const char *n;
pdf_t *pdf;
pdf = calloc(1, sizeof(pdf_t));
if (name)
{
/* Just get the file name (not path) */
if ((n = strrchr(name, '/')))
++n;
else
n = name;
pdf->name = malloc(strlen(n) + 1);
strcpy(pdf->name, n);
}
else /* !name */
{
pdf->name = malloc(strlen("Unknown") + 1);
strcpy(pdf->name, "Unknown");
}
return pdf;
} | 109 | True | 1 |
CVE-2019-14934 | False | False | False | True | AV:N/AC:M/Au:N/C:P/I:P/A:P | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | PARTIAL | 6.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H | LOCAL | LOW | NONE | REQUIRED | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'name': 'https://github.com/enferex/pdfresurrect/compare/v0.17...v0.18', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'name': 'https://github.com/enferex/pdfresurrect/commit/0c4120fffa3dffe97b95c486a120eded82afe8a6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/4DBYXYU2VSDJ3NAL54IW2KYD3TZSR33M/', 'name': 'FEDORA-2019-80e5e20cf8', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LXN6W5QTNQJ2LFDCQWKYSMMZ3NPUWP3U/', 'name': 'FEDORA-2019-e01bc28777', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/Y243C2IFMRFQWHV62JCSHTMQGDDCICNF/', 'name': 'FEDORA-2019-b20614ff74', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00002.html', 'name': '[debian-lts-announce] 20201201 [SECURITY] [DLA 2475-1] pdfresurrect security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pdfresurrect_project:pdfresurrect:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.18', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "An issue was discovered in PDFResurrect before 0.18. pdf_load_pages_kids in pdf.c doesn't validate a certain size value, which leads to a malloc failure and out-of-bounds write."}] | 2020-12-01T15:15Z | 2019-08-11T22:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | Matt Davis | 2019-08-10 07:47:09-07:00 | Zero and sanity check all dynamic allocs.
This addresses the memory issues in Issue #6 expressed in
calloc_some.pdf and malloc_some.pdf | 0c4120fffa3dffe97b95c486a120eded82afe8a6 | False | enferex/pdfresurrect | Analyze and help extract older "hidden" versions of a pdf from the current pdf. | 2013-07-01 12:49:44 | 2021-08-31 03:57:17 | null | enferex | 40.0 | 10.0 | pdf_summarize | pdf_summarize( FILE * fp , const pdf_t * pdf , const char * name , pdf_flag_t flags) | ['fp', 'pdf', 'name', 'flags'] | void pdf_summarize(
FILE *fp,
const pdf_t *pdf,
const char *name,
pdf_flag_t flags)
{
int i, j, page, n_versions, n_entries;
FILE *dst, *out;
char *dst_name, *c;
dst = NULL;
dst_name = NULL;
if (name)
{
dst_name = malloc(strlen(name) * 2 + 16);
sprintf(dst_name, "%s/%s", name, name);
if ((c = strrchr(dst_name, '.')) && (strncmp(c, ".pdf", 4) == 0))
*c = '\0';
strcat(dst_name, ".summary");
if (!(dst = fopen(dst_name, "w")))
{
ERR("Could not open file '%s' for writing\n", dst_name);
return;
}
}
/* Send output to file or stdout */
out = (dst) ? dst : stdout;
/* Count versions */
n_versions = pdf->n_xrefs;
if (n_versions && pdf->xrefs[0].is_linear)
--n_versions;
/* Ignore bad xref entry */
for (i=1; i<pdf->n_xrefs; ++i)
if (pdf->xrefs[i].end == 0)
--n_versions;
/* If we have no valid versions but linear, count that */
if (!pdf->n_xrefs || (!n_versions && pdf->xrefs[0].is_linear))
n_versions = 1;
/* Compare each object (if we dont have xref streams) */
n_entries = 0;
for (i=0; !(const int)pdf->has_xref_streams && i<pdf->n_xrefs; i++)
{
if (flags & PDF_FLAG_QUIET)
continue;
for (j=0; j<pdf->xrefs[i].n_entries; j++)
{
++n_entries;
fprintf(out,
"%s: --%c-- Version %d -- Object %d (%s)",
pdf->name,
pdf_get_object_status(pdf, i, j),
pdf->xrefs[i].version,
pdf->xrefs[i].entries[j].obj_id,
get_type(fp, pdf->xrefs[i].entries[j].obj_id,
&pdf->xrefs[i]));
/* TODO
page = get_page(pdf->xrefs[i].entries[j].obj_id, &pdf->xrefs[i]);
*/
if (0 /*page*/)
fprintf(out, " Page(%d)\n", page);
else
fprintf(out, "\n");
}
}
/* Trailing summary */
if (!(flags & PDF_FLAG_QUIET))
{
/* Let the user know that we cannot we print a per-object summary.
* If we have a 1.5 PDF using streams for xref, we have not objects
* to display, so let the user know whats up.
*/
if (pdf->has_xref_streams || !n_entries)
fprintf(out,
"%s: This PDF contains potential cross reference streams.\n"
"%s: An object summary is not available.\n",
pdf->name,
pdf->name);
fprintf(out,
"---------- %s ----------\n"
"Versions: %d\n",
pdf->name,
n_versions);
/* Count entries for summary */
if (!pdf->has_xref_streams)
for (i=0; i<pdf->n_xrefs; i++)
{
if (pdf->xrefs[i].is_linear)
continue;
n_entries = pdf->xrefs[i].n_entries;
/* If we are a linearized PDF, all versions are made from those
* objects too. So count em'
*/
if (pdf->xrefs[0].is_linear)
n_entries += pdf->xrefs[0].n_entries;
if (pdf->xrefs[i].version && n_entries)
fprintf(out,
"Version %d -- %d objects\n",
pdf->xrefs[i].version,
n_entries);
}
}
else /* Quiet output */
fprintf(out, "%s: %d\n", pdf->name, n_versions);
if (dst)
{
fclose(dst);
free(dst_name);
}
} | 571 | True | 1 |
CVE-2019-14323 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/troglobit/ssdp-responder/commit/ce04b1f29a137198182f60bbb628d5ceb8171765', 'name': 'https://github.com/troglobit/ssdp-responder/commit/ce04b1f29a137198182f60bbb628d5ceb8171765', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/troglobit/ssdp-responder/issues/1', 'name': 'https://github.com/troglobit/ssdp-responder/issues/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-193'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:simple_service_discovery_protocol_responder_project:simple_service_discovery_protocol_responder:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.0', 'versionEndIncluding': '1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'SSDP Responder 1.x through 1.5 mishandles incoming network messages, leading to a stack-based buffer overflow by 1 byte. This results in a crash of the server, but only when strict stack checking is enabled. This is caused by an off-by-one error in ssdp_recv in ssdpd.c.'}] | 2020-12-16T18:55Z | 2019-07-28T13:15Z | Off-by-one Error | A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value. | https://cwe.mitre.org/data/definitions/193.html | 0 | Joachim Nilsson | 2019-07-24 07:35:23+02:00 | Fix #1: Ensure recv buf is always NUL terminated
Signed-off-by: Joachim Nilsson <[email protected]> | ce04b1f29a137198182f60bbb628d5ceb8171765 | False | troglobit/ssdp-responder | SSDP responder for Linux, InternetGatewayDevice icon in Windows :) | 2017-05-10 07:07:30 | 2022-01-14 13:29:14 | troglobit | 42.0 | 14.0 | ssdp_recv | ssdp_recv( int sd) | ['sd'] | static void ssdp_recv(int sd)
{
ssize_t len;
struct sockaddr sa;
socklen_t salen;
char buf[MAX_PKT_SIZE];
memset(buf, 0, sizeof(buf));
len = recvfrom(sd, buf, sizeof(buf), MSG_DONTWAIT, &sa, &salen);
if (len > 0) {
buf[len] = 0;
if (sa.sa_family != AF_INET)
return;
if (strstr(buf, "M-SEARCH *")) {
size_t i;
char *ptr, *type;
struct ifsock *ifs;
struct sockaddr_in *sin = (struct sockaddr_in *)&sa;
ifs = find_outbound(&sa);
if (!ifs) {
logit(LOG_DEBUG, "No matching socket for client %s", inet_ntoa(sin->sin_addr));
return;
}
logit(LOG_DEBUG, "Matching socket for client %s", inet_ntoa(sin->sin_addr));
type = strcasestr(buf, "\r\nST:");
if (!type) {
logit(LOG_DEBUG, "No Search Type (ST:) found in M-SEARCH *, assuming " SSDP_ST_ALL);
type = SSDP_ST_ALL;
send_message(ifs, type, &sa);
return;
}
type = strchr(type, ':');
if (!type)
return;
type++;
while (isspace(*type))
type++;
ptr = strstr(type, "\r\n");
if (!ptr)
return;
*ptr = 0;
for (i = 0; supported_types[i]; i++) {
if (!strcmp(supported_types[i], type)) {
logit(LOG_DEBUG, "M-SEARCH * ST: %s from %s port %d", type,
inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
send_message(ifs, type, &sa);
return;
}
}
logit(LOG_DEBUG, "M-SEARCH * for unsupported ST: %s from %s", type,
inet_ntoa(sin->sin_addr));
}
}
} | 339 | True | 1 |
||
CVE-2019-14323 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/troglobit/ssdp-responder/commit/ce04b1f29a137198182f60bbb628d5ceb8171765', 'name': 'https://github.com/troglobit/ssdp-responder/commit/ce04b1f29a137198182f60bbb628d5ceb8171765', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/troglobit/ssdp-responder/issues/1', 'name': 'https://github.com/troglobit/ssdp-responder/issues/1', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-787'}, {'lang': 'en', 'value': 'CWE-193'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:simple_service_discovery_protocol_responder_project:simple_service_discovery_protocol_responder:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.0', 'versionEndIncluding': '1.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'SSDP Responder 1.x through 1.5 mishandles incoming network messages, leading to a stack-based buffer overflow by 1 byte. This results in a crash of the server, but only when strict stack checking is enabled. This is caused by an off-by-one error in ssdp_recv in ssdpd.c.'}] | 2020-12-16T18:55Z | 2019-07-28T13: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 | Joachim Nilsson | 2019-07-24 07:35:23+02:00 | Fix #1: Ensure recv buf is always NUL terminated
Signed-off-by: Joachim Nilsson <[email protected]> | ce04b1f29a137198182f60bbb628d5ceb8171765 | False | troglobit/ssdp-responder | SSDP responder for Linux, InternetGatewayDevice icon in Windows :) | 2017-05-10 07:07:30 | 2022-01-14 13:29:14 | troglobit | 42.0 | 14.0 | ssdp_recv | ssdp_recv( int sd) | ['sd'] | static void ssdp_recv(int sd)
{
ssize_t len;
struct sockaddr sa;
socklen_t salen;
char buf[MAX_PKT_SIZE];
memset(buf, 0, sizeof(buf));
len = recvfrom(sd, buf, sizeof(buf), MSG_DONTWAIT, &sa, &salen);
if (len > 0) {
buf[len] = 0;
if (sa.sa_family != AF_INET)
return;
if (strstr(buf, "M-SEARCH *")) {
size_t i;
char *ptr, *type;
struct ifsock *ifs;
struct sockaddr_in *sin = (struct sockaddr_in *)&sa;
ifs = find_outbound(&sa);
if (!ifs) {
logit(LOG_DEBUG, "No matching socket for client %s", inet_ntoa(sin->sin_addr));
return;
}
logit(LOG_DEBUG, "Matching socket for client %s", inet_ntoa(sin->sin_addr));
type = strcasestr(buf, "\r\nST:");
if (!type) {
logit(LOG_DEBUG, "No Search Type (ST:) found in M-SEARCH *, assuming " SSDP_ST_ALL);
type = SSDP_ST_ALL;
send_message(ifs, type, &sa);
return;
}
type = strchr(type, ':');
if (!type)
return;
type++;
while (isspace(*type))
type++;
ptr = strstr(type, "\r\n");
if (!ptr)
return;
*ptr = 0;
for (i = 0; supported_types[i]; i++) {
if (!strcmp(supported_types[i], type)) {
logit(LOG_DEBUG, "M-SEARCH * ST: %s from %s port %d", type,
inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
send_message(ifs, type, &sa);
return;
}
}
logit(LOG_DEBUG, "M-SEARCH * for unsupported ST: %s from %s", type,
inet_ntoa(sin->sin_addr));
}
}
} | 339 | True | 1 |
|
CVE-2019-14452 | 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.0/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/Sigil-Ebook/Sigil/commit/0979ba8d10c96ebca330715bfd4494ea0e019a8f', 'name': 'https://github.com/Sigil-Ebook/Sigil/commit/0979ba8d10c96ebca330715bfd4494ea0e019a8f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Sigil-Ebook/Sigil/compare/ea7f27d...5b867e5', 'name': 'https://github.com/Sigil-Ebook/Sigil/compare/ea7f27d...5b867e5', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/Sigil-Ebook/flightcrew/issues/52#issuecomment-505997355', 'name': 'https://github.com/Sigil-Ebook/flightcrew/issues/52#issuecomment-505997355', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/Sigil-Ebook/flightcrew/issues/52#issuecomment-505967936', 'name': 'https://github.com/Sigil-Ebook/flightcrew/issues/52#issuecomment-505967936', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/Sigil-Ebook/Sigil/commit/04e2f280cc4a0766bedcc7b9eb56449ceecc2ad4', 'name': 'https://github.com/Sigil-Ebook/Sigil/commit/04e2f280cc4a0766bedcc7b9eb56449ceecc2ad4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Sigil-Ebook/Sigil/commit/369eebe936e4a8c83cc54662a3412ce8bef189e4', 'name': 'https://github.com/Sigil-Ebook/Sigil/commit/369eebe936e4a8c83cc54662a3412ce8bef189e4', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/Sigil-Ebook/Sigil/releases/tag/0.9.16', 'name': 'https://github.com/Sigil-Ebook/Sigil/releases/tag/0.9.16', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4085-1/', 'name': 'USN-4085-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://salvatoresecurity.com/zip-slip-in-sigil-cve-2019-14452/', 'name': 'https://salvatoresecurity.com/zip-slip-in-sigil-cve-2019-14452/', 'refsource': 'MISC', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-22'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sigil-ebook:sigil:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.9.16', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:flightcrew_project:flightcrew:*:*:*:*:*:sigil:*:*', 'versionStartIncluding': '0.9.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.04:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Sigil before 0.9.16 is vulnerable to a directory traversal, allowing attackers to write arbitrary files via a ../ (dot dot slash) in a ZIP archive entry that is mishandled during extraction.'}] | 2019-08-05T22:15Z | 2019-07-31T02:15Z | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Many file operations are intended to take place within a restricted directory. By using special elements such as ".." and "/" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the "../" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as "/usr/local/bin", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add ".txt" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.
| https://cwe.mitre.org/data/definitions/22.html | 0 | Kevin Hendricks | 2019-06-27 11:47:42-04:00 | further harden against malicious epubs and produce error message | 04e2f280cc4a0766bedcc7b9eb56449ceecc2ad4 | False | Sigil-Ebook/Sigil | Sigil is a multi-platform EPUB ebook editor | 2013-09-15 15:41:20 | 2022-08-18 18:32:16 | Sigil-Ebook | 4703.0 | 545.0 | ImportEPUB::ExtractContainer | ImportEPUB::ExtractContainer() | [] | void ImportEPUB::ExtractContainer()
{
int res = 0;
if (!cp437) {
cp437 = new QCodePage437Codec();
}
#ifdef Q_OS_WIN32
zlib_filefunc64_def ffunc;
fill_win32_filefunc64W(&ffunc);
unzFile zfile = unzOpen2_64(Utility::QStringToStdWString(QDir::toNativeSeparators(m_FullFilePath)).c_str(), &ffunc);
#else
unzFile zfile = unzOpen64(QDir::toNativeSeparators(m_FullFilePath).toUtf8().constData());
#endif
if (zfile == NULL) {
throw (EPUBLoadParseError(QString(QObject::tr("Cannot unzip EPUB: %1")).arg(QDir::toNativeSeparators(m_FullFilePath)).toStdString()));
}
res = unzGoToFirstFile(zfile);
if (res == UNZ_OK) {
do {
// Get the name of the file in the archive.
char file_name[MAX_PATH] = {0};
unz_file_info64 file_info;
unzGetCurrentFileInfo64(zfile, &file_info, file_name, MAX_PATH, NULL, 0, NULL, 0);
QString qfile_name;
QString cp437_file_name;
qfile_name = QString::fromUtf8(file_name);
if (!(file_info.flag & (1<<11))) {
// General purpose bit 11 says the filename is utf-8 encoded. If not set then
// IBM 437 encoding might be used.
cp437_file_name = cp437->toUnicode(file_name);
}
// If there is no file name then we can't do anything with it.
if (!qfile_name.isEmpty()) {
// for security reasons we need the file path to always be inside the
// target folder and not outside, so we will remove all relative upward
// paths segments ".." from the file path before prepending the target
// folder to create the final target path
qfile_name = qfile_name.replace("../","");
cp437_file_name = cp437_file_name.replace("../","");
// We use the dir object to create the path in the temporary directory.
// Unfortunately, we need a dir ojbect to do this as it's not a static function.
QDir dir(m_ExtractedFolderPath);
// Full file path in the temporary directory.
QString file_path = m_ExtractedFolderPath + "/" + qfile_name;
QFileInfo qfile_info(file_path);
// Is this entry a directory?
if (file_info.uncompressed_size == 0 && qfile_name.endsWith('/')) {
dir.mkpath(qfile_name);
continue;
} else {
dir.mkpath(qfile_info.path());
// add it to the list of files found inside the zip
if (cp437_file_name.isEmpty()) {
m_ZipFilePaths << qfile_name;
} else {
m_ZipFilePaths << cp437_file_name;
}
}
// Open the file entry in the archive for reading.
if (unzOpenCurrentFile(zfile) != UNZ_OK) {
unzClose(zfile);
throw (EPUBLoadParseError(QString(QObject::tr("Cannot extract file: %1")).arg(qfile_name).toStdString()));
}
// Open the file on disk to write the entry in the archive to.
QFile entry(file_path);
if (!entry.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
unzCloseCurrentFile(zfile);
unzClose(zfile);
throw (EPUBLoadParseError(QString(QObject::tr("Cannot extract file: %1")).arg(qfile_name).toStdString()));
}
// Buffered reading and writing.
char buff[BUFF_SIZE] = {0};
int read = 0;
while ((read = unzReadCurrentFile(zfile, buff, BUFF_SIZE)) > 0) {
entry.write(buff, read);
}
entry.close();
// Read errors are marked by a negative read amount.
if (read < 0) {
unzCloseCurrentFile(zfile);
unzClose(zfile);
throw (EPUBLoadParseError(QString(QObject::tr("Cannot extract file: %1")).arg(qfile_name).toStdString()));
}
// The file was read but the CRC did not match.
// We don't check the read file size vs the uncompressed file size
// because if they're different there should be a CRC error.
if (unzCloseCurrentFile(zfile) == UNZ_CRCERROR) {
unzClose(zfile);
throw (EPUBLoadParseError(QString(QObject::tr("Cannot extract file: %1")).arg(qfile_name).toStdString()));
}
if (!cp437_file_name.isEmpty() && cp437_file_name != qfile_name) {
QString cp437_file_path = m_ExtractedFolderPath + "/" + cp437_file_name;
QFile::copy(file_path, cp437_file_path);
}
}
} while ((res = unzGoToNextFile(zfile)) == UNZ_OK);
}
if (res != UNZ_END_OF_LIST_OF_FILE) {
unzClose(zfile);
throw (EPUBLoadParseError(QString(QObject::tr("Cannot open EPUB: %1")).arg(QDir::toNativeSeparators(m_FullFilePath)).toStdString()));
}
unzClose(zfile);
} | 657 | True | 1 |
|
CVE-2019-14459 | 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/phaag/nfdump/commit/3b006ededaf351f1723aea6c727c9edd1b1fff9b', 'name': 'https://github.com/phaag/nfdump/commit/3b006ededaf351f1723aea6c727c9edd1b1fff9b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/phaag/nfdump/issues/171', 'name': 'https://github.com/phaag/nfdump/issues/171', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/ULSZMKA7P7REJMANVL7D6WMZ2L7IRSET/', 'name': 'FEDORA-2019-0fbfb00cbb', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/YTONOGJU5FSMFNRCT6OHXYUMDRKH4RPA/', 'name': 'FEDORA-2019-9013b5e75d', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-17', 'name': 'GLSA-202003-17', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/09/msg00021.html', 'name': '[debian-lts-announce] 20200926 [SECURITY] [DLA 2383-1] nfdump security update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-190'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:nfdump_project:nfdump:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.6.17', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'nfdump 1.6.17 and earlier is affected by an integer overflow in the function Process_ipfix_template_withdraw in ipfix.c that can be abused in order to crash the process remotely (denial of service).'}] | 2020-09-26T18:15Z | 2019-07-31T21: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 | Peter Haag | 2019-07-27 15:20:30+02:00 | Fix potential unsigned integer underflow | 3b006ededaf351f1723aea6c727c9edd1b1fff9b | False | phaag/nfdump | Netflow processing tools | 2015-08-09 12:12:03 | 2022-08-27 16:04:36 | null | phaag | 583.0 | 163.0 | Process_ipfix_template_add | Process_ipfix_template_add( exporter_ipfix_domain_t * exporter , void * DataPtr , uint32_t size_left , FlowSource_t * fs) | ['exporter', 'DataPtr', 'size_left', 'fs'] | static void Process_ipfix_template_add(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs) {
input_translation_t *translation_table;
ipfix_template_record_t *ipfix_template_record;
ipfix_template_elements_std_t *NextElement;
int i;
// a template flowset can contain multiple records ( templates )
while ( size_left ) {
uint32_t table_id, count, size_required;
uint32_t num_extensions = 0;
if ( size_left && size_left < 4 ) {
LogError("Process_ipfix [%u] Template size error at %s line %u" ,
exporter->info.id, __FILE__, __LINE__, strerror (errno));
size_left = 0;
continue;
}
// map next record.
ipfix_template_record = (ipfix_template_record_t *)DataPtr;
size_left -= 4;
table_id = ntohs(ipfix_template_record->TemplateID);
count = ntohs(ipfix_template_record->FieldCount);
dbg_printf("\n[%u] Template ID: %u\n", exporter->info.id, table_id);
dbg_printf("FieldCount: %u buffersize: %u\n", count, size_left);
// prepare
// clear helper tables
memset((void *)cache.common_extensions, 0, (Max_num_extensions+1)*sizeof(uint32_t));
memset((void *)cache.lookup_info, 0, 65536 * sizeof(struct element_param_s));
for (i=1; ipfix_element_map[i].id != 0; i++ ) {
uint32_t Type = ipfix_element_map[i].id;
if ( ipfix_element_map[i].id == ipfix_element_map[i-1].id )
continue;
cache.lookup_info[Type].index = i;
// other elements cleard be memset
}
cache.input_order = calloc(count, sizeof(struct order_s));
if ( !cache.input_order ) {
LogError("Process_ipfix: Panic! malloc(): %s line %d: %s", __FILE__, __LINE__, strerror (errno));
size_left = 0;
continue;
}
cache.input_count = count;
// assume all elements in template are std elements. correct this value, if we find an enterprise element
size_required = 4*count;
if ( size_left < size_required ) {
// if we fail this check, this flowset must be skipped.
LogError("Process_ipfix: [%u] Not enough data for template elements! required: %i, left: %u",
exporter->info.id, size_required, size_left);
dbg_printf("ERROR: Not enough data for template elements! required: %i, left: %u", size_required, size_left);
return;
}
// process all elements in this record
NextElement = (ipfix_template_elements_std_t *)ipfix_template_record->elements;
for ( i=0; i<count; i++ ) {
uint16_t Type, Length;
uint32_t ext_id;
int Enterprise;
Type = ntohs(NextElement->Type);
Length = ntohs(NextElement->Length);
Enterprise = Type & 0x8000 ? 1 : 0;
Type = Type & 0x7FFF;
ext_id = MapElement(Type, Length, i);
// do we store this extension? enabled != 0
// more than 1 v9 tag may map to an extension - so count this extension once only
if ( ext_id && extension_descriptor[ext_id].enabled ) {
if ( cache.common_extensions[ext_id] == 0 ) {
cache.common_extensions[ext_id] = 1;
num_extensions++;
}
}
if ( Enterprise ) {
ipfix_template_elements_e_t *e = (ipfix_template_elements_e_t *)NextElement;
size_required += 4; // ad 4 for enterprise value
if ( size_left < size_required ) {
LogError("Process_ipfix: [%u] Not enough data for template elements! required: %i, left: %u",
exporter->info.id, size_required, size_left);
dbg_printf("ERROR: Not enough data for template elements! required: %i, left: %u", size_required, size_left);
return;
}
if ( ntohl(e->EnterpriseNumber) == IPFIX_ReverseInformationElement ) {
dbg_printf(" [%i] Enterprise: 1, Type: %u, Length %u Reverse Information Element: %u\n", i, Type, Length, ntohl(e->EnterpriseNumber));
} else {
dbg_printf(" [%i] Enterprise: 1, Type: %u, Length %u EnterpriseNumber: %u\n", i, Type, Length, ntohl(e->EnterpriseNumber));
}
e++;
NextElement = (ipfix_template_elements_std_t *)e;
} else {
dbg_printf(" [%i] Enterprise: 0, Type: %u, Length %u\n", i, Type, Length);
NextElement++;
}
}
dbg_printf("Processed: %u\n", size_required);
// compact input order and reorder sequencer
if ( compact_input_order() ) {
// valid template with common inout fields
// as the router IP address extension is not part announced in a template, we need to deal with it here
if ( extension_descriptor[EX_ROUTER_IP_v4].enabled ) {
if ( cache.common_extensions[EX_ROUTER_IP_v4] == 0 ) {
cache.common_extensions[EX_ROUTER_IP_v4] = 1;
num_extensions++;
}
dbg_printf("Add sending router IP address (%s) => Extension: %u\n",
fs->sa_family == PF_INET6 ? "ipv6" : "ipv4", EX_ROUTER_IP_v4);
}
// XXX for now, we do not store router ID in IPFIX
extension_descriptor[EX_ROUTER_ID].enabled = 0;
/*
// as the router IP address extension is not part announced in a template, we need to deal with it here
if ( extension_descriptor[EX_ROUTER_ID].enabled ) {
if ( cache.common_extensions[EX_ROUTER_ID] == 0 ) {
cache.common_extensions[EX_ROUTER_ID] = 1;
num_extensions++;
}
dbg_printf("Force add router ID (engine type/ID), Extension: %u\n", EX_ROUTER_ID);
}
*/
// received time
if ( extension_descriptor[EX_RECEIVED].enabled ) {
if ( cache.common_extensions[EX_RECEIVED] == 0 ) {
cache.common_extensions[EX_RECEIVED] = 1;
num_extensions++;
}
dbg_printf("Force add packet received time, Extension: %u\n", EX_RECEIVED);
}
#ifdef DEVEL
{
int i;
for (i=4; extension_descriptor[i].id; i++ ) {
if ( cache.common_extensions[i] ) {
printf("Enabled extension: %i\n", i);
}
}
}
#endif
translation_table = setup_translation_table(exporter, table_id);
if (translation_table->extension_map_changed ) {
// refresh he map in the ouput buffer
dbg_printf("Translation Table changed! Add extension map ID: %i\n", translation_table->extension_info.map->map_id);
AddExtensionMap(fs, translation_table->extension_info.map);
translation_table->extension_map_changed = 0;
dbg_printf("Translation Table added! map ID: %i\n", translation_table->extension_info.map->map_id);
}
if ( !reorder_sequencer(translation_table) ) {
LogError("Process_ipfix: [%u] Failed to reorder sequencer. Remove table id: %u",
exporter->info.id, table_id);
remove_translation_table(fs, exporter, table_id);
}
} else {
dbg_printf("Template does not contain any common fields - skip\n");
}
// update size left of this flowset
size_left -= size_required;
DataPtr = DataPtr + size_required+4; // +4 for header
if ( size_left < 4 ) {
// pading
dbg_printf("Skip %u bytes padding\n", size_left);
size_left = 0;
}
free(cache.input_order);
cache.input_order = NULL;
}
} // End of Process_ipfix_template_add | 894 | True | 1 |
CVE-2019-14462 | 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://libmodbus.org/2019/stable-and-development-releases/', 'name': 'https://libmodbus.org/2019/stable-and-development-releases/', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc', 'name': 'https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/HAGHQFJTJCMYHW553OUWJ3YIJR6PJHB7/', 'name': 'FEDORA-2019-4942e01cdc', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/PRAQZXGAZY6UGWZ6CD33QEFLL7AWW233/', 'name': 'FEDORA-2019-355f6e10c1', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/11/msg00020.html', 'name': '[debian-lts-announce] 20211122 [SECURITY] [DLA 2825-1] libmodbus security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmodbus:libmodbus:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.1.0', 'versionEndExcluding': '3.1.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmodbus:libmodbus:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.7', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:29:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in libmodbus before 3.0.7 and 3.1.x before 3.1.5. There is an out-of-bounds read for the MODBUS_FC_WRITE_MULTIPLE_COILS case, aka VD-1302.'}] | 2021-11-23T22:24Z | 2019-07-31T23: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 | Stéphane Raimbault | 2019-07-26 16:00:06+02:00 | Fix VD-1301 and VD-1302 vulnerabilities
This patch was contributed by Maor Vermucht and Or Peles from
VDOO Connected Trust. | 5ccdf5ef79d742640355d1132fa9e2abc7fbaefc | False | stephane/libmodbus | A Modbus library for Linux, Mac OS, FreeBSD and Windows | 2010-01-21 10:42:06 | 2022-08-24 20:25:09 | http://libmodbus.org | stephane | 2373.0 | 1428.0 | modbus_reply | modbus_reply( modbus_t * ctx , const uint8_t * req , int req_length , modbus_mapping_t * mb_mapping) | ['ctx', 'req', 'req_length', 'mb_mapping'] | int modbus_reply(modbus_t *ctx, const uint8_t *req,
int req_length, modbus_mapping_t *mb_mapping)
{
int offset;
int slave;
int function;
uint16_t address;
uint8_t rsp[MAX_MESSAGE_LENGTH];
int rsp_length = 0;
sft_t sft;
if (ctx == NULL) {
errno = EINVAL;
return -1;
}
offset = ctx->backend->header_length;
slave = req[offset - 1];
function = req[offset];
address = (req[offset + 1] << 8) + req[offset + 2];
sft.slave = slave;
sft.function = function;
sft.t_id = ctx->backend->prepare_response_tid(req, &req_length);
/* Data are flushed on illegal number of values errors. */
switch (function) {
case MODBUS_FC_READ_COILS:
case MODBUS_FC_READ_DISCRETE_INPUTS: {
unsigned int is_input = (function == MODBUS_FC_READ_DISCRETE_INPUTS);
int start_bits = is_input ? mb_mapping->start_input_bits : mb_mapping->start_bits;
int nb_bits = is_input ? mb_mapping->nb_input_bits : mb_mapping->nb_bits;
uint8_t *tab_bits = is_input ? mb_mapping->tab_input_bits : mb_mapping->tab_bits;
const char * const name = is_input ? "read_input_bits" : "read_bits";
int nb = (req[offset + 3] << 8) + req[offset + 4];
/* The mapping can be shifted to reduce memory consumption and it
doesn't always start at address zero. */
int mapping_address = address - start_bits;
if (nb < 1 || MODBUS_MAX_READ_BITS < nb) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal nb of values %d in %s (max %d)\n",
nb, name, MODBUS_MAX_READ_BITS);
} else if (mapping_address < 0 || (mapping_address + nb) > nb_bits) {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in %s\n",
mapping_address < 0 ? address : address + nb, name);
} else {
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
rsp[rsp_length++] = (nb / 8) + ((nb % 8) ? 1 : 0);
rsp_length = response_io_status(tab_bits, mapping_address, nb,
rsp, rsp_length);
}
}
break;
case MODBUS_FC_READ_HOLDING_REGISTERS:
case MODBUS_FC_READ_INPUT_REGISTERS: {
unsigned int is_input = (function == MODBUS_FC_READ_INPUT_REGISTERS);
int start_registers = is_input ? mb_mapping->start_input_registers : mb_mapping->start_registers;
int nb_registers = is_input ? mb_mapping->nb_input_registers : mb_mapping->nb_registers;
uint16_t *tab_registers = is_input ? mb_mapping->tab_input_registers : mb_mapping->tab_registers;
const char * const name = is_input ? "read_input_registers" : "read_registers";
int nb = (req[offset + 3] << 8) + req[offset + 4];
/* The mapping can be shifted to reduce memory consumption and it
doesn't always start at address zero. */
int mapping_address = address - start_registers;
if (nb < 1 || MODBUS_MAX_READ_REGISTERS < nb) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal nb of values %d in %s (max %d)\n",
nb, name, MODBUS_MAX_READ_REGISTERS);
} else if (mapping_address < 0 || (mapping_address + nb) > nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in %s\n",
mapping_address < 0 ? address : address + nb, name);
} else {
int i;
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
rsp[rsp_length++] = nb << 1;
for (i = mapping_address; i < mapping_address + nb; i++) {
rsp[rsp_length++] = tab_registers[i] >> 8;
rsp[rsp_length++] = tab_registers[i] & 0xFF;
}
}
}
break;
case MODBUS_FC_WRITE_SINGLE_COIL: {
int mapping_address = address - mb_mapping->start_bits;
if (mapping_address < 0 || mapping_address >= mb_mapping->nb_bits) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_bit\n",
address);
} else {
int data = (req[offset + 3] << 8) + req[offset + 4];
if (data == 0xFF00 || data == 0x0) {
mb_mapping->tab_bits[mapping_address] = data ? ON : OFF;
memcpy(rsp, req, req_length);
rsp_length = req_length;
} else {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, FALSE,
"Illegal data value 0x%0X in write_bit request at address %0X\n",
data, address);
}
}
}
break;
case MODBUS_FC_WRITE_SINGLE_REGISTER: {
int mapping_address = address - mb_mapping->start_registers;
if (mapping_address < 0 || mapping_address >= mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_register\n",
address);
} else {
int data = (req[offset + 3] << 8) + req[offset + 4];
mb_mapping->tab_registers[mapping_address] = data;
memcpy(rsp, req, req_length);
rsp_length = req_length;
}
}
break;
case MODBUS_FC_WRITE_MULTIPLE_COILS: {
int nb = (req[offset + 3] << 8) + req[offset + 4];
int mapping_address = address - mb_mapping->start_bits;
if (nb < 1 || MODBUS_MAX_WRITE_BITS < nb) {
/* May be the indication has been truncated on reading because of
* invalid address (eg. nb is 0 but the request contains values to
* write) so it's necessary to flush. */
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal number of values %d in write_bits (max %d)\n",
nb, MODBUS_MAX_WRITE_BITS);
} else if (mapping_address < 0 ||
(mapping_address + nb) > mb_mapping->nb_bits) {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_bits\n",
mapping_address < 0 ? address : address + nb);
} else {
/* 6 = byte count */
modbus_set_bits_from_bytes(mb_mapping->tab_bits, mapping_address, nb,
&req[offset + 6]);
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
/* 4 to copy the bit address (2) and the quantity of bits */
memcpy(rsp + rsp_length, req + rsp_length, 4);
rsp_length += 4;
}
}
break;
case MODBUS_FC_WRITE_MULTIPLE_REGISTERS: {
int nb = (req[offset + 3] << 8) + req[offset + 4];
int mapping_address = address - mb_mapping->start_registers;
if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal number of values %d in write_registers (max %d)\n",
nb, MODBUS_MAX_WRITE_REGISTERS);
} else if (mapping_address < 0 ||
(mapping_address + nb) > mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_registers\n",
mapping_address < 0 ? address : address + nb);
} else {
int i, j;
for (i = mapping_address, j = 6; i < mapping_address + nb; i++, j += 2) {
/* 6 and 7 = first value */
mb_mapping->tab_registers[i] =
(req[offset + j] << 8) + req[offset + j + 1];
}
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
/* 4 to copy the address (2) and the no. of registers */
memcpy(rsp + rsp_length, req + rsp_length, 4);
rsp_length += 4;
}
}
break;
case MODBUS_FC_REPORT_SLAVE_ID: {
int str_len;
int byte_count_pos;
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
/* Skip byte count for now */
byte_count_pos = rsp_length++;
rsp[rsp_length++] = _REPORT_SLAVE_ID;
/* Run indicator status to ON */
rsp[rsp_length++] = 0xFF;
/* LMB + length of LIBMODBUS_VERSION_STRING */
str_len = 3 + strlen(LIBMODBUS_VERSION_STRING);
memcpy(rsp + rsp_length, "LMB" LIBMODBUS_VERSION_STRING, str_len);
rsp_length += str_len;
rsp[byte_count_pos] = rsp_length - byte_count_pos - 1;
}
break;
case MODBUS_FC_READ_EXCEPTION_STATUS:
if (ctx->debug) {
fprintf(stderr, "FIXME Not implemented\n");
}
errno = ENOPROTOOPT;
return -1;
break;
case MODBUS_FC_MASK_WRITE_REGISTER: {
int mapping_address = address - mb_mapping->start_registers;
if (mapping_address < 0 || mapping_address >= mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_register\n",
address);
} else {
uint16_t data = mb_mapping->tab_registers[mapping_address];
uint16_t and = (req[offset + 3] << 8) + req[offset + 4];
uint16_t or = (req[offset + 5] << 8) + req[offset + 6];
data = (data & and) | (or & (~and));
mb_mapping->tab_registers[mapping_address] = data;
memcpy(rsp, req, req_length);
rsp_length = req_length;
}
}
break;
case MODBUS_FC_WRITE_AND_READ_REGISTERS: {
int nb = (req[offset + 3] << 8) + req[offset + 4];
uint16_t address_write = (req[offset + 5] << 8) + req[offset + 6];
int nb_write = (req[offset + 7] << 8) + req[offset + 8];
int nb_write_bytes = req[offset + 9];
int mapping_address = address - mb_mapping->start_registers;
int mapping_address_write = address_write - mb_mapping->start_registers;
if (nb_write < 1 || MODBUS_MAX_WR_WRITE_REGISTERS < nb_write ||
nb < 1 || MODBUS_MAX_WR_READ_REGISTERS < nb ||
nb_write_bytes != nb_write * 2) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal nb of values (W%d, R%d) in write_and_read_registers (max W%d, R%d)\n",
nb_write, nb, MODBUS_MAX_WR_WRITE_REGISTERS, MODBUS_MAX_WR_READ_REGISTERS);
} else if (mapping_address < 0 ||
(mapping_address + nb) > mb_mapping->nb_registers ||
mapping_address < 0 ||
(mapping_address_write + nb_write) > mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data read address 0x%0X or write address 0x%0X write_and_read_registers\n",
mapping_address < 0 ? address : address + nb,
mapping_address_write < 0 ? address_write : address_write + nb_write);
} else {
int i, j;
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
rsp[rsp_length++] = nb << 1;
/* Write first.
10 and 11 are the offset of the first values to write */
for (i = mapping_address_write, j = 10;
i < mapping_address_write + nb_write; i++, j += 2) {
mb_mapping->tab_registers[i] =
(req[offset + j] << 8) + req[offset + j + 1];
}
/* and read the data for the response */
for (i = mapping_address; i < mapping_address + nb; i++) {
rsp[rsp_length++] = mb_mapping->tab_registers[i] >> 8;
rsp[rsp_length++] = mb_mapping->tab_registers[i] & 0xFF;
}
}
}
break;
default:
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_FUNCTION, rsp, TRUE,
"Unknown Modbus function code: 0x%0X\n", function);
break;
}
/* Suppress any responses when the request was a broadcast */
return (ctx->backend->backend_type == _MODBUS_BACKEND_TYPE_RTU &&
slave == MODBUS_BROADCAST_ADDRESS) ? 0 : send_msg(ctx, rsp, rsp_length);
} | 1923 | True | 1 |
CVE-2019-14463 | 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://libmodbus.org/2019/stable-and-development-releases/', 'name': 'https://libmodbus.org/2019/stable-and-development-releases/', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc', 'name': 'https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/HAGHQFJTJCMYHW553OUWJ3YIJR6PJHB7/', 'name': 'FEDORA-2019-4942e01cdc', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/PRAQZXGAZY6UGWZ6CD33QEFLL7AWW233/', 'name': 'FEDORA-2019-355f6e10c1', 'refsource': 'FEDORA', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/11/msg00020.html', 'name': '[debian-lts-announce] 20211122 [SECURITY] [DLA 2825-1] libmodbus security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmodbus:libmodbus:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.1.0', 'versionEndExcluding': '3.1.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:libmodbus:libmodbus:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.0.7', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:29:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'An issue was discovered in libmodbus before 3.0.7 and 3.1.x before 3.1.5. There is an out-of-bounds read for the MODBUS_FC_WRITE_MULTIPLE_REGISTERS case, aka VD-1301.'}] | 2021-11-23T22:24Z | 2019-07-31T23: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 | Stéphane Raimbault | 2019-07-26 16:00:06+02:00 | Fix VD-1301 and VD-1302 vulnerabilities
This patch was contributed by Maor Vermucht and Or Peles from
VDOO Connected Trust. | 5ccdf5ef79d742640355d1132fa9e2abc7fbaefc | False | stephane/libmodbus | A Modbus library for Linux, Mac OS, FreeBSD and Windows | 2010-01-21 10:42:06 | 2022-08-24 20:25:09 | http://libmodbus.org | stephane | 2373.0 | 1428.0 | modbus_reply | modbus_reply( modbus_t * ctx , const uint8_t * req , int req_length , modbus_mapping_t * mb_mapping) | ['ctx', 'req', 'req_length', 'mb_mapping'] | int modbus_reply(modbus_t *ctx, const uint8_t *req,
int req_length, modbus_mapping_t *mb_mapping)
{
int offset;
int slave;
int function;
uint16_t address;
uint8_t rsp[MAX_MESSAGE_LENGTH];
int rsp_length = 0;
sft_t sft;
if (ctx == NULL) {
errno = EINVAL;
return -1;
}
offset = ctx->backend->header_length;
slave = req[offset - 1];
function = req[offset];
address = (req[offset + 1] << 8) + req[offset + 2];
sft.slave = slave;
sft.function = function;
sft.t_id = ctx->backend->prepare_response_tid(req, &req_length);
/* Data are flushed on illegal number of values errors. */
switch (function) {
case MODBUS_FC_READ_COILS:
case MODBUS_FC_READ_DISCRETE_INPUTS: {
unsigned int is_input = (function == MODBUS_FC_READ_DISCRETE_INPUTS);
int start_bits = is_input ? mb_mapping->start_input_bits : mb_mapping->start_bits;
int nb_bits = is_input ? mb_mapping->nb_input_bits : mb_mapping->nb_bits;
uint8_t *tab_bits = is_input ? mb_mapping->tab_input_bits : mb_mapping->tab_bits;
const char * const name = is_input ? "read_input_bits" : "read_bits";
int nb = (req[offset + 3] << 8) + req[offset + 4];
/* The mapping can be shifted to reduce memory consumption and it
doesn't always start at address zero. */
int mapping_address = address - start_bits;
if (nb < 1 || MODBUS_MAX_READ_BITS < nb) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal nb of values %d in %s (max %d)\n",
nb, name, MODBUS_MAX_READ_BITS);
} else if (mapping_address < 0 || (mapping_address + nb) > nb_bits) {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in %s\n",
mapping_address < 0 ? address : address + nb, name);
} else {
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
rsp[rsp_length++] = (nb / 8) + ((nb % 8) ? 1 : 0);
rsp_length = response_io_status(tab_bits, mapping_address, nb,
rsp, rsp_length);
}
}
break;
case MODBUS_FC_READ_HOLDING_REGISTERS:
case MODBUS_FC_READ_INPUT_REGISTERS: {
unsigned int is_input = (function == MODBUS_FC_READ_INPUT_REGISTERS);
int start_registers = is_input ? mb_mapping->start_input_registers : mb_mapping->start_registers;
int nb_registers = is_input ? mb_mapping->nb_input_registers : mb_mapping->nb_registers;
uint16_t *tab_registers = is_input ? mb_mapping->tab_input_registers : mb_mapping->tab_registers;
const char * const name = is_input ? "read_input_registers" : "read_registers";
int nb = (req[offset + 3] << 8) + req[offset + 4];
/* The mapping can be shifted to reduce memory consumption and it
doesn't always start at address zero. */
int mapping_address = address - start_registers;
if (nb < 1 || MODBUS_MAX_READ_REGISTERS < nb) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal nb of values %d in %s (max %d)\n",
nb, name, MODBUS_MAX_READ_REGISTERS);
} else if (mapping_address < 0 || (mapping_address + nb) > nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in %s\n",
mapping_address < 0 ? address : address + nb, name);
} else {
int i;
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
rsp[rsp_length++] = nb << 1;
for (i = mapping_address; i < mapping_address + nb; i++) {
rsp[rsp_length++] = tab_registers[i] >> 8;
rsp[rsp_length++] = tab_registers[i] & 0xFF;
}
}
}
break;
case MODBUS_FC_WRITE_SINGLE_COIL: {
int mapping_address = address - mb_mapping->start_bits;
if (mapping_address < 0 || mapping_address >= mb_mapping->nb_bits) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_bit\n",
address);
} else {
int data = (req[offset + 3] << 8) + req[offset + 4];
if (data == 0xFF00 || data == 0x0) {
mb_mapping->tab_bits[mapping_address] = data ? ON : OFF;
memcpy(rsp, req, req_length);
rsp_length = req_length;
} else {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, FALSE,
"Illegal data value 0x%0X in write_bit request at address %0X\n",
data, address);
}
}
}
break;
case MODBUS_FC_WRITE_SINGLE_REGISTER: {
int mapping_address = address - mb_mapping->start_registers;
if (mapping_address < 0 || mapping_address >= mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_register\n",
address);
} else {
int data = (req[offset + 3] << 8) + req[offset + 4];
mb_mapping->tab_registers[mapping_address] = data;
memcpy(rsp, req, req_length);
rsp_length = req_length;
}
}
break;
case MODBUS_FC_WRITE_MULTIPLE_COILS: {
int nb = (req[offset + 3] << 8) + req[offset + 4];
int mapping_address = address - mb_mapping->start_bits;
if (nb < 1 || MODBUS_MAX_WRITE_BITS < nb) {
/* May be the indication has been truncated on reading because of
* invalid address (eg. nb is 0 but the request contains values to
* write) so it's necessary to flush. */
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal number of values %d in write_bits (max %d)\n",
nb, MODBUS_MAX_WRITE_BITS);
} else if (mapping_address < 0 ||
(mapping_address + nb) > mb_mapping->nb_bits) {
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_bits\n",
mapping_address < 0 ? address : address + nb);
} else {
/* 6 = byte count */
modbus_set_bits_from_bytes(mb_mapping->tab_bits, mapping_address, nb,
&req[offset + 6]);
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
/* 4 to copy the bit address (2) and the quantity of bits */
memcpy(rsp + rsp_length, req + rsp_length, 4);
rsp_length += 4;
}
}
break;
case MODBUS_FC_WRITE_MULTIPLE_REGISTERS: {
int nb = (req[offset + 3] << 8) + req[offset + 4];
int mapping_address = address - mb_mapping->start_registers;
if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal number of values %d in write_registers (max %d)\n",
nb, MODBUS_MAX_WRITE_REGISTERS);
} else if (mapping_address < 0 ||
(mapping_address + nb) > mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_registers\n",
mapping_address < 0 ? address : address + nb);
} else {
int i, j;
for (i = mapping_address, j = 6; i < mapping_address + nb; i++, j += 2) {
/* 6 and 7 = first value */
mb_mapping->tab_registers[i] =
(req[offset + j] << 8) + req[offset + j + 1];
}
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
/* 4 to copy the address (2) and the no. of registers */
memcpy(rsp + rsp_length, req + rsp_length, 4);
rsp_length += 4;
}
}
break;
case MODBUS_FC_REPORT_SLAVE_ID: {
int str_len;
int byte_count_pos;
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
/* Skip byte count for now */
byte_count_pos = rsp_length++;
rsp[rsp_length++] = _REPORT_SLAVE_ID;
/* Run indicator status to ON */
rsp[rsp_length++] = 0xFF;
/* LMB + length of LIBMODBUS_VERSION_STRING */
str_len = 3 + strlen(LIBMODBUS_VERSION_STRING);
memcpy(rsp + rsp_length, "LMB" LIBMODBUS_VERSION_STRING, str_len);
rsp_length += str_len;
rsp[byte_count_pos] = rsp_length - byte_count_pos - 1;
}
break;
case MODBUS_FC_READ_EXCEPTION_STATUS:
if (ctx->debug) {
fprintf(stderr, "FIXME Not implemented\n");
}
errno = ENOPROTOOPT;
return -1;
break;
case MODBUS_FC_MASK_WRITE_REGISTER: {
int mapping_address = address - mb_mapping->start_registers;
if (mapping_address < 0 || mapping_address >= mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data address 0x%0X in write_register\n",
address);
} else {
uint16_t data = mb_mapping->tab_registers[mapping_address];
uint16_t and = (req[offset + 3] << 8) + req[offset + 4];
uint16_t or = (req[offset + 5] << 8) + req[offset + 6];
data = (data & and) | (or & (~and));
mb_mapping->tab_registers[mapping_address] = data;
memcpy(rsp, req, req_length);
rsp_length = req_length;
}
}
break;
case MODBUS_FC_WRITE_AND_READ_REGISTERS: {
int nb = (req[offset + 3] << 8) + req[offset + 4];
uint16_t address_write = (req[offset + 5] << 8) + req[offset + 6];
int nb_write = (req[offset + 7] << 8) + req[offset + 8];
int nb_write_bytes = req[offset + 9];
int mapping_address = address - mb_mapping->start_registers;
int mapping_address_write = address_write - mb_mapping->start_registers;
if (nb_write < 1 || MODBUS_MAX_WR_WRITE_REGISTERS < nb_write ||
nb < 1 || MODBUS_MAX_WR_READ_REGISTERS < nb ||
nb_write_bytes != nb_write * 2) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp, TRUE,
"Illegal nb of values (W%d, R%d) in write_and_read_registers (max W%d, R%d)\n",
nb_write, nb, MODBUS_MAX_WR_WRITE_REGISTERS, MODBUS_MAX_WR_READ_REGISTERS);
} else if (mapping_address < 0 ||
(mapping_address + nb) > mb_mapping->nb_registers ||
mapping_address < 0 ||
(mapping_address_write + nb_write) > mb_mapping->nb_registers) {
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp, FALSE,
"Illegal data read address 0x%0X or write address 0x%0X write_and_read_registers\n",
mapping_address < 0 ? address : address + nb,
mapping_address_write < 0 ? address_write : address_write + nb_write);
} else {
int i, j;
rsp_length = ctx->backend->build_response_basis(&sft, rsp);
rsp[rsp_length++] = nb << 1;
/* Write first.
10 and 11 are the offset of the first values to write */
for (i = mapping_address_write, j = 10;
i < mapping_address_write + nb_write; i++, j += 2) {
mb_mapping->tab_registers[i] =
(req[offset + j] << 8) + req[offset + j + 1];
}
/* and read the data for the response */
for (i = mapping_address; i < mapping_address + nb; i++) {
rsp[rsp_length++] = mb_mapping->tab_registers[i] >> 8;
rsp[rsp_length++] = mb_mapping->tab_registers[i] & 0xFF;
}
}
}
break;
default:
rsp_length = response_exception(
ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_FUNCTION, rsp, TRUE,
"Unknown Modbus function code: 0x%0X\n", function);
break;
}
/* Suppress any responses when the request was a broadcast */
return (ctx->backend->backend_type == _MODBUS_BACKEND_TYPE_RTU &&
slave == MODBUS_BROADCAST_ADDRESS) ? 0 : send_msg(ctx, rsp, rsp_length);
} | 1923 | True | 1 |
CVE-2019-14495 | False | False | False | False | AV:N/AC:L/Au:N/C:P/I:P/A:P | NETWORK | LOW | NONE | PARTIAL | PARTIAL | PARTIAL | 7.5 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | HIGH | HIGH | 9.8 | CRITICAL | 3.9 | 5.9 | False | [{'url': 'https://github.com/z3APA3A/3proxy/compare/0.8.12...0.8.13', 'name': 'https://github.com/z3APA3A/3proxy/compare/0.8.12...0.8.13', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/z3APA3A/3proxy/releases/tag/0.8.13', 'name': 'https://github.com/z3APA3A/3proxy/releases/tag/0.8.13', 'refsource': 'MISC', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/z3APA3A/3proxy/commit/3b67dc844789dc0f00e934270c7b349bcb547865', 'name': 'https://github.com/z3APA3A/3proxy/commit/3b67dc844789dc0f00e934270c7b349bcb547865', '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:3proxy:3proxy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '0.8.13', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'webadmin.c in 3proxy before 0.8.13 has an out-of-bounds write in the admin interface.'}] | 2019-10-09T23:46Z | 2019-08-01T17: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 | z3APA3A | 2019-08-01 16:46:22+03:00 | Fix: out-of-bounds write and few more bugs in 'admin' configuration upload | 3b67dc844789dc0f00e934270c7b349bcb547865 | False | visit repo url | visit repo url | visit repo url | visit repo url | visit repo url | z3APA3A | visit repo url | visit repo url | adminchild | adminchild( struct clientparam * param) | ['param'] | void * adminchild(struct clientparam* param) {
int i, res;
char * buf;
char username[256];
char *sb;
char *req = NULL;
struct printparam pp;
int contentlen = 0;
int isform = 0;
pp.inbuf = 0;
pp.cp = param;
buf = myalloc(LINESIZE);
if(!buf) {RETURN(555);}
i = sockgetlinebuf(param, CLIENT, (unsigned char *)buf, LINESIZE - 1, '\n', conf.timeouts[STRING_S]);
if(i<5 || ((buf[0]!='G' || buf[1]!='E' || buf[2]!='T' || buf[3]!=' ' || buf[4]!='/') &&
(buf[0]!='P' || buf[1]!='O' || buf[2]!='S' || buf[3]!='T' || buf[4]!=' ' || buf[5]!='/')))
{
RETURN(701);
}
buf[i] = 0;
sb = strchr(buf+5, ' ');
if(!sb){
RETURN(702);
}
*sb = 0;
req = mystrdup(buf + ((*buf == 'P')? 6 : 5));
while((i = sockgetlinebuf(param, CLIENT, (unsigned char *)buf, LINESIZE - 1, '\n', conf.timeouts[STRING_S])) > 2){
buf[i] = 0;
if(i > 19 && (!strncasecmp(buf, "authorization", 13))){
sb = strchr(buf, ':');
if(!sb)continue;
++sb;
while(isspace(*sb))sb++;
if(!*sb || strncasecmp(sb, "basic", 5)){
continue;
}
sb+=5;
while(isspace(*sb))sb++;
i = de64((unsigned char *)sb, (unsigned char *)username, 255);
if(i<=0)continue;
username[i] = 0;
sb = strchr((char *)username, ':');
if(sb){
*sb = 0;
if(param->password)myfree(param->password);
param->password = (unsigned char *)mystrdup(sb+1);
}
if(param->username) myfree(param->username);
param->username = (unsigned char *)mystrdup(username);
continue;
}
else if(i > 15 && (!strncasecmp(buf, "content-length:", 15))){
sb = buf + 15;
while(isspace(*sb))sb++;
contentlen = atoi(sb);
}
else if(i > 13 && (!strncasecmp(buf, "content-type:", 13))){
sb = buf + 13;
while(isspace(*sb))sb++;
if(!strncasecmp(sb, "x-www-form-urlencoded", 21)) isform = 1;
}
}
param->operation = ADMIN;
if(isform && contentlen) {
printstr(&pp, "HTTP/1.0 100 Continue\r\n\r\n");
stdpr(&pp, NULL, 0);
}
res = (*param->srv->authfunc)(param);
if(res && res != 10) {
printstr(&pp, authreq);
RETURN(res);
}
if(param->srv->singlepacket || param->redirected){
if(*req == 'C') req[1] = 0;
else *req = 0;
}
sprintf(buf, ok, conf.stringtable?(char *)conf.stringtable[2]:"3proxy", conf.stringtable?(char *)conf.stringtable[2]:"3[APA3A] tiny proxy", conf.stringtable?(char *)conf.stringtable[3]:"");
if(*req != 'S') printstr(&pp, buf);
switch(*req){
case 'C':
printstr(&pp, counters);
{
struct trafcount *cp;
int num = 0;
for(cp = conf.trafcounter; cp; cp = cp->next, num++){
int inbuf = 0;
if(cp->ace && (param->srv->singlepacket || param->redirected)){
if(!ACLmatches(cp->ace, param))continue;
}
if(req[1] == 'S' && atoi(req+2) == num) cp->disabled=0;
if(req[1] == 'D' && atoi(req+2) == num) cp->disabled=1;
inbuf += sprintf(buf, "<tr>"
"<td>%s</td><td><A HREF=\'/C%c%d\'>%s</A></td><td>",
(cp->comment)?cp->comment:" ",
(cp->disabled)?'S':'D',
num,
(cp->disabled)?"NO":"YES"
);
if(!cp->ace || !cp->ace->users){
inbuf += sprintf(buf+inbuf, "<center>ANY</center>");
}
else {
inbuf += printuserlist(buf+inbuf, LINESIZE-800, cp->ace->users, ",<br />\r\n");
}
inbuf += sprintf(buf+inbuf, "</td><td>");
if(!cp->ace || !cp->ace->src){
inbuf += sprintf(buf+inbuf, "<center>ANY</center>");
}
else {
inbuf += printiplist(buf+inbuf, LINESIZE-512, cp->ace->src, ",<br />\r\n");
}
inbuf += sprintf(buf+inbuf, "</td><td>");
if(!cp->ace || !cp->ace->dst){
inbuf += sprintf(buf+inbuf, "<center>ANY</center>");
}
else {
inbuf += printiplist(buf+inbuf, LINESIZE-512, cp->ace->dst, ",<br />\r\n");
}
inbuf += sprintf(buf+inbuf, "</td><td>");
if(!cp->ace || !cp->ace->ports){
inbuf += sprintf(buf+inbuf, "<center>ANY</center>");
}
else {
inbuf += printportlist(buf+inbuf, LINESIZE-128, cp->ace->ports, ",<br />\r\n");
}
if(cp->type == NONE) {
inbuf += sprintf(buf+inbuf,
"</td><td colspan=\'6\' align=\'center\'>exclude from limitation</td></tr>\r\n"
);
}
else {
inbuf += sprintf(buf+inbuf,
"</td><td>%"PRINTF_INT64_MODIFIER"u</td>"
"<td>MB%s</td>"
"<td>%"PRINTF_INT64_MODIFIER"u</td>"
"<td>%s</td>",
cp->traflim64 / (1024 * 1024),
rotations[cp->type],
cp->traf64,
cp->cleared?ctime(&cp->cleared):"never"
);
inbuf += sprintf(buf + inbuf,
"<td>%s</td>"
"<td>%i</td>"
"</tr>\r\n",
cp->updated?ctime(&cp->updated):"never",
cp->number
);
}
printstr(&pp, buf);
}
}
printstr(&pp, counterstail);
break;
case 'R':
conf.needreload = 1;
printstr(&pp, "<h3>Reload scheduled</h3>");
break;
case 'S':
{
if(req[1] == 'X'){
printstr(&pp, style);
break;
}
printstr(&pp, xml);
printval(conf.services, TYPE_SERVER, 0, &pp);
printstr(&pp, postxml);
}
break;
case 'F':
{
FILE *fp;
char buf[256];
fp = confopen();
if(!fp){
printstr(&pp, "<h3><font color=\"red\">Failed to open config file</font></h3>");
break;
}
printstr(&pp, "<h3>Please be careful editing config file remotely</h3>");
printstr(&pp, "<form method=\"POST\" action=\"/U\"><textarea cols=\"80\" rows=\"30\" name=\"conffile\">");
while(fgets(buf, 256, fp)){
printstr(&pp, buf);
}
if(!writable) fclose(fp);
printstr(&pp, "</textarea><br><input type=\"Submit\"></form>");
break;
}
case 'U':
{
int l=0;
int error = 0;
if(!writable || fseek(writable, 0, 0)){
error = 1;
}
while((i = sockgetlinebuf(param, CLIENT, (unsigned char *)buf, LINESIZE - 1, '+', conf.timeouts[STRING_S])) > 0){
if(i > (contentlen - l)) i = (contentlen - l);
buf[i] = 0;
if(!l){
if(strncasecmp(buf, "conffile=", 9)) error = 1;
}
if(!error){
decodeurl((unsigned char *)buf, 1);
fprintf(writable, "%s", l? buf : buf + 9);
}
l += i;
if(l >= contentlen) break;
}
if(writable && !error){
fflush(writable);
#ifndef _WINCE
ftruncate(fileno(writable), ftell(writable));
#endif
}
printstr(&pp, error? "<h3><font color=\"red\">Config file is not writable</font></h3>Make sure you have \"writable\" command in configuration file":
"<h3>Configuration updated</h3>");
}
break;
default:
printstr(&pp, (char *)conf.stringtable[WEBBANNERS]);
break;
}
if(*req != 'S') printstr(&pp, tail);
CLEANRET:
printstr(&pp, NULL);
if(buf) myfree(buf);
(*param->srv->logfunc)(param, (unsigned char *)req);
if(req)myfree(req);
freeparam(param);
return (NULL);
} | 1796 | True | 1 |
CVE-2019-14868 | False | False | False | False | AV:L/AC:L/Au:N/C:C/I:C/A:C | LOCAL | LOW | NONE | COMPLETE | COMPLETE | COMPLETE | 7.2 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | LOCAL | LOW | LOW | NONE | UNCHANGED | HIGH | HIGH | HIGH | 7.8 | HIGH | 1.8 | 5.9 | False | [{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-14868', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-14868', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/att/ast/commit/c7de8b641266bac7c77942239ac659edfee9ecd2', 'name': 'https://github.com/att/ast/commit/c7de8b641266bac7c77942239ac659edfee9ecd2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://support.apple.com/kb/HT211170', 'name': 'https://support.apple.com/kb/HT211170', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'http://seclists.org/fulldisclosure/2020/May/53', 'name': '20200529 APPLE-SA-2020-05-26-3 macOS Catalina 10.15.5, Security Update 2020-003 Mojave, Security Update 2020-003 High Sierra', 'refsource': 'FULLDISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/07/msg00015.html', 'name': '[debian-lts-announce] 20200720 [SECURITY] [DLA 2284-1] ksh security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-77'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ksh_project:ksh:20120801:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:apple:mac_os_x:*:*:*:*:*:*:*:*', 'versionEndExcluding': '10.15.5', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'In ksh version 20120801, a flaw was found in the way it evaluates certain environment variables. An attacker could use this flaw to override or bypass environment restrictions to execute shell commands. Services and applications that allow remote unauthenticated attackers to provide one of those environment variables could allow them to exploit this issue remotely.'}] | 2020-10-09T13:46Z | 2020-04-02T17: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 | Kurtis Rader | 2019-12-12 18:46:50-08:00 | Harden env var imports | c7de8b641266bac7c77942239ac659edfee9ecd2 | False | att/ast | AST - AT&T Software Technology | 2013-02-22 19:38:58 | 2021-08-15 21:31:18 | att | 446.0 | 150.0 | sh_strnum | sh_strnum( Shell_t * shp , const char * str , char ** ptr , int mode) | ['shp', 'str', 'ptr', 'mode'] | Sfdouble_t sh_strnum(Shell_t *shp, const char *str, char **ptr, int mode) {
Sfdouble_t d;
char *last;
if (*str == 0) {
if (ptr) *ptr = (char *)str;
return 0;
}
errno = 0;
d = number(str, &last, shp->inarith ? 0 : 10, NULL);
if (*last) {
if (*last != '.' || last[1] != '.') {
d = strval(shp, str, &last, arith, mode);
Varsubscript = true;
}
if (!ptr && *last && mode > 0) errormsg(SH_DICT, ERROR_exit(1), e_lexbadchar, *last, str);
} else if (!d && *str == '-') {
d = -0.0;
}
if (ptr) *ptr = last;
return d;
} | 180 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | IsValidSize | IsValidSize( GPMF_stream * ms , uint32_t size) | ['ms', 'size'] | GPMF_ERR IsValidSize(GPMF_stream *ms, uint32_t size) // size is in longs not bytes.
{
if (ms)
{
int32_t nestsize = (int32_t)ms->nest_size[ms->nest_level];
if (nestsize == 0 && ms->nest_level == 0)
nestsize = ms->buffer_size_longs;
if (size + 2 <= nestsize) return GPMF_OK;
}
return GPMF_ERROR_BAD_STRUCTURE;
} | 64 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | IsValidSize | IsValidSize( GPMF_stream * ms , uint32_t size) | ['ms', 'size'] | GPMF_ERR IsValidSize(GPMF_stream *ms, uint32_t size) // size is in longs not bytes.
{
if (ms)
{
int32_t nestsize = (int32_t)ms->nest_size[ms->nest_level];
if (nestsize == 0 && ms->nest_level == 0)
nestsize = ms->buffer_size_longs;
if (size + 2 <= nestsize) return GPMF_OK;
}
return GPMF_ERROR_BAD_STRUCTURE;
} | 64 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | IsValidSize | IsValidSize( GPMF_stream * ms , uint32_t size) | ['ms', 'size'] | GPMF_ERR IsValidSize(GPMF_stream *ms, uint32_t size) // size is in longs not bytes.
{
if (ms)
{
int32_t nestsize = (int32_t)ms->nest_size[ms->nest_level];
if (nestsize == 0 && ms->nest_level == 0)
nestsize = ms->buffer_size_longs;
if (size + 2 <= nestsize) return GPMF_OK;
}
return GPMF_ERROR_BAD_STRUCTURE;
} | 64 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
int32_t ret = GPMF_OK;
GPMF_stream metadata_stream, *ms = &metadata_stream;
double metadatalength;
uint32_t *payload = NULL; //buffer to store GPMF samples from the MP4.
// get file return data
if (argc != 2)
{
printf("usage: %s <file_with_GPMF>\n", argv[0]);
return -1;
}
size_t mp4 = OpenMP4Source(argv[1], MOV_GPMF_TRAK_TYPE, MOV_GPMF_TRAK_SUBTYPE);
// size_t mp4 = OpenMP4SourceUDTA(argv[1]); //Search for GPMF payload with MP4's udta
metadatalength = GetDuration(mp4);
if (metadatalength > 0.0)
{
uint32_t index, payloads = GetNumberPayloads(mp4);
// printf("found %.2fs of metadata, from %d payloads, within %s\n", metadatalength, payloads, argv[1]);
#if 1
if (payloads == 1) // Printf the contents of the single payload
{
uint32_t payloadsize = GetPayloadSize(mp4,0);
payload = GetPayload(mp4, payload, 0);
if(payload == NULL)
goto cleanup;
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
// Output (printf) all the contained GPMF data within this payload
ret = GPMF_Validate(ms, GPMF_RECURSE_LEVELS); // optional
if (GPMF_OK != ret)
{
printf("Invalid Structure\n");
goto cleanup;
}
GPMF_ResetState(ms);
do
{
PrintGPMF(ms); // printf current GPMF KLV
} while (GPMF_OK == GPMF_Next(ms, GPMF_RECURSE_LEVELS));
GPMF_ResetState(ms);
printf("\n");
}
#endif
for (index = 0; index < payloads; index++)
{
uint32_t payloadsize = GetPayloadSize(mp4, index);
float in = 0.0, out = 0.0; //times
payload = GetPayload(mp4, payload, index);
if (payload == NULL)
goto cleanup;
ret = GetPayloadTime(mp4, index, &in, &out);
if (ret != GPMF_OK)
goto cleanup;
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
#if 1 // Find all the available Streams and the data carrying FourCC
if (index == 0) // show first payload
{
ret = GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS);
while (GPMF_OK == ret)
{
ret = GPMF_SeekToSamples(ms);
if (GPMF_OK == ret) //find the last FOURCC within the stream
{
uint32_t key = GPMF_Key(ms);
GPMF_SampleType type = GPMF_Type(ms);
uint32_t elements = GPMF_ElementsInStruct(ms);
//uint32_t samples = GPMF_Repeat(ms);
uint32_t samples = GPMF_PayloadSampleCount(ms);
if (samples)
{
printf(" STRM of %c%c%c%c ", PRINTF_4CC(key));
if (type == GPMF_TYPE_COMPLEX)
{
GPMF_stream find_stream;
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TYPE, GPMF_CURRENT_LEVEL))
{
char tmp[64];
char *data = (char *)GPMF_RawData(&find_stream);
int size = GPMF_RawDataSize(&find_stream);
if (size < sizeof(tmp))
{
memcpy(tmp, data, size);
tmp[size] = 0;
printf("of type %s ", tmp);
}
}
}
else
{
printf("of type %c ", type);
}
printf("with %d sample%s ", samples, samples > 1 ? "s" : "");
if (elements > 1)
printf("-- %d elements per sample", elements);
printf("\n");
}
ret = GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS);
}
else
{
if (ret == GPMF_ERROR_BAD_STRUCTURE) // some payload element was corrupt, skip to the next valid GPMF KLV at the previous level.
{
ret = GPMF_Next(ms, GPMF_CURRENT_LEVEL); // this will be the next stream if any more are present.
}
}
}
GPMF_ResetState(ms);
printf("\n");
}
#endif
#if 1 // Find GPS values and return scaled doubles.
if (index == 0) // show first payload
{
if (GPMF_OK == GPMF_FindNext(ms, STR2FOURCC("GPS5"), GPMF_RECURSE_LEVELS) || //GoPro Hero5/6/7 GPS
GPMF_OK == GPMF_FindNext(ms, STR2FOURCC("GPRI"), GPMF_RECURSE_LEVELS)) //GoPro Karma GPS
{
uint32_t key = GPMF_Key(ms);
uint32_t samples = GPMF_Repeat(ms);
uint32_t elements = GPMF_ElementsInStruct(ms);
uint32_t buffersize = samples * elements * sizeof(double);
GPMF_stream find_stream;
double *ptr, *tmpbuffer = malloc(buffersize);
char units[10][6] = { "" };
uint32_t unit_samples = 1;
printf("MP4 Payload time %.3f to %.3f seconds\n", in, out);
if (tmpbuffer && samples)
{
uint32_t i, j;
//Search for any units to display
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_SI_UNITS, GPMF_CURRENT_LEVEL) ||
GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_UNITS, GPMF_CURRENT_LEVEL))
{
char *data = (char *)GPMF_RawData(&find_stream);
int ssize = GPMF_StructSize(&find_stream);
unit_samples = GPMF_Repeat(&find_stream);
for (i = 0; i < unit_samples; i++)
{
memcpy(units[i], data, ssize);
units[i][ssize] = 0;
data += ssize;
}
}
//GPMF_FormattedData(ms, tmpbuffer, buffersize, 0, samples); // Output data in LittleEnd, but no scale
GPMF_ScaledData(ms, tmpbuffer, buffersize, 0, samples, GPMF_TYPE_DOUBLE); //Output scaled data as floats
ptr = tmpbuffer;
for (i = 0; i < samples; i++)
{
printf("%c%c%c%c ", PRINTF_4CC(key));
for (j = 0; j < elements; j++)
printf("%.3f%s, ", *ptr++, units[j%unit_samples]);
printf("\n");
}
free(tmpbuffer);
}
}
GPMF_ResetState(ms);
printf("\n");
}
#endif
}
#if 1
// Find all the available Streams and compute they sample rates
while (GPMF_OK == GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS))
{
if (GPMF_OK == GPMF_SeekToSamples(ms)) //find the last FOURCC within the stream
{
uint32_t fourcc = GPMF_Key(ms);
double rate = GetGPMFSampleRate(mp4, fourcc, GPMF_SAMPLE_RATE_PRECISE);// GPMF_SAMPLE_RATE_FAST);
printf("%c%c%c%c sampling rate = %f Hz\n", PRINTF_4CC(fourcc), rate);
}
}
#endif
cleanup:
if (payload) FreePayload(payload); payload = NULL;
CloseSource(mp4);
}
return ret;
} | 1005 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
int32_t ret = GPMF_OK;
GPMF_stream metadata_stream, *ms = &metadata_stream;
double metadatalength;
uint32_t *payload = NULL; //buffer to store GPMF samples from the MP4.
// get file return data
if (argc != 2)
{
printf("usage: %s <file_with_GPMF>\n", argv[0]);
return -1;
}
size_t mp4 = OpenMP4Source(argv[1], MOV_GPMF_TRAK_TYPE, MOV_GPMF_TRAK_SUBTYPE);
// size_t mp4 = OpenMP4SourceUDTA(argv[1]); //Search for GPMF payload with MP4's udta
metadatalength = GetDuration(mp4);
if (metadatalength > 0.0)
{
uint32_t index, payloads = GetNumberPayloads(mp4);
// printf("found %.2fs of metadata, from %d payloads, within %s\n", metadatalength, payloads, argv[1]);
#if 1
if (payloads == 1) // Printf the contents of the single payload
{
uint32_t payloadsize = GetPayloadSize(mp4,0);
payload = GetPayload(mp4, payload, 0);
if(payload == NULL)
goto cleanup;
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
// Output (printf) all the contained GPMF data within this payload
ret = GPMF_Validate(ms, GPMF_RECURSE_LEVELS); // optional
if (GPMF_OK != ret)
{
printf("Invalid Structure\n");
goto cleanup;
}
GPMF_ResetState(ms);
do
{
PrintGPMF(ms); // printf current GPMF KLV
} while (GPMF_OK == GPMF_Next(ms, GPMF_RECURSE_LEVELS));
GPMF_ResetState(ms);
printf("\n");
}
#endif
for (index = 0; index < payloads; index++)
{
uint32_t payloadsize = GetPayloadSize(mp4, index);
float in = 0.0, out = 0.0; //times
payload = GetPayload(mp4, payload, index);
if (payload == NULL)
goto cleanup;
ret = GetPayloadTime(mp4, index, &in, &out);
if (ret != GPMF_OK)
goto cleanup;
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
#if 1 // Find all the available Streams and the data carrying FourCC
if (index == 0) // show first payload
{
ret = GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS);
while (GPMF_OK == ret)
{
ret = GPMF_SeekToSamples(ms);
if (GPMF_OK == ret) //find the last FOURCC within the stream
{
uint32_t key = GPMF_Key(ms);
GPMF_SampleType type = GPMF_Type(ms);
uint32_t elements = GPMF_ElementsInStruct(ms);
//uint32_t samples = GPMF_Repeat(ms);
uint32_t samples = GPMF_PayloadSampleCount(ms);
if (samples)
{
printf(" STRM of %c%c%c%c ", PRINTF_4CC(key));
if (type == GPMF_TYPE_COMPLEX)
{
GPMF_stream find_stream;
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TYPE, GPMF_CURRENT_LEVEL))
{
char tmp[64];
char *data = (char *)GPMF_RawData(&find_stream);
int size = GPMF_RawDataSize(&find_stream);
if (size < sizeof(tmp))
{
memcpy(tmp, data, size);
tmp[size] = 0;
printf("of type %s ", tmp);
}
}
}
else
{
printf("of type %c ", type);
}
printf("with %d sample%s ", samples, samples > 1 ? "s" : "");
if (elements > 1)
printf("-- %d elements per sample", elements);
printf("\n");
}
ret = GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS);
}
else
{
if (ret == GPMF_ERROR_BAD_STRUCTURE) // some payload element was corrupt, skip to the next valid GPMF KLV at the previous level.
{
ret = GPMF_Next(ms, GPMF_CURRENT_LEVEL); // this will be the next stream if any more are present.
}
}
}
GPMF_ResetState(ms);
printf("\n");
}
#endif
#if 1 // Find GPS values and return scaled doubles.
if (index == 0) // show first payload
{
if (GPMF_OK == GPMF_FindNext(ms, STR2FOURCC("GPS5"), GPMF_RECURSE_LEVELS) || //GoPro Hero5/6/7 GPS
GPMF_OK == GPMF_FindNext(ms, STR2FOURCC("GPRI"), GPMF_RECURSE_LEVELS)) //GoPro Karma GPS
{
uint32_t key = GPMF_Key(ms);
uint32_t samples = GPMF_Repeat(ms);
uint32_t elements = GPMF_ElementsInStruct(ms);
uint32_t buffersize = samples * elements * sizeof(double);
GPMF_stream find_stream;
double *ptr, *tmpbuffer = malloc(buffersize);
char units[10][6] = { "" };
uint32_t unit_samples = 1;
printf("MP4 Payload time %.3f to %.3f seconds\n", in, out);
if (tmpbuffer && samples)
{
uint32_t i, j;
//Search for any units to display
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_SI_UNITS, GPMF_CURRENT_LEVEL) ||
GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_UNITS, GPMF_CURRENT_LEVEL))
{
char *data = (char *)GPMF_RawData(&find_stream);
int ssize = GPMF_StructSize(&find_stream);
unit_samples = GPMF_Repeat(&find_stream);
for (i = 0; i < unit_samples; i++)
{
memcpy(units[i], data, ssize);
units[i][ssize] = 0;
data += ssize;
}
}
//GPMF_FormattedData(ms, tmpbuffer, buffersize, 0, samples); // Output data in LittleEnd, but no scale
GPMF_ScaledData(ms, tmpbuffer, buffersize, 0, samples, GPMF_TYPE_DOUBLE); //Output scaled data as floats
ptr = tmpbuffer;
for (i = 0; i < samples; i++)
{
printf("%c%c%c%c ", PRINTF_4CC(key));
for (j = 0; j < elements; j++)
printf("%.3f%s, ", *ptr++, units[j%unit_samples]);
printf("\n");
}
free(tmpbuffer);
}
}
GPMF_ResetState(ms);
printf("\n");
}
#endif
}
#if 1
// Find all the available Streams and compute they sample rates
while (GPMF_OK == GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS))
{
if (GPMF_OK == GPMF_SeekToSamples(ms)) //find the last FOURCC within the stream
{
uint32_t fourcc = GPMF_Key(ms);
double rate = GetGPMFSampleRate(mp4, fourcc, GPMF_SAMPLE_RATE_PRECISE);// GPMF_SAMPLE_RATE_FAST);
printf("%c%c%c%c sampling rate = %f Hz\n", PRINTF_4CC(fourcc), rate);
}
}
#endif
cleanup:
if (payload) FreePayload(payload); payload = NULL;
CloseSource(mp4);
}
return ret;
} | 1005 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | main | main( int argc , char * argv [ ]) | ['argc'] | int main(int argc, char *argv[])
{
int32_t ret = GPMF_OK;
GPMF_stream metadata_stream, *ms = &metadata_stream;
double metadatalength;
uint32_t *payload = NULL; //buffer to store GPMF samples from the MP4.
// get file return data
if (argc != 2)
{
printf("usage: %s <file_with_GPMF>\n", argv[0]);
return -1;
}
size_t mp4 = OpenMP4Source(argv[1], MOV_GPMF_TRAK_TYPE, MOV_GPMF_TRAK_SUBTYPE);
// size_t mp4 = OpenMP4SourceUDTA(argv[1]); //Search for GPMF payload with MP4's udta
metadatalength = GetDuration(mp4);
if (metadatalength > 0.0)
{
uint32_t index, payloads = GetNumberPayloads(mp4);
// printf("found %.2fs of metadata, from %d payloads, within %s\n", metadatalength, payloads, argv[1]);
#if 1
if (payloads == 1) // Printf the contents of the single payload
{
uint32_t payloadsize = GetPayloadSize(mp4,0);
payload = GetPayload(mp4, payload, 0);
if(payload == NULL)
goto cleanup;
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
// Output (printf) all the contained GPMF data within this payload
ret = GPMF_Validate(ms, GPMF_RECURSE_LEVELS); // optional
if (GPMF_OK != ret)
{
printf("Invalid Structure\n");
goto cleanup;
}
GPMF_ResetState(ms);
do
{
PrintGPMF(ms); // printf current GPMF KLV
} while (GPMF_OK == GPMF_Next(ms, GPMF_RECURSE_LEVELS));
GPMF_ResetState(ms);
printf("\n");
}
#endif
for (index = 0; index < payloads; index++)
{
uint32_t payloadsize = GetPayloadSize(mp4, index);
float in = 0.0, out = 0.0; //times
payload = GetPayload(mp4, payload, index);
if (payload == NULL)
goto cleanup;
ret = GetPayloadTime(mp4, index, &in, &out);
if (ret != GPMF_OK)
goto cleanup;
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
#if 1 // Find all the available Streams and the data carrying FourCC
if (index == 0) // show first payload
{
ret = GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS);
while (GPMF_OK == ret)
{
ret = GPMF_SeekToSamples(ms);
if (GPMF_OK == ret) //find the last FOURCC within the stream
{
uint32_t key = GPMF_Key(ms);
GPMF_SampleType type = GPMF_Type(ms);
uint32_t elements = GPMF_ElementsInStruct(ms);
//uint32_t samples = GPMF_Repeat(ms);
uint32_t samples = GPMF_PayloadSampleCount(ms);
if (samples)
{
printf(" STRM of %c%c%c%c ", PRINTF_4CC(key));
if (type == GPMF_TYPE_COMPLEX)
{
GPMF_stream find_stream;
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TYPE, GPMF_CURRENT_LEVEL))
{
char tmp[64];
char *data = (char *)GPMF_RawData(&find_stream);
int size = GPMF_RawDataSize(&find_stream);
if (size < sizeof(tmp))
{
memcpy(tmp, data, size);
tmp[size] = 0;
printf("of type %s ", tmp);
}
}
}
else
{
printf("of type %c ", type);
}
printf("with %d sample%s ", samples, samples > 1 ? "s" : "");
if (elements > 1)
printf("-- %d elements per sample", elements);
printf("\n");
}
ret = GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS);
}
else
{
if (ret == GPMF_ERROR_BAD_STRUCTURE) // some payload element was corrupt, skip to the next valid GPMF KLV at the previous level.
{
ret = GPMF_Next(ms, GPMF_CURRENT_LEVEL); // this will be the next stream if any more are present.
}
}
}
GPMF_ResetState(ms);
printf("\n");
}
#endif
#if 1 // Find GPS values and return scaled doubles.
if (index == 0) // show first payload
{
if (GPMF_OK == GPMF_FindNext(ms, STR2FOURCC("GPS5"), GPMF_RECURSE_LEVELS) || //GoPro Hero5/6/7 GPS
GPMF_OK == GPMF_FindNext(ms, STR2FOURCC("GPRI"), GPMF_RECURSE_LEVELS)) //GoPro Karma GPS
{
uint32_t key = GPMF_Key(ms);
uint32_t samples = GPMF_Repeat(ms);
uint32_t elements = GPMF_ElementsInStruct(ms);
uint32_t buffersize = samples * elements * sizeof(double);
GPMF_stream find_stream;
double *ptr, *tmpbuffer = malloc(buffersize);
char units[10][6] = { "" };
uint32_t unit_samples = 1;
printf("MP4 Payload time %.3f to %.3f seconds\n", in, out);
if (tmpbuffer && samples)
{
uint32_t i, j;
//Search for any units to display
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_SI_UNITS, GPMF_CURRENT_LEVEL) ||
GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_UNITS, GPMF_CURRENT_LEVEL))
{
char *data = (char *)GPMF_RawData(&find_stream);
int ssize = GPMF_StructSize(&find_stream);
unit_samples = GPMF_Repeat(&find_stream);
for (i = 0; i < unit_samples; i++)
{
memcpy(units[i], data, ssize);
units[i][ssize] = 0;
data += ssize;
}
}
//GPMF_FormattedData(ms, tmpbuffer, buffersize, 0, samples); // Output data in LittleEnd, but no scale
GPMF_ScaledData(ms, tmpbuffer, buffersize, 0, samples, GPMF_TYPE_DOUBLE); //Output scaled data as floats
ptr = tmpbuffer;
for (i = 0; i < samples; i++)
{
printf("%c%c%c%c ", PRINTF_4CC(key));
for (j = 0; j < elements; j++)
printf("%.3f%s, ", *ptr++, units[j%unit_samples]);
printf("\n");
}
free(tmpbuffer);
}
}
GPMF_ResetState(ms);
printf("\n");
}
#endif
}
#if 1
// Find all the available Streams and compute they sample rates
while (GPMF_OK == GPMF_FindNext(ms, GPMF_KEY_STREAM, GPMF_RECURSE_LEVELS))
{
if (GPMF_OK == GPMF_SeekToSamples(ms)) //find the last FOURCC within the stream
{
uint32_t fourcc = GPMF_Key(ms);
double rate = GetGPMFSampleRate(mp4, fourcc, GPMF_SAMPLE_RATE_PRECISE);// GPMF_SAMPLE_RATE_FAST);
printf("%c%c%c%c sampling rate = %f Hz\n", PRINTF_4CC(fourcc), rate);
}
}
#endif
cleanup:
if (payload) FreePayload(payload); payload = NULL;
CloseSource(mp4);
}
return ret;
} | 1005 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetGPMFSampleRate | GetGPMFSampleRate( size_t handle , uint32_t fourcc , uint32_t flags) | ['handle', 'fourcc', 'flags'] | double GetGPMFSampleRate(size_t handle, uint32_t fourcc, uint32_t flags)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0.0;
GPMF_stream metadata_stream, *ms = &metadata_stream;
uint32_t teststart = 0;
uint32_t testend = mp4->indexcount;
double rate = 0.0;
if (mp4->indexcount < 1)
return 0.0;
if (mp4->indexcount > 3) // samples after first and before last are statistically the best, avoiding camera start up or shutdown anomollies.
{
teststart++;
testend--;
}
uint32_t *payload = GetPayload(handle, NULL, teststart); // second payload
uint32_t payloadsize = GetPayloadSize(handle, teststart);
int32_t ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
{
uint32_t startsamples = 0;
uint32_t endsamples = 0;
uint32_t missing_samples = 0;
while (ret == GPMF_OK && GPMF_OK != GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
missing_samples = 1;
teststart++;
payload = GetPayload(handle, payload, teststart); // second last payload
payloadsize = GetPayloadSize(handle, teststart);
ret = GPMF_Init(ms, payload, payloadsize);
}
if (missing_samples)
{
teststart++; //samples after sensor start are statistically the best
payload = GetPayload(handle, payload, teststart);
payloadsize = GetPayloadSize(handle, teststart);
ret = GPMF_Init(ms, payload, payloadsize);
}
if (ret == GPMF_OK)
{
uint32_t samples = GPMF_Repeat(ms);
GPMF_stream find_stream;
GPMF_CopyState(ms, &find_stream);
if (!(flags & GPMF_SAMPLE_RATE_PRECISE) && GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
startsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream)) - samples;
payload = GetPayload(handle, payload, testend); // second last payload
payloadsize = GetPayloadSize(handle, testend);
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
if (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
endsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream));
rate = (double)(endsamples - startsamples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
goto cleanup;
}
}
rate = (double)(samples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
}
else // for increased precision, for older GPMF streams sometimes missing the total sample count
{
uint32_t payloadpos = 0, payloadcount = 0;
double slope, top = 0.0, bot = 0.0, meanX = 0, meanY = 0;
uint32_t *repeatarray = malloc(mp4->indexcount * 4 + 4);
memset(repeatarray, 0, mp4->indexcount * 4 + 4);
samples = 0;
for (payloadpos = teststart; payloadpos < testend; payloadcount++, payloadpos++)
{
payload = GetPayload(handle, payload, payloadpos); // second last payload
payloadsize = GetPayloadSize(handle, payloadpos);
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
if (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
GPMF_stream find_stream2;
GPMF_CopyState(ms, &find_stream2);
if (GPMF_OK == GPMF_FindNext(&find_stream2, fourcc, GPMF_CURRENT_LEVEL)) // Count the instances, not the repeats
{
if (repeatarray)
{
float in, out;
do
{
samples++;
} while (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_CURRENT_LEVEL));
repeatarray[payloadpos] = samples;
meanY += (double)samples;
GetPayloadTime(handle, payloadpos, &in, &out);
meanX += out;
}
}
else
{
uint32_t repeat = GPMF_Repeat(ms);
samples += repeat;
if (repeatarray)
{
float in, out;
repeatarray[payloadpos] = samples;
meanY += (double)samples;
GetPayloadTime(handle, payloadpos, &in, &out);
meanX += out;
}
}
}
}
// Compute the line of best fit for a jitter removed sample rate.
// This does assume an unchanging clock, even though the IMU data can thermally impacted causing small clock changes.
// TODO: Next enhancement would be a low order polynominal fit the compensate for any thermal clock drift.
if (repeatarray)
{
meanY /= (double)payloadcount;
meanX /= (double)payloadcount;
for (payloadpos = teststart; payloadpos < testend; payloadpos++)
{
float in, out;
GetPayloadTime(handle, payloadpos, &in, &out);
top += ((double)out - meanX)*((double)repeatarray[payloadpos] - meanY);
bot += ((double)out - meanX)*((double)out - meanX);
}
slope = top / bot;
#if 0
// This sample code might be useful for compare data latency between channels.
{
double intercept;
intercept = meanY - slope*meanX;
printf("%c%c%c%c start offset = %f (%.3fms)\n", PRINTF_4CC(fourcc), intercept, 1000.0 * intercept / slope);
}
#endif
rate = slope;
}
else
{
rate = (double)(samples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
}
free(repeatarray);
goto cleanup;
}
}
}
cleanup:
if (payload)
{
FreePayload(payload);
payload = NULL;
}
return rate;
} | 982 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetGPMFSampleRate | GetGPMFSampleRate( size_t handle , uint32_t fourcc , uint32_t flags) | ['handle', 'fourcc', 'flags'] | double GetGPMFSampleRate(size_t handle, uint32_t fourcc, uint32_t flags)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0.0;
GPMF_stream metadata_stream, *ms = &metadata_stream;
uint32_t teststart = 0;
uint32_t testend = mp4->indexcount;
double rate = 0.0;
if (mp4->indexcount < 1)
return 0.0;
if (mp4->indexcount > 3) // samples after first and before last are statistically the best, avoiding camera start up or shutdown anomollies.
{
teststart++;
testend--;
}
uint32_t *payload = GetPayload(handle, NULL, teststart); // second payload
uint32_t payloadsize = GetPayloadSize(handle, teststart);
int32_t ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
{
uint32_t startsamples = 0;
uint32_t endsamples = 0;
uint32_t missing_samples = 0;
while (ret == GPMF_OK && GPMF_OK != GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
missing_samples = 1;
teststart++;
payload = GetPayload(handle, payload, teststart); // second last payload
payloadsize = GetPayloadSize(handle, teststart);
ret = GPMF_Init(ms, payload, payloadsize);
}
if (missing_samples)
{
teststart++; //samples after sensor start are statistically the best
payload = GetPayload(handle, payload, teststart);
payloadsize = GetPayloadSize(handle, teststart);
ret = GPMF_Init(ms, payload, payloadsize);
}
if (ret == GPMF_OK)
{
uint32_t samples = GPMF_Repeat(ms);
GPMF_stream find_stream;
GPMF_CopyState(ms, &find_stream);
if (!(flags & GPMF_SAMPLE_RATE_PRECISE) && GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
startsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream)) - samples;
payload = GetPayload(handle, payload, testend); // second last payload
payloadsize = GetPayloadSize(handle, testend);
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
if (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
endsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream));
rate = (double)(endsamples - startsamples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
goto cleanup;
}
}
rate = (double)(samples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
}
else // for increased precision, for older GPMF streams sometimes missing the total sample count
{
uint32_t payloadpos = 0, payloadcount = 0;
double slope, top = 0.0, bot = 0.0, meanX = 0, meanY = 0;
uint32_t *repeatarray = malloc(mp4->indexcount * 4 + 4);
memset(repeatarray, 0, mp4->indexcount * 4 + 4);
samples = 0;
for (payloadpos = teststart; payloadpos < testend; payloadcount++, payloadpos++)
{
payload = GetPayload(handle, payload, payloadpos); // second last payload
payloadsize = GetPayloadSize(handle, payloadpos);
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
if (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
GPMF_stream find_stream2;
GPMF_CopyState(ms, &find_stream2);
if (GPMF_OK == GPMF_FindNext(&find_stream2, fourcc, GPMF_CURRENT_LEVEL)) // Count the instances, not the repeats
{
if (repeatarray)
{
float in, out;
do
{
samples++;
} while (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_CURRENT_LEVEL));
repeatarray[payloadpos] = samples;
meanY += (double)samples;
GetPayloadTime(handle, payloadpos, &in, &out);
meanX += out;
}
}
else
{
uint32_t repeat = GPMF_Repeat(ms);
samples += repeat;
if (repeatarray)
{
float in, out;
repeatarray[payloadpos] = samples;
meanY += (double)samples;
GetPayloadTime(handle, payloadpos, &in, &out);
meanX += out;
}
}
}
}
// Compute the line of best fit for a jitter removed sample rate.
// This does assume an unchanging clock, even though the IMU data can thermally impacted causing small clock changes.
// TODO: Next enhancement would be a low order polynominal fit the compensate for any thermal clock drift.
if (repeatarray)
{
meanY /= (double)payloadcount;
meanX /= (double)payloadcount;
for (payloadpos = teststart; payloadpos < testend; payloadpos++)
{
float in, out;
GetPayloadTime(handle, payloadpos, &in, &out);
top += ((double)out - meanX)*((double)repeatarray[payloadpos] - meanY);
bot += ((double)out - meanX)*((double)out - meanX);
}
slope = top / bot;
#if 0
// This sample code might be useful for compare data latency between channels.
{
double intercept;
intercept = meanY - slope*meanX;
printf("%c%c%c%c start offset = %f (%.3fms)\n", PRINTF_4CC(fourcc), intercept, 1000.0 * intercept / slope);
}
#endif
rate = slope;
}
else
{
rate = (double)(samples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
}
free(repeatarray);
goto cleanup;
}
}
}
cleanup:
if (payload)
{
FreePayload(payload);
payload = NULL;
}
return rate;
} | 982 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetGPMFSampleRate | GetGPMFSampleRate( size_t handle , uint32_t fourcc , uint32_t flags) | ['handle', 'fourcc', 'flags'] | double GetGPMFSampleRate(size_t handle, uint32_t fourcc, uint32_t flags)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0.0;
GPMF_stream metadata_stream, *ms = &metadata_stream;
uint32_t teststart = 0;
uint32_t testend = mp4->indexcount;
double rate = 0.0;
if (mp4->indexcount < 1)
return 0.0;
if (mp4->indexcount > 3) // samples after first and before last are statistically the best, avoiding camera start up or shutdown anomollies.
{
teststart++;
testend--;
}
uint32_t *payload = GetPayload(handle, NULL, teststart); // second payload
uint32_t payloadsize = GetPayloadSize(handle, teststart);
int32_t ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
{
uint32_t startsamples = 0;
uint32_t endsamples = 0;
uint32_t missing_samples = 0;
while (ret == GPMF_OK && GPMF_OK != GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
missing_samples = 1;
teststart++;
payload = GetPayload(handle, payload, teststart); // second last payload
payloadsize = GetPayloadSize(handle, teststart);
ret = GPMF_Init(ms, payload, payloadsize);
}
if (missing_samples)
{
teststart++; //samples after sensor start are statistically the best
payload = GetPayload(handle, payload, teststart);
payloadsize = GetPayloadSize(handle, teststart);
ret = GPMF_Init(ms, payload, payloadsize);
}
if (ret == GPMF_OK)
{
uint32_t samples = GPMF_Repeat(ms);
GPMF_stream find_stream;
GPMF_CopyState(ms, &find_stream);
if (!(flags & GPMF_SAMPLE_RATE_PRECISE) && GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
startsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream)) - samples;
payload = GetPayload(handle, payload, testend); // second last payload
payloadsize = GetPayloadSize(handle, testend);
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
if (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
GPMF_CopyState(ms, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
endsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream));
rate = (double)(endsamples - startsamples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
goto cleanup;
}
}
rate = (double)(samples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
}
else // for increased precision, for older GPMF streams sometimes missing the total sample count
{
uint32_t payloadpos = 0, payloadcount = 0;
double slope, top = 0.0, bot = 0.0, meanX = 0, meanY = 0;
uint32_t *repeatarray = malloc(mp4->indexcount * 4 + 4);
memset(repeatarray, 0, mp4->indexcount * 4 + 4);
samples = 0;
for (payloadpos = teststart; payloadpos < testend; payloadcount++, payloadpos++)
{
payload = GetPayload(handle, payload, payloadpos); // second last payload
payloadsize = GetPayloadSize(handle, payloadpos);
ret = GPMF_Init(ms, payload, payloadsize);
if (ret != GPMF_OK)
goto cleanup;
if (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_RECURSE_LEVELS))
{
GPMF_stream find_stream2;
GPMF_CopyState(ms, &find_stream2);
if (GPMF_OK == GPMF_FindNext(&find_stream2, fourcc, GPMF_CURRENT_LEVEL)) // Count the instances, not the repeats
{
if (repeatarray)
{
float in, out;
do
{
samples++;
} while (GPMF_OK == GPMF_FindNext(ms, fourcc, GPMF_CURRENT_LEVEL));
repeatarray[payloadpos] = samples;
meanY += (double)samples;
GetPayloadTime(handle, payloadpos, &in, &out);
meanX += out;
}
}
else
{
uint32_t repeat = GPMF_Repeat(ms);
samples += repeat;
if (repeatarray)
{
float in, out;
repeatarray[payloadpos] = samples;
meanY += (double)samples;
GetPayloadTime(handle, payloadpos, &in, &out);
meanX += out;
}
}
}
}
// Compute the line of best fit for a jitter removed sample rate.
// This does assume an unchanging clock, even though the IMU data can thermally impacted causing small clock changes.
// TODO: Next enhancement would be a low order polynominal fit the compensate for any thermal clock drift.
if (repeatarray)
{
meanY /= (double)payloadcount;
meanX /= (double)payloadcount;
for (payloadpos = teststart; payloadpos < testend; payloadpos++)
{
float in, out;
GetPayloadTime(handle, payloadpos, &in, &out);
top += ((double)out - meanX)*((double)repeatarray[payloadpos] - meanY);
bot += ((double)out - meanX)*((double)out - meanX);
}
slope = top / bot;
#if 0
// This sample code might be useful for compare data latency between channels.
{
double intercept;
intercept = meanY - slope*meanX;
printf("%c%c%c%c start offset = %f (%.3fms)\n", PRINTF_4CC(fourcc), intercept, 1000.0 * intercept / slope);
}
#endif
rate = slope;
}
else
{
rate = (double)(samples) / (mp4->metadatalength * ((double)(testend - teststart + 1)) / (double)mp4->indexcount);
}
free(repeatarray);
goto cleanup;
}
}
}
cleanup:
if (payload)
{
FreePayload(payload);
payload = NULL;
}
return rate;
} | 982 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetGPMFSampleRateAndTimes | GetGPMFSampleRateAndTimes( size_t handle , GPMF_stream * gs , double rate , uint32_t index , double * in , double * out) | ['handle', 'gs', 'rate', 'index', 'in', 'out'] | double GetGPMFSampleRateAndTimes(size_t handle, GPMF_stream *gs, double rate, uint32_t index, double *in, double *out)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0.0;
uint32_t key, insamples;
uint32_t repeat, outsamples;
GPMF_stream find_stream;
if (gs == NULL || mp4->metaoffsets == 0 || mp4->indexcount == 0 || mp4->basemetadataduration == 0 || mp4->meta_clockdemon == 0 || in == NULL || out == NULL) return 0.0;
key = GPMF_Key(gs);
repeat = GPMF_Repeat(gs);
if (rate == 0.0)
rate = GetGPMFSampleRate(handle, key, GPMF_SAMPLE_RATE_FAST);
if (rate == 0.0)
{
*in = *out = 0.0;
return 0.0;
}
GPMF_CopyState(gs, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
outsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream));
insamples = outsamples - repeat;
*in = ((double)insamples / (double)rate);
*out = ((double)outsamples / (double)rate);
}
else
{
// might too costly in some applications read all the samples to determine the clock jitter, here I return the estimate from the MP4 track.
*in = ((double)index * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
*out = ((double)(index + 1) * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
}
return rate;
} | 294 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetGPMFSampleRateAndTimes | GetGPMFSampleRateAndTimes( size_t handle , GPMF_stream * gs , double rate , uint32_t index , double * in , double * out) | ['handle', 'gs', 'rate', 'index', 'in', 'out'] | double GetGPMFSampleRateAndTimes(size_t handle, GPMF_stream *gs, double rate, uint32_t index, double *in, double *out)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0.0;
uint32_t key, insamples;
uint32_t repeat, outsamples;
GPMF_stream find_stream;
if (gs == NULL || mp4->metaoffsets == 0 || mp4->indexcount == 0 || mp4->basemetadataduration == 0 || mp4->meta_clockdemon == 0 || in == NULL || out == NULL) return 0.0;
key = GPMF_Key(gs);
repeat = GPMF_Repeat(gs);
if (rate == 0.0)
rate = GetGPMFSampleRate(handle, key, GPMF_SAMPLE_RATE_FAST);
if (rate == 0.0)
{
*in = *out = 0.0;
return 0.0;
}
GPMF_CopyState(gs, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
outsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream));
insamples = outsamples - repeat;
*in = ((double)insamples / (double)rate);
*out = ((double)outsamples / (double)rate);
}
else
{
// might too costly in some applications read all the samples to determine the clock jitter, here I return the estimate from the MP4 track.
*in = ((double)index * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
*out = ((double)(index + 1) * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
}
return rate;
} | 294 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetGPMFSampleRateAndTimes | GetGPMFSampleRateAndTimes( size_t handle , GPMF_stream * gs , double rate , uint32_t index , double * in , double * out) | ['handle', 'gs', 'rate', 'index', 'in', 'out'] | double GetGPMFSampleRateAndTimes(size_t handle, GPMF_stream *gs, double rate, uint32_t index, double *in, double *out)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0.0;
uint32_t key, insamples;
uint32_t repeat, outsamples;
GPMF_stream find_stream;
if (gs == NULL || mp4->metaoffsets == 0 || mp4->indexcount == 0 || mp4->basemetadataduration == 0 || mp4->meta_clockdemon == 0 || in == NULL || out == NULL) return 0.0;
key = GPMF_Key(gs);
repeat = GPMF_Repeat(gs);
if (rate == 0.0)
rate = GetGPMFSampleRate(handle, key, GPMF_SAMPLE_RATE_FAST);
if (rate == 0.0)
{
*in = *out = 0.0;
return 0.0;
}
GPMF_CopyState(gs, &find_stream);
if (GPMF_OK == GPMF_FindPrev(&find_stream, GPMF_KEY_TOTAL_SAMPLES, GPMF_CURRENT_LEVEL))
{
outsamples = BYTESWAP32(*(uint32_t *)GPMF_RawData(&find_stream));
insamples = outsamples - repeat;
*in = ((double)insamples / (double)rate);
*out = ((double)outsamples / (double)rate);
}
else
{
// might too costly in some applications read all the samples to determine the clock jitter, here I return the estimate from the MP4 track.
*in = ((double)index * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
*out = ((double)(index + 1) * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
}
return rate;
} | 294 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetPayload | GetPayload( size_t handle , uint32_t * lastpayload , uint32_t index) | ['handle', 'lastpayload', 'index'] | uint32_t *GetPayload(size_t handle, uint32_t *lastpayload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return NULL;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp)
{
MP4buffer = (uint32_t *)realloc((void *)lastpayload, mp4->metasizes[index]);
if (MP4buffer)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fread(MP4buffer, 1, mp4->metasizes[index], mp4->mediafp);
return MP4buffer;
}
}
return NULL;
} | 121 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetPayload | GetPayload( size_t handle , uint32_t * lastpayload , uint32_t index) | ['handle', 'lastpayload', 'index'] | uint32_t *GetPayload(size_t handle, uint32_t *lastpayload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return NULL;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp)
{
MP4buffer = (uint32_t *)realloc((void *)lastpayload, mp4->metasizes[index]);
if (MP4buffer)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fread(MP4buffer, 1, mp4->metasizes[index], mp4->mediafp);
return MP4buffer;
}
}
return NULL;
} | 121 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetPayload | GetPayload( size_t handle , uint32_t * lastpayload , uint32_t index) | ['handle', 'lastpayload', 'index'] | uint32_t *GetPayload(size_t handle, uint32_t *lastpayload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return NULL;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp)
{
MP4buffer = (uint32_t *)realloc((void *)lastpayload, mp4->metasizes[index]);
if (MP4buffer)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fread(MP4buffer, 1, mp4->metasizes[index], mp4->mediafp);
return MP4buffer;
}
}
return NULL;
} | 121 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetPayloadTime | GetPayloadTime( size_t handle , uint32_t index , float * in , float * out) | ['handle', 'index', 'in', 'out'] | uint32_t GetPayloadTime(size_t handle, uint32_t index, float *in, float *out)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0;
if (mp4->metaoffsets == 0 || mp4->basemetadataduration == 0 || mp4->meta_clockdemon == 0 || in == NULL || out == NULL) return 1;
*in = (float)((double)index * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
*out = (float)((double)(index + 1) * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
return 0;
} | 129 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetPayloadTime | GetPayloadTime( size_t handle , uint32_t index , float * in , float * out) | ['handle', 'index', 'in', 'out'] | uint32_t GetPayloadTime(size_t handle, uint32_t index, float *in, float *out)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0;
if (mp4->metaoffsets == 0 || mp4->basemetadataduration == 0 || mp4->meta_clockdemon == 0 || in == NULL || out == NULL) return 1;
*in = (float)((double)index * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
*out = (float)((double)(index + 1) * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
return 0;
} | 129 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | GetPayloadTime | GetPayloadTime( size_t handle , uint32_t index , float * in , float * out) | ['handle', 'index', 'in', 'out'] | uint32_t GetPayloadTime(size_t handle, uint32_t index, float *in, float *out)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return 0;
if (mp4->metaoffsets == 0 || mp4->basemetadataduration == 0 || mp4->meta_clockdemon == 0 || in == NULL || out == NULL) return 1;
*in = (float)((double)index * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
*out = (float)((double)(index + 1) * (double)mp4->basemetadataduration / (double)mp4->meta_clockdemon);
return 0;
} | 129 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | OpenMP4Source | OpenMP4Source( char * filename , uint32_t traktype , uint32_t traksubtype) | ['filename', 'traktype', 'traksubtype'] | size_t OpenMP4Source(char *filename, uint32_t traktype, uint32_t traksubtype) //RAW or within MP4
{
mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object));
if (mp4 == NULL) return 0;
memset(mp4, 0, sizeof(mp4object));
#ifdef _WINDOWS
fopen_s(&mp4->mediafp, filename, "rb");
#else
mp4->mediafp = fopen(filename, "rb");
#endif
if (mp4->mediafp)
{
uint32_t qttag, qtsize32, skip, type = 0, subtype = 0, num;
size_t len;
int32_t nest = 0;
uint64_t nestsize[MAX_NEST_LEVEL] = { 0 };
uint64_t lastsize = 0, qtsize;
do
{
len = fread(&qtsize32, 1, 4, mp4->mediafp);
len += fread(&qttag, 1, 4, mp4->mediafp);
if (len == 8)
{
if (!VALID_FOURCC(qttag))
{
LONGSEEK(mp4->mediafp, lastsize - 8 - 8, SEEK_CUR);
NESTSIZE(lastsize - 8);
continue;
}
qtsize32 = BYTESWAP32(qtsize32);
if (qtsize32 == 1) // 64-bit Atom
{
fread(&qtsize, 1, 8, mp4->mediafp);
qtsize = BYTESWAP64(qtsize) - 8;
}
else
qtsize = qtsize32;
nest++;
if (qtsize < 8) break;
if (nest >= MAX_NEST_LEVEL) break;
nestsize[nest] = qtsize;
lastsize = qtsize;
#if PRINT_MP4_STRUCTURE
for (int i = 1; i < nest; i++) printf(" ");
printf("%c%c%c%c (%lld)\n", (qttag & 0xff), ((qttag >> 8) & 0xff), ((qttag >> 16) & 0xff), ((qttag >> 24) & 0xff), qtsize);
if (qttag == MAKEID('m', 'd', 'a', 't') ||
qttag == MAKEID('f', 't', 'y', 'p') ||
qttag == MAKEID('u', 'd', 't', 'a'))
{
LONGSEEK(mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
#else
if (qttag != MAKEID('m', 'o', 'o', 'v') && //skip over all but these atoms
qttag != MAKEID('m', 'v', 'h', 'd') &&
qttag != MAKEID('t', 'r', 'a', 'k') &&
qttag != MAKEID('m', 'd', 'i', 'a') &&
qttag != MAKEID('m', 'd', 'h', 'd') &&
qttag != MAKEID('m', 'i', 'n', 'f') &&
qttag != MAKEID('g', 'm', 'i', 'n') &&
qttag != MAKEID('d', 'i', 'n', 'f') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('s', 't', 's', 'd') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('s', 't', 'b', 'l') &&
qttag != MAKEID('s', 't', 't', 's') &&
qttag != MAKEID('s', 't', 's', 'c') &&
qttag != MAKEID('s', 't', 's', 'z') &&
qttag != MAKEID('s', 't', 'c', 'o') &&
qttag != MAKEID('c', 'o', '6', '4') &&
qttag != MAKEID('h', 'd', 'l', 'r'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else
#endif
if (qttag == MAKEID('m', 'v', 'h', 'd')) //mvhd movie header
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&mp4->clockdemon, 1, 4, mp4->mediafp); mp4->clockdemon = BYTESWAP32(mp4->clockdemon);
len += fread(&mp4->clockcount, 1, 4, mp4->mediafp); mp4->clockcount = BYTESWAP32(mp4->clockcount);
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over mvhd
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('m', 'd', 'h', 'd')) //mdhd media header
{
media_header md;
len = fread(&md, 1, sizeof(md), mp4->mediafp);
if (len == sizeof(md))
{
md.creation_time = BYTESWAP32(md.creation_time);
md.modification_time = BYTESWAP32(md.modification_time);
md.time_scale = BYTESWAP32(md.time_scale);
md.duration = BYTESWAP32(md.duration);
mp4->trak_clockdemon = md.time_scale;
mp4->trak_clockcount = md.duration;
if (mp4->videolength == 0.0) // Get the video length from the first track
{
mp4->videolength = (float)((double)mp4->trak_clockcount / (double)mp4->trak_clockdemon);
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over mvhd
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('h', 'd', 'l', 'r')) //hldr
{
uint32_t temp;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&temp, 1, 4, mp4->mediafp); // type will be 'meta' for the correct trak.
if (temp != MAKEID('a', 'l', 'i', 's'))
type = temp;
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over hldr
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'd')) //read the sample decription to determine the type of metadata
{
if (type == traktype) //like meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&subtype, 1, 4, mp4->mediafp); // type will be 'meta' for the correct trak.
if (len == 16)
{
if (subtype != traksubtype) // MP4 metadata
{
type = 0; // MP4
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsd
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'c')) // metadata stsc - offset chunks
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 12 <= qtsize - 8 - len)
{
mp4->metastsc_count = num;
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = (SampleToChunk *)malloc(num * 12);
if (mp4->metastsc)
{
uint32_t total_stsc = num;
len += fread(mp4->metastsc, 1, num * sizeof(SampleToChunk), mp4->mediafp);
do
{
num--;
mp4->metastsc[num].chunk_num = BYTESWAP32(mp4->metastsc[num].chunk_num);
mp4->metastsc[num].samples = BYTESWAP32(mp4->metastsc[num].samples);
mp4->metastsc[num].id = BYTESWAP32(mp4->metastsc[num].id);
} while (num > 0);
}
if (mp4->metastsc_count == 1 && mp4->metastsc[0].samples == 1) // Simplify if the stsc is not reporting any grouped chunks.
{
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsx
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'z')) // metadata stsz - sizes
{
if (type == traktype) // meta
{
uint32_t equalsamplesize;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&equalsamplesize, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 4 <= qtsize - 8 - len)
{
mp4->metasize_count = num;
if (mp4->metasizes) free(mp4->metasizes);
mp4->metasizes = (uint32_t *)malloc(num * 4);
if (mp4->metasizes)
{
if (equalsamplesize == 0)
{
len += fread(mp4->metasizes, 1, num * 4, mp4->mediafp);
do
{
num--;
mp4->metasizes[num] = BYTESWAP32(mp4->metasizes[num]);
} while (num > 0);
}
else
{
equalsamplesize = BYTESWAP32(equalsamplesize);
do
{
num--;
mp4->metasizes[num] = equalsamplesize;
} while (num > 0);
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsz
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 'c', 'o')) // metadata stco - offsets
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 4 <= qtsize - 8 - len)
{
if (mp4->metastsc_count > 0 && num != mp4->metasize_count)
{
mp4->indexcount = mp4->metasize_count;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(mp4->metasize_count * 8);
if (mp4->metaoffsets)
{
uint32_t *metaoffsets32 = NULL;
metaoffsets32 = (uint32_t *)malloc(num * 4);
if (metaoffsets32)
{
uint64_t fileoffset = 0;
int stsc_pos = 0;
int stco_pos = 0;
int repeat = 1;
len += fread(metaoffsets32, 1, num * 4, mp4->mediafp);
do
{
num--;
metaoffsets32[num] = BYTESWAP32(metaoffsets32[num]);
} while (num > 0);
mp4->metaoffsets[0] = fileoffset = metaoffsets32[stco_pos];
num = 1;
while (num < mp4->metasize_count)
{
if (stsc_pos + 1 < (int)mp4->metastsc_count && num == stsc_pos)
{
stco_pos++; stsc_pos++;
fileoffset = (uint64_t)metaoffsets32[stco_pos];
repeat = 1;
}
else if (repeat == mp4->metastsc[stsc_pos].samples)
{
stco_pos++;
fileoffset = (uint64_t)metaoffsets32[stco_pos];
repeat = 1;
}
else
{
fileoffset += (uint64_t)mp4->metasizes[num - 1];
repeat++;
}
mp4->metaoffsets[num] = fileoffset;
//int delta = metaoffsets[num] - metaoffsets[num - 1];
//printf("%3d:%08x, delta = %08x\n", num, (int)fileoffset, delta);
num++;
}
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
free(metaoffsets32);
}
}
}
else
{
mp4->indexcount = num;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(num * 8);
if (mp4->metaoffsets)
{
uint32_t *metaoffsets32 = NULL;
metaoffsets32 = (uint32_t *)malloc(num * 4);
if (metaoffsets32)
{
size_t readlen = fread(metaoffsets32, 1, num * 4, mp4->mediafp);
len += readlen;
do
{
num--;
mp4->metaoffsets[num] = BYTESWAP32(metaoffsets32[num]);
} while (num > 0);
free(metaoffsets32);
}
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('c', 'o', '6', '4')) // metadata stco - offsets
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 8 <= qtsize - 8 - len)
{
if (mp4->metastsc_count > 0 && num != mp4->metasize_count)
{
mp4->indexcount = mp4->metasize_count;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(mp4->metasize_count * 8);
if (mp4->metaoffsets)
{
uint64_t *metaoffsets64 = NULL;
metaoffsets64 = (uint64_t *)malloc(num * 8);
if (metaoffsets64)
{
uint64_t fileoffset = 0;
int stsc_pos = 0;
int stco_pos = 0;
len += fread(metaoffsets64, 1, num * 8, mp4->mediafp);
do
{
num--;
metaoffsets64[num] = BYTESWAP64(metaoffsets64[num]);
} while (num > 0);
fileoffset = metaoffsets64[0];
mp4->metaoffsets[0] = fileoffset;
//printf("%3d:%08x, delta = %08x\n", 0, (int)fileoffset, 0);
num = 1;
while (num < mp4->metasize_count)
{
if (num != mp4->metastsc[stsc_pos].chunk_num - 1 && 0 == (num - (mp4->metastsc[stsc_pos].chunk_num - 1)) % mp4->metastsc[stsc_pos].samples)
{
stco_pos++;
fileoffset = (uint64_t)metaoffsets64[stco_pos];
}
else
{
fileoffset += (uint64_t)mp4->metasizes[num - 1];
}
mp4->metaoffsets[num] = fileoffset;
//int delta = metaoffsets[num] - metaoffsets[num - 1];
//printf("%3d:%08x, delta = %08x\n", num, (int)fileoffset, delta);
num++;
}
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
free(metaoffsets64);
}
}
}
else
{
mp4->indexcount = num;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(num * 8);
if (mp4->metaoffsets)
{
len += fread(mp4->metaoffsets, 1, num * 8, mp4->mediafp);
do
{
num--;
mp4->metaoffsets[num] = BYTESWAP64(mp4->metaoffsets[num]);
} while (num > 0);
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 't', 's')) // time to samples
{
if (type == traktype) // meta
{
uint32_t totaldur = 0, samples = 0;
int32_t entries = 0;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 8 <= qtsize - 8 - len)
{
entries = num;
mp4->meta_clockdemon = mp4->trak_clockdemon;
mp4->meta_clockcount = mp4->trak_clockcount;
while (entries > 0)
{
int32_t samplecount;
int32_t duration;
len += fread(&samplecount, 1, 4, mp4->mediafp);
samplecount = BYTESWAP32(samplecount);
len += fread(&duration, 1, 4, mp4->mediafp);
duration = BYTESWAP32(duration);
samples += samplecount;
entries--;
totaldur += duration;
mp4->metadatalength += (double)((double)samplecount * (double)duration / (double)mp4->meta_clockdemon);
}
mp4->basemetadataduration = mp4->metadatalength * (double)mp4->meta_clockdemon / (double)samples;
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else
{
NESTSIZE(8);
}
}
else
{
break;
}
} while (len > 0);
}
else
{
// printf("Could not open %s for input\n", filename);
// exit(1);
free(mp4);
mp4 = NULL;
}
return (size_t)mp4;
} | 3149 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | OpenMP4Source | OpenMP4Source( char * filename , uint32_t traktype , uint32_t traksubtype) | ['filename', 'traktype', 'traksubtype'] | size_t OpenMP4Source(char *filename, uint32_t traktype, uint32_t traksubtype) //RAW or within MP4
{
mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object));
if (mp4 == NULL) return 0;
memset(mp4, 0, sizeof(mp4object));
#ifdef _WINDOWS
fopen_s(&mp4->mediafp, filename, "rb");
#else
mp4->mediafp = fopen(filename, "rb");
#endif
if (mp4->mediafp)
{
uint32_t qttag, qtsize32, skip, type = 0, subtype = 0, num;
size_t len;
int32_t nest = 0;
uint64_t nestsize[MAX_NEST_LEVEL] = { 0 };
uint64_t lastsize = 0, qtsize;
do
{
len = fread(&qtsize32, 1, 4, mp4->mediafp);
len += fread(&qttag, 1, 4, mp4->mediafp);
if (len == 8)
{
if (!VALID_FOURCC(qttag))
{
LONGSEEK(mp4->mediafp, lastsize - 8 - 8, SEEK_CUR);
NESTSIZE(lastsize - 8);
continue;
}
qtsize32 = BYTESWAP32(qtsize32);
if (qtsize32 == 1) // 64-bit Atom
{
fread(&qtsize, 1, 8, mp4->mediafp);
qtsize = BYTESWAP64(qtsize) - 8;
}
else
qtsize = qtsize32;
nest++;
if (qtsize < 8) break;
if (nest >= MAX_NEST_LEVEL) break;
nestsize[nest] = qtsize;
lastsize = qtsize;
#if PRINT_MP4_STRUCTURE
for (int i = 1; i < nest; i++) printf(" ");
printf("%c%c%c%c (%lld)\n", (qttag & 0xff), ((qttag >> 8) & 0xff), ((qttag >> 16) & 0xff), ((qttag >> 24) & 0xff), qtsize);
if (qttag == MAKEID('m', 'd', 'a', 't') ||
qttag == MAKEID('f', 't', 'y', 'p') ||
qttag == MAKEID('u', 'd', 't', 'a'))
{
LONGSEEK(mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
#else
if (qttag != MAKEID('m', 'o', 'o', 'v') && //skip over all but these atoms
qttag != MAKEID('m', 'v', 'h', 'd') &&
qttag != MAKEID('t', 'r', 'a', 'k') &&
qttag != MAKEID('m', 'd', 'i', 'a') &&
qttag != MAKEID('m', 'd', 'h', 'd') &&
qttag != MAKEID('m', 'i', 'n', 'f') &&
qttag != MAKEID('g', 'm', 'i', 'n') &&
qttag != MAKEID('d', 'i', 'n', 'f') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('s', 't', 's', 'd') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('s', 't', 'b', 'l') &&
qttag != MAKEID('s', 't', 't', 's') &&
qttag != MAKEID('s', 't', 's', 'c') &&
qttag != MAKEID('s', 't', 's', 'z') &&
qttag != MAKEID('s', 't', 'c', 'o') &&
qttag != MAKEID('c', 'o', '6', '4') &&
qttag != MAKEID('h', 'd', 'l', 'r'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else
#endif
if (qttag == MAKEID('m', 'v', 'h', 'd')) //mvhd movie header
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&mp4->clockdemon, 1, 4, mp4->mediafp); mp4->clockdemon = BYTESWAP32(mp4->clockdemon);
len += fread(&mp4->clockcount, 1, 4, mp4->mediafp); mp4->clockcount = BYTESWAP32(mp4->clockcount);
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over mvhd
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('m', 'd', 'h', 'd')) //mdhd media header
{
media_header md;
len = fread(&md, 1, sizeof(md), mp4->mediafp);
if (len == sizeof(md))
{
md.creation_time = BYTESWAP32(md.creation_time);
md.modification_time = BYTESWAP32(md.modification_time);
md.time_scale = BYTESWAP32(md.time_scale);
md.duration = BYTESWAP32(md.duration);
mp4->trak_clockdemon = md.time_scale;
mp4->trak_clockcount = md.duration;
if (mp4->videolength == 0.0) // Get the video length from the first track
{
mp4->videolength = (float)((double)mp4->trak_clockcount / (double)mp4->trak_clockdemon);
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over mvhd
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('h', 'd', 'l', 'r')) //hldr
{
uint32_t temp;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&temp, 1, 4, mp4->mediafp); // type will be 'meta' for the correct trak.
if (temp != MAKEID('a', 'l', 'i', 's'))
type = temp;
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over hldr
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'd')) //read the sample decription to determine the type of metadata
{
if (type == traktype) //like meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&subtype, 1, 4, mp4->mediafp); // type will be 'meta' for the correct trak.
if (len == 16)
{
if (subtype != traksubtype) // MP4 metadata
{
type = 0; // MP4
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsd
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'c')) // metadata stsc - offset chunks
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 12 <= qtsize - 8 - len)
{
mp4->metastsc_count = num;
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = (SampleToChunk *)malloc(num * 12);
if (mp4->metastsc)
{
uint32_t total_stsc = num;
len += fread(mp4->metastsc, 1, num * sizeof(SampleToChunk), mp4->mediafp);
do
{
num--;
mp4->metastsc[num].chunk_num = BYTESWAP32(mp4->metastsc[num].chunk_num);
mp4->metastsc[num].samples = BYTESWAP32(mp4->metastsc[num].samples);
mp4->metastsc[num].id = BYTESWAP32(mp4->metastsc[num].id);
} while (num > 0);
}
if (mp4->metastsc_count == 1 && mp4->metastsc[0].samples == 1) // Simplify if the stsc is not reporting any grouped chunks.
{
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsx
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'z')) // metadata stsz - sizes
{
if (type == traktype) // meta
{
uint32_t equalsamplesize;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&equalsamplesize, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 4 <= qtsize - 8 - len)
{
mp4->metasize_count = num;
if (mp4->metasizes) free(mp4->metasizes);
mp4->metasizes = (uint32_t *)malloc(num * 4);
if (mp4->metasizes)
{
if (equalsamplesize == 0)
{
len += fread(mp4->metasizes, 1, num * 4, mp4->mediafp);
do
{
num--;
mp4->metasizes[num] = BYTESWAP32(mp4->metasizes[num]);
} while (num > 0);
}
else
{
equalsamplesize = BYTESWAP32(equalsamplesize);
do
{
num--;
mp4->metasizes[num] = equalsamplesize;
} while (num > 0);
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsz
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 'c', 'o')) // metadata stco - offsets
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 4 <= qtsize - 8 - len)
{
if (mp4->metastsc_count > 0 && num != mp4->metasize_count)
{
mp4->indexcount = mp4->metasize_count;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(mp4->metasize_count * 8);
if (mp4->metaoffsets)
{
uint32_t *metaoffsets32 = NULL;
metaoffsets32 = (uint32_t *)malloc(num * 4);
if (metaoffsets32)
{
uint64_t fileoffset = 0;
int stsc_pos = 0;
int stco_pos = 0;
int repeat = 1;
len += fread(metaoffsets32, 1, num * 4, mp4->mediafp);
do
{
num--;
metaoffsets32[num] = BYTESWAP32(metaoffsets32[num]);
} while (num > 0);
mp4->metaoffsets[0] = fileoffset = metaoffsets32[stco_pos];
num = 1;
while (num < mp4->metasize_count)
{
if (stsc_pos + 1 < (int)mp4->metastsc_count && num == stsc_pos)
{
stco_pos++; stsc_pos++;
fileoffset = (uint64_t)metaoffsets32[stco_pos];
repeat = 1;
}
else if (repeat == mp4->metastsc[stsc_pos].samples)
{
stco_pos++;
fileoffset = (uint64_t)metaoffsets32[stco_pos];
repeat = 1;
}
else
{
fileoffset += (uint64_t)mp4->metasizes[num - 1];
repeat++;
}
mp4->metaoffsets[num] = fileoffset;
//int delta = metaoffsets[num] - metaoffsets[num - 1];
//printf("%3d:%08x, delta = %08x\n", num, (int)fileoffset, delta);
num++;
}
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
free(metaoffsets32);
}
}
}
else
{
mp4->indexcount = num;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(num * 8);
if (mp4->metaoffsets)
{
uint32_t *metaoffsets32 = NULL;
metaoffsets32 = (uint32_t *)malloc(num * 4);
if (metaoffsets32)
{
size_t readlen = fread(metaoffsets32, 1, num * 4, mp4->mediafp);
len += readlen;
do
{
num--;
mp4->metaoffsets[num] = BYTESWAP32(metaoffsets32[num]);
} while (num > 0);
free(metaoffsets32);
}
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('c', 'o', '6', '4')) // metadata stco - offsets
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 8 <= qtsize - 8 - len)
{
if (mp4->metastsc_count > 0 && num != mp4->metasize_count)
{
mp4->indexcount = mp4->metasize_count;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(mp4->metasize_count * 8);
if (mp4->metaoffsets)
{
uint64_t *metaoffsets64 = NULL;
metaoffsets64 = (uint64_t *)malloc(num * 8);
if (metaoffsets64)
{
uint64_t fileoffset = 0;
int stsc_pos = 0;
int stco_pos = 0;
len += fread(metaoffsets64, 1, num * 8, mp4->mediafp);
do
{
num--;
metaoffsets64[num] = BYTESWAP64(metaoffsets64[num]);
} while (num > 0);
fileoffset = metaoffsets64[0];
mp4->metaoffsets[0] = fileoffset;
//printf("%3d:%08x, delta = %08x\n", 0, (int)fileoffset, 0);
num = 1;
while (num < mp4->metasize_count)
{
if (num != mp4->metastsc[stsc_pos].chunk_num - 1 && 0 == (num - (mp4->metastsc[stsc_pos].chunk_num - 1)) % mp4->metastsc[stsc_pos].samples)
{
stco_pos++;
fileoffset = (uint64_t)metaoffsets64[stco_pos];
}
else
{
fileoffset += (uint64_t)mp4->metasizes[num - 1];
}
mp4->metaoffsets[num] = fileoffset;
//int delta = metaoffsets[num] - metaoffsets[num - 1];
//printf("%3d:%08x, delta = %08x\n", num, (int)fileoffset, delta);
num++;
}
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
free(metaoffsets64);
}
}
}
else
{
mp4->indexcount = num;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(num * 8);
if (mp4->metaoffsets)
{
len += fread(mp4->metaoffsets, 1, num * 8, mp4->mediafp);
do
{
num--;
mp4->metaoffsets[num] = BYTESWAP64(mp4->metaoffsets[num]);
} while (num > 0);
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 't', 's')) // time to samples
{
if (type == traktype) // meta
{
uint32_t totaldur = 0, samples = 0;
int32_t entries = 0;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 8 <= qtsize - 8 - len)
{
entries = num;
mp4->meta_clockdemon = mp4->trak_clockdemon;
mp4->meta_clockcount = mp4->trak_clockcount;
while (entries > 0)
{
int32_t samplecount;
int32_t duration;
len += fread(&samplecount, 1, 4, mp4->mediafp);
samplecount = BYTESWAP32(samplecount);
len += fread(&duration, 1, 4, mp4->mediafp);
duration = BYTESWAP32(duration);
samples += samplecount;
entries--;
totaldur += duration;
mp4->metadatalength += (double)((double)samplecount * (double)duration / (double)mp4->meta_clockdemon);
}
mp4->basemetadataduration = mp4->metadatalength * (double)mp4->meta_clockdemon / (double)samples;
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else
{
NESTSIZE(8);
}
}
else
{
break;
}
} while (len > 0);
}
else
{
// printf("Could not open %s for input\n", filename);
// exit(1);
free(mp4);
mp4 = NULL;
}
return (size_t)mp4;
} | 3149 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | OpenMP4Source | OpenMP4Source( char * filename , uint32_t traktype , uint32_t traksubtype) | ['filename', 'traktype', 'traksubtype'] | size_t OpenMP4Source(char *filename, uint32_t traktype, uint32_t traksubtype) //RAW or within MP4
{
mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object));
if (mp4 == NULL) return 0;
memset(mp4, 0, sizeof(mp4object));
#ifdef _WINDOWS
fopen_s(&mp4->mediafp, filename, "rb");
#else
mp4->mediafp = fopen(filename, "rb");
#endif
if (mp4->mediafp)
{
uint32_t qttag, qtsize32, skip, type = 0, subtype = 0, num;
size_t len;
int32_t nest = 0;
uint64_t nestsize[MAX_NEST_LEVEL] = { 0 };
uint64_t lastsize = 0, qtsize;
do
{
len = fread(&qtsize32, 1, 4, mp4->mediafp);
len += fread(&qttag, 1, 4, mp4->mediafp);
if (len == 8)
{
if (!VALID_FOURCC(qttag))
{
LONGSEEK(mp4->mediafp, lastsize - 8 - 8, SEEK_CUR);
NESTSIZE(lastsize - 8);
continue;
}
qtsize32 = BYTESWAP32(qtsize32);
if (qtsize32 == 1) // 64-bit Atom
{
fread(&qtsize, 1, 8, mp4->mediafp);
qtsize = BYTESWAP64(qtsize) - 8;
}
else
qtsize = qtsize32;
nest++;
if (qtsize < 8) break;
if (nest >= MAX_NEST_LEVEL) break;
nestsize[nest] = qtsize;
lastsize = qtsize;
#if PRINT_MP4_STRUCTURE
for (int i = 1; i < nest; i++) printf(" ");
printf("%c%c%c%c (%lld)\n", (qttag & 0xff), ((qttag >> 8) & 0xff), ((qttag >> 16) & 0xff), ((qttag >> 24) & 0xff), qtsize);
if (qttag == MAKEID('m', 'd', 'a', 't') ||
qttag == MAKEID('f', 't', 'y', 'p') ||
qttag == MAKEID('u', 'd', 't', 'a'))
{
LONGSEEK(mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
#else
if (qttag != MAKEID('m', 'o', 'o', 'v') && //skip over all but these atoms
qttag != MAKEID('m', 'v', 'h', 'd') &&
qttag != MAKEID('t', 'r', 'a', 'k') &&
qttag != MAKEID('m', 'd', 'i', 'a') &&
qttag != MAKEID('m', 'd', 'h', 'd') &&
qttag != MAKEID('m', 'i', 'n', 'f') &&
qttag != MAKEID('g', 'm', 'i', 'n') &&
qttag != MAKEID('d', 'i', 'n', 'f') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('s', 't', 's', 'd') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('a', 'l', 'i', 's') &&
qttag != MAKEID('s', 't', 'b', 'l') &&
qttag != MAKEID('s', 't', 't', 's') &&
qttag != MAKEID('s', 't', 's', 'c') &&
qttag != MAKEID('s', 't', 's', 'z') &&
qttag != MAKEID('s', 't', 'c', 'o') &&
qttag != MAKEID('c', 'o', '6', '4') &&
qttag != MAKEID('h', 'd', 'l', 'r'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else
#endif
if (qttag == MAKEID('m', 'v', 'h', 'd')) //mvhd movie header
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&mp4->clockdemon, 1, 4, mp4->mediafp); mp4->clockdemon = BYTESWAP32(mp4->clockdemon);
len += fread(&mp4->clockcount, 1, 4, mp4->mediafp); mp4->clockcount = BYTESWAP32(mp4->clockcount);
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over mvhd
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('m', 'd', 'h', 'd')) //mdhd media header
{
media_header md;
len = fread(&md, 1, sizeof(md), mp4->mediafp);
if (len == sizeof(md))
{
md.creation_time = BYTESWAP32(md.creation_time);
md.modification_time = BYTESWAP32(md.modification_time);
md.time_scale = BYTESWAP32(md.time_scale);
md.duration = BYTESWAP32(md.duration);
mp4->trak_clockdemon = md.time_scale;
mp4->trak_clockcount = md.duration;
if (mp4->videolength == 0.0) // Get the video length from the first track
{
mp4->videolength = (float)((double)mp4->trak_clockcount / (double)mp4->trak_clockdemon);
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over mvhd
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('h', 'd', 'l', 'r')) //hldr
{
uint32_t temp;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&temp, 1, 4, mp4->mediafp); // type will be 'meta' for the correct trak.
if (temp != MAKEID('a', 'l', 'i', 's'))
type = temp;
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over hldr
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'd')) //read the sample decription to determine the type of metadata
{
if (type == traktype) //like meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&skip, 1, 4, mp4->mediafp);
len += fread(&subtype, 1, 4, mp4->mediafp); // type will be 'meta' for the correct trak.
if (len == 16)
{
if (subtype != traksubtype) // MP4 metadata
{
type = 0; // MP4
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsd
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'c')) // metadata stsc - offset chunks
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 12 <= qtsize - 8 - len)
{
mp4->metastsc_count = num;
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = (SampleToChunk *)malloc(num * 12);
if (mp4->metastsc)
{
uint32_t total_stsc = num;
len += fread(mp4->metastsc, 1, num * sizeof(SampleToChunk), mp4->mediafp);
do
{
num--;
mp4->metastsc[num].chunk_num = BYTESWAP32(mp4->metastsc[num].chunk_num);
mp4->metastsc[num].samples = BYTESWAP32(mp4->metastsc[num].samples);
mp4->metastsc[num].id = BYTESWAP32(mp4->metastsc[num].id);
} while (num > 0);
}
if (mp4->metastsc_count == 1 && mp4->metastsc[0].samples == 1) // Simplify if the stsc is not reporting any grouped chunks.
{
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsx
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 's', 'z')) // metadata stsz - sizes
{
if (type == traktype) // meta
{
uint32_t equalsamplesize;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&equalsamplesize, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 4 <= qtsize - 8 - len)
{
mp4->metasize_count = num;
if (mp4->metasizes) free(mp4->metasizes);
mp4->metasizes = (uint32_t *)malloc(num * 4);
if (mp4->metasizes)
{
if (equalsamplesize == 0)
{
len += fread(mp4->metasizes, 1, num * 4, mp4->mediafp);
do
{
num--;
mp4->metasizes[num] = BYTESWAP32(mp4->metasizes[num]);
} while (num > 0);
}
else
{
equalsamplesize = BYTESWAP32(equalsamplesize);
do
{
num--;
mp4->metasizes[num] = equalsamplesize;
} while (num > 0);
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stsz
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 'c', 'o')) // metadata stco - offsets
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 4 <= qtsize - 8 - len)
{
if (mp4->metastsc_count > 0 && num != mp4->metasize_count)
{
mp4->indexcount = mp4->metasize_count;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(mp4->metasize_count * 8);
if (mp4->metaoffsets)
{
uint32_t *metaoffsets32 = NULL;
metaoffsets32 = (uint32_t *)malloc(num * 4);
if (metaoffsets32)
{
uint64_t fileoffset = 0;
int stsc_pos = 0;
int stco_pos = 0;
int repeat = 1;
len += fread(metaoffsets32, 1, num * 4, mp4->mediafp);
do
{
num--;
metaoffsets32[num] = BYTESWAP32(metaoffsets32[num]);
} while (num > 0);
mp4->metaoffsets[0] = fileoffset = metaoffsets32[stco_pos];
num = 1;
while (num < mp4->metasize_count)
{
if (stsc_pos + 1 < (int)mp4->metastsc_count && num == stsc_pos)
{
stco_pos++; stsc_pos++;
fileoffset = (uint64_t)metaoffsets32[stco_pos];
repeat = 1;
}
else if (repeat == mp4->metastsc[stsc_pos].samples)
{
stco_pos++;
fileoffset = (uint64_t)metaoffsets32[stco_pos];
repeat = 1;
}
else
{
fileoffset += (uint64_t)mp4->metasizes[num - 1];
repeat++;
}
mp4->metaoffsets[num] = fileoffset;
//int delta = metaoffsets[num] - metaoffsets[num - 1];
//printf("%3d:%08x, delta = %08x\n", num, (int)fileoffset, delta);
num++;
}
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
free(metaoffsets32);
}
}
}
else
{
mp4->indexcount = num;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(num * 8);
if (mp4->metaoffsets)
{
uint32_t *metaoffsets32 = NULL;
metaoffsets32 = (uint32_t *)malloc(num * 4);
if (metaoffsets32)
{
size_t readlen = fread(metaoffsets32, 1, num * 4, mp4->mediafp);
len += readlen;
do
{
num--;
mp4->metaoffsets[num] = BYTESWAP32(metaoffsets32[num]);
} while (num > 0);
free(metaoffsets32);
}
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('c', 'o', '6', '4')) // metadata stco - offsets
{
if (type == traktype) // meta
{
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 8 <= qtsize - 8 - len)
{
if (mp4->metastsc_count > 0 && num != mp4->metasize_count)
{
mp4->indexcount = mp4->metasize_count;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(mp4->metasize_count * 8);
if (mp4->metaoffsets)
{
uint64_t *metaoffsets64 = NULL;
metaoffsets64 = (uint64_t *)malloc(num * 8);
if (metaoffsets64)
{
uint64_t fileoffset = 0;
int stsc_pos = 0;
int stco_pos = 0;
len += fread(metaoffsets64, 1, num * 8, mp4->mediafp);
do
{
num--;
metaoffsets64[num] = BYTESWAP64(metaoffsets64[num]);
} while (num > 0);
fileoffset = metaoffsets64[0];
mp4->metaoffsets[0] = fileoffset;
//printf("%3d:%08x, delta = %08x\n", 0, (int)fileoffset, 0);
num = 1;
while (num < mp4->metasize_count)
{
if (num != mp4->metastsc[stsc_pos].chunk_num - 1 && 0 == (num - (mp4->metastsc[stsc_pos].chunk_num - 1)) % mp4->metastsc[stsc_pos].samples)
{
stco_pos++;
fileoffset = (uint64_t)metaoffsets64[stco_pos];
}
else
{
fileoffset += (uint64_t)mp4->metasizes[num - 1];
}
mp4->metaoffsets[num] = fileoffset;
//int delta = metaoffsets[num] - metaoffsets[num - 1];
//printf("%3d:%08x, delta = %08x\n", num, (int)fileoffset, delta);
num++;
}
if (mp4->metastsc) free(mp4->metastsc);
mp4->metastsc = NULL;
mp4->metastsc_count = 0;
free(metaoffsets64);
}
}
}
else
{
mp4->indexcount = num;
if (mp4->metaoffsets) free(mp4->metaoffsets);
mp4->metaoffsets = (uint64_t *)malloc(num * 8);
if (mp4->metaoffsets)
{
len += fread(mp4->metaoffsets, 1, num * 8, mp4->mediafp);
do
{
num--;
mp4->metaoffsets[num] = BYTESWAP64(mp4->metaoffsets[num]);
} while (num > 0);
}
}
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else if (qttag == MAKEID('s', 't', 't', 's')) // time to samples
{
if (type == traktype) // meta
{
uint32_t totaldur = 0, samples = 0;
int32_t entries = 0;
len = fread(&skip, 1, 4, mp4->mediafp);
len += fread(&num, 1, 4, mp4->mediafp);
num = BYTESWAP32(num);
if (num * 8 <= qtsize - 8 - len)
{
entries = num;
mp4->meta_clockdemon = mp4->trak_clockdemon;
mp4->meta_clockcount = mp4->trak_clockcount;
while (entries > 0)
{
int32_t samplecount;
int32_t duration;
len += fread(&samplecount, 1, 4, mp4->mediafp);
samplecount = BYTESWAP32(samplecount);
len += fread(&duration, 1, 4, mp4->mediafp);
duration = BYTESWAP32(duration);
samples += samplecount;
entries--;
totaldur += duration;
mp4->metadatalength += (double)((double)samplecount * (double)duration / (double)mp4->meta_clockdemon);
}
mp4->basemetadataduration = mp4->metadatalength * (double)mp4->meta_clockdemon / (double)samples;
}
LONGSEEK(mp4->mediafp, qtsize - 8 - len, SEEK_CUR); // skip over stco
}
else
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
}
else
{
NESTSIZE(8);
}
}
else
{
break;
}
} while (len > 0);
}
else
{
// printf("Could not open %s for input\n", filename);
// exit(1);
free(mp4);
mp4 = NULL;
}
return (size_t)mp4;
} | 3149 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | OpenMP4SourceUDTA | OpenMP4SourceUDTA( char * filename) | ['filename'] | size_t OpenMP4SourceUDTA(char *filename)
{
mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object));
if (mp4 == NULL) return 0;
memset(mp4, 0, sizeof(mp4object));
#ifdef _WINDOWS
fopen_s(&mp4->mediafp, filename, "rb");
#else
mp4->mediafp = fopen(filename, "rb");
#endif
if (mp4->mediafp)
{
uint32_t qttag, qtsize32, len;
int32_t nest = 0;
uint64_t nestsize[MAX_NEST_LEVEL] = { 0 };
uint64_t lastsize = 0, qtsize;
do
{
len = fread(&qtsize32, 1, 4, mp4->mediafp);
len += fread(&qttag, 1, 4, mp4->mediafp);
if (len == 8)
{
if (!GPMF_VALID_FOURCC(qttag))
{
LONGSEEK(mp4->mediafp, lastsize - 8 - 8, SEEK_CUR);
NESTSIZE(lastsize - 8);
continue;
}
qtsize32 = BYTESWAP32(qtsize32);
if (qtsize32 == 1) // 64-bit Atom
{
fread(&qtsize, 1, 8, mp4->mediafp);
qtsize = BYTESWAP64(qtsize) - 8;
}
else
qtsize = qtsize32;
nest++;
if (qtsize < 8) break;
if (nest >= MAX_NEST_LEVEL) break;
nestsize[nest] = qtsize;
lastsize = qtsize;
if (qttag == MAKEID('m', 'd', 'a', 't') ||
qttag == MAKEID('f', 't', 'y', 'p'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
if (qttag == MAKEID('G', 'P', 'M', 'F'))
{
mp4->videolength += 1.0;
mp4->metadatalength += 1.0;
mp4->indexcount = (int)mp4->metadatalength;
mp4->metasizes = (uint32_t *)malloc(mp4->indexcount * 4 + 4); memset(mp4->metasizes, 0, mp4->indexcount * 4 + 4);
mp4->metaoffsets = (uint64_t *)malloc(mp4->indexcount * 8 + 8); memset(mp4->metaoffsets, 0, mp4->indexcount * 8 + 8);
mp4->metasizes[0] = (int)qtsize - 8;
mp4->metaoffsets[0] = ftell(mp4->mediafp);
mp4->metasize_count = 1;
return (size_t)mp4; // not an MP4, RAW GPMF which has not inherent timing, assigning a during of 1second.
}
if (qttag != MAKEID('m', 'o', 'o', 'v') && //skip over all but these atoms
qttag != MAKEID('u', 'd', 't', 'a'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
else
{
NESTSIZE(8);
}
}
} while (len > 0);
}
return (size_t)mp4;
} | 532 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | OpenMP4SourceUDTA | OpenMP4SourceUDTA( char * filename) | ['filename'] | size_t OpenMP4SourceUDTA(char *filename)
{
mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object));
if (mp4 == NULL) return 0;
memset(mp4, 0, sizeof(mp4object));
#ifdef _WINDOWS
fopen_s(&mp4->mediafp, filename, "rb");
#else
mp4->mediafp = fopen(filename, "rb");
#endif
if (mp4->mediafp)
{
uint32_t qttag, qtsize32, len;
int32_t nest = 0;
uint64_t nestsize[MAX_NEST_LEVEL] = { 0 };
uint64_t lastsize = 0, qtsize;
do
{
len = fread(&qtsize32, 1, 4, mp4->mediafp);
len += fread(&qttag, 1, 4, mp4->mediafp);
if (len == 8)
{
if (!GPMF_VALID_FOURCC(qttag))
{
LONGSEEK(mp4->mediafp, lastsize - 8 - 8, SEEK_CUR);
NESTSIZE(lastsize - 8);
continue;
}
qtsize32 = BYTESWAP32(qtsize32);
if (qtsize32 == 1) // 64-bit Atom
{
fread(&qtsize, 1, 8, mp4->mediafp);
qtsize = BYTESWAP64(qtsize) - 8;
}
else
qtsize = qtsize32;
nest++;
if (qtsize < 8) break;
if (nest >= MAX_NEST_LEVEL) break;
nestsize[nest] = qtsize;
lastsize = qtsize;
if (qttag == MAKEID('m', 'd', 'a', 't') ||
qttag == MAKEID('f', 't', 'y', 'p'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
if (qttag == MAKEID('G', 'P', 'M', 'F'))
{
mp4->videolength += 1.0;
mp4->metadatalength += 1.0;
mp4->indexcount = (int)mp4->metadatalength;
mp4->metasizes = (uint32_t *)malloc(mp4->indexcount * 4 + 4); memset(mp4->metasizes, 0, mp4->indexcount * 4 + 4);
mp4->metaoffsets = (uint64_t *)malloc(mp4->indexcount * 8 + 8); memset(mp4->metaoffsets, 0, mp4->indexcount * 8 + 8);
mp4->metasizes[0] = (int)qtsize - 8;
mp4->metaoffsets[0] = ftell(mp4->mediafp);
mp4->metasize_count = 1;
return (size_t)mp4; // not an MP4, RAW GPMF which has not inherent timing, assigning a during of 1second.
}
if (qttag != MAKEID('m', 'o', 'o', 'v') && //skip over all but these atoms
qttag != MAKEID('u', 'd', 't', 'a'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
else
{
NESTSIZE(8);
}
}
} while (len > 0);
}
return (size_t)mp4;
} | 532 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | OpenMP4SourceUDTA | OpenMP4SourceUDTA( char * filename) | ['filename'] | size_t OpenMP4SourceUDTA(char *filename)
{
mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object));
if (mp4 == NULL) return 0;
memset(mp4, 0, sizeof(mp4object));
#ifdef _WINDOWS
fopen_s(&mp4->mediafp, filename, "rb");
#else
mp4->mediafp = fopen(filename, "rb");
#endif
if (mp4->mediafp)
{
uint32_t qttag, qtsize32, len;
int32_t nest = 0;
uint64_t nestsize[MAX_NEST_LEVEL] = { 0 };
uint64_t lastsize = 0, qtsize;
do
{
len = fread(&qtsize32, 1, 4, mp4->mediafp);
len += fread(&qttag, 1, 4, mp4->mediafp);
if (len == 8)
{
if (!GPMF_VALID_FOURCC(qttag))
{
LONGSEEK(mp4->mediafp, lastsize - 8 - 8, SEEK_CUR);
NESTSIZE(lastsize - 8);
continue;
}
qtsize32 = BYTESWAP32(qtsize32);
if (qtsize32 == 1) // 64-bit Atom
{
fread(&qtsize, 1, 8, mp4->mediafp);
qtsize = BYTESWAP64(qtsize) - 8;
}
else
qtsize = qtsize32;
nest++;
if (qtsize < 8) break;
if (nest >= MAX_NEST_LEVEL) break;
nestsize[nest] = qtsize;
lastsize = qtsize;
if (qttag == MAKEID('m', 'd', 'a', 't') ||
qttag == MAKEID('f', 't', 'y', 'p'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
if (qttag == MAKEID('G', 'P', 'M', 'F'))
{
mp4->videolength += 1.0;
mp4->metadatalength += 1.0;
mp4->indexcount = (int)mp4->metadatalength;
mp4->metasizes = (uint32_t *)malloc(mp4->indexcount * 4 + 4); memset(mp4->metasizes, 0, mp4->indexcount * 4 + 4);
mp4->metaoffsets = (uint64_t *)malloc(mp4->indexcount * 8 + 8); memset(mp4->metaoffsets, 0, mp4->indexcount * 8 + 8);
mp4->metasizes[0] = (int)qtsize - 8;
mp4->metaoffsets[0] = ftell(mp4->mediafp);
mp4->metasize_count = 1;
return (size_t)mp4; // not an MP4, RAW GPMF which has not inherent timing, assigning a during of 1second.
}
if (qttag != MAKEID('m', 'o', 'o', 'v') && //skip over all but these atoms
qttag != MAKEID('u', 'd', 't', 'a'))
{
LONGSEEK(mp4->mediafp, qtsize - 8, SEEK_CUR);
NESTSIZE(qtsize);
continue;
}
else
{
NESTSIZE(8);
}
}
} while (len > 0);
}
return (size_t)mp4;
} | 532 | True | 1 |
|
CVE-2019-15146 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has a heap-based buffer over-read (4 bytes) in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | SavePayload | SavePayload( size_t handle , uint32_t * payload , uint32_t index) | ['handle', 'payload', 'index'] | void SavePayload(size_t handle, uint32_t *payload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp && payload)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fwrite(payload, 1, mp4->metasizes[index], mp4->mediafp);
}
return;
} | 90 | True | 1 |
|
CVE-2019-15147 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds read and SEGV in GPMF_Next in GPMF_parser.c.'}] | 2019-08-22T17:00Z | 2019-08-18T19: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 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | SavePayload | SavePayload( size_t handle , uint32_t * payload , uint32_t index) | ['handle', 'payload', 'index'] | void SavePayload(size_t handle, uint32_t *payload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp && payload)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fwrite(payload, 1, mp4->metasizes[index], mp4->mediafp);
}
return;
} | 90 | True | 1 |
|
CVE-2019-15148 | 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.0/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/gopro/gpmf-parser/issues/60', 'name': 'https://github.com/gopro/gpmf-parser/issues/60', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', 'name': 'https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681', '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:gopro:gpmf-parser:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'GoPro GPMF-parser 1.2.2 has an out-of-bounds write in OpenMP4Source in demo/GPMF_mp4reader.c.'}] | 2019-08-22T17:06Z | 2019-08-18T19:15Z | Out-of-bounds Write | The software writes data past the end, or before the beginning, of the intended buffer. | Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/787.html | 0 | David | 2019-05-28 16:29:02-07:00 | fixed many security issues with the too crude mp4 reader | 341f12cd5b97ab419e53853ca00176457c9f1681 | False | gopro/gpmf-parser | Parser for GPMF™ formatted telemetry data used within GoPro® cameras. | 2017-03-29 23:27:56 | 2022-08-18 20:45:22 | gopro | 383.0 | 81.0 | SavePayload | SavePayload( size_t handle , uint32_t * payload , uint32_t index) | ['handle', 'payload', 'index'] | void SavePayload(size_t handle, uint32_t *payload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp && payload)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fwrite(payload, 1, mp4->metasizes[index], mp4->mediafp);
}
return;
} | 90 | True | 1 |
|
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::ConnectionManagerImpl::ActiveStream::decodeHeaders | Envoy::Http::ConnectionManagerImpl::ActiveStream::decodeHeaders( HeaderMapPtr && headers , bool end_stream) | ['headers', 'end_stream'] | void ConnectionManagerImpl::ActiveStream::decodeHeaders(HeaderMapPtr&& headers, bool end_stream) {
ScopeTrackerScopeState scope(this,
connection_manager_.read_callbacks_->connection().dispatcher());
request_headers_ = std::move(headers);
// For Admin thread, we don't use routeConfigProvider or SRDS route provider.
if (dynamic_cast<Server::Admin*>(&connection_manager_.config_) == nullptr &&
connection_manager_.config_.scopedRouteConfigProvider() != nullptr) {
ASSERT(snapped_route_config_ == nullptr,
"Route config already latched to the active stream when scoped RDS is enabled.");
// We need to snap snapped_route_config_ here as it's used in mutateRequestHeaders later.
snapScopedRouteConfig();
}
if (Http::Headers::get().MethodValues.Head ==
request_headers_->Method()->value().getStringView()) {
is_head_request_ = true;
}
ENVOY_STREAM_LOG(debug, "request headers complete (end_stream={}):\n{}", *this, end_stream,
*request_headers_);
// We end the decode here only if the request is header only. If we convert the request to a
// header only, the stream will be marked as done once a subsequent decodeData/decodeTrailers is
// called with end_stream=true.
maybeEndDecode(end_stream);
// Drop new requests when overloaded as soon as we have decoded the headers.
if (connection_manager_.overload_stop_accepting_requests_ref_ ==
Server::OverloadActionState::Active) {
// In this one special case, do not create the filter chain. If there is a risk of memory
// overload it is more important to avoid unnecessary allocation than to create the filters.
state_.created_filter_chain_ = true;
connection_manager_.stats_.named_.downstream_rq_overload_close_.inc();
sendLocalReply(Grpc::Common::hasGrpcContentType(*request_headers_),
Http::Code::ServiceUnavailable, "envoy overloaded", nullptr, is_head_request_,
absl::nullopt, StreamInfo::ResponseCodeDetails::get().Overload);
return;
}
if (!connection_manager_.config_.proxy100Continue() && request_headers_->Expect() &&
request_headers_->Expect()->value() == Headers::get().ExpectValues._100Continue.c_str()) {
// Note in the case Envoy is handling 100-Continue complexity, it skips the filter chain
// and sends the 100-Continue directly to the encoder.
chargeStats(continueHeader());
response_encoder_->encode100ContinueHeaders(continueHeader());
// Remove the Expect header so it won't be handled again upstream.
request_headers_->removeExpect();
}
connection_manager_.user_agent_.initializeFromHeaders(
*request_headers_, connection_manager_.stats_.prefix_, connection_manager_.stats_.scope_);
// Make sure we are getting a codec version we support.
Protocol protocol = connection_manager_.codec_->protocol();
if (protocol == Protocol::Http10) {
// Assume this is HTTP/1.0. This is fine for HTTP/0.9 but this code will also affect any
// requests with non-standard version numbers (0.9, 1.3), basically anything which is not
// HTTP/1.1.
//
// The protocol may have shifted in the HTTP/1.0 case so reset it.
stream_info_.protocol(protocol);
if (!connection_manager_.config_.http1Settings().accept_http_10_) {
// Send "Upgrade Required" if HTTP/1.0 support is not explicitly configured on.
sendLocalReply(false, Code::UpgradeRequired, "", nullptr, is_head_request_, absl::nullopt,
StreamInfo::ResponseCodeDetails::get().LowVersion);
return;
} else {
// HTTP/1.0 defaults to single-use connections. Make sure the connection
// will be closed unless Keep-Alive is present.
state_.saw_connection_close_ = true;
if (request_headers_->Connection() &&
absl::EqualsIgnoreCase(request_headers_->Connection()->value().getStringView(),
Http::Headers::get().ConnectionValues.KeepAlive)) {
state_.saw_connection_close_ = false;
}
}
}
if (!request_headers_->Host()) {
if ((protocol == Protocol::Http10) &&
!connection_manager_.config_.http1Settings().default_host_for_http_10_.empty()) {
// Add a default host if configured to do so.
request_headers_->insertHost().value(
connection_manager_.config_.http1Settings().default_host_for_http_10_);
} else {
// Require host header. For HTTP/1.1 Host has already been translated to :authority.
sendLocalReply(Grpc::Common::hasGrpcContentType(*request_headers_), Code::BadRequest, "",
nullptr, is_head_request_, absl::nullopt,
StreamInfo::ResponseCodeDetails::get().MissingHost);
return;
}
}
ASSERT(connection_manager_.config_.maxRequestHeadersKb() > 0);
if (request_headers_->byteSize() > (connection_manager_.config_.maxRequestHeadersKb() * 1024)) {
sendLocalReply(Grpc::Common::hasGrpcContentType(*request_headers_),
Code::RequestHeaderFieldsTooLarge, "", nullptr, is_head_request_, absl::nullopt,
StreamInfo::ResponseCodeDetails::get().RequestHeadersTooLarge);
return;
}
// Currently we only support relative paths at the application layer. We expect the codec to have
// broken the path into pieces if applicable. NOTE: Currently the HTTP/1.1 codec only does this
// when the allow_absolute_url flag is enabled on the HCM.
// https://tools.ietf.org/html/rfc7230#section-5.3 We also need to check for the existence of
// :path because CONNECT does not have a path, and we don't support that currently.
if (!request_headers_->Path() || request_headers_->Path()->value().getStringView().empty() ||
request_headers_->Path()->value().getStringView()[0] != '/') {
const bool has_path =
request_headers_->Path() && !request_headers_->Path()->value().getStringView().empty();
connection_manager_.stats_.named_.downstream_rq_non_relative_path_.inc();
sendLocalReply(Grpc::Common::hasGrpcContentType(*request_headers_), Code::NotFound, "", nullptr,
is_head_request_, absl::nullopt,
has_path ? StreamInfo::ResponseCodeDetails::get().AbsolutePath
: StreamInfo::ResponseCodeDetails::get().MissingPath);
return;
}
// Path sanitization should happen before any path access other than the above sanity check.
if (!ConnectionManagerUtility::maybeNormalizePath(*request_headers_,
connection_manager_.config_)) {
sendLocalReply(Grpc::Common::hasGrpcContentType(*request_headers_), Code::BadRequest, "",
nullptr, is_head_request_, absl::nullopt,
StreamInfo::ResponseCodeDetails::get().PathNormalizationFailed);
return;
}
if (protocol == Protocol::Http11 && request_headers_->Connection() &&
absl::EqualsIgnoreCase(request_headers_->Connection()->value().getStringView(),
Http::Headers::get().ConnectionValues.Close)) {
state_.saw_connection_close_ = true;
}
// Note: Proxy-Connection is not a standard header, but is supported here
// since it is supported by http-parser the underlying parser for http
// requests.
if (protocol != Protocol::Http2 && !state_.saw_connection_close_ &&
request_headers_->ProxyConnection() &&
absl::EqualsIgnoreCase(request_headers_->ProxyConnection()->value().getStringView(),
Http::Headers::get().ConnectionValues.Close)) {
state_.saw_connection_close_ = true;
}
if (!state_.is_internally_created_) { // Only sanitize headers on first pass.
// Modify the downstream remote address depending on configuration and headers.
stream_info_.setDownstreamRemoteAddress(ConnectionManagerUtility::mutateRequestHeaders(
*request_headers_, connection_manager_.read_callbacks_->connection(),
connection_manager_.config_, *snapped_route_config_, connection_manager_.random_generator_,
connection_manager_.local_info_));
}
ASSERT(stream_info_.downstreamRemoteAddress() != nullptr);
ASSERT(!cached_route_);
refreshCachedRoute();
if (!state_.is_internally_created_) { // Only mutate tracing headers on first pass.
ConnectionManagerUtility::mutateTracingRequestHeader(
*request_headers_, connection_manager_.runtime_, connection_manager_.config_,
cached_route_.value().get());
}
const bool upgrade_rejected = createFilterChain() == false;
// TODO if there are no filters when starting a filter iteration, the connection manager
// should return 404. The current returns no response if there is no router filter.
if (protocol == Protocol::Http11 && hasCachedRoute()) {
if (upgrade_rejected) {
// Do not allow upgrades if the route does not support it.
connection_manager_.stats_.named_.downstream_rq_ws_on_non_ws_route_.inc();
sendLocalReply(Grpc::Common::hasGrpcContentType(*request_headers_), Code::Forbidden, "",
nullptr, is_head_request_, absl::nullopt,
StreamInfo::ResponseCodeDetails::get().UpgradeFailed);
return;
}
// Allow non websocket requests to go through websocket enabled routes.
}
if (hasCachedRoute()) {
const Router::RouteEntry* route_entry = cached_route_.value()->routeEntry();
if (route_entry != nullptr && route_entry->idleTimeout()) {
idle_timeout_ms_ = route_entry->idleTimeout().value();
if (idle_timeout_ms_.count()) {
// If we have a route-level idle timeout but no global stream idle timeout, create a timer.
if (stream_idle_timer_ == nullptr) {
stream_idle_timer_ =
connection_manager_.read_callbacks_->connection().dispatcher().createTimer(
[this]() -> void { onIdleTimeout(); });
}
} else if (stream_idle_timer_ != nullptr) {
// If we had a global stream idle timeout but the route-level idle timeout is set to zero
// (to override), we disable the idle timer.
stream_idle_timer_->disableTimer();
stream_idle_timer_ = nullptr;
}
}
}
// Check if tracing is enabled at all.
if (connection_manager_.config_.tracingConfig()) {
traceRequest();
}
decodeHeaders(nullptr, *request_headers_, end_stream);
// Reset it here for both global and overridden cases.
resetIdleTimer();
} | 1240 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::addCopy | Envoy::Http::HeaderMapImpl::addCopy( const LowerCaseString & key , const std :: string & value) | ['key', 'value'] | void HeaderMapImpl::addCopy(const LowerCaseString& key, const std::string& value) {
auto* entry = getExistingInline(key.get());
if (entry != nullptr) {
appendToHeader(entry->value(), value);
return;
}
HeaderString new_key;
new_key.setCopy(key.get().c_str(), key.get().size());
HeaderString new_value;
new_value.setCopy(value.c_str(), value.size());
insertByKey(std::move(new_key), std::move(new_value));
ASSERT(new_key.empty()); // NOLINT(bugprone-use-after-move)
ASSERT(new_value.empty()); // NOLINT(bugprone-use-after-move)
} | 135 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::addCopy | Envoy::Http::HeaderMapImpl::addCopy( const LowerCaseString & key , uint64_t value) | ['key', 'value'] | void HeaderMapImpl::addCopy(const LowerCaseString& key, uint64_t value) {
auto* entry = getExistingInline(key.get());
if (entry != nullptr) {
char buf[32];
StringUtil::itoa(buf, sizeof(buf), value);
appendToHeader(entry->value(), buf);
return;
}
HeaderString new_key;
new_key.setCopy(key.get().c_str(), key.get().size());
HeaderString new_value;
new_value.setInteger(value);
insertByKey(std::move(new_key), std::move(new_value));
ASSERT(new_key.empty()); // NOLINT(bugprone-use-after-move)
ASSERT(new_value.empty()); // NOLINT(bugprone-use-after-move)
} | 141 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::addViaMove | Envoy::Http::HeaderMapImpl::addViaMove( HeaderString && key , HeaderString && value) | ['key', 'value'] | void HeaderMapImpl::addViaMove(HeaderString&& key, HeaderString&& value) {
// If this is an inline header, we can't addViaMove, because we'll overwrite
// the existing value.
auto* entry = getExistingInline(key.getStringView());
if (entry != nullptr) {
appendToHeader(entry->value(), value.getStringView());
key.clear();
value.clear();
} else {
insertByKey(std::move(key), std::move(value));
}
} | 82 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::appendToHeader | Envoy::Http::HeaderMapImpl::appendToHeader( HeaderString & header , absl :: string_view data) | ['header', 'data'] | void HeaderMapImpl::appendToHeader(HeaderString& header, absl::string_view data) {
if (data.empty()) {
return;
}
if (!header.empty()) {
header.append(",", 1);
}
header.append(data.data(), data.size());
} | 64 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::byteSize | Envoy::Http::HeaderMapImpl::byteSize() const | [] | uint64_t HeaderMapImpl::byteSize() const {
uint64_t byte_size = 0;
for (const HeaderEntryImpl& header : headers_) {
byte_size += header.key().size();
byte_size += header.value().size();
}
return byte_size;
} | 51 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::insertByKey | Envoy::Http::HeaderMapImpl::insertByKey( HeaderString && key , HeaderString && value) | ['key', 'value'] | void HeaderMapImpl::insertByKey(HeaderString&& key, HeaderString&& value) {
EntryCb cb = ConstSingleton<StaticLookupTable>::get().find(key.getStringView());
if (cb) {
key.clear();
StaticLookupResponse ref_lookup_response = cb(*this);
if (*ref_lookup_response.entry_ == nullptr) {
maybeCreateInline(ref_lookup_response.entry_, *ref_lookup_response.key_, std::move(value));
} else {
appendToHeader((*ref_lookup_response.entry_)->value(), value.getStringView());
value.clear();
}
} else {
std::list<HeaderEntryImpl>::iterator i = headers_.insert(std::move(key), std::move(value));
i->entry_ = i;
}
} | 153 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImpl::removePrefix | Envoy::Http::HeaderMapImpl::removePrefix( const LowerCaseString & prefix) | ['prefix'] | void HeaderMapImpl::removePrefix(const LowerCaseString& prefix) {
headers_.remove_if([&](const HeaderEntryImpl& entry) {
bool to_remove = absl::StartsWith(entry.key().getStringView(), prefix.get());
if (to_remove) {
// If this header should be removed, make sure any references in the
// static lookup table are cleared as well.
EntryCb cb = ConstSingleton<StaticLookupTable>::get().find(entry.key().getStringView());
if (cb) {
StaticLookupResponse ref_lookup_response = cb(*this);
if (ref_lookup_response.entry_) {
*ref_lookup_response.entry_ = nullptr;
}
}
}
return to_remove;
});
} | 116 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::Http1::ConnectionImpl::onHeaderValue | Envoy::Http::Http1::ConnectionImpl::onHeaderValue( const char * data , size_t length) | ['data', 'length'] | void ConnectionImpl::onHeaderValue(const char* data, size_t length) {
if (header_parsing_state_ == HeaderParsingState::Done) {
// Ignore trailers.
return;
}
const absl::string_view header_value = absl::string_view(data, length);
if (strict_header_validation_) {
if (!Http::HeaderUtility::headerIsValid(header_value)) {
ENVOY_CONN_LOG(debug, "invalid header value: {}", connection_, header_value);
error_code_ = Http::Code::BadRequest;
sendProtocolError();
throw CodecProtocolException("http/1.1 protocol error: header value contains invalid chars");
}
} else if (header_value.find('\0') != absl::string_view::npos) {
// http-parser should filter for this
// (https://tools.ietf.org/html/rfc7230#section-3.2.6), but it doesn't today. HeaderStrings
// have an invariant that they must not contain embedded zero characters
// (NUL, ASCII 0x0).
throw CodecProtocolException("http/1.1 protocol error: header value contains NUL");
}
header_parsing_state_ = HeaderParsingState::Value;
current_header_value_.append(data, length);
const uint32_t total =
current_header_field_.size() + current_header_value_.size() + current_header_map_->byteSize();
if (total > (max_request_headers_kb_ * 1024)) {
error_code_ = Http::Code::RequestHeaderFieldsTooLarge;
sendProtocolError();
throw CodecProtocolException("headers size exceeds limit");
}
} | 181 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::Http2::ConnectionImpl::saveHeader | Envoy::Http::Http2::ConnectionImpl::saveHeader( const nghttp2_frame * frame , HeaderString && name , HeaderString && value) | ['frame', 'name', 'value'] | int ConnectionImpl::saveHeader(const nghttp2_frame* frame, HeaderString&& name,
HeaderString&& value) {
StreamImpl* stream = getStream(frame->hd.stream_id);
if (!stream) {
// We have seen 1 or 2 crashes where we get a headers callback but there is no associated
// stream data. I honestly am not sure how this can happen. However, from reading the nghttp2
// code it looks possible that inflate_header_block() can safely inflate headers for an already
// closed stream, but will still call the headers callback. Since that seems possible, we should
// ignore this case here.
// TODO(mattklein123): Figure out a test case that can hit this.
stats_.headers_cb_no_stream_.inc();
return 0;
}
stream->saveHeader(std::move(name), std::move(value));
if (stream->headers_->byteSize() > max_request_headers_kb_ * 1024) {
// This will cause the library to reset/close the stream.
stats_.header_overflow_.inc();
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
} else {
return 0;
}
} | 102 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::AccessLoggers::HttpGrpc::HttpGrpcAccessLog::emitLog | Envoy::Extensions::AccessLoggers::HttpGrpc::HttpGrpcAccessLog::emitLog( const Http :: HeaderMap & request_headers , const Http :: HeaderMap & response_headers , const Http :: HeaderMap & response_trailers , const StreamInfo :: StreamInfo & stream_info) | ['request_headers', 'response_headers', 'response_trailers', 'stream_info'] | void HttpGrpcAccessLog::emitLog(const Http::HeaderMap& request_headers,
const Http::HeaderMap& response_headers,
const Http::HeaderMap& response_trailers,
const StreamInfo::StreamInfo& stream_info) {
// Common log properties.
// TODO(mattklein123): Populate sample_rate field.
envoy::data::accesslog::v2::HTTPAccessLogEntry log_entry;
GrpcCommon::Utility::extractCommonAccessLogProperties(*log_entry.mutable_common_properties(),
stream_info);
if (stream_info.protocol()) {
switch (stream_info.protocol().value()) {
case Http::Protocol::Http10:
log_entry.set_protocol_version(envoy::data::accesslog::v2::HTTPAccessLogEntry::HTTP10);
break;
case Http::Protocol::Http11:
log_entry.set_protocol_version(envoy::data::accesslog::v2::HTTPAccessLogEntry::HTTP11);
break;
case Http::Protocol::Http2:
log_entry.set_protocol_version(envoy::data::accesslog::v2::HTTPAccessLogEntry::HTTP2);
break;
}
}
// HTTP request properties.
// TODO(mattklein123): Populate port field.
auto* request_properties = log_entry.mutable_request();
if (request_headers.Scheme() != nullptr) {
request_properties->set_scheme(std::string(request_headers.Scheme()->value().getStringView()));
}
if (request_headers.Host() != nullptr) {
request_properties->set_authority(std::string(request_headers.Host()->value().getStringView()));
}
if (request_headers.Path() != nullptr) {
request_properties->set_path(std::string(request_headers.Path()->value().getStringView()));
}
if (request_headers.UserAgent() != nullptr) {
request_properties->set_user_agent(
std::string(request_headers.UserAgent()->value().getStringView()));
}
if (request_headers.Referer() != nullptr) {
request_properties->set_referer(
std::string(request_headers.Referer()->value().getStringView()));
}
if (request_headers.ForwardedFor() != nullptr) {
request_properties->set_forwarded_for(
std::string(request_headers.ForwardedFor()->value().getStringView()));
}
if (request_headers.RequestId() != nullptr) {
request_properties->set_request_id(
std::string(request_headers.RequestId()->value().getStringView()));
}
if (request_headers.EnvoyOriginalPath() != nullptr) {
request_properties->set_original_path(
std::string(request_headers.EnvoyOriginalPath()->value().getStringView()));
}
request_properties->set_request_headers_bytes(request_headers.byteSize());
request_properties->set_request_body_bytes(stream_info.bytesReceived());
if (request_headers.Method() != nullptr) {
envoy::api::v2::core::RequestMethod method =
envoy::api::v2::core::RequestMethod::METHOD_UNSPECIFIED;
envoy::api::v2::core::RequestMethod_Parse(
std::string(request_headers.Method()->value().getStringView()), &method);
request_properties->set_request_method(method);
}
if (!request_headers_to_log_.empty()) {
auto* logged_headers = request_properties->mutable_request_headers();
for (const auto& header : request_headers_to_log_) {
const Http::HeaderEntry* entry = request_headers.get(header);
if (entry != nullptr) {
logged_headers->insert({header.get(), std::string(entry->value().getStringView())});
}
}
}
// HTTP response properties.
auto* response_properties = log_entry.mutable_response();
if (stream_info.responseCode()) {
response_properties->mutable_response_code()->set_value(stream_info.responseCode().value());
}
if (stream_info.responseCodeDetails()) {
response_properties->set_response_code_details(stream_info.responseCodeDetails().value());
}
response_properties->set_response_headers_bytes(response_headers.byteSize());
response_properties->set_response_body_bytes(stream_info.bytesSent());
if (!response_headers_to_log_.empty()) {
auto* logged_headers = response_properties->mutable_response_headers();
for (const auto& header : response_headers_to_log_) {
const Http::HeaderEntry* entry = response_headers.get(header);
if (entry != nullptr) {
logged_headers->insert({header.get(), std::string(entry->value().getStringView())});
}
}
}
if (!response_trailers_to_log_.empty()) {
auto* logged_headers = response_properties->mutable_response_trailers();
for (const auto& header : response_trailers_to_log_) {
const Http::HeaderEntry* entry = response_trailers.get(header);
if (entry != nullptr) {
logged_headers->insert({header.get(), std::string(entry->value().getStringView())});
}
}
}
tls_slot_->getTyped<ThreadLocalLogger>().logger_->log(std::move(log_entry));
} | 911 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::Filters::Common::Expr::RequestWrapper::operator [ ] | Envoy::Extensions::Filters::Common::Expr::RequestWrapper::operator [ ]( CelValue key) const | ['key'] | absl::optional<CelValue> RequestWrapper::operator[](CelValue key) const {
if (!key.IsString()) {
return {};
}
auto value = key.StringOrDie().value();
if (value == Headers) {
return CelValue::CreateMap(&headers_);
} else if (value == Time) {
return CelValue::CreateTimestamp(absl::FromChrono(info_.startTime()));
} else if (value == Size) {
// it is important to make a choice whether to rely on content-length vs stream info
// (which is not available at the time of the request headers)
if (headers_.value_ != nullptr && headers_.value_->ContentLength() != nullptr) {
int64_t length;
if (absl::SimpleAtoi(headers_.value_->ContentLength()->value().getStringView(), &length)) {
return CelValue::CreateInt64(length);
}
} else {
return CelValue::CreateInt64(info_.bytesReceived());
}
} else if (value == Duration) {
auto duration = info_.requestComplete();
if (duration.has_value()) {
return CelValue::CreateDuration(absl::FromChrono(duration.value()));
}
}
if (headers_.value_ != nullptr) {
if (value == Path) {
return convertHeaderEntry(headers_.value_->Path());
} else if (value == UrlPath) {
absl::string_view path = headers_.value_->Path()->value().getStringView();
size_t query_offset = path.find('?');
if (query_offset == absl::string_view::npos) {
return CelValue::CreateString(path);
}
return CelValue::CreateString(path.substr(0, query_offset));
} else if (value == Host) {
return convertHeaderEntry(headers_.value_->Host());
} else if (value == Scheme) {
return convertHeaderEntry(headers_.value_->Scheme());
} else if (value == Method) {
return convertHeaderEntry(headers_.value_->Method());
} else if (value == Referer) {
return convertHeaderEntry(headers_.value_->Referer());
} else if (value == ID) {
return convertHeaderEntry(headers_.value_->RequestId());
} else if (value == UserAgent) {
return convertHeaderEntry(headers_.value_->UserAgent());
} else if (value == TotalSize) {
return CelValue::CreateInt64(info_.bytesReceived() + headers_.value_->byteSize());
}
}
return {};
} | 475 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::TEST_F | Envoy::Http::TEST_F( HttpConnectionManagerImplTest , OverlyLongHeadersAcceptedIfConfigured) | ['HttpConnectionManagerImplTest', 'OverlyLongHeadersAcceptedIfConfigured'] | TEST_F(HttpConnectionManagerImplTest, OverlyLongHeadersAcceptedIfConfigured) {
max_request_headers_kb_ = 62;
setup(false, "");
EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance&) -> void {
StreamDecoder* decoder = &conn_manager_->newStream(response_encoder_);
HeaderMapPtr headers{
new TestHeaderMapImpl{{":authority", "host"}, {":path", "/"}, {":method", "GET"}}};
headers->addCopy(LowerCaseString("Foo"), std::string(60 * 1024, 'a'));
EXPECT_CALL(response_encoder_, encodeHeaders(_, _)).Times(0);
decoder->decodeHeaders(std::move(headers), true);
conn_manager_->newStream(response_encoder_);
}));
Buffer::OwnedImpl fake_input("1234");
conn_manager_->onData(fake_input, false); // kick off request
} | 164 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::TEST_F | Envoy::Http::TEST_F( HttpConnectionManagerImplTest , OverlyLongHeadersRejected) | ['HttpConnectionManagerImplTest', 'OverlyLongHeadersRejected'] | TEST_F(HttpConnectionManagerImplTest, OverlyLongHeadersRejected) {
setup(false, "");
std::string response_code;
std::string response_body;
EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance&) -> void {
StreamDecoder* decoder = &conn_manager_->newStream(response_encoder_);
HeaderMapPtr headers{
new TestHeaderMapImpl{{":authority", "host"}, {":path", "/"}, {":method", "GET"}}};
headers->addCopy(LowerCaseString("Foo"), std::string(60 * 1024, 'a'));
EXPECT_CALL(response_encoder_, encodeHeaders(_, true))
.WillOnce(Invoke([&response_code](const HeaderMap& headers, bool) -> void {
response_code = std::string(headers.Status()->value().getStringView());
}));
decoder->decodeHeaders(std::move(headers), true);
conn_manager_->newStream(response_encoder_);
}));
Buffer::OwnedImpl fake_input("1234");
conn_manager_->onData(fake_input, false); // kick off request
EXPECT_EQ("431", response_code);
EXPECT_EQ("", response_body);
} | 223 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::HeaderMapImplGetByteSize | Envoy::Http::HeaderMapImplGetByteSize( benchmark :: State & state) | ['state'] | static void HeaderMapImplGetByteSize(benchmark::State& state) {
HeaderMapImpl headers;
addDummyHeaders(headers, state.range(0));
uint64_t size = 0;
for (auto _ : state) {
size += headers.byteSize();
}
benchmark::DoNotOptimize(size);
} | 54 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Http::Http2::TEST_P | Envoy::Http::Http2::TEST_P( Http2CodecImplTest , TestLargeRequestHeadersAtLimitAccepted) | ['Http2CodecImplTest', 'TestLargeRequestHeadersAtLimitAccepted'] | TEST_P(Http2CodecImplTest, TestLargeRequestHeadersAtLimitAccepted) {
uint32_t codec_limit_kb = 64;
max_request_headers_kb_ = codec_limit_kb;
initialize();
TestHeaderMapImpl request_headers;
HttpTestUtility::addDefaultHeaders(request_headers);
std::string key = "big";
uint32_t head_room = 77;
uint32_t long_string_length =
codec_limit_kb * 1024 - request_headers.byteSize() - key.length() - head_room;
std::string long_string = std::string(long_string_length, 'q');
request_headers.addCopy(key, long_string);
// The amount of data sent to the codec is not equivalent to the size of the
// request headers that Envoy computes, as the codec limits based on the
// entire http2 frame. The exact head room needed (76) was found through iteration.
ASSERT_EQ(request_headers.byteSize() + head_room, codec_limit_kb * 1024);
EXPECT_CALL(request_decoder_, decodeHeaders_(_, _));
request_encoder_->encodeHeaders(request_headers, true);
} | 123 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::HttpIntegrationTest::sendRequestAndWaitForResponse | Envoy::HttpIntegrationTest::sendRequestAndWaitForResponse( const Http :: TestHeaderMapImpl & request_headers , uint32_t request_body_size , const Http :: TestHeaderMapImpl & response_headers , uint32_t response_size , int upstream_index) | ['request_headers', 'request_body_size', 'response_headers', 'response_size', 'upstream_index'] | IntegrationStreamDecoderPtr HttpIntegrationTest::sendRequestAndWaitForResponse(
const Http::TestHeaderMapImpl& request_headers, uint32_t request_body_size,
const Http::TestHeaderMapImpl& response_headers, uint32_t response_size, int upstream_index) {
ASSERT(codec_client_ != nullptr);
// Send the request to Envoy.
IntegrationStreamDecoderPtr response;
if (request_body_size) {
response = codec_client_->makeRequestWithBody(request_headers, request_body_size);
} else {
response = codec_client_->makeHeaderOnlyRequest(request_headers);
}
waitForNextUpstreamRequest(upstream_index);
// Send response headers, and end_stream if there is no response body.
upstream_request_->encodeHeaders(response_headers, response_size == 0);
// Send any response data, with end_stream true.
if (response_size) {
upstream_request_->encodeData(response_size, true);
}
// Wait for the response to be read by the codec client.
response->waitForEndStream();
return response;
} | 108 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::HttpIntegrationTest::waitForNextUpstreamRequest | Envoy::HttpIntegrationTest::waitForNextUpstreamRequest( const std :: vector<uint64_t> & upstream_indices) | ['upstream_indices'] | HttpIntegrationTest::waitForNextUpstreamRequest(const std::vector<uint64_t>& upstream_indices) {
uint64_t upstream_with_request;
// If there is no upstream connection, wait for it to be established.
if (!fake_upstream_connection_) {
AssertionResult result = AssertionFailure();
for (auto upstream_index : upstream_indices) {
result = fake_upstreams_[upstream_index]->waitForHttpConnection(
*dispatcher_, fake_upstream_connection_, TestUtility::DefaultTimeout,
max_request_headers_kb_);
if (result) {
upstream_with_request = upstream_index;
break;
}
}
RELEASE_ASSERT(result, result.message());
}
// Wait for the next stream on the upstream connection.
AssertionResult result =
fake_upstream_connection_->waitForNewStream(*dispatcher_, upstream_request_);
RELEASE_ASSERT(result, result.message());
// Wait for the stream to be completely received.
result = upstream_request_->waitForEndStream(*dispatcher_);
RELEASE_ASSERT(result, result.message());
return upstream_with_request;
} | 134 | True | 1 |
CVE-2019-15226 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:C | NETWORK | LOW | NONE | NONE | NONE | COMPLETE | 7.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commits/master', 'name': 'https://github.com/envoyproxy/envoy/commits/master', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/issues/8520', 'name': 'https://github.com/envoyproxy/envoy/issues/8520', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'name': 'https://github.com/envoyproxy/envoy/commit/afc39bea36fd436e54262f150c009e8d72db5014', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-400'}]}] | HIGH | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.5.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.6.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.10.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.11.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Upon receiving each incoming request header data, Envoy will iterate over existing request headers to verify that the total size of the headers stays below a maximum limit. The implementation in versions 1.10.0 through 1.11.1 for HTTP/1.x traffic and all versions of Envoy for HTTP/2 traffic had O(n^2) performance characteristics. A remote attacker may craft a request that stays below the maximum request header size but consists of many thousands of small headers to consume CPU and result in a denial-of-service attack.'}] | 2019-10-17T17:03Z | 2019-10-09T16:15Z | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. |
Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
There are at least three distinct scenarios which can commonly lead to resource exhaustion:
Lack of throttling for the number of allocated resources
Losing all references to a resource before reaching the shutdown stage
Not closing/returning a resource after processing
Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
Error conditions and other exceptional circumstances.
Confusion over which part of the program is responsible for releasing the resource.
| https://cwe.mitre.org/data/definitions/400.html | 0 | Asra Ali | 2019-10-07 17:58:39-04:00 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the HeaderMap to sum
the size of each key and value in the HeaderMap.
Signed-off-by: Asra Ali <[email protected]> | afc39bea36fd436e54262f150c009e8d72db5014 | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::HttpIntegrationTest::waitForNextUpstreamRequest | Envoy::HttpIntegrationTest::waitForNextUpstreamRequest( uint64_t upstream_index) | ['upstream_index'] | void HttpIntegrationTest::waitForNextUpstreamRequest(uint64_t upstream_index) {
waitForNextUpstreamRequest(std::vector<uint64_t>({upstream_index}));
} | 24 | True | 1 |
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Improper Authentication | When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct. | https://cwe.mitre.org/data/definitions/287.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::AnyVerifierImpl::onComplete | Envoy::Extensions::HttpFilters::JwtAuthn::AnyVerifierImpl::onComplete( const Status & status , ContextImpl & context) const | ['status', 'context'] | void onComplete(const Status& status, ContextImpl& context) const override {
auto& completion_state = context.getCompletionState(this);
if (completion_state.is_completed_) {
return;
}
// If any of children is OK, return OK
if (Status::Ok == status) {
completion_state.is_completed_ = true;
completeWithStatus(status, context);
return;
}
// Then wait for all children to be done.
if (++completion_state.number_completed_children_ == verifiers_.size()) {
// Aggregate all children status into a final status.
// JwtMissing should be treated differently than other failure status
// since it simply means there is not Jwt token for the required provider.
// If there is a failure status other than JwtMissing in the children,
// it should be used as the final status.
Status final_status = Status::JwtMissed;
for (const auto& it : verifiers_) {
// If a Jwt is extracted from a location not specified by the required provider,
// the authenticator returns JwtUnknownIssuer. It should be treated the same as
// JwtMissed.
Status child_status = context.getCompletionState(it.get()).status_;
if (child_status != Status::JwtMissed && child_status != Status::JwtUnknownIssuer) {
final_status = child_status;
}
}
if (is_allow_missing_or_failed_) {
final_status = Status::Ok;
} else if (is_allow_missing_ && final_status == Status::JwtMissed) {
final_status = Status::Ok;
}
completion_state.is_completed_ = true;
completeWithStatus(final_status, context);
}
} | 174 | True | 1 |
|
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Incorrect Implementation of Authentication Algorithm | The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect. | This incorrect implementation may allow authentication to be bypassed.
| https://cwe.mitre.org/data/definitions/303.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::AnyVerifierImpl::onComplete | Envoy::Extensions::HttpFilters::JwtAuthn::AnyVerifierImpl::onComplete( const Status & status , ContextImpl & context) const | ['status', 'context'] | void onComplete(const Status& status, ContextImpl& context) const override {
auto& completion_state = context.getCompletionState(this);
if (completion_state.is_completed_) {
return;
}
// If any of children is OK, return OK
if (Status::Ok == status) {
completion_state.is_completed_ = true;
completeWithStatus(status, context);
return;
}
// Then wait for all children to be done.
if (++completion_state.number_completed_children_ == verifiers_.size()) {
// Aggregate all children status into a final status.
// JwtMissing should be treated differently than other failure status
// since it simply means there is not Jwt token for the required provider.
// If there is a failure status other than JwtMissing in the children,
// it should be used as the final status.
Status final_status = Status::JwtMissed;
for (const auto& it : verifiers_) {
// If a Jwt is extracted from a location not specified by the required provider,
// the authenticator returns JwtUnknownIssuer. It should be treated the same as
// JwtMissed.
Status child_status = context.getCompletionState(it.get()).status_;
if (child_status != Status::JwtMissed && child_status != Status::JwtUnknownIssuer) {
final_status = child_status;
}
}
if (is_allow_missing_or_failed_) {
final_status = Status::Ok;
} else if (is_allow_missing_ && final_status == Status::JwtMissed) {
final_status = Status::Ok;
}
completion_state.is_completed_ = true;
completeWithStatus(final_status, context);
}
} | 174 | True | 1 |
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Improper Authentication | When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct. | https://cwe.mitre.org/data/definitions/287.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F( AllowMissingInAndOfOrListTest , GoodAndBadJwts) | ['AllowMissingInAndOfOrListTest', 'GoodAndBadJwts'] | TEST_F(AllowMissingInAndOfOrListTest, GoodAndBadJwts) {
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
// Use the token with example.com issuer for x-other.
auto headers =
Http::TestRequestHeaderMapImpl{{kExampleHeader, GoodToken}, {kOtherHeader, GoodToken}};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
EXPECT_THAT(headers, JwtOutputSuccess(kExampleHeader));
EXPECT_THAT(headers, JwtOutputFailedOrIgnore(kOtherHeader));
} | 81 | True | 1 |
|
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Incorrect Implementation of Authentication Algorithm | The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect. | This incorrect implementation may allow authentication to be bypassed.
| https://cwe.mitre.org/data/definitions/303.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F( AllowMissingInAndOfOrListTest , GoodAndBadJwts) | ['AllowMissingInAndOfOrListTest', 'GoodAndBadJwts'] | TEST_F(AllowMissingInAndOfOrListTest, GoodAndBadJwts) {
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
// Use the token with example.com issuer for x-other.
auto headers =
Http::TestRequestHeaderMapImpl{{kExampleHeader, GoodToken}, {kOtherHeader, GoodToken}};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
EXPECT_THAT(headers, JwtOutputSuccess(kExampleHeader));
EXPECT_THAT(headers, JwtOutputFailedOrIgnore(kOtherHeader));
} | 81 | True | 1 |
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Improper Authentication | When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct. | https://cwe.mitre.org/data/definitions/287.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F( SingleAllowMissingInOrListTest , MissingIssToken) | ['SingleAllowMissingInOrListTest', 'MissingIssToken'] | TEST_F(SingleAllowMissingInOrListTest, MissingIssToken) {
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
auto headers = Http::TestRequestHeaderMapImpl{{kExampleHeader, ES256WithoutIssToken}};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
EXPECT_THAT(headers, JwtOutputFailedOrIgnore(kExampleHeader));
} | 65 | True | 1 |
|
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Incorrect Implementation of Authentication Algorithm | The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect. | This incorrect implementation may allow authentication to be bypassed.
| https://cwe.mitre.org/data/definitions/303.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F( SingleAllowMissingInOrListTest , MissingIssToken) | ['SingleAllowMissingInOrListTest', 'MissingIssToken'] | TEST_F(SingleAllowMissingInOrListTest, MissingIssToken) {
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
auto headers = Http::TestRequestHeaderMapImpl{{kExampleHeader, ES256WithoutIssToken}};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
EXPECT_THAT(headers, JwtOutputFailedOrIgnore(kExampleHeader));
} | 65 | True | 1 |
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Improper Authentication | When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct. | https://cwe.mitre.org/data/definitions/287.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F( GroupVerifierTest , TestRequiresAnyWithAllowMissingButOk) | ['GroupVerifierTest', 'TestRequiresAnyWithAllowMissingButOk'] | TEST_F(GroupVerifierTest, TestRequiresAnyWithAllowMissingButOk) {
TestUtility::loadFromYaml(RequiresAnyConfig, proto_config_);
proto_config_.mutable_rules(0)
->mutable_requires()
->mutable_requires_any()
->add_requirements()
->mutable_allow_missing();
createAsyncMockAuthsAndVerifier(std::vector<std::string>{"example_provider", "other_provider"});
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
auto headers = Http::TestRequestHeaderMapImpl{};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
callbacks_["example_provider"](Status::JwtMissed);
callbacks_["other_provider"](Status::JwtUnknownIssuer);
} | 119 | True | 1 |
|
CVE-2021-21378 | 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:L/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | HIGH | LOW | NONE | 8.2 | HIGH | 3.9 | 4.2 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'name': 'https://github.com/envoyproxy/envoy/commit/ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-4996-m8hf-hj27', 'refsource': 'CONFIRM', 'tags': ['Mitigation', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/pull/15194', 'name': 'https://github.com/envoyproxy/envoy/pull/15194', 'refsource': 'MISC', 'tags': ['Patch']}] | [{'description': [{'lang': 'en', 'value': 'CWE-287'}, {'lang': 'en', 'value': 'CWE-303'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:1.17.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing."}] | 2021-03-24T12:59Z | 2021-03-11T03:15Z | Incorrect Implementation of Authentication Algorithm | The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect. | This incorrect implementation may allow authentication to be bypassed.
| https://cwe.mitre.org/data/definitions/303.html | 0 | Wayne Zhang | 2021-02-25 16:49:10-08:00 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving JwtUnknownIssuer in allow_missing case.
Signed-off-by: Wayne Zhang <[email protected]> | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F | Envoy::Extensions::HttpFilters::JwtAuthn::TEST_F( GroupVerifierTest , TestRequiresAnyWithAllowMissingButOk) | ['GroupVerifierTest', 'TestRequiresAnyWithAllowMissingButOk'] | TEST_F(GroupVerifierTest, TestRequiresAnyWithAllowMissingButOk) {
TestUtility::loadFromYaml(RequiresAnyConfig, proto_config_);
proto_config_.mutable_rules(0)
->mutable_requires()
->mutable_requires_any()
->add_requirements()
->mutable_allow_missing();
createAsyncMockAuthsAndVerifier(std::vector<std::string>{"example_provider", "other_provider"});
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
auto headers = Http::TestRequestHeaderMapImpl{};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
callbacks_["example_provider"](Status::JwtMissed);
callbacks_["other_provider"](Status::JwtUnknownIssuer);
} | 119 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Ssl::CertificateValidationContextConfigImpl::CertificateValidationContextConfigImpl | Envoy::Ssl::CertificateValidationContextConfigImpl::CertificateValidationContextConfigImpl( const envoy :: extensions :: transport_sockets :: tls :: v3 :: CertificateValidationContext & config , Api :: Api & api) | ['config', 'api'] | CertificateValidationContextConfigImpl::CertificateValidationContextConfigImpl(
const envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext& config,
Api::Api& api)
: ca_cert_(Config::DataSource::read(config.trusted_ca(), true, api)),
ca_cert_path_(Config::DataSource::getPath(config.trusted_ca())
.value_or(ca_cert_.empty() ? EMPTY_STRING : INLINE_STRING)),
certificate_revocation_list_(Config::DataSource::read(config.crl(), true, api)),
certificate_revocation_list_path_(
Config::DataSource::getPath(config.crl())
.value_or(certificate_revocation_list_.empty() ? EMPTY_STRING : INLINE_STRING)),
subject_alt_name_matchers_(config.match_subject_alt_names().begin(),
config.match_subject_alt_names().end()),
verify_certificate_hash_list_(config.verify_certificate_hash().begin(),
config.verify_certificate_hash().end()),
verify_certificate_spki_list_(config.verify_certificate_spki().begin(),
config.verify_certificate_spki().end()),
allow_expired_certificate_(config.allow_expired_certificate()),
trust_chain_verification_(config.trust_chain_verification()),
custom_validator_config_(
config.has_custom_validator_config()
? absl::make_optional<envoy::config::core::v3::TypedExtensionConfig>(
config.custom_validator_config())
: absl::nullopt),
api_(api), only_verify_leaf_cert_crl_(config.only_verify_leaf_cert_crl()) {
if (ca_cert_.empty() && custom_validator_config_ == absl::nullopt) {
if (!certificate_revocation_list_.empty()) {
throw EnvoyException(fmt::format("Failed to load CRL from {} without trusted CA",
certificateRevocationListPath()));
}
if (!subject_alt_name_matchers_.empty()) {
throw EnvoyException("SAN-based verification of peer certificates without "
"trusted CA is insecure and not allowed");
}
if (allow_expired_certificate_) {
throw EnvoyException("Certificate validity period is always ignored without trusted CA");
}
}
} | 333 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::doVerifyCertChain | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::doVerifyCertChain( X509_STORE_CTX * store_ctx , Ssl :: SslExtendedSocketInfo * ssl_extended_info , X509 & leaf_cert , const Network :: TransportSocketOptions * transport_socket_options) | ['store_ctx', 'ssl_extended_info', 'leaf_cert', 'transport_socket_options'] | int DefaultCertValidator::doVerifyCertChain(
X509_STORE_CTX* store_ctx, Ssl::SslExtendedSocketInfo* ssl_extended_info, X509& leaf_cert,
const Network::TransportSocketOptions* transport_socket_options) {
if (verify_trusted_ca_) {
int ret = X509_verify_cert(store_ctx);
if (ssl_extended_info) {
ssl_extended_info->setCertificateValidationStatus(
ret == 1 ? Envoy::Ssl::ClientValidationStatus::Validated
: Envoy::Ssl::ClientValidationStatus::Failed);
}
if (ret <= 0) {
stats_.fail_verify_error_.inc();
ENVOY_LOG(debug, "{}", Utility::getX509VerificationErrorInfo(store_ctx));
return allow_untrusted_certificate_ ? 1 : ret;
}
}
Envoy::Ssl::ClientValidationStatus validated =
verifyCertificate(&leaf_cert,
transport_socket_options != nullptr
? transport_socket_options->verifySubjectAltNameListOverride()
: std::vector<std::string>{},
subject_alt_name_matchers_);
if (ssl_extended_info) {
if (ssl_extended_info->certificateValidationStatus() ==
Envoy::Ssl::ClientValidationStatus::NotValidated) {
ssl_extended_info->setCertificateValidationStatus(validated);
} else if (validated != Envoy::Ssl::ClientValidationStatus::NotValidated) {
ssl_extended_info->setCertificateValidationStatus(validated);
}
}
// If `trusted_ca` exists, it is already verified in the code above. Thus, we just need to make
// sure the verification for other validation context configurations doesn't fail (i.e. either
// `NotValidated` or `Validated`). If `trusted_ca` doesn't exist, we will need to make sure other
// configurations are verified and the verification succeed.
int validation_status = verify_trusted_ca_
? validated != Envoy::Ssl::ClientValidationStatus::Failed
: validated == Envoy::Ssl::ClientValidationStatus::Validated;
return allow_untrusted_certificate_ ? 1 : validation_status;
} | 230 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::initializeSslContexts | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::initializeSslContexts( std :: vector<SSL_CTX*> contexts , bool provides_certificates) | ['contexts', 'provides_certificates'] | int DefaultCertValidator::initializeSslContexts(std::vector<SSL_CTX*> contexts,
bool provides_certificates) {
int verify_mode = SSL_VERIFY_NONE;
int verify_mode_validation_context = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
if (config_ != nullptr) {
envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext::
TrustChainVerification verification = config_->trustChainVerification();
if (verification == envoy::extensions::transport_sockets::tls::v3::
CertificateValidationContext::ACCEPT_UNTRUSTED) {
verify_mode = SSL_VERIFY_PEER; // Ensure client-certs will be requested even if we have
// nothing to verify against
verify_mode_validation_context = SSL_VERIFY_PEER;
}
}
if (config_ != nullptr && !config_->caCert().empty() && !provides_certificates) {
ca_file_path_ = config_->caCertPath();
bssl::UniquePtr<BIO> bio(
BIO_new_mem_buf(const_cast<char*>(config_->caCert().data()), config_->caCert().size()));
RELEASE_ASSERT(bio != nullptr, "");
// Based on BoringSSL's X509_load_cert_crl_file().
bssl::UniquePtr<STACK_OF(X509_INFO)> list(
PEM_X509_INFO_read_bio(bio.get(), nullptr, nullptr, nullptr));
if (list == nullptr) {
throw EnvoyException(
absl::StrCat("Failed to load trusted CA certificates from ", config_->caCertPath()));
}
for (auto& ctx : contexts) {
X509_STORE* store = SSL_CTX_get_cert_store(ctx);
bool has_crl = false;
for (const X509_INFO* item : list.get()) {
if (item->x509) {
X509_STORE_add_cert(store, item->x509);
if (ca_cert_ == nullptr) {
X509_up_ref(item->x509);
ca_cert_.reset(item->x509);
}
}
if (item->crl) {
X509_STORE_add_crl(store, item->crl);
has_crl = true;
}
}
if (ca_cert_ == nullptr) {
throw EnvoyException(
absl::StrCat("Failed to load trusted CA certificates from ", config_->caCertPath()));
}
if (has_crl) {
X509_STORE_set_flags(store, config_->onlyVerifyLeafCertificateCrl()
? X509_V_FLAG_CRL_CHECK
: X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
}
verify_mode = SSL_VERIFY_PEER;
verify_trusted_ca_ = true;
// NOTE: We're using SSL_CTX_set_cert_verify_callback() instead of X509_verify_cert()
// directly. However, our new callback is still calling X509_verify_cert() under
// the hood. Therefore, to ignore cert expiration, we need to set the callback
// for X509_verify_cert to ignore that error.
if (config_->allowExpiredCertificate()) {
X509_STORE_set_verify_cb(store, CertValidatorUtil::ignoreCertificateExpirationCallback);
}
}
}
if (config_ != nullptr && !config_->certificateRevocationList().empty()) {
bssl::UniquePtr<BIO> bio(
BIO_new_mem_buf(const_cast<char*>(config_->certificateRevocationList().data()),
config_->certificateRevocationList().size()));
RELEASE_ASSERT(bio != nullptr, "");
// Based on BoringSSL's X509_load_cert_crl_file().
bssl::UniquePtr<STACK_OF(X509_INFO)> list(
PEM_X509_INFO_read_bio(bio.get(), nullptr, nullptr, nullptr));
if (list == nullptr) {
throw EnvoyException(
absl::StrCat("Failed to load CRL from ", config_->certificateRevocationListPath()));
}
for (auto& ctx : contexts) {
X509_STORE* store = SSL_CTX_get_cert_store(ctx);
for (const X509_INFO* item : list.get()) {
if (item->crl) {
X509_STORE_add_crl(store, item->crl);
}
}
X509_STORE_set_flags(store, config_->onlyVerifyLeafCertificateCrl()
? X509_V_FLAG_CRL_CHECK
: X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
}
}
const Envoy::Ssl::CertificateValidationContextConfig* cert_validation_config = config_;
if (cert_validation_config != nullptr) {
if (!cert_validation_config->subjectAltNameMatchers().empty()) {
for (const envoy::type::matcher::v3::StringMatcher& matcher :
cert_validation_config->subjectAltNameMatchers()) {
subject_alt_name_matchers_.push_back(Matchers::StringMatcherImpl(matcher));
}
verify_mode = verify_mode_validation_context;
}
if (!cert_validation_config->verifyCertificateHashList().empty()) {
for (auto hash : cert_validation_config->verifyCertificateHashList()) {
// Remove colons from the 95 chars long colon-separated "fingerprint"
// in order to get the hex-encoded string.
if (hash.size() == 95) {
hash.erase(std::remove(hash.begin(), hash.end(), ':'), hash.end());
}
const auto& decoded = Hex::decode(hash);
if (decoded.size() != SHA256_DIGEST_LENGTH) {
throw EnvoyException(absl::StrCat("Invalid hex-encoded SHA-256 ", hash));
}
verify_certificate_hash_list_.push_back(decoded);
}
verify_mode = verify_mode_validation_context;
}
if (!cert_validation_config->verifyCertificateSpkiList().empty()) {
for (const auto& hash : cert_validation_config->verifyCertificateSpkiList()) {
const auto decoded = Base64::decode(hash);
if (decoded.size() != SHA256_DIGEST_LENGTH) {
throw EnvoyException(absl::StrCat("Invalid base64-encoded SHA-256 ", hash));
}
verify_certificate_spki_list_.emplace_back(decoded.begin(), decoded.end());
}
verify_mode = verify_mode_validation_context;
}
}
return verify_mode;
} | 861 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::matchSubjectAltName | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::matchSubjectAltName( X509 * cert , const std :: vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>> & subject_alt_name_matchers) | ['cert', 'subject_alt_name_matchers'] | bool DefaultCertValidator::matchSubjectAltName(
X509* cert,
const std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>&
subject_alt_name_matchers) {
bssl::UniquePtr<GENERAL_NAMES> san_names(
static_cast<GENERAL_NAMES*>(X509_get_ext_d2i(cert, NID_subject_alt_name, nullptr, nullptr)));
if (san_names == nullptr) {
return false;
}
for (const GENERAL_NAME* general_name : san_names.get()) {
const std::string san = Utility::generalNameAsString(general_name);
for (auto& config_san_matcher : subject_alt_name_matchers) {
// For DNS SAN, if the StringMatcher type is exact, we have to follow DNS matching semantics.
if (general_name->type == GEN_DNS &&
config_san_matcher.matcher().match_pattern_case() ==
envoy::type::matcher::v3::StringMatcher::MatchPatternCase::kExact
? Utility::dnsNameMatch(config_san_matcher.matcher().exact(), absl::string_view(san))
: config_san_matcher.match(san)) {
return true;
}
}
}
return false;
} | 178 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::verifyCertificate | Envoy::Extensions::TransportSockets::Tls::DefaultCertValidator::verifyCertificate( X509 * cert , const std :: vector<std::string> & verify_san_list , const std :: vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>> & subject_alt_name_matchers) | ['cert', 'verify_san_list', 'subject_alt_name_matchers'] | Envoy::Ssl::ClientValidationStatus DefaultCertValidator::verifyCertificate(
X509* cert, const std::vector<std::string>& verify_san_list,
const std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>&
subject_alt_name_matchers) {
Envoy::Ssl::ClientValidationStatus validated = Envoy::Ssl::ClientValidationStatus::NotValidated;
if (!verify_san_list.empty()) {
if (!verifySubjectAltName(cert, verify_san_list)) {
stats_.fail_verify_san_.inc();
return Envoy::Ssl::ClientValidationStatus::Failed;
}
validated = Envoy::Ssl::ClientValidationStatus::Validated;
}
if (!subject_alt_name_matchers.empty()) {
if (!matchSubjectAltName(cert, subject_alt_name_matchers)) {
stats_.fail_verify_san_.inc();
return Envoy::Ssl::ClientValidationStatus::Failed;
}
validated = Envoy::Ssl::ClientValidationStatus::Validated;
}
if (!verify_certificate_hash_list_.empty() || !verify_certificate_spki_list_.empty()) {
const bool valid_certificate_hash =
!verify_certificate_hash_list_.empty() &&
verifyCertificateHashList(cert, verify_certificate_hash_list_);
const bool valid_certificate_spki =
!verify_certificate_spki_list_.empty() &&
verifyCertificateSpkiList(cert, verify_certificate_spki_list_);
if (!valid_certificate_hash && !valid_certificate_spki) {
stats_.fail_verify_cert_hash_.inc();
return Envoy::Ssl::ClientValidationStatus::Failed;
}
validated = Envoy::Ssl::ClientValidationStatus::Validated;
}
return validated;
} | 254 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::SPIFFEValidator::SPIFFEValidator | Envoy::Extensions::TransportSockets::Tls::SPIFFEValidator::SPIFFEValidator( const Envoy :: Ssl :: CertificateValidationContextConfig * config , SslStats & stats , TimeSource & time_source) | ['config', 'stats', 'time_source'] | SPIFFEValidator::SPIFFEValidator(const Envoy::Ssl::CertificateValidationContextConfig* config,
SslStats& stats, TimeSource& time_source)
: stats_(stats), time_source_(time_source) {
ASSERT(config != nullptr);
allow_expired_certificate_ = config->allowExpiredCertificate();
SPIFFEConfig message;
Config::Utility::translateOpaqueConfig(config->customValidatorConfig().value().typed_config(),
ProtobufMessage::getStrictValidationVisitor(), message);
if (!config->subjectAltNameMatchers().empty()) {
for (const auto& matcher : config->subjectAltNameMatchers()) {
subject_alt_name_matchers_.push_back(Matchers::StringMatcherImpl(matcher));
}
}
const auto size = message.trust_domains().size();
trust_bundle_stores_.reserve(size);
for (auto& domain : message.trust_domains()) {
if (trust_bundle_stores_.find(domain.name()) != trust_bundle_stores_.end()) {
throw EnvoyException(absl::StrCat(
"Multiple trust bundles are given for one trust domain for ", domain.name()));
}
auto cert = Config::DataSource::read(domain.trust_bundle(), true, config->api());
bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(const_cast<char*>(cert.data()), cert.size()));
RELEASE_ASSERT(bio != nullptr, "");
bssl::UniquePtr<STACK_OF(X509_INFO)> list(
PEM_X509_INFO_read_bio(bio.get(), nullptr, nullptr, nullptr));
if (list == nullptr || sk_X509_INFO_num(list.get()) == 0) {
throw EnvoyException(
absl::StrCat("Failed to load trusted CA certificate for ", domain.name()));
}
auto store = X509StorePtr(X509_STORE_new());
bool has_crl = false;
bool ca_loaded = false;
for (const X509_INFO* item : list.get()) {
if (item->x509) {
X509_STORE_add_cert(store.get(), item->x509);
ca_certs_.push_back(bssl::UniquePtr<X509>(item->x509));
X509_up_ref(item->x509);
if (!ca_loaded) {
// TODO: With the current interface, we cannot return the multiple
// cert information on getCaCertInformation method.
// So temporarily we return the first CA's info here.
ca_loaded = true;
ca_file_name_ = absl::StrCat(domain.name(), ": ",
domain.trust_bundle().filename().empty()
? "<inline>"
: domain.trust_bundle().filename());
}
}
if (item->crl) {
has_crl = true;
X509_STORE_add_crl(store.get(), item->crl);
}
}
if (has_crl) {
X509_STORE_set_flags(store.get(), X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
}
trust_bundle_stores_[domain.name()] = std::move(store);
}
} | 514 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::SPIFFEValidator::matchSubjectAltName | Envoy::Extensions::TransportSockets::Tls::SPIFFEValidator::matchSubjectAltName( X509 & leaf_cert) | ['leaf_cert'] | bool SPIFFEValidator::matchSubjectAltName(X509& leaf_cert) {
bssl::UniquePtr<GENERAL_NAMES> san_names(static_cast<GENERAL_NAMES*>(
X509_get_ext_d2i(&leaf_cert, NID_subject_alt_name, nullptr, nullptr)));
// We must not have san_names == nullptr here because this function is called after the
// SPIFFE cert validation algorithm succeeded, which requires exactly one URI SAN in the leaf
// cert.
ASSERT(san_names != nullptr,
"san_names should have at least one name after SPIFFE cert validation");
// Only match against URI SAN since SPIFFE specification does not restrict values in other SAN
// types. See the discussion: https://github.com/envoyproxy/envoy/issues/15392
for (const GENERAL_NAME* general_name : san_names.get()) {
if (general_name->type == GEN_URI) {
const std::string san = Utility::generalNameAsString(general_name);
for (const auto& config_san_matcher : subject_alt_name_matchers_) {
if (config_san_matcher.match(san)) {
return true;
}
}
}
}
return false;
} | 113 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Quic::SignatureVerifier::SignatureVerifier | Envoy::Quic::SignatureVerifier::SignatureVerifier() | [] | SignatureVerifier() {
ON_CALL(client_context_config_, cipherSuites)
.WillByDefault(ReturnRef(
Extensions::TransportSockets::Tls::ClientContextConfigImpl::DEFAULT_CIPHER_SUITES));
ON_CALL(client_context_config_, ecdhCurves)
.WillByDefault(
ReturnRef(Extensions::TransportSockets::Tls::ClientContextConfigImpl::DEFAULT_CURVES));
const std::string alpn("h2,http/1.1");
ON_CALL(client_context_config_, alpnProtocols()).WillByDefault(ReturnRef(alpn));
const std::string empty_string;
ON_CALL(client_context_config_, serverNameIndication()).WillByDefault(ReturnRef(empty_string));
ON_CALL(client_context_config_, signingAlgorithmsForTest())
.WillByDefault(ReturnRef(empty_string));
ON_CALL(client_context_config_, certificateValidationContext())
.WillByDefault(Return(&cert_validation_ctx_config_));
// Getting the last cert in the chain as the root CA cert.
std::string cert_chain(quic::test::kTestCertificateChainPem);
const std::string& root_ca_cert =
cert_chain.substr(cert_chain.rfind("-----BEGIN CERTIFICATE-----"));
const std::string path_string("some_path");
ON_CALL(cert_validation_ctx_config_, caCert()).WillByDefault(ReturnRef(root_ca_cert));
ON_CALL(cert_validation_ctx_config_, caCertPath()).WillByDefault(ReturnRef(path_string));
ON_CALL(cert_validation_ctx_config_, trustChainVerification)
.WillByDefault(Return(envoy::extensions::transport_sockets::tls::v3::
CertificateValidationContext::VERIFY_TRUST_CHAIN));
ON_CALL(cert_validation_ctx_config_, allowExpiredCertificate()).WillByDefault(Return(true));
const std::string crl_list;
ON_CALL(cert_validation_ctx_config_, certificateRevocationList())
.WillByDefault(ReturnRef(crl_list));
ON_CALL(cert_validation_ctx_config_, certificateRevocationListPath())
.WillByDefault(ReturnRef(path_string));
const std::vector<std::string> empty_string_list;
const std::vector<envoy::type::matcher::v3::StringMatcher> san_matchers;
ON_CALL(cert_validation_ctx_config_, subjectAltNameMatchers())
.WillByDefault(ReturnRef(san_matchers));
ON_CALL(cert_validation_ctx_config_, verifyCertificateHashList())
.WillByDefault(ReturnRef(empty_string_list));
ON_CALL(cert_validation_ctx_config_, verifyCertificateSpkiList())
.WillByDefault(ReturnRef(empty_string_list));
const absl::optional<envoy::config::core::v3::TypedExtensionConfig> nullopt = absl::nullopt;
ON_CALL(cert_validation_ctx_config_, customValidatorConfig()).WillByDefault(ReturnRef(nullopt));
auto context = std::make_shared<Extensions::TransportSockets::Tls::ClientContextImpl>(
store_, client_context_config_, time_system_);
verifier_ = std::make_unique<EnvoyQuicProofVerifier>(std::move(context));
} | 450 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Secret::TEST_F | Envoy::Secret::TEST_F( SdsApiTest , DefaultCertificateValidationContextTest) | ['SdsApiTest', 'DefaultCertificateValidationContextTest'] | TEST_F(SdsApiTest, DefaultCertificateValidationContextTest) {
envoy::config::core::v3::ConfigSource config_source;
setupMocks();
CertificateValidationContextSdsApi sds_api(
config_source, "abc.com", subscription_factory_, time_system_, validation_visitor_, stats_,
[]() {}, *dispatcher_, *api_);
init_manager_.add(*sds_api.initTarget());
NiceMock<Secret::MockSecretCallbacks> secret_callback;
auto handle =
sds_api.addUpdateCallback([&secret_callback]() { secret_callback.onAddOrUpdateSecret(); });
NiceMock<MockCvcValidationCallback> validation_callback;
auto validation_handle = sds_api.addValidationCallback(
[&validation_callback](
const envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext& cvc) {
validation_callback.validateCvc(cvc);
});
envoy::extensions::transport_sockets::tls::v3::Secret typed_secret;
typed_secret.set_name("abc.com");
auto* dynamic_cvc = typed_secret.mutable_validation_context();
dynamic_cvc->set_allow_expired_certificate(false);
dynamic_cvc->mutable_trusted_ca()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"));
dynamic_cvc->add_match_subject_alt_names()->set_exact("second san");
const std::string dynamic_verify_certificate_spki =
"QGJRPdmx/r5EGOFLb2MTiZp2isyC0Whht7iazhzXaCM=";
dynamic_cvc->add_verify_certificate_spki(dynamic_verify_certificate_spki);
EXPECT_CALL(secret_callback, onAddOrUpdateSecret());
EXPECT_CALL(validation_callback, validateCvc(_));
const auto decoded_resources = TestUtility::decodeResources({typed_secret});
initialize();
subscription_factory_.callbacks_->onConfigUpdate(decoded_resources.refvec_, "");
const std::string default_verify_certificate_hash =
"0000000000000000000000000000000000000000000000000000000000000000";
envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext default_cvc;
default_cvc.set_allow_expired_certificate(true);
default_cvc.mutable_trusted_ca()->set_inline_bytes("fake trusted ca");
default_cvc.add_match_subject_alt_names()->set_exact("first san");
default_cvc.add_verify_certificate_hash(default_verify_certificate_hash);
envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext merged_cvc =
default_cvc;
merged_cvc.MergeFrom(*sds_api.secret());
Ssl::CertificateValidationContextConfigImpl cvc_config(merged_cvc, *api_);
// Verify that merging CertificateValidationContext applies logical OR to bool
// field.
EXPECT_TRUE(cvc_config.allowExpiredCertificate());
// Verify that singular fields are overwritten.
const std::string ca_cert =
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(ca_cert)),
cvc_config.caCert());
// Verify that repeated fields are concatenated.
EXPECT_EQ(2, cvc_config.subjectAltNameMatchers().size());
EXPECT_EQ("first san", cvc_config.subjectAltNameMatchers()[0].exact());
EXPECT_EQ("second san", cvc_config.subjectAltNameMatchers()[1].exact());
// Verify that if dynamic CertificateValidationContext does not set certificate hash list, the new
// secret contains hash list from default CertificateValidationContext.
EXPECT_EQ(1, cvc_config.verifyCertificateHashList().size());
EXPECT_EQ(default_verify_certificate_hash, cvc_config.verifyCertificateHashList()[0]);
// Verify that if default CertificateValidationContext does not set certificate SPKI list, the new
// secret contains SPKI list from dynamic CertificateValidationContext.
EXPECT_EQ(1, cvc_config.verifyCertificateSpkiList().size());
EXPECT_EQ(dynamic_verify_certificate_spki, cvc_config.verifyCertificateSpkiList()[0]);
} | 509 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Upstream::TEST_F | Envoy::Upstream::TEST_F( ClusterInfoImplTest , Http3) | ['ClusterInfoImplTest', 'Http3'] | TEST_F(ClusterInfoImplTest, Http3) {
const std::string yaml = TestEnvironment::substitute(R"EOF(
name: name
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: MAGLEV
load_assignment:
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: foo.bar.com
port_value: 443
transport_socket:
name: envoy.transport_sockets.quic
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.quic.v3.QuicUpstreamTransport
upstream_tls_context:
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
- exact: localhost
- exact: 127.0.0.1
)EOF",
Network::Address::IpVersion::v4);
auto cluster1 = makeCluster(yaml);
ASSERT_TRUE(cluster1->info()->idleTimeout().has_value());
EXPECT_EQ(std::chrono::hours(1), cluster1->info()->idleTimeout().value());
const std::string explicit_http3 = R"EOF(
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http3_protocol_options:
quic_protocol_options:
max_concurrent_streams: 2
common_http_protocol_options:
idle_timeout: 1s
)EOF";
const std::string downstream_http3 = R"EOF(
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
use_downstream_protocol_config:
http3_protocol_options: {}
common_http_protocol_options:
idle_timeout: 1s
)EOF";
auto explicit_h3 = makeCluster(yaml + explicit_http3);
EXPECT_EQ(Http::Protocol::Http3,
explicit_h3->info()->upstreamHttpProtocol({Http::Protocol::Http10})[0]);
EXPECT_EQ(
explicit_h3->info()->http3Options().quic_protocol_options().max_concurrent_streams().value(),
2);
auto downstream_h3 = makeCluster(yaml + downstream_http3);
EXPECT_EQ(Http::Protocol::Http3,
downstream_h3->info()->upstreamHttpProtocol({Http::Protocol::Http3})[0]);
EXPECT_FALSE(
downstream_h3->info()->http3Options().quic_protocol_options().has_max_concurrent_streams());
} | 294 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Upstream::TEST_F | Envoy::Upstream::TEST_F( ClusterInfoImplTest , Http3Auto) | ['ClusterInfoImplTest', 'Http3Auto'] | TEST_F(ClusterInfoImplTest, Http3Auto) {
const std::string yaml = TestEnvironment::substitute(R"EOF(
name: name
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: MAGLEV
load_assignment:
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: foo.bar.com
port_value: 443
transport_socket:
name: envoy.transport_sockets.quic
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.quic.v3.QuicUpstreamTransport
upstream_tls_context:
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
- exact: localhost
- exact: 127.0.0.1
)EOF",
Network::Address::IpVersion::v4);
auto cluster1 = makeCluster(yaml);
ASSERT_TRUE(cluster1->info()->idleTimeout().has_value());
EXPECT_EQ(std::chrono::hours(1), cluster1->info()->idleTimeout().value());
const std::string auto_http3 = R"EOF(
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
auto_config:
http3_protocol_options:
quic_protocol_options:
max_concurrent_streams: 2
alternate_protocols_cache_options:
name: default
common_http_protocol_options:
idle_timeout: 1s
)EOF";
auto auto_h3 = makeCluster(yaml + auto_http3);
EXPECT_EQ(Http::Protocol::Http3,
auto_h3->info()->upstreamHttpProtocol({Http::Protocol::Http10})[0]);
EXPECT_EQ(
auto_h3->info()->http3Options().quic_protocol_options().max_concurrent_streams().value(), 2);
} | 222 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Upstream::TEST_F | Envoy::Upstream::TEST_F( ClusterInfoImplTest , Http3BadConfig) | ['ClusterInfoImplTest', 'Http3BadConfig'] | TEST_F(ClusterInfoImplTest, Http3BadConfig) {
const std::string yaml = TestEnvironment::substitute(R"EOF(
name: name
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: MAGLEV
load_assignment:
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: foo.bar.com
port_value: 443
transport_socket:
name: envoy.transport_sockets.not_quic
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.quic.v3.QuicUpstreamTransport
upstream_tls_context:
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
- exact: localhost
- exact: 127.0.0.1
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
use_downstream_protocol_config:
http3_protocol_options: {}
common_http_protocol_options:
idle_timeout: 1s
)EOF",
Network::Address::IpVersion::v4);
EXPECT_THROW_WITH_REGEX(makeCluster(yaml), EnvoyException,
"HTTP3 requires a QuicUpstreamTransport transport socket: name.*");
} | 108 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Upstream::TEST_F | Envoy::Upstream::TEST_F( ClusterInfoImplTest , UseDownstreamHttpProtocolWithoutDowngrade) | ['ClusterInfoImplTest', 'UseDownstreamHttpProtocolWithoutDowngrade'] | TEST_F(ClusterInfoImplTest, UseDownstreamHttpProtocolWithoutDowngrade) {
const std::string yaml = TestEnvironment::substitute(R"EOF(
name: name
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: MAGLEV
load_assignment:
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: foo.bar.com
port_value: 443
transport_socket:
name: envoy.transport_sockets.quic
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.quic.v3.QuicUpstreamTransport
upstream_tls_context:
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
- exact: localhost
- exact: 127.0.0.1
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
use_downstream_protocol_config:
http3_protocol_options: {}
common_http_protocol_options:
idle_timeout: 1s
)EOF",
Network::Address::IpVersion::v4);
auto cluster = makeCluster(yaml);
EXPECT_EQ(Http::Protocol::Http10,
cluster->info()->upstreamHttpProtocol({Http::Protocol::Http10})[0]);
EXPECT_EQ(Http::Protocol::Http11,
cluster->info()->upstreamHttpProtocol({Http::Protocol::Http11})[0]);
EXPECT_EQ(Http::Protocol::Http2,
cluster->info()->upstreamHttpProtocol({Http::Protocol::Http2})[0]);
EXPECT_EQ(Http::Protocol::Http3,
cluster->info()->upstreamHttpProtocol({Http::Protocol::Http3})[0]);
} | 220 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::ConfigHelper::initializeTls | Envoy::ConfigHelper::initializeTls( const ServerSslOptions & options , envoy :: extensions :: transport_sockets :: tls :: v3 :: CommonTlsContext & common_tls_context) | ['options', 'common_tls_context'] | void ConfigHelper::initializeTls(
const ServerSslOptions& options,
envoy::extensions::transport_sockets::tls::v3::CommonTlsContext& common_tls_context) {
common_tls_context.add_alpn_protocols(Http::Utility::AlpnNames::get().Http2);
common_tls_context.add_alpn_protocols(Http::Utility::AlpnNames::get().Http11);
auto* validation_context = common_tls_context.mutable_validation_context();
if (options.custom_validator_config_) {
validation_context->set_allocated_custom_validator_config(options.custom_validator_config_);
} else {
validation_context->mutable_trusted_ca()->set_filename(
TestEnvironment::runfilesPath("test/config/integration/certs/cacert.pem"));
validation_context->add_verify_certificate_hash(
options.expect_client_ecdsa_cert_ ? TEST_CLIENT_ECDSA_CERT_HASH : TEST_CLIENT_CERT_HASH);
}
validation_context->set_allow_expired_certificate(options.allow_expired_certificate_);
// We'll negotiate up to TLSv1.3 for the tests that care, but it really
// depends on what the client sets.
common_tls_context.mutable_tls_params()->set_tls_maximum_protocol_version(
options.tlsv1_3_ ? envoy::extensions::transport_sockets::tls::v3::TlsParameters::TLSv1_3
: envoy::extensions::transport_sockets::tls::v3::TlsParameters::TLSv1_2);
if (options.rsa_cert_) {
auto* tls_certificate = common_tls_context.add_tls_certificates();
tls_certificate->mutable_certificate_chain()->set_filename(
TestEnvironment::runfilesPath("test/config/integration/certs/servercert.pem"));
tls_certificate->mutable_private_key()->set_filename(
TestEnvironment::runfilesPath("test/config/integration/certs/serverkey.pem"));
if (options.rsa_cert_ocsp_staple_) {
tls_certificate->mutable_ocsp_staple()->set_filename(
TestEnvironment::runfilesPath("test/config/integration/certs/server_ocsp_resp.der"));
}
}
if (options.ecdsa_cert_) {
auto* tls_certificate = common_tls_context.add_tls_certificates();
tls_certificate->mutable_certificate_chain()->set_filename(
TestEnvironment::runfilesPath("test/config/integration/certs/server_ecdsacert.pem"));
tls_certificate->mutable_private_key()->set_filename(
TestEnvironment::runfilesPath("test/config/integration/certs/server_ecdsakey.pem"));
if (options.ecdsa_cert_ocsp_staple_) {
tls_certificate->mutable_ocsp_staple()->set_filename(TestEnvironment::runfilesPath(
"test/config/integration/certs/server_ecdsa_ocsp_resp.der"));
}
}
if (!options.san_matchers_.empty()) {
*validation_context->mutable_match_subject_alt_names() = {options.san_matchers_.begin(),
options.san_matchers_.end()};
}
} | 354 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::ConfigHelper::ServerSslOptions::setSanMatchers | Envoy::ConfigHelper::ServerSslOptions::setSanMatchers( std :: vector<envoy::type::matcher::v3::StringMatcher> san_matchers) | ['san_matchers'] | setSanMatchers(std::vector<envoy::type::matcher::v3::StringMatcher> san_matchers) {
san_matchers_ = san_matchers;
return *this;
} | 28 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST | Envoy::Extensions::TransportSockets::Tls::TEST( DefaultCertValidatorTest , TestCertificateVerificationWithSANMatcher) | ['DefaultCertValidatorTest', 'TestCertificateVerificationWithSANMatcher'] | TEST(DefaultCertValidatorTest, TestCertificateVerificationWithSANMatcher) {
Stats::TestUtil::TestStore test_store;
SslStats stats = generateSslStats(test_store);
// Create the default validator object.
auto default_validator =
std::make_unique<Extensions::TransportSockets::Tls::DefaultCertValidator>(
/*CertificateValidationContextConfig=*/nullptr, stats,
Event::GlobalTimeSystem().timeSystem());
bssl::UniquePtr<X509> cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns_cert.pem"));
envoy::type::matcher::v3::StringMatcher matcher;
matcher.MergeFrom(TestUtility::createRegexMatcher(".*.example.com"));
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>> san_matchers;
san_matchers.push_back(Matchers::StringMatcherImpl(matcher));
// Verify the certificate with correct SAN regex matcher.
EXPECT_EQ(default_validator->verifyCertificate(cert.get(), /*verify_san_list=*/{}, san_matchers),
Envoy::Ssl::ClientValidationStatus::Validated);
EXPECT_EQ(stats.fail_verify_san_.value(), 0);
matcher.MergeFrom(TestUtility::createExactMatcher("hello.example.com"));
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>
invalid_san_matchers;
invalid_san_matchers.push_back(Matchers::StringMatcherImpl(matcher));
// Verify the certificate with incorrect SAN exact matcher.
EXPECT_EQ(default_validator->verifyCertificate(cert.get(), /*verify_san_list=*/{},
invalid_san_matchers),
Envoy::Ssl::ClientValidationStatus::Failed);
EXPECT_EQ(stats.fail_verify_san_.value(), 1);
} | 253 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST | Envoy::Extensions::TransportSockets::Tls::TEST( DefaultCertValidatorTest , TestMatchSubjectAltNameDNSMatched) | ['DefaultCertValidatorTest', 'TestMatchSubjectAltNameDNSMatched'] | TEST(DefaultCertValidatorTest, TestMatchSubjectAltNameDNSMatched) {
bssl::UniquePtr<X509> cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns_cert.pem"));
envoy::type::matcher::v3::StringMatcher matcher;
matcher.MergeFrom(TestUtility::createRegexMatcher(".*.example.com"));
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>
subject_alt_name_matchers;
subject_alt_name_matchers.push_back(Matchers::StringMatcherImpl(matcher));
EXPECT_TRUE(DefaultCertValidator::matchSubjectAltName(cert.get(), subject_alt_name_matchers));
} | 98 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST | Envoy::Extensions::TransportSockets::Tls::TEST( DefaultCertValidatorTest , TestMatchSubjectAltNameNotMatched) | ['DefaultCertValidatorTest', 'TestMatchSubjectAltNameNotMatched'] | TEST(DefaultCertValidatorTest, TestMatchSubjectAltNameNotMatched) {
bssl::UniquePtr<X509> cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns_cert.pem"));
envoy::type::matcher::v3::StringMatcher matcher;
matcher.MergeFrom(TestUtility::createRegexMatcher(".*.foo.com"));
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>
subject_alt_name_matchers;
subject_alt_name_matchers.push_back(Matchers::StringMatcherImpl(matcher));
EXPECT_FALSE(DefaultCertValidator::matchSubjectAltName(cert.get(), subject_alt_name_matchers));
} | 98 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST | Envoy::Extensions::TransportSockets::Tls::TEST( DefaultCertValidatorTest , TestMatchSubjectAltNameURIMatched) | ['DefaultCertValidatorTest', 'TestMatchSubjectAltNameURIMatched'] | TEST(DefaultCertValidatorTest, TestMatchSubjectAltNameURIMatched) {
bssl::UniquePtr<X509> cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_cert.pem"));
envoy::type::matcher::v3::StringMatcher matcher;
matcher.MergeFrom(TestUtility::createRegexMatcher("spiffe://lyft.com/.*-team"));
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>
subject_alt_name_matchers;
subject_alt_name_matchers.push_back(Matchers::StringMatcherImpl(matcher));
EXPECT_TRUE(DefaultCertValidator::matchSubjectAltName(cert.get(), subject_alt_name_matchers));
} | 98 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST | Envoy::Extensions::TransportSockets::Tls::TEST( DefaultCertValidatorTest , TestMatchSubjectAltNameWildcardDNSMatched) | ['DefaultCertValidatorTest', 'TestMatchSubjectAltNameWildcardDNSMatched'] | TEST(DefaultCertValidatorTest, TestMatchSubjectAltNameWildcardDNSMatched) {
bssl::UniquePtr<X509> cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/san_multiple_dns_cert.pem"));
envoy::type::matcher::v3::StringMatcher matcher;
matcher.set_exact("api.example.com");
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>
subject_alt_name_matchers;
subject_alt_name_matchers.push_back(Matchers::StringMatcherImpl(matcher));
EXPECT_TRUE(DefaultCertValidator::matchSubjectAltName(cert.get(), subject_alt_name_matchers));
} | 94 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST | Envoy::Extensions::TransportSockets::Tls::TEST( DefaultCertValidatorTest , TestMultiLevelMatch) | ['DefaultCertValidatorTest', 'TestMultiLevelMatch'] | TEST(DefaultCertValidatorTest, TestMultiLevelMatch) {
// san_multiple_dns_cert matches *.example.com
bssl::UniquePtr<X509> cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/san_multiple_dns_cert.pem"));
envoy::type::matcher::v3::StringMatcher matcher;
matcher.set_exact("foo.api.example.com");
std::vector<Matchers::StringMatcherImpl<envoy::type::matcher::v3::StringMatcher>>
subject_alt_name_matchers;
subject_alt_name_matchers.push_back(Matchers::StringMatcherImpl(matcher));
EXPECT_FALSE(DefaultCertValidator::matchSubjectAltName(cert.get(), subject_alt_name_matchers));
} | 94 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Ssl::TEST_P | Envoy::Ssl::TEST_P( SslSPIFFECertValidatorIntegrationTest , ServerRsaSPIFFEValidatorSANMatch) | ['SslSPIFFECertValidatorIntegrationTest', 'ServerRsaSPIFFEValidatorSANMatch'] | TEST_P(SslSPIFFECertValidatorIntegrationTest, ServerRsaSPIFFEValidatorSANMatch) {
auto typed_conf = new envoy::config::core::v3::TypedExtensionConfig();
TestUtility::loadFromYaml(TestEnvironment::substitute(R"EOF(
name: envoy.tls.cert_validator.spiffe
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig
trust_domains:
- name: lyft.com
trust_bundle:
filename: "{{ test_rundir }}/test/config/integration/certs/cacert.pem"
)EOF"),
*typed_conf);
custom_validator_config_ = typed_conf;
envoy::type::matcher::v3::StringMatcher matcher;
matcher.set_prefix("spiffe://lyft.com/");
san_matchers_ = {matcher};
ConnectionCreationFunction creator = [&]() -> Network::ClientConnectionPtr {
return makeSslClientConnection({});
};
testRouterRequestAndResponseWithBody(1024, 512, false, false, &creator);
checkVerifyErrorCouter(0);
} | 130 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Ssl::TEST_P | Envoy::Ssl::TEST_P( SslSPIFFECertValidatorIntegrationTest , ServerRsaSPIFFEValidatorSANNotMatch) | ['SslSPIFFECertValidatorIntegrationTest', 'ServerRsaSPIFFEValidatorSANNotMatch'] | TEST_P(SslSPIFFECertValidatorIntegrationTest, ServerRsaSPIFFEValidatorSANNotMatch) {
auto typed_conf = new envoy::config::core::v3::TypedExtensionConfig();
TestUtility::loadFromYaml(TestEnvironment::substitute(R"EOF(
name: envoy.tls.cert_validator.spiffe
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig
trust_domains:
- name: lyft.com
trust_bundle:
filename: "{{ test_rundir }}/test/config/integration/certs/cacert.pem"
)EOF"),
*typed_conf);
custom_validator_config_ = typed_conf;
envoy::type::matcher::v3::StringMatcher matcher;
matcher.set_prefix("spiffe://example.com/");
// The cert has "DNS.1 = lyft.com" but SPIFFE validator must ignore SAN types other than URI.
matcher.set_prefix("www.lyft.com");
san_matchers_ = {matcher};
initialize();
auto conn = makeSslClientConnection({});
if (tls_version_ == envoy::extensions::transport_sockets::tls::v3::TlsParameters::TLSv1_2) {
auto codec = makeRawHttpConnection(std::move(conn), absl::nullopt);
EXPECT_FALSE(codec->connected());
} else {
auto codec = makeHttpConnection(std::move(conn));
ASSERT_TRUE(codec->waitForDisconnect());
codec->close();
}
checkVerifyErrorCouter(1);
} | 191 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST_F | Envoy::Extensions::TransportSockets::Tls::TEST_F( TestSPIFFEValidator , TestGetTrustBundleStore) | ['TestSPIFFEValidator', 'TestGetTrustBundleStore'] | TEST_F(TestSPIFFEValidator, TestGetTrustBundleStore) {
initialize();
// No SAN
auto cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/extensions_cert.pem"));
EXPECT_FALSE(validator().getTrustBundleStore(cert.get()));
// Non-SPIFFE SAN
cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/non_spiffe_san_cert.pem"));
EXPECT_FALSE(validator().getTrustBundleStore(cert.get()));
// SPIFFE SAN
cert = readCertFromFile(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/spiffe_san_cert.pem"));
// Trust bundle not provided.
EXPECT_FALSE(validator().getTrustBundleStore(cert.get()));
// Trust bundle provided.
validator().trustBundleStores().emplace("example.com", X509StorePtr(X509_STORE_new()));
EXPECT_TRUE(validator().getTrustBundleStore(cert.get()));
} | 133 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TestSPIFFEValidator::setSanMatchers | Envoy::Extensions::TransportSockets::Tls::TestSPIFFEValidator::setSanMatchers( std :: vector<envoy::type::matcher::v3::StringMatcher> san_matchers) | ['san_matchers'] | void setSanMatchers(std::vector<envoy::type::matcher::v3::StringMatcher> san_matchers) {
san_matchers_ = san_matchers;
}; | 24 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TestCertificateValidationContextConfig::TestCertificateValidationContextConfig | Envoy::Extensions::TransportSockets::Tls::TestCertificateValidationContextConfig::TestCertificateValidationContextConfig( envoy :: config :: core :: v3 :: TypedExtensionConfig config , bool allow_expired_certificate = false , std :: vector<envoy::type::matcher::v3::StringMatcher> san_matchers = { }) | ['config', 'allow_expired_certificate', 'san_matchers'] | TestCertificateValidationContextConfig(
envoy::config::core::v3::TypedExtensionConfig config, bool allow_expired_certificate = false,
std::vector<envoy::type::matcher::v3::StringMatcher> san_matchers = {})
: allow_expired_certificate_(allow_expired_certificate), api_(Api::createApiForTest()),
custom_validator_config_(config), san_matchers_(san_matchers){}; | 63 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST_F | Envoy::Extensions::TransportSockets::Tls::TEST_F( SslServerContextImplTicketTest , VerifySanWithNoCA) | ['SslServerContextImplTicketTest', 'VerifySanWithNoCA'] | TEST_F(SslServerContextImplTicketTest, VerifySanWithNoCA) {
const std::string yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns_key.pem"
validation_context:
match_subject_alt_names:
exact : "spiffe://lyft.com/testclient"
)EOF";
EXPECT_THROW_WITH_MESSAGE(loadConfigYaml(yaml), EnvoyException,
"SAN-based verification of peer certificates without trusted CA "
"is insecure and not allowed");
}
TEST_F(SslServerContextImplTicketTest, StatelessSessionResumptionEnabledByDefault) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
EXPECT_FALSE(server_context_config.disableStatelessSessionResumption());
}
TEST_F(SslServerContextImplTicketTest, StatelessSessionResumptionExplicitlyEnabled) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
disable_stateless_session_resumption: false
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
EXPECT_FALSE(server_context_config.disableStatelessSessionResumption());
}
TEST_F(SslServerContextImplTicketTest, StatelessSessionResumptionDisabled) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
disable_stateless_session_resumption: true
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
EXPECT_TRUE(server_context_config.disableStatelessSessionResumption());
}
TEST_F(SslServerContextImplTicketTest, StatelessSessionResumptionEnabledWhenKeyIsConfigured) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
session_ticket_keys:
keys:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ticket_key_a"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
EXPECT_FALSE(server_context_config.disableStatelessSessionResumption());
}
class ClientContextConfigImplTest : public SslCertsTest {};
// Validate that empty SNI (according to C string rules) fails config validation.
TEST_F(ClientContextConfigImplTest, EmptyServerNameIndication) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
NiceMock<Server::Configuration::MockTransportSocketFactoryContext> factory_context;
tls_context.set_sni(std::string("\000", 1));
EXPECT_THROW_WITH_MESSAGE(
ClientContextConfigImpl client_context_config(tls_context, factory_context), EnvoyException,
"SNI names containing NULL-byte are not allowed");
tls_context.set_sni(std::string("a\000b", 3));
EXPECT_THROW_WITH_MESSAGE(
ClientContextConfigImpl client_context_config(tls_context, factory_context), EnvoyException,
"SNI names containing NULL-byte are not allowed");
}
// Validate that values other than a hex-encoded SHA-256 fail config validation.
TEST_F(ClientContextConfigImplTest, InvalidCertificateHash) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
NiceMock<Server::Configuration::MockTransportSocketFactoryContext> factory_context;
tls_context.mutable_common_tls_context()
->mutable_validation_context()
// This is valid hex-encoded string, but it doesn't represent SHA-256 (80 vs 64 chars).
->add_verify_certificate_hash("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
ClientContextConfigImpl client_context_config(tls_context, factory_context);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException, "Invalid hex-encoded SHA-256 .*");
}
// Validate that values other than a base64-encoded SHA-256 fail config validation.
TEST_F(ClientContextConfigImplTest, InvalidCertificateSpki) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
NiceMock<Server::Configuration::MockTransportSocketFactoryContext> factory_context;
tls_context.mutable_common_tls_context()
->mutable_validation_context()
// Not a base64-encoded string.
->add_verify_certificate_spki("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
ClientContextConfigImpl client_context_config(tls_context, factory_context);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException, "Invalid base64-encoded SHA-256 .*");
}
// Validate that 2048-bit RSA certificates load successfully.
TEST_F(ClientContextConfigImplTest, RSA2048Cert) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
manager.createSslClientContext(store, client_context_config, nullptr);
}
// Validate that 1024-bit RSA certificates are rejected.
TEST_F(ClientContextConfigImplTest, RSA1024Cert) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_1024_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_1024_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
std::string error_msg(
"Failed to load certificate chain from .*selfsigned_rsa_1024_cert.pem, only RSA certificates "
#ifdef BORINGSSL_FIPS
"with 2048-bit, 3072-bit or 4096-bit keys are supported in FIPS mode"
#else
"with 2048-bit or larger keys are supported"
#endif
);
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException, error_msg);
}
// Validate that 1024-bit RSA certificates are rejected from `pkcs12`.
TEST_F(ClientContextConfigImplTest, RSA1024Pkcs12) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
pkcs12:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_1024_certkey.p12"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
std::string error_msg("Failed to load certificate chain from .*selfsigned_rsa_1024_certkey.p12, "
"only RSA certificates "
#ifdef BORINGSSL_FIPS
"with 2048-bit, 3072-bit or 4096-bit keys are supported in FIPS mode"
#else
"with 2048-bit or larger keys are supported"
#endif
);
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException, error_msg);
}
// Validate that 3072-bit RSA certificates load successfully.
TEST_F(ClientContextConfigImplTest, RSA3072Cert) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_3072_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_3072_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
manager.createSslClientContext(store, client_context_config, nullptr);
}
// Validate that 4096-bit RSA certificates load successfully.
TEST_F(ClientContextConfigImplTest, RSA4096Cert) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_4096_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_4096_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
manager.createSslClientContext(store, client_context_config, nullptr);
}
// Validate that P256 ECDSA certs load.
TEST_F(ClientContextConfigImplTest, P256EcdsaCert) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
manager.createSslClientContext(store, client_context_config, nullptr);
}
// Validate that non-P256 ECDSA certs are rejected.
TEST_F(ClientContextConfigImplTest, NonP256EcdsaCert) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p384_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p384_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException,
"Failed to load certificate chain from .*selfsigned_ecdsa_p384_cert.pem, "
"only P-256 ECDSA certificates are supported");
}
// Validate that non-P256 ECDSA certs are rejected loaded from `pkcs12`.
TEST_F(ClientContextConfigImplTest, NonP256EcdsaPkcs12) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
pkcs12:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p384_certkey.p12"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(
manager.createSslClientContext(store, client_context_config, nullptr), EnvoyException,
"Failed to load certificate chain from .*selfsigned_ecdsa_p384_certkey.p12, "
"only P-256 ECDSA certificates are supported");
}
// Multiple TLS certificates are not yet supported.
// TODO(PiotrSikora): Support multiple TLS certificates.
TEST_F(ClientContextConfigImplTest, MultipleTlsCertificates) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
EXPECT_THROW_WITH_MESSAGE(
ClientContextConfigImpl client_context_config(tls_context, factory_context_), EnvoyException,
"Multiple TLS certificates are not supported for client contexts");
}
// Validate context config does not support handling both static TLS certificate and dynamic TLS
// certificate.
TEST_F(ClientContextConfigImplTest, TlsCertificatesAndSdsConfig) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
tls_context.mutable_common_tls_context()->add_tls_certificate_sds_secret_configs();
EXPECT_THROW_WITH_MESSAGE(
ClientContextConfigImpl client_context_config(tls_context, factory_context_), EnvoyException,
"Multiple TLS certificates are not supported for client contexts");
}
// Validate context config supports SDS, and is marked as not ready if secrets are not yet
// downloaded.
TEST_F(ClientContextConfigImplTest, SecretNotReady) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
NiceMock<LocalInfo::MockLocalInfo> local_info;
Stats::IsolatedStoreImpl stats;
NiceMock<Init::MockManager> init_manager;
NiceMock<Event::MockDispatcher> dispatcher;
EXPECT_CALL(factory_context_, localInfo()).WillOnce(ReturnRef(local_info));
EXPECT_CALL(factory_context_, stats()).WillOnce(ReturnRef(stats));
EXPECT_CALL(factory_context_, initManager()).WillRepeatedly(ReturnRef(init_manager));
EXPECT_CALL(factory_context_, mainThreadDispatcher()).WillRepeatedly(ReturnRef(dispatcher));
auto sds_secret_configs =
tls_context.mutable_common_tls_context()->mutable_tls_certificate_sds_secret_configs()->Add();
sds_secret_configs->set_name("abc.com");
sds_secret_configs->mutable_sds_config();
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
// When sds secret is not downloaded, config is not ready.
EXPECT_FALSE(client_context_config.isReady());
// Set various callbacks to config.
NiceMock<Secret::MockSecretCallbacks> secret_callback;
client_context_config.setSecretUpdateCallback(
[&secret_callback]() { secret_callback.onAddOrUpdateSecret(); });
client_context_config.setSecretUpdateCallback([]() {});
}
// Validate client context config supports SDS, and is marked as not ready if dynamic
// certificate validation context is not yet downloaded.
TEST_F(ClientContextConfigImplTest, ValidationContextNotReady) {
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
envoy::extensions::transport_sockets::tls::v3::TlsCertificate* client_cert =
tls_context.mutable_common_tls_context()->add_tls_certificates();
client_cert->mutable_certificate_chain()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"));
client_cert->mutable_private_key()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"));
NiceMock<LocalInfo::MockLocalInfo> local_info;
Stats::IsolatedStoreImpl stats;
NiceMock<Init::MockManager> init_manager;
NiceMock<Event::MockDispatcher> dispatcher;
EXPECT_CALL(factory_context_, localInfo()).WillOnce(ReturnRef(local_info));
EXPECT_CALL(factory_context_, stats()).WillOnce(ReturnRef(stats));
EXPECT_CALL(factory_context_, initManager()).WillRepeatedly(ReturnRef(init_manager));
EXPECT_CALL(factory_context_, mainThreadDispatcher()).WillRepeatedly(ReturnRef(dispatcher));
auto sds_secret_configs =
tls_context.mutable_common_tls_context()->mutable_validation_context_sds_secret_config();
sds_secret_configs->set_name("abc.com");
sds_secret_configs->mutable_sds_config();
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
// When sds secret is not downloaded, config is not ready.
EXPECT_FALSE(client_context_config.isReady());
// Set various callbacks to config.
NiceMock<Secret::MockSecretCallbacks> secret_callback;
client_context_config.setSecretUpdateCallback(
[&secret_callback]() { secret_callback.onAddOrUpdateSecret(); });
client_context_config.setSecretUpdateCallback([]() {});
}
// Validate that client context config with static TLS certificates is created successfully.
TEST_F(ClientContextConfigImplTest, StaticTlsCertificates) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
const std::string yaml = R"EOF(
name: "abc.com"
tls_certificate:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(yaml), secret_config);
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
factory_context_.secretManager().addStaticSecret(secret_config);
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
const std::string cert_pem =
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(cert_pem)),
client_context_config.tlsCertificates()[0].get().certificateChain());
const std::string key_pem =
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(key_pem)),
client_context_config.tlsCertificates()[0].get().privateKey());
}
// Validate that client context config with password-protected TLS certificates is created
// successfully.
TEST_F(ClientContextConfigImplTest, PasswordProtectedTlsCertificates) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
secret_config.set_name("abc.com");
auto* tls_certificate = secret_config.mutable_tls_certificate();
tls_certificate->mutable_certificate_chain()->set_filename(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_cert.pem"));
tls_certificate->mutable_private_key()->set_filename(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_key.pem"));
tls_certificate->mutable_password()->set_filename(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_password.txt"));
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
factory_context_.secretManager().addStaticSecret(secret_config);
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
const std::string cert_pem =
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_cert.pem";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(cert_pem)),
client_context_config.tlsCertificates()[0].get().certificateChain());
const std::string key_pem =
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_key.pem";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(key_pem)),
client_context_config.tlsCertificates()[0].get().privateKey());
const std::string password_file =
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_password.txt";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(password_file)),
client_context_config.tlsCertificates()[0].get().password());
}
// Validate that client context config with password-protected TLS certificates loaded from
// `PKCS12` is created successfully.
TEST_F(ClientContextConfigImplTest, PasswordProtectedPkcs12) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
secret_config.set_name("abc.com");
auto* tls_certificate = secret_config.mutable_tls_certificate();
tls_certificate->mutable_pkcs12()->set_filename(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_certkey.p12"));
tls_certificate->mutable_password()->set_filename(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_password.txt"));
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
factory_context_.secretManager().addStaticSecret(secret_config);
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
const std::string cert_p12 =
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_certkey.p12";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(cert_p12)),
client_context_config.tlsCertificates()[0].get().pkcs12());
const std::string password_file =
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_password.txt";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(password_file)),
client_context_config.tlsCertificates()[0].get().password());
}
// Validate that not supplying the incorrect passphrase for password-protected `PKCS12`
// triggers a failure loading the private key.
TEST_F(ClientContextConfigImplTest, PasswordWrongPkcs12) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
secret_config.set_name("abc.com");
auto* tls_certificate = secret_config.mutable_tls_certificate();
const std::string pkcs12_path = TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_certkey.p12");
tls_certificate->mutable_pkcs12()->set_filename(pkcs12_path);
tls_certificate->mutable_password()->set_inline_string("WrongPassword");
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
factory_context_.secretManager().addStaticSecret(secret_config);
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException, absl::StrCat("Failed to load pkcs12 from ", pkcs12_path));
}
// Validate that not supplying a passphrase for password-protected `PKCS12`
// triggers a failure loading the private key.
TEST_F(ClientContextConfigImplTest, PasswordNotSuppliedPkcs12) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
secret_config.set_name("abc.com");
auto* tls_certificate = secret_config.mutable_tls_certificate();
const std::string pkcs12_path = TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_certkey.p12");
tls_certificate->mutable_pkcs12()->set_filename(pkcs12_path);
// Don't supply the password.
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
factory_context_.secretManager().addStaticSecret(secret_config);
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException, absl::StrCat("Failed to load pkcs12 from ", pkcs12_path));
}
// Validate that not supplying a passphrase for password-protected TLS certificates
// triggers a failure.
TEST_F(ClientContextConfigImplTest, PasswordNotSuppliedTlsCertificates) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
secret_config.set_name("abc.com");
auto* tls_certificate = secret_config.mutable_tls_certificate();
tls_certificate->mutable_certificate_chain()->set_filename(TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_cert.pem"));
const std::string private_key_path = TestEnvironment::substitute(
"{{ test_rundir "
"}}/test/extensions/transport_sockets/tls/test_data/password_protected_key.pem");
tls_certificate->mutable_private_key()->set_filename(private_key_path);
// Don't supply the password.
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
factory_context_.secretManager().addStaticSecret(secret_config);
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_REGEX(manager.createSslClientContext(store, client_context_config, nullptr),
EnvoyException,
absl::StrCat("Failed to load private key from ", private_key_path));
}
// Validate that client context config with static certificate validation context is created
// successfully.
TEST_F(ClientContextConfigImplTest, StaticCertificateValidationContext) {
envoy::extensions::transport_sockets::tls::v3::Secret tls_certificate_secret_config;
const std::string tls_certificate_yaml = R"EOF(
name: "abc.com"
tls_certificate:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
tls_certificate_secret_config);
factory_context_.secretManager().addStaticSecret(tls_certificate_secret_config);
envoy::extensions::transport_sockets::tls::v3::Secret
certificate_validation_context_secret_config;
const std::string certificate_validation_context_yaml = R"EOF(
name: "def.com"
validation_context:
trusted_ca: { filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem" }
allow_expired_certificate: true
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(certificate_validation_context_yaml),
certificate_validation_context_secret_config);
factory_context_.secretManager().addStaticSecret(certificate_validation_context_secret_config);
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
tls_context.mutable_common_tls_context()
->mutable_validation_context_sds_secret_config()
->set_name("def.com");
ClientContextConfigImpl client_context_config(tls_context, factory_context_);
const std::string cert_pem =
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem";
EXPECT_EQ(TestEnvironment::readFileToStringForTest(TestEnvironment::substitute(cert_pem)),
client_context_config.certificateValidationContext()->caCert());
}
// Validate that constructor of client context config throws an exception when static TLS
// certificate is missing.
TEST_F(ClientContextConfigImplTest, MissingStaticSecretTlsCertificates) {
envoy::extensions::transport_sockets::tls::v3::Secret secret_config;
const std::string yaml = R"EOF(
name: "abc.com"
tls_certificate:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(yaml), secret_config);
factory_context_.secretManager().addStaticSecret(secret_config);
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("missing");
EXPECT_THROW_WITH_MESSAGE(
ClientContextConfigImpl client_context_config(tls_context, factory_context_), EnvoyException,
"Unknown static secret: missing");
}
// Validate that constructor of client context config throws an exception when static certificate
// validation context is missing.
TEST_F(ClientContextConfigImplTest, MissingStaticCertificateValidationContext) {
envoy::extensions::transport_sockets::tls::v3::Secret tls_certificate_secret_config;
const std::string tls_certificate_yaml = R"EOF(
name: "abc.com"
tls_certificate:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
tls_certificate_secret_config);
factory_context_.secretManager().addStaticSecret(tls_certificate_secret_config);
envoy::extensions::transport_sockets::tls::v3::Secret
certificate_validation_context_secret_config;
const std::string certificate_validation_context_yaml = R"EOF(
name: "def.com"
validation_context:
trusted_ca: { filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem" }
allow_expired_certificate: true
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(certificate_validation_context_yaml),
certificate_validation_context_secret_config);
factory_context_.secretManager().addStaticSecret(certificate_validation_context_secret_config);
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()
->mutable_tls_certificate_sds_secret_configs()
->Add()
->set_name("abc.com");
tls_context.mutable_common_tls_context()
->mutable_validation_context_sds_secret_config()
->set_name("missing");
EXPECT_THROW_WITH_MESSAGE(
ClientContextConfigImpl client_context_config(tls_context, factory_context_), EnvoyException,
"Unknown static certificate validation context: missing");
}
class ServerContextConfigImplTest : public SslCertsTest {};
// Multiple TLS certificates are supported.
TEST_F(ServerContextConfigImplTest, MultipleTlsCertificates) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl client_context_config(tls_context, factory_context_), EnvoyException,
"No TLS certificates found for server context");
const std::string rsa_tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
const std::string ecdsa_tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(rsa_tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
TestUtility::loadFromYaml(TestEnvironment::substitute(ecdsa_tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
auto tls_certs = server_context_config.tlsCertificates();
ASSERT_EQ(2, tls_certs.size());
EXPECT_THAT(tls_certs[0].get().privateKeyPath(), EndsWith("selfsigned_key.pem"));
EXPECT_THAT(tls_certs[1].get().privateKeyPath(), EndsWith("selfsigned_ecdsa_p256_key.pem"));
}
TEST_F(ServerContextConfigImplTest, TlsCertificatesAndSdsConfig) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"No TLS certificates found for server context");
const std::string tls_certificate_yaml = R"EOF(
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_certificate_yaml),
*tls_context.mutable_common_tls_context()->add_tls_certificates());
tls_context.mutable_common_tls_context()->add_tls_certificate_sds_secret_configs();
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"SDS and non-SDS TLS certificates may not be mixed in server contexts");
}
TEST_F(ServerContextConfigImplTest, MultiSdsConfig) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()->add_tls_certificate_sds_secret_configs();
tls_context.mutable_common_tls_context()->add_tls_certificate_sds_secret_configs();
EXPECT_THROW_WITH_REGEX(
TestUtility::validate<envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext>(
tls_context),
EnvoyException, "Proto constraint validation failed");
}
TEST_F(ServerContextConfigImplTest, SecretNotReady) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
NiceMock<LocalInfo::MockLocalInfo> local_info;
Stats::IsolatedStoreImpl stats;
NiceMock<Init::MockManager> init_manager;
NiceMock<Event::MockDispatcher> dispatcher;
EXPECT_CALL(factory_context_, localInfo()).WillOnce(ReturnRef(local_info));
EXPECT_CALL(factory_context_, stats()).WillOnce(ReturnRef(stats));
EXPECT_CALL(factory_context_, initManager()).WillRepeatedly(ReturnRef(init_manager));
EXPECT_CALL(factory_context_, mainThreadDispatcher()).WillRepeatedly(ReturnRef(dispatcher));
auto sds_secret_configs =
tls_context.mutable_common_tls_context()->mutable_tls_certificate_sds_secret_configs()->Add();
sds_secret_configs->set_name("abc.com");
sds_secret_configs->mutable_sds_config();
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
// When sds secret is not downloaded, config is not ready.
EXPECT_FALSE(server_context_config.isReady());
// Set various callbacks to config.
NiceMock<Secret::MockSecretCallbacks> secret_callback;
server_context_config.setSecretUpdateCallback(
[&secret_callback]() { secret_callback.onAddOrUpdateSecret(); });
server_context_config.setSecretUpdateCallback([]() {});
}
// Validate server context config supports SDS, and is marked as not ready if dynamic
// certificate validation context is not yet downloaded.
TEST_F(ServerContextConfigImplTest, ValidationContextNotReady) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
envoy::extensions::transport_sockets::tls::v3::TlsCertificate* server_cert =
tls_context.mutable_common_tls_context()->add_tls_certificates();
server_cert->mutable_certificate_chain()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"));
server_cert->mutable_private_key()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"));
NiceMock<LocalInfo::MockLocalInfo> local_info;
Stats::IsolatedStoreImpl stats;
NiceMock<Init::MockManager> init_manager;
NiceMock<Event::MockDispatcher> dispatcher;
EXPECT_CALL(factory_context_, localInfo()).WillOnce(ReturnRef(local_info));
EXPECT_CALL(factory_context_, stats()).WillOnce(ReturnRef(stats));
EXPECT_CALL(factory_context_, initManager()).WillRepeatedly(ReturnRef(init_manager));
EXPECT_CALL(factory_context_, mainThreadDispatcher()).WillRepeatedly(ReturnRef(dispatcher));
auto sds_secret_configs =
tls_context.mutable_common_tls_context()->mutable_validation_context_sds_secret_config();
sds_secret_configs->set_name("abc.com");
sds_secret_configs->mutable_sds_config();
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
// When sds secret is not downloaded, config is not ready.
EXPECT_FALSE(server_context_config.isReady());
// Set various callbacks to config.
NiceMock<Secret::MockSecretCallbacks> secret_callback;
server_context_config.setSecretUpdateCallback(
[&secret_callback]() { secret_callback.onAddOrUpdateSecret(); });
server_context_config.setSecretUpdateCallback([]() {});
}
// TlsCertificate messages must have a cert for servers.
TEST_F(ServerContextConfigImplTest, TlsCertificateNonEmpty) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()->add_tls_certificates();
ServerContextConfigImpl client_context_config(tls_context, factory_context_);
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
Stats::IsolatedStoreImpl store;
EXPECT_THROW_WITH_MESSAGE(
Envoy::Ssl::ServerContextSharedPtr server_ctx(manager.createSslServerContext(
store, client_context_config, std::vector<std::string>{}, nullptr)),
EnvoyException, "Server TlsCertificates must have a certificate specified");
}
// Cannot ignore certificate expiration without a trusted CA.
TEST_F(ServerContextConfigImplTest, InvalidIgnoreCertsNoCA) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
envoy::extensions::transport_sockets::tls::v3::CertificateValidationContext*
server_validation_ctx =
tls_context.mutable_common_tls_context()->mutable_validation_context();
server_validation_ctx->set_allow_expired_certificate(true);
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Certificate validity period is always ignored without trusted CA");
envoy::extensions::transport_sockets::tls::v3::TlsCertificate* server_cert =
tls_context.mutable_common_tls_context()->add_tls_certificates();
server_cert->mutable_certificate_chain()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"));
server_cert->mutable_private_key()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"));
server_validation_ctx->set_allow_expired_certificate(false);
EXPECT_NO_THROW(ServerContextConfigImpl server_context_config(tls_context, factory_context_));
server_validation_ctx->set_allow_expired_certificate(true);
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Certificate validity period is always ignored without trusted CA");
// But once you add a trusted CA, you should be able to create the context.
server_validation_ctx->mutable_trusted_ca()->set_filename(TestEnvironment::substitute(
"{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"));
EXPECT_NO_THROW(ServerContextConfigImpl server_context_config(tls_context, factory_context_));
}
TEST_F(ServerContextConfigImplTest, PrivateKeyMethodLoadFailureNoProvider) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
NiceMock<Ssl::MockContextManager> context_manager;
NiceMock<Ssl::MockPrivateKeyMethodManager> private_key_method_manager;
EXPECT_CALL(factory_context_, sslContextManager()).WillOnce(ReturnRef(context_manager));
EXPECT_CALL(context_manager, privateKeyMethodManager())
.WillOnce(ReturnRef(private_key_method_manager));
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key_provider:
provider_name: mock_provider
typed_config:
"@type": type.googleapis.com/google.protobuf.Struct
value:
test_value: 100
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
EXPECT_THROW_WITH_REGEX(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Failed to load private key provider: mock_provider");
}
TEST_F(ServerContextConfigImplTest, PrivateKeyMethodLoadFailureNoMethod) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
tls_context.mutable_common_tls_context()->add_tls_certificates();
Stats::IsolatedStoreImpl store;
NiceMock<Ssl::MockContextManager> context_manager;
NiceMock<Ssl::MockPrivateKeyMethodManager> private_key_method_manager;
auto private_key_method_provider_ptr =
std::make_shared<NiceMock<Ssl::MockPrivateKeyMethodProvider>>();
Event::SimulatedTimeSystem time_system;
ContextManagerImpl manager(time_system);
EXPECT_CALL(factory_context_, sslContextManager()).WillOnce(ReturnRef(context_manager));
EXPECT_CALL(context_manager, privateKeyMethodManager())
.WillOnce(ReturnRef(private_key_method_manager));
EXPECT_CALL(private_key_method_manager, createPrivateKeyMethodProvider(_, _))
.WillOnce(Return(private_key_method_provider_ptr));
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key_provider:
provider_name: mock_provider
typed_config:
"@type": type.googleapis.com/google.protobuf.Struct
value:
test_value: 100
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
EXPECT_THROW_WITH_MESSAGE(
Envoy::Ssl::ServerContextSharedPtr server_ctx(manager.createSslServerContext(
store, server_context_config, std::vector<std::string>{}, nullptr)),
EnvoyException, "Failed to get BoringSSL private key method from provider");
}
TEST_F(ServerContextConfigImplTest, PrivateKeyMethodLoadSuccess) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
NiceMock<Ssl::MockContextManager> context_manager;
NiceMock<Ssl::MockPrivateKeyMethodManager> private_key_method_manager;
auto private_key_method_provider_ptr =
std::make_shared<NiceMock<Ssl::MockPrivateKeyMethodProvider>>();
EXPECT_CALL(factory_context_, sslContextManager()).WillOnce(ReturnRef(context_manager));
EXPECT_CALL(context_manager, privateKeyMethodManager())
.WillOnce(ReturnRef(private_key_method_manager));
EXPECT_CALL(private_key_method_manager, createPrivateKeyMethodProvider(_, _))
.WillOnce(Return(private_key_method_provider_ptr));
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key_provider:
provider_name: mock_provider
typed_config:
"@type": type.googleapis.com/google.protobuf.Struct
value:
test_value: 100
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
ServerContextConfigImpl server_context_config(tls_context, factory_context_);
}
TEST_F(ServerContextConfigImplTest, PrivateKeyMethodLoadFailureBothKeyAndMethod) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
NiceMock<Ssl::MockContextManager> context_manager;
NiceMock<Ssl::MockPrivateKeyMethodManager> private_key_method_manager;
auto private_key_method_provider_ptr =
std::make_shared<NiceMock<Ssl::MockPrivateKeyMethodProvider>>();
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
private_key_provider:
provider_name: mock_provider
typed_config:
"@type": type.googleapis.com/google.protobuf.Struct
value:
test_value: 100
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Certificate configuration can't have both private_key and private_key_provider");
}
TEST_F(ServerContextConfigImplTest, Pkcs12LoadFailureBothPkcs12AndMethod) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
NiceMock<Ssl::MockContextManager> context_manager;
NiceMock<Ssl::MockPrivateKeyMethodManager> private_key_method_manager;
auto private_key_method_provider_ptr =
std::make_shared<NiceMock<Ssl::MockPrivateKeyMethodProvider>>();
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- pkcs12:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns3_certkeychain.p12"
private_key_provider:
provider_name: mock_provider
typed_config:
"@type": type.googleapis.com/google.protobuf.Struct
value:
test_value: 100
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Certificate configuration can't have both pkcs12 and private_key_provider");
}
TEST_F(ServerContextConfigImplTest, Pkcs12LoadFailureBothPkcs12AndKey) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- pkcs12:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns3_certkeychain.p12"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_key.pem"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Certificate configuration can't have both pkcs12 and private_key");
}
TEST_F(ServerContextConfigImplTest, Pkcs12LoadFailureBothPkcs12AndCertChain) {
envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext tls_context;
const std::string tls_context_yaml = R"EOF(
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
pkcs12:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_dns3_certkeychain.p12"
)EOF";
TestUtility::loadFromYaml(TestEnvironment::substitute(tls_context_yaml), tls_context);
EXPECT_THROW_WITH_MESSAGE(
ServerContextConfigImpl server_context_config(tls_context, factory_context_), EnvoyException,
"Certificate configuration can't have both pkcs12 and certificate_chain");
}
// Subclass ContextImpl so we can instantiate directly from tests, despite the
// constructor being protected.
class TestContextImpl : public ContextImpl {
public:
TestContextImpl(Stats::Scope& scope, const Envoy::Ssl::ContextConfig& config,
TimeSource& time_source)
: ContextImpl(scope, config, time_source), pool_(scope.symbolTable()),
fallback_(pool_.add("fallback")) {}
void incCounter(absl::string_view name, absl::string_view value) {
ContextImpl::incCounter(pool_.add(name), value, fallback_);
}
Stats::StatNamePool pool_;
const Stats::StatName fallback_;
};
class SslContextStatsTest : public SslContextImplTest {
protected:
SslContextStatsTest() {
TestUtility::loadFromYaml(TestEnvironment::substitute(yaml), tls_context_);
client_context_config_ =
std::make_unique<ClientContextConfigImpl>(tls_context_, factory_context_);
context_ = std::make_unique<TestContextImpl>(store_, *client_context_config_, time_system_);
}
Stats::TestUtil::TestStore store_;
envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context_;
std::unique_ptr<ClientContextConfigImpl> client_context_config_;
std::unique_ptr<TestContextImpl> context_;
const std::string yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
)EOF";
};
TEST_F(SslContextStatsTest, IncOnlyKnownCounters) {
// Incrementing a value for a cipher that is part of the configuration works, and
// we'll be able to find the value in the stats store.
for (const auto& cipher :
{"TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256"}) {
// Test supported built-in TLS v1.3 cipher suites
// https://tools.ietf.org/html/rfc8446#appendix-B.4.
context_->incCounter("ssl.ciphers", cipher);
Stats::CounterOptConstRef stat =
store_.findCounterByString(absl::StrCat("ssl.ciphers.", cipher));
ASSERT_TRUE(stat.has_value());
EXPECT_EQ(1, stat->get().value());
}
// Incrementing a stat for a random unknown cipher does not work. A
// rate-limited error log message will also be generated but that is hard to
// test as it is dependent on timing and test-ordering.
EXPECT_DEBUG_DEATH(context_->incCounter("ssl.ciphers", "unexpected"),
"Unexpected ssl.ciphers value: unexpected");
EXPECT_FALSE(store_.findCounterByString("ssl.ciphers.unexpected"));
// We will account for the 'unexpected' cipher as "fallback", however in debug
// mode that will not work as the ENVOY_BUG macro will assert first, thus the
// fallback registration does not occur. So we test for the fallback only in
// release builds.
#ifdef NDEBUG
Stats::CounterOptConstRef stat = store_.findCounterByString("ssl.ciphers.fallback");
ASSERT_TRUE(stat.has_value());
EXPECT_EQ(1, stat->get().value());
#endif
} | 1673 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST_P | Envoy::Extensions::TransportSockets::Tls::TEST_P( SslSocketTest , FailedClientAuthSanVerification) | ['SslSocketTest', 'FailedClientAuthSanVerification'] | TEST_P(SslSocketTest, FailedClientAuthSanVerification) {
const std::string client_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/no_san_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/no_san_key.pem"
)EOF";
const std::string server_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
exact: "example.com"
)EOF";
TestUtilOptions test_options(client_ctx_yaml, server_ctx_yaml, false, GetParam());
testUtil(test_options.setExpectedServerStats("ssl.fail_verify_san"));
} | 154 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST_P | Envoy::Extensions::TransportSockets::Tls::TEST_P( SslSocketTest , FailedClientAuthSanVerificationNoClientCert) | ['SslSocketTest', 'FailedClientAuthSanVerificationNoClientCert'] | TEST_P(SslSocketTest, FailedClientAuthSanVerificationNoClientCert) {
const std::string client_ctx_yaml = R"EOF(
common_tls_context:
)EOF";
const std::string server_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
exact: "example.com"
)EOF";
TestUtilOptions test_options(client_ctx_yaml, server_ctx_yaml, false, GetParam());
testUtil(test_options.setExpectedServerStats("ssl.fail_verify_no_cert"));
} | 114 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST_P | Envoy::Extensions::TransportSockets::Tls::TEST_P( SslSocketTest , GetUriWithUriSan) | ['SslSocketTest', 'GetUriWithUriSan'] | TEST_P(SslSocketTest, GetUriWithUriSan) {
const std::string client_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/san_uri_key.pem"
)EOF";
const std::string server_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/ca_cert.pem"
match_subject_alt_names:
exact: "spiffe://lyft.com/test-team"
)EOF";
TestUtilOptions test_options(client_ctx_yaml, server_ctx_yaml, true, GetParam());
testUtil(test_options.setExpectedClientCertUri("spiffe://lyft.com/test-team")
.setExpectedSerialNumber(TEST_SAN_URI_CERT_SERIAL));
} | 139 | True | 1 |
CVE-2022-21656 | False | False | False | False | AV:N/AC:M/Au:N/C:P/I:P/A:N | NETWORK | MEDIUM | NONE | PARTIAL | PARTIAL | NONE | 5.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | HIGH | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 5.9 | MEDIUM | 2.2 | 3.6 | False | [{'url': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'name': 'https://github.com/envoyproxy/envoy/commit/bb95af848c939cfe5b5ee33c5b1770558077e64e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'name': 'https://github.com/envoyproxy/envoy/security/advisories/GHSA-c9g7-xwcv-pjx2', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'CWE-295'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:envoyproxy:envoy:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.20.2', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'Envoy is an open source edge and service proxy, designed for cloud-native applications. The default_validator.cc implementation used to implement the default certificate validation routines has a "type confusion" bug when processing subjectAltNames. This processing allows, for example, an rfc822Name or uniformResourceIndicator to be authenticated as a domain name. This confusion allows for the bypassing of nameConstraints, as processed by the underlying OpenSSL/BoringSSL implementation, exposing the possibility of impersonation of arbitrary servers. As a result Envoy will trust upstream certificates that should not be trusted.'}] | 2022-03-02T14:56Z | 2022-02-22T23:15Z | Improper Certificate Validation | The software does not validate, or incorrectly validates, a certificate. | When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.
| https://cwe.mitre.org/data/definitions/295.html | 0 | pradeepcrao | 2021-11-24 14:28:02+00:00 | Specify type for matching Subject Alternative Name. (#18628)
Signed-off-by: Pradeep Rao <[email protected]> | bb95af848c939cfe5b5ee33c5b1770558077e64e | False | envoyproxy/envoy | Cloud-native high-performance edge/middle/service proxy | 2016-08-08 15:07:24 | 2022-08-27 20:59:09 | https://www.envoyproxy.io | envoyproxy | 20284.0 | 3840.0 | Envoy::Extensions::TransportSockets::Tls::TEST_P | Envoy::Extensions::TransportSockets::Tls::TEST_P( SslSocketTest , Ipv4San) | ['SslSocketTest', 'Ipv4San'] | TEST_P(SslSocketTest, Ipv4San) {
const std::string client_ctx_yaml = R"EOF(
common_tls_context:
validation_context:
trusted_ca:
filename: "{{ test_rundir }}/test/config/integration/certs/upstreamcacert.pem"
match_subject_alt_names:
exact: "127.0.0.1"
)EOF";
const std::string server_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
certificate_chain:
filename: "{{ test_rundir }}/test/config/integration/certs/upstreamlocalhostcert.pem"
private_key:
filename: "{{ test_rundir }}/test/config/integration/certs/upstreamlocalhostkey.pem"
)EOF";
TestUtilOptions test_options(client_ctx_yaml, server_ctx_yaml, true, GetParam());
testUtil(test_options);
} | 107 | True | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.