Upload rag_mixedbread scripts and artifacts
Browse files- .gitattributes +1 -0
- README.md +84 -0
- __init__.py +9 -0
- artifacts/README.md +49 -0
- artifacts/cve_corpus.jsonl +3 -0
- artifacts/decomposed_query_results.json +514 -0
- build_index.py +200 -0
- config.py +60 -0
- env.example +10 -0
- prepare_cve_corpus.py +367 -0
- query_service.py +162 -0
.gitattributes
CHANGED
|
@@ -57,3 +57,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
artifacts/cve_corpus.jsonl filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Mixedbread CVE RAG Workflow
|
| 2 |
+
|
| 3 |
+
Scripts in this directory let you build a Retrieval Augmented Generation (RAG) workflow over the `cvelistV5` dataset using Mixedbread's embedding and reranking models loaded locally. Vector storage relies on a persisted [Chroma](https://www.trychroma.com/) database. No steps have been executed yet—run them when you're ready.
|
| 4 |
+
|
| 5 |
+
## Prerequisites
|
| 6 |
+
- Python 3.10+
|
| 7 |
+
- Packages: `sentence-transformers`, `chromadb`, `numpy`, `torch` (or `torch` with CUDA for GPU)
|
| 8 |
+
- Hugging Face account (optional, only needed for private models or rate-limited downloads)
|
| 9 |
+
- Optional: `HF_API_TOKEN` environment variable if downloading models requires authentication
|
| 10 |
+
|
| 11 |
+
You can copy `env.example` to `.env` (or export vars directly) and populate any overrides.
|
| 12 |
+
|
| 13 |
+
## Workflow
|
| 14 |
+
|
| 15 |
+
1. **Unzip the CVE archive**
|
| 16 |
+
```bash
|
| 17 |
+
python scripts/unzip_cvelist.py
|
| 18 |
+
```
|
| 19 |
+
- Reads `testing/cvelistV5-main.zip`
|
| 20 |
+
- Extracts to `data/cvelistV5-main/`
|
| 21 |
+
- Use `--force` to re-extract if the destination already exists.
|
| 22 |
+
|
| 23 |
+
2. **Prepare the corpus**
|
| 24 |
+
```bash
|
| 25 |
+
python -m rag_mixedbread.prepare_cve_corpus \
|
| 26 |
+
--cve-root data/cvelistV5-main \
|
| 27 |
+
--output rag_mixedbread/artifacts/cve_corpus.jsonl
|
| 28 |
+
```
|
| 29 |
+
- Walks every CVE JSON file
|
| 30 |
+
- Normalizes metadata + descriptions
|
| 31 |
+
- Splits long descriptions into overlapping character chunks
|
| 32 |
+
|
| 33 |
+
3. **Build the Chroma index with Mixedbread embeddings**
|
| 34 |
+
```bash
|
| 35 |
+
python -m rag_mixedbread.build_index \
|
| 36 |
+
--corpus rag_mixedbread/artifacts/cve_corpus.jsonl \
|
| 37 |
+
--batch-size 8 \
|
| 38 |
+
--normalize \
|
| 39 |
+
--reset
|
| 40 |
+
```
|
| 41 |
+
- Loads `mixedbread-ai/mxbai-embed-large-v1` locally (downloads on first run)
|
| 42 |
+
- Embeds all corpus chunks and persists into Chroma at `rag_mixedbread/index/`
|
| 43 |
+
- `--reset` wipes the existing collection before re-building
|
| 44 |
+
- Models run on CPU by default; set `RAG_DEVICE=cuda` for GPU acceleration
|
| 45 |
+
|
| 46 |
+
4. **Query with reranking**
|
| 47 |
+
```bash
|
| 48 |
+
python -m rag_mixedbread.query_service \
|
| 49 |
+
"buffer overflow in ssh" \
|
| 50 |
+
--top-k 20 \
|
| 51 |
+
--top-n 5 \
|
| 52 |
+
--normalize
|
| 53 |
+
```
|
| 54 |
+
- Loads embedding and reranker models locally (downloads on first run)
|
| 55 |
+
- Retrieves similar chunks from Chroma
|
| 56 |
+
- Reranks candidates using `mixedbread-ai/mxbai-rerank-base-v2` CrossEncoder
|
| 57 |
+
- Prints human-friendly summaries or JSON (`--json`) for automation
|
| 58 |
+
|
| 59 |
+
## Configuration
|
| 60 |
+
|
| 61 |
+
`rag_mixedbread/config.py` centralizes default paths and settings:
|
| 62 |
+
|
| 63 |
+
- Archive path: `testing/cvelistV5-main.zip`
|
| 64 |
+
- Extracted CVE directory: `data/cvelistV5-main`
|
| 65 |
+
- Corpus output: `rag_mixedbread/artifacts/cve_corpus.jsonl`
|
| 66 |
+
- Chroma directory: `rag_mixedbread/index/` (collection `cve_chunks` by default)
|
| 67 |
+
|
| 68 |
+
Environment variables override defaults:
|
| 69 |
+
|
| 70 |
+
| Variable | Purpose | Default |
|
| 71 |
+
| --- | --- | --- |
|
| 72 |
+
| `HF_API_TOKEN` | Optional: for private models or rate-limited downloads | _none_ |
|
| 73 |
+
| `RAG_EMBED_MODEL` | Embedding model ID (Hugging Face Hub) | `mixedbread-ai/mxbai-embed-large-v1` |
|
| 74 |
+
| `RAG_RERANK_MODEL` | Rerank model ID (Hugging Face Hub) | `mixedbread-ai/mxbai-rerank-base-v2` |
|
| 75 |
+
| `RAG_EMBED_BATCH` | Batch size during indexing | `8` |
|
| 76 |
+
| `RAG_DEVICE` | Device for model inference (`cpu` or `cuda`) | `cpu` |
|
| 77 |
+
| `RAG_CHROMA_COLLECTION` | Collection name inside Chroma | `cve_chunks` |
|
| 78 |
+
|
| 79 |
+
## Notes
|
| 80 |
+
- The scripts intentionally avoid running automatically; invoke them manually when ready.
|
| 81 |
+
- Models are downloaded from Hugging Face Hub on first use (cached in `~/.cache/huggingface/`).
|
| 82 |
+
- For GPU acceleration, install PyTorch with CUDA and set `RAG_DEVICE=cuda`.
|
| 83 |
+
- Adjust `--batch-size` based on available memory (larger batches = faster but more memory).
|
| 84 |
+
|
__init__.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Mixedbread-based Retrieval Augmented Generation utilities.
|
| 3 |
+
|
| 4 |
+
This package contains scripts for preparing the CVE corpus, building the
|
| 5 |
+
embedding index, and querying via Mixedbread embedding + reranking models.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
__all__ = []
|
| 9 |
+
|
artifacts/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_name: embedding-cve-nvd-dataset
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
license: mit
|
| 6 |
+
tags:
|
| 7 |
+
- cybersecurity
|
| 8 |
+
- cve
|
| 9 |
+
- embeddings
|
| 10 |
+
- nvd
|
| 11 |
+
pretty_name: CVE NVD Embedding Dataset
|
| 12 |
+
task_categories:
|
| 13 |
+
- text-retrieval
|
| 14 |
+
task_ids:
|
| 15 |
+
- document-retrieval
|
| 16 |
+
size_categories:
|
| 17 |
+
- 100K<datasets<1M
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# CVE NVD Embedding Dataset
|
| 21 |
+
|
| 22 |
+
This dataset contains the processed CVE/NVD corpus that was used with the `rag_mixedbread` pipeline.
|
| 23 |
+
It bundles:
|
| 24 |
+
|
| 25 |
+
- `cve_corpus.jsonl` (~700 MB): each line is a JSON object with `cve_id`, `title`, `description`, `cvss`, `vendors`, and the pre-computed text chunk that feeds the embedding model.
|
| 26 |
+
- `decomposed_query_results.json` (63 KB): a dictionary of exemplar queries, decomposed sub-questions, and the retrieved doc IDs used for quality checks.
|
| 27 |
+
|
| 28 |
+
## Generation pipeline
|
| 29 |
+
1. Raw CVE/NVD feeds were normalized via `prepare_cve_corpus.py`.
|
| 30 |
+
2. Fields were concatenated and deduplicated into retrieval-ready passages.
|
| 31 |
+
3. The resulting corpus was used to build MixedBread vector indexes for the RAG workflow.
|
| 32 |
+
|
| 33 |
+
## Usage
|
| 34 |
+
You can stream the JSONL file and index it with any vector database:
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
import json
|
| 38 |
+
from datasets import load_dataset
|
| 39 |
+
|
| 40 |
+
ds = load_dataset("Kushalkhemka/embedding-cve-nvd-dataset", split="train")
|
| 41 |
+
for row in ds:
|
| 42 |
+
payload = json.loads(row["text"]) # each row is a JSON line
|
| 43 |
+
# index payload["chunk"] into your vector store
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
The `decomposed_query_results.json` file is useful for evaluation—each entry has the original user question, the decomposed sub-queries, and the reference CVE IDs that should match during retrieval.
|
| 47 |
+
|
| 48 |
+
## License
|
| 49 |
+
MIT. Please respect the original NVD data terms when redistributing.
|
artifacts/cve_corpus.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0cdb50937c380a8e66d1907c77f7afc4e1dd9e15442b3365267168447338458
|
| 3 |
+
size 706241703
|
artifacts/decomposed_query_results.json
ADDED
|
@@ -0,0 +1,514 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"file_function_focus": [
|
| 3 |
+
{
|
| 4 |
+
"score": 0.25626450777053833,
|
| 5 |
+
"text": "CVE ID: CVE-2016-4008 State: PUBLISHED Published: 2016-05-05T18:00:00 Last Updated: 2024-08-06T00:17:30.800Z Vendors: n/a Products: n/a Problem Types: n/a Description: The _asn1_extract_der_octet function in lib/decoding.c in GNU Libtasn1 before 4.8, when used without the ASN1_DECODE_FLAG_STRICT_DER flag, allows remote attackers to cause a denial of service (infinite recursion) via a crafted certificate. Additional Analyst Notes: - CVE Program Container: References: - https://security.gentoo.org/glsa/201703-05 - http://lists.fedoraproject.org/pipermail/package-announce/2016-April/182299.html - http://git.savannah.gnu.org/gitweb/?p=libtasn1.git%3Ba=commit%3Bh=a6e0a0b58f5cdaf4e9beca5bce69c0980",
|
| 6 |
+
"cve_id": "CVE-2016-4008",
|
| 7 |
+
"chunk_id": 0,
|
| 8 |
+
"metadata": {
|
| 9 |
+
"published": "2016-05-05T18:00:00",
|
| 10 |
+
"problem_types": "n/a",
|
| 11 |
+
"vendors": "n/a",
|
| 12 |
+
"products": "n/a",
|
| 13 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2016/4xxx/CVE-2016-4008.json",
|
| 14 |
+
"last_modified": "2024-08-06T00:17:30.800Z",
|
| 15 |
+
"references": "https://security.gentoo.org/glsa/201703-05, http://lists.fedoraproject.org/pipermail/package-announce/2016-April/182299.html, http://git.savannah.gnu.org/gitweb/?p=libtasn1.git%3Ba=commit%3Bh=a6e0a0b58f5cdaf4e9beca5bce69c09808cbb625, http://www.ubuntu.com/usn/USN-2957-2, http://lists.fedoraproject.org/pipermail/package-announce/2016-April/182907.html, http://lists.opensuse.org/opensuse-updates/2016-06/msg00047.html, https://lists.gnu.org/archive/html/help-libtasn1/2016-04/msg00009.html, http://git.savannah.gnu.org/gitweb/?p=libtasn1.git%3Ba=commit%3Bh=f435825c0f527a8e52e6ffbc3ad0bc60531d537e, http://www.debian.org/security/2016/dsa-3568, http://lists.opensuse.org/opensuse-updates/2016-06/msg00097.html, http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183221.html, http://www.ubuntu.com/usn/USN-2957-1, http://www.openwall.com/lists/oss-security/2016/04/11/3"
|
| 16 |
+
},
|
| 17 |
+
"rerank_score": 0.7202061414718628
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"score": 0.2438894510269165,
|
| 21 |
+
"text": "e specific flaw exists within the ASN.1 parser. When parsing ASN.1 strings, the process does not properly validate the length of user-supplied data prior to copying it to a fixed-length heap-based buffer. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-7472. Additional Analyst Notes: - CVE Program Container: References: - https://www.zerodayinitiative.com/advisories/ZDI-19-253/",
|
| 22 |
+
"cve_id": "CVE-2019-6740",
|
| 23 |
+
"chunk_id": 1,
|
| 24 |
+
"metadata": {
|
| 25 |
+
"products": "Galaxy S9",
|
| 26 |
+
"problem_types": "CWE-122",
|
| 27 |
+
"cwe": "CWE-122",
|
| 28 |
+
"published": "2019-06-03T18:15:47",
|
| 29 |
+
"severity": "CRITICAL",
|
| 30 |
+
"last_modified": "2024-08-04T20:31:04.226Z",
|
| 31 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2019/6xxx/CVE-2019-6740.json",
|
| 32 |
+
"vendors": "Samsung",
|
| 33 |
+
"cvss_score": 9.6,
|
| 34 |
+
"references": "https://www.zerodayinitiative.com/advisories/ZDI-19-253/",
|
| 35 |
+
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
|
| 36 |
+
},
|
| 37 |
+
"rerank_score": 0.0643041580915451
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"score": 0.24674034118652344,
|
| 41 |
+
"text": "CVE ID: CVE-2009-0590 State: PUBLISHED Published: 2009-03-27T16:00:00 Last Updated: 2024-08-07T04:40:04.972Z Vendors: n/a Products: n/a Problem Types: n/a Description: The ASN1_STRING_print_ex function in OpenSSL before 0.9.8k allows remote attackers to cause a denial of service (invalid memory access and application crash) via vectors that trigger printing of a (1) BMPString or (2) UniversalString with an invalid encoded length. Additional Analyst Notes: - CVE Program Container: References: - http://marc.info/?l=bugtraq&m=124464882609472&w=2 - http://www.vupen.com/english/advisories/2009/0850 - http://securitytracker.com/id?1021905 - http://secunia.com/advisories/34896 - http://www.mandriva",
|
| 42 |
+
"cve_id": "CVE-2009-0590",
|
| 43 |
+
"chunk_id": 0,
|
| 44 |
+
"metadata": {
|
| 45 |
+
"last_modified": "2024-08-07T04:40:04.972Z",
|
| 46 |
+
"products": "n/a",
|
| 47 |
+
"references": "http://marc.info/?l=bugtraq&m=124464882609472&w=2, http://www.vupen.com/english/advisories/2009/0850, http://securitytracker.com/id?1021905, http://secunia.com/advisories/34896, http://www.mandriva.com/security/advisories?name=MDVSA-2009:087, http://www.vupen.com/english/advisories/2009/1175, http://secunia.com/advisories/42724, http://www.securityfocus.com/archive/1/502429/100/0/threaded, http://lists.opensuse.org/opensuse-security-announce/2011-07/msg00014.html, http://wiki.rpath.com/Advisories:rPSA-2009-0057, http://www.debian.org/security/2009/dsa-1763, http://secunia.com/advisories/38794, http://lists.vmware.com/pipermail/security-announce/2010/000082.html, http://sourceforge.net/project/shownotes.php?release_id=671059&group_id=116847, http://secunia.com/advisories/34960, http://lists.opensuse.org/opensuse-security-announce/2011-07/msg00013.html, http://wiki.rpath.com/wiki/Advisories:rPSA-2009-0057, http://secunia.com/advisories/34666, http://www.ubuntu.com/usn/usn-750-1, http://security.FreeBSD.org/advisories/FreeBSD-SA-09:08.openssl.asc, http://marc.info/?l=bugtraq&m=124464882609472&w=2, http://www.vupen.com/english/advisories/2009/1020, http://secunia.com/advisories/35729, http://www.redhat.com/support/errata/RHSA-2009-1335.html, http://www.osvdb.org/52864, http://secunia.com/advisories/34561, http://secunia.com/advisories/35380, http://marc.info/?l=bugtraq&m=127678688104458&w=2, http://secunia.com/advisories/42467, http://lists.apple.com/archives/security-announce/2009/Sep/msg00004.html, http://secunia.com/advisories/35065, https://lists.balabit.com/pipermail/syslog-ng-announce/2011-January/000101.html, https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10198, http://secunia.com/advisories/36533, http://www.php.net/archive/2009.php#id2009-04-08-1, http://secunia.com/advisories/34411, ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2009-008.txt.asc, http://www.securityfocus.com/archive/1/515055/100/0/threaded, http://secunia.com/advisories/34509, https://exchange.xforce.ibmcloud.com/vulnerabilities/49431, http://secunia.com/advisories/35181, http://sunsolve.sun.com/search/document.do?assetkey=1-26-258048-1, http://secunia.com/advisories/38834, http://lists.opensuse.org/opensuse-security-announce/2009-05/msg00000.html, https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A6996, https://lists.balabit.com/pipermail/syslog-ng-announce/2011-January/000102.html, http://www.vupen.com/english/advisories/2010/3126, http://voodoo-circle.sourceforge.net/sa/sa-20090326-01.html, http://support.apple.com/kb/HT3865, http://www.vupen.com/english/advisories/2009/1220, http://www.openssl.org/news/secadv_20090325.txt, http://www.vupen.com/english/advisories/2009/1548, http://secunia.com/advisories/36701, http://support.avaya.com/elmodocs2/security/ASA-2009-172.htm, http://www.vmware.com/security/advisories/VMSA-2010-0019.html, http://marc.info/?l=bugtraq&m=125017764422557&w=2, https://kb.bluecoat.com/index?page=content&id=SA50, http://secunia.com/advisories/34460, http://marc.info/?l=bugtraq&m=125017764422557&w=2, http://www.securityfocus.com/bid/34256, http://secunia.com/advisories/42733, http://www.vupen.com/english/advisories/2010/0528",
|
| 48 |
+
"problem_types": "n/a",
|
| 49 |
+
"vendors": "n/a",
|
| 50 |
+
"published": "2009-03-27T16:00:00",
|
| 51 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2009/0xxx/CVE-2009-0590.json"
|
| 52 |
+
},
|
| 53 |
+
"rerank_score": 0.06226126104593277
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"score": 0.22262418270111084,
|
| 57 |
+
"text": "CVE ID: CVE-2012-1165 State: PUBLISHED Published: 2012-03-15T17:00:00 Last Updated: 2024-08-06T18:53:36.063Z Vendors: n/a Products: n/a Problem Types: n/a Description: The mime_param_cmp function in crypto/asn1/asn_mime.c in OpenSSL before 0.9.8u and 1.x before 1.0.0h allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted S/MIME message, a different vulnerability than CVE-2006-7250. Additional Analyst Notes: - CVE Program Container: References: - http://lists.fedoraproject.org/pipermail/package-announce/2012-April/077666.html - http://rhn.redhat.com/errata/RHSA-2012-0531.html - http://h20000.www2.hp.com/bizsupport/TechSupport/Docum",
|
| 58 |
+
"cve_id": "CVE-2012-1165",
|
| 59 |
+
"chunk_id": 0,
|
| 60 |
+
"metadata": {
|
| 61 |
+
"published": "2012-03-15T17:00:00",
|
| 62 |
+
"products": "n/a",
|
| 63 |
+
"last_modified": "2024-08-06T18:53:36.063Z",
|
| 64 |
+
"references": "http://lists.fedoraproject.org/pipermail/package-announce/2012-April/077666.html, http://rhn.redhat.com/errata/RHSA-2012-0531.html, http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041, http://lists.fedoraproject.org/pipermail/package-announce/2012-November/092905.html, http://secunia.com/advisories/48899, https://downloads.avaya.com/css/P8/documents/100162507, http://rhn.redhat.com/errata/RHSA-2012-1308.html, http://www.openwall.com/lists/oss-security/2012/03/12/3, http://rhn.redhat.com/errata/RHSA-2012-1307.html, http://www.openwall.com/lists/oss-security/2012/03/12/6, http://rhn.redhat.com/errata/RHSA-2012-0488.html, http://www.debian.org/security/2012/dsa-2454, http://www.ubuntu.com/usn/USN-1424-1, http://secunia.com/advisories/48895, http://secunia.com/advisories/48580, http://rhn.redhat.com/errata/RHSA-2012-1306.html, http://www.securitytracker.com/id?1026787, http://lists.fedoraproject.org/pipermail/package-announce/2012-April/077086.html, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://rhn.redhat.com/errata/RHSA-2012-0426.html, http://cvs.openssl.org/chngview?cn=22252, http://marc.info/?l=bugtraq&m=133728068926468&w=2, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://www.securityfocus.com/bid/52764, http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03360041, http://lists.fedoraproject.org/pipermail/package-announce/2012-April/077221.html, http://www.openwall.com/lists/oss-security/2012/03/13/2, http://www.openwall.com/lists/oss-security/2012/03/12/7, http://marc.info/?l=bugtraq&m=133728068926468&w=2",
|
| 65 |
+
"vendors": "n/a",
|
| 66 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2012/1xxx/CVE-2012-1165.json",
|
| 67 |
+
"problem_types": "n/a"
|
| 68 |
+
},
|
| 69 |
+
"rerank_score": 0.0578303262591362
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"score": 0.2591143250465393,
|
| 73 |
+
"text": "CVE ID: CVE-2005-1935 State: PUBLISHED Published: 2005-06-09T04:00:00 Last Updated: 2024-08-07T22:06:57.662Z Vendors: n/a Products: n/a Problem Types: n/a Description: Heap-based buffer overflow in the BERDecBitString function in Microsoft ASN.1 library (MSASN1.DLL) allows remote attackers to execute arbitrary code via nested constructed bit strings, which leads to a realloc of a non-null pointer and causes the function to overwrite previously freed memory, as demonstrated using a SPNEGO token with a constructed bit string during HTTP authentication, and a different vulnerability than CVE-2003-0818. NOTE: the researcher has claimed that MS:MS04-007 fixes this issue. Additional Analyst Notes:",
|
| 74 |
+
"cve_id": "CVE-2005-1935",
|
| 75 |
+
"chunk_id": 0,
|
| 76 |
+
"metadata": {
|
| 77 |
+
"published": "2005-06-09T04:00:00",
|
| 78 |
+
"references": "https://exchange.xforce.ibmcloud.com/vulnerabilities/20870, http://www.phreedom.org/solar/exploits/msasn1-bitstring/",
|
| 79 |
+
"vendors": "n/a",
|
| 80 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2005/1xxx/CVE-2005-1935.json",
|
| 81 |
+
"products": "n/a",
|
| 82 |
+
"last_modified": "2024-08-07T22:06:57.662Z",
|
| 83 |
+
"problem_types": "n/a"
|
| 84 |
+
},
|
| 85 |
+
"rerank_score": 0.0565408356487751
|
| 86 |
+
}
|
| 87 |
+
],
|
| 88 |
+
"cwe_focus": [
|
| 89 |
+
{
|
| 90 |
+
"score": 0.2751823663711548,
|
| 91 |
+
"text": "CVE ID: CVE-2020-8939 State: PUBLISHED Published: 2020-12-15T14:55:35 Last Updated: 2024-08-04T10:12:11.010Z Severity: MEDIUM (CVSS 5.3 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N) Vendors: Google LLC Products: Asylo Problem Types: CWE-125 Description: An out of bounds read on the enc_untrusted_inet_ntop function allows an attack to extend the result size that is used by memcpy() to read memory from within the enclave heap. We recommend upgrading past commit 6ff3b77ffe110a33a2f93848a6333f33616f02c4 Additional Analyst Notes: - CVE Program Container: References: - https://github.com/google/asylo/commit/6ff3b77ffe110a33a2f93848a6333f33616f02c4",
|
| 92 |
+
"cve_id": "CVE-2020-8939",
|
| 93 |
+
"chunk_id": 0,
|
| 94 |
+
"metadata": {
|
| 95 |
+
"problem_types": "CWE-125",
|
| 96 |
+
"vendors": "Google LLC",
|
| 97 |
+
"last_modified": "2024-08-04T10:12:11.010Z",
|
| 98 |
+
"references": "https://github.com/google/asylo/commit/6ff3b77ffe110a33a2f93848a6333f33616f02c4",
|
| 99 |
+
"severity": "MEDIUM",
|
| 100 |
+
"cvss_score": 5.3,
|
| 101 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2020/8xxx/CVE-2020-8939.json",
|
| 102 |
+
"cwe": "CWE-125",
|
| 103 |
+
"cvss_vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N",
|
| 104 |
+
"products": "Asylo",
|
| 105 |
+
"published": "2020-12-15T14:55:35"
|
| 106 |
+
},
|
| 107 |
+
"rerank_score": 0.12189315259456635
|
| 108 |
+
},
|
| 109 |
+
{
|
| 110 |
+
"score": 0.26371169090270996,
|
| 111 |
+
"text": "CVE ID: CVE-2021-41581 State: PUBLISHED Published: 2021-09-24T02:12:33 Last Updated: 2024-08-04T03:15:29.047Z Vendors: n/a Products: n/a Problem Types: n/a Description: x509_constraints_parse_mailbox in lib/libcrypto/x509/x509_constraints.c in LibreSSL through 3.4.0 has a stack-based buffer over-read. When the input exceeds DOMAIN_PART_MAX_LEN, the buffer lacks '\\0' termination. Additional Analyst Notes: - CVE Program Container: References: - https://github.com/libressl-portable/openbsd/issues/126",
|
| 112 |
+
"cve_id": "CVE-2021-41581",
|
| 113 |
+
"chunk_id": 0,
|
| 114 |
+
"metadata": {
|
| 115 |
+
"products": "n/a",
|
| 116 |
+
"problem_types": "n/a",
|
| 117 |
+
"last_modified": "2024-08-04T03:15:29.047Z",
|
| 118 |
+
"references": "https://github.com/libressl-portable/openbsd/issues/126",
|
| 119 |
+
"vendors": "n/a",
|
| 120 |
+
"published": "2021-09-24T02:12:33",
|
| 121 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2021/41xxx/CVE-2021-41581.json"
|
| 122 |
+
},
|
| 123 |
+
"rerank_score": 0.09560760110616684
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"score": 0.27542662620544434,
|
| 127 |
+
"text": "CVE ID: CVE-2019-18840 State: PUBLISHED Published: 2019-11-09T12:58:52 Last Updated: 2024-08-05T02:02:39.610Z Severity: HIGH (CVSS 7.5 CVSS:3.0/AC:L/AV:N/A:H/C:N/I:N/PR:N/S:U/UI:N) Vendors: n/a Products: n/a Problem Types: n/a Description: In wolfSSL 4.1.0 through 4.2.0c, there are missing sanity checks of memory accesses in parsing ASN.1 certificate data while handshaking. Specifically, there is a one-byte heap-based buffer overflow inside the DecodedCert structure in GetName in wolfcrypt/src/asn.c because the domain name location index is mishandled. Because a pointer is overwritten, there is an invalid free. Additional Analyst Notes: - CVE Program Container: References: - https://github.c",
|
| 128 |
+
"cve_id": "CVE-2019-18840",
|
| 129 |
+
"chunk_id": 0,
|
| 130 |
+
"metadata": {
|
| 131 |
+
"cvss_vector": "CVSS:3.0/AC:L/AV:N/A:H/C:N/I:N/PR:N/S:U/UI:N",
|
| 132 |
+
"severity": "HIGH",
|
| 133 |
+
"last_modified": "2024-08-05T02:02:39.610Z",
|
| 134 |
+
"references": "https://github.com/wolfSSL/wolfssl/issues/2555",
|
| 135 |
+
"products": "n/a",
|
| 136 |
+
"published": "2019-11-09T12:58:52",
|
| 137 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2019/18xxx/CVE-2019-18840.json",
|
| 138 |
+
"vendors": "n/a",
|
| 139 |
+
"problem_types": "n/a",
|
| 140 |
+
"cvss_score": 7.5
|
| 141 |
+
},
|
| 142 |
+
"rerank_score": 0.0745200663805008
|
| 143 |
+
},
|
| 144 |
+
{
|
| 145 |
+
"score": 0.27149730920791626,
|
| 146 |
+
"text": "CVE ID: CVE-2025-11680 State: PUBLISHED Published: 2025-10-20T14:04:06.854Z Last Updated: 2025-10-20T14:34:57.848Z Vendors: warmcat Products: libwebsockets Problem Types: CWE-787 Description: Out-of-bounds Write in unfilter_scanline in warmcat libwebsockets allows, when the LWS_WITH_UPNG flag is enabled during compilation and the HTML display stack is used, to write past a heap allocated buffer possibly causing a crash, when the user visits an attacker controlled website that contains a crafted PNG file with a big width value that causes an integer overflow which value is used for determining the size of a heap allocation. Additional Analyst Notes: - CISA ADP Vulnrichment: References: - http",
|
| 147 |
+
"cve_id": "CVE-2025-11680",
|
| 148 |
+
"chunk_id": 0,
|
| 149 |
+
"metadata": {
|
| 150 |
+
"last_modified": "2025-10-20T14:34:57.848Z",
|
| 151 |
+
"vendors": "warmcat",
|
| 152 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2025/11xxx/CVE-2025-11680.json",
|
| 153 |
+
"published": "2025-10-20T14:04:06.854Z",
|
| 154 |
+
"references": "https://libwebsockets.org/git/libwebsockets/commit?id=2b715249f39291c86443b969a1088d59b6a89b78, https://www.nozominetworks.com/labs/vulnerability-advisories-cve-2025-11680",
|
| 155 |
+
"products": "libwebsockets",
|
| 156 |
+
"cwe": "CWE-787",
|
| 157 |
+
"problem_types": "CWE-787"
|
| 158 |
+
},
|
| 159 |
+
"rerank_score": 0.07184864580631256
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"score": 0.2666282653808594,
|
| 163 |
+
"text": "CVE ID: CVE-2023-1380 State: PUBLISHED Published: 2023-03-27T00:00:00 Last Updated: 2024-08-02T05:49:10.358Z Vendors: n/a Products: Kernel Problem Types: CWE-125 Description: A slab-out-of-bound read problem was found in brcmf_get_assoc_ies in drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c in the Linux Kernel. This issue could occur when assoc_info->req_len data is bigger than the size of the buffer, defined as WL_EXTRA_BUF_MAX, leading to a denial of service. Additional Analyst Notes: - CVE Program Container: References: - https://bugzilla.redhat.com/show_bug.cgi?id=2177883 - https://lore.kernel.org/linux-wireless/20230309104457.22628-1-jisoo.jang%40yonsei.ac.kr/T/#u - https://",
|
| 164 |
+
"cve_id": "CVE-2023-1380",
|
| 165 |
+
"chunk_id": 0,
|
| 166 |
+
"metadata": {
|
| 167 |
+
"references": "https://bugzilla.redhat.com/show_bug.cgi?id=2177883, https://lore.kernel.org/linux-wireless/20230309104457.22628-1-jisoo.jang%40yonsei.ac.kr/T/#u, https://www.openwall.com/lists/oss-security/2023/03/14/1, https://security.netapp.com/advisory/ntap-20230511-0001/, http://packetstormsecurity.com/files/173087/Kernel-Live-Patch-Security-Notice-LSN-0095-1.html, http://packetstormsecurity.com/files/173757/Kernel-Live-Patch-Security-Notice-LSN-0096-1.html, https://lists.debian.org/debian-lts-announce/2023/07/msg00030.html, https://www.debian.org/security/2023/dsa-5480, https://lists.debian.org/debian-lts-announce/2023/10/msg00027.html",
|
| 168 |
+
"products": "Kernel",
|
| 169 |
+
"problem_types": "CWE-125",
|
| 170 |
+
"published": "2023-03-27T00:00:00",
|
| 171 |
+
"last_modified": "2024-08-02T05:49:10.358Z",
|
| 172 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2023/1xxx/CVE-2023-1380.json",
|
| 173 |
+
"cwe": "CWE-125",
|
| 174 |
+
"vendors": "n/a"
|
| 175 |
+
},
|
| 176 |
+
"rerank_score": 0.0640094131231308
|
| 177 |
+
}
|
| 178 |
+
],
|
| 179 |
+
"root_cause_focus": [
|
| 180 |
+
{
|
| 181 |
+
"score": 0.22617650032043457,
|
| 182 |
+
"text": "y assumes that the source string is always null terminated. This causes a read outside of the source string triggering the buffer overflow detection. detected buffer overflow in strlen ------------[ cut here ]------------ kernel BUG at lib/string.c:1149! invalid opcode: 0000 [#1] SMP PTI CPU: 1 PID: 910 Comm: mount.ocfs2 Not tainted 5.14.0-1-amd64 #1 Debian 5.14.6-2 RIP: 0010:fortify_panic+0xf/0x11 ... Call Trace: ocfs2_initialize_super.isra.0.cold+0xc/0x18 [ocfs2] ocfs2_fill_super+0x359/0x19b0 [ocfs2] mount_bdev+0x185/0x1b0 legacy_get_tree+0x27/0x40 vfs_get_tree+0x25/0xb0 path_mount+0x454/0xa20 __x64_sys_mount+0x103/0x140 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Addi",
|
| 183 |
+
"cve_id": "CVE-2021-47458",
|
| 184 |
+
"chunk_id": 1,
|
| 185 |
+
"metadata": {
|
| 186 |
+
"products": "Linux",
|
| 187 |
+
"references": "https://git.kernel.org/stable/c/ac011cb3ff7a76b3e0e6e77158ee4ba2f929e1fb, https://git.kernel.org/stable/c/4b74ddcc22ee6455946e80a9c4808801f8f8561e, https://git.kernel.org/stable/c/232ed9752510de4436468b653d145565669c8498, https://git.kernel.org/stable/c/7623b1035ca2d17bde0f6a086ad6844a34648df1, https://git.kernel.org/stable/c/d3a83576378b4c904f711598dde2c5e881c4295c, https://git.kernel.org/stable/c/93be0eeea14cf39235e585c8f56df3b3859deaad, https://git.kernel.org/stable/c/0e677ea5b7396f715a76b6b0ef441430e4c4b57f, https://git.kernel.org/stable/c/b15fa9224e6e1239414525d8d556d824701849fc",
|
| 188 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2021/47xxx/CVE-2021-47458.json",
|
| 189 |
+
"last_modified": "2025-05-04T07:11:21.260Z",
|
| 190 |
+
"published": "2024-05-22T06:19:46.675Z",
|
| 191 |
+
"vendors": "Linux",
|
| 192 |
+
"problem_types": ""
|
| 193 |
+
},
|
| 194 |
+
"rerank_score": 0.3580714464187622
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"score": 0.25088775157928467,
|
| 198 |
+
"text": "CVE ID: CVE-2012-3480 State: PUBLISHED Published: 2012-08-25T10:00:00 Last Updated: 2024-08-06T20:05:12.639Z Vendors: n/a Products: n/a Problem Types: n/a Description: Multiple integer overflows in the (1) strtod, (2) strtof, (3) strtold, (4) strtod_l, and other unspecified \"related functions\" in stdlib in GNU C Library (aka glibc or libc6) 2.16 allow local users to cause a denial of service (application crash) and possibly execute arbitrary code via a long string, which triggers a stack-based buffer overflow. Additional Analyst Notes: - CVE Program Container: References: - http://www.openwall.com/lists/oss-security/2012/08/13/4 - http://lists.fedoraproject.org/pipermail/package-announce/201",
|
| 199 |
+
"cve_id": "CVE-2012-3480",
|
| 200 |
+
"chunk_id": 0,
|
| 201 |
+
"metadata": {
|
| 202 |
+
"vendors": "n/a",
|
| 203 |
+
"references": "http://www.openwall.com/lists/oss-security/2012/08/13/4, http://lists.fedoraproject.org/pipermail/package-announce/2012-August/085190.html, http://osvdb.org/84710, http://www.securityfocus.com/bid/54982, http://www.openwall.com/lists/oss-security/2012/08/13/6, http://rhn.redhat.com/errata/RHSA-2012-1325.html, http://sourceware.org/ml/libc-alpha/2012-08/msg00202.html, http://sourceware.org/bugzilla/show_bug.cgi?id=14459, http://rhn.redhat.com/errata/RHSA-2012-1262.html, https://security.gentoo.org/glsa/201503-04, http://rhn.redhat.com/errata/RHSA-2012-1207.html, http://www.securitytracker.com/id?1027374, http://www.ubuntu.com/usn/USN-1589-1, http://secunia.com/advisories/50201, http://secunia.com/advisories/50422, http://rhn.redhat.com/errata/RHSA-2012-1208.html",
|
| 204 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2012/3xxx/CVE-2012-3480.json",
|
| 205 |
+
"last_modified": "2024-08-06T20:05:12.639Z",
|
| 206 |
+
"problem_types": "n/a",
|
| 207 |
+
"products": "n/a",
|
| 208 |
+
"published": "2012-08-25T10:00:00"
|
| 209 |
+
},
|
| 210 |
+
"rerank_score": 0.1205206885933876
|
| 211 |
+
},
|
| 212 |
+
{
|
| 213 |
+
"score": 0.22298675775527954,
|
| 214 |
+
"text": "sized buffer data is memcpy\u2018d into, but after the memcpy a null byte is written to what is assumed to be the end of the buffer to terminate the char*, but without length checks, this null write occurs at an arbitrary offset from the buffer. An attacker can provide malicious input to trigger this vulnerability. Additional Analyst Notes: - CVE Program Container: References: - https://talosintelligence.com/vulnerability_reports/TALOS-2021-1280",
|
| 215 |
+
"cve_id": "CVE-2021-21814",
|
| 216 |
+
"chunk_id": 1,
|
| 217 |
+
"metadata": {
|
| 218 |
+
"problem_types": "stack-based buffer overflow",
|
| 219 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2021/21xxx/CVE-2021-21814.json",
|
| 220 |
+
"last_modified": "2024-08-03T18:23:29.664Z",
|
| 221 |
+
"vendors": "n/a",
|
| 222 |
+
"cvss_score": 7.8,
|
| 223 |
+
"cvss_vector": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
|
| 224 |
+
"published": "2021-08-13T22:39:59",
|
| 225 |
+
"severity": "HIGH",
|
| 226 |
+
"references": "https://talosintelligence.com/vulnerability_reports/TALOS-2021-1280",
|
| 227 |
+
"products": "AT&T"
|
| 228 |
+
},
|
| 229 |
+
"rerank_score": 0.08900631964206696
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"score": 0.22700989246368408,
|
| 233 |
+
"text": "CVE ID: CVE-2022-49401 State: PUBLISHED Published: 2025-02-26T02:12:28.603Z Last Updated: 2025-05-04T08:36:53.713Z Vendors: Linux Products: Linux Description: In the Linux kernel, the following vulnerability has been resolved: mm/page_owner: use strscpy() instead of strlcpy() current->comm[] is not a string (no guarantee for a zero byte in it). strlcpy(s1, s2, l) is calling strlen(s2), potentially causing out-of-bound access, as reported by syzbot: detected buffer overflow in __fortify_strlen ------------[ cut here ]------------ kernel BUG at lib/string_helpers.c:980! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 4087 Comm: dhcpcd-run-hooks Not tainted 5.18.0-rc3-syzkaller-01537-g2",
|
| 234 |
+
"cve_id": "CVE-2022-49401",
|
| 235 |
+
"chunk_id": 0,
|
| 236 |
+
"metadata": {
|
| 237 |
+
"published": "2025-02-26T02:12:28.603Z",
|
| 238 |
+
"products": "Linux",
|
| 239 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2022/49xxx/CVE-2022-49401.json",
|
| 240 |
+
"references": "https://git.kernel.org/stable/c/5cd9900a1ac8b0a4ff3cd97d4d77b7711be435bf, https://git.kernel.org/stable/c/cd8c1fd8cdd14158f2d8bea2d1bfe8015dccfa3a",
|
| 241 |
+
"problem_types": "",
|
| 242 |
+
"last_modified": "2025-05-04T08:36:53.713Z",
|
| 243 |
+
"vendors": "Linux"
|
| 244 |
+
},
|
| 245 |
+
"rerank_score": 0.08080703765153885
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"score": 0.2457108497619629,
|
| 249 |
+
"text": "e for the s_offset key is copied using strcpy to the buffer at $sp+0x2b0. This buffer is 32 bytes large, sending anything longer will cause a buffer overflow. Additional Analyst Notes: - CVE Program Container: References: - https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0483",
|
| 250 |
+
"cve_id": "CVE-2017-16337",
|
| 251 |
+
"chunk_id": 1,
|
| 252 |
+
"metadata": {
|
| 253 |
+
"products": "Insteon Hub 2245-222",
|
| 254 |
+
"severity": "HIGH",
|
| 255 |
+
"last_modified": "2024-09-16T18:55:33.214Z",
|
| 256 |
+
"vendors": "Insteon",
|
| 257 |
+
"cvss_vector": "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H",
|
| 258 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2017/16xxx/CVE-2017-16337.json",
|
| 259 |
+
"cvss_score": 8.5,
|
| 260 |
+
"problem_types": "Stack-based buffer overflow",
|
| 261 |
+
"references": "https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0483",
|
| 262 |
+
"published": "2018-08-23T15:00:00Z"
|
| 263 |
+
},
|
| 264 |
+
"rerank_score": 0.07241660356521606
|
| 265 |
+
}
|
| 266 |
+
],
|
| 267 |
+
"component_focus": [
|
| 268 |
+
{
|
| 269 |
+
"score": 0.2445216178894043,
|
| 270 |
+
"text": "CVE ID: CVE-2025-55904 State: PUBLISHED Published: 2025-09-17T00:00:00.000Z Last Updated: 2025-09-17T14:28:46.520Z Vendors: n/a Products: n/a Problem Types: n/a Description: Open5GS v2.7.5, prior to commit 67ba7f92bbd7a378954895d96d9d7b05d5b64615, is vulnerable to a NULL pointer dereference when a multipart/related HTTP POST request with an empty HTTP body is sent to the SBI of either AMF, AUSF, BSF, NRF, NSSF, PCF, SMF, UDM, or UDR, resulting in a denial of service. This occurs in the parse_multipart function in lib/sbi/message.c. Additional Analyst Notes: - CISA ADP Vulnrichment: References: - https://github.com/open5gs/open5gs/commit/67ba7f92bbd7a378954895d96d9d7b05d5b64615 - https://gith",
|
| 271 |
+
"cve_id": "CVE-2025-55904",
|
| 272 |
+
"chunk_id": 0,
|
| 273 |
+
"metadata": {
|
| 274 |
+
"published": "2025-09-17T00:00:00.000Z",
|
| 275 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2025/55xxx/CVE-2025-55904.json",
|
| 276 |
+
"last_modified": "2025-09-17T14:28:46.520Z",
|
| 277 |
+
"vendors": "n/a",
|
| 278 |
+
"problem_types": "n/a",
|
| 279 |
+
"references": "https://github.com/open5gs/open5gs/commit/67ba7f92bbd7a378954895d96d9d7b05d5b64615, https://github.com/open5gs/open5gs/issues/3942, https://github.com/tsiamoulis/vuln-research/tree/main/CVE-2025-55904",
|
| 280 |
+
"products": "n/a"
|
| 281 |
+
},
|
| 282 |
+
"rerank_score": 0.9995604157447815
|
| 283 |
+
},
|
| 284 |
+
{
|
| 285 |
+
"score": 0.2402043342590332,
|
| 286 |
+
"text": "CVE ID: CVE-2008-1673 State: PUBLISHED Published: 2008-06-10T00:00:00 Last Updated: 2024-08-07T08:32:01.473Z Vendors: n/a Products: n/a Problem Types: n/a Description: The asn1 implementation in (a) the Linux kernel 2.4 before 2.4.36.6 and 2.6 before 2.6.25.5, as used in the cifs and ip_nat_snmp_basic modules; and (b) the gxsnmp package; does not properly validate length values during decoding of ASN.1 BER data, which allows remote attackers to cause a denial of service (crash) or execute arbitrary code via (1) a length greater than the working buffer, which can lead to an unspecified overflow; (2) an oid length of zero, which can lead to an off-by-one error; or (3) an indefinite length for ",
|
| 287 |
+
"cve_id": "CVE-2008-1673",
|
| 288 |
+
"chunk_id": 0,
|
| 289 |
+
"metadata": {
|
| 290 |
+
"products": "n/a",
|
| 291 |
+
"published": "2008-06-10T00:00:00",
|
| 292 |
+
"problem_types": "n/a",
|
| 293 |
+
"references": "http://lists.opensuse.org/opensuse-security-announce/2008-10/msg00000.html, http://secunia.com/advisories/30000, http://secunia.com/advisories/30658, http://wiki.rpath.com/wiki/Advisories:rPSA-2008-0189, http://lists.opensuse.org/opensuse-security-announce/2008-07/msg00012.html, http://www.securityfocus.com/bid/29589, http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git%3Ba=commit%3Bh=ddb2c43594f22843e9f3153da151deaba1a834c5, http://lists.opensuse.org/opensuse-security-announce/2008-07/msg00007.html, http://lists.opensuse.org/opensuse-security-announce/2008-10/msg00008.html, https://www.redhat.com/archives/fedora-package-announce/2008-June/msg00587.html, http://secunia.com/advisories/32104, http://secunia.com/advisories/30982, http://secunia.com/advisories/30580, http://www.securityfocus.com/archive/1/493300/100/0/threaded, https://exchange.xforce.ibmcloud.com/vulnerabilities/42921, http://secunia.com/advisories/30644, http://lists.opensuse.org/opensuse-security-announce/2008-10/msg00001.html, http://secunia.com/advisories/32103, http://www.mandriva.com/security/advisories?name=MDVSA-2008:113, http://www.securitytracker.com/id?1020210, http://www.mandriva.com/security/advisories?name=MDVSA-2008:174, http://secunia.com/advisories/32759, http://www.vupen.com/english/advisories/2008/1770, http://secunia.com/advisories/31107, http://kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.25.5, http://secunia.com/advisories/32370, http://secunia.com/advisories/31836, http://www.ubuntu.com/usn/usn-625-1, https://bugzilla.redhat.com/show_bug.cgi?id=443962, http://www.debian.org/security/2008/dsa-1592, http://lists.opensuse.org/opensuse-security-announce/2008-10/msg00003.html, http://lists.opensuse.org/opensuse-security-announce/2008-11/msg00001.html, http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.25.y.git%3Ba=commit%3Bh=33afb8403f361919aa5c8fe1d0a4f5ddbfbbea3c, http://kernel.org/pub/linux/kernel/v2.4/ChangeLog-2.4.36.6",
|
| 294 |
+
"vendors": "n/a",
|
| 295 |
+
"last_modified": "2024-08-07T08:32:01.473Z",
|
| 296 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2008/1xxx/CVE-2008-1673.json"
|
| 297 |
+
},
|
| 298 |
+
"rerank_score": 0.10628625750541687
|
| 299 |
+
},
|
| 300 |
+
{
|
| 301 |
+
"score": 0.2239304780960083,
|
| 302 |
+
"text": "CVE ID: CVE-2005-1935 State: PUBLISHED Published: 2005-06-09T04:00:00 Last Updated: 2024-08-07T22:06:57.662Z Vendors: n/a Products: n/a Problem Types: n/a Description: Heap-based buffer overflow in the BERDecBitString function in Microsoft ASN.1 library (MSASN1.DLL) allows remote attackers to execute arbitrary code via nested constructed bit strings, which leads to a realloc of a non-null pointer and causes the function to overwrite previously freed memory, as demonstrated using a SPNEGO token with a constructed bit string during HTTP authentication, and a different vulnerability than CVE-2003-0818. NOTE: the researcher has claimed that MS:MS04-007 fixes this issue. Additional Analyst Notes:",
|
| 303 |
+
"cve_id": "CVE-2005-1935",
|
| 304 |
+
"chunk_id": 0,
|
| 305 |
+
"metadata": {
|
| 306 |
+
"vendors": "n/a",
|
| 307 |
+
"last_modified": "2024-08-07T22:06:57.662Z",
|
| 308 |
+
"problem_types": "n/a",
|
| 309 |
+
"products": "n/a",
|
| 310 |
+
"references": "https://exchange.xforce.ibmcloud.com/vulnerabilities/20870, http://www.phreedom.org/solar/exploits/msasn1-bitstring/",
|
| 311 |
+
"published": "2005-06-09T04:00:00",
|
| 312 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2005/1xxx/CVE-2005-1935.json"
|
| 313 |
+
},
|
| 314 |
+
"rerank_score": 0.08243680745363235
|
| 315 |
+
},
|
| 316 |
+
{
|
| 317 |
+
"score": 0.2558332681655884,
|
| 318 |
+
"text": "CVE ID: CVE-2012-2131 State: PUBLISHED Published: 2012-04-24T20:00:00 Last Updated: 2024-08-06T19:26:08.465Z Vendors: n/a Products: n/a Problem Types: n/a Description: Multiple integer signedness errors in crypto/buffer/buffer.c in OpenSSL 0.9.8v allow remote attackers to conduct buffer overflow attacks, and cause a denial of service (memory corruption) or possibly have unspecified other impact, via crafted DER data, as demonstrated by an X.509 certificate or an RSA public key. NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-2110. Additional Analyst Notes: - CVE Program Container: References: - http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00014.ht",
|
| 319 |
+
"cve_id": "CVE-2012-2131",
|
| 320 |
+
"chunk_id": 0,
|
| 321 |
+
"metadata": {
|
| 322 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2012/2xxx/CVE-2012-2131.json",
|
| 323 |
+
"references": "http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00014.html, http://lists.opensuse.org/opensuse-security-announce/2012-09/msg00007.html, http://www-01.ibm.com/support/docview.wss?uid=ssg1S1004564, http://www.mandriva.com/security/advisories?name=MDVSA-2012:064, http://kb.juniper.net/InfoCenter/index?page=content&id=JSA10673, http://www.ubuntu.com/usn/USN-1428-1, http://cvs.openssl.org/chngview?cn=22479, http://www.openssl.org/news/secadv_20120424.txt, http://www.debian.org/security/2012/dsa-2454, http://support.apple.com/kb/HT5784, http://lists.apple.com/archives/security-announce/2013/Jun/msg00000.html, http://secunia.com/advisories/48895, https://exchange.xforce.ibmcloud.com/vulnerabilities/75099, http://secunia.com/advisories/48956, http://www.openwall.com/lists/oss-security/2012/04/24/1, http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00015.html, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://secunia.com/advisories/57353, http://marc.info/?l=bugtraq&m=133728068926468&w=2, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://www.securitytracker.com/id?1026957, http://www.securityfocus.com/bid/53212, http://marc.info/?l=bugtraq&m=133728068926468&w=2",
|
| 324 |
+
"problem_types": "n/a",
|
| 325 |
+
"vendors": "n/a",
|
| 326 |
+
"last_modified": "2024-08-06T19:26:08.465Z",
|
| 327 |
+
"products": "n/a",
|
| 328 |
+
"published": "2012-04-24T20:00:00"
|
| 329 |
+
},
|
| 330 |
+
"rerank_score": 0.08150697499513626
|
| 331 |
+
},
|
| 332 |
+
{
|
| 333 |
+
"score": 0.2544565200805664,
|
| 334 |
+
"text": "CVE ID: CVE-2012-2110 State: PUBLISHED Published: 2012-04-19T17:00:00 Last Updated: 2024-08-06T19:26:07.655Z Vendors: n/a Products: n/a Problem Types: n/a Description: The asn1_d2i_read_bio function in crypto/asn1/a_d2i_fp.c in OpenSSL before 0.9.8v, 1.0.0 before 1.0.0i, and 1.0.1 before 1.0.1a does not properly interpret integer data, which allows remote attackers to conduct buffer overflow attacks, and cause a denial of service (memory corruption) or possibly have unspecified other impact, via crafted DER data, as demonstrated by an X.509 certificate or an RSA public key. Additional Analyst Notes: - CVE Program Container: References: - http://lists.opensuse.org/opensuse-security-announce/2",
|
| 335 |
+
"cve_id": "CVE-2012-2110",
|
| 336 |
+
"chunk_id": 0,
|
| 337 |
+
"metadata": {
|
| 338 |
+
"problem_types": "n/a",
|
| 339 |
+
"vendors": "n/a",
|
| 340 |
+
"last_modified": "2024-08-06T19:26:07.655Z",
|
| 341 |
+
"published": "2012-04-19T17:00:00",
|
| 342 |
+
"products": "n/a",
|
| 343 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2012/2xxx/CVE-2012-2110.json",
|
| 344 |
+
"references": "http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00014.html, http://lists.opensuse.org/opensuse-security-announce/2012-09/msg00007.html, http://www-01.ibm.com/support/docview.wss?uid=ssg1S1004564, https://h20564.www2.hp.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c03839862, http://lists.fedoraproject.org/pipermail/package-announce/2012-November/092905.html, http://secunia.com/advisories/48899, http://archives.neohapsis.com/archives/fulldisclosure/2012-04/0209.html, http://rhn.redhat.com/errata/RHSA-2012-1308.html, http://cvs.openssl.org/chngview?cn=22434, http://www.mandriva.com/security/advisories?name=MDVSA-2012:060, http://rhn.redhat.com/errata/RHSA-2012-1307.html, http://www.exploit-db.com/exploits/18756, http://rhn.redhat.com/errata/RHSA-2012-0518.html, http://www.debian.org/security/2012/dsa-2454, http://support.apple.com/kb/HT5784, http://lists.apple.com/archives/security-announce/2013/Jun/msg00000.html, http://www.ubuntu.com/usn/USN-1424-1, http://secunia.com/advisories/48895, http://secunia.com/advisories/48847, http://cvs.openssl.org/chngview?cn=22439, http://rhn.redhat.com/errata/RHSA-2012-1306.html, http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00015.html, http://rhn.redhat.com/errata/RHSA-2012-0522.html, http://lists.fedoraproject.org/pipermail/package-announce/2012-April/079149.html, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://secunia.com/advisories/57353, http://www.securityfocus.com/bid/53158, http://marc.info/?l=bugtraq&m=133728068926468&w=2, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://lists.fedoraproject.org/pipermail/package-announce/2012-May/080176.html, http://www.collax.com/produkte/AllinOne-server-for-small-businesses#id2565578, http://marc.info/?l=bugtraq&m=133951357207000&w=2, http://secunia.com/advisories/48942, http://www.openssl.org/news/secadv_20120419.txt, http://cvs.openssl.org/chngview?cn=22431, http://www.securitytracker.com/id?1026957, http://secunia.com/advisories/48999, http://marc.info/?l=bugtraq&m=133951357207000&w=2, http://osvdb.org/81223, https://h20564.www2.hp.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c03839862, http://lists.fedoraproject.org/pipermail/package-announce/2012-April/079299.html, https://kb.juniper.net/KB27376, http://marc.info/?l=bugtraq&m=133728068926468&w=2"
|
| 345 |
+
},
|
| 346 |
+
"rerank_score": 0.07558979094028473
|
| 347 |
+
}
|
| 348 |
+
],
|
| 349 |
+
"technical_pattern_focus": [
|
| 350 |
+
{
|
| 351 |
+
"score": 0.29820066690444946,
|
| 352 |
+
"text": "c' in cifs_strndup_to_utf16 and returns NULL early to prevent dereferencing NULL pointer. Found by Linux Verification Center (linuxtesting.org) with SVACE Additional Analyst Notes: - CVE Program Container: References: - https://git.kernel.org/stable/c/65b98a7e65e7a8f3894d8760cd194eaf20504c99 - https://git.kernel.org/stable/c/1cfa5dd05847137f0fb3ce74ced80c0b4858d716 - https://git.kernel.org/stable/c/1f797f062b5cf13a1c2bcc23285361baaa7c9260 - https://git.kernel.org/stable/c/3c26a8d30ed6b53a52a023ec537dc50a6d34a67a - https://git.kernel.org/stable/c/70bccd9855dae56942f2b18a08ba137bb54093a0",
|
| 353 |
+
"cve_id": "CVE-2025-39838",
|
| 354 |
+
"chunk_id": 1,
|
| 355 |
+
"metadata": {
|
| 356 |
+
"references": "https://git.kernel.org/stable/c/65b98a7e65e7a8f3894d8760cd194eaf20504c99, https://git.kernel.org/stable/c/1cfa5dd05847137f0fb3ce74ced80c0b4858d716, https://git.kernel.org/stable/c/1f797f062b5cf13a1c2bcc23285361baaa7c9260, https://git.kernel.org/stable/c/3c26a8d30ed6b53a52a023ec537dc50a6d34a67a, https://git.kernel.org/stable/c/70bccd9855dae56942f2b18a08ba137bb54093a0",
|
| 357 |
+
"published": "2025-09-19T15:26:13.506Z",
|
| 358 |
+
"problem_types": "",
|
| 359 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2025/39xxx/CVE-2025-39838.json",
|
| 360 |
+
"vendors": "Linux",
|
| 361 |
+
"products": "Linux",
|
| 362 |
+
"last_modified": "2025-11-03T17:43:52.863Z"
|
| 363 |
+
},
|
| 364 |
+
"rerank_score": 0.6811597347259521
|
| 365 |
+
},
|
| 366 |
+
{
|
| 367 |
+
"score": 0.2855958938598633,
|
| 368 |
+
"text": " buffer is already full but cp, the cursor position, is in the middle of the buffer, then we will write past the end of the supplied buffer. Fix this by replacing the dubious strncpy() calls with memmove()/memcpy() calls plus explicit boundary checks to make sure we have enough space before we start moving characters around. Additional Analyst Notes: - CVE Program Container: - CISA ADP Vulnrichment: References: - https://git.kernel.org/stable/c/fb824a99e148ff272a53d71d84122728b5f00992 - https://git.kernel.org/stable/c/ddd2972d8e2dee3b33e8121669d55def59f0be8a - https://git.kernel.org/stable/c/cfdc2fa4db57503bc6d3817240547c8ddc55fa96 - https://git.kernel.org/stable/c/f636a40834d22e5e3fc748f060",
|
| 369 |
+
"cve_id": "CVE-2024-39480",
|
| 370 |
+
"chunk_id": 1,
|
| 371 |
+
"metadata": {
|
| 372 |
+
"products": "Linux",
|
| 373 |
+
"vendors": "Linux",
|
| 374 |
+
"last_modified": "2025-05-04T09:16:41.644Z",
|
| 375 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2024/39xxx/CVE-2024-39480.json",
|
| 376 |
+
"references": "https://git.kernel.org/stable/c/fb824a99e148ff272a53d71d84122728b5f00992, https://git.kernel.org/stable/c/ddd2972d8e2dee3b33e8121669d55def59f0be8a, https://git.kernel.org/stable/c/cfdc2fa4db57503bc6d3817240547c8ddc55fa96, https://git.kernel.org/stable/c/f636a40834d22e5e3fc748f060211879c056cd33, https://git.kernel.org/stable/c/33d9c814652b971461d1e30bead6792851c209e7, https://git.kernel.org/stable/c/107e825cc448b7834b31e8b1b3cf0f57426d46d5, https://git.kernel.org/stable/c/f694da720dcf795dc3eb97bf76d220213f76aaa7, https://git.kernel.org/stable/c/e9730744bf3af04cda23799029342aa3cddbc454",
|
| 377 |
+
"published": "2024-07-05T06:55:09.241Z",
|
| 378 |
+
"problem_types": ""
|
| 379 |
+
},
|
| 380 |
+
"rerank_score": 0.1396441012620926
|
| 381 |
+
},
|
| 382 |
+
{
|
| 383 |
+
"score": 0.25617337226867676,
|
| 384 |
+
"text": " ']', strchr() returns NULL, and a call to g_strdup(start + 1) leads to a null pointer dereference. This vulnerability is fixed in 1.24.10. Additional Analyst Notes: - CISA ADP Vulnrichment: - CVE Program Container: References: - https://securitylab.github.com/advisories/GHSL-2024-263_Gstreamer/ - https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8039.patch - https://gstreamer.freedesktop.org/security/sa-2024-0029.html",
|
| 385 |
+
"cve_id": "CVE-2024-47835",
|
| 386 |
+
"chunk_id": 1,
|
| 387 |
+
"metadata": {
|
| 388 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2024/47xxx/CVE-2024-47835.json",
|
| 389 |
+
"references": "https://securitylab.github.com/advisories/GHSL-2024-263_Gstreamer/, https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8039.patch, https://gstreamer.freedesktop.org/security/sa-2024-0029.html",
|
| 390 |
+
"vendors": "gstreamer",
|
| 391 |
+
"published": "2024-12-11T19:17:26.688Z",
|
| 392 |
+
"cwe": "CWE-476",
|
| 393 |
+
"problem_types": "CWE-476",
|
| 394 |
+
"last_modified": "2025-11-03T22:21:51.646Z",
|
| 395 |
+
"products": "gstreamer"
|
| 396 |
+
},
|
| 397 |
+
"rerank_score": 0.1372045874595642
|
| 398 |
+
},
|
| 399 |
+
{
|
| 400 |
+
"score": 0.2788669466972351,
|
| 401 |
+
"text": "CVE ID: CVE-2023-0216 State: PUBLISHED Published: 2023-02-08T19:03:05.652Z Last Updated: 2025-11-04T19:14:34.082Z Vendors: OpenSSL Products: OpenSSL Problem Types: invalid pointer dereference Description: An invalid pointer dereference on read can be triggered when an application tries to load malformed PKCS7 data with the d2i_PKCS7(), d2i_PKCS7_bio() or d2i_PKCS7_fp() functions. The result of the dereference is an application crash which could lead to a denial of service attack. The TLS implementation in OpenSSL does not call this function however third party applications might call these functions on untrusted data. Additional Analyst Notes: - CVE Program Container: - CISA ADP Vulnrichment",
|
| 402 |
+
"cve_id": "CVE-2023-0216",
|
| 403 |
+
"chunk_id": 0,
|
| 404 |
+
"metadata": {
|
| 405 |
+
"products": "OpenSSL",
|
| 406 |
+
"last_modified": "2025-11-04T19:14:34.082Z",
|
| 407 |
+
"published": "2023-02-08T19:03:05.652Z",
|
| 408 |
+
"vendors": "OpenSSL",
|
| 409 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2023/0xxx/CVE-2023-0216.json",
|
| 410 |
+
"problem_types": "invalid pointer dereference",
|
| 411 |
+
"references": "https://www.openssl.org/news/secadv/20230207.txt, https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=934a04f0e775309cadbef0aa6b9692e1b12a76c6, https://security.gentoo.org/glsa/202402-08"
|
| 412 |
+
},
|
| 413 |
+
"rerank_score": 0.10002315044403076
|
| 414 |
+
},
|
| 415 |
+
{
|
| 416 |
+
"score": 0.29868656396865845,
|
| 417 |
+
"text": "when 0 (from the Content-Length) is passed to the function cfl_sds_len, which in turn tries to cast a NULL pointer into struct cfl_sds. This is related to process_payload_traces_proto_ng() at opentelemetry_prot.c. Additional Analyst Notes: - CISA ADP Vulnrichment: References: - https://fluentbit.io/announcements/ - https://github.com/fluent/fluent-bit/releases - https://www.ebryx.com/blogs/exploring-cve-2024-50608-and-cve-2024-50609",
|
| 418 |
+
"cve_id": "CVE-2024-50609",
|
| 419 |
+
"chunk_id": 1,
|
| 420 |
+
"metadata": {
|
| 421 |
+
"problem_types": "n/a",
|
| 422 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2024/50xxx/CVE-2024-50609.json",
|
| 423 |
+
"published": "2025-02-18T00:00:00.000Z",
|
| 424 |
+
"products": "n/a",
|
| 425 |
+
"last_modified": "2025-02-19T14:58:22.328Z",
|
| 426 |
+
"references": "https://fluentbit.io/announcements/, https://github.com/fluent/fluent-bit/releases, https://www.ebryx.com/blogs/exploring-cve-2024-50608-and-cve-2024-50609",
|
| 427 |
+
"vendors": "n/a"
|
| 428 |
+
},
|
| 429 |
+
"rerank_score": 0.09550007432699203
|
| 430 |
+
}
|
| 431 |
+
],
|
| 432 |
+
"temporal_focus": [
|
| 433 |
+
{
|
| 434 |
+
"score": 0.2402409315109253,
|
| 435 |
+
"text": "CVE ID: CVE-2009-0590 State: PUBLISHED Published: 2009-03-27T16:00:00 Last Updated: 2024-08-07T04:40:04.972Z Vendors: n/a Products: n/a Problem Types: n/a Description: The ASN1_STRING_print_ex function in OpenSSL before 0.9.8k allows remote attackers to cause a denial of service (invalid memory access and application crash) via vectors that trigger printing of a (1) BMPString or (2) UniversalString with an invalid encoded length. Additional Analyst Notes: - CVE Program Container: References: - http://marc.info/?l=bugtraq&m=124464882609472&w=2 - http://www.vupen.com/english/advisories/2009/0850 - http://securitytracker.com/id?1021905 - http://secunia.com/advisories/34896 - http://www.mandriva",
|
| 436 |
+
"cve_id": "CVE-2009-0590",
|
| 437 |
+
"chunk_id": 0,
|
| 438 |
+
"metadata": {
|
| 439 |
+
"problem_types": "n/a",
|
| 440 |
+
"last_modified": "2024-08-07T04:40:04.972Z",
|
| 441 |
+
"vendors": "n/a",
|
| 442 |
+
"products": "n/a",
|
| 443 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2009/0xxx/CVE-2009-0590.json",
|
| 444 |
+
"references": "http://marc.info/?l=bugtraq&m=124464882609472&w=2, http://www.vupen.com/english/advisories/2009/0850, http://securitytracker.com/id?1021905, http://secunia.com/advisories/34896, http://www.mandriva.com/security/advisories?name=MDVSA-2009:087, http://www.vupen.com/english/advisories/2009/1175, http://secunia.com/advisories/42724, http://www.securityfocus.com/archive/1/502429/100/0/threaded, http://lists.opensuse.org/opensuse-security-announce/2011-07/msg00014.html, http://wiki.rpath.com/Advisories:rPSA-2009-0057, http://www.debian.org/security/2009/dsa-1763, http://secunia.com/advisories/38794, http://lists.vmware.com/pipermail/security-announce/2010/000082.html, http://sourceforge.net/project/shownotes.php?release_id=671059&group_id=116847, http://secunia.com/advisories/34960, http://lists.opensuse.org/opensuse-security-announce/2011-07/msg00013.html, http://wiki.rpath.com/wiki/Advisories:rPSA-2009-0057, http://secunia.com/advisories/34666, http://www.ubuntu.com/usn/usn-750-1, http://security.FreeBSD.org/advisories/FreeBSD-SA-09:08.openssl.asc, http://marc.info/?l=bugtraq&m=124464882609472&w=2, http://www.vupen.com/english/advisories/2009/1020, http://secunia.com/advisories/35729, http://www.redhat.com/support/errata/RHSA-2009-1335.html, http://www.osvdb.org/52864, http://secunia.com/advisories/34561, http://secunia.com/advisories/35380, http://marc.info/?l=bugtraq&m=127678688104458&w=2, http://secunia.com/advisories/42467, http://lists.apple.com/archives/security-announce/2009/Sep/msg00004.html, http://secunia.com/advisories/35065, https://lists.balabit.com/pipermail/syslog-ng-announce/2011-January/000101.html, https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10198, http://secunia.com/advisories/36533, http://www.php.net/archive/2009.php#id2009-04-08-1, http://secunia.com/advisories/34411, ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2009-008.txt.asc, http://www.securityfocus.com/archive/1/515055/100/0/threaded, http://secunia.com/advisories/34509, https://exchange.xforce.ibmcloud.com/vulnerabilities/49431, http://secunia.com/advisories/35181, http://sunsolve.sun.com/search/document.do?assetkey=1-26-258048-1, http://secunia.com/advisories/38834, http://lists.opensuse.org/opensuse-security-announce/2009-05/msg00000.html, https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A6996, https://lists.balabit.com/pipermail/syslog-ng-announce/2011-January/000102.html, http://www.vupen.com/english/advisories/2010/3126, http://voodoo-circle.sourceforge.net/sa/sa-20090326-01.html, http://support.apple.com/kb/HT3865, http://www.vupen.com/english/advisories/2009/1220, http://www.openssl.org/news/secadv_20090325.txt, http://www.vupen.com/english/advisories/2009/1548, http://secunia.com/advisories/36701, http://support.avaya.com/elmodocs2/security/ASA-2009-172.htm, http://www.vmware.com/security/advisories/VMSA-2010-0019.html, http://marc.info/?l=bugtraq&m=125017764422557&w=2, https://kb.bluecoat.com/index?page=content&id=SA50, http://secunia.com/advisories/34460, http://marc.info/?l=bugtraq&m=125017764422557&w=2, http://www.securityfocus.com/bid/34256, http://secunia.com/advisories/42733, http://www.vupen.com/english/advisories/2010/0528",
|
| 445 |
+
"published": "2009-03-27T16:00:00"
|
| 446 |
+
},
|
| 447 |
+
"rerank_score": 0.9808268547058105
|
| 448 |
+
},
|
| 449 |
+
{
|
| 450 |
+
"score": 0.22816550731658936,
|
| 451 |
+
"text": "CVE ID: CVE-2012-2131 State: PUBLISHED Published: 2012-04-24T20:00:00 Last Updated: 2024-08-06T19:26:08.465Z Vendors: n/a Products: n/a Problem Types: n/a Description: Multiple integer signedness errors in crypto/buffer/buffer.c in OpenSSL 0.9.8v allow remote attackers to conduct buffer overflow attacks, and cause a denial of service (memory corruption) or possibly have unspecified other impact, via crafted DER data, as demonstrated by an X.509 certificate or an RSA public key. NOTE: this vulnerability exists because of an incomplete fix for CVE-2012-2110. Additional Analyst Notes: - CVE Program Container: References: - http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00014.ht",
|
| 452 |
+
"cve_id": "CVE-2012-2131",
|
| 453 |
+
"chunk_id": 0,
|
| 454 |
+
"metadata": {
|
| 455 |
+
"vendors": "n/a",
|
| 456 |
+
"products": "n/a",
|
| 457 |
+
"published": "2012-04-24T20:00:00",
|
| 458 |
+
"problem_types": "n/a",
|
| 459 |
+
"references": "http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00014.html, http://lists.opensuse.org/opensuse-security-announce/2012-09/msg00007.html, http://www-01.ibm.com/support/docview.wss?uid=ssg1S1004564, http://www.mandriva.com/security/advisories?name=MDVSA-2012:064, http://kb.juniper.net/InfoCenter/index?page=content&id=JSA10673, http://www.ubuntu.com/usn/USN-1428-1, http://cvs.openssl.org/chngview?cn=22479, http://www.openssl.org/news/secadv_20120424.txt, http://www.debian.org/security/2012/dsa-2454, http://support.apple.com/kb/HT5784, http://lists.apple.com/archives/security-announce/2013/Jun/msg00000.html, http://secunia.com/advisories/48895, https://exchange.xforce.ibmcloud.com/vulnerabilities/75099, http://secunia.com/advisories/48956, http://www.openwall.com/lists/oss-security/2012/04/24/1, http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00015.html, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://secunia.com/advisories/57353, http://marc.info/?l=bugtraq&m=133728068926468&w=2, http://marc.info/?l=bugtraq&m=134039053214295&w=2, http://www.securitytracker.com/id?1026957, http://www.securityfocus.com/bid/53212, http://marc.info/?l=bugtraq&m=133728068926468&w=2",
|
| 460 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2012/2xxx/CVE-2012-2131.json",
|
| 461 |
+
"last_modified": "2024-08-06T19:26:08.465Z"
|
| 462 |
+
},
|
| 463 |
+
"rerank_score": 0.09194397181272507
|
| 464 |
+
},
|
| 465 |
+
{
|
| 466 |
+
"score": 0.23902076482772827,
|
| 467 |
+
"text": "CVE ID: CVE-2012-3405 State: PUBLISHED Published: 2014-02-10T17:00:00 Last Updated: 2024-08-06T20:05:12.277Z Vendors: n/a Products: n/a Problem Types: n/a Description: The vfprintf function in stdio-common/vfprintf.c in libc in GNU C Library (aka glibc) 2.14 and other versions does not properly calculate a buffer length, which allows context-dependent attackers to bypass the FORTIFY_SOURCE format-string protection mechanism and cause a denial of service (segmentation fault and crash) via a format string with a large number of format specifiers that triggers \"desynchronization within the buffer size handling,\" a different vulnerability than CVE-2012-3404. Additional Analyst Notes: - CVE Progr",
|
| 468 |
+
"cve_id": "CVE-2012-3405",
|
| 469 |
+
"chunk_id": 0,
|
| 470 |
+
"metadata": {
|
| 471 |
+
"references": "http://rhn.redhat.com/errata/RHSA-2012-1200.html, https://bugzilla.redhat.com/show_bug.cgi?id=833704, https://sourceware.org/bugzilla/show_bug.cgi?id=13446, https://security.gentoo.org/glsa/201503-04, http://rhn.redhat.com/errata/RHSA-2012-1098.html, http://www.ubuntu.com/usn/USN-1589-1, http://www.openwall.com/lists/oss-security/2012/07/11/17",
|
| 472 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2012/3xxx/CVE-2012-3405.json",
|
| 473 |
+
"problem_types": "n/a",
|
| 474 |
+
"vendors": "n/a",
|
| 475 |
+
"products": "n/a",
|
| 476 |
+
"last_modified": "2024-08-06T20:05:12.277Z",
|
| 477 |
+
"published": "2014-02-10T17:00:00"
|
| 478 |
+
},
|
| 479 |
+
"rerank_score": 0.09069297462701797
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"score": 0.22998183965682983,
|
| 483 |
+
"text": "CVE ID: CVE-2014-0160 State: PUBLISHED Published: 2014-04-07T00:00:00.000Z Last Updated: 2025-10-22T00:05:38.217Z Vendors: n/a Products: n/a Problem Types: n/a Description: The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packets, which allows remote attackers to obtain sensitive information from process memory via crafted packets that trigger a buffer over-read, as demonstrated by reading private keys, related to d1_both.c and t1_lib.c, aka the Heartbleed bug. Additional Analyst Notes: - CVE Program Container: - CISA ADP Vulnrichment: References: - https://support.f5.com/kb/en-us/solutions/public/15000/100/sol15159.html?sr=36",
|
| 484 |
+
"cve_id": "CVE-2014-0160",
|
| 485 |
+
"chunk_id": 0,
|
| 486 |
+
"metadata": {
|
| 487 |
+
"products": "n/a",
|
| 488 |
+
"problem_types": "n/a",
|
| 489 |
+
"references": "https://support.f5.com/kb/en-us/solutions/public/15000/100/sol15159.html?sr=36517217, http://www.securitytracker.com/id/1030077, http://seclists.org/fulldisclosure/2014/Apr/90, http://www.getchef.com/blog/2014/04/09/chef-server-heartbleed-cve-2014-0160-releases/, http://www.debian.org/security/2014/dsa-2896, http://marc.info/?l=bugtraq&m=139774054614965&w=2, http://marc.info/?l=bugtraq&m=139889113431619&w=2, http://rhn.redhat.com/errata/RHSA-2014-0396.html, http://marc.info/?l=bugtraq&m=139835815211508&w=2, http://marc.info/?l=bugtraq&m=141287864628122&w=2, http://www.kb.cert.org/vuls/id/720951, http://www.splunk.com/view/SP-CAAAMB3, http://marc.info/?l=bugtraq&m=139905295427946&w=2, http://www.websense.com/support/article/kbarticle/Vulnerabilities-resolved-in-TRITON-APX-Version-8-0, http://www.apcmedia.com/salestools/SJHN-7RKGNM/SJHN-7RKGNM_R4_EN.pdf, http://marc.info/?l=bugtraq&m=139833395230364&w=2, http://www-01.ibm.com/support/docview.wss?uid=swg21670161, http://www.vmware.com/security/advisories/VMSA-2014-0012.html, http://lists.opensuse.org/opensuse-security-announce/2014-04/msg00004.html, http://marc.info/?l=bugtraq&m=142660345230545&w=2, http://seclists.org/fulldisclosure/2014/Apr/109, http://marc.info/?l=bugtraq&m=140724451518351&w=2, http://www.securitytracker.com/id/1030080, http://secunia.com/advisories/57836, http://www-01.ibm.com/support/docview.wss?uid=isg400001843, http://marc.info/?l=bugtraq&m=139808058921905&w=2, http://marc.info/?l=bugtraq&m=139758572430452&w=2, http://www.securityfocus.com/bid/66690, http://www.innominate.com/data/downloads/manuals/mdm_1.5.2.1_Release_Notes.pdf, https://filezilla-project.org/versions.php?type=server, http://marc.info/?l=bugtraq&m=139843768401936&w=2, http://secunia.com/advisories/57483, http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20140409-heartbleed, http://www.kerio.com/support/kerio-control/release-history, http://advisories.mageia.org/MGASA-2014-0165.html, http://www.blackberry.com/btsc/KB35882, http://marc.info/?l=bugtraq&m=142660345230545&w=2, http://marc.info/?l=bugtraq&m=140075368411126&w=2, http://marc.info/?l=bugtraq&m=139905351928096&w=2, http://www.securitytracker.com/id/1030081, http://lists.fedoraproject.org/pipermail/package-announce/2014-April/131221.html, http://www.securityfocus.com/archive/1/534161/100/0/threaded, http://lists.fedoraproject.org/pipermail/package-announce/2014-April/131291.html, https://bugzilla.redhat.com/show_bug.cgi?id=1084875, http://lists.fedoraproject.org/pipermail/package-announce/2014-August/136473.html, http://www-01.ibm.com/support/docview.wss?uid=isg400001841, http://marc.info/?l=bugtraq&m=139824993005633&w=2, http://www.securitytracker.com/id/1030079, http://rhn.redhat.com/errata/RHSA-2014-0377.html, http://marc.info/?l=bugtraq&m=139722163017074&w=2, http://marc.info/?l=bugtraq&m=139889295732144&w=2, https://code.google.com/p/mod-spdy/issues/detail?id=85, http://marc.info/?l=bugtraq&m=139765756720506&w=2, http://marc.info/?l=bugtraq&m=139774703817488&w=2, http://marc.info/?l=bugtraq&m=139905202427693&w=2, http://www.getchef.com/blog/2014/04/09/chef-server-11-0-12-release/, http://heartbleed.com/, http://marc.info/?l=bugtraq&m=139817782017443&w=2, http://download.schneider-electric.com/files?p_Doc_Ref=SEVD%202014-119-01, http://marc.info/?l=bugtraq&m=140015787404650&w=2, http://cogentdatahub.com/ReleaseNotes.html, http://marc.info/?l=bugtraq&m=139869720529462&w=2, http://marc.info/?l=bugtraq&m=139842151128341&w=2, http://marc.info/?l=bugtraq&m=139905243827825&w=2, http://marc.info/?l=bugtraq&m=139905458328378&w=2, http://www.f-secure.com/en/web/labs_global/fsc-2014-1, http://www.us-cert.gov/ncas/alerts/TA14-098A, http://secunia.com/advisories/57347, https://lists.balabit.hu/pipermail/syslog-ng-announce/2014-April/000184.html, http://seclists.org/fulldisclosure/2014/Apr/173, https://blog.torproject.org/blog/openssl-bug-cve-2014-0160, http://www.oracle.com/technetwork/topics/security/cpujul2014-1972956.html, http://www.oracle.com/technetwork/topics/security/opensslheartbleedcve-2014-0160-2188454.html, https://support.f5.com/kb/en-us/solutions/public/15000/100/sol15159.html, http://git.openssl.org/gitweb/?p=openssl.git%3Ba=commit%3Bh=96db9023b881d7cd9f379b0c154650d6c108e9a3, https://h20566.www2.hp.com/portal/site/hpsc/template.PAGE/public/kb/docDisplay/?spf_p.tpst=kbDocDisplay&spf_p.prp_kbDocDisplay=wsrp-navigationalState%3DdocId%253Demr_na-c04260637-4%257CdocLocale%253Den_US%257CcalledBy%253DSearch_Result&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken, http://seclists.org/fulldisclosure/2014/Dec/23, http://marc.info/?l=bugtraq&m=139905653828999&w=2, http://www.ubuntu.com/usn/USN-2165-1, http://rhn.redhat.com/errata/RHSA-2014-0378.html, http://marc.info/?l=bugtraq&m=139757919027752&w=2, http://lists.opensuse.org/opensuse-security-announce/2014-04/msg00005.html, http://www.exploit-db.com/exploits/32764, http://marc.info/?l=bugtraq&m=139757726426985&w=2, http://www.symantec.com/security_response/securityupdates/detail.jsp?fid=security_advisory&pvid=security_advisory&year=&suid=20160512_00, http://marc.info/?l=bugtraq&m=139869891830365&w=2, http://marc.info/?l=bugtraq&m=139905868529690&w=2, http://marc.info/?l=bugtraq&m=139817685517037&w=2, http://marc.info/?l=bugtraq&m=140752315422991&w=2, http://seclists.org/fulldisclosure/2014/Apr/91, http://www.securitytracker.com/id/1030078, http://secunia.com/advisories/59243, http://www-01.ibm.com/support/docview.wss?uid=ssg1S1004661, http://marc.info/?l=bugtraq&m=139836085512508&w=2, http://marc.info/?l=bugtraq&m=139824923705461&w=2, http://rhn.redhat.com/errata/RHSA-2014-0376.html, http://marc.info/?l=bugtraq&m=139835844111589&w=2, http://www.mandriva.com/security/advisories?name=MDVSA-2015:062, https://www.cert.fi/en/reports/2014/vulnerability788210.html, http://secunia.com/advisories/57721, http://secunia.com/advisories/57968, http://blog.fox-it.com/2014/04/08/openssl-heartbleed-bug-live-blog/, http://public.support.unisys.com/common/public/vulnerability/NVD_Detail_Rpt.aspx?ID=3, http://lists.opensuse.org/opensuse-updates/2014-04/msg00061.html, http://marc.info/?l=bugtraq&m=139905405728262&w=2, http://www.securitytracker.com/id/1030082, http://marc.info/?l=bugtraq&m=139757819327350&w=2, http://www.exploit-db.com/exploits/32745, http://seclists.org/fulldisclosure/2014/Apr/190, http://www.getchef.com/blog/2014/04/09/enterprise-chef-11-1-3-release/, http://marc.info/?l=bugtraq&m=139817727317190&w=2, https://www.mitel.com/en-ca/support/security-advisories/mitel-product-security-advisory-17-0008, http://www.openssl.org/news/secadv_20140407.txt, https://gist.github.com/chapmajs/10473815, http://public.support.unisys.com/common/public/vulnerability/NVD_Detail_Rpt.aspx?ID=1, http://www.securitytracker.com/id/1030074, http://support.citrix.com/article/CTX140605, http://secunia.com/advisories/59139, http://www.getchef.com/blog/2014/04/09/enterprise-chef-1-4-9-release/, http://secunia.com/advisories/57966, http://www.securitytracker.com/id/1030026, http://secunia.com/advisories/59347, https://lists.apache.org/thread.html/ba661b0edd913b39ff129a32d855620dd861883ade05fd88a8ce517d%40%3Cdev.tomcat.apache.org%3E, https://lists.apache.org/thread.html/f8e0814e11c7f21f42224b6de111cb3f5e5ab5c15b78924c516d4ec2%40%3Cdev.tomcat.apache.org%3E, https://sku11army.blogspot.com/2020/01/heartbleed-hearts-continue-to-bleed.html, https://lists.apache.org/thread.html/rf8e8c091182b45daa50d3557cad9b10bb4198e3f08cf8f1c66a1b08d%40%3Cdev.tomcat.apache.org%3E, https://cert-portal.siemens.com/productcert/pdf/ssa-635659.pdf, https://lists.apache.org/thread.html/re3b72cbb13e1dfe85c4a06959a3b6ca6d939b407ecca80db12b54220%40%3Cdev.tomcat.apache.org%3E, https://yunus-shn.medium.com/ricon-industrial-cellular-router-heartbleed-attack-2634221c02bd",
|
| 490 |
+
"published": "2014-04-07T00:00:00.000Z",
|
| 491 |
+
"last_modified": "2025-10-22T00:05:38.217Z",
|
| 492 |
+
"vendors": "n/a",
|
| 493 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2014/0xxx/CVE-2014-0160.json"
|
| 494 |
+
},
|
| 495 |
+
"rerank_score": 0.08813377469778061
|
| 496 |
+
},
|
| 497 |
+
{
|
| 498 |
+
"score": 0.22405391931533813,
|
| 499 |
+
"text": "CVE ID: CVE-2019-16748 State: PUBLISHED Published: 2019-09-24T12:12:38 Last Updated: 2024-08-05T01:24:47.098Z Vendors: n/a Products: n/a Problem Types: n/a Description: In wolfSSL through 4.1.0, there is a missing sanity check of memory accesses in parsing ASN.1 certificate data while handshaking. Specifically, there is a one-byte heap-based buffer over-read in CheckCertSignature_ex in wolfcrypt/src/asn.c. Additional Analyst Notes: - CVE Program Container: References: - https://github.com/wolfSSL/wolfssl/issues/2459",
|
| 500 |
+
"cve_id": "CVE-2019-16748",
|
| 501 |
+
"chunk_id": 0,
|
| 502 |
+
"metadata": {
|
| 503 |
+
"last_modified": "2024-08-05T01:24:47.098Z",
|
| 504 |
+
"published": "2019-09-24T12:12:38",
|
| 505 |
+
"products": "n/a",
|
| 506 |
+
"problem_types": "n/a",
|
| 507 |
+
"source_file": "/teamspace/studios/this_studio/cvelistV5-main/cves/2019/16xxx/CVE-2019-16748.json",
|
| 508 |
+
"vendors": "n/a",
|
| 509 |
+
"references": "https://github.com/wolfSSL/wolfssl/issues/2459"
|
| 510 |
+
},
|
| 511 |
+
"rerank_score": 0.06333654373884201
|
| 512 |
+
}
|
| 513 |
+
]
|
| 514 |
+
}
|
build_index.py
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Build a Chroma DB index of CVE chunks using Mixedbread embeddings.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import argparse
|
| 9 |
+
import json
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
from typing import Iterable, List, Sequence, Any
|
| 12 |
+
|
| 13 |
+
import numpy as np
|
| 14 |
+
import chromadb
|
| 15 |
+
from chromadb.config import Settings as ChromaSettings
|
| 16 |
+
from chromadb import errors as chroma_errors
|
| 17 |
+
from sentence_transformers import SentenceTransformer
|
| 18 |
+
|
| 19 |
+
from .config import Settings, load_settings
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def parse_args() -> argparse.Namespace:
|
| 23 |
+
settings = load_settings()
|
| 24 |
+
parser = argparse.ArgumentParser(description="Build the Mixedbread CVE index.")
|
| 25 |
+
parser.add_argument(
|
| 26 |
+
"--corpus",
|
| 27 |
+
default=str(settings.corpus_path),
|
| 28 |
+
help="Path to the prepared CVE corpus JSONL.",
|
| 29 |
+
)
|
| 30 |
+
parser.add_argument(
|
| 31 |
+
"--batch-size",
|
| 32 |
+
type=int,
|
| 33 |
+
default=settings.embed_batch_size,
|
| 34 |
+
help="Number of texts per embedding batch.",
|
| 35 |
+
)
|
| 36 |
+
parser.add_argument(
|
| 37 |
+
"--normalize",
|
| 38 |
+
action="store_true",
|
| 39 |
+
help="L2-normalize embeddings before indexing.",
|
| 40 |
+
)
|
| 41 |
+
parser.add_argument(
|
| 42 |
+
"--reset",
|
| 43 |
+
action="store_true",
|
| 44 |
+
help="Drop the existing Chroma collection before re-building.",
|
| 45 |
+
)
|
| 46 |
+
return parser.parse_args()
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def read_corpus(path: Path) -> Iterable[dict]:
|
| 50 |
+
with path.open("r", encoding="utf-8") as fh:
|
| 51 |
+
for line in fh:
|
| 52 |
+
if line.strip():
|
| 53 |
+
yield json.loads(line)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def chunk_iterable(items: Sequence[str], size: int) -> Iterable[Sequence[str]]:
|
| 57 |
+
for start in range(0, len(items), size):
|
| 58 |
+
yield items[start : start + size]
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def load_embedding_model(settings: Settings) -> SentenceTransformer:
|
| 62 |
+
"""Load the Mixedbread embedding model locally."""
|
| 63 |
+
print(f"Loading embedding model: {settings.embed_model}")
|
| 64 |
+
model = SentenceTransformer(
|
| 65 |
+
settings.embed_model,
|
| 66 |
+
device=settings.device,
|
| 67 |
+
use_auth_token=settings.hf_token if settings.hf_token else None,
|
| 68 |
+
)
|
| 69 |
+
print(f"Model loaded on {settings.device}")
|
| 70 |
+
return model
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def embed_batch(
|
| 74 |
+
texts: Sequence[str], model: SentenceTransformer, normalize: bool
|
| 75 |
+
) -> List[List[float]]:
|
| 76 |
+
"""Embed a batch of texts using the local model."""
|
| 77 |
+
embeddings = model.encode(
|
| 78 |
+
list(texts),
|
| 79 |
+
batch_size=len(texts),
|
| 80 |
+
show_progress_bar=False,
|
| 81 |
+
normalize_embeddings=normalize,
|
| 82 |
+
convert_to_numpy=True,
|
| 83 |
+
)
|
| 84 |
+
return embeddings.tolist()
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def get_collection(settings: Settings, reset: bool):
|
| 88 |
+
chroma_settings = ChromaSettings(
|
| 89 |
+
is_persistent=True,
|
| 90 |
+
persist_directory=str(settings.chroma_dir),
|
| 91 |
+
)
|
| 92 |
+
client = chromadb.Client(chroma_settings)
|
| 93 |
+
if reset:
|
| 94 |
+
try:
|
| 95 |
+
client.delete_collection(settings.chroma_collection)
|
| 96 |
+
except chroma_errors.NotFoundError:
|
| 97 |
+
pass
|
| 98 |
+
collection = client.get_or_create_collection(
|
| 99 |
+
settings.chroma_collection,
|
| 100 |
+
metadata={"hnsw:space": "cosine"},
|
| 101 |
+
)
|
| 102 |
+
return client, collection
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def coerce_metadata(meta: dict[str, Any]) -> dict[str, Any]:
|
| 106 |
+
"""Ensure metadata types are supported by Chroma."""
|
| 107 |
+
coerced: dict[str, Any] = {}
|
| 108 |
+
for key, value in (meta or {}).items():
|
| 109 |
+
if value is None:
|
| 110 |
+
continue
|
| 111 |
+
if isinstance(value, (str, int, float, bool)):
|
| 112 |
+
coerced[key] = value
|
| 113 |
+
elif isinstance(value, (list, tuple, set)):
|
| 114 |
+
coerced[key] = ", ".join(str(item) for item in value if item is not None)
|
| 115 |
+
elif isinstance(value, dict):
|
| 116 |
+
coerced[key] = json.dumps(value, sort_keys=True)
|
| 117 |
+
else:
|
| 118 |
+
coerced[key] = str(value)
|
| 119 |
+
return coerced
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def build_index(
|
| 123 |
+
corpus_path: Path,
|
| 124 |
+
settings: Settings,
|
| 125 |
+
batch_size: int,
|
| 126 |
+
normalize: bool,
|
| 127 |
+
reset: bool,
|
| 128 |
+
) -> None:
|
| 129 |
+
if not corpus_path.exists():
|
| 130 |
+
raise FileNotFoundError(
|
| 131 |
+
f"Corpus not found at {corpus_path}. Run rag_mixedbread/prepare_cve_corpus.py first."
|
| 132 |
+
)
|
| 133 |
+
|
| 134 |
+
texts: List[str] = []
|
| 135 |
+
metadata: List[dict] = []
|
| 136 |
+
|
| 137 |
+
print("Loading corpus into memory...")
|
| 138 |
+
for record in read_corpus(corpus_path):
|
| 139 |
+
text = record["text"]
|
| 140 |
+
texts.append(text)
|
| 141 |
+
metadata.append(
|
| 142 |
+
{
|
| 143 |
+
"cve_id": record["cve_id"],
|
| 144 |
+
"chunk_id": record["chunk_id"],
|
| 145 |
+
"text": text,
|
| 146 |
+
**coerce_metadata(record.get("metadata") or {}),
|
| 147 |
+
}
|
| 148 |
+
)
|
| 149 |
+
|
| 150 |
+
if not texts:
|
| 151 |
+
raise RuntimeError("Corpus is empty; nothing to embed.")
|
| 152 |
+
|
| 153 |
+
# Load the embedding model locally
|
| 154 |
+
model = load_embedding_model(settings)
|
| 155 |
+
client, collection = get_collection(settings, reset=reset)
|
| 156 |
+
|
| 157 |
+
total = len(texts)
|
| 158 |
+
added = 0
|
| 159 |
+
for start in range(0, total, batch_size):
|
| 160 |
+
batch_texts = texts[start : start + batch_size]
|
| 161 |
+
batch_meta = metadata[start : start + batch_size]
|
| 162 |
+
# Embed using local model (normalization handled by sentence-transformers)
|
| 163 |
+
vectors = embed_batch(batch_texts, model, normalize=normalize)
|
| 164 |
+
matrix = np.array(vectors, dtype="float32")
|
| 165 |
+
ids = [
|
| 166 |
+
f"{meta['cve_id']}:{meta['chunk_id']}"
|
| 167 |
+
for meta in batch_meta
|
| 168 |
+
]
|
| 169 |
+
collection.add(
|
| 170 |
+
ids=ids,
|
| 171 |
+
documents=batch_texts,
|
| 172 |
+
metadatas=batch_meta,
|
| 173 |
+
embeddings=matrix.tolist(),
|
| 174 |
+
)
|
| 175 |
+
added += len(batch_texts)
|
| 176 |
+
print(f"Embedded & stored {added} / {total} chunks", end="\r")
|
| 177 |
+
print()
|
| 178 |
+
|
| 179 |
+
client.persist()
|
| 180 |
+
print(
|
| 181 |
+
f"Indexed {added} vectors into Chroma at {settings.chroma_dir} "
|
| 182 |
+
f"(collection: {settings.chroma_collection})."
|
| 183 |
+
)
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
def main() -> None:
|
| 187 |
+
args = parse_args()
|
| 188 |
+
settings = load_settings()
|
| 189 |
+
build_index(
|
| 190 |
+
Path(args.corpus),
|
| 191 |
+
settings,
|
| 192 |
+
args.batch_size,
|
| 193 |
+
args.normalize,
|
| 194 |
+
args.reset,
|
| 195 |
+
)
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
if __name__ == "__main__":
|
| 199 |
+
main()
|
| 200 |
+
|
config.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Centralized configuration helpers for the Mixedbread CVE RAG workflow.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import os
|
| 8 |
+
from dataclasses import dataclass
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
@dataclass
|
| 13 |
+
class Settings:
|
| 14 |
+
"""Container for frequently used paths and model configuration."""
|
| 15 |
+
|
| 16 |
+
project_root: Path
|
| 17 |
+
zip_path: Path
|
| 18 |
+
cve_root: Path
|
| 19 |
+
corpus_path: Path
|
| 20 |
+
chroma_dir: Path
|
| 21 |
+
chroma_collection: str
|
| 22 |
+
embed_model: str
|
| 23 |
+
rerank_model: str
|
| 24 |
+
hf_token: str # Optional, only needed for downloading models from HF Hub
|
| 25 |
+
embed_batch_size: int
|
| 26 |
+
device: str # "cpu" or "cuda" for GPU
|
| 27 |
+
|
| 28 |
+
def load_settings() -> Settings:
|
| 29 |
+
root = Path(__file__).resolve().parents[1]
|
| 30 |
+
data_root = root / "data" / "cvelistV5-main"
|
| 31 |
+
artifacts_dir = root / "rag_mixedbread" / "artifacts"
|
| 32 |
+
chroma_dir = root / "rag_mixedbread" / "index"
|
| 33 |
+
|
| 34 |
+
hf_token = os.environ.get("HF_API_TOKEN", "")
|
| 35 |
+
|
| 36 |
+
settings = Settings(
|
| 37 |
+
project_root=root,
|
| 38 |
+
zip_path=root / "testing" / "cvelistV5-main.zip",
|
| 39 |
+
cve_root=data_root,
|
| 40 |
+
corpus_path=artifacts_dir / "cve_corpus.jsonl",
|
| 41 |
+
chroma_dir=chroma_dir,
|
| 42 |
+
chroma_collection=os.environ.get("RAG_CHROMA_COLLECTION", "cve_chunks"),
|
| 43 |
+
embed_model=os.environ.get(
|
| 44 |
+
"RAG_EMBED_MODEL", "mixedbread-ai/mxbai-embed-large-v1"
|
| 45 |
+
),
|
| 46 |
+
rerank_model=os.environ.get(
|
| 47 |
+
"RAG_RERANK_MODEL", "mixedbread-ai/mxbai-rerank-base-v2"
|
| 48 |
+
),
|
| 49 |
+
hf_token=hf_token, # Optional, only needed for private models or rate-limited downloads
|
| 50 |
+
embed_batch_size=int(os.environ.get("RAG_EMBED_BATCH", "8")),
|
| 51 |
+
device=os.environ.get("RAG_DEVICE", "cpu"), # "cpu" or "cuda"
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
artifacts_dir.mkdir(parents=True, exist_ok=True)
|
| 55 |
+
chroma_dir.mkdir(parents=True, exist_ok=True)
|
| 56 |
+
return settings
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
__all__ = ["Settings", "load_settings"]
|
| 60 |
+
|
env.example
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Optional: Hugging Face token (only needed for private models or rate-limited downloads)
|
| 2 |
+
# HF_API_TOKEN=hf_your_token_here
|
| 3 |
+
|
| 4 |
+
# Optional overrides
|
| 5 |
+
# RAG_EMBED_MODEL=mixedbread-ai/mxbai-embed-large-v1
|
| 6 |
+
# RAG_RERANK_MODEL=mixedbread-ai/mxbai-rerank-base-v2
|
| 7 |
+
# RAG_EMBED_BATCH=8
|
| 8 |
+
# RAG_DEVICE=cpu # or "cuda" for GPU acceleration
|
| 9 |
+
# RAG_CHROMA_COLLECTION=cve_chunks
|
| 10 |
+
|
prepare_cve_corpus.py
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Normalize CVE JSON files into chunked text documents for downstream embeddings.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import argparse
|
| 9 |
+
import json
|
| 10 |
+
import textwrap
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
from typing import Dict, Iterable, List, Sequence, Tuple
|
| 13 |
+
|
| 14 |
+
from .config import load_settings
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def parse_args() -> argparse.Namespace:
|
| 18 |
+
settings = load_settings()
|
| 19 |
+
parser = argparse.ArgumentParser(description="Prepare CVE corpus.")
|
| 20 |
+
parser.add_argument(
|
| 21 |
+
"--cve-root",
|
| 22 |
+
default=str(settings.cve_root),
|
| 23 |
+
help="Directory containing extracted CVE JSON files.",
|
| 24 |
+
)
|
| 25 |
+
parser.add_argument(
|
| 26 |
+
"--output",
|
| 27 |
+
default=str(settings.corpus_path),
|
| 28 |
+
help="Path to write the normalized JSONL corpus.",
|
| 29 |
+
)
|
| 30 |
+
parser.add_argument(
|
| 31 |
+
"--chunk-size",
|
| 32 |
+
type=int,
|
| 33 |
+
default=700,
|
| 34 |
+
help="Maximum number of characters per chunk.",
|
| 35 |
+
)
|
| 36 |
+
parser.add_argument(
|
| 37 |
+
"--chunk-overlap",
|
| 38 |
+
type=int,
|
| 39 |
+
default=120,
|
| 40 |
+
help="Character overlap between consecutive chunks.",
|
| 41 |
+
)
|
| 42 |
+
return parser.parse_args()
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def chunk_text(text: str, chunk_size: int, overlap: int) -> List[str]:
|
| 46 |
+
if not text:
|
| 47 |
+
return []
|
| 48 |
+
text = " ".join(text.split()) # normalize whitespace
|
| 49 |
+
chunks: List[str] = []
|
| 50 |
+
start = 0
|
| 51 |
+
length = len(text)
|
| 52 |
+
while start < length:
|
| 53 |
+
end = min(length, start + chunk_size)
|
| 54 |
+
chunks.append(text[start:end])
|
| 55 |
+
if end == length:
|
| 56 |
+
break
|
| 57 |
+
start = max(0, end - overlap)
|
| 58 |
+
return chunks
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def load_json(path: Path):
|
| 62 |
+
with path.open("r", encoding="utf-8") as fh:
|
| 63 |
+
return json.load(fh)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def iter_raw_entries(path: Path) -> Iterable[Dict]:
|
| 67 |
+
data = load_json(path)
|
| 68 |
+
if isinstance(data, dict):
|
| 69 |
+
if "CVE_Items" in data:
|
| 70 |
+
for item in data["CVE_Items"]:
|
| 71 |
+
yield item
|
| 72 |
+
elif "cve" in data:
|
| 73 |
+
yield data
|
| 74 |
+
else:
|
| 75 |
+
yield data
|
| 76 |
+
elif isinstance(data, list):
|
| 77 |
+
for item in data:
|
| 78 |
+
yield item
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def select_lang_values(items: Sequence[Dict], prefer_lang: str = "en") -> List[str]:
|
| 82 |
+
preferred = [
|
| 83 |
+
item.get("value", "").strip()
|
| 84 |
+
for item in items
|
| 85 |
+
if item.get("value") and item.get("lang") == prefer_lang
|
| 86 |
+
]
|
| 87 |
+
if preferred:
|
| 88 |
+
return preferred
|
| 89 |
+
return [
|
| 90 |
+
item.get("value", "").strip()
|
| 91 |
+
for item in items
|
| 92 |
+
if item.get("value")
|
| 93 |
+
]
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def dedupe(seq: Sequence[str]) -> List[str]:
|
| 97 |
+
seen = set()
|
| 98 |
+
result = []
|
| 99 |
+
for item in seq:
|
| 100 |
+
if not item or item in seen:
|
| 101 |
+
continue
|
| 102 |
+
seen.add(item)
|
| 103 |
+
result.append(item)
|
| 104 |
+
return result
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def extract_cvss(metrics: Sequence[Dict]) -> Tuple[float | None, str | None, str | None]:
|
| 108 |
+
best_score = None
|
| 109 |
+
best_vector = None
|
| 110 |
+
best_severity = None
|
| 111 |
+
for entry in metrics:
|
| 112 |
+
for key in ("cvssV3_1", "cvssV3_0", "cvssV2_0"):
|
| 113 |
+
if key in entry:
|
| 114 |
+
payload = entry[key]
|
| 115 |
+
score = payload.get("baseScore")
|
| 116 |
+
if score is None:
|
| 117 |
+
continue
|
| 118 |
+
if best_score is None or score > best_score:
|
| 119 |
+
best_score = score
|
| 120 |
+
best_vector = payload.get("vectorString")
|
| 121 |
+
best_severity = payload.get("baseSeverity")
|
| 122 |
+
return best_score, best_vector, best_severity
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def extract_problem_types(problem_types: Sequence[Dict]) -> List[str]:
|
| 126 |
+
labels: List[str] = []
|
| 127 |
+
for entry in problem_types:
|
| 128 |
+
for desc in entry.get("descriptions", []):
|
| 129 |
+
label = desc.get("cweId") or desc.get("description")
|
| 130 |
+
if label:
|
| 131 |
+
labels.append(label)
|
| 132 |
+
return dedupe(labels)
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
def summarize_affected(affected: Sequence[Dict]) -> Tuple[List[str], List[str]]:
|
| 136 |
+
vendors: List[str] = []
|
| 137 |
+
products: List[str] = []
|
| 138 |
+
for entry in affected:
|
| 139 |
+
vendor = entry.get("vendor")
|
| 140 |
+
product = entry.get("product")
|
| 141 |
+
if vendor:
|
| 142 |
+
vendors.append(vendor)
|
| 143 |
+
if product:
|
| 144 |
+
products.append(product)
|
| 145 |
+
return dedupe(vendors), dedupe(products)
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def extract_v5_fields(raw: Dict) -> Dict:
|
| 149 |
+
meta = raw.get("cveMetadata", {})
|
| 150 |
+
cna = raw.get("containers", {}).get("cna", {})
|
| 151 |
+
descriptions = select_lang_values(cna.get("descriptions", []))
|
| 152 |
+
description = " ".join(descriptions).strip()
|
| 153 |
+
|
| 154 |
+
references = [
|
| 155 |
+
ref.get("url")
|
| 156 |
+
for ref in cna.get("references", [])
|
| 157 |
+
if ref.get("url")
|
| 158 |
+
]
|
| 159 |
+
|
| 160 |
+
problem_types = extract_problem_types(cna.get("problemTypes", []))
|
| 161 |
+
cwe = next((label for label in problem_types if label.startswith("CWE-")), None)
|
| 162 |
+
|
| 163 |
+
vendors, products = summarize_affected(cna.get("affected", []))
|
| 164 |
+
cvss_score, cvss_vector, severity = extract_cvss(cna.get("metrics", []))
|
| 165 |
+
|
| 166 |
+
published = meta.get("datePublished")
|
| 167 |
+
last_modified = meta.get("dateUpdated")
|
| 168 |
+
|
| 169 |
+
adp_text = []
|
| 170 |
+
for container in raw.get("containers", {}).get("adp", []):
|
| 171 |
+
title = container.get("title")
|
| 172 |
+
notes = select_lang_values(container.get("descriptions", []))
|
| 173 |
+
if title:
|
| 174 |
+
adp_text.append(f"{title}: {' '.join(notes) if notes else ''}".strip())
|
| 175 |
+
|
| 176 |
+
body_parts = [
|
| 177 |
+
f"CVE ID: {meta.get('cveId', 'UNKNOWN')}",
|
| 178 |
+
f"State: {meta.get('state', 'N/A')}",
|
| 179 |
+
f"Published: {published or 'N/A'}",
|
| 180 |
+
f"Last Updated: {last_modified or 'N/A'}",
|
| 181 |
+
]
|
| 182 |
+
if severity or cvss_score:
|
| 183 |
+
body_parts.append(
|
| 184 |
+
f"Severity: {severity or 'N/A'} (CVSS {cvss_score or 'N/A'} {cvss_vector or ''})".strip()
|
| 185 |
+
)
|
| 186 |
+
if vendors:
|
| 187 |
+
body_parts.append(f"Vendors: {', '.join(vendors)}")
|
| 188 |
+
if products:
|
| 189 |
+
body_parts.append(f"Products: {', '.join(products)}")
|
| 190 |
+
if problem_types:
|
| 191 |
+
body_parts.append(f"Problem Types: {', '.join(problem_types)}")
|
| 192 |
+
|
| 193 |
+
body_parts.extend(
|
| 194 |
+
[
|
| 195 |
+
"",
|
| 196 |
+
"Description:",
|
| 197 |
+
description or "No description available.",
|
| 198 |
+
]
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
if adp_text:
|
| 202 |
+
body_parts.append("")
|
| 203 |
+
body_parts.append("Additional Analyst Notes:")
|
| 204 |
+
for note in adp_text:
|
| 205 |
+
body_parts.append(f"- {note}")
|
| 206 |
+
|
| 207 |
+
if references:
|
| 208 |
+
body_parts.append("")
|
| 209 |
+
body_parts.append("References:")
|
| 210 |
+
for ref in references:
|
| 211 |
+
body_parts.append(f"- {ref}")
|
| 212 |
+
|
| 213 |
+
flat_text = "\n".join(textwrap.dedent(part).strip() for part in body_parts if part is not None)
|
| 214 |
+
|
| 215 |
+
return {
|
| 216 |
+
"cve_id": meta.get("cveId", "UNKNOWN"),
|
| 217 |
+
"cwe": cwe,
|
| 218 |
+
"problem_types": problem_types,
|
| 219 |
+
"published": published,
|
| 220 |
+
"last_modified": last_modified,
|
| 221 |
+
"severity": severity,
|
| 222 |
+
"cvss_score": cvss_score,
|
| 223 |
+
"cvss_vector": cvss_vector,
|
| 224 |
+
"vendors": vendors,
|
| 225 |
+
"products": products,
|
| 226 |
+
"references": references,
|
| 227 |
+
"text": flat_text,
|
| 228 |
+
"source_file": str(raw.get("_source_file", "unknown")),
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
def extract_legacy_fields(raw: Dict) -> Dict:
|
| 233 |
+
cve_id = (
|
| 234 |
+
raw.get("cve", {})
|
| 235 |
+
.get("CVE_data_meta", {})
|
| 236 |
+
.get("ID")
|
| 237 |
+
or raw.get("cve_id")
|
| 238 |
+
or raw.get("id")
|
| 239 |
+
)
|
| 240 |
+
description = ""
|
| 241 |
+
if "cve" in raw:
|
| 242 |
+
desc_data = raw["cve"].get("description", {}).get("description_data", [])
|
| 243 |
+
description = " ".join(item.get("value", "") for item in desc_data)
|
| 244 |
+
elif "description" in raw:
|
| 245 |
+
if isinstance(raw["description"], dict):
|
| 246 |
+
description = raw["description"].get("description_data", "")
|
| 247 |
+
else:
|
| 248 |
+
description = str(raw["description"])
|
| 249 |
+
|
| 250 |
+
references = []
|
| 251 |
+
if "cve" in raw:
|
| 252 |
+
refs = raw["cve"].get("references", {}).get("reference_data", [])
|
| 253 |
+
references = [ref.get("url") for ref in refs if ref.get("url")]
|
| 254 |
+
elif "references" in raw and isinstance(raw["references"], list):
|
| 255 |
+
references = [
|
| 256 |
+
ref if isinstance(ref, str) else ref.get("url")
|
| 257 |
+
for ref in raw["references"]
|
| 258 |
+
]
|
| 259 |
+
|
| 260 |
+
cwe = None
|
| 261 |
+
problemtype = raw.get("cve", {}).get("problemtype", {}).get("problemtype_data", [])
|
| 262 |
+
if problemtype:
|
| 263 |
+
descriptions = problemtype[0].get("description", [])
|
| 264 |
+
if descriptions:
|
| 265 |
+
cwe = descriptions[0].get("value")
|
| 266 |
+
|
| 267 |
+
published = raw.get("publishedDate") or raw.get("published")
|
| 268 |
+
last_modified = raw.get("lastModifiedDate") or raw.get("last_modified")
|
| 269 |
+
|
| 270 |
+
body_parts = [
|
| 271 |
+
f"CVE ID: {cve_id or 'UNKNOWN'}",
|
| 272 |
+
f"CWE: {cwe or 'N/A'}",
|
| 273 |
+
f"Published: {published or 'N/A'}",
|
| 274 |
+
f"Last Modified: {last_modified or 'N/A'}",
|
| 275 |
+
"",
|
| 276 |
+
"Description:",
|
| 277 |
+
description or "No description available.",
|
| 278 |
+
]
|
| 279 |
+
|
| 280 |
+
if references:
|
| 281 |
+
body_parts.append("")
|
| 282 |
+
body_parts.append("References:")
|
| 283 |
+
for ref in references:
|
| 284 |
+
body_parts.append(f"- {ref}")
|
| 285 |
+
|
| 286 |
+
flat_text = "\n".join(textwrap.dedent(part).strip() for part in body_parts)
|
| 287 |
+
|
| 288 |
+
return {
|
| 289 |
+
"cve_id": cve_id or "UNKNOWN",
|
| 290 |
+
"cwe": cwe,
|
| 291 |
+
"problem_types": [cwe] if cwe else [],
|
| 292 |
+
"published": published,
|
| 293 |
+
"last_modified": last_modified,
|
| 294 |
+
"severity": None,
|
| 295 |
+
"cvss_score": None,
|
| 296 |
+
"cvss_vector": None,
|
| 297 |
+
"vendors": [],
|
| 298 |
+
"products": [],
|
| 299 |
+
"references": references,
|
| 300 |
+
"text": flat_text,
|
| 301 |
+
"source_file": str(raw.get("_source_file", "unknown")),
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
|
| 305 |
+
def normalize_entry(raw: Dict) -> Dict:
|
| 306 |
+
if "containers" in raw and "cveMetadata" in raw:
|
| 307 |
+
return extract_v5_fields(raw)
|
| 308 |
+
return extract_legacy_fields(raw)
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
def prepare_entries(cve_root: Path) -> Iterable[Dict]:
|
| 312 |
+
json_files = sorted(cve_root.rglob("*.json"))
|
| 313 |
+
for path in json_files:
|
| 314 |
+
for raw in iter_raw_entries(path):
|
| 315 |
+
raw["_source_file"] = path
|
| 316 |
+
yield normalize_entry(raw)
|
| 317 |
+
|
| 318 |
+
|
| 319 |
+
def write_corpus(
|
| 320 |
+
entries: Iterable[Dict], output_path: Path, chunk_size: int, overlap: int
|
| 321 |
+
) -> Tuple[int, int]:
|
| 322 |
+
output_path.parent.mkdir(parents=True, exist_ok=True)
|
| 323 |
+
doc_count = 0
|
| 324 |
+
chunk_count = 0
|
| 325 |
+
with output_path.open("w", encoding="utf-8") as writer:
|
| 326 |
+
for entry in entries:
|
| 327 |
+
doc_count += 1
|
| 328 |
+
chunks = chunk_text(entry["text"], chunk_size, overlap)
|
| 329 |
+
for idx, chunk in enumerate(chunks):
|
| 330 |
+
chunk_count += 1
|
| 331 |
+
record = {
|
| 332 |
+
"cve_id": entry["cve_id"],
|
| 333 |
+
"chunk_id": idx,
|
| 334 |
+
"text": chunk,
|
| 335 |
+
"metadata": {
|
| 336 |
+
"cwe": entry["cwe"],
|
| 337 |
+
"problem_types": entry.get("problem_types"),
|
| 338 |
+
"published": entry["published"],
|
| 339 |
+
"last_modified": entry["last_modified"],
|
| 340 |
+
"severity": entry.get("severity"),
|
| 341 |
+
"cvss_score": entry.get("cvss_score"),
|
| 342 |
+
"cvss_vector": entry.get("cvss_vector"),
|
| 343 |
+
"vendors": entry.get("vendors"),
|
| 344 |
+
"products": entry.get("products"),
|
| 345 |
+
"references": entry["references"],
|
| 346 |
+
"source_file": entry["source_file"],
|
| 347 |
+
},
|
| 348 |
+
}
|
| 349 |
+
writer.write(json.dumps(record) + "\n")
|
| 350 |
+
return doc_count, chunk_count
|
| 351 |
+
|
| 352 |
+
|
| 353 |
+
def main() -> None:
|
| 354 |
+
args = parse_args()
|
| 355 |
+
cve_root = Path(args.cve_root)
|
| 356 |
+
if not cve_root.exists():
|
| 357 |
+
raise FileNotFoundError(
|
| 358 |
+
f"CVE root {cve_root} not found. Run scripts/unzip_cvelist.py first."
|
| 359 |
+
)
|
| 360 |
+
entries = prepare_entries(cve_root)
|
| 361 |
+
docs, chunks = write_corpus(entries, Path(args.output), args.chunk_size, args.chunk_overlap)
|
| 362 |
+
print(f"Wrote {chunks} chunks from {docs} CVE entries to {args.output}")
|
| 363 |
+
|
| 364 |
+
|
| 365 |
+
if __name__ == "__main__":
|
| 366 |
+
main()
|
| 367 |
+
|
query_service.py
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Query interface for the Mixedbread CVE RAG index with reranking using Chroma DB.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import argparse
|
| 9 |
+
import json
|
| 10 |
+
from typing import List, Sequence
|
| 11 |
+
|
| 12 |
+
import numpy as np
|
| 13 |
+
import chromadb
|
| 14 |
+
from chromadb.config import Settings as ChromaSettings
|
| 15 |
+
from chromadb import errors as chroma_errors
|
| 16 |
+
from sentence_transformers import SentenceTransformer, CrossEncoder
|
| 17 |
+
|
| 18 |
+
from .config import Settings, load_settings
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class QueryEngine:
|
| 22 |
+
def __init__(self, settings: Settings, normalize: bool):
|
| 23 |
+
self.settings = settings
|
| 24 |
+
self.normalize = normalize
|
| 25 |
+
chroma_settings = ChromaSettings(
|
| 26 |
+
is_persistent=True,
|
| 27 |
+
persist_directory=str(settings.chroma_dir),
|
| 28 |
+
)
|
| 29 |
+
self.client = chromadb.Client(chroma_settings)
|
| 30 |
+
try:
|
| 31 |
+
self.collection = self.client.get_collection(settings.chroma_collection)
|
| 32 |
+
except chroma_errors.NotFoundError as exc:
|
| 33 |
+
raise FileNotFoundError(
|
| 34 |
+
f"Chroma collection '{settings.chroma_collection}' not found in {settings.chroma_dir}. "
|
| 35 |
+
"Run build_index.py first."
|
| 36 |
+
) from exc
|
| 37 |
+
|
| 38 |
+
# Load embedding model locally
|
| 39 |
+
print(f"Loading embedding model: {settings.embed_model}")
|
| 40 |
+
embed_kwargs = {
|
| 41 |
+
"device": settings.device,
|
| 42 |
+
}
|
| 43 |
+
if settings.hf_token:
|
| 44 |
+
embed_kwargs["use_auth_token"] = settings.hf_token
|
| 45 |
+
self.embed_model = SentenceTransformer(
|
| 46 |
+
settings.embed_model,
|
| 47 |
+
**embed_kwargs,
|
| 48 |
+
)
|
| 49 |
+
print(f"Loading reranker model: {settings.rerank_model}")
|
| 50 |
+
rerank_kwargs = {
|
| 51 |
+
"device": settings.device,
|
| 52 |
+
}
|
| 53 |
+
if settings.hf_token:
|
| 54 |
+
rerank_kwargs["token"] = settings.hf_token
|
| 55 |
+
self.rerank_model = CrossEncoder(
|
| 56 |
+
settings.rerank_model,
|
| 57 |
+
**rerank_kwargs,
|
| 58 |
+
)
|
| 59 |
+
print(f"Models loaded on {settings.device}")
|
| 60 |
+
|
| 61 |
+
def _embed(self, texts: Sequence[str]) -> np.ndarray:
|
| 62 |
+
"""Embed texts using the local model."""
|
| 63 |
+
embeddings = self.embed_model.encode(
|
| 64 |
+
list(texts),
|
| 65 |
+
batch_size=len(texts),
|
| 66 |
+
show_progress_bar=False,
|
| 67 |
+
normalize_embeddings=self.normalize,
|
| 68 |
+
convert_to_numpy=True,
|
| 69 |
+
)
|
| 70 |
+
return embeddings
|
| 71 |
+
|
| 72 |
+
def _rerank(self, query: str, candidates: List[dict], top_n: int) -> List[dict]:
|
| 73 |
+
"""Rerank candidates using the local CrossEncoder model."""
|
| 74 |
+
pairs = [[query, c["text"]] for c in candidates]
|
| 75 |
+
scores = self.rerank_model.predict(pairs)
|
| 76 |
+
scored = []
|
| 77 |
+
for candidate, score in zip(candidates, scores):
|
| 78 |
+
scored.append({**candidate, "rerank_score": float(score)})
|
| 79 |
+
scored.sort(key=lambda x: x.get("rerank_score", 0), reverse=True)
|
| 80 |
+
return scored[:top_n]
|
| 81 |
+
|
| 82 |
+
def query(self, query_text: str, top_k: int, top_n: int) -> List[dict]:
|
| 83 |
+
query_vec = self._embed([query_text])
|
| 84 |
+
results = self.collection.query(
|
| 85 |
+
query_embeddings=query_vec.tolist(),
|
| 86 |
+
n_results=top_k,
|
| 87 |
+
include=["documents", "metadatas", "distances"],
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
documents = results.get("documents", [[]])[0]
|
| 91 |
+
metadatas = results.get("metadatas", [[]])[0]
|
| 92 |
+
distances = results.get("distances", [[]])[0]
|
| 93 |
+
|
| 94 |
+
candidates = []
|
| 95 |
+
for doc, meta, score in zip(documents, metadatas, distances):
|
| 96 |
+
candidates.append(
|
| 97 |
+
{
|
| 98 |
+
"score": float(score),
|
| 99 |
+
"text": doc,
|
| 100 |
+
"cve_id": meta.get("cve_id", "UNKNOWN"),
|
| 101 |
+
"chunk_id": meta.get("chunk_id", -1),
|
| 102 |
+
"metadata": {k: v for k, v in meta.items() if k not in {"cve_id", "chunk_id", "text"}},
|
| 103 |
+
}
|
| 104 |
+
)
|
| 105 |
+
if not candidates:
|
| 106 |
+
return []
|
| 107 |
+
return self._rerank(query_text, candidates, top_n)
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def parse_args() -> argparse.Namespace:
|
| 111 |
+
parser = argparse.ArgumentParser(description="Query the Mixedbread CVE index.")
|
| 112 |
+
parser.add_argument("query", help="Natural language query to search for.")
|
| 113 |
+
parser.add_argument(
|
| 114 |
+
"--top-k",
|
| 115 |
+
type=int,
|
| 116 |
+
default=20,
|
| 117 |
+
help="Number of candidates to retrieve before reranking.",
|
| 118 |
+
)
|
| 119 |
+
parser.add_argument(
|
| 120 |
+
"--top-n",
|
| 121 |
+
type=int,
|
| 122 |
+
default=5,
|
| 123 |
+
help="Number of reranked results to display.",
|
| 124 |
+
)
|
| 125 |
+
parser.add_argument(
|
| 126 |
+
"--normalize",
|
| 127 |
+
action="store_true",
|
| 128 |
+
help="Normalize query embeddings (must match build_index normalization).",
|
| 129 |
+
)
|
| 130 |
+
parser.add_argument(
|
| 131 |
+
"--json",
|
| 132 |
+
action="store_true",
|
| 133 |
+
help="Emit results as JSON for downstream automation.",
|
| 134 |
+
)
|
| 135 |
+
return parser.parse_args()
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
def main() -> None:
|
| 139 |
+
args = parse_args()
|
| 140 |
+
settings = load_settings()
|
| 141 |
+
engine = QueryEngine(settings, normalize=args.normalize)
|
| 142 |
+
results = engine.query(args.query, args.top_k, args.top_n)
|
| 143 |
+
if args.json:
|
| 144 |
+
print(json.dumps(results, indent=2))
|
| 145 |
+
return
|
| 146 |
+
for idx, result in enumerate(results, start=1):
|
| 147 |
+
print(f"[{idx}] CVE {result['cve_id']} (chunk {result['chunk_id']})")
|
| 148 |
+
print(f" Rerank score: {result.get('rerank_score'):.4f}")
|
| 149 |
+
meta = result["metadata"]
|
| 150 |
+
if meta.get("cwe"):
|
| 151 |
+
print(f" CWE: {meta['cwe']}")
|
| 152 |
+
if meta.get("published"):
|
| 153 |
+
print(f" Published: {meta['published']}")
|
| 154 |
+
print(" Text preview:")
|
| 155 |
+
preview = result["text"].strip().replace("\n", " ")
|
| 156 |
+
print(f" {preview[:400]}{'...' if len(preview) > 400 else ''}")
|
| 157 |
+
print()
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
if __name__ == "__main__":
|
| 161 |
+
main()
|
| 162 |
+
|