취약점 개요
취약점 설명
브로드캐스트 리시버는 안드로이드 4대 컴포넌트 중 하나로, 시스템 및 앱 간에 이벤트를 전달하고 처리하는 데 사용되는 중요한 구성 요소이다. 설정에 문제가 있거나 악의적으로 사용될 경우 보안 위협을 초래할 수 있다.
보안 위협
브로드캐스트 리시버를 악용하여 악성 앱이 정상적인 앱의 브로드캐스트를 가로채거나 변조하는 등의 행위를 할 수 있다.
발생 위치
AndroidManifest.xml
취약점 진단 과정
adb
Step 1) AndroidManifext.xml 확인
브로드캐스트 리시버의 android:exported 속성이 “true”로 설정되어 있는 것을 확인할 수 있다.
<receiver
android:name=".MyBroadCastReceiver"
android:exported="true" >
<intent-filter>
<action android:name="theBroadcast" >
</action>
</intent-filter>
</receiver>
Step 2) 브로드캐스트 리시버 실행
adb에서 브로드캐스트 리시버를 실행 후 logcat을 확인해보면 비밀번호 변경 메시지와 비밀번호가 출력된다.
# am broadcast -a theBroadcast -n [애플리케이션 설치 주소]/[패키지 주소] --es [매개변수 이름] [데이터]
am broadcast -a theBroadcast -n com.android.insecurebankv2/.MyBroadCastReceiver --es phonenumber 5555 --es newpass test


drozer
Step 1) 애플리케이션 취약점 확인
1개의 브로드캐스트 리시버 취약점을 발견하였다.

Step 2) 브로드캐스트 리시버 정보 확인
com.android.insecurebankv2 패키지에서 MyBroadCastReceiver 브로드캐스트를 확인할 수 있다. Permission 권한은 설정되어 있지 않다.
# run app.broadcast.info -a [애플리케이션 설치 주소]
run app.broadcast.info -a com.android.insecurebankv2

Step 3) 브로드캐스트 리시버 실행
drozer에서 브로드캐스트 리시버를 실행 후 logcat을 확인해 보면, 비밀번호가 평문 노출된 것을 확인할 수 있다.
# run app.broadcast.send --component [애플리케이션 설치 주소] [패키지 주소] --extra [매개변수 데이터 유형] [매개변수 이름] [데이터]
run app.broadcast.send --component com.android.insecurebankv2 com.android.insecurebankv2.MyBroadCastReceiver --extra string phonenumber 5555 --extra string newpass test


대응 방안
- AndroidManifest.xml 리시버 항목의 android:exported=”true” 속성을 “false”로 변경한다.
- Permission 권한을 부여한다.
반응형
'Security Study > Android' 카테고리의 다른 글
[InsecureBankv2] 액티비티 컴포넌트 취약점 (0) | 2024.02.22 |
---|---|
[InsecureBankv2] 로컬 암호화 이슈 (0) | 2024.02.19 |
[InsecureBankv2] 취약한 인증 메커니즘 (0) | 2024.02.15 |
[InsecureBankv2] 환경 구축 (0) | 2024.02.08 |
[Android] 안드로이드 4대 컴포넌트 (0) | 2024.02.06 |