Docsity

GIAC Secure Software Application Programmer SSAP Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
GIAC Secure Software Application
Programmer SSAP Ultimate Exam
**Question 160.** Which of the following is the most secure way to store a public‑key certificate
used for verifying JWT signatures in a .NET Core application?
A) Embedding the certificate string in source code
B) Storing it in Azure Key Vault and loading it at runtime
C) Placing the certificate file in the wwwroot folder
D) Including it in appsettings.json without encryption
Answer: B
Explanation: Azure Key Vault protects the certificate with access controls and audit logging,
preventing accidental exposure.
**Question 161.** In a Java Spring Boot application, which annotation disables CSRF protection for
a specific endpoint that is intended for API clients?
A) @CrossOrigin
B) @EnableWebSecurity
C) @CsrfIgnore
D) @CrossOrigin(exposedHeaders = "X‑CSRF‑Token")
Answer: C
Explanation: The `@CsrfIgnore` (or configuring HttpSecurity.csrf().ignoringAntMatchers) disables
CSRF checks for designated endpoints.
**Question 162.** Which of the following is a recommended approach to mitigate “HTTP
Parameter Pollution” attacks?
A) Accepting duplicate query parameters and concatenating their values
B) Using a framework that parses parameters into a map that retains only the first occurrence
C) Ignoring all query parameters
D) Allowing unlimited duplicate parameters
Answer: B
Explanation: Retaining only the first (or last) occurrence prevents attackers from influencing logic via
duplicated parameters.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download GIAC Secure Software Application Programmer SSAP Ultimate Exam and more Exams Technology in PDF only on Docsity!

Programmer SSAP Ultimate Exam

Question 160. Which of the following is the most secure way to store a public‑key certificate used for verifying JWT signatures in a .NET Core application? A) Embedding the certificate string in source code B) Storing it in Azure Key Vault and loading it at runtime C) Placing the certificate file in the wwwroot folder D) Including it in appsettings.json without encryption Answer: B Explanation: Azure Key Vault protects the certificate with access controls and audit logging, preventing accidental exposure. Question 161. In a Java Spring Boot application, which annotation disables CSRF protection for a specific endpoint that is intended for API clients? A) @CrossOrigin B) @EnableWebSecurity C) @CsrfIgnore D) @CrossOrigin(exposedHeaders = "X‑CSRF‑Token") Answer: C Explanation: The @CsrfIgnore (or configuring HttpSecurity.csrf().ignoringAntMatchers) disables CSRF checks for designated endpoints. Question 162. Which of the following is a recommended approach to mitigate “HTTP Parameter Pollution” attacks? A) Accepting duplicate query parameters and concatenating their values B) Using a framework that parses parameters into a map that retains only the first occurrence C) Ignoring all query parameters D) Allowing unlimited duplicate parameters Answer: B Explanation: Retaining only the first (or last) occurrence prevents attackers from influencing logic via duplicated parameters.

Programmer SSAP Ultimate Exam

Question 163. Which of the following is the best practice for handling “password reset” tokens to prevent them from being used after a user changes their password? A) Not storing the token at all B) Deleting the token from the database once the password is successfully changed C) Keeping the token indefinitely for audit purposes D) Re‑using the same token for multiple password resets Answer: B Explanation: Removing the token after a successful reset ensures it cannot be replayed. Question 164. Which of the following HTTP response headers can be used to prevent browsers from caching pages that contain sensitive information? A) X‑Content‑Security‑Policy: default-src 'self' B) Cache‑Control: private, no‑store C) Content‑Encoding: gzip D) Accept‑Ranges: bytes Answer: B Explanation: Cache-Control: private, no-store tells browsers and intermediaries not to store the response. Question 165. In the context of the OWASP ASVS, which level (1, 2, or 3) requires that all cryptographic keys be rotated at least annually? A) Level 1 B) Level 2 C) Level 3 Answer: C Explanation: ASVS Level 3 targets high‑risk applications and mandates stricter key‑rotation policies, including annual rotation.

Programmer SSAP Ultimate Exam

