News for hackers. Stuff that matters.
Re:Lucee: A dynamic, Java-based, tag and scripting language ... by naranha on Thursday September 13, 2018 @03:44AM (#17976780)
Already on the getting started page I see something that looks almost like possible SQL injection: https://docs.lucee.org/guides/getting-started/first-steps.ht...

I hope I'm wrong?

Re:Lucee: A dynamic, Java-based, tag and scripting language ... by rmason on Thursday September 13, 2018 @04:20AM (#17976924)
Sometimes things get simplified in tutorials. Best practice in CF is to use cfqueryparam:

SELECT * FROM #strDatabasePrefix#_courses WHERE intCourseID = <cfqueryparam value = #intCourseID# CFSQLType = "CF_SQL_INTEGER">

You would also want to protect your input variables so that you only get what you're expecting.

There's also a free service called HackMyCF that lets you check your server after you've hardened it with the guide that comes with both Lucee and Adobe CF.

https://foundeo.com/hack-my-cf/

Re:Lucee: A dynamic, Java-based, tag and scripting language ... by jarym on Thursday September 13, 2018 @04:53AM (#17977072)
> Sometimes things get simplified in tutorials

That’s putting it nicely. What’s happened is you’re showing users the wrong way to do something without it being explicitly clear to them. Then we wonder why people write crap code...

My view is NEVER simplify an example to the point it becomes a security or performance hazard.

What this tells me now is that this projects examples are not useable, their agenda is to make things appear easy when in fact concrete examples may not be.

Re:Lucee: A dynamic, Java-based, tag and scripting language ... by abraham_lincoln on Thursday September 13, 2018 @07:56AM (#17977872)
I am quite certain, regardless of language, a good developer would be aware that input for a DB needs to be sanitized.
Re:Lucee: A dynamic, Java-based, tag and scripting language ... by hobofan on Thursday September 13, 2018 @09:12AM (#17978305)
And what about all the none-"good" developers?

There are also frameworks that do the sanitization for you (e.g. Rails IIRC), and novice developers coming from those certainly might not be aware.

Re:Lucee: A dynamic, Java-based, tag and scripting language ... by jarym on Thursday September 13, 2018 @05:31PM (#17982807)
Equally, one could argue a 'good' developer would not in any way be put off by an example that demonstrated good security practice.

And 'good' needs to be put in context: e.g. a 'good' hardware or kernel engineer who never wrote front-end stuff may legitimately be unaware of the need to defend against SQL injection unless its written somewhere.

If they're as 'good' as you're expecting they would probably not even require a getting started tutorial...

Anyway, this is something I see in many tutorials and its somewhat unfair to single out Lucee. I just wish tutorial writers would put effort into real-world examples more often.

Re:Lucee: A dynamic, Java-based, tag and scripting language ... by dominicr on Thursday September 13, 2018 @04:19AM (#17976921)
It's not a great example as it's trying to be ultra simple for first steps.

There's a lot of built in security to Lucee/CF but for a query I'd always be doubly sure and explicitly state the parameter data type as well and that'll definitely block SQL injections. So this code would be:

queryExecute( "select * from employee where id= :itemID" { itemID = { value=arguments.itemID, cfsqltype="cf_sql_varchar", list=true } } );

Re:Lucee: A dynamic, Java-based, tag and scripting language ... by bdcravens on Thursday September 13, 2018 @11:54AM (#17979576)
That works, though I think most developers are drawn to the markup style <cfquery> (I've been building CFML apps since 1999, and I don't know if I've ever seen queryExecute in the wild)
Re:Lucee: A dynamic, Java-based, tag and scripting language ... by cjcampbell on Thursday September 13, 2018 @12:41PM (#17980023)
I've seen both in security reviews, primarily driven by where the code fits in the application. The more modern apps that I've come across (with stronger coding standards) restrict tag-based code to view templates.