Jupyter Server is the backend for Jupyter web applications. In versions 2.17.0 and earlier, a path traversal vulnerability in the REST API allows an authenticated user to escape the configured root_dir and access sibling directories whose names begin with the same prefix as the root_dir. For example, with a root_dir named "test", the API permits access to a sibling directory named "testtest" through a crafted request to the /api/contents endpoint using encoded path components. An attacker can read, write, and delete files in affected sibling directories. Multi-tenant deployments using predictable naming schemes are particularly at risk, as a user with a directory named "user1" could access directories for user10 through user19 and beyond. A user who can choose a single-character folder name could gain access to a significant number of sibling directories.
Version 2.18.0 contains a fix. As a workaround, ensure folder names do not share a common prefix with any sibling directory.
Jupyter Server versions 2.17.0 and earlier contain a critical path traversal vulnerability in the REST API that allows authenticated users to escape the configured root directory and access sibling directories with matching name prefixes. This vulnerability is particularly severe in multi-tenant deployments where predictable naming schemes are used, enabling attackers to read, write, and delete files across tenant boundaries. With an available exploit and widespread use in research and educational institutions across Saudi Arabia, immediate patching to version 2.18.0 is essential.
IMMEDIATE ACTIONS:
1. Identify all Jupyter Server instances in your environment running versions 2.17.0 or earlier
2. Audit access logs for the /api/contents endpoint to detect potential exploitation attempts
3. Review directory naming schemes for predictable patterns or common prefixes
PATCHING GUIDANCE:
1. Upgrade Jupyter Server to version 2.18.0 or later immediately
2. For pip installations: pip install --upgrade jupyter-server>=2.18.0
3. For conda installations: conda update jupyter-server
4. Restart all Jupyter Server instances after patching
5. Verify patch installation: jupyter server --version
COMPENSATING CONTROLS (if immediate patching not possible):
1. Implement strict access controls limiting authenticated users to their assigned directories only
2. Rename directories to eliminate common prefixes between sibling directories
3. Use random or UUID-based directory naming instead of sequential naming (avoid user1, user2, etc.)
4. Implement network-level access controls restricting /api/contents endpoint access
5. Deploy Web Application Firewall (WAF) rules to detect and block path traversal attempts
6. Enable detailed logging and monitoring of all /api/contents API calls
DETECTION RULES:
1. Monitor for encoded path components in /api/contents requests (../, %2e%2e%2f, etc.)
2. Alert on /api/contents requests accessing directories outside the configured root_dir
3. Track failed authentication attempts followed by successful API calls
4. Monitor for unusual file access patterns across multiple user directories
5. Implement IDS/IPS signatures for path traversal attempts in Jupyter API endpoints
الإجراءات الفورية:
1. تحديد جميع مثيلات Jupyter Server في بيئتك التي تعمل بالإصدارات 2.17.0 أو الأقدم
2. تدقيق سجلات الوصول لنقطة نهاية /api/contents للكشف عن محاولات الاستغلال المحتملة
3. مراجعة أسماء الدلائل للبحث عن أنماط يمكن التنبؤ بها أو بادئات مشتركة
إرشادات التصحيح:
1. ترقية Jupyter Server إلى الإصدار 2.18.0 أو الأحدث فوراً
2. لتثبيتات pip: pip install --upgrade jupyter-server>=2.18.0
3. لتثبيتات conda: conda update jupyter-server
4. إعادة تشغيل جميع مثيلات Jupyter Server بعد التصحيح
5. التحقق من تثبيت التصحيح: jupyter server --version
الضوابط البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تنفيذ ضوابط وصول صارمة تقصر المستخدمين المصرحين على الدلائل المخصصة لهم فقط
2. إعادة تسمية الدلائل لإزالة البادئات المشتركة بين الدلائل الشقيقة
3. استخدام تسمية عشوائية أو قائمة على UUID بدلاً من التسمية المتسلسلة
4. تنفيذ ضوابط الوصول على مستوى الشبكة لتقييد الوصول إلى نقطة نهاية /api/contents
5. نشر قواعد جدار الحماية لتطبيقات الويب (WAF) للكشف عن محاولات المسار المتقاطع وحجبها
6. تفعيل السجلات والمراقبة التفصيلية لجميع استدعاءات API /api/contents
قواعد الكشف:
1. مراقبة المكونات المشفرة للمسار في طلبات /api/contents
2. تنبيهات على طلبات /api/contents التي تصل إلى دلائل خارج root_dir المكون
3. تتبع محاولات المصادقة الفاشلة متبوعة باستدعاءات API الناجحة
4. مراقبة أنماط الوصول غير العادية عبر دلائل المستخدمين المتعددة
5. تنفيذ توقيعات IDS/IPS لمحاولات المسار المتقاطع في نقاط نهاية Jupyter API