Skip to content

Commit 53d2ffc

Browse files
committed
fix: address CI lint and textlint errors in Feature Flag test case
Changes: - Fix MD029: Use consistent ordered list prefixes (1. instead of 1/2/3) - Fix MD012: Remove extra blank line at end of file - Fix textlint: Change "back-end" to "backend" (4 occurrences) - Fix textlint: Change "local storage" to "localStorage" (3 occurrences) - Fix broken link: Update LaunchDarkly docs URL Signed-off-by: Ahmed Adel Bakr Alderai <bakr.alderai@gmail.com>
1 parent 95fa29b commit 53d2ffc

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/15-Test_for_Feature_Flag_Security_Bypass.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Feature flags (also known as feature toggles, feature switches, or feature gates
1111
Common security issues with feature flags include:
1212

1313
- **Client-side manipulation**: Flags evaluated in the browser can be modified by attackers to enable restricted features.
14-
- **Authorization bypass**: Hidden UI elements may still have accessible back-end endpoints.
14+
- **Authorization bypass**: Hidden UI elements may still have accessible backend endpoints.
1515
- **Information disclosure**: Flag configurations may leak unreleased features or internal logic.
1616
- **Insecure defaults**: Fallback values when the flag service is unavailable may fail open.
1717
- **Stale flag vulnerabilities**: Unused flags referencing deprecated code paths may contain unpatched vulnerabilities.
@@ -22,7 +22,7 @@ Modern applications increasingly rely on feature flag services (LaunchDarkly, Sp
2222

2323
- Identify feature flags that gate security-relevant functionality.
2424
- Assess whether feature flag states can be manipulated client-side.
25-
- Verify that back-end authorization is independent of flag state.
25+
- Verify that backend authorization is independent of flag state.
2626
- Determine if flag configurations expose sensitive information.
2727
- Evaluate fail-safe behavior when the flag service is unavailable.
2828

@@ -44,7 +44,7 @@ splitio
4444
flagsmith
4545
```
4646

47-
2. **Monitor network traffic** for requests to feature flag endpoints:
47+
1. **Monitor network traffic** for requests to feature flag endpoints:
4848

4949
```http
5050
GET /api/features HTTP/1.1
@@ -62,7 +62,7 @@ Content-Type: application/json
6262
}
6363
```
6464

65-
3. **Examine local storage and cookies** for cached flag values.
65+
1. **Examine localStorage and cookies** for cached flag values.
6666

6767
### Test Client-Side Flag Manipulation
6868

@@ -78,7 +78,7 @@ Attempt to modify flag values to enable restricted features:
7878
{"admin_mode": true}
7979
```
8080

81-
2. **Modify local storage**: If flags are cached client-side, change the values directly.
81+
1. **Modify localStorage**: If flags are cached client-side, change the values directly.
8282

8383
```javascript
8484
// In browser console
@@ -88,11 +88,11 @@ localStorage.setItem('featureFlags', JSON.stringify({
8888
}));
8989
```
9090

91-
3. **Observe application behavior**: Determine if the application grants access to functionality that should be restricted.
91+
1. **Observe application behavior**: Determine if the application grants access to functionality that should be restricted.
9292

9393
### Verify Backend Authorization Independence
9494

95-
Ensure back-end endpoints enforce authorization independently of flag state:
95+
Ensure backend endpoints enforce authorization independently of flag state:
9696

9797
1. **Identify hidden endpoints**: Extract API endpoints from JavaScript bundles that are associated with disabled features.
9898

@@ -101,7 +101,7 @@ Ensure back-end endpoints enforce authorization independently of flag state:
101101
grep -oE '/api/v[0-9]+/[a-zA-Z_]+' bundle.js
102102
```
103103

104-
2. **Send direct requests**: Attempt to access endpoints for disabled features.
104+
1. **Send direct requests**: Attempt to access endpoints for disabled features.
105105

106106
```http
107107
POST /api/admin/users/delete HTTP/1.1
@@ -112,7 +112,7 @@ Content-Type: application/json
112112
{"user_id": "12345"}
113113
```
114114

115-
3. **Expected result**: The server should return `403 Forbidden` if the feature is disabled, not just hide the UI.
115+
1. **Expected result**: The server should return `403 Forbidden` if the feature is disabled, not just hide the UI.
116116

117117
### Test Fallback Behavior
118118

@@ -126,9 +126,9 @@ Evaluate what happens when the feature flag service is unavailable:
126126
127.0.0.1 app.split.io
127127
```
128128

129-
2. **Observe fallback behavior**: Determine if the application fails open (enables features) or fails closed (disables features).
129+
1. **Observe fallback behavior**: Determine if the application fails open (enables features) or fails closed (disables features).
130130

131-
3. **Security-critical result**: Features gating security controls should default to disabled when the flag service is unreachable.
131+
1. **Security-critical result**: Features gating security controls should default to disabled when the flag service is unreachable.
132132

133133
### Analyze Flag Configuration for Information Leakage
134134

@@ -140,7 +140,7 @@ Examine flag payloads for sensitive information:
140140
- Targeting rules containing email domains or user identifiers
141141
- Environment-specific configurations
142142

143-
2. **Example of information leakage**:
143+
1. **Example of information leakage**:
144144

145145
```json
146146
{
@@ -157,8 +157,8 @@ Examine flag payloads for sensitive information:
157157
Identify and test unused flags that may expose deprecated functionality:
158158

159159
1. **Map all flags** and their creation dates if available.
160-
2. **Force-enable old flags** and observe if deprecated code paths are accessible.
161-
3. **Assess deprecated code** for known vulnerabilities or security weaknesses.
160+
1. **Force-enable old flags** and observe if deprecated code paths are accessible.
161+
1. **Assess deprecated code** for known vulnerabilities or security weaknesses.
162162

163163
## Remediation
164164

@@ -180,11 +180,10 @@ For more details, see:
180180

181181
- [Burp Suite](https://portswigger.net/burp) - Intercept and modify HTTP traffic
182182
- [OWASP ZAP](https://www.zaproxy.org/) - Web application security testing
183-
- Browser Developer Tools - Network inspection and local storage modification
183+
- Browser Developer Tools - Network inspection and localStorage modification
184184

185185
## References
186186

187187
- [Feature Toggles (aka Feature Flags) - Martin Fowler](https://martinfowler.com/articles/feature-toggles.html)
188-
- [LaunchDarkly Security Best Practices](https://docs.launchdarkly.com/home/security)
188+
- [LaunchDarkly Account Security](https://launchdarkly.com/docs/home/account/secure)
189189
- [OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/)
190-

0 commit comments

Comments
 (0)