Skip to content

Instantly share code, notes, and snippets.

@toddbirchard
Last active September 6, 2023 04:40
Show Gist options
  • Save toddbirchard/b6f86f03f6cf4fc9492ad4349ee7ff8b to your computer and use it in GitHub Desktop.
Save toddbirchard/b6f86f03f6cf4fc9492ad4349ee7ff8b to your computer and use it in GitHub Desktop.
"""Extract nested values from a JSON tree."""
def json_extract(obj, key):
"""Recursively fetch values from nested JSON."""
arr = []
def extract(obj, arr, key):
"""Recursively search for values of key in JSON tree."""
if isinstance(obj, dict):
for k, v in obj.items():
if isinstance(v, (dict, list)):
extract(v, arr, key)
elif k == key:
arr.append(v)
elif isinstance(obj, list):
for item in obj:
extract(item, arr, key)
return arr
values = extract(obj, arr, key)
return values
@dqharris6
Copy link

dqharris6 commented Apr 5, 2019

Is there any way to capture the position of the key that was found? I'm looking to pull the relative position of the key that was found, or somehow relate the data captured back to the structure of the original JSON.

@nikhilc2710
Copy link

thank you for this snippet greatly appreciated but when i trying to access key whole value is list or dict. it returning empty list
for ex extract_values(r.json,'rows')
it gives empty list

@ecallahan5
Copy link

thank you for this snippet greatly appreciated but when i trying to access key whole value is list or dict. it returning empty list
for ex extract_values(r.json,'rows')
it gives empty list

Agreed. To be more specific, in my case it seems to return values fine when the key refers to a single text value but returns an empty list when the key refers to a value which is another dictionary.

@mantig
Copy link

mantig commented Aug 8, 2019

Hello, i'm trying to parse through the json files from https://nvd.nist.gov/vuln/data-feeds.
Everything is deeply nested. I'll give this a try and see if it will work. Do you think there are any changes that i'll have to specify for it to work?
I just keep getting "CVE_items" as a column and a bunch of nested json data within the field.

@triwats
Copy link

triwats commented Feb 26, 2020

A sneaky yank from me... Nothing to see here...

@rravi-devhub
Copy link

thank you for this snippet greatly appreciated but when i trying to access key whole value is list or dict. it returning empty list
for ex extract_values(r.json,'rows')
it gives empty list

Agreed. To be more specific, in my case it seems to return values fine when the key refers to a single text value but returns an empty list when the key refers to a value which is another dictionary.

Hi, I see the same result. Returns an empty list when the value for the key is another list or dictionary. Is there a fix for this?

@Fjurg
Copy link

Fjurg commented Jun 16, 2020

Hey guys, I modified the function to this and it appears to be working as intended. I also modified the results to return a one-dimensional list instead of possibly nested lists:

`def extract_values(obj, key):
"""Recursively pull values of specified key from nested JSON."""
arr = []

def extract(obj, arr, key):
    """Return all matching values in an object."""
    if isinstance(obj, dict):
        for k, v in obj.items():
            if isinstance(v, (dict, list)):
                if k == key:
                    arr.append(v)
                extract(v, arr, key)
            elif k == key:
                arr.append(v)
    elif isinstance(obj, list):
        for item in obj:
            extract(item, arr, key)
    return arr

results = extract(obj, arr, key)
to_return = []
for result in results:
    if type(result) == list:
        for item in result:
            to_return.append(item)
    else:
        to_return.append(result)
return to_return`

@toddbirchard
Copy link
Author

Hello, i'm trying to parse through the json files from https://nvd.nist.gov/vuln/data-feeds.
Everything is deeply nested. I'll give this a try and see if it will work. Do you think there are any changes that i'll have to specify for it to work?
I just keep getting "CVE_items" as a column and a bunch of nested json data within the field.

Hey @mantig, I just tried parsing one of the JSON files from nvd.nist.gov using the json_extract() function. First I grabbed all version numbers:

import json
from extract import json_extract

data = json.loads(open('nvd.json').read())
my_values = json_extract(data, 'version')
print(my_values)

Here's what I got:

['2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '2.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.0', '2.0', '3.0', '2.0', '3.0', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0', '3.1', '2.0']

Then again with ID:

