Skip to content

Environment variables need to be escaped #488

Closed
@jeaye

Description

@jeaye

Variables like POSTGRES_PASSWORD may contain ' or $, which will cause bash to intercept them and open the door to errors. This is an injection problem, yes, but it's also just a convenience problem. Lots of secure (randomly generated) passphrases use quotes and dollar signs.

database_1   | 2018-08-23 20:20:50.925 UTC [66] ERROR:  unrecognized role option "fun" at character 52
database_1   | 2018-08-23 20:20:50.925 UTC [66] STATEMENT:  CREATE USER "zulip" WITH SUPERUSER PASSWORD 'zulip'fun' ;
database_1   | ERROR:  unrecognized role option "fun"
database_1   | LINE 1: CREATE USER "zulip" WITH SUPERUSER PASSWORD 'zulip'fun' ;
database_1   |                                                            ^

This issue originally comes from zulip/docker-zulip#143 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions