Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free EC-Council Certified Application Security Engineer (JAVA) 312-96 Exam Questions

Last updated: · 13 practice questions with answers and explanations

Page: 1 / 8 Total 47 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Understanding Application Security, Threats, and Attacks

Skill tested: Integrates security activities into the SDLC to identify design risks before implementation.

A financial services team is replacing a batch payment system with a Java web application. Functional requirements and release dates are already approved, but security issues have repeatedly surfaced late in testing, forcing costly redesigns. The team has limited security staff and cannot add a separate security phase that delays every release. Management wants a repeatable process that addresses security throughout development while preserving iterative delivery. Which change best meets this goal?

Correct Answer: C. Integrate security requirements, threat analysis, secure design and code review, and security testing into the existing SDLC activities.
Explanation:

Embedding security activities in requirements, design, implementation, and testing helps the team find defects when they are less expensive to correct and makes security part of iterative delivery rather than a release-blocking afterthought. Training alone does not alter the process or ensure that risks are identified. A production-only penetration test detects issues late, while replacing functional testing would leave business behavior unverified and still would not provide security coverage throughout development.

Question 2

New Single answer

Topic: Security Requirements Gathering

Skill tested: Uses abuse-case modeling to derive security requirements from attacker goals and system behavior.

A healthcare provider is defining requirements for a Java portal that lets patients download laboratory reports. Patients authenticate through an existing identity service, and the portal must be ready for a fixed compliance review. The product owner has documented normal workflows, but the team has not considered how a patient might access another patient's report by changing a request identifier or abusing a shared workstation. The team needs actionable requirements before design approval, rather than a general security checklist. What should it do next?

Correct Answer: A. Complete an abuse-case model that traces attacker goals and misuse paths, then derive testable security requirements and mitigations.
Explanation:

Abuse-case modeling complements normal use cases by describing attacker goals and the paths through which system behavior could be misused. In this scenario, it can expose authorization and shared-session risks early enough to derive concrete, testable requirements, such as enforcing patient-to-record authorization on every request. A broad compliance statement is not an actionable requirement. Testing an unfinished implementation is too late for requirements discovery, and elaborating only legitimate workflows leaves the stated abuse paths unaddressed.

Question 3

New Multiple answers

Topic: Secure Application Design and Architecture

Skill tested: Applies STRIDE threat modeling to identify trust-boundary threats and architecture mitigations.

A retailer is designing a Java order service with a browser client, an application tier, and an Oracle database. The browser sends order details and a customer identifier; the application tier uses a database account with broad read/write privileges. A diagram shows data flows but does not identify trust boundaries or threats. The team must complete design review before implementation, and it cannot rely on a client-supplied identifier as proof of identity. Which TWO actions provide the strongest threat-modeling response? Select TWO.

Correct Answer: C. Use STRIDE against the data-flow diagram, including spoofing and tampering risks at the browser-to-service boundary.; D. Authenticate the user through a trusted mechanism and authorize access to each order using server-side identity and ownership checks.
Explanation:

STRIDE applied to data flows and trust boundaries helps uncover threats such as spoofed identity and tampered order identifiers. The model should lead to architectural controls: establish the user's identity through a trusted mechanism and perform server-side authorization for each order. A client-provided identifier is manipulable, and logging it does not prevent abuse. DREAD can support risk prioritization, but a low score does not justify ignoring a threat without context. Transport encryption protects data in transit, not access decisions.

Question 4

New Single answer

Topic: Secure Coding Practices for Input Validation

Skill tested: Implements server-side allowlist validation for structured input before application use.

A Java service accepts a report period from a request and uses it to select a report. The current implementation checks that the value is not null, then passes it into a downstream query builder. The accepted business values are exactly four-digit years from 2020 through 2035. The endpoint is internet-facing, and the team wants validation to reject malformed or out-of-range values before they affect any query or business logic. Which implementation is most appropriate?

Correct Answer: B. Parse the input as an integer, enforce the range 2020 through 2035, and reject parsing failures before use.
Explanation:

The input has a narrow, well-defined semantic range, so server-side parsing and range checking provide a strong allowlist validation strategy. Invalid syntax and out-of-range values should be rejected before the value reaches query construction or business logic. Removing a few characters is a fragile blacklist and does not establish that the value is a valid year. Client-side validation can be bypassed. HTML output encoding addresses a different context and does not validate a value used by the application.

Question 5

New Multiple answers

Topic: Secure Coding Practices for Authentication and Authorization

Skill tested: Combines Spring Security authentication and server-side object authorization for protected resources.