Question 169. Which of the following is a recommended practice for “secret rotation” in a CI/CD pipeline? A) Hard‑coding the secret in the pipeline definition B) Using a secret‑management plugin that fetches the latest secret at build time and invalidates the old one after deployment C) Storing the secret in a publicly accessible Git repository D) Never rotating the secret once set Answer: B Explanation: Dynamic retrieval and automated invalidation ensure secrets stay fresh without manual errors. Question 170. Which of the following is the most effective way to protect a microservice’s internal API from being accessed by external clients? A) Exposing the service on a public IP address without authentication B) Placing the service behind an internal load balancer and using mutual TLS for authentication C) Relying on security through obscurity of the endpoint URL D) Disabling TLS for internal traffic to improve performance Answer: B Explanation: An internal load balancer combined with mTLS ensures only authorized services can communicate. Question 171. Which of the following is a secure method for handling “user‑supplied CSV files” that will be imported into a database? A) Trusting the file content and using bulk import directly B) Validating the CSV structure, limiting column counts, and using parameterized bulk‑insert statements C) Allowing any delimiter and quoting style without checks D) Storing the CSV file on a public S3 bucket without access controls Answer: B

Programmer SSAP Ultimate Exam

Explanation: Validation and parameterized inserts prevent injection and malformed data from reaching the database. Question 172. Which of the following is a recommended way to mitigate “server‑side request forgery” (SSRF) when an application fetches URLs supplied by users? A) Allowing any URL, including internal IP ranges B) Validating that the URL scheme is http/https and that the hostname resolves to a public IP address not in private ranges C) Disabling DNS resolution entirely D) Using the user‑supplied URL directly in a system() call Answer: B Explanation: Restricting to public IPs and allowed schemes prevents attackers from accessing internal services. Question 173. Which of the following is a secure default for the “Feature‑Policy” header to disable the “camera” feature? A) camera * B) camera 'none' C) camera () D) camera=() Answer: C Explanation: An empty list camera () disables the feature for all origins. Question 174. Which of the following is the most appropriate way to protect “admin” endpoints from being accessed via automated tools? A) Relying on obscurity of the URL path only B) Implementing rate limiting, MFA, and IP allow‑list controls in addition to authentication C) Disabling TLS for admin traffic D) Allowing any authenticated user to access admin endpoints

Programmer SSAP Ultimate Exam

Answer: B Explanation: UUIDs prevent name collisions and hide user‑controlled values, while metadata preserves the original name. Question 178. Which of the following is a secure default for the “X‑Download‑Options” header in Microsoft Edge? A) open B) noopen C) allow-all D) disabled Answer: B Explanation: noopen forces the browser to prompt before opening downloaded files, reducing drive‑by execution risk. Question 179. Which of the following is a recommended practice for “API versioning” to maintain security over time? A) Removing old versions without notifying clients B) Keeping deprecated versions indefinitely C) Providing a deprecation schedule, enforcing TLS, and applying security patches to all active versions D) Allowing any client to request any version without validation Answer: C Explanation: A clear deprecation plan and consistent security controls across versions keep the API safe. Question 180. Which of the following is the most appropriate way to protect against “cross‑site script inclusion” (XSSI) attacks? A) Disabling all script tags on the site B) Prefixing JSON responses with while(1); or /**/ to break malicious script execution C) Serving JSON with the MIME type text/html

Programmer SSAP Ultimate Exam

D) Allowing any origin to load scripts via CORS Answer: B Explanation: Prefixing JSON responses prevents them from being executed as valid JavaScript. Question 181. Which of the following is a secure way to manage “service‑to‑service authentication” in a microservices architecture? A) Sharing a single static API key among all services B) Using short‑lived JWTs signed by a central authority and verifying them on each request C) Relying on IP address filtering only D) Sending credentials in clear text over HTTP Answer: B Explanation: Short‑lived JWTs provide verifiable, time‑bounded authentication without exposing long‑term secrets. Question 182. Which of the following is a recommended practice for “handling large file uploads” to avoid denial‑of‑service attacks? A) Accepting files of any size without limits B) Setting a maximum request body size in the web server and rejecting oversized uploads early C) Storing the file directly in memory before writing to disk D) Disabling all upload functionality Answer: B Explanation: Enforcing size limits prevents resource exhaustion attacks. Question 183. Which of the following is a secure default for the “X‑XSS‑Protection” header in browsers that still support it? A) 0 (disable) B) 1; mode=block C) 1; report=/xss-report D) No header (default)

Programmer SSAP Ultimate Exam

