Courseiva

CCNA Secure Software Implementation Questions

28 questions · Secure Software Implementation · All types, answers revealed

1
MCQhard

A team is using SonarQube to enforce secure coding standards. Which analysis approach is required to detect vulnerabilities related to improper handling of sensitive information in logs?

A.Syntax checking
B.Unit testing
C.Dead code detection
D.Taint analysis
AnswerD

Taint analysis tracks data from source to sink to identify leaks.

Why this answer

Data flow analysis (or taint analysis) is required to track whether sensitive data reaches an insecure sink like a log file.

2
MCQmedium

When managing third-party libraries, why is a Software Bill of Materials (SBOM) essential?

A.To encrypt source code
B.To provide a complete inventory of software components
C.To speed up build times
D.To replace the need for unit testing
AnswerB

SBOMs allow for rapid vulnerability identification across the entire supply chain.

Why this answer

An SBOM provides a comprehensive list of all components, making it possible to identify if a newly disclosed vulnerability affects your application.

3
Multi-Selecthard

Which TWO of the following are crucial when performing a manual code review for security?

Select 2 answers
A.Identifying data flow sources and sinks
B.Focusing only on UI design elements
C.Rewriting the entire application
D.Verifying authorization checks are enforced
E.Checking code indentation consistency
AnswersA, D

Correct - central to spotting injection flaws.

Why this answer

Identifying data sources and sinks and checking for authorization controls are central to manual security audits.

4
Multi-Selecthard

Which THREE of the following are recognized techniques for minimizing the attack surface of an API?

Select 3 answers
A.Implement robust authentication
B.Use cleartext headers for all communication
C.Implement rate limiting
D.Expose full internal database schemas
E.Disable unused HTTP methods
AnswersA, C, E

Correct - ensures access control.

Why this answer

Disabling unused methods, authentication, and rate limiting are standard API hardening techniques.

5
MCQmedium

You are auditing a web application for insecure deserialization. Which language-specific feature is most commonly the source of this vulnerability?

A.The use of internal logging
B.The use of JSON.parse()
C.The use of static typing
D.The use of native object serialization
AnswerD

Native serialization formats are often susceptible to gadget chain attacks.

Why this answer

Deserialization of untrusted data in languages like Java (ObjectInputStream) or Python (pickle) can allow code execution.

6
MCQhard

When utilizing a third-party library, what is the best strategy to minimize security risks during the build process?

A.Trust all repositories by default
B.Download libraries from the developer's website
C.Always use the 'latest' version
D.Pin dependencies to specific versions and verify hashes
AnswerD

Lock files ensure reproducibility and prevent tampering.

Why this answer

Pinning dependencies to specific versions and using hash verification ensures you are not pulling in malicious or modified code.

7
MCQmedium

You are reviewing a Node.js web application. Which secure coding practice directly mitigates Cross-Site Scripting (XSS) when rendering user-supplied data in an EJS template?

A.Using <%- %> tags for all variables
B.Disabling the template engine
C.Using <%= %> tags for user data
D.Implementing a global regex filter
AnswerC

The <%= tag performs HTML entity escaping on the rendered content.

Why this answer

Escaping output is the primary defense against XSS; EJS uses the <%= %> tag for escaped output, which handles special characters.

8
Multi-Selecteasy

Which THREE of the following are effective methods to prevent SQL Injection in a database-driven application?

Select 3 answers
A.Using stored procedures with dynamic SQL
B.Using parameterized queries
C.Relying solely on client-side validation
D.Applying the principle of least privilege to the database user
E.Strict input validation based on allow-lists
AnswersB, D, E

Correct - separates code from data.

Why this answer

Parameterized queries, input validation, and the principle of least privilege are core defenses against SQLi.

9
MCQeasy

When conducting a static code analysis for a C++ application, which memory management error is best detected by tools like Fortify or Coverity?

A.Database connection timeout
B.Business logic flaws
C.Buffer overflow
D.Zero-day authentication bypass
AnswerC

Static analysis tools scan for dangerous function calls like strcpy or gets that cause buffer overflows.

Why this answer

Static analysis tools are highly effective at identifying buffer overflows, which are common in C++ due to manual memory management.

10
MCQmedium

