Is there a RESTful API for the Ubuntu CVE Tracker?
Solution 1:
The best API for CVEs I have found so far is at https://www.circl.lu/services/cve-search/. For example, if we want to use the API to get information about CVE-2016-7395, we run
curl http://cve.circl.lu/api/cve/CVE-2016-7395
which returns a JSON given by
{
"Modified": "2016-09-11T06:59:26.727-04:00",
"Published": "2016-09-11T06:59:25.337-04:00",
"capec": [
{
"id": "230",
"name": "XML Nested Payloads",
"prerequisites": [
"An application uses an XML parser to perform transformation on user-controllable data.",
"An application does not perform sufficient validation to ensure that user-controllable data is safe for an XML parser."
],
"related_weakness": [
"112",
"20",
"19",
"674",
"770"
],
"solutions": [
"Carefully validate and sanitize all user-controllable data prior to passing it to the XML parser routine. Ensure that the resultant data is safe to pass to the XML parser.",
"Perform validation on canonical data.",
"Pick a robust implementation of an XML parser.",
"Validate XML against a valid schema or DTD prior to parsing."
],
"summary": [
"Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. By nesting XML data and causing this data to be continuously self-referential, an attacker can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization. An attacker's goal is to leverage parser failure to his or her advantage. In most cases this type of an attack will result in a denial of service due to an application becoming unstable, freezing, or crash. However it may be possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [R.230.1]."
]
},
{
"id": "231",
"name": "XML Oversized Payloads",
"prerequisites": [
"An application uses an XML parser to perform transformation on user-controllable data.",
"An application does not perform sufficient validation to ensure that user-controllable data is safe for an XML parser."
],
"related_weakness": [
"112",
"20",
"19",
"674",
"770"
],
"solutions": [
"Carefully validate and sanitize all user-controllable data prior to passing it to the XML parser routine. Ensure that the resultant data is safe to pass to the XML parser.",
"Perform validation on canonical data.",
"Pick a robust implementation of an XML parser.",
"Validate XML against a valid schema or DTD prior to parsing."
],
"summary": [
"Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. By supplying oversized payloads in input vectors that will be processed by the XML parser, an attacker can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization, and potentially cause execution of arbitrary code. An attacker's goal is to leverage parser failure to his or her advantage. In many cases this type of an attack will result in a denial of service due to an application becoming unstable, freezing, or crash. However it is possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [R.231.1]."
]
},
{
"id": "484",
"name": "XML Client-Side Attack",
"prerequisites": [
"An application uses an XML parser to perform transformation on user-controllable data.",
"An application does not perform sufficient validation to ensure that user-controllable data is safe for an XML parser."
],
"related_weakness": [
"112",
"20",
"19"
],
"solutions": [
"Carefully validate and sanitize all user-controllable data prior to passing it to the XML parser routine. Ensure that the resultant data is safe to pass to the XML parser.",
"The client software should have the latest patches and should be audited for vulnerabilities before being used to communicate with potentially hostile servers."
],
"summary": [
"Client applications such as web browsers that process HTML data often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintended system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser. [R.484.1]"
]
},
{
"id": "99",
"name": "XML Parser Attack",
"prerequisites": [
"An application uses an XML parser to perform transformation on user-controllable data.",
"An application does not perform sufficient validation to ensure that user-controllable data is safe for an XML parser."
],
"related_weakness": [
"112",
"20",
"19",
"674",
"770"
],
"solutions": [
"Carefully validate and sanitize all user-controllable data prior to passing it to the XML parser routine. Ensure that the resultant data is safe to pass to the XML parser.",
"Perform validation on canonical data.",
"Pick a robust implementation of an XML parser.",
"Validate XML against a valid schema or DTD prior to parsing."
],
"summary": [
"Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintended system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser. [R.99.1]"
]
},
{
"id": "100",
"name": "Overflow Buffers",
"prerequisites": [
"Targeted software performs buffer operations.",
"Targeted software inadequately performs bounds-checking on buffer operations.",
"Attacker has the capability to influence the input to buffer operations."
],
"related_weakness": [
"120",
"119",
"131",
"129",
"805",
"19",
"680"
],
"solutions": [
"Use a language or compiler that performs automatic bounds checking.",
"Use secure functions not vulnerable to buffer overflow.",
"If you have to use dangerous functions, make sure that you do boundary checking.",
"Compiler-based canary mechanisms such as StackGuard, ProPolice and the Microsoft Visual Studio /GS flag. Unless this provides automatic bounds checking, it is not a complete solution.",
"Use OS-level preventative functionality. Not a complete solution.",
"Utilize static source code analysis tools to identify potential buffer overflow weaknesses in the software."
],
"summary": [
"Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice."
]
}
],
"cvss": 6.8,
"cwe": "CWE-19",
"id": "CVE-2016-7395",
"last-modified": "2016-09-12T13:43:31.873-04:00",
"ranking": [
[
{
"circl": 2
}
]
],
"references": [
"https://codereview.chromium.org/2006143009",
"https://crbug.com/613918",
"https://googlechromereleases.blogspot.com/2016/08/stable-channel-update-for-desktop_31.html"
],
"summary": "SkPath.cpp in Skia, as used in Google Chrome before 53.0.2785.89 on Windows and OS X and before 53.0.2785.92 on Linux, does not properly validate the return values of ChopMonoAtY calls, which allows remote attackers to cause a denial of service (uninitialized memory access and application crash) or possibly have unspecified other impact via crafted graphics data.",
"vulnerable_configuration": [
{
"id": "cpe:2.3:a:google:chrome:52.0.2743.116",
"title": "Google Chrome 52.0.2743.116"
}
],
"vulnerable_configuration_cpe_2_2": [
"cpe:/a:google:chrome:52.0.2743.116"
]
}
Visit https://www.circl.lu/services/cve-search/ for more information about how to use the API.
Solution 2:
Disclaimer: I work on Metadefender.com as software engineer
At Metadefender.com we provide set of CVE focused APIs. There is limited number of free API calls to the CVE endpoints. You just have to register on OPSWAT Portal to obtain the key.
Vulnerability Lookup by file hash
Documentation for this endpoint
curl -XGET -H "Authorization: apikey YOUR_API_KEY" "https://api.metadefender.com/v3/vulnerability/B075602CF6BCB3284C44A640DAFFA49CC5AA8F469A20E4B242F2DDE85FCB4DB"
{
"success":true,
"data":[
{
"description":"Use-after-free vulnerability in Google Chrome before 8.0.552.215 allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors involving SVG animations.",
"severity":"CRITICAL",
"severity_index":5,
"cvss":{
"generated-on-datetime":"2015-11-13T10:32:35.623-05:00",
"source":"http://nvd.nist.gov",
"availablity-impact":"",
"integrity-impact":"COMPLETE",
"confidentiality-impact":"COMPLETE",
"authentication":"NONE",
"access-complexity":"LOW",
"access-vector":"NETWORK",
"score":"10.0"
},
"references":[
[
{
"name":"DSA-2188",
"url":"http://www.debian.org/security/2011/dsa-2188"
}
],
...
],
"last-modified-epoch":1447432729,
"last-modified-datetime":"2015-11-13T11:38:49.100-05:00",
"published-epoch":1291755609,
"published-datetime":"2010-12-07T16:00:09.577-05:00",
"cwe":"CWE-399",
"cve":"CVE-2010-4492",
"product_info":{
"wa_signature_id":"41",
"wa_product_id":"39",
"product_version":"37.0.2062.103",
"product_name":"Google Chrome"
},
"modified":"2015-11-13T11:38:49.100-05:00",
"score":10
},
...
]
}
CVE Information Lookup by CVE
Documentation for this endpoint
curl -XGET -H "Authorization: apikey YOUR_API_KEY" "https://api.metadefender.com/v3/cve/CVE-2013-2841"
{
"success": true,
"data": {
"covered_appinfo_report_date": "2016-10-06T00:00:00.000Z",
"covered_vulnerability_cve": "CVE-2013-2841",
"data": {
"appinfo_report_date": "2016-10-06T00:00:00.000Z",
"vendor_name_norm": [
"google inc "
],
"sha1": [
"00EB0558F95E1CF11F9D36105D2BC832ECF1B051",
"004DB78C1C34EF7A802311C3804EC657A9C7EE19",
"00A060025F5C5FA26D0519E09EB33DB874A2465B",
...
],
"product_name_version_norm": [
{
"product_name_norm": "google chrome",
"product_version_norm": "48 0 2564 109"
},
{
"product_name_norm": "google chrome",
"product_version_norm": "31 0 1650 63"
},
....
],
"cve_info": {
"cve": "CVE-2013-2841",
"cwe": "CWE-399",
"published-datetime": "2013-05-22T09:29:56.030-04:00",
"published-epoch": 1369229396,
"last-modified-datetime": "2013-11-02T23:32:28.300-04:00",
"last-modified-epoch": 1383449548,
"references": [
[
{
"name": "https://code.google.com/p/chromium/issues/detail?id=227350",
"url": "https://code.google.com/p/chromium/issues/detail?id=227350"
}
],
...
],
"cvss": {
"score": "7.5",
"access-vector": "NETWORK",
"access-complexity": "LOW",
"authentication": "NONE",
"confidentiality-impact": "PARTIAL",
"integrity-impact": "PARTIAL",
"availablity-impact": "",
"source": "http://nvd.nist.gov",
"generated-on-datetime": "2013-05-22T11:31:00.000-04:00"
},
"severity_index": 4,
"severity": "IMPORTANT"
}
}
}
}