a static analysis tool for finding vulnerabilities in C/C++ source code
Go to file
Julien Hachenberger 025cee45db
Move all test related files into a subdirectory
In order to keep all test-related files within one folder,
this commit creates a new folder 'test/', moves the
test-related files into it and intrdocues a second makefile
within this folder dedicated to run the tests.
The original makefile still contains a 'test' target, but simply
delegates this task to the second makefile.

(fixes david-a-wheeler/flawfinder#11)

Signed-off-by: Julien Hachenberger <julien.hachenberger@sit.fraunhofer.de>
2019-09-23 11:37:14 +02:00
test Move all test related files into a subdirectory 2019-09-23 11:37:14 +02:00
.gitignore Broaden an ignore rule 2018-03-15 22:49:45 -06:00
CONTRIBUTING.md Update documentation 2019-01-21 17:30:28 -05:00
COPYING Initial import 2007-01-16 02:44:45 +00:00
ChangeLog Update ChangeLog 2019-06-22 14:54:00 -04:00
INSTALL.md Update documentation 2019-01-21 17:30:28 -05:00
MANIFEST.in Fix SourceForge #18 Renamed file still referenced by other files 2018-10-06 18:46:09 -04:00
README.md Update documentation 2019-01-21 17:30:28 -05:00
announcement Initial import 2007-01-16 02:44:45 +00:00
cwe.l Add ability to list CWEs in source code 2014-07-13 09:44:34 -04:00
flawfinder Add better error message on encoding problems 2019-09-22 15:22:17 -04:00
flawfinder.1 Improve docs on character encoding 2019-09-22 15:21:11 -04:00
flawfinder.spec Update version number to upcoming 2.0.11 2019-06-23 19:43:09 -04:00
makefile Move all test related files into a subdirectory 2019-09-23 11:37:14 +02:00
pylintrc Mass reformat of flawfinder source code to better comply with PEP 8 2017-07-30 20:06:39 -04:00
release_process.md Set version number for next release (2.0.9) 2019-01-21 18:54:01 -05:00
setup.cfg Fix SourceForge #18 Renamed file still referenced by other files 2018-10-06 18:46:09 -04:00
setup.py Update version number to upcoming 2.0.11 2019-06-23 19:43:09 -04:00

README.md

About

This is "flawfinder" by David A. Wheeler.

Flawfinder is a simple program that scans C/C++ source code and reports potential security flaws. It can be a useful tool for examining software for vulnerabilities, and it can also serve as a simple introduction to static source code analysis tools more generally. It is designed to be easy to install and use. Flawfinder supports the Common Weakness Enumeration (CWE) and is officially CWE-Compatible.

For more information, see the project website

Platforms

Flawfinder is designed for use on Unix/Linux/POSIX systems (including Cygwin, Linux-based systems, MacOS, and various BSDs) as a command line tool. It requires either Python 2.7 or Python 3.

Installation

If you just want to use it, you can install flawfinder with Python's "pip" or with your system's package manager (flawfinder has packages for many systems). It also supports easy installation following usual make install source installation conventions. The file INSTALL.md has more detailed installation instructions. You don't HAVE to install it to run it, but it's easiest that way.

Usage

To run flawfinder, just give it a list of source files or directories to example. For example, to examine all files in "src/" and down recursively:

flawfinder src/

To examine all files in the current directory and down recursively:

flawfinder ./

Hits (findings) are given a risk level from 0 (very low risk) to 5 (high risk), By default, findings of risk level 1 or higher are shown. You can show only the hits of risk level 4 or higher in the current directory and down this way:

flawfinder --minlevel 4 ./

The manual page (flawfinder.1 or flawfinder.pdf) describes how to use flawfinder (including its various options) and related information (such as how it supports CWE). For example, the --html option generates output in HTML format. The --help option gives a brief list of options.

Under the hood

More technically, flawfinder uses lexical scanning to find tokens (such as function names) that suggest likely vulnerabilities, estimates their level of risk (e.g., by the text of function calls), and reports the results. Flawfinder does not use or have access to information about control flow, data flow, or data types. Thus, flawfinder will necessarily produce many false positives for vulnerabilities and fail to report many vulnerabilities. On the other hand, flawfinder can find vulnerabilities in programs that cannot be built or cannot be linked. Flawfinder also doesn't get as confused by macro definitions and other oddities that more sophisticated tools have trouble with.

Contributions

We love contributions! For more information on contributing, see the file CONTRIBUTING.md.

License

Flawfinder is released under the GNU GPL license version 2 or later (GPL-2.0+). See the COPYING file for license information.