We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e20e4db commit 7f7dd8dCopy full SHA for 7f7dd8d
docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-460/noncompliant01d_container.py
@@ -0,0 +1,30 @@
1
+# SPDX-FileCopyrightText: OpenSSF project contributors
2
+# SPDX-License-Identifier: MIT
3
+"""Non-compliant Code Example"""
4
+
5
6
+class pallet:
7
+ """_Fake Euro Pallet"""
8
9
+ pallet_weight_kg: int = 25
10
+ max_weight_in_kg: int = 1500
11
+ weight_kg: int = 0
12
13
+ def __init__(self):
14
+ self.weight_kg = self.pallet_weight_kg
15
16
+ def add_box(self, kg: str):
17
+ self.weight_kg += int(kg)
18
19
+ def get_total(self):
20
+ return str(self.weight_kg)
21
22
23
+#####################
24
+# Trying to exploit above code example
25
26
+p = pallet()
27
+p.add_box(kg="100")
28
+print(p.get_total())
29
+p.add_box("100.0")
30
0 commit comments