You are configuring a Content Security Policy (CSP) for a web application. Which directive should be used to restrict the sources from which scripts can be loaded?

A.style-src
B.script-src
C.img-src
D.connect-src
AnswerB

This is the correct CSP directive for controlling script origins.

Why this answer

The script-src directive dictates valid sources for executable scripts, preventing malicious code injection from untrusted domains.

11
MCQeasy

A developer is using OWASP Dependency-Check to scan a Java application. Which configuration parameter should be utilized to ignore specific false-positive vulnerabilities identified in a third-party library?

A.--ignore-cve
B.--exclude-all
C.--skip-analysis
D.--suppression
AnswerD

The suppression file is the standard mechanism to filter out known false positives.

Why this answer

The --suppression flag allows developers to provide an XML file that defines rules to ignore specific CVEs or false positives in the dependency scan report.

12
MCQhard

In a Java Spring Boot application, which configuration prevents Cross-Site Request Forgery (CSRF) for state-changing HTTP requests?

A.Set the Content-Type header to application/json
B.Use a stateless session strategy with no tokens
C.Configure the HttpSecurity object to require CSRF tokens
D.Enable csrf().disable() in the SecurityFilterChain
AnswerC

Validating CSRF tokens ensures the request originated from the trusted UI.

Why this answer

Spring Security enables CSRF protection by default, which validates tokens for non-GET requests; disabling it (csrf().disable()) is the primary cause of vulnerability.

13
MCQmedium

When developing a microservice using gRPC, which mechanism is recommended for authenticating service-to-service communication?

A.HTTP Basic Auth
B.Mutual TLS (mTLS)
C.IP allow-listing
D.Shared API keys in headers
AnswerB

mTLS is the standard for gRPC service authentication.

Why this answer

Mutual TLS (mTLS) ensures both the client and server verify each other's certificates, providing strong authentication.

14
MCQeasy

Which standard security practice should be applied to all passwords stored in a database?

A.Encryption with a symmetric key
B.Storing in a configuration file
C.Hashing with a unique salt per user
D.Base64 encoding
AnswerC

Salting prevents rainbow table attacks.

Why this answer

Salting and hashing with a strong, slow algorithm (like Argon2 or bcrypt) is required to protect passwords.

15
MCQmedium

In an OAuth2 flow, what is the purpose of the 'state' parameter?

A.To prevent CSRF attacks
B.To store the user's password
C.To track the user's location
D.To encrypt the access token
AnswerA

It binds the request to the user's session.

Why this answer

The state parameter is used to prevent CSRF in OAuth flows by ensuring the redirect matches the original request.

16
Multi-Selectmedium

Which THREE of the following are best practices for the secure use of third-party libraries?

Select 3 answers
A.Automatically update to the latest version without testing
B.Monitor for vulnerability disclosures
C.Perform security audits on third-party code
D.Store all third-party code in the public root folder
E.Pin library versions to avoid unexpected changes
AnswersB, C, E

Correct - proactive security management.

Why this answer

Monitoring for vulnerabilities, pinning versions, and auditing updates are key practices.

17
MCQmedium

You are reviewing code and find a hardcoded API key. Which security control should be implemented to securely manage this secret?

A.Use a secret management service
B.Store it in a public environment variable
C.Add it to the .gitignore file
D.Obfuscate the key in the code
AnswerA

Dedicated services provide encryption and centralized access control for secrets.

Why this answer

Secret management services like HashiCorp Vault or AWS Secrets Manager allow externalizing and rotating secrets without code changes.

18
Multi-Selecteasy

Which TWO of the following are essential components of a Secure Software Development Lifecycle (SSDLC)?

Select 2 answers
A.Hardware procurement
B.Marketing strategies
C.Security requirements definition
D.Threat modeling
E.Unlimited project budget
AnswersC, D

Correct - defines the security posture.

Why this answer

Threat modeling and security requirements are foundational to the SSDLC process.

19
MCQhard

During a peer code review, you find a function that constructs an OS command using user input. What is the most secure way to handle this?

A.Run the command as a root user
B.Use built-in language APIs instead of shell commands
C.Sanitize the input with a blacklist
D.Escape the input with shell-specific characters
AnswerB

Native APIs avoid the shell and prevent injection.

