@azure/msal-node 7.2.1 → 7.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/cache/CacheHelpers.mjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/TokenCache.mjs +1 -1
  4. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  5. package/dist/cache/serializer/Deserializer.mjs +1 -1
  6. package/dist/cache/serializer/Serializer.mjs +1 -1
  7. package/dist/client/BaseClient.mjs +1 -1
  8. package/dist/client/ClientApplication.mjs +11 -15
  9. package/dist/client/ClientApplication.mjs.map +1 -1
  10. package/dist/client/ClientAssertion.mjs +1 -1
  11. package/dist/client/ClientCredentialClient.mjs +1 -1
  12. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  13. package/dist/client/DeviceCodeClient.mjs +1 -1
  14. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  15. package/dist/client/ManagedIdentityClient.mjs +1 -1
  16. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  17. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  18. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  19. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  20. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  21. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  22. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  23. package/dist/client/OnBehalfOfClient.mjs +1 -1
  24. package/dist/client/PublicClientApplication.mjs +1 -1
  25. package/dist/client/SilentRequestCoalescer.mjs +1 -1
  26. package/dist/client/UserFederatedIdentityCredentialClient.mjs +1 -1
  27. package/dist/client/UsernamePasswordClient.mjs +1 -1
  28. package/dist/config/Configuration.mjs +1 -1
  29. package/dist/config/ManagedIdentityId.mjs +1 -1
  30. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  31. package/dist/crypto/CryptoProvider.mjs +1 -1
  32. package/dist/crypto/GuidGenerator.mjs +1 -1
  33. package/dist/crypto/HashUtils.mjs +1 -1
  34. package/dist/crypto/PkceGenerator.mjs +1 -1
  35. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  36. package/dist/error/ManagedIdentityError.mjs +1 -1
  37. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  38. package/dist/error/NodeAuthError.mjs +1 -1
  39. package/dist/index.mjs +1 -1
  40. package/dist/internals.mjs +1 -1
  41. package/dist/network/HttpClient.mjs +1 -1
  42. package/dist/network/HttpClientWithRetries.mjs +1 -1
  43. package/dist/network/LoopbackClient.mjs +1 -1
  44. package/dist/packageMetadata.mjs +2 -2
  45. package/dist/protocol/Authorize.mjs +1 -1
  46. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  47. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  48. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  49. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  50. package/dist/utils/Constants.mjs +1 -1
  51. package/dist/utils/EncodingUtils.mjs +1 -1
  52. package/dist/utils/TimeUtils.mjs +1 -1
  53. package/lib/msal-node.cjs +139 -91
  54. package/lib/msal-node.cjs.map +1 -1
  55. package/package.json +2 -2
  56. package/src/client/ClientApplication.ts +10 -15
  57. package/src/packageMetadata.ts +1 -1
  58. package/types/client/ClientApplication.d.ts.map +1 -1
  59. package/types/packageMetadata.d.ts +1 -1
package/lib/msal-node.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v7.2.1 2026-11-06 */
1
+ /*! @azure/msal-node v7.2.3 2026-11-18 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -151,7 +151,7 @@ class Serializer {
151
151
  }
152
152
  }
153
153
 
154
- /*! @azure/msal-common v16.16.1 2026-11-06 */
154
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
155
155
  /*
156
156
  * Copyright (c) Microsoft Corporation. All rights reserved.
157
157
  * Licensed under the MIT License.
@@ -215,7 +215,7 @@ const ATTRIBUTE_TOKENS = "attribute_tokens";
215
215
  */
216
216
  const POPUP_ORIGIN_CHECK_DONE = "pocd";
217
217
 
