Skip to content
View mhamidlad's full-sized avatar
πŸ’­
Detecting php risks.....
πŸ’­
Detecting php risks.....

Block or report mhamidlad

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
mhamidlad/README.md

πŸ›‘οΈ Muhammad Hamid

Cybersecurity Engineer | Application Security (AppSec) | DevSecOps | AI Code Security

WhatsApp Email Portfolio Status

Typing SVG


πŸ“Œ Executive Summary

I work on uncovering security weaknesses across web applications, APIs, cloud environments, CI/CD pipelines, and AI-assisted software β€” and more importantly, engineering robust fixes.

My approach is practical and evidence-driven:

Reproduce the issue βž” Diagnose root cause βž” Engineer the fix βž” Implement regression tests βž” Automate continuous prevention.

With rapid software delivery and the rise of AI-assisted software development, code is shipped faster than ever, but architectural security considerations and subtle vulnerabilities are frequently overlooked. I specialize in identifying these vulnerabilities early and hardening applications before they reach production.


🎯 What I Do

  • Application & API Security: OWASP Top 10, API Security Top 10, secure session management, CSRF/XSS defense.
  • Secure Code Review (SAST): In-depth source code analysis across Python, PHP, JavaScript, and TypeScript codebases.
  • AI-Generated Code Security: Identifying dangerous hallucinations, insecure deserialization, SQL injection, and command injection in AI-assisted code.
  • DevSecOps & CI/CD Hardening: Automated security scanning (SARIF, Ruff, Bandit, Semgrep) integrated into GitHub Actions with least-privilege permissions.
  • Authentication & Access Control (RBAC): Object-level authorization (BOLA/IDOR prevention), multi-tenant ACLs, and cloud security rules.
  • Secrets Detection & Remediation: Automated pipeline secret scanning, credential rotation workflows, and secure environment isolation.
  • Security Testing & Vulnerability Remediation: Engineering defensive patches backed by reproducible automated tests to prevent security regressions.

πŸš€ Featured Flagship Projects

πŸ›‘οΈ PHP Security Audit Toolkit

Repo CI Security

A production-ready command-line security auditing toolkit for PHP applications. Scans PHP source code, Composer lockfiles, Dockerfiles, and GitHub Actions workflows for vulnerabilities.

  • 12+ Detection Rules: SQLi, Command Injection, XSS, Path Traversal, Deserialization, etc.
  • Enterprise Output: Terminal reports, structured JSON, and OASIS SARIF v2.1.0 for GitHub Code Scanning integration.
  • Built with: Python 3.11+, Typer, Rich, PyYAML, Pytest (100% passing tests).

Explore Project βž”

πŸ§ͺ AI Security Fix Lab

Repo CI Tests

Complete vulnerability reproduction and defensive remediation lab covering 8 critical OWASP categories with automated security and regression tests.

  • 8 Interactive Labs: SQLi, Broken Access Control (BOLA), XSS, Insecure File Upload, Password Storage, Command Injection, SSRF, Deserialization.
  • Dual Implementations: Vulnerable and secure code side-by-side with root cause analysis.
  • Built with: Python 3.9 - 3.13, Pytest, bcrypt (74 automated tests).

Explore Project βž”

πŸ” Role-Based Admin Dashboard (RBAC)

Repo Demo Security

A complete role-based access control architecture implementing defense-in-depth authentication and granular permissions on Google Firebase.

  • Dual-Layer Enforcement: UI route protection backed by declarative Firestore security rules to prevent client-side bypasses.
  • Granular Roles: Strict administrative isolation, preventing privilege escalation.

Explore Project βž”

πŸ“§ TempMail Sim - Privacy Shield

Repo Privacy

A privacy-oriented disposable temporary email client interface preventing personal inbox pollution and correlation tracking during untrusted service signups.

Explore Project βž”


πŸ” Security Case Studies & Real-World Fixes

1. Broken Object-Level Authorization (BOLA / IDOR)

  • The Vulnerability: An API endpoint authenticated users but relied solely on client-provided IDs without verifying tenant ownership.
    GET /api/orders/10452 HTTP/1.1
    Authorization: Bearer <valid_token_for_user_A>
    (Changing the ID exposed records belonging to User B).
  • The Engineering Fix: Enforced strict server-side ownership binding in query scopes rather than trusting request parameters:
    # Safe: Verifies tenant ownership directly in the database lookup
    order = db.query(Order).filter(
        Order.id == order_id,
        Order.account_id == current_user.account_id
    ).first_or_404()
  • Key Principle: Authentication verifies identity; Authorization verifies permissions. Both must be enforced independently on every request.

2. SQL Injection in Dynamic Queries

  • The Vulnerability: Dynamic string concatenation or unescaped interpolation in database lookups.
    # Unsafe pattern
    cursor.execute(f"SELECT * FROM users WHERE email = '{user_input}'")
  • The Engineering Fix: Parameterized prepared statements combined with automated regression tests:
    # Secure pattern
    cursor.execute(
        "SELECT id, username, email FROM users WHERE email = %s",
        (user_input,)
    )

3. Hardcoded Secrets & Multi-Stage Remediation

  • The Problem: API keys, database credentials, or tokens inadvertently committed to source code or configuration files.
  • The Remediation Protocol:
    1. Immediate Revocation: Rotate/revoke the active key at the provider level immediately.
    2. History Cleansing: Purge the secret from git history using tools like git-filter-repo.
    3. Environment Isolation: Migrate to secure environment variables or vault secret managers.
    4. Automated Prevention: Deploy pre-commit hooks and CI detection (e.g., Gitleaks, Bandit, custom SAST) to block commits containing high-entropy strings.

4. Command Injection & Unsafe Shell Calls

  • The Vulnerability: Application code delegating system operations through shell interpreters with user input:
    # Unsafe: Shell interpolation allows command chaining (e.g., '127.0.0.1; rm -rf /')
    os.system("ping -c 1 " + ip_address)
  • The Engineering Fix: Use argument-vector subprocess execution with shell=False and strict regex input validation:
    import subprocess
    import ipaddress
    
    # Validate format strictly
    validated_ip = str(ipaddress.ip_address(user_input))
    subprocess.run(["ping", "-c", "1", validated_ip], check=True, shell=False)

5. AI Agent & LLM Application Security

  • The Challenge: LLM agents equipped with system tool calls can be coerced via prompt injection to execute unauthorized actions or exfiltrate private data.
  • Defensive Architecture:
    • Least Privilege for Tools: Disallow destructive tool calls without mandatory human-in-the-loop authorization.
    • Strict Sandboxing: Run agent-generated code inside disposable, network-restricted container runtimes.
    • Output Validation & Schema Enforcement: Validate LLM output against strict JSON schemas before passing to downstream internal APIs.

πŸ› οΈ Technologies & Security Tooling

Core Languages Python PHP JavaScript TypeScript SQL Bash
AppSec & SAST / DAST OWASP Semgrep Bandit SARIF Burp Suite ZAP Nmap
DevSecOps & Cloud GitHub Actions Docker Linux Firebase CI/CD Secrets
AI & LLM Security Prompt Injection AI Agent OWASP LLM AI Code Review

πŸ”„ Security Engineering Lifecycle

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  01 IDENTIFY β”‚ ──> β”‚ 02 VALIDATE  β”‚ ──> β”‚03 UNDERSTAND β”‚
β”‚ Code Review, β”‚     β”‚ Confirm True β”‚     β”‚ Diagnose     β”‚
β”‚ SAST & Scans β”‚     β”‚ Exploitation β”‚     β”‚ Root Cause   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                 β”‚
                                                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  06 PREVENT  β”‚ <── β”‚   05 TEST    β”‚ <── β”‚ 04 REMEDIATE β”‚
β”‚ CI/CD Gates  β”‚     β”‚ Regression & β”‚     β”‚ Implement    β”‚
β”‚ & Automation β”‚     β”‚ Edge Tests   β”‚     β”‚ Secure Fix   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š GitHub Analytics

Hamid's GitHub Stats Top Languages

Hamid's Streak Stats


πŸ’Ό Available for Security Consulting & Audits

I provide dedicated application security assessments, secure code auditing, and vulnerability remediation services for startups, dev agencies, and software engineering teams:

  • AI-Generated Code Security Audits: Reviewing software generated by LLM coding assistants to eliminate hidden vulnerabilities.
  • Application & API Penetration Testing: Identifying authorization flaws, injection patterns, and business logic flaws.
  • Secure Code Review: Line-by-line manual reviews and custom SAST rule implementation.
  • DevSecOps Pipeline Integration: Embedding automated security gates into GitHub Actions and CI/CD pipelines.
  • Remediation Engineering: Working directly with development teams to write, test, and ship security patches.

πŸ“¬ Contact & Inquiries

WhatsApp Email Portfolio

Security First β€’ Evidence Over Assumptions β€’ Fixes Over Findings

Authorized security assessments only. All assessments conducted within strictly defined rules of engagement.

Popular repositories Loading

  1. hamidblog hamidblog Public

    Technical writeups, security notes, and DevSecOps best practice guides

  2. fileflip fileflip Public

    File Converting System by Hamid (WhatsApp: +923167417135)

  3. userroles userroles Public

    Built a secure role-based admin dashboard using Firebase Authentication and Firestore on the Spark plan. Implemented Google and email login, protected routes, admin-only permissions, user managemen…

  4. Temporary-Email- Temporary-Email- Public

    Your Temporary Email Address Forget about spam, advertising mailings, and hacking. Stay safe.

    HTML

  5. abouthamid abouthamid Public

    Personal portfolio & cybersecurity services hub for Muhammad Hamid

  6. php-security-audit-toolkit php-security-audit-toolkit Public

    Find PHP security risks. Understand the findings. Fix them. Verify the results.

    Python