Issues found by flawfinder

Bug #1278174 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Low
Unassigned

Bug Description

I recently discovered flawfinder (http://www.dwheeler.com/flawfinder/), which is a static code analysis tool focusing on security issues. I can't really review the issues found, but it seemed to be few with high severety though. Also, it runs really fast, using only 1-2 seconds to generate a report for the entire code base.

I created the attached report with the following command:
$ flawfinder --context --falsepositive src/ > flawfinder-report.txt

Some explanation to the options; "--context" prints the line in question to easier see what the issue is about and "--falsepostive" silence some (~200) issues which are likely false positives. (Note that other issues reported might still be false positives.) In the report, after the list of files scanned it will list the issues in decending order of importance. See the number in brackets after the file name for importance, where [5] is the most severe.

Since I only recently discovered it, any issues will be too late to make it into build18 (unless something is really critical I guess). Though, I think someone should take a look at the report to see if any of them should be fixed.

PS. I initially filed this as a private security issue, since that's the kind of issues this tool finds. I don't know if that is really necessary, though since the report contains potential security issues I figured we might review and/or patch them before making this visible to the general public.

PS. For other warning reports, see bug 1258667 (Clang), bug 986611 (cppcheck) and bug 1202101 (Visual Studio).

Tags: cleanups
Revision history for this message
Hans Joachim Desserud (hjd) wrote :
Revision history for this message
SirVer (sirver) wrote :

I looked over the list of errors and believe most of them are accurate detection, i.e. there is something flawed in the source code. However I did not see a critical problem in any of them where a remote attacker could gain access to a system through Widelands. Most of them are local exploits, but since Widelands never changes its uid an attacker can not gain any privileges through this (as far as I can tell).

However, it would be nice to get the all fixed of course, most changes should be fairly mechanical.

information type: Private Security → Public
Changed in widelands:
status: New → Confirmed
importance: Undecided → Low
description: updated
Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Changed in widelands:
status: Confirmed → Incomplete
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Attached an up-to-date flawfinder report of r7175. (Seems like the original reporter failed to include a revision number, ahem)

Since the initial report we have reduced the overall number of issues, though mostly the low severity ones. The other categories have each gone slightly up. However, since I don't think anyone has worked actively on this, I think that's a fair result after ~six months.

Changed in widelands:
status: Incomplete → Confirmed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Looks like most of the warnings are string-function related. Since we switched string formatting over to boost::format, most of these should be resolved now. So, it would be worth running this again.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

> So, it would be worth running this again.

You rang? :)

Attached is a new report based on current trunk.

GunChleoc (gunchleoc)
tags: added: cleanups
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.