A vulnerability was detected in SourceCodester Pharmacy Sales and Inventory System 1.0. This issue affects some unknown processing of the file /ajax.php?action=chk_prod_availability. The manipulation of the argument ID results in sql injection. The attack may be performed from remote. The exploit is now public and may be used.
CVE-2026-6187 is a critical SQL injection vulnerability in SourceCodester Pharmacy Sales and Inventory System 1.0 affecting the /ajax.php?action=chk_prod_availability endpoint. The vulnerability allows remote attackers to manipulate the ID parameter to execute arbitrary SQL queries, potentially leading to unauthorized data access, modification, or deletion. With a CVSS score of 7.3 and public exploit availability, this poses an immediate threat to healthcare organizations and pharmacies in Saudi Arabia.
IMMEDIATE ACTIONS:
1. Identify all instances of SourceCodester Pharmacy Sales and Inventory System 1.0 in your environment
2. Isolate affected systems from production networks if possible
3. Implement network-level access controls to restrict access to /ajax.php endpoints
4. Enable comprehensive logging and monitoring of all database queries
PATCHING GUIDANCE:
1. Contact SourceCodester for security patches or upgrade to a patched version
2. If no patch is available, consider migrating to alternative pharmacy management systems
3. Implement Web Application Firewall (WAF) rules to block SQL injection attempts
COMPENSATING CONTROLS:
1. Deploy WAF with SQL injection detection signatures
2. Implement input validation and parameterized queries at application level
3. Apply principle of least privilege to database user accounts
4. Enable database activity monitoring and alerting
5. Conduct regular security audits of the application
6. Implement rate limiting on /ajax.php endpoints
7. Use prepared statements and stored procedures
DETECTION RULES:
1. Monitor for SQL keywords in ID parameter (UNION, SELECT, DROP, INSERT, UPDATE, DELETE)
2. Alert on unusual database query patterns or failed authentication attempts
3. Track database error messages in application logs
4. Monitor for multiple rapid requests to /ajax.php?action=chk_prod_availability
الإجراءات الفورية:
1. تحديد جميع حالات نظام SourceCodester للصيدليات والمبيعات والمخزون الإصدار 1.0 في بيئتك
2. عزل الأنظمة المتأثرة عن شبكات الإنتاج إن أمكن
3. تطبيق عناصر التحكم في الوصول على مستوى الشبكة لتقييد الوصول إلى نقاط نهاية /ajax.php
4. تفعيل السجلات الشاملة ومراقبة جميع استعلامات قاعدة البيانات
إرشادات التصحيح:
1. الاتصال بـ SourceCodester للحصول على تصحيحات أمان أو الترقية إلى نسخة مصححة
2. إذا لم يكن هناك تصحيح متاح، فكر في الهجرة إلى أنظمة إدارة صيدليات بديلة
3. تطبيق قواعد جدار حماية تطبيقات الويب (WAF) لحجب محاولات حقن SQL
عناصر التحكم التعويضية:
1. نشر WAF مع توقيعات كشف حقن SQL
2. تطبيق التحقق من صحة المدخلات والاستعلامات المعاملة على مستوى التطبيق
3. تطبيق مبدأ أقل امتياز على حسابات مستخدمي قاعدة البيانات
4. تفعيل مراقبة نشاط قاعدة البيانات والتنبيهات
5. إجراء عمليات تدقيق أمان منتظمة للتطبيق
6. تطبيق تحديد معدل على نقاط نهاية /ajax.php
7. استخدام الاستعلامات المعدة والإجراءات المخزنة
قواعد الكشف:
1. مراقبة كلمات SQL الرئيسية في معامل ID (UNION, SELECT, DROP, INSERT, UPDATE, DELETE)
2. التنبيه على أنماط استعلامات قاعدة البيانات غير العادية أو محاولات المصادقة الفاشلة
3. تتبع رسائل خطأ قاعدة البيانات في سجلات التطبيق
4. مراقبة الطلبات السريعة المتعددة إلى /ajax.php?action=chk_prod_availability