D385 SOFTWARE SECURITY AND TESTING EXAM
2025 | ALL QUESTIONS AND CORRECT ANSWERS
| ALREADY GRADED A+ | LATEST VERSION (JUST
RELEASED)
Save
Terms in this set (22)
https://quizlet.com/1001619882/d385-software-security-and-testing-exam-2025-all-questions-and-correct-answers-already-graded-a-latest-version-ju… 1/19
,2/5/25, 3:13 AM D385 SOFTWARE SECURITY AND TESTING EXAM 2025 | ALL QUESTIONS AND CORRECT ANSWERS | ALREADY GRADED A…
C. Sanitize outbound log messages.
The primary defense against log injection attacks is to
sanitize outbound log messages. Log injection is a
type of security vulnerability where an attacker
manipulates log messages to inject malicious code or
exploit system vulnerabilities. By sanitizing outbound
log messages, you ensure that any user-supplied
input or potentially dangerous characters are
properly escaped or removed before being included
What is the primary in the log.
defense against log Sanitizing log messages involves applying input
injection attacks? validation and output encoding techniques to prevent
the injection of malicious content. It typically involves
A. Do not use validating the input data, such as user inputs, and
parameterized stored sanitizing or encoding it appropriately to ensure it
procedures in the does not contain any harmful characters or
database constructs.
B. Allow all users to write Some common techniques for sanitizing log
to these logs messages include:
C. Sanitize outbound log Input validation: Validate and restrict user input to
messages ensure it conforms to expected formats and does not
D. Use API calls to log contain any unauthorized or dangerous characters.
actions Output encoding: Encode the log messages in a way
that prevents the interpretation of special characters
or malicious constructs. For example, you can use
HTML entity encoding, URL encoding, or database-
specific encoding techniques, depending on the log
storage and processing mechanisms.
By properly sanitizing outbound log messages, you
can minimize the risk of log injection attacks and
ensure that the logs remain a reliable and secure
source of information for monitoring and analysis
purposes.
https://quizlet.com/1001619882/d385-software-security-and-testing-exam-2025-all-questions-and-correct-answers-already-graded-a-latest-version-ju… 2/19
, 2/5/25, 3:13 AM D385 SOFTWARE SECURITY AND TESTING EXAM 2025 | ALL QUESTIONS AND CORRECT ANSWERS | ALREADY GRADED A…
import logging logging.error(' The exception that occurred is: ' +
import sys str(e))
#log division by zero error
to the log, the output is
printed to the screen
def
divideByZeroError(dividen
d, divisor):
logging.basicConfig(strea
m=sys.stdout,format='%
(levelname)s:%
(message)s')
try:
quotient =
dividend/divisor
print (quotient)
except Exception as e:
#logging error here, use
str(e) as part of the output
if __name__ == '__main__':
dividend = int(input())
divisor = int(input())
divideByZeroError(dividen
d,divisor)
https://quizlet.com/1001619882/d385-software-security-and-testing-exam-2025-all-questions-and-correct-answers-already-graded-a-latest-version-ju… 3/19