{"id":15115134,"url":"https://github.com/vanhauser-thc/vulntest","last_synced_at":"2025-10-14T05:10:08.739Z","repository":{"id":80304459,"uuid":"246289162","full_name":"vanhauser-thc/vulntest","owner":"vanhauser-thc","description":"Static code analysis test source code","archived":false,"fork":false,"pushed_at":"2023-08-30T12:41:06.000Z","size":29,"stargazers_count":32,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T08:11:20.349Z","etag":null,"topics":["sca","static-code-analysis"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanhauser-thc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-10T12:00:21.000Z","updated_at":"2025-01-22T15:21:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b5a6f8f-79a2-4a07-963b-a435e65d7723","html_url":"https://github.com/vanhauser-thc/vulntest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanhauser-thc%2Fvulntest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanhauser-thc%2Fvulntest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanhauser-thc%2Fvulntest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanhauser-thc%2Fvulntest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanhauser-thc","download_url":"https://codeload.github.com/vanhauser-thc/vulntest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907420,"owners_count":20529850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sca","static-code-analysis"],"created_at":"2024-09-26T01:43:41.204Z","updated_at":"2025-10-14T05:10:08.671Z","avatar_url":"https://github.com/vanhauser-thc.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Little test programs to test static code analysis software\n\n## Introduction\n\nThese small code pieces were used by me to analyse the detective abilities\nof a few SCA solutions to identify security vulnerabilities in source code.\nThis was not a comprehensive test, but rather a quick analysis.\n\nInitially I wanted to create sophisticated bugs and check if they can find\nthem but found out that even easy test cases can be too hard ;-)\n\nThe result of my testing can be read in the german article here:\n[https://www.heise.de/hintergrund/Pruefstand-fuer-Testwerkzeuge-Codeanalyse-im-Praxiseinsatz-4679430.html?seite=all](https://www.heise.de/hintergrund/Pruefstand-fuer-Testwerkzeuge-Codeanalyse-im-Praxiseinsatz-4679430.html?seite=all)\n\n## The test source code\n\nAlphabetically:\n\n - andreas.cpp - hard coded credentials\n - bof.c - buffer overflow based on untrusted length information\n - confuse.cpp - type confusion vulnerability\n - double_free.cpp - copy of a CWE415 NIST test source code\n - encrypt.c - weak encryption mode\n - fdleak.c - leaking a file descriptor to a child process\n - hardcoded_password.c - hard coded credentials\n - ok.c - nothing wrong here, for testing false positives and standard \"warnings\"\n - ok2.c - nothing wrong here, for testing false positives and standard \"warnings\"\n - strcpy.c - standard strcpy buffer overflow (and format string vulnerability which was not the test target)\n - strcpy2.c - standard string copy via while-loop (and format string vulnerability which was not the test target)\n - tricky.c - buffer overflow based on untrusted length information\n - use_after_free.c - use after free vulnerability\n\n## Results\n\nAll vendors reviewed the setup and verified that the results were real and not\nbased on a misconfiguration.\nAnd yes, most of them were not happy with the results.\n\n|   CODE/SOFTWARE    |Perforce Klocwork 19.01|Parasoft C/C++test 10.4.2|Mathworks Bugfinder R2019a (2)|Viva 64 PVS Studio|CodeQL Oct 2022|joern Oct 2022|semgrep Oct 2022|cppcheck 2.9|llvm 14 clang-analyzer|ChatGPT 4.0|\n|:------------------:|:------:|:-------:|:--------|:-------------:|:------:|:------:|:------:|:------------:|:------------:|:-----:|\n| andreas            | yes    | no      | no      | no            | no     | no     | no     | no           | no           | yes   |\n| bof                | yes    | no      | yes     | no            | yes    | no     | no     | no           | yes(3)       | yes   |\n| confuse            | no     | no      | no      | no            | no     | no     | no     | no           | no           | yes   |\n| double_free        | yes    | no      | no      | yes           | no     | no     | no     | no           | yes          | yes   |\n| encrypt            | yes    | no      | yes     | no            | yes(1) | no     | no     | no           | no           | yes   |\n| fdleak             | no     | no      | no      | no            | no     | no     | no     | no           | no           | partial |\n| hardcoded_password | yes    | no      | no      | no            | no     | no     | no     | no           | no           | yes   |\n| strcpy             | no     | yes     | no      | no            | yes(1) | no     | no     | no           | no           | yes   |\n| strcpy2            | no     | no      | no      | no            | no     | no     | no     | no           | no           | yes   |\n| tricky             |partial | no      | no      | yes           | no     | no     | no     | no           | no           | yes   |\n| use_after_free     | yes    | yes     | yes     | yes           | no     | no     | yes    | yes          | yes          | yes   |\n\n(1) Not in cpp-lgtm.qls but from cpp/ql/src/Security\n\n(2) For Mathworks Bugfinder, there is also the Code Prover product which checks\n    for robustness which includes buffer overruns. This might detect the buffer\n    overflow bugs but is a seperate product that is not a SCA comparable to the\n    others.\n\n(3) with alpha.security checkers enabled\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanhauser-thc%2Fvulntest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanhauser-thc%2Fvulntest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanhauser-thc%2Fvulntest/lists"}