<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Todd Burner on Medium]]></title>
        <description><![CDATA[Stories by Todd Burner on Medium]]></description>
        <link>https://medium.com/@tburner?source=rss-b75659eb5438------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*0M8UTWnVVDfohtt0</url>
            <title>Stories by Todd Burner on Medium</title>
            <link>https://medium.com/@tburner?source=rss-b75659eb5438------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:52:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tburner/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making Sense of Intent Filters in Android 13]]></title>
            <link>https://medium.com/androiddevelopers/making-sense-of-intent-filters-in-android-13-8f6656903dde?source=rss-b75659eb5438------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f6656903dde</guid>
            <category><![CDATA[android-13]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[mobile-security]]></category>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[android-intents]]></category>
            <dc:creator><![CDATA[Todd Burner]]></dc:creator>
            <pubDate>Wed, 06 Jul 2022 17:02:20 GMT</pubDate>
            <atom:updated>2022-07-11T17:48:31.587Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PX8VuYcLzaC-AvOtSPgMRw.png" /></figure><p>Before Android 13, when an app registered an exported component in its manifest and added an <strong>&lt;intent-filter&gt;</strong>, the component could be started by any explicit intent — even those that do not match the intent filter. In some circumstances this can allow other apps to trigger internal-only functionality.</p><p>This behavior has been updated in Android 13. Now intents that specify actions and originate from external apps are delivered to an exported component if and only if the intent matches its declared <strong>&lt;intent-filter&gt;</strong> elements.</p><h3><strong>Counterintuitive</strong></h3><p>In existing Android versions, there are two ways to deliver an intent to a component (such as an <strong>&lt;activity&gt;</strong>) where the intent <strong>does not</strong> match the component’s declared <strong>&lt;intent-filter&gt;</strong> elements:</p><ol><li><a href="https://developer.android.com/guide/components/intents-filters#ExampleExplicit">Explicit intents</a>: intents with a component name set will always be delivered to the component, as long as the sender has permission.</li><li><a href="https://developer.android.com/reference/android/content/Intent#setSelector(android.content.Intent)">Intent selectors</a>: when setting a matching intent as a selector of the main intent, the main intent will always be delivered.</li></ol><p>Developers expected that intent-filters would impact all intents rather than just a subset. In fact we’ve seen a lot of confusion around intent-filters.</p><h3><strong>A Review</strong></h3><p>For each of the following questions, you are presented with the following:</p><ul><li>The creation of an intent object, which is passed to <strong>startActivity()</strong> or <strong>sendBroadcast()</strong>.</li><li>An <strong>&lt;intent-filter&gt;</strong> element.</li></ul><p>Your job is to answer the question: <strong>Will the intent match the intent filter?</strong></p><p>First, the intent:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7e4e3868d524268a9590c1ddf412005/href">https://medium.com/media/b7e4e3868d524268a9590c1ddf412005/href</a></iframe><p>And the intent filter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c5eae2cd1bdf6f28c9cadcda0cd29c2/href">https://medium.com/media/2c5eae2cd1bdf6f28c9cadcda0cd29c2/href</a></iframe><p>No!</p><p>If an intent does not contain any categories, Android will treat it as if <strong>CATEGORY_DEFAULT</strong> to all implicit intents passed to <strong>startActivity</strong>() and <strong>startActivityForResult</strong>(). Note, this behavior is defined if and only if that intent is used to launch an activity. Intent filters must include <strong>CATEGORY_DEFAULT</strong> in order to receive implicit activity intents (<a href="https://developer.android.com/guide/topics/manifest/category-element">documentation</a>). <strong>Note that this only applies when starting an activity. </strong>They do not apply to launching services or sending broadcasts.</p><p>To correctly match this example the intent filter should be implemented as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a5cb9fd015cd5a48b053318dd39d6b9/href">https://medium.com/media/7a5cb9fd015cd5a48b053318dd39d6b9/href</a></iframe><p>How about another one?</p><p>Intent:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6780d4b970af74a9dd77af5eb9d5b293/href">https://medium.com/media/6780d4b970af74a9dd77af5eb9d5b293/href</a></iframe><p>Filter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0386377df889427e92deae1d291b2b99/href">https://medium.com/media/0386377df889427e92deae1d291b2b99/href</a></iframe><p>No again!</p><p>An intent filter must specify a &lt;data&gt; element to accept intents with data (<a href="https://developer.android.com/guide/components/intents-filters#DataTest">documentation</a>). To match it should look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8e7f32fcce5126e7905e9d445c2dcbf/href">https://medium.com/media/c8e7f32fcce5126e7905e9d445c2dcbf/href</a></iframe><h3><strong>One Risk Improved</strong></h3><p>In the past year we found one particular pitfall that we think we can help with, making intent filters work in a more intuitive way.</p><p>Let’s look at it as an example:</p><p>Intent:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43c98cf5247c4b66c1d7ab8c62bdda6b/href">https://medium.com/media/43c98cf5247c4b66c1d7ab8c62bdda6b/href</a></iframe><p>Filter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fab952fa18d9182bd590571dcc4a1a22/href">https://medium.com/media/fab952fa18d9182bd590571dcc4a1a22/href</a></iframe><p>In existing Android versions, yes — the intent does match the filter! This is because explicit intents don’t need to match declared intent filters. When an app declares an exported component in its manifest and adds an &lt;intent-filter&gt;, the component can be started by any intent — even those that do not match the intent filter! This could have caused vulnerabilities in many apps.</p><p>Here is an example we’ve discovered in the wild:</p><p>Code of vulnerable app:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b33ac5ec50a4740ce0644ca443a8284f/href">https://medium.com/media/b33ac5ec50a4740ce0644ca443a8284f/href</a></iframe><p>Components declared in victim’s manifest:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/772dbe6797c0443957787d975764b9fc/href">https://medium.com/media/772dbe6797c0443957787d975764b9fc/href</a></iframe><p>The action <strong>com.example.PRIVATE_INTERNAL_ACTION</strong> is not supposed to be accessible outside of the application, since the receiver that handles it (<strong>InternalReceiver</strong>) is not exported. However, due to the fact that <strong>ExternalReceiver</strong> does not check and guard the incoming action, a malicious actor can do the following to trigger internal functionality:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b51e2cd4c9ebd1ce1e60c59b77f61b4/href">https://medium.com/media/5b51e2cd4c9ebd1ce1e60c59b77f61b4/href</a></iframe><p>For apps that target Android 13+ this has now changed. The next section describes these changes.</p><h3><strong>What’s Changed?</strong></h3><p>Starting for apps targeting Android 13+ (the intent receiving side), all intents originating from external apps are delivered to an exported component if and only if the intent matches its declared <strong>&lt;intent-filter&gt;</strong> elements.</p><p><strong>One big caveat:</strong> If an intent does not specify an action, it passes the intent matching test as long as the filter contains at least one action. This means that you should always handle the case if the incoming intent does not have an action (when intent.<strong>getAction</strong>() returns <strong>null</strong>)!</p><p>Non-matching intents are blocked. Situations where intent matching is not enforced include the following:</p><ul><li>Intents delivered to components that don’t declare any intent filters</li><li>Intents originating within the same app</li><li>Intents originating from the system and from root.</li></ul><p>While this change is great for security reasons — if you were depending on this behavior to make your app interact with another through explicit intents, you may see behavior changes in your app, even if you don’t update to target Android 13.</p><p>With these changes, the malicious actor in our previous example can no longer trigger internal functionality of our victim application on Android 13, assuming the victim application is updated to target Android 13. However, it is still <strong>strongly recommended</strong> to update all exported components to check and only accept actions that are allowed to protect your application when running on older Android versions. Our updated example will be like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f679d805f9b20a0d563bae87e2a6c1fa/href">https://medium.com/media/f679d805f9b20a0d563bae87e2a6c1fa/href</a></iframe><h3><strong>What should I do?</strong></h3><p>First, we should note, the enforcement is only enabled if the <strong>intent receiving app targets Android 13+</strong>. It does NOT affect intents delivered to the same app internally.</p><h3>Intent sending side</h3><p>If you are sending explicit intents (intents with an explicit component name set) to <strong>another app</strong>, ensure that the intent matches the components’ &lt;<strong>intent-filter</strong>&gt; elements. The matching logic is exactly the same as <a href="https://developer.android.com/guide/components/intents-filters#ExampleFilters">resolving implicit intents.</a></p><p>When trying to start an activity with a non-matching explicit intent, you will get an immediate <strong>ActivityNotFoundException</strong> with the message:</p><blockquote>Unable to find explicit activity class {component name}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared &lt;intent-filter&gt;?</blockquote><p>For broadcast receivers and services, there is no obvious signal of failure other than warning logcat messages in the tag “PackageManager”:</p><blockquote>Intent does not match component’s intent filter: &lt;intent description&gt;</blockquote><blockquote>Access blocked: &lt;component name&gt;</blockquote><h3>Intent receiving side</h3><p>Make sure to declare all possible intent filters that your component expects and accepts in <strong>AndroidManifest.xml</strong>.</p><p>Beyond that, if a component only expects explicit intents, consider removing all <strong>&lt;intent-filter&gt;</strong> elements if no filtering is desired. Components with no intent filters will accept any explicit intent.</p><h3>Testing</h3><p>This change is already enabled on Android 13 builds, since Developer Preview 1.</p><p>You can toggle this change using the <a href="https://developer.android.com/guide/app-compatibility/test-debug">compatibility framework</a> UI in developer options, or by entering the following ADB command in a terminal window:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc4ebdc5aced3d9ad378e95e799edbba/href">https://medium.com/media/dc4ebdc5aced3d9ad378e95e799edbba/href</a></iframe><p>Remember that this applies to the app <em>receiving</em> the intent; you cannot disable the change for intents that your app <em>sends</em> to other apps.</p><h3>Going Forward</h3><p>Because this change can affect developers even before they target 13, it’s important to investigate this change and <strong>coordinate an update soon if you use intents</strong> to interact with external apps. For more information, check out our <a href="https://developer.android.com/guide/components/intents-filters">docs that describe intents and intent filters.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f6656903dde" width="1" height="1" alt=""><hr><p><a href="https://medium.com/androiddevelopers/making-sense-of-intent-filters-in-android-13-8f6656903dde">Making Sense of Intent Filters in Android 13</a> was originally published in <a href="https://medium.com/androiddevelopers">Android Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>