Remote Code Execution Through Image Uploads in BookStack
Impact
A user could upload PHP files through image upload functions, which would allow them to execute code on the host system remotely. They would then have the permissions of the PHP process.
This most impacts scenarios where non-trusted users are given permission to upload images in any area of the application.
Patches
The issue was addressed in a series of patches: v0.25.3, v0.25.4 and v0.25.5. Users should upgrade to at least v0.25.5 to avoid this patch but ideally the latest BookStack version as previous versions are un-supported.
Workarounds
Depending on BookStack version, you could use the local_secure image storage option, or use s3 or a similar compatible service.
Preventing direct execution of any php files, apart from the public/index.php file, though web-server configuration would also prevent this.
References
BookStack Beta v0.25.3 BookStack Beta v0.25.4 BookStack Beta v0.25.5
For more information
If you have any questions or comments about this advisory:
- Open an issue in the BookStack GitHub repository.
- Ask on the BookStack Discord chat.
- Follow the BookStack Security advise to contact someone privately.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | ssddanbrown/bookstack | < 0.25.5 | 0.25.5 |
References
- https://github.com/BookStackApp/BookStack/security/advisories/GHSA-g9rq-x4fj-f5hx
- https://nvd.nist.gov/vuln/detail/CVE-2020-5256
- https://github.com/BookStackApp/BookStack/releases/tag/v0.25.3
- https://github.com/BookStackApp/BookStack/releases/tag/v0.25.4
- https://github.com/BookStackApp/BookStack/releases/tag/v0.25.5
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L- Weakness (CWE)
CWE-95- Platform
- Composer
- Package
ssddanbrown/bookstack- Disclosed
- 13.03.2020
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-g9rq-x4fj-f5hx - CC BY 4.0
Vulnerability history: ssddanbrown/bookstack
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 10
- First → latest
- 03.2020 07.2024
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 4
- Medium 5
- Low 1
Disclosures per year
- 2020: 2
- 2021: 4
- 2022: 3
- 2023: 0
- 2024: 1
- 2025: 0
- 2026: 0
-
Remote Code Execution Through Image Uploads in BookStack this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.