['CVE-2001-0054', 'CVE-2001-1463', 'CVE-2002-2393', 'CVE-2004-0330', 'CVE-2004-1675', 'CVE-2004-1992', 'CVE-2004-2111', 'CVE-2004-2532', 'CVE-2004-2533', 'CVE-2005-0850', 'CVE-2005-0851', 'CVE-2005-3467', 'CVE-2006-6565', 'CVE-2007-5199', 'CVE-2008-3077', 'CVE-2008-3255', 'CVE-2008-3272', 'CVE-2008-3496', 'CVE-2008-3534', 'CVE-2008-3535', 'CVE-2008-3731', 'CVE-2008-4500', 'CVE-2008-4501', 'CVE-2009-0884', 'CVE-2009-0967', 'CVE-2009-1031', 'CVE-2009-3097', 'CVE-2009-3655', 'CVE-2009-4006', 'CVE-2009-4815', 'CVE-2010-0751', 'CVE-2010-1822', 'CVE-2010-1823', 'CVE-2010-1824', 'CVE-2010-1825', 'CVE-2010-2295', 'CVE-2010-2296', 'CVE-2010-2297', 'CVE-2010-2298', 'CVE-2010-2299', 'CVE-2010-2300', 'CVE-2010-2302', 'CVE-2010-2434', 'CVE-2010-2495', 'CVE-2010-2897', 'CVE-2010-2898', 'CVE-2010-2899', 'CVE-2010-2901', 'CVE-2010-2902', 'CVE-2010-2903', 'CVE-2010-3111', 'CVE-2010-3112', 'CVE-2010-3113', 'CVE-2010-3114', 'CVE-2010-3115', 'CVE-2010-3116', 'CVE-2010-3117', 'CVE-2010-3118', 'CVE-2010-3119', 'CVE-2010-3120', 'CVE-2010-3246', 'CVE-2010-3247', 'CVE-2010-3248', 'CVE-2010-3249', 'CVE-2010-3250', 'CVE-2010-3251', 'CVE-2010-3252', 'CVE-2010-3253', 'CVE-2010-3254', 'CVE-2010-3255', 'CVE-2010-3256', 'CVE-2010-3257', 'CVE-2010-3258', 'CVE-2010-3259', 'CVE-2010-3411', 'CVE-2010-3412', 'CVE-2010-3413', 'CVE-2010-3414', 'CVE-2010-3415', 'CVE-2010-3416', 'CVE-2010-3417', 'CVE-2010-3729', 'CVE-2010-3730', 'CVE-2010-4038', 'CVE-2010-4039', 'CVE-2010-4040', 'CVE-2010-4041', 'CVE-2010-4042', 'CVE-2010-4197', 'CVE-2010-4198', 'CVE-2010-4199', 'CVE-2010-4201', 'CVE-2010-4202', 'CVE-2010-4203', 'CVE-2010-4204', 'CVE-2010-4205', 'CVE-2010-4206', 'CVE-2010-4251', 'CVE-2010-4487', 'CVE-2010-4492', 'CVE-2010-4493', 'CVE-2010-4494', 'CVE-2010-4574', 'CVE-2010-4575', 'CVE-2010-4576', 'CVE-2010-4577', 'CVE-2010-4578', 'CVE-2010-4656', 'CVE-2010-4805', 'CVE-2011-0463', 'CVE-2011-1013', 'CVE-2011-1019', 'CVE-2011-1076', 'CVE-2011-1093', 'CVE-2011-1169', 'CVE-2011-1173', 'CVE-2011-1182', 'CVE-2011-1478', 'CVE-2011-1573', 'CVE-2011-1581', 'CVE-2011-1593', 'CVE-2011-1598', 'CVE-2011-1640', 'CVE-2011-1745', 'CVE-2011-1746', 'CVE-2011-1747', 'CVE-2011-1748', 'CVE-2011-2022', 'CVE-2011-2057', 'CVE-2011-2058', 'CVE-2011-2184', 'CVE-2011-2189', 'CVE-2011-2213', 'CVE-2011-2482', 'CVE-2011-2491', 'CVE-2011-2492', 'CVE-2011-2497', 'CVE-2011-2517', 'CVE-2011-2521', 'CVE-2011-2525', 'CVE-2011-2689', 'CVE-2011-2695', 'CVE-2011-2699', 'CVE-2011-2700', 'CVE-2011-2707', 'CVE-2011-2723', 'CVE-2011-2898', 'CVE-2011-2906', 'CVE-2011-2918', 'CVE-2011-2928', 'CVE-2011-3188', 'CVE-2011-3191', 'CVE-2011-3193', 'CVE-2011-3353', 'CVE-2011-3638', 'CVE-2011-4080', 'CVE-2011-4081', 'CVE-2011-4097', 'CVE-2011-4112', 'CVE-2011-4326', 'CVE-2011-4367', 'CVE-2011-4594', 'CVE-2011-4611', 'CVE-2011-4800', 'CVE-2012-0038', 'CVE-2012-0044', 'CVE-2012-0058', 'CVE-2012-0207', 'CVE-2012-0247', 'CVE-2012-0248', 'CVE-2012-0259', 'CVE-2012-0260', 'CVE-2012-0381', 'CVE-2012-0382', 'CVE-2012-0823', 'CVE-2012-0879', 'CVE-2012-1185', 'CVE-2012-1186', 'CVE-2012-1610', 'CVE-2012-1798', 'CVE-2012-3160', 'CVE-2012-3177', 'CVE-2012-3552', 'CVE-2012-6636', 'CVE-2013-0744', 'CVE-2013-0746', 'CVE-2013-0748', 'CVE-2013-0750', 'CVE-2013-0753', 'CVE-2013-0754', 'CVE-2013-0758', 'CVE-2013-0759', 'CVE-2013-0762', 'CVE-2013-0763', 'CVE-2013-1142', 'CVE-2013-1943', 'CVE-2013-2128', 'CVE-2013-4366', 'CVE-2013-4588', 'CVE-2014-0160', 'CVE-2014-0224', 'CVE-2014-1490', 'CVE-2014-1491', 'CVE-2014-1496', 'CVE-2014-1505', 'CVE-2014-1508', 'CVE-2014-1509', 'CVE-2014-1510', 'CVE-2014-1511', 'CVE-2014-1514', 'CVE-2014-1766', 'CVE-2014-7255', 'CVE-2014-9410', 'CVE-2014-9512', 'CVE-2014-9758', 'CVE-2015-0568', 'CVE-2015-0569', 'CVE-2015-0570', 'CVE-2015-0571', 'CVE-2015-0572', 'CVE-2015-0573', 'CVE-2015-1350', 'CVE-2015-3890', 'CVE-2015-4027', 'CVE-2015-4173', 'CVE-2015-7714', 'CVE-2015-7715', 'CVE-2015-8900', 'CVE-2015-8901', 'CVE-2015-8902', 'CVE-2015-8903', 'CVE-2015-9098', 'CVE-2015-9233', 'CVE-2015-9542', 'CVE-2015-9549', 'CVE-2016-10402', 'CVE-2016-2059', 'CVE-2016-2061', 'CVE-2016-2062', 'CVE-2016-2064', 'CVE-2016-2065', 'CVE-2016-2067', 'CVE-2016-2068', 'CVE-2016-5340', 'CVE-2016-5342', 'CVE-2016-5343', 'CVE-2016-5344', 'CVE-2016-5556', 'CVE-2016-5568', 'CVE-2016-5582', 'CVE-2016-5870', 'CVE-2016-8827', 'CVE-2016-9085', 'CVE-2016-9840', 'CVE-2016-9841', 'CVE-2016-9842', 'CVE-2016-9843', 'CVE-2017-1000009', 'CVE-2017-1000010', 'CVE-2017-1000068', 'CVE-2017-1000119', 'CVE-2017-1000193', 'CVE-2017-1000194', 'CVE-2017-1000195', 'CVE-2017-1000196', 'CVE-2017-1000197', 'CVE-2017-11104', 'CVE-2017-11464', 'CVE-2017-12122', 'CVE-2017-14245', 'CVE-2017-14246', 'CVE-2017-14440', 'CVE-2017-14441', 'CVE-2017-14442', 'CVE-2017-14448', 'CVE-2017-14449', 'CVE-2017-14450', 'CVE-2017-14702', 'CVE-2017-15284', 'CVE-2017-15376', 'CVE-2017-16244', 'CVE-2017-16821', 'CVE-2017-17458', 'CVE-2017-18112', 'CVE-2017-18923', 'CVE-2017-2718', 'CVE-2017-5645', 'CVE-2017-5878', 'CVE-2017-5972', 'CVE-2017-6311', 'CVE-2017-6312', 'CVE-2017-6313', 'CVE-2017-6314', 'CVE-2017-6519', 'CVE-2017-6743', 'CVE-2017-7442', 'CVE-2017-7656', 'CVE-2017-7657', 'CVE-2017-7658', 'CVE-2017-7950', 'CVE-2017-9334', 'CVE-2017-9585', 'CVE-2017-9591', 'CVE-2018-0739', 'CVE-2018-1000049', 'CVE-2018-1000132', 'CVE-2018-1000500', 'CVE-2018-1000544', 'CVE-2018-1000549', 'CVE-2018-1000550', 'CVE-2018-1000671', 'CVE-2018-10756', 'CVE-2018-1152', 'CVE-2018-11695', 'CVE-2018-12437', 'CVE-2018-12538', 'CVE-2018-1285', 'CVE-2018-13346', 'CVE-2018-13347', 'CVE-2018-13348', 'CVE-2018-14498', 'CVE-2018-14647', 'CVE-2018-15686', 'CVE-2018-15750', 'CVE-2018-15751', 'CVE-2018-16402', 'CVE-2018-18823', 'CVE-2018-18824', 'CVE-2018-19360', 'CVE-2018-19361', 'CVE-2018-19362', 'CVE-2018-1999008', 'CVE-2018-1999009', 'CVE-2018-20685', 'CVE-2018-3628', 'CVE-2018-3629', 'CVE-2018-3632', 'CVE-2018-3837', 'CVE-2018-3838', 'CVE-2018-3839', 'CVE-2018-3977', 'CVE-2018-6594', 'CVE-2018-6892', 'CVE-2018-7198', 'CVE-2019-1010091', 'CVE-2019-1010247', 'CVE-2019-10160', 'CVE-2019-10580', 'CVE-2019-10646', 'CVE-2019-11252', 'CVE-2019-11286', 'CVE-2019-11411', 'CVE-2019-11412', 'CVE-2019-11413', 'CVE-2019-11485', 'CVE-2019-12380', 'CVE-2019-12520', 'CVE-2019-12523', 'CVE-2019-12524', 'CVE-2019-13312', 'CVE-2019-13510', 'CVE-2019-13565', 'CVE-2019-14037', 'CVE-2019-14077', 'CVE-2019-14093', 'CVE-2019-14099', 'CVE-2019-14100', 'CVE-2019-14101', 'CVE-2019-14123', 'CVE-2019-14124', 'CVE-2019-14130', 'CVE-2019-14379', 'CVE-2019-14540', 'CVE-2019-14857', 'CVE-2019-14892', 'CVE-2019-14893', 'CVE-2019-15942', 'CVE-2019-16056', 'CVE-2019-16089', 'CVE-2019-16335', 'CVE-2019-16942', 'CVE-2019-16943', 'CVE-2019-17113', 'CVE-2019-17267', 'CVE-2019-17531', 'CVE-2019-17571', 'CVE-2019-18618', 'CVE-2019-18619', 'CVE-2019-18676', 'CVE-2019-19036', 'CVE-2019-19039', 'CVE-2019-19318', 'CVE-2019-19377', 'CVE-2019-19453', 'CVE-2019-19454', 'CVE-2019-19455', 'CVE-2019-19456', 'CVE-2019-19462', 'CVE-2019-19813', 'CVE-2019-19816', 'CVE-2019-20001', 'CVE-2019-20025', 'CVE-2019-20026', 'CVE-2019-20027', 'CVE-2019-20028', 'CVE-2019-20029', 'CVE-2019-20030', 'CVE-2019-20031', 'CVE-2019-20032', 'CVE-2019-20033', 'CVE-2019-20330', 'CVE-2019-20444', 'CVE-2019-20445', 'CVE-2019-20446', 'CVE-2019-20479', 'CVE-2019-20810', 'CVE-2019-20907', 'CVE-2019-20908', 'CVE-2019-3832', 'CVE-2019-3902', 'CVE-2019-4366', 'CVE-2019-4589', 'CVE-2019-4731', 'CVE-2019-5010', 'CVE-2019-5429', 'CVE-2019-7148', 'CVE-2019-9948', 'CVE-2020-0642', 'CVE-2020-10136', 'CVE-2020-10600', 'CVE-2020-10602', 'CVE-2020-10604', 'CVE-2020-10606', 'CVE-2020-10608', 'CVE-2020-10609', 'CVE-2020-10610', 'CVE-2020-10614', 'CVE-2020-10643', 'CVE-2020-10683', 'CVE-2020-10711', 'CVE-2020-10713', 'CVE-2020-10730', 'CVE-2020-10731', 'CVE-2020-10732', 'CVE-2020-10756', 'CVE-2020-10757', 'CVE-2020-10761', 'CVE-2020-10917', 'CVE-2020-10918', 'CVE-2020-10919', 'CVE-2020-10920', 'CVE-2020-10921', 'CVE-2020-10922', 'CVE-2020-10923', 'CVE-2020-10924', 'CVE-2020-10925', 'CVE-2020-10926', 'CVE-2020-10927', 'CVE-2020-10928', 'CVE-2020-10929', 'CVE-2020-10930', 'CVE-2020-10936', 'CVE-2020-10945', 'CVE-2020-10982', 'CVE-2020-10983', 'CVE-2020-10984', 'CVE-2020-10985', 'CVE-2020-11078', 'CVE-2020-11083', 'CVE-2020-11095', 'CVE-2020-11096', 'CVE-2020-11097', 'CVE-2020-11098', 'CVE-2020-11099', 'CVE-2020-11110', 'CVE-2020-11440', 'CVE-2020-1147', 'CVE-2020-11474', 'CVE-2020-11476', 'CVE-2020-11583', 'CVE-2020-11584', 'CVE-2020-11623', 'CVE-2020-11624', 'CVE-2020-11625', 'CVE-2020-11655', 'CVE-2020-11656', 'CVE-2020-11749', 'CVE-2020-11932', 'CVE-2020-11933', 'CVE-2020-11934', 'CVE-2020-12007', 'CVE-2020-12009', 'CVE-2020-12011', 'CVE-2020-12013', 'CVE-2020-12081', 'CVE-2020-12284', 'CVE-2020-12399', 'CVE-2020-12402', 'CVE-2020-12460', 'CVE-2020-12499', 'CVE-2020-12620', 'CVE-2020-12638', 'CVE-2020-12739', 'CVE-2020-12762', 'CVE-2020-12770', 'CVE-2020-12812', 'CVE-2020-12845', 'CVE-2020-12880', 'CVE-2020-13143', 'CVE-2020-13151', 'CVE-2020-13361', 'CVE-2020-13362', 'CVE-2020-13404', 'CVE-2020-13434', 'CVE-2020-13435', 'CVE-2020-13522', 'CVE-2020-13523', 'CVE-2020-13625', 'CVE-2020-13630', 'CVE-2020-13631', 'CVE-2020-13632', 'CVE-2020-13659', 'CVE-2020-13692', 'CVE-2020-13699', 'CVE-2020-13776', 'CVE-2020-13790', 'CVE-2020-13800', 'CVE-2020-13819', 'CVE-2020-13820', 'CVE-2020-13867', 'CVE-2020-13904', 'CVE-2020-13913', 'CVE-2020-13914', 'CVE-2020-13915', 'CVE-2020-13916', 'CVE-2020-13917', 'CVE-2020-13918', 'CVE-2020-13919', 'CVE-2020-13921', 'CVE-2020-13934', 'CVE-2020-13935', 'CVE-2020-13970', 'CVE-2020-13971', 'CVE-2020-13974', 'CVE-2020-13997', 'CVE-2020-14001', 'CVE-2020-14039', 'CVE-2020-14093', 'CVE-2020-14152', 'CVE-2020-14154', 'CVE-2020-14158', 'CVE-2020-14162', 'CVE-2020-14212', 'CVE-2020-1425', 'CVE-2020-14297', 'CVE-2020-14307', 'CVE-2020-14308', 'CVE-2020-14309', 'CVE-2020-14310', 'CVE-2020-14311', 'CVE-2020-14316', 'CVE-2020-14319', 'CVE-2020-14334', 'CVE-2020-14337', 'CVE-2020-14344', 'CVE-2020-14347', 'CVE-2020-14399', 'CVE-2020-14400', 'CVE-2020-14401', 'CVE-2020-14403', 'CVE-2020-14405', 'CVE-2020-14422', 'CVE-2020-14486', 'CVE-2020-14487', 'CVE-2020-14488', 'CVE-2020-14489', 'CVE-2020-14490', 'CVE-2020-14492', 'CVE-2020-14493', 'CVE-2020-14520', 'CVE-2020-14539', 'CVE-2020-14540', 'CVE-2020-14547', 'CVE-2020-14550', 'CVE-2020-14553', 'CVE-2020-14556', 'CVE-2020-14559', 'CVE-2020-14562', 'CVE-2020-14568', 'CVE-2020-1457', 'CVE-2020-14573', 'CVE-2020-14575', 'CVE-2020-14576', 'CVE-2020-14577', 'CVE-2020-14578', 'CVE-2020-14579', 'CVE-2020-14581', 'CVE-2020-14583', 'CVE-2020-14586', 'CVE-2020-14591', 'CVE-2020-14593', 'CVE-2020-14597', 'CVE-2020-14619', 'CVE-2020-14620', 'CVE-2020-14621', 'CVE-2020-14623', 'CVE-2020-14624', 'CVE-2020-14631', 'CVE-2020-14632', 'CVE-2020-14633', 'CVE-2020-14634', 'CVE-2020-14641', 'CVE-2020-14643', 'CVE-2020-14651', 'CVE-2020-14654', 'CVE-2020-14656', 'CVE-2020-14663', 'CVE-2020-14678', 'CVE-2020-14680', 'CVE-2020-14697', 'CVE-2020-14702', 'CVE-2020-14725', 'CVE-2020-14928', 'CVE-2020-14954', 'CVE-2020-15009', 'CVE-2020-15038', 'CVE-2020-15085', 'CVE-2020-15086', 'CVE-2020-15092', 'CVE-2020-15098', 'CVE-2020-15099', 'CVE-2020-15101', 'CVE-2020-15103', 'CVE-2020-15106', 'CVE-2020-15109', 'CVE-2020-15111', 'CVE-2020-15112', 'CVE-2020-15113', 'CVE-2020-15118', 'CVE-2020-15120', 'CVE-2020-15125', 'CVE-2020-15126', 'CVE-2020-15127', 'CVE-2020-15128', 'CVE-2020-15129', 'CVE-2020-15130', 'CVE-2020-15131', 'CVE-2020-15132', 'CVE-2020-15133', 'CVE-2020-15134', 'CVE-2020-15135', 'CVE-2020-15358', 'CVE-2020-15366', 'CVE-2020-15408', 'CVE-2020-15416', 'CVE-2020-15417', 'CVE-2020-15418', 'CVE-2020-15419', 'CVE-2020-15420', 'CVE-2020-15421', 'CVE-2020-15422', 'CVE-2020-15423', 'CVE-2020-15424', 'CVE-2020-15425', 'CVE-2020-15426', 'CVE-2020-15427', 'CVE-2020-15428', 'CVE-2020-15429', 'CVE-2020-15430', 'CVE-2020-15431', 'CVE-2020-15432', 'CVE-2020-15433', 'CVE-2020-15434', 'CVE-2020-15435', 'CVE-2020-15467', 'CVE-2020-15492', 'CVE-2020-15497', 'CVE-2020-15503', 'CVE-2020-15511', 'CVE-2020-15586', 'CVE-2020-15588', 'CVE-2020-15592', 'CVE-2020-15593', 'CVE-2020-15606', 'CVE-2020-15607', 'CVE-2020-15608', 'CVE-2020-15609', 'CVE-2020-15610', 'CVE-2020-15611', 'CVE-2020-15612', 'CVE-2020-15613', 'CVE-2020-15614', 'CVE-2020-15615', 'CVE-2020-15616', 'CVE-2020-15617', 'CVE-2020-15618', 'CVE-2020-15619', 'CVE-2020-15620', 'CVE-2020-15621', 'CVE-2020-15622', 'CVE-2020-15623', 'CVE-2020-15624', 'CVE-2020-15625', 'CVE-2020-15626', 'CVE-2020-15627', 'CVE-2020-15628', 'CVE-2020-15631', 'CVE-2020-15632', 'CVE-2020-15633', 'CVE-2020-15705', 'CVE-2020-15706', 'CVE-2020-15707', 'CVE-2020-15712', 'CVE-2020-15713', 'CVE-2020-15714', 'CVE-2020-15715', 'CVE-2020-15719', 'CVE-2020-15778', 'CVE-2020-15780', 'CVE-2020-15801', 'CVE-2020-15803', 'CVE-2020-15860', 'CVE-2020-15863', 'CVE-2020-15869', 'CVE-2020-15870', 'CVE-2020-15871', 'CVE-2020-15882', 'CVE-2020-15888', 'CVE-2020-15890', 'CVE-2020-15899', 'CVE-2020-15900', 'CVE-2020-15904', 'CVE-2020-15912', 'CVE-2020-15917', 'CVE-2020-15932', 'CVE-2020-15943', 'CVE-2020-15944', 'CVE-2020-15945', 'CVE-2020-15953', 'CVE-2020-15954', 'CVE-2020-15956', 'CVE-2020-15957', 'CVE-2020-16088', 'CVE-2020-16094', 'CVE-2020-16095', 'CVE-2020-16116', 'CVE-2020-16117', 'CVE-2020-16118', 'CVE-2020-16131', 'CVE-2020-16134', 'CVE-2020-16135', 'CVE-2020-16136', 'CVE-2020-1614', 'CVE-2020-16143', 'CVE-2020-16157', 'CVE-2020-16162', 'CVE-2020-16163', 'CVE-2020-16164', 'CVE-2020-16165', 'CVE-2020-16166', 'CVE-2020-16192', 'CVE-2020-16199', 'CVE-2020-16201', 'CVE-2020-16203', 'CVE-2020-16252', 'CVE-2020-16253', 'CVE-2020-16254', 'CVE-2020-16269', 'CVE-2020-16271', 'CVE-2020-16272', 'CVE-2020-1652', 'CVE-2020-16843', 'CVE-2020-16847', 'CVE-2020-17353', 'CVE-2020-17364', 'CVE-2020-17366', 'CVE-2020-1945', 'CVE-2020-2076', 'CVE-2020-2077', 'CVE-2020-2078', 'CVE-2020-3187', 'CVE-2020-3327', 'CVE-2020-3350', 'CVE-2020-3374', 'CVE-2020-3375', 'CVE-2020-3376', 'CVE-2020-3377', 'CVE-2020-3382', 'CVE-2020-3383', 'CVE-2020-3384', 'CVE-2020-3386', 'CVE-2020-3452', 'CVE-2020-3460', 'CVE-2020-3461', 'CVE-2020-3462', 'CVE-2020-3481', 'CVE-2020-3671', 'CVE-2020-3681', 'CVE-2020-3688', 'CVE-2020-3698', 'CVE-2020-3699', 'CVE-2020-3700', 'CVE-2020-3701', 'CVE-2020-3902', 'CVE-2020-4030', 'CVE-2020-4031', 'CVE-2020-4032', 'CVE-2020-4033', 'CVE-2020-4044', 'CVE-2020-4185', 'CVE-2020-4186', 'CVE-2020-4243', 'CVE-2020-4317', 'CVE-2020-4318', 'CVE-2020-4319', 'CVE-2020-4328', 'CVE-2020-4375', 'CVE-2020-4377', 'CVE-2020-4396', 'CVE-2020-4405', 'CVE-2020-4408', 'CVE-2020-4410', 'CVE-2020-4459', 'CVE-2020-4463', 'CVE-2020-4465', 'CVE-2020-4481', 'CVE-2020-4498', 'CVE-2020-4525', 'CVE-2020-4534', 'CVE-2020-4542', 'CVE-2020-4549', 'CVE-2020-4550', 'CVE-2020-4551', 'CVE-2020-4552', 'CVE-2020-4553', 'CVE-2020-4554', 'CVE-2020-4560', 'CVE-2020-4567', 'CVE-2020-4569', 'CVE-2020-4572', 'CVE-2020-4573', 'CVE-2020-4574', 'CVE-2020-4631', 'CVE-2020-4644', 'CVE-2020-4645', 'CVE-2020-5295', 'CVE-2020-5296', 'CVE-2020-5297', 'CVE-2020-5298', 'CVE-2020-5299', 'CVE-2020-5377', 'CVE-2020-5384', 'CVE-2020-5396', 'CVE-2020-5413', 'CVE-2020-5414', 'CVE-2020-5608', 'CVE-2020-5609', 'CVE-2020-5610', 'CVE-2020-5612', 'CVE-2020-5613', 'CVE-2020-5614', 'CVE-2020-5615', 'CVE-2020-5616', 'CVE-2020-5617', 'CVE-2020-5760', 'CVE-2020-5761', 'CVE-2020-5762', 'CVE-2020-5763', 'CVE-2020-5770', 'CVE-2020-5771', 'CVE-2020-5772', 'CVE-2020-5773', 'CVE-2020-5902', 'CVE-2020-6012', 'CVE-2020-6096', 'CVE-2020-6098', 'CVE-2020-6102', 'CVE-2020-6463', 'CVE-2020-6510', 'CVE-2020-6511', 'CVE-2020-6512', 'CVE-2020-6513', 'CVE-2020-6514', 'CVE-2020-6515', 'CVE-2020-6516', 'CVE-2020-6517', 'CVE-2020-6518', 'CVE-2020-6519', 'CVE-2020-6520', 'CVE-2020-6521', 'CVE-2020-6522', 'CVE-2020-6523', 'CVE-2020-6524', 'CVE-2020-6525', 'CVE-2020-6526', 'CVE-2020-6527', 'CVE-2020-6528', 'CVE-2020-6529', 'CVE-2020-6530', 'CVE-2020-6531', 'CVE-2020-6533', 'CVE-2020-6534', 'CVE-2020-6535', 'CVE-2020-6536', 'CVE-2020-7016', 'CVE-2020-7017', 'CVE-2020-7205', 'CVE-2020-7298', 'CVE-2020-7457', 'CVE-2020-7483', 'CVE-2020-7484', 'CVE-2020-7485', 'CVE-2020-7486', 'CVE-2020-7491', 'CVE-2020-7520', 'CVE-2020-7637', 'CVE-2020-7685', 'CVE-2020-7694', 'CVE-2020-7695', 'CVE-2020-7697', 'CVE-2020-7698', 'CVE-2020-7699', 'CVE-2020-7822', 'CVE-2020-7823', 'CVE-2020-7827', 'CVE-2020-7828', 'CVE-2020-7829', 'CVE-2020-8010', 'CVE-2020-8012', 'CVE-2020-8108', 'CVE-2020-8174', 'CVE-2020-8192', 'CVE-2020-8202', 'CVE-2020-8203', 'CVE-2020-8204', 'CVE-2020-8206', 'CVE-2020-8207', 'CVE-2020-8213', 'CVE-2020-8216', 'CVE-2020-8217', 'CVE-2020-8218', 'CVE-2020-8219', 'CVE-2020-8220', 'CVE-2020-8221', 'CVE-2020-8222', 'CVE-2020-8317', 'CVE-2020-8326', 'CVE-2020-8553', 'CVE-2020-8557', 'CVE-2020-8558', 'CVE-2020-8574', 'CVE-2020-8575', 'CVE-2020-8607', 'CVE-2020-8816', 'CVE-2020-8840', 'CVE-2020-9036', 'CVE-2020-9077', 'CVE-2020-9248', 'CVE-2020-9249', 'CVE-2020-9251', 'CVE-2020-9480', 'CVE-2020-9689', 'CVE-2020-9690', 'CVE-2020-9691', 'CVE-2020-9692']

