Skip to content

Commit 46fb02d

Browse files
hubertchaoDevtools-frontend LUCI CQ
authored andcommitted
Local Network Access: Add LNA CORS issue descriptions
Modeled off of https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4654400 https://screenshot.googleplex.com/439ixiEdMGb9kTh Bug: 395895368 Change-Id: I954b2db7feed3856d864491a1e42390b604b3a73 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6330471 Reviewed-by: Mathias Bynens <[email protected]> Commit-Queue: Hubert Chao <[email protected]> Reviewed-by: Simon Zünd <[email protected]>
1 parent 7812dfc commit 46fb02d

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ grd_files_release_sources = [
449449
"front_end/models/issues_manager/descriptions/corsHeaderDisallowedByPreflightResponse.md",
450450
"front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md",
451451
"front_end/models/issues_manager/descriptions/corsInvalidHeaderValues.md",
452+
"front_end/models/issues_manager/descriptions/corsLocalNetworkAccessPermissionDenied.md",
452453
"front_end/models/issues_manager/descriptions/corsMethodDisallowedByPreflightResponse.md",
453454
"front_end/models/issues_manager/descriptions/corsNoCorsRedirectModeNotFollow.md",
454455
"front_end/models/issues_manager/descriptions/corsOriginMismatch.md",

front_end/core/host/UserMetrics.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,9 @@ export enum IssueCreated {
11341134
'SRIMessageSignatureIssue::ValidationFailedSignatureExpired' = 108,
11351135
'SRIMessageSignatureIssue::ValidationFailedInvalidLength' = 109,
11361136
'SRIMessageSignatureIssue::ValidationFailedSignatureMismatch' = 110,
1137+
'CorsIssue::LocalNetworkAccessPermissionDenied' = 111,
11371138
/* eslint-enable @typescript-eslint/naming-convention */
1138-
MAX_VALUE = 111,
1139+
MAX_VALUE = 112,
11391140
}
11401141

11411142
export const enum DeveloperResourceLoaded {

front_end/models/issues_manager/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ devtools_issue_description_files = [
103103
"corsHeaderDisallowedByPreflightResponse.md",
104104
"corsInsecurePrivateNetwork.md",
105105
"corsInvalidHeaderValues.md",
106+
"corsLocalNetworkAccessPermissionDenied.md",
106107
"corsMethodDisallowedByPreflightResponse.md",
107108
"corsNoCorsRedirectModeNotFollow.md",
108109
"corsOriginMismatch.md",

front_end/models/issues_manager/CorsIssue.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import {Issue, IssueCategory, IssueKind} from './Issue.js';
1010
import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
1111

1212
const UIStrings = {
13+
/**
14+
*@description Label for the link for CORS Local Network Access issues
15+
*/
16+
corsLocalNetworkAccess: 'Local Network Access',
1317
/**
1418
*@description Label for the link for CORS private network issues
1519
*/
@@ -246,13 +250,20 @@ export class CorsIssue extends Issue<IssueCode> {
246250
linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
247251
}],
248252
};
253+
case IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED:
254+
return {
255+
file: 'corsLocalNetworkAccessPermissionDenied.md',
256+
links: [{
257+
link: 'https://chromestatus.com/feature/5152728072060928',
258+
linkTitle: i18nString(UIStrings.corsLocalNetworkAccess),
259+
}],
260+
};
249261
case IssueCode.PREFLIGHT_MISSING_ALLOW_EXTERNAL:
250262
case IssueCode.PREFLIGHT_INVALID_ALLOW_EXTERNAL:
251263
case IssueCode.INVALID_PRIVATE_NETWORK_ACCESS:
252264
case IssueCode.UNEXPECTED_PRIVATE_NETWORK_ACCESS:
253265
case IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE:
254266
case IssueCode.PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED:
255-
case IssueCode.LOCAL_NETWORK_ACCESS_PERMISSION_DENIED:
256267
return null;
257268
}
258269
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Ensure that local network requests are compatible with upcoming restrictions
2+
3+
A site requested a resource from a network that it could only access because of
4+
its users' privileged network position.
5+
6+
These requests expose devices and servers to the internet, increasing the risk
7+
of a cross-site request forgery (CSRF) attack and/or information leakage.
8+
9+
To mitigate these risks, Chrome will begin requiring the user grant explicit
10+
permission before a site can make local network requests. Local network requests
11+
are those that go to either private IP addresses, .local domains, or loopback
12+
addresses. Additionally, Chrome will block local network requests (both
13+
subframes and subresources) when initiated from non-secure contexts.
14+
15+
If the user explicitly grants the permission, the site can make local network
16+
requests over HTTP for hostnames that are private IP addresses, .local
17+
hostnames, or to localhost. Sites can also set the `targetAddressSpace` fetch
18+
option to `private` or `local` to mark requests as being local network requests,
19+
which will allow them to be made over HTTP.

0 commit comments

Comments
 (0)