Why this answer

Avoid calling OS commands entirely. If necessary, use built-in language APIs that don't involve shell execution, or enforce strict allow-lists.

20
MCQhard

A developer is using parameterized queries in C#. Which vulnerability is primarily prevented by this implementation?

A.Session Hijacking
B.SQL Injection
C.Insecure Deserialization
D.Directory Traversal
AnswerB

Parameterized queries separate code from data in the database layer.

Why this answer

Parameterized queries ensure that user input is treated as data, not executable code, effectively preventing SQL Injection.

21
Multi-Selectmedium

Which THREE of the following practices contribute to secure configuration of a web server?

Select 3 answers
A.Remove default files and pages
B.Allow all HTTP methods (TRACE, OPTIONS)
C.Enable verbose error reporting
D.Disable directory listing
E.Enforce HTTPS (TLS)
AnswersA, D, E

Correct - reduces attack surface.

Why this answer

Disabling directory listing, removing default pages, and enforcing HTTPS are essential for server hardening.

22
MCQeasy

Which cryptographic practice is recommended for protecting sensitive data at rest in a relational database?

A.Using cleartext with database permissions
B.Using MD5 hashing
C.Using AES-256 encryption
D.Storing data in base64 encoding
AnswerC

AES-256 is the current standard for secure encryption.

Why this answer

AES-256 is the industry standard for symmetric encryption of data at rest.

23
Multi-Selecthard

Which TWO of the following are required to successfully implement a secure logging mechanism?

Select 2 answers
A.Log every single user mouse movement
B.Send logs to a publicly accessible bucket
C.Filter sensitive data before logging
D.Store logs in a tamper-evident system
E.Disable all logging to improve performance
AnswersC, D

Correct - prevents leakage of PII/credentials.

Why this answer

Sensitive data must be filtered, and logs must be stored in a secure, tamper-evident location.

24
Multi-Selectmedium

Which TWO of the following are effective strategies to prevent Cross-Site Scripting (XSS)?

Select 2 answers
A.Relying on antivirus software
B.Disabling cookies
C.Using insecure HTML comments
D.Using a Content Security Policy (CSP)
E.Context-aware output encoding
AnswersD, E

Correct - prevents execution of unauthorized scripts.

Why this answer

Context-aware encoding and CSP are the most effective defenses against XSS.

25
MCQmedium

A developer is implementing a REST API. To prevent Mass Assignment vulnerabilities, what should be enforced during the model binding process?

A.Use Data Transfer Objects (DTOs) to restrict input
B.Disable SSL on the API endpoint
C.Increase the request timeout
D.Store user passwords in plaintext
AnswerA

DTOs act as an allow-list for fields, preventing unauthorized property injection.

Why this answer

Mass assignment occurs when input fields are mapped directly to database objects; using Data Transfer Objects (DTOs) allows explicit control over allowed fields.

26
MCQeasy

What is the primary security benefit of using a hardened container base image for microservices?

A.It reduces the attack surface
B.It increases execution speed
C.It automatically encrypts application logs
D.It eliminates the need for patching
AnswerA

Removing unused tools makes it harder for an attacker to escalate privileges.

Why this answer

Hardened images remove unnecessary binaries and shells, reducing the attack surface for potential exploits.

27
MCQhard

A developer is using an ORM (Object-Relational Mapping) framework. What risk remains even when using built-in ORM features?

A.Cross-Site Scripting
B.Brute force attacks
C.Buffer overflows
D.SQL Injection through unsafe raw queries
AnswerD

Using raw query functions with dynamic strings bypasses ORM protections.

Why this answer

Even with ORMs, developers can introduce SQL injection if they dynamically construct queries using string concatenation inside the ORM's raw query methods.

28
MCQhard

When implementing file uploads, which practice is most effective in preventing remote code execution (RCE)?

A.Storing files outside the web root and renaming them
B.Checking the file size
C.Validating the file extension only
D.Enabling execution permissions on the upload folder
AnswerA

This prevents direct execution of uploaded files by the web server.

Why this answer

Renaming files and storing them outside the web root prevents attackers from executing malicious scripts they have uploaded.

Ready to test yourself?

Try a timed practice session using only Secure Software Implementation questions.