Babel is a compiler for writing next generation JavaScript. From 7.12.0 to before 7.29.4 and 8.0.0-alpha.13, using Babel to compile code that was specifically crafted by an attacker can cause Babel to generate output code that executes arbitrary code. This vulnerability is fixed in 7.29.4 and 8.0.0-alpha.13.
CVE-2026-44728 is a critical code injection vulnerability in Babel JavaScript compiler (versions 7.12.0-7.29.3 and 8.0.0-alpha.0 through alpha.12) that allows attackers to inject malicious code through specially crafted input, resulting in arbitrary code execution during compilation. This vulnerability poses significant risk to Saudi development organizations and CI/CD pipelines that rely on Babel for JavaScript transpilation. The vulnerability requires attacker-controlled source code input but can compromise entire build systems and deployed applications.
IMMEDIATE ACTIONS:
1. Inventory all Babel installations across development, CI/CD, and build environments — run 'npm list babel' and 'npm list @babel/core' in all projects
2. Identify projects using vulnerable versions (7.12.0-7.29.3 or 8.0.0-alpha.0 through alpha.12)
3. Restrict code compilation to trusted sources only — implement code review and approval workflows before compilation
4. Isolate build systems from production networks to contain potential compromise
PATCHING GUIDANCE:
1. Upgrade Babel to version 7.29.4 or later (stable branch) or 8.0.0-alpha.13 or later (alpha branch)
2. Update package.json: change 'babel' and '@babel/core' version constraints to >=7.29.4 or >=8.0.0-alpha.13
3. Run 'npm audit fix' to resolve dependency conflicts
4. Rebuild all artifacts and redeploy applications
5. Test thoroughly in staging environment before production deployment
COMPENSATING CONTROLS (if immediate patching not possible):
1. Implement strict input validation on all source code before Babel compilation
2. Use sandboxed build environments with minimal privileges
3. Enable build artifact signing and verification
4. Monitor build logs for suspicious compilation patterns
5. Restrict Babel plugin usage to whitelisted, vetted plugins only
6. Implement network segmentation to prevent lateral movement from compromised builds
DETECTION RULES:
1. Monitor npm/yarn package manager for Babel version downgrades or suspicious version pins
2. Alert on Babel compilation of untrusted or externally-sourced code
3. Detect unusual process execution from build environments (spawning shells, network connections)
4. Monitor for modifications to .babelrc, babel.config.js, or package.json in version control
5. Track build artifact hash changes without corresponding source code changes
الإجراءات الفورية:
1. حصر جميع تثبيتات Babel عبر بيئات التطوير و CI/CD والبناء — قم بتشغيل 'npm list babel' و 'npm list @babel/core' في جميع المشاريع
2. تحديد المشاريع التي تستخدم الإصدارات الضعيفة (7.12.0-7.29.3 أو 8.0.0-alpha.0 إلى alpha.12)
3. تقييد ترجمة الأكواد للمصادر الموثوقة فقط — تنفيذ سير عمل المراجعة والموافقة على الأكواد قبل الترجمة
4. عزل أنظمة البناء عن شبكات الإنتاج لاحتواء الاختراق المحتمل
إرشادات التصحيح:
1. ترقية Babel إلى الإصدار 7.29.4 أو أحدث (الفرع المستقر) أو 8.0.0-alpha.13 أو أحدث (فرع ألفا)
2. تحديث package.json: تغيير قيود إصدار 'babel' و '@babel/core' إلى >=7.29.4 أو >=8.0.0-alpha.13
3. تشغيل 'npm audit fix' لحل تضاربات التبعيات
4. إعادة بناء جميع الأعمال وإعادة نشر التطبيقات
5. الاختبار الشامل في بيئة التجريب قبل نشر الإنتاج
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تنفيذ التحقق الصارم من المدخلات على جميع الأكواد المصدرية قبل ترجمة Babel
2. استخدام بيئات بناء معزولة بامتيازات دنيا
3. تفعيل توقيع التحقق من أعمال البناء
4. مراقبة سجلات البناء للأنماط المريبة في الترجمة
5. تقييد استخدام مكونات Babel الإضافية على المكونات الموثوقة والمدققة فقط
6. تنفيذ تقسيم الشبكة لمنع الحركة الجانبية من عمليات البناء المخترقة
قواعد الكشف:
1. مراقبة مدير الحزم npm/yarn لخفض إصدار Babel أو تثبيت إصدار مريب
2. التنبيه على ترجمة Babel للأكواد غير الموثوقة أو المصدرة خارجياً
3. كشف تنفيذ العمليات غير العادية من بيئات البناء (فتح الأصداف، الاتصالات الشبكية)
4. مراقبة التعديلات على .babelrc أو babel.config.js أو package.json في التحكم بالإصدار
5. تتبع تغييرات بصمة أعمال البناء بدون تغييرات مصدر الكود المقابلة