Skip to content

Warn on port spoofing /7 - #29463

Merged
Rick-Anderson merged 15 commits into
mainfrom
hostPortSpoof
Jun 14, 2023
Merged

Rick-Anderson merged 15 commits into
mainfrom
hostPortSpoof

Conversation

@Rick-Anderson

@Rick-Anderson Rick-Anderson commented Jun 8, 2023 •

Copy link
Copy Markdown
Contributor

@Rick-Anderson
Rick-Anderson marked this pull request as ready for review June 8, 2023 00:34
@Rick-Anderson
Rick-Anderson requested a review from guardrex June 8, 2023 00:44
@guardrex

guardrex commented Jun 8, 2023

Copy link
Copy Markdown
Collaborator

host port spoofing

Isn't the concern beyond just port spoofing to include the host as well? ... or did you want it with a slash there ... "host/port spoofing"?

RequireAuthorization

I'm not clear on why that would work. I didn't see that that was a solution in dotnet/aspnetcore#46057.

@Rick-Anderson

Copy link
Copy Markdown
Contributor Author

@guardrex check my last commit on host/porr and suggest better wording.

RequireAuthorization

I'm not clear on why that would work. I didn't see that that was a solution in dotnet/aspnetcore#46057.

The PU will likely nix that but I thought I'd add it. It doesn't prevent authorized hosts from spoofing, just unauthorized, lol.

Comment thread aspnetcore/includes/spoof.md Resolved

@guardrex guardrex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm cool, except for this line ...

To prevent unauthorized clients from spoofing the port, call xref:Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization%2A:

... just because I don't think that's going to work.

Comment thread aspnetcore/includes/spoof.md Resolved
Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com>
Comment on lines +105 to +107
To prevent unauthorized clients from spoofing the port, call <xref:Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization%2A>:

:::code language="csharp" source="~/host-and-deploy/health-checks/samples/7.x/HealthChecksSample/Snippets/Program.cs" id="snippet_MapHealthChecksRequireHostPortAuth":::

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed?

@Rick-Anderson
Rick-Anderson requested a review from JamesNK June 8, 2023 18:09
@Rick-Anderson

Copy link
Copy Markdown
Contributor Author

I'm cool, except for this line ...

To prevent unauthorized clients from spoofing the port, call xref:Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization%2A:

... just because I don't think that's going to work.

@JamesNK will decide. It prevents unauthorized clients from port spoofing, but not authorized clients.

Rick-Anderson and others added 2 commits June 8, 2023 08:11
Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com>
@Rick-Anderson
Rick-Anderson requested review from JamesNK and removed request for JamesNK June 9, 2023 21:51
@JamesNK

JamesNK commented Jun 10, 2023

Copy link
Copy Markdown
Member

I'm not familiar with this attack or workaround. I'm not the right person to review.

@Rick-Anderson
Rick-Anderson removed the request for review from JamesNK June 10, 2023 02:29
@Rick-Anderson

Rick-Anderson commented Jun 10, 2023 •

Copy link
Copy Markdown
Contributor Author

@blowdart or @Tratcher can you recommend a reviewer?

@Rick-Anderson
Rick-Anderson requested a review from Tratcher June 13, 2023 19:07
Comment thread aspnetcore/includes/spoof.md Resolved
@Rick-Anderson
Rick-Anderson requested a review from Tratcher June 13, 2023 21:15
Comment thread aspnetcore/includes/spoof.md Resolved
Co-authored-by: Chris Ross <chrross@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsafe pattern for port restriction in documentation

4 participants