Closed Bug 173641 Opened 24 years ago Closed 24 years ago

flawfinder warnings in js module

Categories

(Core :: JavaScript Engine, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: morse, Assigned: morse)

References

Details

Heikki ran flawfinder (http://www.dwheeler.com/flawfinder) on Mozilla 1.0.1 branch. flawfinder found 72 warnings in js module code (1867-1938). Go through that list and for each warning: * If it is false positive, comment here why it is not an issue * If it is a real issue, make patch for it here and let's get them checked in In addition to checking the branch, also check the trunk. 1867) js/jsd/jsd_scpt.c:198 [4] (buffer) sprintf: does not check for buffer overflows. Use snprintf or vsnprintf. 1868) js/jsd/jsd_step.c:106 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1869) js/jsd/jsd_xpc.cpp:71 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1870) js/src/js.c:112 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1871) js/src/js.c:155 [4] (format) fprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1872) js/src/js.c:165 [4] (format) vsnprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1873) js/src/js.c:177 [4] (format) vsnprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1874) js/src/js.c:212 [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once.. Check environment variables carefully before using them. 1875) js/src/js.c:265 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1876) js/src/js.c:274 [4] (format) fprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1877) js/src/js.c:281 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1878) js/src/js.c:1883 [4] (tmpfile) execvp: this calls out to a new process and is difficult to use safely. try using a library call that implements the same functionality if available.. 1879) js/src/js.c:1938 [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once.. Check environment variables carefully before using them. 1880) js/src/js.c:1957 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 1881) js/src/js.c:2125 [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once.. Check environment variables carefully before using them. 1882) js/src/jsdhash.c:383 [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once.. Check environment variables carefully before using them. 1883) js/src/jsdhash.c:387 [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once.. Check environment variables carefully before using them. 1884) js/src/jsdtoa.c:1922 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1885) js/src/jsdtoa.c:2684 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1886) js/src/jsfile.c:66 [4] (tmpfile) popen: this calls out to a new process and is difficult to use safely. try using a library call that implements the same functionality if available.. 1887) js/src/jsfile.c:203 [2] (buffer) sprintf: does not check for buffer overflows. Use snprintf or vsnprintf. Risk is low because the source has a constant maximum length. 1888) js/src/jsfile.c:289 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1889) js/src/jsfile.c:299 [4] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. 1890) js/src/jsfile.c:483 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1891) js/src/jsfile.c:488 [4] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. 1892) js/src/jsfile.c:508 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1893) js/src/jsfile.c:515 [4] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. 1894) js/src/jsfile.c:586 [1] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. Risk is low because the source is a constant character. 1895) js/src/jsfile.c:1954 [4] (buffer) sprintf: does not check for buffer overflows. Use snprintf or vsnprintf. 1896) js/src/jsfile.c:2268 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1897) js/src/jsfile.c:2269 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1898) js/src/jsfile.c:2273 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1899) js/src/jsfile.c:2274 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1900) js/src/jsfile.c:2278 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1901) js/src/jsfile.c:2279 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1902) js/src/jsfile.c:2283 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1903) js/src/jsfile.c:2284 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1904) js/src/jsfile.c:2288 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1905) js/src/jsfile.c:2289 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1906) js/src/jsfile.c:2293 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1907) js/src/jsfile.c:2294 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1908) js/src/jsfile.c:2298 [1] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant character. 1909) js/src/jsfile.c:2299 [2] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. Risk is low because the source is a constant string. 1910) js/src/jsgc.c:866 [2] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. Risk is low because the source is a constant string. 1911) js/src/jsgc.c:869 [2] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. Risk is low because the source is a constant string. 1912) js/src/jsgc.c:872 [2] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. Risk is low because the source is a constant string. 1913) js/src/jsgc.c:891 [2] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. Risk is low because the source is a constant string. 1914) js/src/jsgc.c:897 [2] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. Risk is low because the source is a constant string. 1915) js/src/jsprf.c:358 [4] (format) sprintf: Potential format string problem. Make format string constant. 1916) js/src/jsprf.c:417 [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once.. Check environment variables carefully before using them. 1917) js/src/liveconnect/jsj_JavaArray.c:185 [2] (buffer) sprintf: does not check for buffer overflows. Use snprintf or vsnprintf. Risk is low because the source has a constant maximum length. 1918) js/src/liveconnect/jsj_JavaPackage.c:71 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 1919) js/src/liveconnect/jsj_JavaPackage.c:76 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 1920) js/src/liveconnect/jsj_JavaPackage.c:489 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 1921) js/src/liveconnect/jsj_private.h:656 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1922) js/src/liveconnect/jsjava.h:185 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 1923) js/src/xpconnect/shell/xpcshell.cpp:416 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1924) js/src/xpconnect/shell/xpcshell.cpp:425 [4] (format) fprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1925) js/src/xpconnect/shell/xpcshell.cpp:428 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 1926) js/src/xpconnect/src/xpcdebug.cpp:290 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1927) js/src/xpconnect/src/xpcdebug.cpp:362 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1928) js/src/xpconnect/src/xpcdebug.cpp:365 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1929) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1265 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1930) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1266 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1931) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1270 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1932) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1275 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1933) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1276 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1934) js/src/xpconnect/tests/TestXPC.cpp:125 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1935) js/src/xpconnect/tests/TestXPC.cpp:607 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1936) js/src/xpconnect/tests/TestXPC.cpp:626 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1937) js/src/xpconnect/tests/TestXPC.cpp:693 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 1938) js/src/xpconnect/tests/components/xpctest_echo.cpp:482 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification.
Blocks: 148251
cc'ing Brendan, Mike, Steve -
Assignee: rogerl → khanson
The tool should have the sense not to complain about s = malloc(strlen(t)+1); if (s) strcpy(s, t), or equivalent. I'm not going to bother explaining why all such cases listed here are safe. Get a better flawfinder and we'll talk. /be
The code you showed is safe only if |t| is null terminated. (Some impls. of strlen() might also assert if |t==0|.) Provided that is the case, it is trivial for us to agree that it is safe. But flawfinder, and I suspect all the other free tools as well, seem to be based on pattern matching (like grep). They won't be able to catch those things. We know the tools spill out mostly false positives, but we have also fixed some real issues. Because of the huge number of warnings we are dividing the effort. It usually does not require a genius to check out the code, but *someone* needs to do it. There apparently are better products as well. One vendor claims their tool finds even more errors, and manages to cut the false positives by as much as 90%. Even then it would spew out several hundred warnings for the Mozilla code. But it also comes with a price tag of $100k or something. So until we have access to such tools this is the best we can do: tools find all the cases, hopefully (and we are using several different tools), humans check all those cases.
Even if what you say is true, why are the TestXPC entries listed anywhere, and why aren't the XPConnect files listed in some other bug? ($100K is about half a person-year; how much time do you expect to spend running the tools, chasing people to look at lists bloated with false positives from these naive grep-like tools, arguing about the semantics of |strlen(NULL)| and then realizing that the calls to PL_strcpy and nsCRT::whatever mask "unsafe" practices as well? I smell a false economy.)
And a free lunch. It seems to me that the person running such a naive tool should expend more energy weeding out false positives, filing bugs by module, etc. before dumping a bunch of bugs on random and heretofore unconsulted owners. This is not "module-neighborly" behavior. /be
We have modified some of the tools to find the Mozilla-specific functions. When I filed the first bunch of flawfinder bugs, I did not mention any files that had names like *test*.[c|h|cpp]. But they are easy enough to skip even if they are filed as bugs. Some maintainers of those test applications might even care. We are filing bugs per module. Nobody knows all the code well enough to file all the bugs under the correct components and owners. People file bugs under wrong components/assign to wrong people all the time. It is better to have the bug reported than miss it because the reporter was not sure who should own it. If you clearly see some/all of the warnings should be under some other component or with a different owner, just open new bugs or reassign. This happens all the time. I don't understand the hostility now. Sure, in theory we could hire a bunch of people to do nothing but run these tools, analyze the output and fix the bugs and you would never need to hear from us. Obviously that is not going be possible in practise. Besides, security is everyone's responsibility. I could argue that we are doing you a service by giving you a list of warnings; you don't need to find, build and install these tools and learn how to run them, and modify them to recognize mozilla stuff and then spend the time running them. Also by getting the module owners etc. involved we at least let them know of these issues; not everyone is aware, or has paid attention to these issues. By dividing the effort we can finish the task much faster than by having a small team do it, and look at unfamiliar code. There are thousands of warnings to look at. Just filing the bugs based on modules (or what we think are modules) is taking days, if not weeks. You asking us to evaluate every warning ourselves, only filing bugs for warnings we can't figure out and making sure we never make mistakes in filing these bugs would make sure we will never finish this task. On the other hand, it would only take you a few minutes, or hours at most, to check the warnings in your module. [Say it takes 2 minutes to check a warning, on average. There are 72 warnings under js -> about 2.5 hours of the module owners time, which could be less by dividing the effort further or skipping test files etc. On the other hand, say I was to look at all 8000 warnings the unedited flawfinder produced from the Mozilla source, and say I could spent 2 work days a week (optimistic) doing just that: if I started now I would finish in January or Ferbruary next year.] We don't want to end up doing this full scale effort over and over again. We want to do this exactly once, educate people in the process and try to work up a solution that would do the scanning for every checkin and show the results on Tinderbox or something. But if we do end up running full scans, we can easily do diffs between the results and only look at changed warnings (we are actually doing diffs between the logs the different tools produce). We have a long way to get there, though. I was under the impression that people cared about security. Tell me if I was wrong and we can stop wasting our time. I am sure the hackers out there are more than happy to run flawfinder etc. on their copy of the source and find the crown jewels. I will stop venting now. If you have questions or reasonable suggestions I can answer.
"No one knows all the modules" -- true, but we have http://www.mozilla.org/owners.html with a form field into which you can type a filename. We have #mozilla on irc.mozilla.org. We have email, where a heads-up and some discussion should precede this kind of bug-filing, I think. "Security is everyone's responsibility" -- vacuous, useless if you leave it to "everyone" and no one is accountable. Filing all these bugs distributes responsibility in ways that we've seen fail before (unchecked malloc/new bugs were filed similarly, but not many were fixed). It's better to have one person be individually responsible for good results. Finally, and I'm done talking in this bug about it: shaver has a valid point that you do not address. If you spend 100 people for 1 day each on something that could be done with better tools by one person in 10 days, you've wasted a lot of money/time/patience. There are worse inefficiencies (see above about collective unaccountability). Just because it's easy to file bugs doesn't mean you make the world a better place by "getting something on file". /be
This bug is almost completely invalid. The one issue raised indirectly is some extremely minor bloat inherited by js/src from NSPR back when fur@netscape.com cloned prprf.c into jsprf.c (the l10n_debug printfs should be #ifdef DEBUG). I filed bug 173827 on that issue. I'm not going to say much more here than that flawfinder is fatally flawed. It doesn't even check for a left parenthesis after a naughty name (see the notes about jsj_JavaPackage.c/jsjava.h below) that it takes to be a function being (or about to be) invoked. jsj_JavaPackage.c and jsjava.h hits are based on a formal parameter and struct member named access, which flawfinder lamely takes to indicate an access(2) Unix system call that races with a later system call based on the existence or non-existence of the file as reported by access(). jsj_private.h is completely off base, and it's wasted enough of my time that I'm going to say no more. Read the implicated line yourself and laugh. All the other hits are either #ifdef DEBUG, #if 0, in code not compiled into Mozilla (whether test code or orphaned optional source such as jsfile.c). This was almost a complete waste of too much of my time, and it was entirely avoidable, had there been the usual heads-up and a little discussion before any contemplated pan-tree source inspection and potential change turns into a swarm of bugs. Being on a Mission from God (I'm not totally sarcastic, I value the security efforts of many Mozilla community members highly) is no excuse. /be
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
All of the xpconnect parts of the bug INVALID. All reported issues all either in test programs/components or inside #ifdef DEBUG
Marking Verified -
Status: RESOLVED → VERIFIED
First off, thanks you for your time in going over the issues. Below I will try to answer to the final points. Clearly we will have to disagree on some issues. Individuals will not get that many flawfinder bugs because nobody owns that many modules, so I don't think bugmail spam is relevant in this case. The owners list isn't totally accurate, although it has gotten better. Would have caught XPConnect, though. Email etc. again make this task take that much longer. I don't believe misfiling is such a big problem, and the person that receives the bug can easily do the things I explained above. I did not know we need permission to file bugs. Are there guidelines somewhere about this, like what sort of bugs or how many of a class of bugs need approval, and where to ask for approval? I think this would be silly, but if it is official Mozilla policy I will follow it. We have discussed this stuff at Netscape for months, so a lot of module owners should have been aware that there was a bunch of people running these tools and bugs would be filed eventually. Not everyone works at Netscape obviously. We started filing bugs as security sensitive originally, based on the most "promising" components and errors. Some owners responded quickly, some did not respond at all. In some cases the Netscape security people checked out the modules that did not seem to get fast enough attention. We have heard the argument that if bugs are security sensitive they do not get resolved as fast as open bugs. Dunno if Steve did it on purpose or not, but he's been filing these bugs as open. We'll see if we'll get any better results this way. Maybe we'll get most resolved in a couple of weeks, after which we could go through with the rest with a smaller group. Maybe we will see a high profile news article and we all jump into this and solve them by the end of the week. We didn't just start filing these bugs with the intention of forgetting about them. We are monitoring the progress, and will respond if needed. I argue that there are too many warnings for a small group to solve effectively (but I also pointed out other reasons why I think it is a bad idea). Many other sweeping tree changes, large as they were, were still more suitable for a small group to tackle. If I had access to a better tool I would use it. But I don't. And the free tools we have access to at the moment aren't very good, so we run all of them because they find different things.
Where did I say you need permission to file a bug? Obviously, there is no prior restraint; we get too many UNCONFIRMED duplicates from anyone willing to give a valid email address to get a bugzilla login. To repeat: it's a very good idea to talk to the affected owners, if not to the whole Mozilla community (and not just select parts of Netscape), using the usual lists/newsgroups/channels, before going off on a pan-tree crusade (ask timeless; 'nuff said). I still obviously disagree with the apparent "any tool is better than no tool" engineering principle at work here. Let's use a better tool before injecting a ton of noise and work into the bug system. Asking knowledgable Mozilla community members may lead to an existing better tool: roc+moz@cs.cmu.edu and tor@cs.brown.edu mentioned Dawson Engler's work at Stanford on the Stanford Checker. So, google away, and let's take this exchange to the mozilla.security newsgroup, if not to the security-group@mozilla.org (which is too narrow a group for such a thread to bear maximum fruit). /be
cross posting here. Brendan, I have spent quite a time analyzing logs of czech (a tool quite similar to flawfinder). From personal experience I can say that the "statical quality" of the JavaScript engine is very good so your bashing of the false positives is understandable, but totally bashing the use of such tools for other modules is wrong IMHO. The fact is with the help of source analysis I have found an expploitable bug in Mailnews and another exploitable one which was hopefully #ifdef'ed. In some cases with sprintf (and such) and pointer arithmetic I was unable to tell whether the warning is exploitable or a false positive - a person who is familiar with the source can tell and better yet use the safe function having in mind lengths. As someone already pointed these warning though false positive, may have some educational effect on some developers - I suggest always use strncpy instead of strcpy - the overhead is minimal. Also the following does not work - some one checks the source and in the same time some people continue to write insecure code. I may be wrong, but practice shows that the more warnings tools give about a product, the more security bugs are discovered - good examples about this are qmail and apache. I also disagree that buying an expensive auditing tool is a good solution. Such an expensive tool may somewhat decrease the number of false positives, but it can't brove bugness of bugfreeness - this is a human decision still - there was a quote from Dejkstra IIRC: "The testing for bugs can prove their presence, but not their absence" or something like this. georgi
Fatally flawed Flawfinder reported 44 more warnings in the js module (4513-4556) Reopening. 4513) js/jsd/jsd_scpt.c:198 [4] (buffer) sprintf: does not check for buffer overflows. Use snprintf or vsnprintf. 4514) js/jsd/jsd_step.c:106 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4515) js/jsd/jsd_xpc.cpp:71 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4516) js/src/js.c:112 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4517) js/src/js.c:155 [4] (format) fprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4518) js/src/js.c:165 [4] (format) vsnprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4519) js/src/js.c:177 [4] (format) vsnprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4520) js/src/js.c:265 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4521) js/src/js.c:274 [4] (format) fprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4522) js/src/js.c:281 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4523) js/src/js.c:1883 [4] (tmpfile) execvp: this calls out to a new process and is difficult to use safely. try using a library call that implements the same functionality if available.. 4524) js/src/js.c:1957 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 4525) js/src/jsdtoa.c:1922 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4526) js/src/jsdtoa.c:2684 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4527) js/src/jsfile.c:66 [4] (tmpfile) popen: this calls out to a new process and is difficult to use safely. try using a library call that implements the same functionality if available.. 4528) js/src/jsfile.c:289 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4529) js/src/jsfile.c:299 [4] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. 4530) js/src/jsfile.c:483 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4531) js/src/jsfile.c:488 [4] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. 4532) js/src/jsfile.c:508 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4533) js/src/jsfile.c:515 [4] (buffer) strcat: does not check for buffer overflows. Consider using strncat or strlcat. 4534) js/src/jsfile.c:1954 [4] (buffer) sprintf: does not check for buffer overflows. Use snprintf or vsnprintf. 4535) js/src/jsprf.c:358 [4] (format) sprintf: Potential format string problem. Make format string constant. 4536) js/src/liveconnect/jsj_JavaPackage.c:71 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 4537) js/src/liveconnect/jsj_JavaPackage.c:76 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 4538) js/src/liveconnect/jsj_JavaPackage.c:489 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 4539) js/src/liveconnect/jsj_private.h:656 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4540) js/src/liveconnect/jsjava.h:185 [4] (race) access: this usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition. Set up the correct permissions (e.g., using setuid()) and try to open the file directly. 4541) js/src/xpconnect/shell/xpcshell.cpp:416 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4542) js/src/xpconnect/shell/xpcshell.cpp:425 [4] (format) fprintf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4543) js/src/xpconnect/shell/xpcshell.cpp:428 [4] (buffer) strcpy: does not check for buffer overflows. Consider using strncpy or strlcpy. 4544) js/src/xpconnect/src/xpcdebug.cpp:290 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4545) js/src/xpconnect/src/xpcdebug.cpp:362 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4546) js/src/xpconnect/src/xpcdebug.cpp:365 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4547) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1265 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4548) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1266 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4549) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1270 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4550) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1275 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4551) js/src/xpconnect/src/xpcwrappedjsclass.cpp:1276 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4552) js/src/xpconnect/tests/TestXPC.cpp:125 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4553) js/src/xpconnect/tests/TestXPC.cpp:607 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4554) js/src/xpconnect/tests/TestXPC.cpp:626 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4555) js/src/xpconnect/tests/TestXPC.cpp:693 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification. 4556) js/src/xpconnect/tests/components/xpctest_echo.cpp:482 [4] (format) printf: if format strings can be influenced by an attacker, they can be exploited. Use a constant for the format specification.
Status: VERIFIED → REOPENED
Resolution: INVALID → ---
Don't play games or abuse bugzilla privileges. If you think you've found a bug, demonstrate it with reproduce-by instructions. /be
Assignee: khanson → morse
Status: REOPENED → NEW
In this case Flawfinder was clearly at fault. It reported the same errors twice (I checked the ones here). Closing this bug again as invalid. In some cases Flawfinder seems to report the same errors more than once. Any non-consecutive warnings Flawfinder reports for the same module are almost certainly duplicates, but I have also seen non-duplicates.
Status: NEW → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → INVALID
This was also verified by Phil earlier.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.