Description
What happened:
When setting Chromium launch arguments through the RENDERING_ARGS environment variable, if an argument contains a comma ,
, such as --host-resolver-rules=MAP fonts.googleapis.com 127.0.0.1, MAP fonts.gstatic.com 127.0.0.1
, the arguments are incorrectly split.
What you expected to happen:
Arguments passed through RENDERING_ARGS should be parsed safely even if they contain commas. Chromium should launch properly without splitting important arguments, and the renderer service should start successfully.
How to reproduce it (as minimally and precisely as possible):
- Set the RENDERING_ARGS environment variable with Chromium flags, including
--host-resolver-rules
that contains a comma:
--no-sandbox,--disable-setuid-sandbox,--host-resolver-rules=MAP fonts.googleapis.com 127.0.0.1, MAP fonts.gstatic.com 127.0.0.1
- Start the Grafana Image Renderer service.
- Observe that the renderer fails to launch Chromium properly and crashes.
Anything else we need to know?:
The splitting logic inside the image renderer code incorrectly splits RENDERING_ARGS by commas without considering quoted arguments or escaping.
It is impossible to pass certain valid Chromium arguments (like --host-resolver-rules) safely without modifying the code.
A better approach would be to split the environment variable by newlines or provide another structured way to pass arguments (e.g., JSON array).
Environment:
Grafana Image Renderer version: Latest and any.
Grafana version: 10.x/11.x
Installed plugin or remote renderer service: Remote renderer service.
OS Grafana Image Renderer is installed on: Linux/Windows/Mac
User OS & Browser: N/A
Others: N/A
Metadata
Metadata
Assignees
Labels
Type
Projects
Status