You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POST https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroup}}/providers/Microsoft.ApiManagement/service/{{apimName}}/gateways/managed/listDebugCredentials?api-version=2023-05-01-preview
description: Describes options for dangling subdomain prevention on Azure App Service.
3
+
description: Learn how to prevent dangling subdomain takeovers to reduce the threat of malicious activity.
4
4
ms.topic: concept-article
5
-
ms.date: 10/14/2022
5
+
ms.date: 12/02/2025
6
6
ms.update-cycle: 1095-days
7
7
ms.author: msangapu
8
8
ms.custom: UpdateFrequency3
@@ -13,35 +13,35 @@ ms.service: azure-app-service
13
13
14
14
---
15
15
16
-
# Mitigating subdomain takeovers in Azure App Service
16
+
# Prevent subdomain takeovers in Azure App Service
17
17
18
-
Subdomain takeovers are a common threat for organizations that regularly create and delete many resources. A subdomain takeover can occur when you have a DNS record that points to a deprovisioned Azure resource. Such DNS records are also known as "dangling DNS" entries. Subdomain takeovers enable malicious actors to redirect traffic intended for an organization’s domain to a site performing malicious activity.
18
+
Subdomain takeovers are a common threat for organizations that regularly create and delete many resources. A subdomain takeover can occur when you have a DNS record that points to a deprovisioned Azure resource. Such DNS records are also known as "dangling DNS" entries. Subdomain takeovers allow malicious actors to redirect traffic intended for an organization’s domain to a site performing malicious activity.
19
19
20
20
The risks of subdomain takeover include:
21
21
22
22
- Loss of control over the content of the subdomain
23
23
- Cookie harvesting from unsuspecting visitors
24
24
- Phishing campaigns
25
-
- Further risks of classic attacks such as XSS, CSRF, CORS bypass
25
+
- Further risks of classic attacks such as XSS, CSRF, or CORS bypass
26
26
27
-
Learn more about Subdomain Takeover at [Dangling DNS and subdomain takeover](../security/fundamentals/subdomain-takeover.md).
27
+
To learn more about subdomain takeover, see [Prevent dangling DNS entries and avoid subdomain takeover](../security/fundamentals/subdomain-takeover.md).
28
28
29
-
Azure App Service provides [Name Reservation Service](#how-app-service-prevents-subdomain-takeovers) and [domain verification tokens](#how-you-can-prevent-subdomain-takeovers) to prevent subdomain takeovers.
29
+
Azure App Service provides [name reservation](#how-app-service-prevents-subdomain-takeovers) and [domain verification tokens](#how-you-can-prevent-subdomain-takeovers) to prevent subdomain takeovers.
30
30
31
31
## How App Service prevents subdomain takeovers
32
32
33
-
Upon deletion of an App Service app or App Service Environment (ASE), immediate reuse of the corresponding DNS is forbidden except for subscriptions belonging to the tenant of the subscription that originally owned the DNS. Thus, the customer is afforded some time to either clean-up any associations/pointers to the said DNS or reclaim the DNS in Azure by recreating the resource with the same name. This behavior is enabled by default on Azure App Service for "\*.azurewebsites.net" and "\*.appserviceenvironment.net" resources, so it doesn't require any customer configuration.
33
+
Upon deletion of an App Service app or App Service Environment (ASE), the corresponding DNS is forbidden from reuse except by subscriptions that belong to the tenant of the subscription that originally owned the DNS. Thus, the customer has some time to either cleanup any associations or pointers to the said DNS or reclaim the DNS in Azure by recreating the resource with the same name. This behavior is enabled by default on Azure App Service for `*.azurewebsites.net` and `*.appserviceenvironment.net` resources, so it doesn't require any customer configuration.
34
34
35
-
####Example scenario
35
+
### Example scenario
36
36
37
-
Subscription 'A' and subscription 'B' are the only subscriptions belonging to tenant 'AB'. Subscription 'A' contains an App Service web app 'test' with DNS name 'test'.azurewebsites.net'. Upon deletion of the app, only subscription 'A' or subscription 'B' will be able to immediately reuse the DNS name 'test.azurewebsites.net' by creating a web app named 'test'. No other subscriptions will be allowed to claim the name right after the resource deletion.
37
+
Subscription *A* and subscription *B* are the only subscriptions that belong to tenant *AB*. Subscription *A* contains an App Service web app *test* with DNS name `test.azurewebsites.net`. Upon deletion of the app, only subscriptions *A* or *B* are able to immediately reuse the DNS name `test.azurewebsites.net` by creating a web app named *test*. No other subscriptions are allowed to claim the name right after the resource deletion.
38
38
39
39
## How you can prevent subdomain takeovers
40
40
41
-
When creating DNS entries for Azure App Service, create an asuid.{subdomain} TXT record with the Domain Verification ID. When such a TXT record exists, no other Azure Subscription can validate the Custom Domain or take it over unless they add their token verification ID to the DNS entries.
41
+
When creating DNS entries for Azure App Service, create an *asuid.{subdomain}* TXT record with the domain verification ID. When such a TXT record exists, no other Azure subscription can validate the custom domain or take it over unless they add their token verification ID to the DNS entries.
42
42
43
43
These records prevent the creation of another App Service app using the same name from your CNAME entry. Without the ability to prove ownership of the domain name, threat actors can't receive traffic or control the content.
44
44
45
45
DNS records should be updated before the site deletion to ensure bad actors can't take over the domain between the period of deletion and re-creation.
46
46
47
-
To get a domain verification ID, see the [Map a custom domain tutorial](app-service-web-tutorial-custom-domain.md)
47
+
To get a domain verification ID, see [Set up an existing custom domain in Azure App Service](app-service-web-tutorial-custom-domain.md).
0 commit comments