Skip to content

Commit 700bfea

Browse files
Minor tweaks
Signed-off-by: David A. Wheeler <[email protected]>
1 parent 7f7fd8b commit 700bfea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

secure_software_development_fundamentals.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,8 +2508,9 @@ and it also has other information such as all relevant character
25082508
encodings.
25092509
Perhaps most importantly, the DBMS developers will typically have
25102510
security experts review this part of the DBMS system.
2511-
However, DBMS-side parameter processing often requires using special
2512-
effort, so many DBMS libraries use "application-side" parameter processing.
2511+
However, DBMS-side parameter processing can require more effort to
2512+
within implement in DBMS libraries, so many DBMS libraries use
2513+
"application-side" parameter processing.
25132514

25142515
"Application-side" parameter processing occurs when the parameter escaping
25152516
occurs within a library *not* in the DBMS, but instead in the application's
@@ -2598,6 +2599,7 @@ For example, in Python, if you need to write to a user-provided table name, you
25982599
cur = con.cursor()
25992600
cur.execute(f"insert into {table_name}(d, ts) values (?, ?)", (today, now)) # This is safe because we know that table_name can only take trusted values from table_name_map
26002601
~~~~
2602+
26012603
##### Other Approaches
26022604

26032605
Many programs use object-relational mapping (ORM). This is just a technique to automatically convert data in a relational database into an object in an object-oriented programming language and back; lots of libraries and frameworks will do this for you. This is fine, as long as the ORM is implemented using parameterized statements or something equivalent to them. In practice, any good ORM implementation will do so. So if you are using a respected ORM, you are already doing this. That said, it is common in systems that use ORMs to occasionally need to use SQL queries directly… and when you do, use parameterized statements or prepared statements.

0 commit comments

Comments
 (0)