Spaces in bot names not escaped #318

Closed
opened 2026-04-05 20:26:47 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @ccMatrix on 11/16/2023

CloudPanel version(s) affected

2.3.2

Description

When adding bots to block to a site an nginx regex is created. If the bot name contains a space like in "evil bot" then the regex will be broken.

image

How to reproduce

Go to site security tab and add a bot with a space e.g. "test bot".
Then go to vhost and just save it to run the nginx -t command and it will show the erro.

Possible Solution

Escape the space with \s when writing it to the nginx configuration on disk

Additional Context

No response

*Originally created by @ccMatrix on 11/16/2023* ### CloudPanel version(s) affected 2.3.2 ### Description When adding bots to block to a site an nginx regex is created. If the bot name contains a space like in "evil bot" then the regex will be broken. ![image](https://github.com/cloudpanel-io/cloudpanel-ce/assets/96917/3ae6d46a-9a9d-4b25-a05b-47a98abef655) ### How to reproduce Go to site security tab and add a bot with a space e.g. "test bot". Then go to vhost and just save it to run the nginx -t command and it will show the erro. ### Possible Solution Escape the space with `\s` when writing it to the nginx configuration on disk ### Additional Context _No response_
Sign in to join this conversation.