Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marking virtual attributes in Rails 5.1 may be exposing decrypted data #353

Closed
stevenjackson opened this issue Aug 20, 2019 · 2 comments · May be fixed by #354
Closed

Marking virtual attributes in Rails 5.1 may be exposing decrypted data #353

stevenjackson opened this issue Aug 20, 2019 · 2 comments · May be fixed by #354

Comments

@stevenjackson
Copy link

When upgrading an application from Rails 5.0.7.2 to 5.1.7, I noticed that decrypted fields that used to be filtered out of our JSON responses are now included.

I believe this was caused by #263, if I comment out this line, the secrets stay secret.

attribute attr if ::ActiveRecord::VERSION::STRING >= "5.1.0"

My theory is that this is enabled because the field is now in attributes, which is enumerated when ActiveRecord creates a serializable_hash of a model.

https://github.com/rails/rails/blob/66cabeda2c46c582d19738e1318be8d59584cc5b/activemodel/lib/active_model/serialization.rb#L126

@Suyash-Chaudhary
Copy link

Suyash-Chaudhary commented Jul 19, 2023

Has there been any update on this? I am facing the same issue as well. Pretty much kills the whole point of using encryption in the first place.

@joshbranham
Copy link
Member

Has there been any update on this? I am facing the same issue as well. Pretty much kills the whole point of using encryption in the first place.

This is a very old issue. None of the maintainers from that time are still active, so issues like this ended up getting pretty stale. If you are still having this issue, could you please open a new issue including what version of Rails, Ruby and attry_encrypted you are on? I would also suggest trying the latest release if you can as the linked code above no longer exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants