Skip to content

Commit ea49c4d

Browse files
authored
docs: Fix typos in documentation (#74)
arbitary -> arbitrary symplicity -> simplicity concatentation -> concatenation devestating -> devastating
1 parent 6c64dcb commit ea49c4d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ More information: https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)
6565

6666
#### `detect-eval-with-expression`
6767

68-
Detects `eval(variable)` which can allow an attacker to run arbitary code inside your process.
68+
Detects `eval(variable)` which can allow an attacker to run arbitrary code inside your process.
6969

7070
More information: http://security.stackexchange.com/questions/94017/what-are-the-security-issues-with-eval-in-javascript
7171

docs/avoid-command-injection-node.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this post we are going to learn about the proper way to call a system command using node.js to avoid a common security flaw, command injection.
44

5-
A call that we often see used, due to it's symplicity is `child_process.exec`. It's got a simple pattern; pass in a command string and it calls you back with an error or the command results.
5+
A call that we often see used, due to it's simplicity is `child_process.exec`. It's got a simple pattern; pass in a command string and it calls you back with an error or the command results.
66

77
Here is a very typical way you would call a system command with `child_process.exec.`
88

@@ -12,7 +12,7 @@ child_process.exec('ls', function (err, data) {
1212
});
1313
```
1414

15-
What happens though when you need to start getting user input for arguments into your command? The obvious solution is to take the user input and build your command out using string concatenation. But here's something I've learned over the years: When you use string concatentation to send data from one system to another you're probably going to have a bad day.
15+
What happens though when you need to start getting user input for arguments into your command? The obvious solution is to take the user input and build your command out using string concatenation. But here's something I've learned over the years: When you use string concatenation to send data from one system to another you're probably going to have a bad day.
1616

1717
```js
1818
var path = "user input";
@@ -23,7 +23,7 @@ child_process.exec('ls -l ' + path, function (err, data) {
2323

2424
## Why is string concatenation a problem?
2525

26-
Well, because under the hood, `child_process.exec` makes a call to execute <kbd>/bin/sh</kbd> rather than the target program. The command that was sent just gets passed along as a shell command in the newly spawned <kbd>/bin/sh</kbd> process. `child_process.exec` has a misleading name - it's a bash interpreter, not a program launcher. And that means that all shell metacharacters can have devestating effects if the command is including user input.
26+
Well, because under the hood, `child_process.exec` makes a call to execute <kbd>/bin/sh</kbd> rather than the target program. The command that was sent just gets passed along as a shell command in the newly spawned <kbd>/bin/sh</kbd> process. `child_process.exec` has a misleading name - it's a bash interpreter, not a program launcher. And that means that all shell metacharacters can have devastating effects if the command is including user input.
2727

2828
```sh
2929
[pid 25170] execve("/bin/sh", ["/bin/sh", "-c", "ls -l user input"], [/* 16 vars */]

0 commit comments

Comments
 (0)