Skip to content

Commit

Permalink
Update rule metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
saberduck authored and andrey-tyukin-sonarsource committed Aug 21, 2020
1 parent d538360 commit 3024015
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ <h2>Compliant Solution</h2>
</pre>
<h2>See</h2>
<ul>
<li> MISRA C:2004, 13.7 - Boolean operations whose results are invariant shall not be permitted. </li>
<li> MISRA C:2012, 14.3 - Controlling expressions shall not be invariant </li>
<li> <a href="http://cwe.mitre.org/data/definitions/571">MITRE, CWE-571</a> - Expression is Always True </li>
<li> <a href="http://cwe.mitre.org/data/definitions/570">MITRE, CWE-570</a> - Expression is Always False </li>
<li> <a href="http://cwe.mitre.org/data/definitions/489">MITRE, CWE-489</a> - Leftover Debug Code </li>
<li> <a href="https://www.securecoding.cert.org/confluence/x/NYA5">CERT, MSC12-C.</a> - Detect and remove code that has no effect or is never
executed </li>
</ul>

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<p>These minimum restrictions should be applied when handling file uploads:</p>
<p>- the file upload folder to restrict untrusted files to a specific folder.</p>
<p>- the file extension of the uploaded file to prevent remote code execution.</p>
<ul>
<li> the file upload folder to restrict untrusted files to a specific folder. </li>
<li> the file extension of the uploaded file to prevent remote code execution. </li>
</ul>
<p>Also the size of the uploaded file should be limited to prevent denial of service attacks. This requirement is covered by the rule S5693.</p>
<h2>Noncompliant Code Example</h2>
<p><a href="https://www.npmjs.com/package/formidable">formidable</a> module:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>Ask Yourself Whether</h2>
<li> input received from sockets is used without being sanitized. </li>
<li> sensitive data is sent via sockets without being encrypted. </li>
</ul>
<p>You are at risk if you answered yes to any of these questions.</p>
<p>There is a risk if you answered yes to any of those questions.</p>
<h2>Recommended Secure Coding Practices</h2>
<ul>
<li> In many cases there is no need to open a socket yourself. Use instead libraries and existing protocols. </li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"S4829",
"S5122",
"S5689",
"S5691"
"S5691",
"S5693"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"S4829",
"S5122",
"S5689",
"S5691"
"S5691",
"S5693"
]
}
2 changes: 1 addition & 1 deletion sonarpedia.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languages": [
"JS"
],
"latest-update": "2020-07-09T07:43:58.942706Z",
"latest-update": "2020-08-21T11:27:42.731721Z",
"options": {
"no-language-in-filenames": true,
"preserve-filenames": true
Expand Down

0 comments on commit 3024015

Please sign in to comment.