C) Logging only the IP address D) Not logging failures to avoid alert fatigue Answer: B Explanation: Detailed context enables investigation while omitting sensitive data. Question 187. Which of the following is a secure default for the “Cache‑Control” header on API responses that should not be cached? A) public, max‑age= B) private, max‑age=0, no‑store C) no‑cache, must‑revalidate D) public, must‑revalidate Answer: B Explanation: private, max-age=0, no-store ensures the response is not cached by browsers or intermediaries. Question 188. Which of the following is a recommended mitigation for “XML External Entity” (XXE) attacks in .NET’s XmlReader? A) Enabling DTD processing by default B) Setting XmlReaderSettings.DtdProcessing = DtdProcessing.Prohibit and disabling external entity resolution C) Allowing any external entity URLs D) Ignoring the issue because .NET is immune to XXE Answer: B Explanation: Prohibiting DTD processing prevents the parser from expanding external entities. Question 189. Which of the following is a secure practice when using “Webhooks” to receive external events? A) Accepting any POST request without verification B) Validating a cryptographic signature (e.g., HMAC) included in the request headers and using TLS

Programmer SSAP Ultimate Exam

C) Sending the webhook payload over HTTP D) Storing the webhook secret in the code repository Answer: B Explanation: Signature verification ensures the payload originates from the trusted source, and TLS protects it in transit. Question 190. Which of the following is an appropriate way to protect “client‑side secrets” in a native mobile application? A) Hard‑coding the secret in the binary and obfuscating the code B) Storing the secret in the device’s secure keystore (Keychain or Android Keystore) and retrieving it at runtime C) Embedding the secret in a public configuration file D) Sending the secret to the server on every request in plain text Answer: B Explanation: Secure keystores encrypt secrets and restrict access to the owning application. Question 191. Which of the following is a recommended way to protect against “HTTP request smuggling” when using a reverse proxy? A) Allowing both Transfer‑Encoding: chunked and Content‑Length headers simultaneously B) Normalizing and validating header combinations, rejecting ambiguous requests C) Ignoring the TE header altogether D) Forwarding raw requests without inspection Answer: B Explanation: Proper validation of conflicting headers prevents ambiguity that can be exploited for request smuggling. Question 192. Which of the following is a secure default for the “X‑Content‑Security‑Policy” header on older browsers that only support that header? A) default‑src *

Programmer SSAP Ultimate Exam

B) Using Diffie‑Hellman (DHE) or Elliptic‑Curve Diffie‑Hellman (ECDHE) with strong parameters C) Transmitting the private key over the network D) Disabling forward secrecy Answer: B Explanation: DHE/ECDHE provides forward secrecy and uses strong parameters, protecting past sessions even if the server key is later compromised. Question 196. Which of the following is a recommended way to protect “admin APIs” from being accessed by compromised user accounts? A) Relying solely on role‑based access control B) Implementing additional contextual checks such as MFA, IP allow‑list, and behavior analytics for privileged actions C) Allowing any authenticated user to call admin endpoints D) Disabling logging for admin actions to reduce noise Answer: B Explanation: Contextual controls add layers beyond RBAC, reducing risk from credential theft. Question 197. Which of the following is a secure default for the “X‑Content‑Type‑Options” header? A) nosniff B) sniff C) allow-all D) disabled Answer: A Explanation: nosniff prevents browsers from MIME‑type sniffing, mitigating certain drive‑by attacks. Question 198. Which of the following is the most appropriate way to protect “configuration files” that contain sensitive data in a Docker image?

Programmer SSAP Ultimate Exam

A) Including the file in the image layers as plain text B) Storing the file as a Docker secret and mounting it at runtime, ensuring it is not baked into the image C) Writing the configuration to a world‑readable file inside the container D) Committing the file to the Git repository with the image Answer: B Explanation: Docker secrets keep sensitive data out of the image layers and provide runtime injection with access controls. Question 199. Which of the following is a recommended practice when using “prepared statements” in a Java JDBC context to prevent SQL injection? A) Concatenating user input into the SQL string before preparing B) Using ? placeholders for all user‑supplied values and binding them via PreparedStatement.set* methods C) Disabling the use of prepared statements for performance reasons D) Relying on client‑side validation only Answer: B Explanation: Placeholders separate code from data, and the driver handles proper escaping, eliminating injection vectors. Question 200. Which of the following is a secure way to handle “user‑supplied URLs” that will be displayed as clickable links in a web page? A) Rendering the URL directly without any checks B) Validating that the URL uses the https scheme and encoding it with HTML attribute escaping before insertion C) Allowing javascript: URIs D) Storing the URL in a hidden form field only Answer: B Explanation: Enforcing HTTPS and proper HTML encoding prevents XSS and malicious redirects.

Programmer SSAP Ultimate Exam

