🌍 Back-end Web Developement · flashcards
Back-end Web Developement Security Flashcards
50 question-and-answer cards covering Security as it is examined in Back-end Web Developement. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Security deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
What is a cryptographic hash function, and what are its key properties?
A hash function maps arbitrary-length input to a fixed-length output (digest). Key properties: deterministic, fast to compute, pre-image resistant (one-way), second pre-image resistant, and collision resistant.
What does 'collision resistance' mean for a hash function?
Collision resistance means it is computationally infeasible to find two distinct inputs $x \neq y$ such that $H(x) = H(y)$.
Why are MD5 and SHA-1 considered insecure today?
Both are broken with respect to collision resistance — practical collision attacks exist (MD5 fully broken, SHA-1 collisions demonstrated), so they must not be used for security-critical purposes like digital signatures or certificates.
Why should password hashing use algorithms like bcrypt, scrypt, or Argon2 instead of SHA-256?
General-purpose hashes like SHA-256 are too fast, enabling brute-force/GPU attacks. bcrypt, scrypt, and Argon2 are deliberately slow and (for scrypt/Argon2) memory-hard, with a tunable work factor, making password cracking far more expensive.
What is a salt in password hashing, and what attack does it prevent?
A salt is a unique random value added to each password before hashing. It ensures identical passwords produce different hashes, defeating precomputed rainbow-table attacks and preventing detection of duplicate passwords.
What is the difference between hashing and encryption?
Hashing is a one-way function that cannot be reversed and produces a fixed-length digest (used for integrity/passwords). Encryption is a two-way, reversible function using a key that turns plaintext into ciphertext and back (used for confidentiality).
What is an HMAC?
HMAC (Hash-based Message Authentication Code) combines a cryptographic hash function with a secret key to provide both data integrity and authentication, computed as $\text{HMAC}(K, m) = H\big((K \oplus opad)\ \|\ H((K \oplus ipad)\ \|\ m)\big)$.
What is SQL Injection (SQLi)?
SQL Injection is a vulnerability where an attacker inserts or 'injects' malicious SQL into an application's query — via untrusted input — causing the database to execute unintended commands, potentially reading, modifying, or deleting data.
Give a classic example of a SQL injection authentication bypass payload.
Entering ' OR '1'='1 as the username/password turns WHERE username='' OR '1'='1' into an always-true condition, bypassing authentication because $\text{'1'='1'}$ is always true.
What is the single most effective defense against SQL injection?
Using parameterized queries (prepared statements) with bound parameters, so user input is always treated as data and never as executable SQL code. Stored procedures and ORMs (used correctly) also help.
Name the main categories/classifications of SQL injection.
In-band (Error-based and Union-based), Blind/Inferential (Boolean-based and Time-based), and Out-of-band SQL injection.
What is Blind SQL injection?
Blind SQLi is a variant where the application does not return query results or errors directly. The attacker infers data by observing the application's behavior — true/false responses (Boolean-based) or response delays (time-based).
Why is input validation alone insufficient to fully prevent SQL injection?
Input validation (allowlisting) reduces risk but can be bypassed and may miss edge cases; it does not change how the query is constructed. Parameterization is required because it structurally separates code from data regardless of input content.
What is Cross-Site Scripting (XSS)?
XSS is a vulnerability where an attacker injects malicious client-side scripts (usually JavaScript) into web pages viewed by other users, causing the victim's browser to execute the attacker's code in the site's context.
Name and describe the three types of XSS.
Stored (Persistent): the payload is saved on the server and served to victims. Reflected: the payload is reflected off the server in the immediate response (e.g. via a URL parameter). DOM-based: the vulnerability is entirely in client-side JavaScript that writes untrusted data to the DOM.
What can an attacker achieve with a successful XSS attack?
Steal session cookies/tokens, hijack sessions, perform actions as the user, capture keystrokes, deface pages, redirect users to malicious sites, or deliver malware — all in the victim's authenticated context.
What is the primary defense against XSS?
Context-aware output encoding/escaping of untrusted data when rendering it into HTML, and input validation. Additional defenses include a Content Security Policy (CSP) and setting the HttpOnly flag on session cookies.
How does a Content Security Policy (CSP) help mitigate XSS?
CSP is an HTTP response header that restricts which sources of scripts, styles, and other resources the browser may load/execute, blocking inline scripts and unauthorized origins — limiting the impact of injected code.
What does the HttpOnly cookie flag do in relation to XSS?
HttpOnly prevents client-side JavaScript from reading the cookie via document.cookie, so even if XSS occurs, the attacker's script cannot directly steal the session cookie.
What is Cross-Site Request Forgery (CSRF)?
CSRF is an attack that tricks an authenticated user's browser into sending an unwanted, forged request to a web application in which they are logged in, causing state-changing actions to be performed without the user's intent.
Why does CSRF work — what does it exploit?
It exploits the browser's automatic inclusion of credentials (like session cookies) with every request to a site, plus the site's trust that a request coming from the user's browser is intentional.
What is the primary defense against CSRF?
Anti-CSRF tokens (synchronizer tokens): a unique, unpredictable, per-session/per-request token that the server generates and validates on state-changing requests. It works because an attacker's site cannot read or guess the token.
How does the SameSite cookie attribute help prevent CSRF?
SameSite (set to Lax or Strict) instructs the browser not to send the cookie on cross-site requests, so a forged request from an attacker's origin arrives without the session cookie, defeating the CSRF attack.
Contrast XSS and CSRF in one sentence each.
XSS exploits the user's trust in a website by injecting and running malicious scripts in the victim's browser. CSRF exploits the website's trust in the user's browser by forging authenticated requests the user did not intend.
What this deck covers
The Security deck follows the Back-end Web Developement Security syllabus — 3 chapters and 8 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 16.7 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 215 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Security flashcards FAQ
How many Security flashcards are in this Back-end Web Developement deck?
50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these Back-end Web Developement flashcards free?
Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.
What do the Security cards cover?
They follow the Back-end Web Developement Security syllabus — 3 chapters and 8 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.