218
- /*! @azure/msal-common v16.16.1 2026-11-06 */
218
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
219
219
  /*
220
220
  * Copyright (c) Microsoft Corporation. All rights reserved.
221
221
  * Licensed under the MIT License.
@@ -473,7 +473,7 @@ const EncodingTypes = {
473
473
  UTF8: "utf-8",
474
474
  };
475
475
 
476
- /*! @azure/msal-common v16.16.1 2026-11-06 */
476
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
477
477
  /*
478
478
  * Copyright (c) Microsoft Corporation. All rights reserved.
479
479
  * Licensed under the MIT License.
@@ -502,7 +502,7 @@ function createAuthError(code, correlationId, additionalMessage) {
502
502
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage(code));
503
503
  }
504
504
 
505
- /*! @azure/msal-common v16.16.1 2026-11-06 */
505
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
506
506
 
507
507
  /*
508
508
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -525,7 +525,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
525
525
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
526
526
  }
527
527
 
528
- /*! @azure/msal-common v16.16.1 2026-11-06 */
528
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
529
529
  /*
530
530
  * Copyright (c) Microsoft Corporation. All rights reserved.
531
531
  * Licensed under the MIT License.
@@ -611,7 +611,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
611
611
  userCanceled: userCanceled
612
612
  });
613
613
 
614
- /*! @azure/msal-common v16.16.1 2026-11-06 */
614
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
615
615
 
616
616
  /*
617
617
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -649,7 +649,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
649
649
  };
650
650
  }
651
651
 
652
- /*! @azure/msal-common v16.16.1 2026-11-06 */
652
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
653
653
 
654
654
  /*
655
655
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -715,7 +715,7 @@ function getJWSPayload(authToken, correlationId) {
715
715
  return matches[2];
716
716
  }
717
717
 
718
- /*! @azure/msal-common v16.16.1 2026-11-06 */
718
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
719
719
 
720
720
  /*
721
721
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -803,7 +803,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
803
803
  return updatedAccountInfo;
804
804
  }
805
805
 
806
- /*! @azure/msal-common v16.16.1 2026-11-06 */
806
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
807
807
  /*
808
808
  * Copyright (c) Microsoft Corporation. All rights reserved.
809
809
  * Licensed under the MIT License.
@@ -817,7 +817,7 @@ const AuthorityType = {
817
817
  Ciam: 3,
818
818
  };
819
819
 
820
- /*! @azure/msal-common v16.16.1 2026-11-06 */
820
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
821
821
  /*
822
822
  * Copyright (c) Microsoft Corporation. All rights reserved.
823
823
  * Licensed under the MIT License.
@@ -839,7 +839,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
839
839
  return null;
840
840
  }
841
841
 
842
- /*! @azure/msal-common v16.16.1 2026-11-06 */
842
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
843
843
  /*
844
844
  * Copyright (c) Microsoft Corporation. All rights reserved.
845
845
  * Licensed under the MIT License.
@@ -863,7 +863,7 @@ const ProtocolMode = {
863
863
  EAR: "EAR",
864
864
  };
865
865
 
866
- /*! @azure/msal-common v16.16.1 2026-11-06 */
866
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
867
867
  /**
868
868
  * Returns the AccountInfo interface for this account.
869
869
  * @internal
@@ -1012,7 +1012,7 @@ function isAccountEntity(entity) {
1012
1012
  entity.hasOwnProperty("authorityType"));
1013
1013
  }
1014
1014
 
1015
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1015
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1016
1016
  /*
1017
1017
  * Copyright (c) Microsoft Corporation. All rights reserved.
1018
1018
  * Licensed under the MIT License.
@@ -1029,7 +1029,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
1029
1029
  unexpectedError: unexpectedError
1030
1030
  });
1031
1031
 
1032
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1032
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1033
1033
 
1034
1034
  /*
1035
1035
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1049,7 +1049,7 @@ function createClientConfigurationError(errorCode, correlationId) {
1049
1049
  return new ClientConfigurationError(errorCode, correlationId);
1050
1050
  }
1051
1051
 
1052
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1052
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1053
1053
  /*
1054
1054
  * Copyright (c) Microsoft Corporation. All rights reserved.
1055
1055
  * Licensed under the MIT License.
@@ -1089,7 +1089,7 @@ function getResponseHeader(headers, name) {
1089
1089
  return headerName === undefined ? undefined : headers[headerName];
1090
1090
  }
1091
1091
 
1092
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1092
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1093
1093
  /*
1094
1094
  * Copyright (c) Microsoft Corporation. All rights reserved.
1095
1095
  * Licensed under the MIT License.
@@ -1159,7 +1159,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1159
1159
  urlParseError: urlParseError
1160
1160
  });
1161
1161
 
1162
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1162
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1163
1163
  /*
1164
1164
  * Copyright (c) Microsoft Corporation. All rights reserved.
1165
1165
  * Licensed under the MIT License.
@@ -1171,7 +1171,7 @@ function isOpenIdConfigResponse(response) {
1171
1171
  response.hasOwnProperty("jwks_uri"));
1172
1172
  }
1173
1173
 
1174
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1174
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1175
1175
  /*
1176
1176
  * Copyright (c) Microsoft Corporation. All rights reserved.
1177
1177
  * Licensed under the MIT License.
@@ -1251,12 +1251,18 @@ class StringUtils {
1251
1251
  }
1252
1252
  }
1253
1253
 
1254
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1254
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1255
1255
 
1256
1256
  /*
1257
1257
  * Copyright (c) Microsoft Corporation. All rights reserved.
1258
1258
  * Licensed under the MIT License.
1259
1259
  */
1260
+ // Matches ASCII controls, space, DEL, backslash, or the userinfo separator (@).
1261
+ const UNSAFE_AUTHORITY = /[\x00-\x20\x7f\\@]/;
1262
+ const DEFAULT_PORTS = {
1263
+ "https:": ":443",
1264
+ "http:": ":80",
1265
+ };
1260
1266
  /**
1261
1267
  * Url object class which can perform various transformations on url strings.
1262
1268
  */
@@ -1372,6 +1378,29 @@ class UrlString {
1372
1378
  AbsolutePath: match[5],
1373
1379
  QueryString: match[7],
1374
1380
  };
1381
+ let parsedUrl;
1382
+ try {
1383
+ parsedUrl = new URL(this.urlString);
1384
+ }
1385
+ catch {
1386
+ throw createClientConfigurationError(urlParseError, this.correlationId);
1387
+ }
1388
+ const host = urlComponents.HostNameAndPort?.toLowerCase();
1389
+ const schemeAndAuthority = `${urlComponents.Protocol}//${host}`;
1390
+ const defaultPort = DEFAULT_PORTS[parsedUrl.protocol] ?? "";
1391
+ /*
1392
+ * Cross-check the original host; reparsing parsedUrl would hide parser differences.
1393
+ * URL has validated IPv6 syntax, so only bracketed hosts need a normalization comparison.
1394
+ */
1395
+ const hostMatches = host === parsedUrl.host ||
1396
+ host === `${parsedUrl.host}${defaultPort}` ||
1397
+ (host?.startsWith("[") &&
1398
+ new URL(`${urlComponents.Protocol}//${host}`).host ===
1399
+ parsedUrl.host);
1400
+ // Check authority ambiguity without restricting resource paths, queries, or fragments.
1401
+ if (UNSAFE_AUTHORITY.test(schemeAndAuthority) || !hostMatches) {
1402
+ throw createClientConfigurationError(urlParseError, this.correlationId);
1403
+ }
1375
1404
  let pathSegments = urlComponents.AbsolutePath.split("/");
1376
1405
  pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements
1377
1406
  urlComponents.PathSegments = pathSegments;
@@ -1409,7 +1438,7 @@ class UrlString {
1409
1438
  }
1410
1439
  }
1411
1440
 
1412
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1441
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1413
1442
 
