News for hackers. Stuff that matters.
Re:Why client-side verification is bad by fragsworth on Wednesday July 06, 2011 @04:35AM (#2733018)
Sure, we can all poke fun at them for being stupid programmers. Multi-billion dollar company and they don't even know how to do server-side verification? LOL, we're so much better than they are!

But think about it for a moment. Assuming the ideal product would have both client + server verification, it's clearly less work to only do client-side verification. The product can be released quicker.

Maybe they intentionally forgo the server-side verification code until they actually get cheaters. Then they implement it before it begins to hurt their bottom line.

Because what if the game was an utter failure, and never got any users? How glad would you be that you spent all that time writing the server checks for every game action?

Re:Why client-side verification is bad by retube on Wednesday July 06, 2011 @04:45AM (#2733035)
Yes absolutely. Programmers/devs often get way too wrapped in doing everything _right_. But doing it right takes time and money. Commercially it makes sense to get away with the bare minimum. The holes will only be an issue if the product actually takes off.
Re:Why client-side verification is bad by frobozz on Wednesday July 06, 2011 @04:47AM (#2733043)
This is a very good point. After all, it is just a game, not a banking application, and a pretty simple game at that.
Re:Why client-side verification is bad by frobozz on Wednesday July 06, 2011 @04:28AM (#2733003)
This attitude throws the baby out with the bathwater.

Client-side verification is Good, it saves bandwidth and reduces annoyance to the user. Client-side verification without also checking on the server is bad.

Given the example of a word game to be played on a phone. I would argue that client-side verification of valid words is vital.

Re:Why client-side verification is bad by mopoke on Wednesday July 06, 2011 @04:30AM (#2733008)
The title should probably read "Why relying only on client-side verification is bad". I don't think the author is suggesting that doing client-side verification is a bad thing in itself.
Re:Why client-side verification is bad by frobozz on Wednesday July 06, 2011 @04:41AM (#2733027)
That's probably what's in the authors mind, but not what's in the article. The author is not just suggesting that client side verification is bad in itself, but stating that position quite precisely.

"Why client-side verification is bad.."

(rather than the title you suggest)

"to my surprise discovered that it did client-side verification of the words"

(rather than "...that it didn't do server side verification")

However, in support of your position; in his opening paragraph, he does say "you can't rely on it to do authentication", rather than "you shouldn't use it to do authentication".

Re:Why client-side verification is bad by nhebb on Wednesday July 06, 2011 @04:59AM (#2733066)
The author wrote "A common mistake is the web site that relies on javascript". I think the key word is "rely". You either rely on something or you don't. It's not a partial measure.
Re:Why client-side verification is bad by mopoke on Wednesday July 06, 2011 @05:03AM (#2733072)
Author's comment on his site:

"It's not wrong to use client-side methods to do initial validation, but it's wrong to trust that validation on the server side."

Re:Why client-side verification is bad by frobozz on Wednesday July 06, 2011 @05:20AM (#2733102)
The comment you cite (which is new since my comment above) confirms my point that it might be what he thinks, but not what he says. The comment continues:

"I probably wasn't very clear on my feelings though."

Re:Why client-side verification is bad by ralfd on Wednesday July 06, 2011 @04:35AM (#2733017)
In this specific instance there is also validation by the other player. Hacking the game is obvious and the other party will refuse to pay.

In more competitive games like Starcraft you can't trust the client (maphack for example).

Re:Why client-side verification is bad by JoachimSchipper on Wednesday July 06, 2011 @04:41AM (#2733026)
It's also not exactly the only way to cheat (low-tech solution: spend a day with your grandma, who is an absolute Scrabble wizard.)
Re:Why client-side verification is bad by corin_ on Wednesday July 06, 2011 @05:43AM (#2733145)
There was a competition for university students in the UK a few months ago from some investment company, trying to raise interest for post-grad careers with them, basically a several-stage speed test, top five speeds at the end of the time period would get to choose a prize, iPhone, cash, few other things.

A friend of mine (a student) asked me if it was possible to create macros in a browser to help go faster, and since I was bored and lack morals in this area... just took a look through the JS, and fifteen minutes later and an injection for him to paste into the URL bar and skip through each stage, making the game think he had completed it, as fast or slow as he wanted. So he got a free iPhone.

Re:Why client-side verification is bad by andrewcooke on Wednesday July 06, 2011 @06:00AM (#2733190)
(thinking more about web pages than apps here)

are there any frameworks that let you re-use the same verification code on both client and server? i'm imagining some way to decouple the validation from the presentation and then run the validation part on both sides - i don't see why this wouldn't be possible with something like Node.js.

related, i guess that some frameworks (particularly ajax) support duplicating validation on client and server by automatically generating (different) client (javascript) and server-side code (python/ruby/java/...) from simple specifications (eg regexps). does anyone have good experiences with any of these?

Re:Why client-side verification is bad by sequence7 on Wednesday July 06, 2011 @06:12AM (#2733224)
Well it's not a framework but asp.net mvc can actually do pretty much exactly this with data annotations.

http://www.asp.net/mvc/tutorials/mvc-music-store-part-6

Re:Why client-side verification is bad by Joakal on Wednesday July 06, 2011 @04:23AM (#2732994)
Client side validation is good for speed, however should not be trusted when sent to server. Server side validation is for validating such information to prevent issues. eg SQL injections.
Re:Why client-side verification is bad by deno on Wednesday July 06, 2011 @04:59AM (#2733067)
But you can't trust client-side validation, unless you run the client in a DRM container (client then can just sign the request and you can assume that it executed in a secure memory, unaltered).
Re:Why client-side verification is bad by masklinn on Wednesday July 06, 2011 @05:33AM (#2733121)
Is that not exactly what he wrote?
Re:Why client-side verification is bad by deno on Wednesday July 06, 2011 @06:44AM (#2733288)
It seems I got it mixed up with a different comment. My apologies.
Re:Why client-side verification is bad by robryan on Wednesday July 06, 2011 @04:20AM (#2732988)
Words with friends really needs both, without client side it would be tedious for attempting a word, of course this could also cut down on people trying their letters just about every way they can until they get a word.
Re:Why client-side verification is bad by chris_engel on Wednesday July 06, 2011 @04:12AM (#2732967)
This is obvious, isn't it?! Everything the user has access to can be manipulated.
Re:Why client-side verification is bad by wladimir on Wednesday July 06, 2011 @04:25AM (#2732999)
You'd be surprised how many applications and web sites still rely solely on client-side validation, even these days. Either don't think at all about threat scenarios ,or they trust their "Do not reverse engineer" EULA to protect them :-)
Re:Why client-side verification is bad by chris_engel on Wednesday July 06, 2011 @04:47AM (#2733044)
wow, I suppose we shouldn't begin to talk about sql sanitation...
Re:Why client-side verification is bad by robin_reala on Wednesday July 06, 2011 @04:20AM (#2732987)
Sorry, what? Client-side verification is categorically not bad. It’s when you don’t combine it with a round-trip to server-side verification that you have problems.
Re:Why client-side verification is bad by eyalbd1 on Wednesday July 06, 2011 @04:22AM (#2732991)
Client side verification is good to prevent unnecessary hits on the server when the input is incorrect/incomplete , its not.. in any way.. a real input validation.
Re:Why client-side verification is bad by dclaysmith on Wednesday July 06, 2011 @04:49AM (#2733048)
"It wasn't very hard to circumvent this, resulting in a version which accepts moves like the above one.."

I'm more curious as to how you go about circumventing this. I would imagine that it probably IS very hard.

Re:Why client-side verification is bad by kieranyo on Wednesday July 06, 2011 @04:43AM (#2733031)
Surely this is just common sense at this point?
Re:Why client-side verification is bad by steffoz on Wednesday July 06, 2011 @04:32AM (#2733013)
Validation client side is just a way to make user interaction faster. Nothing more, but quite useful, indeed.
Re:Why client-side verification is bad by ragmondo on Wednesday July 06, 2011 @06:02AM (#2733199)
Wanted to comment on the article but all I could think about was "READ THAT EMAIL IN YOUR STATUS BAR"
Re:Why client-side verification is bad by nodata on Wednesday July 06, 2011 @04:17AM (#2732977)
Does HN use client side verification for votes? Otherwise how did this get here?
Re:Why client-side verification is bad by masklinn on Wednesday July 06, 2011 @05:34AM (#2733125)
Not bad, insufficient.
Re:Why client-side verification is bad by lurchpop on Wednesday July 06, 2011 @04:45AM (#2733037)
it is very annoying to have to duplicate validation logic though.
Re:Why client-side verification is bad by avstraliitski on Wednesday July 06, 2011 @07:31AM (#2733390)
Fundamental truth = no code should ever trust its input. Break this rule never. If you have optimization problems, then don't worry because they're better than security problems and the hardware will likely solve it for you by the time you release. Trust relationships between bits of any codebase mean 'not loose coupled' = fundamental design flaw for simple, maintainable and secure code. Unix design philosophy: "do one thing and do it well" (and that means checking all your input religiously for every function)