Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:1796bAbū Bakr b. Abū Shaybah And ʾIsḥāq b. Ibrāhīm > Ibn ʿUyaynah > al-Aswad b. Qays Bihadhā al-Isnād

The Messenger of Allah ﷺ was in a cave (or raid) when his finger was hurt.  

مسلم:١٧٩٦bوَحَدَّثَنَاهُ أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ وَإِسْحَاقُ بْنُ إِبْرَاهِيمَ جَمِيعًا عَنِ ابْنِ عُيَيْنَةَ عَنِ الأَسْوَدِ بْنِ قَيْسٍ بِهَذَا الإِسْنَادِ

وَقَالَ كَانَ رَسُولُ اللَّهِ ﷺ فِي غَارٍ فَنُكِبَتْ إِصْبَعُهُ