-
Notifications
You must be signed in to change notification settings - Fork 225
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
Coherence Security Issues #270
Comments
Hi @newdayrising! It looks like you misunderstood my suggestion. It is possible to retire specific versions of libraries on Hex.pm. My recommendation is that, once a new release is made, this specific version be retired so that people do not inadvertently use an insecure dependency. |
I personally don't like the tone that I took myself. I'll just go ahead and delete that comment :D |
I'm running sobelow 0.6.2 and getting this error:
Is this the same version you are referring to in this issue @GriffinMB ? |
@joshprice - Yes, it is. |
@GriffinMB Thanks! Given the large surface area of Coherence and the fact that we don't actually implement any user registration functionality (thus avoiding the described vulnerability) it's probably worth indicating in sobelow what the vulnerability actually is along with any known mitigation strategies. |
@joshprice - No problem! If you run the command with the It is also worth noting that the issue is not limited to registration, though certainly not all applications using Coherence will be critically vulnerable. At any rate, I don't want to derail the discussion in this issue, so if you want to continue the conversation feel free to open an issue on sobelow! |
@GriffinMB Good to know about If the issues aren't limited to user registration could you please expand on which other areas are affected so that anyone following the link in sobelow can be sure they are or aren't affected? Thanks! |
@joshprice - I will update the original issue to include additional information in the next week or so. But, at a high level (for anyone reading this in the mean time), anything in the user's For example:
Here, I need to refresh my memory on the full scope of the vulnerability, but I will update the original issue with this information and more when time permits! |
Correct me if I am wrong, but this issue is found in any User model exposing a path to update parameters. What is needed is a flag that some fields are editable by user with id = 1 or something similar. |
This is correct! Typically, you would avoid this by having different changeset functions for different user-types and different actions (create, update, etc). You would also want to have separate functions for generating values for columns like |
@GriffinMB I don't understand the discussion regarding iex(4)> User.changeset(u, %{inserted_at: NaiveDateTime.utc_now})
#Ecto.Changeset<action: nil, changes: %{}, errors: [],
data: #SamplePhx.Coherence.User<>, valid?: true> I understand and agree with the other fields.... |
@smpallen99 It was only an example of a possible field that you would generate a value for, not one that necessarily exists. |
In the meantime, while this is getting resolved, what are the steps needed to patch this? |
Got it. Thanks... |
What I've done is created a separate registration changeset that only has
I'm not using the routes for If I'm understanding the vulnerability then I should have essentially worked around it, right? |
@seanculver - As long as you aren't using |
@GriffinMB That is the case, thanks! I did notice some other issues with |
@seanculver - No problem! I haven't looked much into those issues, but I believe they are false-positives. It looks like it's flagging a bunch of |
Is this issue still not resolved? What are the recommended steps to avoid these security issues? |
Hi @newpain01! To my knowledge, these issues are not resolved. Avoiding these issues is difficult if you are fully using this library, but if you are only using bits of it @seanculver's comment above has the right idea. |
Hi @smpallen99 , was this issue ever resolved? |
Thanks again for taking the time to talk with me. I'm opening an issue as per our conversation:
The Coherence library has "Mass Assignment"-like vulnerabilities. In particular, "registration"
endpoints (like creating, editing, updating), allow users to update any
coherence_fields
. Thismeans that, among other issues, users can automatically confirm their accounts by sending the
confirmed_at
parameter with their registration request. Further, the library design and documentation encourages insecure functionality by default.For example:
https://github.com/smpallen99/store/blob/master/web/models/coherence/user.ex
Due to these issues, I would consider officially "retiring" the current version of Coherence in hex.
The text was updated successfully, but these errors were encountered: