Additional features, tools, or issues not covered by specific Microsoft Advertising categories
The scan is reporting that the _uetsid cookie created by Microsoft Advertising UET is missing the Secure and HttpOnly attributes. To address this, configure the application so that all cookies are marked as secure and HttpOnly by default, and ensure the site is always accessed over HTTPS.
Key points from the security guidance:
- Mark cookies as Secure when using HTTPS
Cookies created over HTTPS are still sent over HTTP unless theSecureattribute is set. TheSecureflag tells the browser to send the cookie only over HTTPS. For ASP.NET applications this can be enforced globally inweb.config:
This forces the<configuration> <system.web> <httpCookies requireSSL="true" /> </system.web> </configuration>Secureattribute on all cookies, including current and future ones. Note that if the site is still reachable over plain HTTP, this setting will break those HTTP requests because the browser will not send secure cookies over HTTP. The site must be served only over HTTPS. - Mark cookies as HttpOnly
TheHttpOnlyattribute prevents client-side script from reading the cookie, which mitigates cookie theft via XSS. For ASP.NET applications, configure this globally inweb.config:
This sets<system.web> ... <httpCookies httpOnlyCookies="true" requireSSL="true" /> </system.web>HttpOnlyfor all cookies by default. For individual cookies created in code, ensureHttpCookie.HttpOnlyis set totrue:using System.Web; HttpCookie httpCookie = new HttpCookie("cookieName"); httpCookie.HttpOnly = true; // httpCookie.Secure is controlled by requireSSL above - When cookies are created by frameworks or middleware
If the application uses ASP.NET Core, configure cookies to be secure by default using cookie policy middleware, for example:
This ensures cookies are always marked secure; combine with HttpOnly configuration on the specific cookie types (authentication, session, etc.).public class Startup { public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseCookiePolicy( new CookiePolicyOptions { Secure = CookieSecurePolicy.Always }); } } - Client-side cookies and third-party scripts
The scan notes that the cookie change is observed on the client side. If the UET script is setting cookies via JavaScript, theHttpOnlyflag cannot be applied (HttpOnly cookies are not accessible to script by design). In that case, focus on:- Ensuring the site is HTTPS-only and that cookies are at least marked
Securewhere possible. - Ensuring no sensitive data is stored in client-side cookies set by analytics/advertising scripts.
- Ensuring the site is HTTPS-only and that cookies are at least marked
- Caching headers
For responses that carry sensitive cookies (for example, authentication cookies), configure appropriate cache headers to prevent caching in shared caches. This is part of the general recommendation but is separate from theSecure/HttpOnlyflags.
In summary, fix the scan findings by enforcing requireSSL="true" and httpOnlyCookies="true" (or equivalent in ASP.NET Core) so that all server-controlled cookies are Secure and HttpOnly, ensure the site is HTTPS-only, and verify that any UET or other third-party cookies do not contain sensitive data and are at least marked Secure when possible.
References: