# GetVulnerabilityLibraryIssues

## Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

### Headers

```
GET /api/ss/library HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Query

**name (string) (optional)**

Name of the vulnerability.

Example:

```
GET /api/ss/library?name=SQL%20Injection HTTP/1.1
```

**belongs\_to\_library** **(string) (optional)**

Library which the vulnerability writeup belongs to. Must be one of the following: *Main Vulnerabilities*, *Imported Vulnerabilities*, *Project Vulnerabilities*, or the key for a custom library.

Example:

```
GET /api/ss/library?belongs_to_library=Imported%20Vulnerabilities HTTP/1.1
```

**reference\_id (string) (optional)**

Reference Id of the vulnerability in the library (15-digit number).

Example:

```
GET /api/ss/library?reference_id=754483619065784 HTTP/1.1
```

**created\_from (string) (optional)**

Start date to query vulnerabilities from, based on creation date. Must be UTC string e.g. 2021-06-03T23:15:33.008Z.

Example:

```
GET /api/ss/library?created_from=2021-06-03T00:00:00.000Z HTTP/1.1
```

**created\_to (string) (optional)**

End date to query vulnerabilities to, based on creation date. Must be UTC string e.g. 2021-06-03T23:15:33.008Z.

Example:

```
GET /api/ss/library?created_to=2021-06-03T00:00:00.000Z HTTP/1.1
```

**skip (integer) (optional)**

Number of records to skip. Default is 0 (do not skip any records).

Example:

```
GET /api/ss/library?skip=10 HTTP/1.1
```

**limit (integer) (optional)**

Number of records to limit to. Default limit is 500. Max limit is 500.

Example:

```
GET /api/ss/library?limit=100 HTTP/1.1
```

**q (*****string*****) (*****optional*****)**

Provides options to query a custom selection of vulnerabilities.

Please visit the following link for more details on how to use this filter: <https://support.attackforge.com/attackforge-enterprise/modules/self-service-restful-api/advanced-query-filter>

Example 1 - Writeups with title *SQL Injection*:

```
curl -G -X GET 'https://localhost:3000/api/ss/library' --data-urlencode 'q={title: { $eq: "SQL Injection" }}' -H 'Host: localhost:3000' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

Example 2 - Writeups with the tag *pluginID:53360*:

```
curl -G -X GET 'https://localhost:3000/api/ss/library' --data-urlencode 'q={tags: { $in: "pluginID:53360" }}' -H 'Host: localhost:3000' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

Example 3 - Writeups with the custom field *NessusID* and value *53360*:

```
curl -G -X GET 'https://localhost:3000/api/ss/library' --data-urlencode 'q={custom_fields.name: { $eq: "NessusID" }, custom_fields.value: { $eq: "53360" }}' -H 'Host: localhost:3000' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

**cf\_key\_allowlist (string) (optional)**

List of custom field keys to include in response. Add multiple for more than one key e.g. `?cf_key_allowlist=key1&cf_key_allowlist=key2` or specify no keys to exclude all fields e.g. `?cf_key_allowlist=`

Example:

```
GET /api/ss/library?cf_key_allowlist=key1&cf_key_allowlist=key2 HTTP/1.1
```

**cf\_key\_blocklist (string) (optional)**

List of custom field keys to exclude from response. Add multiple for more than one key e.g. `?cf_key_blocklist=key1&cf_key_blocklist=key2`

Example:

```
GET /api/ss/library?cf_key_blocklist=key1&cf_key_blocklist=key2 HTTP/1.1
```

## Example

The following example is a cURL request to get all SQL Injection vulnerabilities in the library created between two dates.

### Request

Include API Token instead of stars in 'X-SSAPI-KEY: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*' parameter.

```
curl -X GET 'https://demo.attackforge.com/api/ss/library?created_from=2021-06-03T00:00:00.000Z&created_to=2021-06-04T00:00:00.000Z&name=SQL%20Injection' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

### Response

Response contains an array of vulnerability objects.

```
{
   "count": 999,
   "vulnerabilities":[
      {
         "created": "...",
         "last_modified": "...",
         "reference_id": "...",
         "category": "...",
         "title": "...",
         "description": "...",
         "severity": "10",
         "likelihood_of_exploitation": "10",
         "priority": "Critical",
         "attack_scenario": "...",
         "remediation_recommendation": "...",
         "impact_on_confidentiality": "High",
         "impact_on_integrity": "Medium",
         "impact_on_availability": "Low",
         "tags": [
            "..."
         ],
         "id": "...",
         "created_by": "...",
         "belongs_to_library": "Imported Vulnerabilities",
         "import_source": "...",
         "import_source_id": "...",
         "custom_fields": [
            {
               "key": "...", 
               "value": "...", 
               "type": "Tag/Field"
            }
         ],
         "files": [
          {
            "file_name": "...",
            "file_name_custom": "...",
            "storage_name": "...",
            "file_type": "...",
            "file_size": 999,
            "file_size_kb": 99999
          }
        ]
      }
   ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.attackforge.com/attackforge-enterprise/modules/self-service-restful-api/getvulnerabilitylibraryissues.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
