Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug fix
Fixed bug
Something I discovered while reviewing open-rmf/rmf_deployment_template#49. I'm 100% certain if this is an actual bypass in practice as I haven't done a POC, but in theory from what I understand from the code, certain requests can bypass authentication.
rmf_visualization/rmf_visualization_schedule/src/rmf_visualization_schedule/TrajectoryServer.cpp
Lines 121 to 145 in ef42bb4
Here the request is parsed first before auth is checked, in this case "parsing" the request includes processing it. For most requests this can leak information with a timing attack, but there is one operation in particular which is very problematic.
rmf_visualization/rmf_visualization_schedule/src/rmf_visualization_schedule/TrajectoryServer.cpp
Lines 233 to 241 in ef42bb4
The
negotiation_update_subscriberequest subscribes to negotiation updates and the server will push any new negotiations.rmf_visualization/rmf_visualization_schedule/src/rmf_visualization_schedule/TrajectoryServer.cpp
Lines 445 to 473 in ef42bb4
Because the request is processed before auth, the subscription should still go through even with bad credentials and the server will start pushing updates.
Fix applied
Perform auth before processing any request, also close the connection if auth fails.