1414
1443
  /*
1415
1444
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1563,7 +1592,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1563
1592
  return null;
1564
1593
  }
1565
1594
 
1566
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1595
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1567
1596
  /*
1568
1597
  * Copyright (c) Microsoft Corporation. All rights reserved.
1569
1598
  * Licensed under the MIT License.
@@ -1581,7 +1610,7 @@ const AzureCloudInstance = {
1581
1610
  AzureUsGovernment: "https://login.microsoftonline.us",
1582
1611
  };
1583
1612
 
1584
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1613
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1585
1614
  /*
1586
1615
  * Copyright (c) Microsoft Corporation. All rights reserved.
1587
1616
  * Licensed under the MIT License.
@@ -1591,7 +1620,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1591
1620
  response.hasOwnProperty("metadata"));
1592
1621
  }
1593
1622
 
1594
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1623
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1595
1624
  /*
1596
1625
  * Copyright (c) Microsoft Corporation. All rights reserved.
1597
1626
  * Licensed under the MIT License.
@@ -1601,7 +1630,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1601
1630
  response.hasOwnProperty("error_description"));
1602
1631
  }
1603
1632
 
1604
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1633
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1605
1634
  /*
1606
1635
  * Copyright (c) Microsoft Corporation. All rights reserved.
1607
1636
  * Licensed under the MIT License.
@@ -1663,7 +1692,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1663
1692
  */
1664
1693
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1665
1694
 
1666
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1695
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1667
1696
  /*
1668
1697
  * Copyright (c) Microsoft Corporation. All rights reserved.
1669
1698
  * Licensed under the MIT License.
@@ -1699,7 +1728,8 @@ const invoke = (callback, eventName, logger, telemetryClient, correlationId) =>
1699
1728
  catch (e) {
1700
1729
  logger.trace(`Error occurred in '${eventName}'`, correlationId);
1701
1730
  try {
1702
- logger.trace(JSON.stringify(e), correlationId);
1731
+ // Prevent numeric error details from being treated as minified log hashes.
1732
+ logger.tracePii(`Error details: '${JSON.stringify(e)}'`, correlationId);
1703
1733
  }
1704
1734
  catch (e) {
1705
1735
  logger.trace("Unable to print error message.", correlationId);
@@ -1743,7 +1773,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1743
1773
  .catch((e) => {
1744
1774
  logger.trace(`Error occurred in '${eventName}'`, correlationId);
1745
1775
  try {
1746
- logger.trace(JSON.stringify(e), correlationId);
1776
+ logger.tracePii(`Error details: '${JSON.stringify(e)}'`, correlationId);
1747
1777
  }
1748
1778
  catch (e) {
1749
1779
  logger.trace("Unable to print error message.", correlationId);
@@ -1756,12 +1786,26 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1756
1786
  };
1757
1787
  };
1758
1788
 
1759
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1789
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1760
1790
 
1761
1791
  /*
1762
1792
  * Copyright (c) Microsoft Corporation. All rights reserved.
1763
1793
  * Licensed under the MIT License.
1764
1794
  */
