-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add HTTP server functionality and enhance server options #29
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
Conversation
YunxianHua
commented
Jun 6, 2025
- Introduced a new HTTP server class to handle device information requests.
- Updated server options to include MAC and IP addresses.
- Modified CMakeLists.txt to include the new HTTP server library and its dependencies.
- Enhanced websocket server to send additional information to clients.
- Updated ROS1 and ROS2 bridge implementations to integrate the new HTTP server.
- Introduced a new HTTP server class to handle device information requests. - Updated server options to include MAC and IP addresses. - Modified CMakeLists.txt to include the new HTTP server library and its dependencies. - Enhanced websocket server to send additional information to clients. - Updated ROS1 and ROS2 bridge implementations to integrate the new HTTP server.
bugbot run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: ROS1 Bridge Log Level Mapping Error
The HTTP server log handler in the ROS1 bridge incorrectly maps all log levels (Debug, Info, Warn, Error, Critical) to ROS_INFO. This causes warning, error, and critical messages to be logged as informational messages, masking important issues and making debugging difficult.
ros1_bridge/src/ros1_bridge_nodelet.cpp#L159-L178
cobridge/ros1_bridge/src/ros1_bridge_nodelet.cpp
Lines 159 to 178 in a8b088c
auto http_log_handler = [this](http_server::LogLevel level, const char * msg) { | |
switch (level) { | |
case http_server::LogLevel::Debug: | |
ROS_INFO("[HTTP_SERVER] %s", msg); | |
break; | |
case http_server::LogLevel::Info: | |
ROS_INFO("[HTTP_SERVER] %s", msg); | |
break; | |
case http_server::LogLevel::Warn: | |
ROS_INFO("[HTTP_SERVER] %s", msg); | |
break; | |
case http_server::LogLevel::Error: | |
ROS_INFO("[HTTP_SERVER] %s", msg); | |
break; | |
case http_server::LogLevel::Critical: | |
ROS_INFO("[HTTP_SERVER] %s", msg); | |
break; | |
} | |
}; |
Bug: HTTP Request Parsing Vulnerability
Unsafe HTTP request parsing in run_server
. If a malformed request does not contain "GET " or " HTTP/", std::string::find
returns npos
. Using npos
in subsequent calculations for path_start
(adding 4) and path_end
results in integer overflow and incorrect bounds for substr
, leading to crashes or undefined behavior.
http_server/src/http_server.cpp#L301-L304
cobridge/http_server/src/http_server.cpp
Lines 301 to 304 in a8b088c
std::string request(buffer); | |
size_t path_start = request.find("GET ") + 4; | |
size_t path_end = request.find(" HTTP/", path_start); | |
std::string path = request.substr(path_start, path_end - path_start); |
BugBot free trial expires on June 13, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
bugbot run |