Skip to content

Conversation

YunxianHua
Copy link
Collaborator

  • 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.

YunxianHua added 10 commits June 6, 2025 14:26
- 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.
@yujingz
Copy link
Contributor

yujingz commented Jun 6, 2025

bugbot run

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a 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

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;
}
};

Fix in Cursor


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

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);

Fix in Cursor


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 👎

@YunxianHua
Copy link
Collaborator Author

bugbot run

@YunxianHua YunxianHua marked this pull request as ready for review June 25, 2025 02:15
@YunxianHua YunxianHua requested a review from yujingz July 3, 2025 05:28
yujingz
yujingz previously approved these changes Jul 3, 2025
@YunxianHua YunxianHua merged commit a76cb10 into main Aug 19, 2025
7 checks passed
@YunxianHua YunxianHua deleted the feat/http-server branch August 19, 2025 02:23
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

Successfully merging this pull request may close these issues.

2 participants