Giter VIP home page Giter VIP logo

Comments (6)

sferik avatar sferik commented on June 16, 2024

I enabled attribute whitelisting in 6b2c541 as a security measure after a vulnerability in Rails was made public. This patch inadvertently prevented data seeding, which I never noticed, since my local database was seeded long ago (and there are no tests for seeding data). Your workaround will allow data seeding but it should not be committed, lest you open a security hole in Adopt-a-Hydrant. This will be fixed in Rails 4 with strong parameters, which should allow unencumbered seeding of data, since attribute checking will move from the model to the controller.

from adopt-a-hydrant.

mlevans avatar mlevans commented on June 16, 2024

Hey Erik,

Thanks for the explanation. So I ran into this same issue when I tried to adopt a hydrant. I used an attr_accessible declaration for the user_id; otherwise the POST request wasn't working. How does the live site get around this issue?

from adopt-a-hydrant.

sferik avatar sferik commented on June 16, 2024

For all I know, it doesn't work in production. I pushed this change in the middle of June, when the site wasn't active for the winter. It may be broken now, but at least it's secure, right? :wink2:

I'll look into this when I get a chance. Maybe I'll add strong parameters, which is available to use in Rails 3.2 apps as a gem. Or maybe you could work on that?

from adopt-a-hydrant.

mlevans avatar mlevans commented on June 16, 2024

I'll take a look at strong parameters and update you on my progress.

from adopt-a-hydrant.

thorncp avatar thorncp commented on June 16, 2024

FWIW, I just got around the seed data problem by opening up the Thing model in the seeds file, and adding the attr_accessible call there. Here's a commit for reference.

from adopt-a-hydrant.

mlevans avatar mlevans commented on June 16, 2024

Closing this after Erik's latest commit: 7004916. Thanks for fixing this Erik!

from adopt-a-hydrant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.