1795
+ // Starts with an ASCII letter; remaining characters are ASCII letters, digits, or hyphens.
1796
+ const REGION_NAME_PATTERN = /^[a-z][a-z0-9-]*$/i;
1797
+ // A region becomes a DNS label, limited to 63 octets by RFC 1035 section 2.3.4.
1798
+ const MAX_REGION_NAME_LENGTH = 63;
1799
+ /**
1800
+ * Whether a region can safely be used as a single DNS label.
1801
+ */
1802
+ function isValidRegion(region) {
1803
+ return (typeof region === "string" &&
1804
+ region.length <= MAX_REGION_NAME_LENGTH &&
1805
+ REGION_NAME_PATTERN.test(region) &&
1806
+ // Keep the trailing-hyphen rule explicit rather than complicating the pattern.
1807
+ !region.endsWith("-"));
1808
+ }
1765
1809
  class RegionDiscovery {
1766
1810
  constructor(networkInterface, logger, performanceClient, correlationId) {
1767
1811
  this.networkInterface = networkInterface;
@@ -1821,12 +1865,16 @@ class RegionDiscovery {
1821
1865
  regionDiscoveryMetadata.region_source =
1822
1866
  RegionDiscoverySources.ENVIRONMENT_VARIABLE;
1823
1867
  }
1824
- // If no region was auto detected from the environment or from the IMDS endpoint, mark the attempt as a FAILED_AUTO_DETECTION
1825
- if (!autodetectedRegionName) {
1868
+ // Untrusted discovery values must be a single DNS label before becoming a host prefix.
1869
+ if (!autodetectedRegionName || !isValidRegion(autodetectedRegionName)) {
1870
+ if (autodetectedRegionName) {
1871
+ this.logger.warning("Region discovery returned an invalid region. Using the global authority.", this.correlationId);
1872
+ }
1826
1873
  regionDiscoveryMetadata.region_source =
1827
1874
  RegionDiscoverySources.FAILED_AUTO_DETECTION;
1875
+ return null;
1828
1876
  }
1829
- return autodetectedRegionName || null;
1877
+ return autodetectedRegionName;
1830
1878
  }
1831
1879
  /**
1832
1880
  * Make the call to the IMDS endpoint
@@ -1867,7 +1915,7 @@ RegionDiscovery.IMDS_OPTIONS = {
1867
1915
  },
1868
1916
  };
1869
1917
 
1870
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1918
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1871
1919
  /*
1872
1920
  * Copyright (c) Microsoft Corporation. All rights reserved.
1873
1921
  * Licensed under the MIT License.
@@ -1922,7 +1970,7 @@ function delay(t, value) {
1922
1970
  return new Promise((resolve) => setTimeout(() => resolve(value), t));
1923
1971
  }
1924
1972
 
1925
- /*! @azure/msal-common v16.16.1 2026-11-06 */
1973
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1926
1974
 
1927
1975
  /*
1928
1976
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2209,7 +2257,7 @@ function serializeAttributeTokens(attributeTokens) {
2209
2257
  return [...attributeTokens].sort().join(" ");
2210
2258
  }
2211
2259
 
2212
- /*! @azure/msal-common v16.16.1 2026-11-06 */
2260
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
2213
2261
 
2214
2262
  /*
2215
2263
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3062,6 +3110,9 @@ class Authority {
3062
3110
  * @param region string
3063
3111
  */
3064
3112
  static buildRegionalAuthorityString(host, region, correlationId, queryString) {
3113
+ if (!isValidRegion(region)) {
3114
+ throw createClientConfigurationError(urlParseError, correlationId);
3115
+ }
3065
3116
  // Create and validate a Url string object with the initial authority string
3066
3117
  const authorityUrlInstance = new UrlString(host, correlationId);
3067
3118
  authorityUrlInstance.validateAsUri();
@@ -3072,7 +3123,7 @@ class Authority {
3072
3123
  }
3073
3124
  // Include the query string portion of the url
3074
3125
  const url = UrlString.constructAuthorityUriFromObject({
3075
- ...authorityUrlInstance.getUrlComponents(),
3126
+ ...authorityUrlParts,
3076
3127
  HostNameAndPort: hostNameAndPort,
3077
3128
  }, correlationId).urlString;
3078
3129
  // Add the query string if a query string was provided
@@ -3177,7 +3228,7 @@ function buildStaticAuthorityOptions(authOptions) {
3177
3228
  };
3178
3229
  }
3179
3230
 
3180
- /*! @azure/msal-common v16.16.1 2026-11-06 */
3231
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3181
3232
 
3182
3233
  /*
3183
3234
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3211,7 +3262,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3211
3262
  }
3212
3263
  }
3213
3264
 
3214
- /*! @azure/msal-common v16.16.1 2026-11-06 */
3265
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3215
3266
 
3216
3267
  /*
3217
3268
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3407,7 +3458,7 @@ class ScopeSet {
3407
3458
  }
3408
3459
  }
3409
3460
 
3410
- /*! @azure/msal-common v16.16.1 2026-11-06 */
3461
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3411
3462
 
3412
3463
  /*
3413
3464
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3925,7 +3976,7 @@ function addAttributeTokens(parameters, attributeTokens) {
3925
3976
  }
3926
3977
  }
3927
3978
 
3928
- /*! @azure/msal-common v16.16.1 2026-11-06 */
3979
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3929
3980
 
3930
3981
  /*
3931
3982
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3992,7 +4043,7 @@ function mapToQueryString(parameters) {
3992
4043
  return queryParameterArray.join("&");
3993
4044
  }
3994
4045
 
3995
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4046
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3996
4047
 
3997
4048
  /*
3998
4049
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4040,7 +4091,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
4040
4091
  },
4041
4092
  };
4042
4093
 
4043
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4094
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4044
4095
 
4045
4096
  /*
4046
4097
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4063,7 +4114,7 @@ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
4063
4114
  },
4064
4115
  };
4065
4116
 
4066
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4117
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4067
4118
  /*
4068
4119
  * Copyright (c) Microsoft Corporation. All rights reserved.
4069
4120
  * Licensed under the MIT License.
@@ -4338,12 +4389,12 @@ class Logger {
4338
4389
  }
4339
4390
  }
4340
4391
 
4341
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4392
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4342
4393
  /* eslint-disable header/header */
4343
4394
  const name$1 = "@azure/msal-common";
4344
- const version$1 = "16.16.1";
4395
+ const version$1 = "16.17.0";
4345
4396
 
4346
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4397
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4347
4398
  /*
4348
4399
  * Copyright (c) Microsoft Corporation. All rights reserved.
4349
4400
  * Licensed under the MIT License.
@@ -4351,7 +4402,7 @@ const version$1 = "16.16.1";
4351
4402
  const cacheQuotaExceeded = "cache_quota_exceeded";
4352
4403
  const cacheErrorUnknown = "cache_error_unknown";
4353
4404
 
4354
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4405
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4355
4406
 
4356
4407
  /*
4357
4408
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4389,7 +4440,7 @@ function createCacheError(e) {
4389
4440
  }
4390
4441
  }
4391
4442
 
4392
- /*! @azure/msal-common v16.16.1 2026-11-06 */
4443
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4393
4444
 
4394
4445
  /*
4395
4446
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5616,7 +5667,7 @@ class DefaultStorageClass extends CacheManager {
5616
5667
  }
5617
5668
  }
5618
5669
 
5619
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5670
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5620
5671
  /*
5621
5672
  * Copyright (c) Microsoft Corporation. All rights reserved.
5622
5673
  * Licensed under the MIT License.
@@ -5630,7 +5681,7 @@ class DefaultStorageClass extends CacheManager {
5630
5681
  const PerformanceEventStatus = {
5631
5682
  InProgress: 1};
5632
5683
 
5633
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5684
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5634
5685
 
5635
5686
  /*
5636
5687
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5688,7 +5739,7 @@ class StubPerformanceClient {
5688
5739
  }
5689
5740
  }
5690
5741
 
5691
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5742
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5692
5743
 
5693
5744
  /*
5694
5745
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5786,7 +5837,7 @@ function isOidcProtocolMode(config) {
5786
5837
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5787
5838
  }
5788
5839
 
5789
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5840
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5790
5841
  /*
5791
5842
  * Copyright (c) Microsoft Corporation. All rights reserved.
5792
5843
  * Licensed under the MIT License.
@@ -5813,7 +5864,7 @@ function isOidcProtocolMode(config) {
5813
5864
  }
5814
5865
  }
5815
5866
 
5816
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5867
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5817
5868
 
5818
5869
  /*
5819
5870
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5834,7 +5885,7 @@ function createJoseHeaderError(code, correlationId) {
5834
5885
  return new JoseHeaderError(code, correlationId);
5835
5886
  }
5836
5887
 
5837
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5888
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5838
5889
  /*
5839
5890
  * Copyright (c) Microsoft Corporation. All rights reserved.
5840
5891
  * Licensed under the MIT License.
@@ -5859,7 +5910,7 @@ function isPlainObject(value) {
5859
5910
  return Object.getPrototypeOf(value) === proto;
5860
5911
  }
5861
5912
 
5862
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5913
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5863
5914
  /*
5864
5915
  * Copyright (c) Microsoft Corporation. All rights reserved.
5865
5916
  * Licensed under the MIT License.
@@ -5869,7 +5920,7 @@ const missingAlgError = "missing_alg_error";
5869
5920
  const missingJwkError = "missing_jwk_error";
5870
5921
  const invalidJwkError = "invalid_jwk_error";
5871
5922
 
5872
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5923
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5873
5924
 
5874
5925
  /*
5875
5926
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5935,7 +5986,7 @@ class JoseHeader {
5935
5986
  }
5936
5987
  }
5937
5988
 
5938
- /*! @azure/msal-common v16.16.1 2026-11-06 */
5989
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5939
5990
 
5940
5991
  /*
5941
5992
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6036,7 +6087,7 @@ class PopTokenGenerator {
6036
6087
  }
6037
6088
  }
6038
6089
 
6039
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6090
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6040
6091
 
6041
6092
  /*
6042
6093
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6191,7 +6242,7 @@ class DpopProofGenerator {
6191
6242
  }
6192
6243
  }
6193
6244
 
6194
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6245
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6195
6246
  /*
6196
6247
  * Copyright (c) Microsoft Corporation. All rights reserved.
6197
6248
  * Licensed under the MIT License.
@@ -6255,7 +6306,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6255
6306
  uiNotAllowed: uiNotAllowed
6256
6307
  });
6257
6308
 
6258
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6309
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6259
6310
 
6260
6311
  /*
6261
6312
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6322,7 +6373,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
6322
6373
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6323
6374
  }
6324
6375
 
6325
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6376
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6326
6377
 
6327
6378
  /*
6328
6379
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6341,7 +6392,7 @@ class ServerError extends AuthError {
6341
6392
  }
6342
6393
  }
6343
6394
 
6344
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6395
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6345
6396
 
6346
6397
  /*
6347
6398
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6409,7 +6460,7 @@ function parseRequestState(base64Decode, state, correlationId) {
6409
6460
  }
6410
6461
  }
6411
6462
 
6412
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6463
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6413
6464
 
6414
6465
  /*
6415
6466
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6837,7 +6888,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6837
6888
  return baseAccount;
6838
6889
  }
6839
6890
 
6840
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6891
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6841
6892
  /*
6842
6893
  * Copyright (c) Microsoft Corporation. All rights reserved.
6843
6894
  * Licensed under the MIT License.
@@ -6847,7 +6898,7 @@ const CcsCredentialType = {
6847
6898
  UPN: "UPN",
6848
6899
  };
6849
6900
 
6850
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6901
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6851
6902
  /*
6852
6903
  * Copyright (c) Microsoft Corporation. All rights reserved.
6853
6904
  * Licensed under the MIT License.
@@ -6866,7 +6917,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
6866
6917
  }
6867
6918
  }
6868
6919
 
6869
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6920
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6870
6921
 
6871
6922
  /*
6872
6923
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6890,7 +6941,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
6890
6941
  };
6891
6942
  }
6892
6943
 
6893
- /*! @azure/msal-common v16.16.1 2026-11-06 */
6944
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6894
6945
 
6895
6946
  /*
6896
6947
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6980,7 +7031,7 @@ function getRetryAfterHeader(response) {
6980
7031
  return undefined;
6981
7032
  }
6982
7033
 
6983
- /*! @azure/msal-common v16.16.1 2026-11-06 */
7034
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6984
7035
 
6985
7036
  /*
6986
7037
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7011,7 +7062,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
7011
7062
  return new NetworkError(error, httpStatus, responseHeaders);
7012
7063
  }
7013
7064
 
7014
- /*! @azure/msal-common v16.16.1 2026-11-06 */
7065
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7015
7066
 
7016
7067
  /*
7017
7068
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7145,7 +7196,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
7145
7196
  return response;
7146
7197
  }
7147
7198
 
7148
- /*! @azure/msal-common v16.16.1 2026-11-06 */
7199
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7149
7200
 
7150
7201
  /*
7151
7202
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7188,7 +7239,8 @@ class AuthorizationCodeClient {
7188
7239
  throw createClientAuthError(requestCannotBeMade, request.correlationId);
7189
7240
  }
7190
7241
  // Check for new cloud instance
7191
- if (authCodePayload && authCodePayload.cloud_instance_host_name) {
7242
+ if (this.config.authOptions.instanceAware === true &&
7243
+ authCodePayload?.cloud_instance_host_name) {
7192
7244
  await invokeAsync(this.updateTokenEndpointAuthority.bind(this), UpdateTokenEndpointAuthority, this.logger, this.performanceClient, request.correlationId)(authCodePayload.cloud_instance_host_name, request.correlationId);
7193
7245
  }
7194
7246
  const reqTimestamp = nowSeconds();
@@ -7412,7 +7464,7 @@ class AuthorizationCodeClient {
7412
7464
  }
7413
7465
  }
7414
7466
 
7415
- /*! @azure/msal-common v16.16.1 2026-11-06 */
7467
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7416
7468
 
7417
7469
  /*
7418
7470
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7566,7 +7618,7 @@ function extractLoginHint(account) {
7566
7618
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7567
7619
  }
7568
7620
 
7569
- /*! @azure/msal-common v16.16.1 2026-11-06 */
7621
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7570
7622
 
7571
7623
  /*
7572
7624
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7801,7 +7853,7 @@ class RefreshTokenClient {
7801
7853
  }
7802
7854
  }
7803
7855
 
7804
- /*! @azure/msal-common v16.16.1 2026-11-06 */
7856
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7805
7857
 
7806
7858
  /*
7807
7859
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8067,7 +8119,7 @@ class ServerTelemetryManager {
8067
8119
  }
8068
8120
  }
8069
8121
 
8070
- /*! @azure/msal-common v16.16.1 2026-11-06 */
8122
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8071
8123
 
8072
8124
  /*
8073
8125
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8194,7 +8246,7 @@ class SilentFlowClient {
8194
8246
  }
8195
8247
  }
8196
8248
 
8197
- /*! @azure/msal-common v16.16.1 2026-11-06 */
8249
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8198
8250
 
8199
8251
  /*
8200
8252
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10244,7 +10296,7 @@ class ClientAssertion {
10244
10296
 
10245
10297
  /* eslint-disable header/header */
10246
10298
  const name = "@azure/msal-node";
10247
- const version = "7.2.1";
10299
+ const version = "7.2.3";
10248
10300
 
10249
10301
  /*
10250
10302
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10610,23 +10662,19 @@ class ClientApplication {
10610
10662
  */
10611
10663
  async acquireTokenByCode(request, authCodePayLoad) {
10612
10664
  this.logger.info("acquireTokenByCode called", request.correlationId || "");
10613
- let validatedAuthCodePayload = authCodePayLoad;
10614
- if (request.state && validatedAuthCodePayload) {
10665
+ // Only returned state is trusted for comparison; request values own code and nonce.
10666
+ const validatedAuthCodePayload = {
10667
+ code: request.code,
10668
+ nonce: request.nonce,
10669
+ };
10670
+ if (authCodePayLoad) {
10671
+ validatedAuthCodePayload.state = authCodePayLoad.state;
10672
+ }
10673
+ if (request.state && authCodePayLoad) {
10615
10674
  this.logger.info("acquireTokenByCode - validating state", request.correlationId || "");
10616
10675
  this.validateState(request.state, validatedAuthCodePayload.state || "", request.correlationId || "");
10617
- validatedAuthCodePayload = {
10618
- ...validatedAuthCodePayload,
10619
- state: "",
10620
- };
10676
+ validatedAuthCodePayload.state = "";
10621
10677
  }
10622
- const expectedNonce = request.nonce !== undefined
10623
- ? request.nonce
10624
- : validatedAuthCodePayload?.nonce;
10625
- validatedAuthCodePayload = {
10626
- ...validatedAuthCodePayload,
10627
- code: request.code,
10628
- nonce: expectedNonce,
10629
- };
10630
10678
  const validRequest = {
10631
10679
  ...request,
10632
10680
  ...(await this.initializeBaseRequest(request)),