Saving a script causes an empty response. #1459

Closed
opened 2026-02-05 00:58:32 +03:00 by OVERLORD · 8 comments
Owner

Originally created by @uwbfortner on GitHub (Nov 19, 2019).

When editing a page, pasting in a certain SQL statement or bash script will cause the page to error out with an empty response.

Steps to reproduce the behavior:

  1. Create a new page.
  2. Paste this code:

sqlite3 /home/pi/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);";

  1. Save the page.

The only format this will work in is a block quote. Paragraph or code block will cause the error.

Configuration (please complete the following information):

  • BookStack v0.27.5
  • PHP Version: 7.2.24
  • Apache 2.4

Thank you

Originally created by @uwbfortner on GitHub (Nov 19, 2019). When editing a page, pasting in a certain SQL statement or bash script will cause the page to error out with an empty response. Steps to reproduce the behavior: 1. Create a new page. 2. Paste this code: sqlite3 /home/pi/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);"; 3. Save the page. The only format this will work in is a block quote. Paragraph or code block will cause the error. Configuration (please complete the following information): - BookStack v0.27.5 - PHP Version: 7.2.24 - Apache 2.4 Thank you
Author
Owner

@james-geiger commented on GitHub (Nov 19, 2019):

Hi @uwbfortner,

Which editor are you using, WYSIWYG or Markdown? Is there any additional output that occurs when you save the page (e.g. 500) or does the entire page return blank?

Any additional information you can provide would be helpful as I haven't been able to replicate this issue on my instance.

@james-geiger commented on GitHub (Nov 19, 2019): Hi @uwbfortner, Which editor are you using, WYSIWYG or Markdown? Is there any additional output that occurs when you save the page (e.g. 500) or does the entire page return blank? Any additional information you can provide would be helpful as I haven't been able to replicate this issue on my instance.
Author
Owner

@lommes commented on GitHub (Nov 19, 2019):

Are you using mod_security in apache? (#555 )

@lommes commented on GitHub (Nov 19, 2019): Are you using mod_security in apache? ([#555](https://github.com/BookStackApp/BookStack/issues/555#issuecomment-344493193) )
Author
Owner

@uwbfortner commented on GitHub (Nov 19, 2019):

Happens in WYSIWYG or Markdown editor. We are not running mod_security. The page doesn't return an actual error rather an empty response.

Chrome says ERR_EMPTY_REPONSE while Firefox says the connection was reset.

@uwbfortner commented on GitHub (Nov 19, 2019): Happens in WYSIWYG or Markdown editor. We are not running mod_security. The page doesn't return an actual error rather an empty response. Chrome says ERR_EMPTY_REPONSE while Firefox says the connection was reset.
Author
Owner

@lommes commented on GitHub (Nov 19, 2019):

Are you unsing any other web application firewall?

I'm not familiar with the latest changes in bookstack regarding escaping of user input but know this behaviour from other apps and some WAF.

@lommes commented on GitHub (Nov 19, 2019): Are you unsing any other web application firewall? I'm not familiar with the latest changes in bookstack regarding escaping of user input but know this behaviour from other apps and some WAF.
Author
Owner

@uwbfortner commented on GitHub (Nov 20, 2019):

Are you unsing any other web application firewall?

I'm not familiar with the latest changes in bookstack regarding escaping of user input but know this behaviour from other apps and some WAF.

No firewall. If no one else can reproduce the issue it must be something to do with our configuration somewhere. I will keep trying to pinpoint the problem.

@uwbfortner commented on GitHub (Nov 20, 2019): > Are you unsing any other web application firewall? > > I'm not familiar with the latest changes in bookstack regarding escaping of user input but know this behaviour from other apps and some WAF. No firewall. If no one else can reproduce the issue it must be something to do with our configuration somewhere. I will keep trying to pinpoint the problem.
Author
Owner

@ssddanbrown commented on GitHub (Nov 21, 2019):

Very odd. Googling the chrome response in relation to Laravel has led to a few results where opcache has caused such problems.

Worth giving that a go, Finding your php.ini and setting:

opcache.enable=0
@ssddanbrown commented on GitHub (Nov 21, 2019): Very odd. Googling the chrome response in relation to Laravel has led to a few results where opcache has caused such problems. Worth giving that a go, Finding your php.ini and setting: ```ini opcache.enable=0 ```
Author
Owner

@uwbfortner commented on GitHub (Nov 22, 2019):

Very odd. Googling the chrome response in relation to Laravel has led to a few results where opcache has caused such problems.

Worth giving that a go, Finding your php.ini and setting:

opcache.enable=0

We don't use opcache on this server. Thank you for the input however. It is a very odd issue.

@uwbfortner commented on GitHub (Nov 22, 2019): > Very odd. Googling the chrome response in relation to Laravel has led to a few results where opcache has caused such problems. > > Worth giving that a go, Finding your php.ini and setting: > > ```ini > opcache.enable=0 > ``` We don't use opcache on this server. Thank you for the input however. It is a very odd issue.
Author
Owner

@ssddanbrown commented on GitHub (Jul 12, 2020):

I'm going to close this now since it looks like the conversation dropped off.
If it's still an issue, I'd recommend opening a new issue, referencing this one, with as much detail of your BookStack environment as possible (Hardware, Network, Operating System, Software on Host) in the hope that someone may be able to replicate the environment.

@ssddanbrown commented on GitHub (Jul 12, 2020): I'm going to close this now since it looks like the conversation dropped off. If it's still an issue, I'd recommend opening a new issue, referencing this one, with as much detail of your BookStack environment as possible (Hardware, Network, Operating System, Software on Host) in the hope that someone may be able to replicate the environment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1459