[GH-ISSUE #1196] Handle spaces in unquoted env variables #844

Closed
opened 2026-03-03 02:03:52 +03:00 by kerem · 0 comments
Owner

Originally created by @xoxys on GitHub (Oct 21, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1196

Subject of the issue

Spaces in an unquoted env variable value will stop processing every following env var which may result in various errors.

Your environment

  • Bitwarden_rs version: 1.17.0
  • Install method: Custom Docker Image

Steps to reproduce

Add a space to an env var value:

SMTP_FROM_NAME=Bitwarden RS                
SMTP_USERNAME=relay@example.com       
SMTP_PASSWORD=1234567                       
SMTP_AUTH_MECHANISM=plain                   
SMTP_TIMEOUT=30

Check the loaded values in the admin dashboard. All settings after SMTP_FROM_NAME will not be applied anymore. Quoting the value will fix the issue e.g. SMTP_FROM_NAME="Bitwarden RS".

Expected behaviour

Some kind of improved error handling. Add a variable parsing error message to the log, or fix it automatically and strip off everything after a space. Maybe we could still have a warning in the logs that var EXAMPLE was stripped.

Originally created by @xoxys on GitHub (Oct 21, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1196 ### Subject of the issue Spaces in an unquoted env variable value will stop processing every following env var which may result in various errors. ### Your environment * Bitwarden_rs version: 1.17.0 * Install method: Custom Docker Image ### Steps to reproduce Add a space to an env var value: ``` SMTP_FROM_NAME=Bitwarden RS SMTP_USERNAME=relay@example.com SMTP_PASSWORD=1234567 SMTP_AUTH_MECHANISM=plain SMTP_TIMEOUT=30 ``` Check the loaded values in the admin dashboard. All settings after `SMTP_FROM_NAME` will not be applied anymore. Quoting the value will fix the issue e.g. `SMTP_FROM_NAME="Bitwarden RS"`. ### Expected behaviour Some kind of improved error handling. Add a variable parsing error message to the log, or fix it automatically and strip off everything after a space. Maybe we could still have a warning in the logs that var `EXAMPLE` was stripped.
kerem 2026-03-03 02:03:52 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#844
No description provided.