Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5957007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:20:22+00:00 2026-05-22T18:20:22+00:00

I am a Java programmer mostly, and it’s actually amazing that we don’t have

  • 0

I am a Java programmer mostly, and it’s actually amazing that we don’t have to worry about a lot of security concerns that php or even rails developers have to worry about. We have to worry about them, but I think our job is actually a lot easier. You just use Java (already big bonus points there) and use Spring with Spring security… and you’re basically done. Java and servlets are actually really good in this respect.

Now that I’m working in Rails, I think the biggest security concerns that I am the most scared of are parameters – both in the ones that are coming from the controllers (since they dynamic hashes, unlike in SpringMVC) and having to include more hidden values in forms.

But that got me thinking – you really have to be careful what you accept when you create new models or even update models. If you just blindly pass in parameters to your models, bad things can happen. In fact, things like the user role and stuff could be changed if you’re not too careful.

It’s almost like I want to write the setter code by hand to make sure it’s not overwriting something that it shouldn’t. And even if there’s a framework mechanism to handle this… I would still want to test every risky model attribute just to be extra sure that it won’t get overwritten on a create and on an update.

As much as Java gets a bad rep about productivity, it feels like it handles this stuff a lot better.

Anyway, my question is – what is the best resource/tips/advice for dealing with common security pitfalls/concerns/gotchas using rails – especially geared towards a Java/Spring developer who got used to working in a more stateful environment.

Even better, what would be a good checklist to go through every once in awhile?

And last, what tests would you recommend to make sure things are solid?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:20:22+00:00Added an answer on May 22, 2026 at 6:20 pm

    I don’t use ActiveRecord (I use DataMapper), but as a rule, I never do mass-assignment and I always expressly pass only the attributes I want to change. Rails 3 defaults to escaping all content in your views, unless you expressly output that data raw into into the .erb.

    Also, it really bugs me that ActiveRecord doesn’t help you out very much if you need to drop down to using SQL for something. You have to escape input yourself, which can expose you to the risk of human error allowing arbitrary SQL to be executed in your queries. DataMapper’s underlying DataObjects connection supports prepared statements out of the box and in fact, it would actually require more work to avoid using them.

    Rails 3 does have CSRF protection turn on by default too. It also makes session cookies HTTP-only by default, which makes them harder to steal via JavaScript.

    I actually think, aside from Rails encouraging the use of mass-assignment, you’re pretty well-covered for security.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a longtime Java programmer working on a PHP project, and I'm trying to
I'm a pretty experienced Java programmer that's been doing quite a bit of Win32
I'm an old (but not too old) Java programmer, that decided to learn C++.
I posted this question: https://stackoverflow.com/questions/418597/java-and-net-for-php-programmer and the answers I was given didn't really help
I am not a Java programmer by trade. C and Fortran mostly. However, I
I'm studying for Java Programmer Certification (SCJP) exam. A question about exceptions, when handle
I am currently doing a summer job as Java programmer. We have an application
I am a bit ashamed to ask that, being a Java programmer for years,
I'm a Java programmer, and I like my compiler, static analysis tools and unit
I am a Java programmer and need to work on a Flex/ActionScript project right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.