-
Notifications
You must be signed in to change notification settings - Fork 344
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
Unauthorized localhost access #1422
Comments
No, that is a related but different issue. #1421 was about that earlier the CORS headers were incorrectly configured and that PR fixed that. Here I'm reporting that even the CORS headers are set correctly, some browsers (Chrome and Firefox) still make a request and that can have potentially malicious or dangerous effect. This is demonstrated with the link, if you click it on Chrome and have a local Bee node running, then it will change the welcome message to the empty string. |
some solution was suggested here (api token) |
@agazso is there any problem to solve here? i guess that some of this stuff will be resolved by the authorized api but not sure if there's anything to follow up on here. if not then please let's close this |
It will be resolved by the authorized api. I suggest to close this issue once that is implemented. |
After some discussion with @agazso and @nugaon it was decided to move ahead with the smallest subset of functionalities that would allow the JS team to explore to what extent a simple RBAC solution would cover their use cases as DAPP developers. It is implemented as a global policy that has role/resource/action granularity. At the moment the policies are hard coded, however in the future they can be transparently moved to an external file. The reason it is hard coded is that we don't have a strategy or recommendation for the DAPP developers on how to migrate their policy files when new endpoints are added, or default policies are changed for existing endpoints. Security levels By default the bee instance will boot in insecured mode, allowing access to all current APIs in the same way it always has been. If the Modus operandi This solution introduces two configuration params for the admin Upon successful authentication a new token will be generated and stored in the memory of the bee instance. The token must be presented to the API on every request in order to gain access to the resources allowed by its corresponding role. At the moment it only contains the role and expiration time, however it can be extended to have a counter or any other extra trackers to measure allowance, for instance. Alternative A dedicated proxy (side car) service could be implemented to take care of the security/allowance. This approach would require securing the bee instance by some other means (firewall rules) and then interacting with it exclusively via the side-car proxy. Due to uncertainty we decided to go with the bee side security. This would allow us to see to what extent this solution fits us and give us more empirical data to make a better decision. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
@notanatol Can we link the PR with this issue? Maybe close this if its merged already. |
@agazso can we close? |
It seem that disabling CORS only stops the browser from receiving the response, but not from making it completely. For example as a test if I open this link in Chrome, it sets the welcome message of my locally running Bee node to empty string, never mind how
cors-allowed-origins
is set 😬https://test.felfele.org/cors.html?bee=http://localhost:1635/welcome-message&method=POST&body={%22welcome-message%22:%22cors%22}
Tested on:
Chrome 89 - unauthorized access ❌
Firefox 86 - unauthorized access ❌
Safari 13 - blocked ✅
Brave 1.21.74 Chromium 89 - unauthorized access ❌
The content of the
cors.html
:Originally posted by @agazso in #1421 (comment)
The text was updated successfully, but these errors were encountered: