# Discourse\_docker: discourse-setup makes sed parse SMTP password

**URL:** <https://meta.discourse.org/t/discourse-docker-discourse-setup-makes-sed-parse-smtp-password/73390>\
**Category:** Bug\
**Created:** [3 Noviembre, 2017 21:06 UTC](https://meta.discourse.org/t/discourse-docker-discourse-setup-makes-sed-parse-smtp-password/73390 "2017-11-03T21:06:57Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [3 Noviembre, 2017 21:42 UTC](https://meta.discourse.org/t/discourse-docker-discourse-setup-makes-sed-parse-smtp-password/73390/5 "2017-11-03T21:42:26Z")

</div>

> [@tomreyn](#):
>
> discourse-setup uses sed to place the user provided SMTP password in the configuration file. The user input is used as a regular expression by sed (-e) there, while it is really just a plain text string.
> 
> This works as long as the password does not contain any characters which sed would interpret as an expression / command.
> 
> When it fails to work, the user may get to see a sed error message in the discourse-setup output, and installation may fail.

Yeah. That all seems true. It’s fragile that way.

> [@tomreyn](#):
>
> This is potentially a security issue, since sed might end up executing the input string (///e).

That would require someone who is giving an admin an SMTP password to be evil, but you never know.

I suppose I should do this:

> <https://stackoverflow.com/questions/407523/escape-a-string-for-a-sed-replace-pattern/407649#407649>

---

_[View the full topic](https://meta.discourse.org/t/discourse-docker-discourse-setup-makes-sed-parse-smtp-password/73390)._
