Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不支持ARouter路由框架导致断链 #73

Open
firmianay opened this issue Feb 23, 2024 · 2 comments
Open

不支持ARouter路由框架导致断链 #73

firmianay opened this issue Feb 23, 2024 · 2 comments

Comments

@firmianay
Copy link
Contributor

是在一个漏洞案例里发现的,任意URL加载,即导出组件从外部获取Intent,并传入loadUrl()

攻击链:LoginActivity(导出) -> HomeActivity(非导出) -> ARouter(跳转) -> DemoWebActivity(非导出)

private void jumpByRouters(String url) {
      DemoWebBuilder.from()
              .setWebUrl(url)
              .start();
public DemoWebBuilder setWebUrl(String mWebUrl) {
    mBundle.putString(WebViewConst.BUNDLE_KEY.WEB_URL, mWebUrl);
    return this;
}

public void start() {
    if (mBundle != null) {
          ARouter.getInstance().build(WebViewConst.ROUTER_KEY.WEB_ACTIVITY).withTransition(R.anim.fade_in,
              R.anim.fade_out).with(mBundle).navigation();
    }
}

没办法通过路由WebViewConst.ROUTER_KEY.WEB_ACTIVITY进行关联,导致断链:

@Route(path = WebViewConst.ROUTER_KEY.WEB_ACTIVITY)
public class DemoWebActivity extends SimpleActivity implements WebHandlerDelegate.WebJsBridgeListener, WebEventBusDelegate.WebEventListener {
    private void initView() {
        mUrl = getIntent().getStringExtra(WebViewConst.BUNDLE_KEY.WEB_URL);
        loadUrl(mUrl);
    }
@nkbai
Copy link
Collaborator

nkbai commented Feb 24, 2024

跨activity怎么关联呢?这个一直没有好办法,可以一起讨论一下。

@Route(path = WebViewConst.ROUTER_KEY.WEB_ACTIVITY)
public class DemoWebActivity extends SimpleActivity implements WebHandlerDelegate.WebJsBridgeListener, WebEventBusDelegate.WebEventListener {
    private void initView() {
        mUrl = getIntent().getStringExtra(WebViewConst.BUNDLE_KEY.WEB_URL);
        loadUrl(mUrl);
    }

就看这个片段,这个不是典型的uxss?

@firmianay
Copy link
Contributor Author

跨activity我们是通过关联多个规则扫描结果来解决,这里主要是断在ARouter路由这里,单看DemoWebActivity的话,因为是非导出组件,在处理结果的时候就忽略了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants