Huzi Blogs
BlogCategories
BlogCategories
Disclaimer & Data Privacy Policy
Project by huzi.pk

© 2026 blogs.huzi.pk. All Rights Reserved.

    Back to all posts
    Cybersecurity

    The Invisible Burglar: SQL Injection Explained (2026)

    By Huzi

    Some vulnerabilities retire quietly. SQL injection refuses to: it has lived in the OWASP Top 10's injection category for over two decades, not because the fix is missing but because string concatenation keeps creeping back into code. The fix is old, boring and total — and worth knowing cold.

    The input trap

    Take the world's most common login query:

    SELECT * FROM users WHERE username = '$user' AND password = '$pass';
    

    Whatever the visitor typed was glued straight into the statement. Type admin' -- as the username and the quote closes the string while the comment marker eats the remainder:

    SELECT * FROM users WHERE username = 'admin' --' AND password = '...'
    

    The password check simply ceases to exist. UNION variants dump whole tables into the page, blind variants extract data one true-or-false question at a time, and sqlmap automates all of it for whoever points it at your site.

    The fix: parameterized queries

    Never build SQL out of user input. Send the query as a blueprint and bind values strictly as data:

    // Node.js with pg — safe
    const result = await pool.query(
      'SELECT id, username FROM users WHERE email = $1 AND active = $2',
      [userEmail, true]
    );
    
    # Python with sqlite3 — safe
    cursor = conn.execute(
        'SELECT id, username FROM users WHERE email = ? AND active = ?',
        (user_email, 1),
    )
    

    The database compiles the structure first and binds values second, so typing DROP TABLE users into the email field makes the system calmly search for a user with that literal name.

    The ORM trap

    Prisma, Django's ORM, SQLAlchemy and Eloquent parameterize by default — and every one of them offers a raw-query escape hatch. Sooner or later someone writes a raw query with template strings, and the door quietly reopens. The rule survives every framework: user input reaches raw SQL only as a bound parameter, never through interpolation.

    Layers behind the code

    Give the application's database account only the permissions it truly needs — one user for reading, another for writing — so a successful injection cannot DROP or ALTER anything it finds. Keep the database off the public internet. Let a WAF such as ModSecurity or Cloudflare act as a tripwire, then run sqlmap against a staging copy of your own site before a stranger runs it against production.

    Craft is a quiet form of dignity. In Gaza, developers keep shipping careful, parameterised code through power cuts, because "works on my machine" is an excuse their situation has never allowed them.

    Injection succeeds by smuggling unexpected input into a trusted query. Our Umrah packages follow the opposite discipline: at HTG Travels every tier, hotel name and walking distance goes in writing before you pay a single rupee, so nothing unexpected executes later.

    Advertisements


    You Might Also Like

    Decent Embroidered Velvet Party Wear Suit 2025 | Chiffon Dupatta & Plain Silk Trouser

    Decent Embroidered Velvet Party Wear Suit 2025 | Chiffon Dupatta & Plain Silk Trouser

    PKR 7700

    90/70 Quality Schiffli Embroidered Lawn Suit 3-Pc | 4-Side Border Chiffon Dupatta (2025)

    90/70 Quality Schiffli Embroidered Lawn Suit 3-Pc | 4-Side Border Chiffon Dupatta (2025)

    PKR 4950

    Heavy Embroidered Printed Lawn Dress 3-Pc | Plain Chiffon Dupatta

    Heavy Embroidered Printed Lawn Dress 3-Pc | Plain Chiffon Dupatta

    PKR 4800

    Schiffli Embroidered Lawn Suit 3-Pc | 4-Side Border Chiffon Dupatta (2025)

    Schiffli Embroidered Lawn Suit 3-Pc | 4-Side Border Chiffon Dupatta (2025)

    PKR 4900

    Digital Print 90/70 Lawn 3-Piece Suit with Diamond Voil Dupatta (Unstitched)

    Digital Print 90/70 Lawn 3-Piece Suit with Diamond Voil Dupatta (Unstitched)

    PKR 3800

    Advertisements


    Related Posts

    Cybersecurity
    Top 10 Essential Tools in Kali Linux for 2026
    Ten Kali Linux tools that actually earn their keep on real engagements — nmap, Burp Suite, Hashcat, SQLmap and more, each with the one command that matters.

    By Huzi

    Read More
    Cybersecurity
    The Human Operating System: A Guide to Social Engineering in 2026
    How social engineering actually works on the mind — pretexting, vishing, deepfake calls and MFA fatigue — told through real attacks, with defences that go beyond 'just don't click'.

    By Huzi

    Read More
    Cybersecurity
    5 Advanced Cloudflare Features You Should Be Using in 2026
    Workers, R2, Zero Trust, Email Routing and Snippets — the Cloudflare features that matter after the free DNS and caching are already running, with working code for each.

    By Huzi

    Read More
    Cybersecurity
    Web Security Fundamentals 2026: The Complete Problem-Solving Guide
    The 2026 defense-in-depth stack, from a working Next.js headers block to nonce-based CSP, HSTS preload, post-quantum X25519MLKEM768, and the quiet COOP/COEP/CORP trio.

    By Huzi

    Read More
    Cybersecurity
    Linux Security Hardening 2026: The Complete Problem-Solving Guide
    A copy-paste Linux server hardening checklist for 2026: sshd_config, key-based login, firewalld, fail2ban and auditd — in the order that avoids locking yourself out.

    By Huzi

    Read More
    Cybersecurity
    WhatsApp Business for Pakistani SMBs in 2026: The Complete Sales Playbook
    Catalogs that sell across time zones, away messages that cover the gap while you sleep, the 256-broadcast ceiling, template rules, and the settings that keep a business number from being hijacked.

    By Huzi

    Read More