GHSA-ghvf-qf6h-g8x5: NocoBase: Arbitrary File Write chained with Local file Inclusion leads to Remote code execution
Two vulnerabilities were identified and chained to achieve authenticated remote code execution
The first vulnerability allows any authenticated admin to redirect the file upload storage root to an arbitrary path on disk including the application directory itself by supplying an unsanitized documentRoot value to the storages:update API. The second vulnerability allows the same admin to trigger Node.js require() on any absolute filesystem path via the pm:enable plugin manager endpoint, which accepts user-supplied paths with no validation (Local File Inclusion).
Chained together, these two flaws allow an attacker with admin credentials to write a malicious file and have it trigger on the system achieving remote code execution.
A working proof-of-concept exploit chain was developed and verified, requiring only a valid admin session token.
The file-manager plugin’s storage update endpoint accepts an arbitrary documentRoot value without validation. An authenticated admin can overwrite a storage record’s documentRoot to any absolute path on the filesystem, then upload files that land anywhere the Node.js process (root in default Docker deployments) can write including the web root, the application source directory, or system paths.
References
- github.com/advisories/GHSA-ghvf-qf6h-g8x5
- github.com/nocobase/nocobase/commit/7c9ffe1427a529d62576b83c35222ba7ef9b8d11
- github.com/nocobase/nocobase/commit/a89e5a999b608bcb4ec67a845e924af0fb58a7c7
- github.com/nocobase/nocobase/pull/9628
- github.com/nocobase/nocobase/pull/9701
- github.com/nocobase/nocobase/security/advisories/GHSA-ghvf-qf6h-g8x5
Code Behaviors & Features
Detect and mitigate GHSA-ghvf-qf6h-g8x5 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →