










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











This exam assesses mastery of software security fundamentals, threat modeling, static
analysis tooling, secure coding in Python, vulnerability identification and remediation,
software testing principles, code review, and risk assessment documentation aligned
with WGU D385 Task 1 performance assessment. It emphasizes practical application
of OWASP Top 10, CWE/SANS Top 25, and NIST SSDF within Python-centric static
analysis workflows.
A. Parameterized queries with placeholders B. String concatenation to build SQL C. ORM query builders with bound parameters D. Stored procedures with input validation
String concatenation embeds untrusted input directly into SQL, enabling injection (CWE-89). Parameterized queries, ORM bound parameters, and stored procedures with validation prevent injection by separating code from data.
A. Immediately refactor the code to remove the finding B. Suppress the finding to reduce noise C. Triage the finding to confirm exploitability and context D. Escalate to management without review
Triage confirms whether the finding is a true positive and assesses exploitability in context, preventing wasted effort on false positives. Immediate refactoring or suppression without validation can be premature or risky, and escalation without review lacks technical basis.
A. STRIDE per element with trust boundaries B. VAST scaled to enterprise architecture C. PASTA focused on business impact D. OCTAVE for organizational risk
STRIDE applied per element with trust boundaries systematically identifies threats like spoofing and tampering in microservice interactions, aligning with OWASP Top 10 categories. VAST, PASTA, and OCTAVE are broader or organization-level and less directly mapped to code-level OWASP risks.
A. PW.7 (Review and/or Analyze Human-Readable Code) B. PS.1 (Protect All Forms of Code) C. RV.1 (Identify and Confirm Vulnerabilities) D. PO.5 (Implement and Maintain Secure Environments)
PW.7 explicitly covers code review and static analysis to identify vulnerabilities. PS.1 protects code integrity, RV.1 focuses on vulnerability response, and PO. addresses environment security.
A. V2 Authentication B. V3 Session Management C. V5 Validation, Sanitization, Encoding D. V8 Data Protection
ASVS V3 Session Management specifies requirements for session tokens, timeouts, and binding. Authentication (V2), validation (V5), and data protection (V8) address different security domains.
A. CVSS base score alone B. CWE severity rating C. Contextual risk (exploitability, data sensitivity) D. Lines of code affected
Contextual risk combines exploitability, exposure, and data sensitivity to prioritize remediation effectively. CVSS base score lacks environmental context, CWE severity is generic, and lines of code do not indicate risk.
A. Pylint B. Bandit C. Flake D. Mypy
Bandit is designed to find security issues including data flow from sources to sinks (e.g., SQL injection). Pylint and Flake8 focus on style and errors, while Mypy checks type annotations.
A. Parameterized query with placeholders B. f-string interpolation of user input into SQL C. ORM query builder with bound parameters D. Stored procedure call with typed arguments
f-string interpolation embeds user input directly into SQL text, allowing injection (CWE-89). Parameterized queries, ORM binding, and typed stored procedures separate code from data and prevent injection.
A. Suppress the finding with a # nosec comment B. Replace os.system with subprocess.run using a list and shell=False C. Encode the input with base64 before concatenation D. Move the call into a try/except block
Using subprocess with an argument list and shell=False prevents shell interpretation, mitigating OS command injection (CWE-78) while preserving the command's function. Suppression hides risk, base64 is reversible, and try/except does not remove the vulnerability.
A. Reuse well-secured software components B. Define security requirements C. Implement secure design principles D. Perform static analysis
PW.4.1 in NIST SSDF is 'Reuse Existing, Well-Secured Software When Feasible.' Defining requirements is PW.1, secure design is PW.2, and static analysis is PW.7.
A. CWE-79 Cross-site Scripting B. CWE-95 Code Injection C. CWE-22 Path Traversal D. CWE-352 CSRF
eval() executes arbitrary code, directly mapping to CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code). XSS, path traversal, and CSRF involve different mechanisms.
A. Allow developers to dismiss findings locally B. Require a documented risk acceptance with approver identity C. Disable the rule globally after first occurrence D. Run SAST only on release branches
Enforcing documented risk acceptance with approver identity ensures accountability and traceability, aligning with SSDF and audit requirements. Local dismissal, global rule disabling, and infrequent scans undermine the control.
A. hashlib B. hmac.compare_digest C. secrets.token_hex D. base64.b64encode
hmac.compare_digest performs constant-time comparison, preventing timing side channels (CWE-208). hashlib, secrets.token_hex, and base64.b64encode do not provide constant-time comparison.
A. The exact line number only B. A proof-of-concept exploit C. The data flow trace from source to sink D. The developer's commit history
A data flow trace identifies how untrusted input reaches a dangerous sink, enabling precise remediation. Line number alone lacks context, a PoC may not be feasible, and commit history is not directly actionable for fixing the defect.
A. subprocess.run with shell=True and string concatenation B. os.path.join with user-supplied path segments C. pickle.loads on untrusted byte streams D. eval on a sanitized arithmetic expression
CWE-78 occurs when untrusted input reaches a shell interpreter; subprocess.run(shell=True) with concatenated input allows metacharacter injection. os.path.join affects path traversal (CWE-22), pickle.loads enables deserialization RCE (CWE-502), and eval on sanitized arithmetic is still risky but not OS command injection.
A. B101 assert_used in test modules B. B105 hardcoded_password_string in config.py C. B404 subprocess import in a CLI utility D. B311 random for non-security jitter
A hardcoded credential in configuration is a direct secret exposure (CWE-798) affecting authentication. Assert usage, a subprocess import alone, and non-security randomness are lower-impact or false-positive-prone.
A. A signed SBOM listing dependencies B. Documented review records with defect dispositions C. A passing unit test coverage threshold D. An approved change advisory board ticket
PW.7 requires code review with defined criteria and disposition of findings; review records with defect dispositions are the direct evidence. SBOMs, coverage thresholds, and CAB tickets support other practices but not review evidence.
A. os.path.normpath then open the joined path B. Resolve realpath and verify it starts with the base directory C. Strip '../' substrings from the user filename once D. URL-encode the filename before joining
Canonicalizing with realpath and confirming containment under the base directory defeats encoded and nested traversal. normpath alone can still escape, single-pass substring stripping is bypassable, and URL-encoding does not constrain the filesystem path.
A. Fix findings alphabetically by file name B. Prioritize by exploitability, data sensitivity, and reachability C. Suppress all low-severity rules globally D. Remediate only findings in new pull requests
Risk-based triage ranks by exploitability, asset sensitivity, and whether the vulnerable path is reachable, focusing effort on real exposure. Alphabetical order, blanket suppression, and new-code-only scoping ignore existing high-risk defects.
A. Mark the test as integration and skip in CI B. Monkeypatch os.environ and inject a fake secret C. Increase retries to mask environment variance D. Read the real secret from a developer .env file
Monkeypatching os.environ with a controlled fake secret gives deterministic, isolated unit tests without real credentials. Skipping, retries, and real secrets introduce nondeterminism or secret exposure.
A. Replacing json.loads with yaml.safe_load B. Replacing json.loads with pickle.loads on request data C. Adding type hints to a dataclass D. Switching requests to httpx with timeouts
pickle.loads on untrusted request data enables arbitrary code execution (CWE-502) and must be blocked. safe_load is safer YAML, type hints are inert, and httpx with timeouts improves robustness without deserialization risk.
A. Denial of Service B. Information Disclosure C. Spoofing D. Repudiation
Accepting unverified JWT claims allows an attacker to impersonate another user, which is Spoofing in STRIDE. DoS, Information Disclosure, and Repudiation do not directly describe identity forgery.
A. PO.1 Define security requirements B. PS.2 Provide a mechanism for verifying software release integrity C. PW.7 Review and/or analyze human-readable code to identify vulnerabilities D. RV.1 Identify and confirm vulnerabilities on an ongoing basis
PW.7 explicitly covers code review and analysis (including SAST) to find vulnerabilities. PO.1 is requirements, PS.2 is release integrity, and RV.1 is ongoing vulnerability identification, not pipeline integration of static analysis.
A. Immediately remediate as critical B. Mark as false positive and suppress permanently C. Document as a risk-accepted finding with justification and review date D. Escalate to penetration testing team
Unreachable code lowers exploitability, so documenting risk acceptance with justification and periodic review aligns with risk-based triage. Immediate critical remediation ignores context, permanent suppression lacks governance, and escalation is unnecessary without exploitability evidence.
A. String concatenation with escaped quotes B. Parameterized queries with bound parameters C. Using an ORM with raw SQL string formatting D. Input sanitization via regular expressions
Parameterized queries separate code from data, eliminating SQL injection (CWE-89). Concatenation and raw SQL formatting remain vulnerable; regex sanitization is error-prone and not a primary defense.
A. Disabling interprocedural analysis B. Enabling taint tracking with sanitizer definitions C. Lowering the severity threshold to informational D. Excluding third-party libraries from scanning
Taint tracking with properly defined sanitizers focuses on exploitable flows and reduces noise. Disabling interprocedural analysis reduces coverage, lowering thresholds increases noise, and excluding libraries may miss vulnerabilities.
A. Escape single quotes with replace("'", "''") B. Use parameterized queries with bound parameters C. Enable WAF rule blocking SQL keywords D. Hash the input with SHA-256 before concatenation
ASVS requires parameterized queries to prevent SQL injection (CWE-89); manual escaping is error-prone. WAF and hashing do not fix the root cause.
A. Statement coverage only B. Boundary value analysis on each condition C. MC/DC (modified condition/decision coverage) D. Random fuzzing without oracles
MC/DC requires each condition to independently affect the decision outcome, providing strong isolation of branch defects. Statement coverage and random fuzzing lack this rigor; BVA targets boundaries, not condition independence.
A. CWE-502; SSDF PW.5 secure coding B. CWE-79; SSDF PS.1 protect code C. CWE-89; SSDF PW.7 review code D. CWE-798; SSDF PW.4 reuse secure components
eval() on untrusted data enables arbitrary code execution, mapped to CWE- (deserialization of untrusted data); SSDF PW.5 covers secure coding. CWE-79 is XSS, CWE-89 SQLi, CWE-798 hardcoded credentials.
A. CVSS base score only B. Qualitative low/medium/high without context C. CVSS environmental score with exploitability and data sensitivity D. Line count of affected code
Environmental metrics adjust for deployment context, exploitability, and data sensitivity, improving prioritization. Base score alone ignores context; qualitative labels and line counts are insufficient.
A. Enable all rules including SQL string checks B. Suppress CWE-89 rules for ORM-managed queries C. Disable taint analysis entirely D. Run only on test files
Django ORM parameterizes queries, so suppressing raw SQL injection rules reduces false positives while retaining taint analysis for raw SQL. Disabling taint analysis or scanning only tests misses real issues.
A. os.path.join(base, user_path) without normalization B. Resolve realpath and verify it starts with base directory C. Strip '../' once from input D. URL-encode the filename
Canonicalizing with realpath and checking the prefix ensures the resolved path stays within the base directory. Simple stripping or encoding can be bypassed; os.path.join alone does not prevent traversal.