Skip to content

Commit f6b7aea

Browse files
committed
Rust: Add prototype query.
1 parent 5eac0f7 commit f6b7aea

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @name Disabled TLS certificate check
3+
* @description If an application disables TLS certificate checking, it may be vulnerable to
4+
* man-in-the-middle attacks.
5+
* @kind problem
6+
* @problem.severity warning
7+
* @security-severity 7.5
8+
* @precision high
9+
* @id rust/disabled-certificate-check
10+
* @tags security
11+
* external/cwe/cwe-295
12+
*/
13+
14+
import rust
15+
16+
from CallExprBase fc
17+
where
18+
fc.getStaticTarget().(Function).getName().getText() = ["danger_accept_invalid_certs", "danger_accept_invalid_hostnames"] and
19+
fc.getArg(0).(BooleanLiteralExpr).getTextValue() = "true"
20+
select
21+
fc,
22+
"Disabling TLS certificate validation with 'danger_accept_invalid_certs(true)' can expose the application to man-in-the-middle attacks." // TODO: proper message.

0 commit comments

Comments
 (0)