Guide Vulnerability Identification &
Remediation API Security, Python
Testing & Verification 2026 | Verified
WGU D385 Task 2 Complete Practice Guide | Comprehensive
Examination
WGU D385 Task 2 Complete Practice Guide Vulnerability
Identification & Remediation API Security, Python Testing &
Verification 2026 actual exam preparation document with
INTRODUCTION
This document is an important and very helpful preparation
resource for WGU D385 Task 2 Complete Practice Guide
Vulnerability Identification & Remediation API Security,
Python Testing & Verification 2026. Every item uses a focused
exam stem, four response options, a keyed response, and a clear
rationale, making it easier to understand the subject, spot
distractors, and build real exam confidence.
Page 1
, Question 1
A Python Flask API uses JWT for authentication. The token payload includes a
'role' claim, and the server verifies the signature using a hardcoded secret. An
attacker changes the 'role' from 'user' to 'admin' and re-signs the token with the
'none' algorithm. The server accepts the token. Which OWASP API Security
Top 10 category does this vulnerability fall under, and what is the most
effective remediation?
A. API1:2019 Broken Object Level Authorization; enforce object-level
access checks.
B. API2:2019 Broken User Authentication; reject tokens with 'none'
algorithm and use asymmetric keys.
C. API5:2019 Broken Function Level Authorization; implement
role-based access control.
D. API8:2019 Injection; sanitize all JWT claims before use.
Correct Answer: B - API2:2019 Broken User Authentication;
reject tokens with 'none' algorithm and use asymmetric keys.
RATIONALE
This is Broken User Authentication (API2) because the server fails to
validate the JWT signature algorithm, allowing the 'none' algorithm
attack. Remediation includes explicitly rejecting 'none' and using
strong algorithms like RS256 with public/private key pairs. Options A,
C, and D misclassify the vulnerability; object-level authorization and
injection are not the primary issues here.
Question 2
In a Python application, the following code is used to query a SQLite database:
`cursor.execute("SELECT * FROM users WHERE username = '%s' AND
password = '%s'" % (username, password))`. Which testing technique would
most effectively detect this vulnerability during automated verification?
A. Unit testing with mock database connections.
Page 2
, B. Static application security testing (SAST) with taint analysis.
C. Dynamic application security testing (DAST) with authenticated
crawling.
D. Property-based testing with Hypothesis.
Correct Answer: B - Static application security testing (SAST)
with taint analysis.
RATIONALE
SAST with taint analysis can trace user input from source to sink,
identifying the string formatting as a SQL injection vulnerability. Unit
tests with mocks may not exercise the actual query construction.
DAST might detect it but is less reliable for code-level flaws, and
property-based testing is not specifically designed for injection
detection.
Question 3
A development team uses a Python library that has a known CVE (e.g.,
CVE-2023-1234) with a CVSS score of 9.8. The library is used only in a
non-production internal tool that processes non-sensitive data. The team
decides to defer patching. Which risk management principle best justifies this
decision?
A. Risk acceptance based on business context and exploitability.
B. Risk transference through cyber insurance.
C. Risk avoidance by removing the library.
D. Risk mitigation via compensating controls.
Correct Answer: A - Risk acceptance based on business context
and exploitability.
Page 3
, RATIONALE
Risk acceptance is appropriate when the impact is low due to
non-sensitive data and limited exposure, despite high CVSS. CVSS
measures technical severity, not business risk. Transference,
avoidance, or mitigation would require additional actions not taken
here.
Question 4
When performing API fuzzing with a tool like RESTler, which of the
following is the most critical step to ensure effective vulnerability discovery?
A. Using a large dictionary of common passwords.
B. Generating a valid OpenAPI specification and inferring
producer-consumer dependencies.
C. Running the fuzzer without authentication to test for broken access
controls.
D. Configuring the fuzzer to send only GET requests to avoid state
changes.
Correct Answer: B - Generating a valid OpenAPI specification
and inferring producer-consumer dependencies.
RATIONALE
RESTler uses OpenAPI specs to understand API structure and
dependencies, which is essential for generating meaningful sequences.
Without a valid spec, fuzzing is less effective. Other options are either
too narrow or incorrect; authentication and HTTP methods are part of
the spec but not the critical step.
Question 5
In a CI/CD pipeline, a SAST tool flags a potential hardcoded secret in a Python
file. The developer argues it's a false positive because the value is an
environment variable placeholder. Which action should be taken to verify and
resolve the finding?
Page 4