<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f" -->

---
title: EVERY junior dev makes these security mistakes...
description: A walkthrough of five common security mistakes junior developers make in login systems, demonstrated using an intentionally vulnerable login page. Covers SQL...
canonical: https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: EVERY junior dev makes these security mistakes... | daily.dev
og:description: A walkthrough of five common security mistakes junior developers make in login systems, demonstrated using an intentionally vulnerable login page. Covers SQL...
og:url: https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f
og:image: https://api.daily.dev/og/posts/dr38Epd4f.png
og:image:alt: EVERY junior dev makes these security mistakes...
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# EVERY junior dev makes these security mistakes...

**[CodeHead](https://daily.dev/sources/codehead)** · 4 min read · 1 upvotes · 0 comments

## Summary

A walkthrough of five common security mistakes junior developers make in login systems, demonstrated using an intentionally vulnerable login page. Covers SQL injection via string concatenation, IDOR (insecure direct object reference) on order endpoints, storing JWTs in local storage versus HTTP-only cookies, missing rate limiting on login attempts, and unsalted SHA-256 password hashing versus salted bcrypt. Each vulnerability is shown being exploited, then fixed. The video is sponsored by CodeRabbit, a code review tool pitched as a way to catch these issues automatically in pull requests and via repository-wide deep scans, with a referral link and free trial offer.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=AjUeQJxen1k>

## Questions this post answers

### why should JWTs be stored in an HTTP-only cookie instead of local storage

Storing a JWT in local storage exposes it in plain text to any script running on the page, making it readable via JavaScript such as an XSS payload. Setting the token as an HTTP-only cookie instead prevents access through document.cookie or localStorage.getItem, while the browser still automatically sends it with each authenticated request in the background.

_Developers hardening login flows track auth storage pitfalls like this one on daily.dev._

### how does an IDOR vulnerability let one user access another user's data

An IDOR (insecure direct object reference) vulnerability occurs when a server checks only that a request is authenticated, not whether the requested resource belongs to that specific user. For example, a logged-in regular user requesting /orders/1 can receive another user's order data if the endpoint only verifies login status rather than matching the order's owner ID to the requesting user's ID.

_Teams auditing API access control follow real-world IDOR examples like this on daily.dev._

### why is unsalted SHA-256 unsafe for storing passwords

Unsalted SHA-256 produces an identical hash every time the same password is registered, so a single database leak combined with precomputed rainbow tables can instantly crack every account sharing that password, with no brute force needed. Using bcrypt with a per-password salt makes the same password generate a different stored value each time, defeating rainbow table attacks.

_Developers choosing a password hashing approach compare bcrypt against SHA-256 tradeoffs on daily.dev._

## Similar posts on daily.dev

- [How to Fix Common Web Application Security Vulnerabilities in Node.js](https://daily.dev/posts/how-to-fix-common-web-application-security-vulnerabilities-in-node-js-nhhyrhesv) · freeCodeCamp · 3 upvotes · 0 comments
- [Build an IDOR Vulnerability Lab: Why WHERE Clauses Don’t Protect Your API.](https://daily.dev/posts/build-an-idor-vulnerability-lab-why-where-clauses-don-t-protect-your-api--wmreqolv5) · InfoSec Write-ups · 0 upvotes · 0 comments
- [A Practical Guide to Secure Authentication for Developers](https://daily.dev/posts/a-practical-guide-to-secure-authentication-for-developers-p5rufwxgq) · SitePoint · 0 upvotes · 0 comments
- [Cryptographic Failures in Authentication and Session Management](https://daily.dev/posts/cryptographic-failures-in-authentication-and-session-management-vqte7bxll) · Security Boulevard · 0 upvotes · 0 comments

---

Tags: [#authentication](https://daily.dev/tags/authentication), [#coderabbit](https://daily.dev/tags/coderabbit), [#jwt](https://daily.dev/tags/jwt), [#sql](https://daily.dev/tags/sql), [#web-security](https://daily.dev/tags/web-security)

[View this post on daily.dev](https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"EVERY junior dev makes these security mistakes...","url":"https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f"},"datePublished":"2026-09-26T14:15:30.826Z","dateModified":"2026-10-29T02:14:50.594Z","description":"A walkthrough of five common security mistakes junior developers make in login systems, demonstrated using an intentionally vulnerable login page. Covers SQL...","image":"https://i.ytimg.com/vi/AjUeQJxen1k/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/AjUeQJxen1k/sddefault.jpg","isAccessibleForFree":true,"articleSection":"CodeHead","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"CodeHead","logo":"https://media.daily.dev/image/upload/s--ywzrIEkA--/f_auto/v1745508579/logos/codehead","url":"https://daily.dev/sources/codehead"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication,coderabbit,jwt,sql,web-security","timeRequired":"PT4M","video":{"@type":"VideoObject","name":"EVERY junior dev makes these security mistakes...","description":"A walkthrough of five common security mistakes junior developers make in login systems, demonstrated using an intentionally vulnerable login page. Covers SQL...","thumbnailUrl":"https://i.ytimg.com/vi/AjUeQJxen1k/sddefault.jpg","uploadDate":"2026-09-26T14:15:30.826Z","duration":"PT4M","url":"https://api.daily.dev/r/dr38Epd4f","embedUrl":"https://www.youtube.com/embed/AjUeQJxen1k"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"CodeHead","item":"https://daily.dev/sources/codehead"},{"@type":"ListItem","position":3,"name":"EVERY junior dev makes these security mistakes..."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/every-junior-dev-makes-these-security-mistakes--dr38epd4f#faq","mainEntity":[{"@type":"Question","name":"why should JWTs be stored in an HTTP-only cookie instead of local storage","acceptedAnswer":{"@type":"Answer","text":"Storing a JWT in local storage exposes it in plain text to any script running on the page, making it readable via JavaScript such as an XSS payload. Setting the token as an HTTP-only cookie instead prevents access through document.cookie or localStorage.getItem, while the browser still automatically sends it with each authenticated request in the background. Developers hardening login flows track auth storage pitfalls like this one on daily.dev."}},{"@type":"Question","name":"how does an IDOR vulnerability let one user access another user's data","acceptedAnswer":{"@type":"Answer","text":"An IDOR (insecure direct object reference) vulnerability occurs when a server checks only that a request is authenticated, not whether the requested resource belongs to that specific user. For example, a logged-in regular user requesting /orders/1 can receive another user's order data if the endpoint only verifies login status rather than matching the order's owner ID to the requesting user's ID. Teams auditing API access control follow real-world IDOR examples like this on daily.dev."}},{"@type":"Question","name":"why is unsalted SHA-256 unsafe for storing passwords","acceptedAnswer":{"@type":"Answer","text":"Unsalted SHA-256 produces an identical hash every time the same password is registered, so a single database leak combined with precomputed rainbow tables can instantly crack every account sharing that password, with no brute force needed. Using bcrypt with a per-password salt makes the same password generate a different stored value each time, defeating rainbow table attacks. Developers choosing a password hashing approach compare bcrypt against SHA-256 tradeoffs on daily.dev."}}]}
```

