| Nome: | Descrição: | Tamanho: | Formato: | |
|---|---|---|---|---|
| 1.42 MB | Adobe PDF |
Autores
Orientador(es)
Resumo(s)
O crescimento exponencial da complexidade e dimensão do software tem levado a um aumento
alarmante no número de vulnerabilidades reportadas. A sua correção de forma manual torna-se
impraticável face a esta escala, e as ferramentas de análise estática, embora úteis na deteção,
apresentam limitações na correção e frequentemente geram falsos positivos.
Esta dissertação propõe uma ferramenta inovadora, denominada VulnFix, para automatizar a
deteção e correção de vulnerabilidades em código Python. A ferramenta VulnFix combina a capacidade de deteção de três ferramentas de análise estática (Bandit, Semgrep e Snyk) com o poder
de correção dos Grandes Modelos de Linguagem (Large Language Model - LLM) Gemini 1.5 Pro
e GPT-4o. Aproveitando os avanços da aprendizagem profunda em processamento de linguagem
natural, a ferramenta processa código Python, deteta e identifica vulnerabilidades através das ferramentas de análise estática e, em seguida, utiliza os LLM para gerar patchs, através de prompts
adaptados. A arquitetura modular da ferramenta VulnFix permite a sua adaptação a diferentes
projetos e a inclusão de outros métodos de deteção e modelos.
A avaliação da ferramenta VulnFix, realizada com um conjunto de dados de vulnerabilidades
reais em Python associadas a Common Weakness Enumeration (CWE) específicos, obteve uma
accuracy de 53,9% na deteção e uma taxa de sucesso de 33,3% na correção das vulnerabilidades
identificadas, com 97.2% dos patchs v álidos. A ferramenta também demonstrou capacidade para
identificar 15,4% dos falsos positivos.
Apesar das limitações, nomeadamente a inexistência de uma baseline para comparação e a
dependência da qualidade das ferramentas de análise estática, a VulnFix representa um passo
importante na automatização da correção de vulnerabilidades, oferecendo um ponto de partida
valioso para futuras investigações nesta área crucial da segurança de software
The exponential growth in software complexity and size has led to an alarming increase in the number of reported vulnerabilities. Manual patching has become impractical at this scale, and static analysis tools, while useful for detection, have limitations in remediation and often produce false positives. This dissertation proposes an innovative tool, named VulnFix, to automate the detection and remediation of vulnerabilities in Python code. VulnFix combines the detection capabilities of three static analysis tools (Bandit, Semgrep, and Snyk) with the remediation power of Large Language Model (LLM) Gemini 1.5 Pro and GPT-4. Leveraging advancements in deep learning for natural language processing, the tool processes Python code, detects and identifies vulnerabilities using the static analysis tools, and then utilizes the LLMs to generate patches, guided by tailored prompts. The modular architecture of VulnFix allows for its adaptation to different projects and the incorporation of new tools and models. The evaluation of VulnFix, conducted with a dataset of real-world Python vulnerabilities associated with specific Common Weakness Enumeration (CWE), achieved a 53.9% accuracy in detection and a 33.3% success rate in remediating identified vulnerabilities, with 97.2% of the generated patches being valid. The tool also demonstrated the ability to identify 15.4% of false positives. Despite limitations, including the lack of a direct baseline for comparison and the reliance on the quality of static analysis tools, VulnFix represents a significant step towards automating vulnerability remediation, offering a valuable starting point for future research in this crucial area of software security.
The exponential growth in software complexity and size has led to an alarming increase in the number of reported vulnerabilities. Manual patching has become impractical at this scale, and static analysis tools, while useful for detection, have limitations in remediation and often produce false positives. This dissertation proposes an innovative tool, named VulnFix, to automate the detection and remediation of vulnerabilities in Python code. VulnFix combines the detection capabilities of three static analysis tools (Bandit, Semgrep, and Snyk) with the remediation power of Large Language Model (LLM) Gemini 1.5 Pro and GPT-4. Leveraging advancements in deep learning for natural language processing, the tool processes Python code, detects and identifies vulnerabilities using the static analysis tools, and then utilizes the LLMs to generate patches, guided by tailored prompts. The modular architecture of VulnFix allows for its adaptation to different projects and the incorporation of new tools and models. The evaluation of VulnFix, conducted with a dataset of real-world Python vulnerabilities associated with specific Common Weakness Enumeration (CWE), achieved a 53.9% accuracy in detection and a 33.3% success rate in remediating identified vulnerabilities, with 97.2% of the generated patches being valid. The tool also demonstrated the ability to identify 15.4% of false positives. Despite limitations, including the lack of a direct baseline for comparison and the reliance on the quality of static analysis tools, VulnFix represents a significant step towards automating vulnerability remediation, offering a valuable starting point for future research in this crucial area of software security.
Descrição
Tese de mestrado, Segurança Informática , 2025, Universidade de Lisboa, Faculdade de Ciências
Palavras-chave
Grandes Modelos de Linguagem Prompt Análise estática Deteção de vulnerabilidades Correção de vulnerabilidades Teses de mestrado - 2025
