定制 bushra/security-scanner 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bushra/security-scanner

最新稳定版本:1.0.0

Composer 安装命令:

composer require bushra/security-scanner

包简介

Laravel Security Scanner Package

README 文档

README

Laravel Security Scanner is a lightweight developer tool that helps identify common security vulnerabilities in Laravel applications such as SQL Injection, mass assignment, unsafe raw queries, and missing validation.

🚀 Features

  • 🔍 Scan Laravel code for vulnerabilities
  • ⚠️ Detect SQL Injection risks
  • 🛑 Identify unsafe raw queries (DB::select, whereRaw, etc.)
  • 📦 Detect mass assignment issues ($request->all())
  • 🧠 Highlight missing validation
  • 📍 Shows file name, line number, and severity
  • ⚡ Easy CLI command integration

📦 Installation

composer require bushra/laravel-security-scanner

⚙️ Usage

Run the scanner using Artisan:

php artisan security:scan

Optional: Scan a specific directory

php artisan security:scan app/Http/Controllers

📊 Example Output

[HIGH] UserController.php (Line 12)
Possible SQL Injection

[HIGH] UserController.php (Line 20)
Mass assignment risk

[MEDIUM] UserController.php (Line 35)
Dynamic orderBy - validate input

🧠 What It Detects

🔴 High Severity

  • SQL Injection (raw queries with variables)
  • Unsafe whereRaw, DB::select, DB::statement
  • Mass assignment ($request->all())

🟠 Medium Severity

  • Dynamic column usage (e.g., orderBy($request->input()))
  • Unsafe update patterns

🟡 Low Severity

  • Missing validation in controller methods

❗ Important Notes

  • This tool uses pattern-based detection (regex)
  • It helps identify common mistakes but does not replace manual code review
  • Always follow Laravel best practices for security

🛠️ Best Practices

  • Use Eloquent or Query Builder instead of raw SQL
  • Always validate user input
  • Avoid $request->all() in create/update
  • Use parameter binding (?) in raw queries

🔧 Roadmap

  • ✅ CLI Scanner
  • ⏳ Web UI Interface
  • ⏳ Auto-fix suggestions
  • ⏳ Configurable rules
  • ⏳ CI/CD integration

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

📄 License

MIT License

👩‍💻 Author

Bushra

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固