├── .gitignore ├── LICENSE ├── README.md ├── code ├── llm │ ├── cfgs │ │ ├── sample_config.yaml │ │ ├── v1_mixtral_cot_generate_fp.yaml │ │ └── v1_mixtral_cot_generate_tp.yaml │ ├── cot-generate-fp-example.py │ ├── cot-generate-tp-example.py │ ├── llm_driver.py │ └── templates │ │ ├── template_few_shot.yaml │ │ ├── template_few_shot_deepseek_wizardcoder.yaml │ │ ├── template_few_shot_llama.yaml │ │ ├── template_few_shot_mixtral.yaml │ │ ├── template_zero_shot_deepseek_wizardcoder.yaml │ │ ├── template_zero_shot_llama.yaml │ │ ├── template_zero_shot_llama_v2.yaml │ │ ├── template_zero_shot_mixtral.yaml │ │ ├── vulnerable_function_template.txt │ │ └── vulnerable_function_template_v2.txt └── prompts │ ├── few-shot │ ├── example-template │ │ └── vuln-detailed-explain-example-v3.yaml │ └── system-prompt │ │ └── vuln-detailed-explain-system-v3.txt │ ├── user-template │ ├── generate-cot-examples-fp-user-v1.yaml │ ├── generate-cot-examples-tp-user-v1.yaml │ └── vuln-detailed-explain-user-v3.yaml │ └── zero-shot │ └── system-prompt │ ├── basic-system-v3.txt │ ├── generate-cot-examples-fp-system-v1.txt │ ├── generate-cot-examples-tp-system-v1.txt │ ├── vuln-detailed-explain-system-v3.txt │ └── vuln-detailed-system-v3.txt ├── data ├── advisory-data │ ├── govulndb-2023-10-26.csv │ └── govulndb-similar-descriptions-2023-10-31.csv ├── patchparser-data.tar.gz └── rag-db │ ├── advisory-faiss-index-2023-10-26.bin │ ├── advisory-faiss-index-map-2023-10-26.csv │ ├── complete-git-hunk-faiss-index-2023-10-26.bin │ ├── complete-git-hunk-faiss-index-map-2023-10-26.csv │ ├── fp-git-hunk-faiss-index-2023-10-26.bin │ ├── fp-git-hunk-faiss-index-map-2023-10-26.csv │ ├── tp-git-hunk-faiss-index-2023-10-26.bin │ └── tp-git-hunk-faiss-index-map-2023-10-26.csv ├── requirements.txt └── utils ├── __init__.py ├── embedding_helper.py ├── github_helper.py ├── logger_helper.py ├── model_helper.py ├── parse_helper.py ├── prompt_helper.py └── vfc_helper.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/README.md -------------------------------------------------------------------------------- /code/llm/cfgs/sample_config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/cfgs/sample_config.yaml -------------------------------------------------------------------------------- /code/llm/cfgs/v1_mixtral_cot_generate_fp.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/cfgs/v1_mixtral_cot_generate_fp.yaml -------------------------------------------------------------------------------- /code/llm/cfgs/v1_mixtral_cot_generate_tp.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/cfgs/v1_mixtral_cot_generate_tp.yaml -------------------------------------------------------------------------------- /code/llm/cot-generate-fp-example.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/cot-generate-fp-example.py -------------------------------------------------------------------------------- /code/llm/cot-generate-tp-example.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/cot-generate-tp-example.py -------------------------------------------------------------------------------- /code/llm/llm_driver.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/llm_driver.py -------------------------------------------------------------------------------- /code/llm/templates/template_few_shot.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_few_shot.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_few_shot_deepseek_wizardcoder.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_few_shot_deepseek_wizardcoder.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_few_shot_llama.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_few_shot_llama.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_few_shot_mixtral.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_few_shot_mixtral.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_zero_shot_deepseek_wizardcoder.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_zero_shot_deepseek_wizardcoder.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_zero_shot_llama.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_zero_shot_llama.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_zero_shot_llama_v2.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_zero_shot_llama_v2.yaml -------------------------------------------------------------------------------- /code/llm/templates/template_zero_shot_mixtral.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/template_zero_shot_mixtral.yaml -------------------------------------------------------------------------------- /code/llm/templates/vulnerable_function_template.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/vulnerable_function_template.txt -------------------------------------------------------------------------------- /code/llm/templates/vulnerable_function_template_v2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/llm/templates/vulnerable_function_template_v2.txt -------------------------------------------------------------------------------- /code/prompts/few-shot/example-template/vuln-detailed-explain-example-v3.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/few-shot/example-template/vuln-detailed-explain-example-v3.yaml -------------------------------------------------------------------------------- /code/prompts/few-shot/system-prompt/vuln-detailed-explain-system-v3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/few-shot/system-prompt/vuln-detailed-explain-system-v3.txt -------------------------------------------------------------------------------- /code/prompts/user-template/generate-cot-examples-fp-user-v1.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/user-template/generate-cot-examples-fp-user-v1.yaml -------------------------------------------------------------------------------- /code/prompts/user-template/generate-cot-examples-tp-user-v1.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/user-template/generate-cot-examples-tp-user-v1.yaml -------------------------------------------------------------------------------- /code/prompts/user-template/vuln-detailed-explain-user-v3.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/user-template/vuln-detailed-explain-user-v3.yaml -------------------------------------------------------------------------------- /code/prompts/zero-shot/system-prompt/basic-system-v3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/zero-shot/system-prompt/basic-system-v3.txt -------------------------------------------------------------------------------- /code/prompts/zero-shot/system-prompt/generate-cot-examples-fp-system-v1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/zero-shot/system-prompt/generate-cot-examples-fp-system-v1.txt -------------------------------------------------------------------------------- /code/prompts/zero-shot/system-prompt/generate-cot-examples-tp-system-v1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/zero-shot/system-prompt/generate-cot-examples-tp-system-v1.txt -------------------------------------------------------------------------------- /code/prompts/zero-shot/system-prompt/vuln-detailed-explain-system-v3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/zero-shot/system-prompt/vuln-detailed-explain-system-v3.txt -------------------------------------------------------------------------------- /code/prompts/zero-shot/system-prompt/vuln-detailed-system-v3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/code/prompts/zero-shot/system-prompt/vuln-detailed-system-v3.txt -------------------------------------------------------------------------------- /data/advisory-data/govulndb-2023-10-26.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/advisory-data/govulndb-2023-10-26.csv -------------------------------------------------------------------------------- /data/advisory-data/govulndb-similar-descriptions-2023-10-31.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/advisory-data/govulndb-similar-descriptions-2023-10-31.csv -------------------------------------------------------------------------------- /data/patchparser-data.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/patchparser-data.tar.gz -------------------------------------------------------------------------------- /data/rag-db/advisory-faiss-index-2023-10-26.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/advisory-faiss-index-2023-10-26.bin -------------------------------------------------------------------------------- /data/rag-db/advisory-faiss-index-map-2023-10-26.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/advisory-faiss-index-map-2023-10-26.csv -------------------------------------------------------------------------------- /data/rag-db/complete-git-hunk-faiss-index-2023-10-26.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/complete-git-hunk-faiss-index-2023-10-26.bin -------------------------------------------------------------------------------- /data/rag-db/complete-git-hunk-faiss-index-map-2023-10-26.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/complete-git-hunk-faiss-index-map-2023-10-26.csv -------------------------------------------------------------------------------- /data/rag-db/fp-git-hunk-faiss-index-2023-10-26.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/fp-git-hunk-faiss-index-2023-10-26.bin -------------------------------------------------------------------------------- /data/rag-db/fp-git-hunk-faiss-index-map-2023-10-26.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/fp-git-hunk-faiss-index-map-2023-10-26.csv -------------------------------------------------------------------------------- /data/rag-db/tp-git-hunk-faiss-index-2023-10-26.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/tp-git-hunk-faiss-index-2023-10-26.bin -------------------------------------------------------------------------------- /data/rag-db/tp-git-hunk-faiss-index-map-2023-10-26.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/data/rag-db/tp-git-hunk-faiss-index-map-2023-10-26.csv -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/requirements.txt -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/__init__.py -------------------------------------------------------------------------------- /utils/embedding_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/embedding_helper.py -------------------------------------------------------------------------------- /utils/github_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/github_helper.py -------------------------------------------------------------------------------- /utils/logger_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/logger_helper.py -------------------------------------------------------------------------------- /utils/model_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/model_helper.py -------------------------------------------------------------------------------- /utils/parse_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/parse_helper.py -------------------------------------------------------------------------------- /utils/prompt_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/prompt_helper.py -------------------------------------------------------------------------------- /utils/vfc_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s3c2/llm-vulnerable-functions/HEAD/utils/vfc_helper.py --------------------------------------------------------------------------------