Skip to content

Commit 320cbd1

Browse files
authored
feat(plugins): deny access to .txt and .md files in plugin directories (#1625)
1 parent 7377a7b commit 320cbd1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

roles/wordpress-setup/templates/wordpress-site.conf.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ server {
170170
}
171171
{% endblock %}
172172

173+
{% block plugin_theme_docs_files -%}
174+
# Block .txt and .md files in plugins, mu-plugins, and themes directories to prevent version disclosure
175+
location ~* /app/(plugins|mu-plugins|themes)/.+\.(txt|md)$ {
176+
deny all;
177+
}
178+
{% endblock %}
179+
173180
{% block location_primary -%}
174181
location / {
175182
try_files $uri $uri/ /index.php?$args;

0 commit comments

Comments
 (0)