Question 204. Which of the following is the most appropriate way to protect “API keys” that must be used by a front‑end JavaScript application? A) Embedding the key directly in the JavaScript source B) Using a backend proxy that injects the key server‑side, so the client never sees the raw key C) Storing the key in a public CDN D) Sending the key via an unauthenticated HTTP request Answer: B Explanation: A backend proxy keeps the secret on the server, preventing exposure to the client. Question 205. Which of the following is a secure default for the “X‑Download‑Options” header on Microsoft browsers? A) open B) noopen C) allow-all D) disabled Answer: B Explanation: noopen forces a download prompt, reducing automatic execution of downloaded files. Question 206. Which of the following is a recommended practice for “handling user‑supplied JSONP callbacks” to avoid XSS? A) Allow any callback name supplied by the client B) Whitelisting allowed callback function names and validating them against a strict regex before echoing them in the response C) Disabling JSONP entirely and using CORS instead D) Embedding the callback name without escaping Answer: B Explanation: Strict validation of callback names prevents injection of malicious JavaScript.

Programmer SSAP Ultimate Exam

Question 207. Which of the following is the most appropriate way to protect “temporary files” created during file‑upload processing on a server? A) Storing them in a world‑writable directory without cleanup B) Creating them in a secure, access‑controlled directory and deleting them immediately after processing C) Leaving the files on disk indefinitely for audit purposes D) Storing them in the same directory as executable binaries Answer: B Explanation: Secure locations and timely deletion limit exposure and reduce the chance of misuse. Question 208. Which of the following is a secure method for “encrypting data at rest” in a PostgreSQL database? A) Relying on application‑level encryption only B) Enabling Transparent Data Encryption (TDE) with AES‑256 and managing the master key via a hardware security module C) Storing the encryption key in the same database schema D) Using DES for column‑level encryption Answer: B Explanation: TDE with strong algorithms and external key management protects data even if the storage medium is compromised. Question 209. Which of the following is a recommended practice for “protecting against clickjacking” when a page must be embedded in an iframe for a trusted partner? A) Removing all clickjacking defenses B) Using CSP’s frame‑ancestors directive to list the partner’s origin while omitting X‑Frame‑Options C) Setting X‑Frame‑Options to DENY D) Allowing any site to frame the page via * Answer: B

Programmer SSAP Ultimate Exam

Answer: B Explanation: Short‑lived access tokens limit exposure; refresh tokens can be revoked if compromise is detected. Question 213. Which of the following is a secure way to implement “rate limiting” for login attempts in a distributed system? A) Storing the attempt count in a local in‑memory variable on each server instance only B) Using a centralized data store (e.g., Redis) to track attempts per username/IP across all instances and enforcing limits atomically C) Allowing unlimited attempts to improve user experience D) Disabling logging of login attempts Answer: B Explanation: Centralized tracking ensures consistent enforcement across all nodes. Question 214. Which of the following is a recommended practice for “handling user‑provided CSV imports” that may contain Unicode characters? A) Assuming all input is ASCII only B) Validating the file’s encoding (e.g., UTF‑8) and rejecting files with invalid byte sequences before processing C) Ignoring encoding errors and processing anyway D) Storing the raw file without validation Answer: B Explanation: Proper encoding validation prevents malformed data and potential injection attacks. Question 215. Which of the following is a secure default for the “X‑Frame‑Options” header when the application includes an embedded dashboard for internal users only? A) SAMEORIGIN B) ALLOWALL C) DENY

Programmer SSAP Ultimate Exam

D) NONE

Answer: A Explanation: SAMEORIGIN permits framing only by pages from the same origin, suitable for internal dashboards. Question 216. Which of the following is a recommended mitigation for “password spraying” attacks on a public authentication endpoint? A) Allowing unlimited login attempts per username B) Implementing username‑agnostic throttling (e.g., limit total attempts per IP regardless of username) and encouraging MFA C) Disabling account lockout to avoid denial‑of‑service D) Using only CAPTCHA without other controls Answer: B Explanation: Username‑agnostic throttling prevents attackers from trying many usernames from a single source. Question 217. Which of the following is a secure method for “protecting against replay attacks” on OAuth 2.0 authorization codes? A) Not using state parameters B) Storing the authorization code in plain text in the browser’s local storage C) Binding the authorization code to a PKCE code verifier and checking it on token exchange D) Allowing the same code to be exchanged multiple times Answer: C Explanation: PKCE binds the code to a verifier, making replay impossible without the original verifier. Question 218. Which of the following is a recommended practice when “debugging” a production web application to avoid leaking sensitive information? A) Enabling verbose error pages that show stack traces to all users B) Logging detailed errors to a secure backend while returning generic error messages to the client