Skip to content

Commit 0c29d4d

Browse files
fix(security): Use root htaccess to avoid files deletion in subfolder during plugin update
1 parent b120c04 commit 0c29d4d

File tree

14 files changed

+26
-50
lines changed

14 files changed

+26
-50
lines changed

.cache/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*
22
!.gitignore
3-
!.htaccess

.cache/.htaccess

Lines changed: 0 additions & 8 deletions
This file was deleted.

.htaccess

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Redirectmatch 403 wp-content/plugins/crowdsec/logs/
2+
Redirectmatch 403 wp-content/plugins/crowdsec/.cache/
3+
Redirectmatch 403 wp-content/plugins/crowdsec/tls/
4+
Redirectmatch 403 wp-content/plugins/crowdsec/geolocation/

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## [2.3.1](https://github.com/crowdsecurity/cs-wordpress-bouncer/releases/tag/v2.3.1) - 2023-04-06
9+
[_Compare with previous release_](https://github.com/crowdsecurity/cs-wordpress-bouncer/compare/v2.3.0...v2.3.1)
10+
11+
### Fixed
12+
13+
- Use root `.htaccess` instead of multiple subfolders `.htaccess`
14+
15+
16+
---
17+
18+
819
## [2.3.0](https://github.com/crowdsecurity/cs-wordpress-bouncer/releases/tag/v2.3.0) - 2023-04-06
920
[_Compare with previous release_](https://github.com/crowdsecurity/cs-wordpress-bouncer/compare/v2.2.0...v2.3.0)
1021

crowdsec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://github.com/crowdsecurity/cs-wordpress-bouncer
55
* Description: Safer Together. Protect your WordPress application with CrowdSec.
66
* Tags: crowdsec-bouncer, wordpress, security, firewall, captcha, ip-scanner, ip-blocker, ip-blocking, ip-address, ip-database, ip-range-check, crowdsec, ban-hosts, ban-management, anti-hacking, hacker-protection, captcha-image, captcha-generator, captcha-generation, captcha-service
7-
* Version: 2.3.0
7+
* Version: 2.3.1
88
* Author: CrowdSec
99
* Author URI: https://www.crowdsec.net/
1010
* Github: https://github.com/crowdsecurity/cs-wordpress-bouncer
@@ -13,7 +13,7 @@
1313
* Requires PHP: 7.2
1414
* Requires at least: 4.9
1515
* Tested up to: 6.2
16-
* Stable tag: 2.3.0
16+
* Stable tag: 2.3.1
1717
* Text Domain: crowdsec-wp
1818
* First release: 2021.
1919
*/

docs/USER_GUIDE.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,13 @@ server {
530530

531531
#### Apache
532532

533-
If you are using Apache, these folders already contain the required `.htaccess` file:
533+
If you are using Apache, the plugin root folder already contain the required `.htaccess` file:
534534

535535
```
536-
<IfVersion < 2.4>
537-
order allow,deny
538-
deny from all
539-
</IfVersion>
540-
<IfVersion >= 2.4>
541-
Require all denied
542-
</IfVersion>
536+
Redirectmatch 403 wp-content/plugins/crowdsec/logs/
537+
Redirectmatch 403 wp-content/plugins/crowdsec/.cache/
538+
Redirectmatch 403 wp-content/plugins/crowdsec/tls/
539+
Redirectmatch 403 wp-content/plugins/crowdsec/geolocation/
543540
```
544541

545542
So you don't have to do anything more.

geolocation/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*
22
!.gitignore
3-
!.htaccess

geolocation/.htaccess

Lines changed: 0 additions & 8 deletions
This file was deleted.

inc/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Constants extends LibConstants
2020
public const LOG_BASE_PATH = __DIR__ . '/../logs/';
2121
public const CACHE_PATH = __DIR__ . '/../.cache';
2222
public const CONFIG_PATH = __DIR__ . '/standalone-settings.php';
23-
public const VERSION = 'v2.3.0';
23+
public const VERSION = 'v2.3.1';
2424
public const GEOLOCATION_DIR = __DIR__ . '/../geolocation';
2525
public const TLS_DIR = __DIR__ . '/../tls';
2626
}

logs/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*
2-
!.gitignore
3-
!.htaccess
2+
!.gitignore

0 commit comments

Comments
 (0)