devHọc Dev

Week 1 - Day 6: Week 1 Review Quiz

Week 1 – Day 6

30 questions0s
See the answer and explanation right after each question
1
An e-commerce marketplace has an incident: a hacker changes a product's price from 10,000,000 VND to 100 VND for a few minutes before being detected. Which pillar of the CIA triad is violated?
2
In the STRIDE framework, a regular user sends PATCH /api/users/me { "role": "admin" } and the backend accepts the update to the role field from user input. What type of threat is this?
3
In which scenario below is the "Principle of Least Privilege" applied most correctly?
4
Which OWASP Top 10 2021 category rose to #1 and has the highest exploit rate according to real-world bug bounty data?
5
Which category in the OWASP Top 10 2021 is new compared to the 2017 version?
6
A webhook receives a payload from a third party but does not verify the HMAC signature. Which OWASP Top 10 2021 category does this vulnerability belong to?
7
What vulnerability does the following React code have?
function Comment({ html }) {
  return <div dangerouslySetInnerHTML={{ __html: html }} />;
}
8
Which CSP header below provides the lowest security value against XSS?
9
You use SameSite=Lax for the session cookie. Which endpoint below is still at risk of CSRF?
10
Is the following Node.js code safe?
const sql = `SELECT * FROM users WHERE id = ${req.params.id}`;
db.query(sql);
11
An EC2 instance uses IMDSv1 and the app has an SSRF vulnerability that allows fetching arbitrary URLs. How does an attacker exploit it?
12
The endpoint GET /api/invoices/:id/pdf has middleware that verifies the JWT. User A logs in, changes :id in the URL to the ID of User B's invoice → and can download it. What vulnerability is this?
13
Which header below helps prevent clickjacking?
14
You load jQuery from https://cdn.example.com/jquery.js. To protect against the CDN being hacked and the file being modified, you should use:
15
What does the HSTS header Strict-Transport-Security: max-age=31536000; includeSubDomains; preload mean?
16
Why is SHA-256 unsuitable for storing passwords even with a salt?
17
Which algorithm does OWASP 2024 recommend for password hashing in new projects?
18
What is the core difference between a salt and a pepper?
19
A cookie holding a session id needs the HttpOnly flag to prevent which type of attack?
20
When does the JWT alg=none attack work?
21
When should you use RS256 instead of HS256 for JWT?
22
What problem does PKCE solve for public clients (SPA, mobile)?
23
What is the difference between an Access Token and an ID Token (OIDC)?
24
Which claim MUST the Resource Server verify to prevent a "confused deputy" attack (a token for API A replayed against API B)?
25
Why can password + TOTP still not stop phishing 100%?
26
Against which threat is SMS OTP weakest?
27
Why is WebAuthn/Passkey fully phishing-resistant?
28
The endpoint PUT /users/:id (ownership is checked correctly) runs db.users.update(req.params.id, req.body). A user sends the body { "name": "An", "role": "admin" } and becomes an admin. What is this vulnerability and the correct fix?
29
In which scenario does ABAC outperform RBAC?
30
Which of the following is an anti-pattern in authorization?