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

Modifying Models with 'Password' type field in Yancy Editor #141

Open
flash548 opened this issue Aug 1, 2022 · 2 comments
Open

Modifying Models with 'Password' type field in Yancy Editor #141

flash548 opened this issue Aug 1, 2022 · 2 comments

Comments

@flash548
Copy link
Contributor

flash548 commented Aug 1, 2022

When modifying a model item in the Yancy Editor (e.g 'user'), that has a field of type 'password', if you change any field OTHER than the password field (e.g 'email' or something), then submitting the form will cause the password type field to be re-hashed and persisted to the db - thereby changing the password unintentionally. Everything works fine if you send the password field (be it changed or unchanged) in plain-text so that the backend doesn't "rehash the hash".

@preaction
Copy link
Owner

preaction commented Aug 3, 2022

Crap. The API is supposed to filter out format: "password" fields for the GET requests so that when you save it can treat anything in that password field as a new password to hash. So, fixing that (Yancy::Controller should send the empty string for password fields on get() and list() actions) should fix this issue.

That and it's really really bad to send out password hashes to anyone who asks 😛

@flash548
Copy link
Contributor Author

flash548 commented Aug 5, 2022

Lol yeah. Or could have some separate way to change passwords from the Editor.. that posts to a single endpoint that is just for this? But then I guess that would start getting opinionated. I came across this bug making my Mojo::Gateway proxy project (https://github.com/flash548/mojo-gateway) and just decided to host my own endpoint that then used the Yancy backend to change the password. Also any thought on having password expiration/changing feature? I can open a new feature request issue I suppose.... my gateway project does it manually in an under route, but I was thinking of maybe creating a Pull Request for Password.pm... or something like this already in the works?

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

No branches or pull requests

2 participants