Exam Information
Free practice questions with explanations
Eccouncil 312-96 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 15
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Secure Application Design and Architecture
A fintech company is redesigning a Java payment microservice. The team must identify threats early, and the security lead wants a model that classifies each threat by spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege so that mitigations can be mapped to each category during design reviews. The team has limited time before the architecture review board and cannot run a full quantitative risk study. Which approach best meets the requirement?
Correct Answer: CExplanationSTRIDE is the categorisation model that maps threats to spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege, and it is applied per element of a data flow diagram crossing trust boundaries, which fits an architecture review with no time for quantitative work. DREAD is a prioritisation scheme that scores already-identified threats rather than classifying them into those six categories. OCTAVE focuses on organisational assets and risk tolerance, not design-level threat classification. SQUARE produces security requirements through elicitation but does not provide the six-category threat classification the team asked for.
-
2 Question 2 Single choice Secure Coding Practices for Authentication and Authorization
A Spring Boot REST API exposes /api/accounts/{id}. Developers currently check authorization with a controller-level annotation that only verifies the caller is authenticated. Security testing revealed that any authenticated user can read any other user's account by changing the id. The team must fix this without moving authentication out of the existing filter chain and without adding a database round trip for every request in the hot path. Which change best addresses the flaw?
Correct Answer: AExplanationThe flaw is an object-level authorization failure, which role checks alone cannot stop. @PreAuthorize with a SpEL expression that compares the resource owner with the authenticated principal enforces ownership inside the method-security layer without changing the filter chain. Disabling CSRF does nothing for an IDOR and weakens the application. @Secured("ROLE_USER") still lets every ordinary user through, reproducing the defect. Caching the lookup does not add any authorization decision and could serve data to the wrong caller.
-
3 Question 3 Single choice Secure Coding Practices for Cryptography
A healthcare Java application encrypts patient notes with AES in CBC mode before writing them to a database. A code review found that the developer generates a random 16-byte IV per record, stores it alongside the ciphertext, and uses the same secret key for encryption and for computing an HMAC over the ciphertext in a separate step. Auditors report that the implementation must provide confidentiality and integrity together, must not reuse IVs, and must not require a custom provider. Which change is the best fix?
Correct Answer: CExplanationAES/GCM is an authenticated encryption mode, providing confidentiality and integrity in one primitive, and the JCE Cipher class accepts a GCMParameterSpec with a random 12-byte nonce that must never repeat under the same key. This removes the need for a separate HMAC step and avoids custom providers. A sequential counter in a separate table adds a shared state and a concurrency hazard without adding integrity. A deterministic IV derived from the record identifier leaks equality and is a known misuse. Reusing one key for both CBC and HMAC is poor key hygiene, and CBC alone still lacks authenticity even with a stored MAC.
-
4 Question 4 Single choice Secure Coding Practices for Error Handling
A Struts2 application returns a stack trace to users whenever an unhandled exception occurs during login. The security team wants users to see a generic message while operators can still diagnose failures. The company also has a regulatory constraint that the diagnostic record must not contain passwords or session tokens. A developer proposes wrapping the login action in a try-catch that prints e.getMessage() to the response. Which approach best meets all requirements?
Correct Answer: BExplanationCatching the exception at the action boundary, logging it with a correlation ID after sanitising sensitive parameters, and returning a generic message satisfies both the user-facing and the regulatory constraints while keeping operators able to trace failures. Disabling application logging removes the diagnostic capability the operators need. Logging the full request object would store passwords, violating the regulation. Printing to the console keeps the stack trace out of the response but gives no reliable operational record, and does not address the handling inside the action itself.
-
5 Question 5 Single choice Secure Coding Practices for Input Validation
A Spring MVC application accepts a JSON body containing a "sortField" value that is passed to a JPA Criteria query as an ORDER BY expression. The team has a validation layer that rejects requests containing characters outside a regex of letters and digits, but a pentester found that values such as "name desc" are accepted and still change query behaviour. The product owner requires that users can sort by only five approved fields and that the fix must not rely on blacklisting SQL keywords. Which fix should the team implement?
Correct Answer: AExplanationMapping the input to a fixed set of approved fields and then choosing the corresponding Criteria path expressions is an allowlist that makes arbitrary expressions impossible to inject, which is the robust input-validation pattern for identifiers that cannot be parameterised. Extending the regex still depends on enumerating dangerous tokens and misses other constructs such as CASE expressions. Escaping does not apply to ORDER BY identifiers and the original approach is not a native query. A length constraint does nothing against short malicious expressions.
-
6 Question 6 Single choice Secure Coding Practices for Session Management
A Java web application uses Tomcat with the built-in session manager and a Spring Security login form. After login, the application keeps the same JSESSIONID the anonymous visitor received, and in production the cookie is sent over both HTTP and HTTPS because a legacy load balancer still allows port 80. The security team must prevent session fixation and session hijacking through cookie theft, and must not break the existing mixed-protocol redirect path for health checks. Which set of changes best meets these requirements?
Correct Answer: BExplanationSpring Security's session fixation protection migrates the session identifier on authentication, the Secure flag stops the cookie traveling over plain HTTP, HttpOnly prevents script access, and redirecting HTTP to HTTPS at the load balancer removes the plaintext exposure while health checks can still be served through a dedicated path. URL rewriting exposes the session ID in logs and referrers, and short timeouts do not prevent fixation. Invalidating on every request breaks usability and still transmits the cookie over HTTP. Replacing sessions with a JWT moves the problem to token theft and does not fulfil the stated mitigation scope.
-
7 Question 7 Single choice Secure Deployment and Maintenance
A company deploys a Java web application on Apache Tomcat behind a reverse proxy. Penetration testers found that the Tomcat Manager application is reachable from the internet and that the server banner reveals the exact Tomcat version. The operations team must restrict management access, hide version details, and keep the change within the existing deployment pipeline with no downtime for the application. Which measures should the team take? (Choose two.)
Correct Answer: AExplanationTomcat's RemoteAddrValve and RemoteCIDRValve can be placed in the Manager context.xml to restrict access by client address, which keeps the application running while closing the exposure. Setting the server attribute on the Connector and related ServerInfo configuration suppresses the version banner. Deleting webapps does not address the Manager exposure. autoDeploy controls deployment behaviour, not access. Enabling JMX remote adds another management surface rather than closing one.
-
8 Question 8 Single choice Security Requirements Gathering
A bank is starting a requirements workshop for a new Java-based mobile banking backend. The product owner wants security requirements captured as concrete stories that developers can implement, and the security architect needs to show how a malicious insider could abuse the transfer feature so the threat can be validated with stakeholders. The team has only one day and must avoid producing a full risk register. Which artifact pairing best meets these needs?
Correct Answer: DExplanationAbuse cases capture how an attacker or misuser would exploit the feature, and security use cases describe the protective behaviour the system must exhibit, so pairing them gives stakeholders validated threats and implementable requirements in one day. OCTAVE is an organisational risk evaluation that cannot be completed in a day and produces a register rather than stories. STRIDE with test scenarios is a design-level threat analysis rather than a requirements-gathering artifact. DREAD prioritises rather than specifies controls and does not describe the misuse itself.
-
9 Question 9 Single choice Static and Dynamic Application Security Testing (SAST & DAST)
A development team runs a SAST tool on a Java codebase that flags a potential SQL injection in a DAO method. The team also runs a DAST scanner against a staging deployment and gets no finding for the same endpoint. The lead asks why the two tools disagree and which validation step should come next before the defect is closed. Which action is the most appropriate next step?
Correct Answer: BExplanationSAST reasons over code paths and may report a flow that is never reachable or never exploitable, while DAST only sees what the crawler reaches with its payloads. The right next step is to trace the data flow from input to the query and then exercise the endpoint with a proxy-based or manual test to confirm exploitability. Discarding the finding because one DAST run was silent ignores that the crawler may not have reached the path. Disabling the rule removes coverage. Claiming SAST cannot detect injection is incorrect, since data-flow analysis is a standard SAST capability.
-
10 Question 10 Single choice Understanding Application Security, Threats, and Attacks
A retail company's Java order service is vulnerable to a stored cross-site scripting flaw introduced by a recent release. The security champion must explain to the SDLC governance board why the defect escaped earlier stages, so the board can add the most effective preventive control at the requirements and design phases rather than only at testing. Which explanation and control best fit?
Correct Answer: DExplanationThe root cause is a design and coding standard gap: the requirement for context-aware output encoding was not captured, so the defect entered the build. Threat modelling and a secure coding checklist at design time address exactly that gap, which is the preventive control the governance board is seeking. A WAF is a compensating runtime control and does not remove the defect at its source. An outdated IDE is not a credible root cause for a stored XSS flaw. TLS termination does not affect script injection in stored content.
-
11 Question 11 Order list Secure Application Design and Architecture
A healthcare startup is preparing a Java telehealth platform for its first security design review. The architect must produce a threat model that can be used to derive mitigations before any code is written. Arrange the steps in the correct order.
Drag the steps into the correct order, or use the arrows.
- Identify the assets, entry points and actors of the telehealth system from the business context
- Document the mitigation for each identified threat and assign it as a design requirement
- Draw a data flow diagram showing processes, data stores, external entities and trust boundaries
- Apply STRIDE to each element and data flow crossing a trust boundary to enumerate threats
Correct Answer:- Draw a data flow diagram showing processes, data stores, external entities and trust boundaries
- Apply STRIDE to each element and data flow crossing a trust boundary to enumerate threats
- Document the mitigation for each identified threat and assign it as a design requirement
- Identify the assets, entry points and actors of the telehealth system from the business context
ExplanationThe threat modelling process starts from understanding assets, actors and entry points, then produces a data flow diagram that exposes trust boundaries. STRIDE is applied to the elements and flows so that threats are enumerated per category, and only after threats are listed can mitigations be documented and assigned as design requirements. Reversing the diagram and STRIDE steps would enumerate threats without a model of the system to analyse. Listing mitigations before threats would reverse cause and effect.
-
12 Question 12 Order list Secure Coding Practices for Authentication and Authorization
A team is migrating a legacy Java EE application's security to a JAAS-based login module that authenticates users against an LDAP directory and then grants roles. An auditor requires that authentication and authorisation failures are handled without leaking which factor failed, and that roles are only granted after a successful credential check. Arrange the steps in the correct order in which the login module must process a login request.
Drag the steps into the correct order, or use the arrows.
- Map the verified identity to application roles and add them as principals on the subject
- Commit the subject with its principals only after the overall login has succeeded
- Return a generic authentication failure to the caller without indicating whether the username or password was wrong
- Receive the username and password through the callback handler supplied by the application
- Verify the credentials against the directory and set the authenticated status on success
Correct Answer:- Receive the username and password through the callback handler supplied by the application
- Verify the credentials against the directory and set the authenticated status on success
- Commit the subject with its principals only after the overall login has succeeded
- Map the verified identity to application roles and add them as principals on the subject
- Return a generic authentication failure to the caller without indicating whether the username or password was wrong
ExplanationIn JAAS the callback handler first supplies the credentials, the login module verifies them and only then sets authenticated status, and principals are added to the subject before the commit phase finalises the login. Commit only occurs after the overall process succeeds, which keeps roles from being attached to a failed login. The generic failure response is returned when verification fails rather than as a final step after commit. Mapping roles before verification would attach authority to an unverified identity.
-
13 Question 13 Drag and drop Secure Coding Practices for Cryptography
A Java service must protect data at rest, sign release artifacts, secure transport between services, and store master keys without hard-coding them in source. An engineer is reviewing the design and must match each requirement to the mechanism that addresses it. Match each requirement to the service that meets it.
Drag each item onto its matching target. On a phone: tap an item, then tap a target.
Keep the master encryption key outside the application code and host filesystemProtect data in transit between two internal microservicesEncrypt customer records in a database with authenticated encryptionProve that a released JAR was produced by the build team and not alteredMD5 digest of the recordAES with GCM via the javax.crypto Cipher classDigital signature using a private key with java.security.SignatureBase64 encoding of the configuration fileA keystore or secrets manager with access restricted to the service identityTLS using SSLContext with a trusted certificate chainCorrect Answer:- Encrypt customer records in a database with authenticated encryption → AES with GCM via the javax.crypto Cipher class
- Prove that a released JAR was produced by the build team and not altered → Digital signature using a private key with java.security.Signature
- Protect data in transit between two internal microservices → TLS using SSLContext with a trusted certificate chain
- Keep the master encryption key outside the application code and host filesystem → A keystore or secrets manager with access restricted to the service identity
ExplanationAES/GCM through Cipher provides confidentiality and integrity for data at rest, while java.security.Signature with a private key provides the non-repudiable proof of origin needed for artifacts. TLS via SSLContext covers the transport requirement with trusted certificates, and a keystore or secrets manager keeps the master key outside source and the filesystem. An MD5 digest provides no secrecy and is broken for collision resistance, and Base64 is an encoding, not protection, so neither addresses the listed requirements.
-
14 Question 14 Dropdown Secure Coding Practices for Error Handling
A Spring MVC application must return a consistent, non-revealing response for unexpected errors while logging full details server side. A developer is writing the global handler. Complete the handler by selecting the correct value for each blank.
Choose the correct value for each blank.
@ControllerAdvice
public class GlobalErrorHandler {
@ExceptionHandler(Exception.class)
public ResponseEntity handle(Exception ex) {
log.error("Unhandled error, correlationId={}", correlationId, ex);
return ResponseEntity.status().body();
}
}Correct Answer:@ControllerAdvice
public class GlobalErrorHandler {
@ExceptionHandler(Exception.class)
public ResponseEntity handle(Exception ex) {
log.error("Unhandled error, correlationId={}", correlationId, ex);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("An unexpected error occurred");
}
}ExplanationAn unhandled exception should map to HTTP 500 so that clients and monitoring treat it as a server fault, and the response body must be a fixed message, since returning the exception message or stack trace leaks internal detail. The full exception is already passed to the logger in the log statement, so the user-facing body stays generic. A 200 response hides the failure, 404 and 400 misclassify a server fault, and returning toString or the stack trace discloses implementation details.
-
15 Question 15 Dropdown Secure Coding Practices for Input Validation
A Java API receives a numeric account identifier in a query string and passes it to a JDBC PreparedStatement. A reviewer wants the validation applied before the database layer, using a strict format check that rejects anything other than a positive integer of limited length. Complete the validation logic by selecting the correct value for each blank.
Choose the correct value for each blank.
if (!input.matches()) {
throw new IllegalArgumentException("Invalid account id");
}
long id = Long.parseLong(input);
PreparedStatement ps = conn.prepareStatement();Correct Answer:if (!input.matches("[1-9][0-9]{0,18}")) {
throw new IllegalArgumentException("Invalid account id");
}
long id = Long.parseLong(input);
PreparedStatement ps = conn.prepareStatement("SELECT * FROM accounts WHERE id = ?");ExplanationThe regex [1-9][0-9]{0,18} enforces a positive integer with a bounded length, which keeps Long.parseLong from overflowing on the valid range and rejects any injected syntax, so validation is strict rather than blacklisting. The parameterised statement with a placeholder keeps the database layer safe even if validation were bypassed. Accepting any input with .* defeats validation, while concatenating the value into the query reintroduces injection even after parsing. The LIKE variant changes semantics and is not a fix.
These are 15 of the 47 questions in the full 312-96 pack.
Get All 47 QuestionsGet all 47 questions & answers
Full access options for Eccouncil 312-96
Self-study
PDF Version
- 47 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 47 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 47 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the 312-96 Exam (Certified Application Security Engineer (JAVA)) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.