-
-
Notifications
You must be signed in to change notification settings - Fork 445
Closed
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the problem
Arduino CLI returns a segmentation violation bug during the compilation if preprocess flag is True and the sketch filename contains brackets (e.g. {filename}.ino).
If you are using Arduino CLI as a gRPC server or service, this bug leads to the server crash (DoS).
To reproduce
Tested on macOS.
How to reproduce:
- Enable arduino-cli gRPC server:
arduino-cli daemon --debug - Launch the bash script
arduino-cli-029-grpc-dos.sh(attached).
arduino-cli-029-grpc-dos.sh
grpcurl \
-plaintext \
-import-path ./rpc \
-proto cc/arduino/cli/commands/v1/commands.proto \
127.0.0.1:50051 \
cc.arduino.cli.commands.v1.ArduinoCoreService.Create
grpcurl \
-plaintext \
-import-path ./rpc \
-proto cc/arduino/cli/commands/v1/commands.proto \
-d '{"instance": {"id": 1}}' \
127.0.0.1:50051 \
cc.arduino.cli.commands.v1.ArduinoCoreService.Init
grpcurl \
-plaintext \
-import-path ./rpc \
-proto cc/arduino/cli/commands/v1/commands.proto \
-d '{"instance": {"id": 1}, "sketch_dir": "/tmp", "sketch_name": "{fooSketch}"}' \
127.0.0.1:50051 \
cc.arduino.cli.commands.v1.ArduinoCoreService.NewSketch
grpcurl \
-plaintext \
-import-path ./rpc \
-proto cc/arduino/cli/commands/v1/commands.proto \
-proto cc/arduino/cli/commands/v1/compile.proto \
-d '{"instance": {"id": 1}, "fqbn": "arduino:mbed_portenta:portenta_x8", "preprocess": true, "sketch_path": "/tmp/{fooSketch}/{fooSketch}.ino"}' \
127.0.0.1:50051 \
cc.arduino.cli.commands.v1.ArduinoCoreService.Compile
Expected behavior
The Arduino CLI should not crash, I guess.
Arduino CLI version
0.29
Operating system
macOS
Operating system version
13
Additional context
Video PoC
Kapture.2023-01-15.at.23.06.42.mp4
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details
Metadata
Metadata
Assignees
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project