A Java application uses Spring Security to authenticate employees, but its document endpoint accepts a document ID and returns the matching record to any authenticated user. Employees may view only documents assigned to them, and administrators may view all documents. The application must preserve the existing login mechanism and avoid exposing document records through predictable identifiers. Which TWO changes best enforce the requirement? Select TWO.

Correct Answer: A. Apply a server-side authorization rule, such as a method-level check, that distinguishes administrators from document owners.; D. Require authentication on the endpoint and authorize document access against the authenticated principal's permissions and document ownership.
Explanation:

Authentication establishes who the caller is; authorization must still decide whether that principal may access the requested document. Checking ownership or permissions for each object prevents an authenticated user from changing an ID to retrieve another employee's record. A server-side method-level rule can express the owner-versus-administrator distinction consistently. Unpredictable IDs reduce guessability but are not access control. Hiding links is only a presentation measure, and request parameters are controlled by the caller.

Question 6

New Single answer

Topic: Secure Coding Practices for Cryptography

Skill tested: Selects authenticated encryption and appropriate nonce handling for Java application data.

A Java application stores sensitive export files and currently encrypts each file with AES in CBC mode using a fixed IV. Engineers have added a separate hash of the ciphertext but are unsure whether it prevents tampering. They need confidentiality and integrity, can update the Java implementation, and do not need compatibility with an external legacy format. Which approach is the best fit?

Correct Answer: B. Use an authenticated encryption mode such as AES-GCM with a unique nonce for each encryption under a key, and verify the authentication tag before accepting plaintext.
Explanation:

An authenticated encryption mode such as AES-GCM provides confidentiality and detects ciphertext modification through its authentication tag. The nonce must not be reused with the same key, and the application must reject data when tag verification fails. A fixed CBC IV is unsafe for repeated encryption and CBC alone does not authenticate data. An unkeyed hash can be replaced along with the ciphertext. ECB leaks patterns, and a symmetric encryption key is not used as a digital-signature key.

Question 7

New Single answer

Topic: Secure Coding Practices for Session Management:

Skill tested: Mitigates session fixation by renewing the session identifier after authentication.

A Java web application uses container-managed HTTP sessions. During review, an engineer finds that the session identifier created before login remains unchanged after successful authentication. The application uses HTTPS, marks its session cookie Secure and HttpOnly, and invalidates sessions on logout. A complete rewrite of session storage is out of scope, but the team can change authentication flow behavior. Which change most directly addresses the remaining risk?

Correct Answer: C. Regenerate the session identifier after successful authentication while preserving only necessary session state.
Explanation:

If an attacker can cause a victim to use a known pre-authentication session ID, retaining that ID after login can allow session fixation. Renewing the identifier at the authentication boundary breaks that linkage; only required state should be transferred to the new session. HTTPS and cookie flags mitigate other exposure paths but do not replace rotation. A longer timeout increases exposure, disabling HttpOnly weakens cookie protection, and placing the identifier in a form field does not make it secure.

Question 8

New Single answer

Topic: Static and Dynamic Application Security Testing (SAST & DAST)

Skill tested: Uses SAST findings and source review to trace injection risks to vulnerable Java data flows.

A security team runs a static analyzer on a Java application and receives a high-confidence warning that request data may reach a database query. Dynamic testing has not reproduced the issue because the affected route requires a particular account role and data state. The release is approaching, and the team must decide how to triage the finding rather than dismiss it or treat every scanner result as confirmed. What is the best next step?

Correct Answer: B. Manually trace the source-to-sink path, inspect query construction and applicable access paths, then verify remediation with focused tests.
Explanation:

SAST identifies potentially unsafe data flows in source code; a human reviewer should validate the source, transformations, sink, and reachable execution path. The missing DAST reproduction is not dispositive because the scanner may lack the required role or state. Once the issue is confirmed, a focused remediation and regression test can demonstrate that untrusted input no longer reaches an unsafe query operation. Blind suppression may leave a vulnerability, while disabling functionality or changing scanner thresholds does not establish or correct the underlying cause.

Question 9

New Multiple answers

Topic: Secure Deployment and Maintenance

Skill tested: Hardens Tomcat deployment by reducing exposed management access and limiting process privileges.

A Java application is deployed on Tomcat on a dedicated Linux host. The production team discovers that the Tomcat Manager application is reachable from a corporate user network, and the Tomcat process runs as root because it must bind to a privileged port. The application has no requirement for runtime administration through Manager, and the network team can restrict inbound paths. The team wants to reduce the impact of both remote compromise and application-level defects. Which TWO actions are most appropriate? Select TWO.

