• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

D385-Software Security and Testing Study Guide Exam and Correct Answers 2026 Updated.

Document preview thumbnail
Preview 2 out of 8 pages

Primary defense against log injection attacks - Answer sanitize outbound log messages Result of exploiting a cross-site scripting vulnerability - Answer attacker can execute malicious scripts in a user's browser function prone to code injection attacks - Answer eval() Package for internal use by Python for regression testing - Answer test Vulnerability encountered when an attacker takes over multiple users' accounts - Answer Broken Object Level Authorization (BOLA) vulnerability Method used for a SQL injection attack - Answer exploit query parameters Security vulnerability shown by lack of HSTS headers - Answer lack of HTTP Strict Transport Security (HSTS) headers Response code for requesting an invalid URL - Answer 404 Not Found Method that returns information about the server's response - Answer nt Cross-origin resource sharing (CORS) allows users to do what - Answer override the same-origin policy for specific resources Protocol that caches a token after it has been acquired - Answer MSAL (Microsoft Authentication Library) Result of running code with authorizeAdmin(['user']) - Answer assertion error with the message "No admin found." Write a function that logs division by zero errors and outputs the results. The function should log errors to the console and print the quotient for valid divisions.

Content preview

D385-Software Security and Testing
Study Guide Exam and Correct Answers
2026 Updated.
Primary defense against log injection attacks - Answer sanitize outbound log messages



Result of exploiting a cross-site scripting vulnerability - Answer attacker can execute malicious
scripts in a user's browser



function prone to code injection attacks - Answer eval()



Package for internal use by Python for regression testing - Answer test



Vulnerability encountered when an attacker takes over multiple users' accounts - Answer
Broken Object Level Authorization (BOLA) vulnerability



Method used for a SQL injection attack - Answer exploit query parameters



Security vulnerability shown by lack of HSTS headers - Answer lack of HTTP Strict Transport
Security (HSTS) headers



Response code for requesting an invalid URL - Answer 404 Not Found



Method that returns information about the server's response - Answer response.content



Cross-origin resource sharing (CORS) allows users to do what - Answer override the same-
origin policy for specific resources



Protocol that caches a token after it has been acquired - Answer MSAL (Microsoft
Authentication Library)



Result of running code with authorizeAdmin(['user']) - Answer assertion error with the
message "No admin found."



Write a function that logs division by zero errors and outputs the results. The function should
log errors to the console and print the quotient for valid divisions.

, import logging

import sys

def divideByZeroError(dividend, divisor):

logging.basicConfig(stream=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(dividend, divisor) - Answer logging.error('The exception that occurred is: ' +
str(e))



Use the unittest library to create unit tests that check for None values in the multiply_numbers
function. Use assertIsNone to verify if an input is None and return the not-null value.



import unittest

def multiply_numbers(x, y):

# add your code here

return x * y

# add your code here

class TestForNone(unittest.TestCase):

def test_when_a_is_null(self):

try:

self.assertIsNone(multiply_numbers(5, None))

except AssertionError as msg:

print(msg)

if __name__ == '__main__':

unittest.main() - Answer if x is None:

print("x is a null value")

return y

elif y is None:

Document information

Uploaded on
September 10, 2026
Number of pages
8
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
COCOSOLUTIONS
4.1
(38)
Sold
230
Followers
16
Items
9625
Last sold
17 hours ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions