29. OWASP Top 10 Web Vulnerabilities
29.6 A07 Authentication and A02 Cryptographic Failures
Identification and authentication failures: weak passwords allowed, no lockout, session tokens that do not change after login, OTP/password reset flaws.
Fixes (much from Chapter 22): enforce strong passphrases, add rate-limiting/lockout and MFA, regenerate the session ID on login, expire sessions, and never reveal "user exists" on login errors.
session_regenerate_id(true); // after a successful login, stop session fixation
Cryptographic failures: sensitive data sent or stored without proper encryption – plain HTTP (Chapter 24), passwords stored with md5, secrets in code.
Fixes: HTTPS everywhere (Chapter 13), password_hash() with bcrypt (Chapter 22), encrypt sensitive data at rest, and keep keys/secrets out of the codebase (use environment variables or a secrets manager, Chapter 30).
Ravindra Bagale's Tip
After a successful login, don't forget session_regenerate_id(true) – otherwise a session fixation attack becomes possible. And always store passwords with password_hash, and use HTTPS, not HTTP. Adopt these three habits and most authentication bugs are avoided.
Ravindra Bagale's Tip – मराठी
Login बरोबर झाल्यावर session_regenerate_id(true) विसरू नका – नाहीतर session fixation attack शक्य होतो. आणि passwords नेहमी password_hash ने, HTTP नाही HTTPS ने. या तीन सवयी लावल्या तर authentication चे बहुतेक bugs टळतात.
Ravindra Bagale's Tip – हिंदी
Login सफल होने के बाद session_regenerate_id(true) मत भूलो – वरना session fixation attack संभव हो जाता है. और passwords हमेशा password_hash से, HTTP नहीं HTTPS से. ये तीन आदतें डाल लीं तो authentication के ज़्यादातर bugs टल जाते हैं.
Lab
On your reels app: confirm login uses password_hash/password_verify, add session_regenerate_id(true) after login, and confirm the site runs over HTTPS. Note whether login errors leak whether a username exists, and fix it to a generic message.
Extended teaching notes
Why this lesson matters
Part 11 turns tool skills into professional defensive practice: web risks, cloud, SOC work, hardening, cryptography, Indian law and careers. Every example below stays inside systems you own or public teaching material.
Indian company (sample data)
Suppose we are a junior security engineer at an Infosys or TCS client project. You take this lesson's checklist, map it to three production services (for example a Spring Boot API, a Node.js portal and a Python job), and open tickets with evidence and owners.
Global practice
Follow public guidance from OWASP, CERT-In, CISA and cloud provider Well-Architected / security pillars. Cite them in reports.
Everyday analogy
A cricket team that only practises hitting but never fielding loses matches. Offence skills in a lab exist to improve fielding in real systems.
Apply across stacks
Wherever code appears, ask the same questions.
Java / Spring Boot
Parameterise queries, encode output, limit Actuator, patch dependencies.
.NET
EF Core parameters, HTTPS, Data Protection API, patch NuGet.
Node.js
helmet, parameterized SQL, npm audit, lockfiles.
Python
ORM, autoescape, pip-audit, Bandit.
Go / PHP / Ruby
Safe templates, prepared statements, govulncheck / composer audit / Brakeman.
nginx / Apache / Tomcat
Hide versions, TLS, least-open ports.
MySQL / PostgreSQL / MongoDB / Redis
No public ports, auth on, least-privilege users.
AWS / Azure / GCP
Roles not keys, private data stores, cloud logs on.
Defender worksheet
- Write a 5-line summary.
- Name one related public breach or advisory.
- Practise one safe command on a lab you own.
- Write the fix for a teammate.
Recap
- Permission first.
- Fix over spectacle.
- Evidence in notes.
Defender's worksheet (do this today)
- Write the lesson title and date.
- List three owned systems where it applies.
- Run one safe lab check and paste evidence.
- Write a two-sentence fix for a teammate.
- Note one CERT-In or CISA advisory that relates (title + date).
Indian workplace (sample)
At a Wipro or LTIMindtree client SOC, turn this lesson into one playbook step with an owner and a due date.
Global practice
Compare your notes with OWASP, CIS Benchmarks or a cloud Well-Architected security question. Write the overlap in five lines.
Family test
Explain the risk and the fix without jargon. If a parent or sibling can repeat the warning, you are ready to teach juniors.
Common mistakes
- Skipping permission.
- Tool collecting without fixing.
- Publishing lab screenshots that contain secrets.
- Treating encoding as encryption.
Recap
- Evidence, fix, owner, date.
- Own lab only.
Key terms for this page
- Control: a safeguard (patch, config, process).
- Finding: a weakness with evidence.
- Remediation: the fix and how you verified it.
- Scope: systems you are allowed to touch.
- Least privilege: only the access required for the task.
- Defence in depth: several controls in layers.
Mini case study
Suppose we are a junior engineer at Zoho or Freshworks (sample data). A weekly review asks each person to present one control from their area. You pick a control from this lesson, show a before/after screenshot from a lab, and list the production ticket you would open. That habit builds both skill and credibility.
Real incident: Radware – an internal Cloud WAF admin API was open on the internet with no login, and customer cloud keys were exposed (Nov 2026)
1. What happened
In this lesson you learnt that A07 means the app does not check properly who is asking. Why does this case matter? Because here a security company left an admin API with no login at all, and it was reachable from the open internet.
- Radware is a security company. It sells a Cloud WAF (web application firewall), bot protection and DDoS protection, and says it has more than 12,500 enterprise and telecom customers.
- A Radware root cause report, seen by BleepingComputer, says that on 19 November 2026 an unauthorized party used an internal-only Cloud WAF management API. The API was reachable from the public internet and did not ask for any authentication.
- Data that may have been read: customer contact details, and for some customers, the credentials used to send WAF logs to their own storage: AWS S3 access keys, Azure Blob Storage keys or SAS tokens, and SFTP logins.
- Radware found the access about 10 hours after it started. It blocked the source IP and the API, and replaced all its internal account credentials.
- The report says WAF protection kept working. Radware found no sign of access to customer app traffic, certificates or end-user data.
- Radware told affected customers to rotate their log-export keys and read their storage access logs from 19 November. Some customers said AWS alerted them about an unknown IP trying to reach their log buckets. Radware was still investigating.
2. How the hack happened (public reporting only – high-level)
- Radware had a management API for its Cloud WAF. It was meant only for internal use.
- By mistake, this API was open to the whole internet.
- Worse, it had no authentication. Anyone who found it could send requests, with no password and no token.
- An outsider found it on 19 November and used it to read customer details and stored log-export keys.
- Stolen keys can be tried against the customers' own cloud storage. That is why some customers saw AWS alerts about an unknown IP.
- Radware noticed about 10 hours later and shut the door.
3. How to stop it / defend (this lesson: A07 authentication failures)
Why: "internal" is a label, not a lock. If an API can be reached and does not check who is calling, it is a public API.
What a team can do:
- Every API must ask for authentication, even internal and admin ones. Use tokens or keys, and check them on every request.
- Keep admin APIs off the internet. Put them on a private network, behind a VPN or an IP allow-list.
- Deny by default. The gateway should reject any request without a valid token, before it reaches the app.
- Look at yourself from outside. Keep a list of all your internet-facing hosts and APIs, and scan them often for anything that answers without login.
- Do not hand out secrets in API replies. Store keys encrypted, show them only once, and give each key the smallest access, for example "write logs only".
- Alert fast on unusual API use, like many requests from a new IP, so you find a problem in minutes, not hours.
Example: a simple "is any admin API open?" drill.
- Rule: no admin or internal API may answer a request from the internet without a valid login.
- Action: from a normal home network, call each admin API address on your list without a token.
- Check: every call must fail or be blocked. If one returns data, close it the same day.
- What it means: you find an open door before an outsider does.
4. How to take care so it won't happen again (checklist)
- [ ] Every API, internal or not, checks login on every request.
- [ ] Admin and management APIs are not reachable from the public internet.
- [ ] We keep a list of internet-facing hosts and APIs and scan it often.
- [ ] Keys we store for customers are encrypted, never shown again in API replies, and have the smallest access.
- [ ] We alert on unusual API use and can block it quickly.
- [ ] If you use a vendor that stores your cloud keys: rotate them after any vendor alert, and read your storage logs.
Source: BleepingComputer, "Radware discloses breach exposing customer cloud access keys", 24 November 2026 (quoting a Radware root cause analysis report shared with BleepingComputer; Radware had not made a public statement at that time).
1. काय झालं
या lesson मध्ये आपण शिकलो की A07 म्हणजे app नीट check करत नाही की request कोण पाठवतंय. ही घटना का महत्वाची आहे? कारण इथे एका security company ने एक admin API कोणत्याही login शिवाय ठेवला होता, आणि तो internet वरून कुणालाही दिसत होता.
- Radware ही एक security company आहे. ती Cloud WAF (web application firewall), bot protection आणि DDoS protection विकते. त्यांच्या मते त्यांचे 12,500 पेक्षा जास्त enterprise आणि telecom customers आहेत.
- BleepingComputer ने पाहिलेल्या Radware च्या root cause report नुसार, 19 नोव्हेंबर 2026 ला एका अनोळखी माणसाने एक फक्त internal वापरासाठी असलेला Cloud WAF management API वापरला. हा API public internet वरून उघडा होता आणि तो कोणतंही authentication मागत नव्हता.
- कोणता data वाचला गेला असेल: customers चे contact details, आणि काही customers साठी, त्यांच्या स्वतःच्या storage मध्ये WAF logs पाठवायचे credentials: AWS S3 access keys, Azure Blob Storage keys किंवा SAS tokens, आणि SFTP logins.
- हे सुरू झाल्यावर साधारण 10 तासांनी Radware ला कळलं. त्यांनी तो IP आणि API block केला, आणि सगळे internal account credentials बदलले.
- Report नुसार WAF protection चालूच होतं. Customer app traffic, certificates किंवा end users च्या data ला कुणी हात लावल्याचं Radware ला दिसलं नाही.
- Radware ने affected customers ना log-export keys rotate करायला आणि 19 नोव्हेंबर पासूनचे storage access logs बघायला सांगितलं. काही customers ना AWS कडून alert आला की एक अनोळखी IP त्यांच्या log buckets मध्ये घुसायचा प्रयत्न करतोय. Radware चं investigation अजून चालू होतं.
2. Hack कसा झाला (फक्त public reporting – high-level)
- Radware कडे Cloud WAF साठी एक management API होता. तो फक्त internal कामासाठी होता.
- चुकून हा API पूर्ण internet ला उघडा राहिला.
- त्यात भर म्हणजे त्याला authentication नव्हतं. ज्याला तो सापडेल तो password किंवा token शिवाय request पाठवू शकत होता.
- 19 नोव्हेंबर ला एका बाहेरच्या माणसाला तो सापडला आणि त्याने customer details आणि ठेवलेल्या log-export keys वाचल्या.
- चोरलेल्या keys customers च्या स्वतःच्या cloud storage वर try करता येतात. म्हणूनच काही customers ना अनोळखी IP बद्दल AWS alerts आले.
- साधारण 10 तासांनी Radware ला कळलं आणि त्यांनी दार बंद केलं.
3. हे कसं थांबवायचं / defend कसं करायचं (हा lesson: A07 authentication failures)
का: "internal" हे फक्त नाव आहे, कुलूप नाही. API पर्यंत कुणी पोहोचू शकत असेल आणि तो कोण call करतंय हे check करत नसेल, तर तो public API च आहे.
Team काय करू शकते:
- प्रत्येक API ने authentication मागलंच पाहिजे, internal आणि admin API सुद्धा. Tokens किंवा keys वापरा, आणि प्रत्येक request ला check करा.
- Admin APIs internet पासून दूर ठेवा. Private network वर, VPN किंवा IP allow-list च्या मागे ठेवा.
- Default ला नकार. Valid token नसलेली request gateway नेच app पर्यंत पोहोचण्याआधी reject करावी.
- बाहेरून स्वतःकडे बघा. Internet वर दिसणाऱ्या सगळ्या hosts आणि APIs ची list ठेवा, आणि login शिवाय उत्तर देणारं काही आहे का ते वारंवार scan करा.
- API च्या reply मध्ये secrets देऊ नका. Keys encrypt करून ठेवा, फक्त एकदाच दाखवा, आणि प्रत्येक key ला कमीत कमी access द्या, उदा. "फक्त logs लिहायचे".
- लवकर alert मिळेल असं ठेवा, उदा. नवीन IP वरून खूप requests आल्या तर. मग प्रॉब्लेम तासांत नाही, मिनिटांत कळतो.
Example: "कोणता admin API उघडा आहे का?" हा सोपा drill.
- Rule: कोणताही admin किंवा internal API internet वरून valid login शिवाय उत्तर देणार नाही.
- Action: साध्या घरच्या network वरून, list मधल्या प्रत्येक admin API ला token शिवाय call करा.
- Check: प्रत्येक call fail किंवा block झाला पाहिजे. एखाद्याने data दिला तर तो त्याच दिवशी बंद करा.
- याचा अर्थ: बाहेरच्या माणसाआधी तुम्हालाच उघडं दार सापडतं.
4. परत असं होऊ नये म्हणून काळजी (checklist)
- [ ] प्रत्येक API, internal असो वा नसो, प्रत्येक request ला login check करतो.
- [ ] Admin आणि management APIs public internet वरून दिसत नाहीत.
- [ ] Internet वर दिसणाऱ्या hosts आणि APIs ची list आहे आणि आम्ही ती वारंवार scan करतो.
- [ ] Customers साठी ठेवलेल्या keys encrypt केलेल्या आहेत, API reply मध्ये परत दिसत नाहीत, आणि त्यांना कमीत कमी access आहे.
- [ ] असामान्य API वापरावर alert येतो आणि आम्ही तो पटकन block करू शकतो.
- [ ] तुमच्या cloud keys एखाद्या vendor कडे असतील तर: vendor चा alert आल्यावर त्या rotate करा, आणि storage logs बघा.
Source: BleepingComputer, "Radware discloses breach exposing customer cloud access keys", 24 नोव्हेंबर 2026 (quoting a Radware root cause analysis report shared with BleepingComputer; Radware had not made a public statement at that time).
1. क्या हुआ
इस lesson में आपने सीखा कि A07 का मतलब है app ठीक से check नहीं करता कि request कौन भेज रहा है. यह घटना क्यों ज़रूरी है? क्योंकि यहाँ एक security company ने एक admin API बिना किसी login के रखा था, और वह खुले internet से पहुँचा जा सकता था.
- Radware एक security company है. यह Cloud WAF (web application firewall), bot protection और DDoS protection बेचती है, और कहती है कि उसके 12,500 से ज़्यादा enterprise और telecom customers हैं.
- BleepingComputer ने Radware की जो root cause report देखी, उसके अनुसार 19 नवंबर 2026 को एक अनजान व्यक्ति ने एक सिर्फ़ internal इस्तेमाल वाला Cloud WAF management API इस्तेमाल किया. यह API public internet से खुला था और कोई authentication नहीं माँगता था.
- कौन सा data पढ़ा गया हो सकता है: customers के contact details, और कुछ customers के लिए, अपने storage में WAF logs भेजने वाले credentials: AWS S3 access keys, Azure Blob Storage keys या SAS tokens, और SFTP logins.
- शुरू होने के लगभग 10 घंटे बाद Radware को पता चला. उन्होंने वह IP और API block किया, और सारे internal account credentials बदल दिए.
- Report के अनुसार WAF protection चलता रहा. Customer app traffic, certificates या end users के data तक पहुँच का कोई निशान Radware को नहीं मिला.
- Radware ने affected customers से log-export keys rotate करने और 19 नवंबर से storage access logs देखने को कहा. कुछ customers को AWS से alert मिला कि एक अनजान IP उनके log buckets तक पहुँचने की कोशिश कर रहा है. Radware की investigation अभी चल रही थी.
2. Hack कैसे हुआ (सिर्फ़ public reporting – high-level)
- Radware के पास Cloud WAF के लिए एक management API था. यह सिर्फ़ internal काम के लिए था.
- गलती से यह API पूरे internet के लिए खुला रह गया.
- ऊपर से इसमें authentication नहीं था. जिसे भी यह मिले, वह बिना password या token के request भेज सकता था.
- 19 नवंबर को एक बाहरी व्यक्ति को यह मिला और उसने customer details और रखी हुई log-export keys पढ़ लीं.
- चोरी हुई keys customers के अपने cloud storage पर try की जा सकती हैं. इसीलिए कुछ customers को अनजान IP के AWS alerts मिले.
- लगभग 10 घंटे बाद Radware को पता चला और उन्होंने दरवाज़ा बंद किया.
3. इसे कैसे रोकें / defend करें (यह lesson: A07 authentication failures)
क्यों: "internal" सिर्फ़ एक नाम है, ताला नहीं. अगर API तक कोई पहुँच सकता है और वह check नहीं करता कि कौन call कर रहा है, तो वह public API ही है.
Team क्या कर सकती है:
- हर API को authentication माँगना ही चाहिए, internal और admin API भी. Tokens या keys इस्तेमाल करें, और हर request पर check करें.
- Admin APIs को internet से दूर रखें. Private network पर, VPN या IP allow-list के पीछे रखें.
- Default में मना. बिना valid token वाली request को gateway ही app तक पहुँचने से पहले reject करे.
- बाहर से खुद को देखें. Internet पर दिखने वाले सभी hosts और APIs की list रखें, और बार-बार scan करें कि कोई बिना login के जवाब तो नहीं देता.
- API के reply में secrets न दें. Keys encrypt करके रखें, सिर्फ़ एक बार दिखाएँ, और हर key को सबसे कम access दें, जैसे "सिर्फ़ logs लिखना".
- जल्दी alert पाएँ, जैसे नए IP से बहुत सारी requests आएँ तो. तब problem घंटों में नहीं, मिनटों में पता चलती है.
Example: "क्या कोई admin API खुला है?" का आसान drill.
- Rule: कोई भी admin या internal API internet से बिना valid login के जवाब नहीं देगा.
- Action: साधारण घर के network से, list के हर admin API को बिना token के call करें.
- Check: हर call fail या block होना चाहिए. अगर कोई data लौटाए, तो उसे उसी दिन बंद करें.
- मतलब: बाहरी व्यक्ति से पहले आपको ही खुला दरवाज़ा मिल जाता है.
4. फिर से ऐसा न हो, इसके लिए ध्यान (checklist)
- [ ] हर API, internal हो या नहीं, हर request पर login check करता है.
- [ ] Admin और management APIs public internet से नहीं दिखते.
- [ ] Internet पर दिखने वाले hosts और APIs की list है और हम उसे बार-बार scan करते हैं.
- [ ] Customers के लिए रखी keys encrypt हैं, API reply में दोबारा नहीं दिखतीं, और उन्हें सबसे कम access है.
- [ ] असामान्य API इस्तेमाल पर alert आता है और हम उसे जल्दी block कर सकते हैं.
- [ ] अगर आपकी cloud keys किसी vendor के पास हैं: vendor का alert आते ही उन्हें rotate करें, और storage logs देखें.
Source: BleepingComputer, "Radware discloses breach exposing customer cloud access keys", 24 नवंबर 2026 (quoting a Radware root cause analysis report shared with BleepingComputer; Radware had not made a public statement at that time).
Ravindra Bagale's Tip
Never trust the word "internal". Before any API goes live, ask one question: what happens if a stranger on the internet calls this with no token? If the answer is anything other than "blocked", it is not ready.
Ravindra Bagale's Tip – मराठी
"Internal" या शब्दावर कधीच विश्वास ठेवू नका. कोणताही API live करण्याआधी एकच प्रश्न विचारा: internet वरच्या एखाद्या अनोळखी माणसाने token शिवाय हा call केला तर काय होईल? उत्तर "block" सोडून दुसरं काही असेल, तर तो अजून ready नाही.
Ravindra Bagale's Tip – हिंदी
"Internal" शब्द पर कभी भरोसा न करें. कोई भी API live करने से पहले एक सवाल पूछें: internet पर कोई अनजान व्यक्ति बिना token के इसे call करे तो क्या होगा? अगर जवाब "block" के अलावा कुछ भी है, तो वह अभी ready नहीं है.
Check if you're safe: Password Strength Checker