@lsaiken
Copy link

lsaiken commented Sep 10, 2020

Why not return arr from json_extract and remove returning it from extract since lists are mutable?

@selfcontrol7
Copy link

Awsome code. Thank's a lot, you save me hours of coding!!!!

@mark2m60
Copy link

mark2m60 commented Dec 3, 2021

This was great. Saved ton of time. Was able to modify an return 3 fields from 1 obj. Thank you!

@selfcontrol7
Copy link

Hello @Fjurg .
Thank you for your work. Your code works like a charm

@gstewart86
Copy link

Super useful function, thanks all. Here's @Fjurg 's code with added type hinting and more explicit parameter names

 from typing import Dict, List, Union, Any


def extract_values(object_to_search: Union[Dict[Any, Any], List[Any]], search_key: str) -> List:
    """Recursively pull values of specified key from nested JSON."""
    results_array: List = []

    def extract(object_to_search: Union[Dict[Any, Any], List[Any]], results_array: List[Any], search_key: str) -> List:
        """Return all matching values in an object."""
        if isinstance(object_to_search, dict):
            for key, val in object_to_search.items():
                if isinstance(val, (dict, list)):
                    if key == search_key:
                        results_array.append(val)
                    extract(val, results_array, search_key)
                elif key == search_key:
                    results_array.append(val)
        elif isinstance(object_to_search, list):
            for item in object_to_search:
                extract(item, results_array, search_key)
        return results_array

    results = extract(object_to_search, results_array, search_key)
    to_return = []
    for result in results:
        if type(result) == list:
            for item in result:
                to_return.append(item)
        else:
            to_return.append(result)
    return to_return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment