Java Coders Are Getting Bad Security Advice From Stack Overflow (helpnetsecurity.com)
Slashdot reader Orome1 quotes Help Net Security:
A group of Virginia Tech researchers has analyzed hundreds of posts on Stack Overflow, a popular developer forum/Q&A site, and found that many of the developers who offer answers do not appear to understand the security implications of coding options, showing a lack of cybersecurity training. Another thing they discovered is that, sometimes, the most upvoted posts/answers contain insecure suggestions that introduce security vulnerabilities in software, while correct fixes are less popular and visible simply because they have been offered by users with a lower reputation score...
The researchers concentrated on posts relevant to Java security, from both software engineering and security perspectives, and on posts addressing questions tied to Spring Security, a third-party Java framework that provides authentication, authorization and other security features for enterprise applications... Developers are frustrated when they have to spend too much time figuring out the correct usage of APIs, and often end up choosing completely insecure-but-easy fixes such as using obsolete cryptographic hash functions, disabling cross-site request forgery protection, trusting all certificates in HTTPS verification, or using obsolete communication protocols. "These poor coding practices, if used in production code, will seriously compromise the security of software products," the researchers pointed out.
The researchers blame "the rapidly increasing need for enterprise security applications, the lack of security training in the software development workforce, and poorly designed security libraries." Among their suggested solutions: new developer tools which can recognize security errors and suggest patches.
The researchers concentrated on posts relevant to Java security, from both software engineering and security perspectives, and on posts addressing questions tied to Spring Security, a third-party Java framework that provides authentication, authorization and other security features for enterprise applications... Developers are frustrated when they have to spend too much time figuring out the correct usage of APIs, and often end up choosing completely insecure-but-easy fixes such as using obsolete cryptographic hash functions, disabling cross-site request forgery protection, trusting all certificates in HTTPS verification, or using obsolete communication protocols. "These poor coding practices, if used in production code, will seriously compromise the security of software products," the researchers pointed out.
The researchers blame "the rapidly increasing need for enterprise security applications, the lack of security training in the software development workforce, and poorly designed security libraries." Among their suggested solutions: new developer tools which can recognize security errors and suggest patches.
for bringing us the late-breaking news
Pick a language that isn't as much fucking swiss cheese and you'd see instant improvement.
Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
You mean advice from people who spend more time hanging out on Stack Exchange and less time actually writing production code is turning out to be less correct than advice from people who talk less and do more? Color me surprised. (Not.)
How is the Riemann zeta function like Trump rallies? Both have an endless number of trivial zeros.
Stackoverflow suffers like any other forum : reputation.
Keeping user accounts but making submissions invisible to general users would solve so much on that site.
Just the submissions. Ratings and everything else account-based is only seen by said user, mods and admins.
Won't solve every issue since there are idiots out there blinding trusting other idiots who also learned from other idiots that read the language spec off a blog by another idiot that put together said blog horribly when drunk at 4 in the morning.
If people simply hired web developers, most web hacking shit would be gone over fucking night.
It's ridiculous how much crap is on production servers that can be hacked trivially.
APPS especially. You can hack so many apps by entering emojis! It's so dumb.
People trying to DIY it never learn. But hey, that's not limited to software development.
They keep us actual developers in work by fucking things up so hard. Thanks for my higher rate, friends.
News flash, heavily simplified programming snippets for the purposes of example and education are probably not suitable for a production environment.
Give an option to filter out any "answers" from Indian contributors. They almost never contribute any worthwhile advice, and what do you expect from a nation of street shitters?
I thought I would try and help people out on Stackoverflow.
I posted some code, but AFAICT I could not just post it in , I had to indent every line by 4 spaces. PITA.
I clarified why a user was getting an error message, and my answer was marked down because some anal type thought it was a comment not an answer, and new users cannot comment, only answer. PITA
A questioner added a comment to ask for an extra feature in my answer, and I could not reply to his comment, because new users cannot comment, only answer.
I gave up.
I suspect many people with valuable knowledge to impart will have done likewise, and left Slackoverflow to the anal badge collectors that appear to rule it.
If people simply hired web developers, most web hacking shit would be gone over fucking night.
Thanks for the chuckle.
Java is [garbage collecting ] very s [gc] e [gc] [gc] cure.
The garbage collection [gc] algorithm [gc] [gc][gc] ensures that [gc] [gc][gc] you never know [gc] [gc][gc] when it will [gc] [gc] [gc] crash and [gc] [gc] can't explot [gc] [gc] [gc] common stack [gc] [gc] [gc] pointer [gc] [gc] [gc] bugs.
Also, since java is slow [gc] [gc] [gc]thats another security feature [gc] [gc].
fast programs crash [gc] [gc] too fast [gc] [gc]. Making exploits [gc] [gc][gc] trivial [gc] [gc].
All operating systems should [gc] [gc] be java based. Try [gc] [gc] [gc] hacking [gc] [gc] [gc] something that [gc] [gc] [gc] takes 3 days to [gc] [gc] [gc][gc] boo java expection error.
When he asks for the YouTube people to come in and film him.
You can hope for good advice but in the long run when it comes to security features, you have to know who you are talking to, what their qualifications are and make sure they're there to support you down the road - which means you are going to pay them. "Gr8CdrGrl427" on Stack Overflow might have an interesting approach as to how to position and code a slider control but taking security advice from them is simply dumb - the worst case is they're making a suggestion that will lead to an exploit they work.
A basic rule of the internet is, don't trust somebody that's helping you for the good of their health.
Mimetics Inc. Twitter
Coders today are completely lazy, don't give a fuck about doing anything other than writing code and meeting goals. Management didn't tell them to do it? They don't fuckin' do it. I grew up developing web sites and web apps and learned security the hard way ...getting fucking rooted dozens of times! when I started doing development for money I had to make sure someone couldn't just bypass security controls and hack the customer's sites and when they did, you bet your ass i had to FIX IT. It should be obvious to anyone with a fucking pulse that as soon as you put a site online, SOMEONE WILL ATTEMPT TO BREAK INTO IT.
When I got my first professional IT job as a developer, I had to be aware of security on publicly exposed web sites. I had to understand basic concepts such as how requests are handled, how variables are managed, preventing SQL code injections. When I came across vulnerabilities it was my responsibility to communicate that to management and GET THEM FIXED. Oh what you wanted the new company site live thursday? Fuck that, but i'll see what I can do AFTER we fix these other issues. You know something? Not once was I ever told NOT to focus on a major issue when I found one. Those were the "Good old days" - working for a small not-for-profit of all things.
Now, as an IT "Engineer" I manage systems, not code and it's not my place to open my big fucking mouth every time i see something so cringeworthy, i want to just jump out the fucking window. Our fucking developers don't even understand how mother fucking SSL works. I'm NOT MAKING THIS UP. "I don't have time to learn that." they actually say this! Here are a bunch of highly paid professional fucking developers and they don't even know how SSL(ok, TLS now) WORKS ...and here's the kicker, to them, it's not even THEIR FUCKING RESPONSIBILITY to know. Their job is writing code. If two web services can't talk because they don't know how certificate based authentication works, that's not their problem ...to them that's a system problem. How the hell do you think they're going to approach security and vulnerability management?
Is it any surprise then that these very same people don't give one fuck about security, much less even understand the impact of a security vulnerability might be? Hack after fucking hack, all of our personal and private information is being stolen and sold and it's because of people like this. People whose job it is to write code, and whose job it IS NOT to give even a single solitary fuck about security.
Now your typical enterprise may have third party security assessment and penetration testing - which is OK, but most of the time it's testing well-known exploits. The average exposure to vulnerability remediation an enterprise developer gets is putting a ticket into the engineering queue to ask them to modify the load balancer/WAF to add "httponly" and "secure" flags to the fucking cookies. That's when the company starts blowing millions on software and tools to do the work for you, but we all know the buck's gotta stop somewhere. Don't professional enterprise developers have a goddamn duty to be aware of these things and to put the time and effort into avoid such common fucking failures?
Yeah seriously - This is a case where using AC tag is warranted.
It protects the original poster the shame in being labeled a frickin' moron.
Mimetics Inc. Twitter
They hate discussion. Many, many times I've seen a question closed because they were asking a question that was more complicated than mere Q&A. And once an answer is up, "replies" to it are limited to basically Twitter-sized comments. Good luck posting your own answer that corrects people and/or presents a different solution: don't worry, it's not like it will get removed, but you're competing against an accepted answer - which is not the same thing as a "best" or "correct" answer.
Anyone remember programming forums? They're dying because of StackOverflow. But you can find there a community, varied discussions, multiple answers from different viewpoints, and people who are interested more in helping than in getting badges.
If I had a dollar for every time I've had to correct bad advice someone got from StackOverflow, I could take annual vacations to Hawaii.
I had a friend taking a college course to learn C coding, a supposed good example from class on reading a file was
#include
char c;
while ( (c=getchar() ) != EOF) {
}
for this.
When I've had to make a quick judgment about a programmer's knowledge and competency, I've found that there's one simple question to ask that works wonders:
"What do you think about the Rust programming language?"
Some people will say, "Rust? What's that?". These are typically unskilled people who probably don't know more than elementary JavaScript or PHP. I tend to ignore these people going forward. They're not worth my attention.
Other people will say, "Rust! Rust is fantastic! It's so safe!". These people are typically hype-loving suckers. They've heard of Rust, probably at Hacker News or Stack Overflow, and have bought into the hype about it. They want to come off as "trendy", so they talk about how great Rust is. I tend to ignore these people going forward, too. I don't want to deal with small-minded people like this.
Others will say, "Rust... I tried it. I was not impressed." These people can be respected. They have up-to-date technical knowledge, and they're willing to try new technologies, but they're not blinded by hype. These people are worthy of consideration. One thing to be aware of is that they're neutral about something they should not be neutral about. There are just some things that people should have strong negative feelings for.
Finally, the most intelligent will say, "Rust? Fuck, no. I use C++." These are the people to take seriously. They aren't just neutral about Rust. They actively dislike it. This means that they've probably got a thorough understanding of Rust and its flaws. What's more, they clearly know that C++ is a better alternative, and actively choose to use the best option available. These people get my attention, and I respect what they're saying.
It's really surprising how much insight you can get about somebody from such a short and simple question.
What a lot of people don't understand is that Stack Overflow is a very comforting place for autists.
Don't get me wrong, I'm being completely serious about this. I'm not joking about autism and Aspergers, which are very serious disorders that can have a huge impact on somebody's life.
Stack Overflow's community has a rigidity that's nearly unmatched. The only other community that might be as rigid is the Rust programming language community. Both have a strict set of rules that the community must follow, and there's absolutely no flexibility with regards to how these rules are followed. Anyone who deviates from these rules is harshly treated, and in many ways driven out of the community.
This rigid community foundation essentially gives autists a script they can follow. It takes away the difficulties they find with more natural, free-flowing social interaction. All interactions within the Stack Overflow and Rust communities are like following a checklist. They don't have to think about their social interactions; they just follow a template.
Of course, to non-autists this sort of a system seems remarkably strange, and often tyrannical. Non-autists can sometimes find it difficult to understand why people would want to engage in such faux "socializing". But these non-autists fail to realize that those with autism often find great comfort in being subjected to a very strict set of rules, and a sequence of steps they can follow in order to engage in an activity that resembles socializing.
Non-autists shouldn't expect to enjoy engaging in a community like the Stack Overflow community or the Rust community. The structures of such communities have become tailored to work pretty much only for people suffering from autism or Aspergers or some other similar condition.
so to get this straight people are having trouble understanding a framework that is hard to use and changes faster than the documentation can keep up with it? one of SO's biggest weaknesses is that it keeps obsolete answers around forever, and is hard to use when you have version N+3 of some framework that has changed almost completely since the answers about version N + 1 were posted a year or two ago
the irony is that spring started as a SIMPLIFIED, EASIER java framework to replace heavyweight, difficult stuff like EJB - and now has become what it set out to destroy - so we need a new framework-of-the-weak that is easier to understand to replace spring - the real irony is spring mvc was designed to be a simplified version of struts, but apparently struts hasn't gone away
If people simply hired web developers, most web hacking shit would be gone over fucking night.
No. Just no. The only thing worse than Java programmers are web developers.
People who say "sheeple" have about as much sophistication as an AOL user, and in fact are probably actually AOL users.
... just about all of them are terrible, low quality memory hogs.
QED
Developers absolutely suck at security. This might be for nerds, but how is this news?
If a developer was given root access on an internet-facing server, then within 10 minutes the whole filesystem would be 777, all ports would be wide open, SELinux would be turned off, direct root login from the outside would be enabled, and all processes would run as root or with root permissions.
(Yes, I am a grumpy sysadmin who has had to clean up far too many messes from you clowns. The examples I cited weren't even the most egregious that I've had to deal with after being overruled by management.)
stackoverflow contains shitty advice
After reading this post, I decided to check out the CERT C Coding Standards and C++ Coding Standards. They want you to create an account to in order to download! Even CERT is clueless on how to make secure programming easily accessible for developers.
Many of the Stackoverflow first answers are very poor, as are many followups from people who don't sanitize their inprts. The problem is aggravated for Java, where error reporting is often very poor and where programmers have been taught with object oriented principles to pay no attention to the rest of the system: it's considered outside the scope of their immediate task.
I do find Stackoverflow useful: there are often extremely useful hooks to start from, and it's well worth thanking the community by following up with my more detailed or robust answers, especially when the published answers did not quite work. That kind of feedback is critical to open source and free software projects.
... ...
If people simply hired web developers, most web hacking shit would be gone over fucking night.
"Web developers" are the Thalidomide babies of the IT world.
If people simply hired web developers, most web hacking shit would be gone over fucking night.
No. Just no. The only thing worse than Java programmers are web developers.
This is a web site, made by web developers. Criticizing web developers is childish and pointless.
Well I never!
Canoncial example of a Stackoverflow exchange:
Answer: Why in the world would you want to do that? Here do this
Answer:
#1 upvote:
#2 upvote:
#4 or #5 most upvoted:
further down:
Stackoverflow is the best for people that sort of know what the answer should be and can separate the wheat from the chaff.
I often point to this on as a good canonical example. https://stackoverflow.com/ques...
If poor answers are floating to the top because of reputation, then Stack Overflow has effectively automated argument from authority.
This is not too surprising. Automating fallacy is probably easy. Automating security is likely to be hard. Trust me. I'm an expert on this.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
So, I agree with all the haterade at SO and all the things it does wrong and stuff. But let's take a moment of reflection and see if maybe we as a community also did something wrong.
My opinion is that it's a total lack of actually useful documentation. And by that I mean there's almost always documentation, but it's at a level of specificity that makes it totally useless.
By way of analogy, imagine getting into an airplane and there's tons of man pages for each instrument like "The throttle control the amount of forward thrust generated by the engines. It has three auto-throttle modes for speed, trim and power, you can enable those modes by setting the auto-throttle switch to the ON position and adjusting the rotary dial to the desired mode. The power mode cannot be used while the autopilot for level is set."
And so on there's documentation on every little thing but nowhere does it actually explain how the hell to fly a plane.
There are projects whose documentation is exactly like this. They are full of great (and useful) detail about how the parts work but there is no place that explains how the whole project works at a general level and how to get it off the ground.
They're Java coders. Easily replaced.
I tend to rant.
You always get bad advice from Stack Overflow.
Really, I don't know how that god-forsaken site, stackoverflow became the standard go-to for problem solving.
90% of the content on that site are pompous programmers talking down to people and questioning their every motive, or modding newbies down. That site seems to exist to give 99% of most programmers an inferiority complex, more than it does to educate people, or provide quality code.
A standard StackOverflow query tends to go like this:
* User asks a question
Responses:
* instant downvote with no explanation
* mod critique that the question is not properly formatted
* "Why do you want to do that?"
* (wrong answer, but posted really fast)
* "your question is too detailed/not detailed enough"
* "what are you trying to do?"
* pointing out the question has kinda been asked before (but not really)
By far the hardest part of security is getting companies to care about it.
And so on there's documentation on every little thing but nowhere does it actually explain how the hell to fly a plane.
There are projects whose documentation is exactly like this. They are full of great (and useful) detail about how the parts work but there is no place that explains how the whole project works at a general level and how to get it off the ground.
That's because the general assumption, in this case, is that the reader already knows how to fly planes in general, and only needs the specifics for this model.
Of course, given the number of coders whose training consisted solely of rote memorization, this assumption is provably wrong. That leads to the sorry state the IT industry is in now, and why I'm very glad I'm training to get my CDL and drive a truck.
Go on, citizen, stamp the vote card. R or D, your choice.
First off, I hate fucking Java. Second, the data may be correct, but the conclusion is out of reality. The reason this is an issue and the up votes go for the easiest not most secure answer, is 1. Human nature, 2. Companies don't give a flying fuck about security. If a "business" leader in a ecom org can't even be bothered to learn a single thing about how a web page even works, then they certainly don't really understand the impact of a few coding side steps and no budget will be allocated DAY TO DAY, to deal with it. After the fact security reviews are doomed to fail, because there is just to much rot after a while.
Who's going to pay for training so that developers can recognize bad advice on Stack Overflow, or possibly increase the amount of good advice on Stack Overflow?
Who's going to invest? Who's going to spend the money? And on who's time are they going to be researching better security in code?
What the fuck did you expect?
One big problem SO has is reconciling old questions with "best" answers that might no longer be the best -- or even still RELEVANT.
Suppose that someone posted a message to SO in 2012 asking how to hide the mouse pointer arrow that appears if the user connects a bluetooth or USB mouse to the device when their app (say, an OpenGL ES game) is in the foreground.
Five years ago, the correct and concise answer would have been, "You can't".
Today, the proper answer would be, "You can't do it unless the device has Android N (7.0) or newer AND you target API 24+, in which case here's what you need to do..."
The problem is, if someone posted a new question like this TODAY, some mod looking for easy points would likely flag it within minutes for closure-as-duplicate, EVEN IF the older question's only answer is "you can't". Often, the mods who are the most aggressive about flagging for closure-as-duplicate aren't even subject matter experts in the platform whose questions they're moderating... they're just looking to score easy points for their "Google" skills, and don't BOTHER to actually read anything beyond the search result summaries (let alone consider whether the original questions' answers are still relevant).
This happened on a grand scale for MONTHS after Android Studio moved to Gradle-based projects. People would post questions asking how to do something specific in a Gradle-based Android Studio 2.x project, then get their question swatted down almost instantly (as "duplicate-of-older-question", usually some question about Eclipse or Android Studio 1.0) by users with high reputations, but no discernible expertise in ANDROID development (because the real Android experts KNEW that Gradle was a HUGE change that broke things up, down, left, right, and diagonally).
> Another thing they discovered is that, sometimes, the most upvoted posts/answers contain insecure suggestions that introduce security vulnerabilities in software, while correct fixes are less popular and visible simply because they have been offered by users with a lower reputation score...
So, in essence, qualified answers by low ranking posters -- let's call them ACs -- are not as upvoted as BS from registered users?
Who would imagine that?
When the people signing the checks don't want to pay for security. Try telling the powers that be that the software project, which seems perfectly functional in the demo you just gave them, is still weeks or months away from delivery because we have to implement security. You will see how fast security goes out the window when the money men smell profit and see "first mover" advantage in the marketplace through their tunnel vision.
This is a web site, made by web developers.
A few hardline anti-JavaScript users I've run into are under the impression that Slashdot ought to have been an NNTP site viewed through a news reader, not a website viewed through a web browser. They tolerate web-based discussion forums, though they would prefer a discussion-specific protocol.
Also, Stackoverflow users a formatting syntax called "markdown". It's the same as Github.
In this case, no, it isn't the same as GitHub. GitHub recognizes several extensions to Markdown that Stack Exchange does not, such as the triple-backtick for code blocks as an alternative to the four-space indent.
Go on, now tell me why that's a bad idea.
People are simply too lazy nowadays. This reminds me of the heady days of BASIC interpreters everywhere.
There's a reason I switched to assembler.
FTFY
>> ...The researchers concentrated on posts relevant to Java security ...
Java security. Those two words simply do not belong together.
It should be syntaxically forbidden to write them side by side.
aaaaaaa
This is a web site, made by web developers. Criticizing web developers is childish and pointless.
Speaking of pointless, your statement is orthogonal to the discussion. The fact that this is a website has nothing whatsoever to do with the claim that web developers, are, on the whole, lousy programmers.
People who say "sheeple" have about as much sophistication as an AOL user, and in fact are probably actually AOL users.
This is a web site, made by web developers. Criticizing web developers is childish and pointless.
Take two: The quality of slashdot does far more to reinforce my point than it does yours.
People who say "sheeple" have about as much sophistication as an AOL user, and in fact are probably actually AOL users.
At that price, you want quality, too?
There's no time like the present. Well, the past used to be.
If people simply hired web developers, most web hacking shit would be gone over fucking night.
Thanks for the chuckle.
Sure it can be done one week with a single programmer. Ask the marketing manager who is the only one allowed to scope the requirements.
http://saveie6.com/
That's because the general assumption, in this case, is that the reader already knows how to fly planes in general, and only needs the specifics for this model.
Indeed. And software documentation should assume that the reader already knows how to use a computer in general and only needs the specifics for this particular piece of software.
Take a look at the git book for example. First, it does assume that the reader knows what files are, how files are arranged in a filesystem, how to use a command line. Then it actually explains at high but not abstract level how git actually works. Then it goes through examples of using it. Only last does it provide a reference/glossary type documentation for looking up the detailed syntax of each and every little command.
To be more concrete, not even the most capable and savvy computer person who has never heard of git will be able to understand this sentence:
git fetch
Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories." (although this is there).
If you've never heard of git before, it's just bloody meaningless. No matter how much general knowledge you have, even if you've used CVS and SVN before . . .