Correct Answer: A. Run Tomcat as a dedicated unprivileged account and use an appropriate mechanism to expose the service on the required port.; C. Remove or disable the Manager application when it is not required, and restrict management access to authorized administrative paths.
Explanation:

Removing an unnecessary management surface and restricting any required administrative access reduces opportunities for remote misuse. Running Tomcat under a dedicated unprivileged account limits the host impact if the application or container is compromised; privileged port exposure can be handled without running the whole process as root. A strong password does not justify broad reachability. Unrestricted sudo expands privilege, and application authentication cannot replace host and network controls.

Question 10

New Single answer

Topic: Secure Coding Practices for Error Handling

Skill tested: Designs client-safe exception handling while preserving diagnostic details in protected server logs.

An online service catches database exceptions and returns the exception message and stack trace in an HTTP error response. Support staff rely on the response to investigate failures, but the endpoint is public and exception details have exposed schema names and file paths. The application uses a centralized Spring MVC error handler, and the operations team has access to protected server logs. Which change best balances safe error reporting and effective diagnosis?

Correct Answer: A. Return a generic error response with a correlation identifier, and log the detailed exception server-side with access controls and appropriate redaction.
Explanation:

Clients should receive a stable, non-sensitive error message rather than internal exception details. A correlation identifier lets support staff locate the corresponding protected server-side diagnostic record without exposing schemas or paths to unauthenticated callers. Logging should retain useful context while avoiding secrets and controlling access. A warning does not prevent disclosure; returning success misrepresents the operation and can break clients; and partial stack traces or raw database messages still expose implementation details.

Question 11

New Multiple answers

Topic: Understanding Application Security, Threats, and Attacks

Skill tested: Distinguishes security validation from functional testing and selects complementary assurance activities.

A software group claims that its Java application is secure because all functional acceptance tests pass. A recent incident showed that a valid user could alter a request parameter to view another customer's data. The organization wants to improve assurance without treating any single testing technique as complete. Development teams can add requirements and automated checks, while a central security group can conduct targeted reviews. Which TWO actions best address the gap? Select TWO.

Correct Answer: D. Add explicit authorization requirements and negative tests that verify users cannot access other customers' records.; E. Include security-focused code review or SAST and targeted DAST or penetration testing as complementary activities.
Explanation:

Functional tests establish that intended behaviors work, but do not necessarily verify security properties such as denying cross-customer access. Explicit authorization requirements and negative tests make that property testable. Security-focused code review or SAST can identify implementation weaknesses, while DAST or targeted penetration testing assesses behavior in a running system; the approaches complement rather than replace one another. Encryption at rest does not enforce per-user authorization, and postponing security checks leaves the same late-discovery problem.

Question 12

New Single answer

Topic: Secure Coding Practices for Session Management:

Skill tested: Configures session cookies and lifecycle controls to reduce browser-based session exposure.

A Spring-based Java application is used over HTTPS, but its session cookie is sent on HTTP requests in a staging environment and remains available to browser scripts. The application also permits long-lived sessions on shared workstations. The production service must keep its current session architecture, and developers can change cookie and timeout settings. Which configuration change is the best baseline improvement?

Correct Answer: D. Mark the session cookie Secure and HttpOnly, set an appropriate SameSite policy, and configure a session lifetime consistent with the application's risk.
Explanation:

The Secure attribute restricts cookie transmission to HTTPS, while HttpOnly prevents ordinary client-side script access to the cookie. An appropriate SameSite setting can reduce some cross-site request risks, and a risk-based lifetime limits exposure on shared devices. These controls complement server-side session invalidation and authorization. JavaScript access increases the consequences of script injection, a longer lifetime extends the attack window, and URL-based session identifiers can leak through histories, logs, or referrer data.

Question 13

New Single answer

Topic: Secure Coding Practices for Error Handling

Skill tested: Prevents sensitive-data exposure and log injection through structured, sanitized security logging.

A Java service logs failed login attempts by concatenating the submitted username and request headers into a text message. An attacker can submit newline characters and control characters, making the log appear to contain forged success events. Logs are shipped to a central system and used during incident response. The team must retain enough context to investigate abuse while preventing forged entries and avoiding storage of credentials. What is the best change?

Correct Answer: B. Use structured logging with appropriate escaping or sanitization, record a limited set of relevant fields, and never log passwords or secrets.
Explanation:

Structured logging and proper escaping prevent attacker-controlled newline or control characters from being interpreted as separate forged records. Limiting fields to relevant metadata supports investigation while avoiding credentials and unnecessary personal data. Logging full request bodies risks retaining passwords, tokens, and other sensitive content. Disabling failure logging sacrifices valuable detection and incident-response evidence. A fixed prefix does not neutralize untrusted data later in the message.