Repository navigation
Conversation
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
vitormattos
left a comment
There was a problem hiding this comment.
The security issue identified here is valid, but I don't think this fix should live only in LibreSign/saas.
The PHP execution behavior comes from LibreCodeCoop/wordpress-docker, and the proposed vendor / vendor-bin restriction is generic WordPress runtime hardening rather than LibreSign SaaS-specific configuration. I think this should be implemented upstream in wordpress-docker, ideally with security tests covering plugin/theme vendor directories and vendor-bin.
While reviewing this, I also noticed a related architectural problem: saas currently replaces the entire nginx default.conf. Because of that, it has already diverged from upstream and is missing protections that wordpress-docker now has, including the XML-RPC hardening include and the rule denying PHP execution under wp-content/uploads.
So I think we should:
- move this hardening to
LibreCodeCoop/wordpress-docker; - add the corresponding tests there;
- update the
wordpress-dockersubmodule here; - avoid maintaining a full copy of the upstream nginx config in
saasjust to apply SaaS-specific overrides such asclient_max_body_size.
The vulnerability itself should definitely be fixed, but merging this as-is would solve it only locally while keeping the configuration drift that caused us to miss other upstream security changes.
|
Thanks, @vitormattos I moved the fix upstream and split it in two PRs:
Once both are merged, I'll update this PR to bump the submodule, drop While checking this I found that XML-RPC isn't actually blocked in saas today. |
The nginx of the WordPress stack runs any
.phpfile under the web root. The test suites of the LibreSign plugins and theme install a complete WordPress, the WordPress test suite and WooCommerce intovendor/inside their own folder, which is underwp-content/in this stack. After acomposer installthere,http://localhost/wp-content/themes/libresign/vendor/wordpress/wp-admin/setup-config.phpopened a fresh WordPress installer, and the port is bound to all interfaces, so anyone on the network could point it at their own database and run code in the container. The same happened with the plugins that have that suite, such aswoocommerce-restrict-switch.This denies running PHP from any
vendor/orvendor-bin/folder underwp-content/. Static files there are still served.Verification
With the rule loaded on the local stack:
woocommerce-restrict-switch, and forplugins/woocommerce/vendor/autoload.php, also with the path in upper case, with./and with%76endor./lost-password/,wp-login.php, the theme and WooCommerce stylesheets, and the admin pages (dashboard, WooCommerce settings, products, Site Editor).vendor/folder.