You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(README): update features and usage sections for clarity and consistency
docs(README): improve formatting and add examples for ALLOW_COMMANDS variable
docs(README): enhance development setup instructions and add license section
The `ALLOW_COMMANDS` environment variable specifies which commands are allowed to be executed.
26
+
The `ALLOW_COMMANDS` environment variable specifies which commands are allowed to be executed. Commands can be separated by commas with optional spaces around them.
35
27
36
-
### Making Requests
28
+
Valid formats for ALLOW_COMMANDS:
29
+
```bash
30
+
ALLOW_COMMANDS="ls,cat,echo"# Basic format
31
+
ALLOW_COMMANDS="ls ,echo, cat"# With spaces
32
+
ALLOW_COMMANDS="ls, cat , echo"# Multiple spaces
33
+
```
37
34
38
-
Example requests to the server:
35
+
### Request Format
39
36
40
37
```python
41
38
# Basic command execution
@@ -53,7 +50,6 @@ Example requests to the server:
53
50
### Response Format
54
51
55
52
Successful response:
56
-
57
53
```json
58
54
{
59
55
"stdout": "command output",
@@ -64,7 +60,6 @@ Successful response:
64
60
```
65
61
66
62
Error response:
67
-
68
63
```json
69
64
{
70
65
"error": "Command not allowed: rm",
@@ -80,35 +75,54 @@ Error response:
80
75
The server implements several security measures:
81
76
82
77
1.**Command Whitelisting**: Only explicitly allowed commands can be executed
83
-
2.**Shell Operator Validation**: Commands after shell operators are also validated against the whitelist
78
+
2.**Shell Operator Validation**: Commands after shell operators (;, &&, ||, |) are also validated against the whitelist
84
79
3.**No Shell Injection**: Commands are executed directly without shell interpretation
85
80
86
-
## Environment Variables
81
+
## Development
87
82
88
-
*`ALLOW_COMMANDS`: Comma-separated list of allowed commands (e.g., "ls, cat, echo")
0 commit comments