{"id":"GHSA-g9rq-x4fj-f5hx","summary":"Remote Code Execution Through Image Uploads in BookStack","details":"### Impact\n\nA 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.\n\nThis most impacts scenarios where non-trusted users are given permission to upload images in any area of the application. \n\n### Patches\n\nThe issue was addressed in a series of patches: v0.25.3, v0.25.4 and v0.25.5.\nUsers should upgrade to at least v0.25.5 to avoid this patch but ideally the latest BookStack version as previous versions are un-supported.\n\n### Workarounds\n\nDepending on BookStack version, you could use the [local_secure](https://www.bookstackapp.com/docs/admin/upload-config/#local-secure) image storage option, or use s3 or a similar compatible service.\n\nPreventing direct execution of any `php` files, apart from the `public/index.php` file, though web-server configuration would also prevent this.\n\n### References\n\n[BookStack Beta v0.25.3](https://github.com/BookStackApp/BookStack/releases/tag/v0.25.3)\n[BookStack Beta v0.25.4](https://github.com/BookStackApp/BookStack/releases/tag/v0.25.4)\n[BookStack Beta v0.25.5](https://github.com/BookStackApp/BookStack/releases/tag/v0.25.5)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [the BookStack GitHub repository](BookStackApp/BookStack/issues).\n* Ask on the [BookStack Discord chat](https://discord.gg/ztkBqR2).\n* Follow the [BookStack Security advise](https://github.com/BookStackApp/BookStack#-security) to contact someone privately.","aliases":["CVE-2020-5256"],"modified":"2026-05-07T05:01:12.986143462Z","published":"2020-03-13T20:21:27Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2020-03-13T20:20:25Z","nvd_published_at":null,"cwe_ids":["CWE-95"],"severity":"HIGH"},"references":[{"type":"WEB","url":"https://github.com/BookStackApp/BookStack/security/advisories/GHSA-g9rq-x4fj-f5hx"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-5256"},{"type":"WEB","url":"https://github.com/BookStackApp/BookStack/releases/tag/v0.25.3"},{"type":"WEB","url":"https://github.com/BookStackApp/BookStack/releases/tag/v0.25.4"},{"type":"WEB","url":"https://github.com/BookStackApp/BookStack/releases/tag/v0.25.5"}],"affected":[{"package":{"name":"ssddanbrown/bookstack","ecosystem":"Packagist","purl":"pkg:composer/ssddanbrown/bookstack"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.25.5"}]}],"versions":["0.7.2","V0.7.5","v0.10.0","v0.11.0","v0.11.1","v0.11.2","v0.12.0","v0.12.1","v0.12.2","v0.13.0","v0.13.1","v0.14.0","v0.14.1","v0.14.2","v0.14.3","v0.15.0","v0.15.1","v0.15.2","v0.15.3","v0.16.0","v0.16.1","v0.16.2","v0.16.3","v0.17.0","v0.17.1","v0.17.2","v0.17.3","v0.17.4","v0.18.0","v0.18.1","v0.18.2","v0.18.3","v0.18.4","v0.18.5","v0.19.0","v0.20.0","v0.20.1","v0.20.2","v0.20.3","v0.21.0","v0.22.0","v0.23.0","v0.23.1","v0.23.2","v0.24.0","v0.24.1","v0.24.2","v0.24.3","v0.25.0","v0.25.1","v0.25.2","v0.25.3","v0.25.4","v0.5.0","v0.6.0","v0.6.1","v0.6.2","v0.6.3","v0.7.0","v0.7.3","v0.7.4","v0.7.6","v0.8.0","v0.8.1","v0.8.2","v0.9.0","v0.9.1","v0.9.2","v0.9.3"],"database_specific":{"last_known_affected_version_range":"\u003c 0.25.3","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/03/GHSA-g9rq-x4fj-f5hx/GHSA-g9rq-x4fj-f5hx.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L"}]}