-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strict-validate-path-type does not allow period/dot/. in Exact or Prefix path #11176
Comments
Then does this https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ page also has the words |
And I could be wrong, but |
@longwuyuan You're linking documentation in the context of Kubernetes objects, but these requirements are not the same as used by ingress-nginx for path validation. This documentation does indeed mention that alphanumeric means I looked up the validation of the path as used by ingress-nginx here:
Be that as it may, this is not supported by the path validation in ingress-nginx so you can't even host static files with a file extenstion (index.html for example) using Exact or Prefix paths when See: https://regex101.com/r/WjwI0c/1 I think this is an oversight and that |
thanks @rouke-broersma , maybe we should keep adding thoughts here so it helps make progress.
|
@longwuyuan here is an ingress from my existing homelab: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: bazarr-auth
namespace: authentik
spec:
rules:
- host: bazarr.example.com
http:
paths:
- backend:
service:
name: ak-outpost-authentik-embedded-outpost
port:
number: 9000
path: /outpost.goauthentik.io
pathType: Prefix Log message:
I would say that since I would say that allowing the commonly used |
@longwuyuan I know - host: bazarr.example.com
http:
paths:
path: .outpost.goauthentik.io
pathType: Prefix This might change the host part instead of only the path part of the ingress, which could be a concern. However since |
I think I am trying to see enough text in this issue description here that settles the following thoughts
|
Ingress-nginx implements it's own regex for the path validation, which is not actually exactly the same as the docs you linked. The ingress-nginx docs also do not link to this other documentation, so while one can make the assumption that this is a term shared within the k8s sig-network, it would be an improvement to the docs if it actually mentions this if this is in fact the case. As it stands there is no reason to assume both usages of the term are the same, since the ingress-nginx docs are also not hosted in the same location. You are more familiar with the kubernetes project so for you it makes sense that they are related. For me as an outsider it is not as obvious, so I turned to Google to tell me what alphanumerical characters means, and there I did not find one consistent definition. Some did include
I disagree with you that the On top of that the
In this case I believe the actual change is very minor, it would only involve changing the validating regex I linked above and adding a test case. That said I believe this discussion is currently highly relevant because |
Thank you for pointing this out; many recent changes were due to security issues with path validation and annotations. They were made quickly to prevent these issues. Please feel free to update the documentation to remind folks that they should be Implementation Specific if they have dots in their paths. /kind documentation |
@strongjz: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/triage accepted |
@rouke-broersma are you going to open a PR to update the documentation around this? |
I can do that. Just to be absolutely sure, the current behavior is as intended and changing this is not acceptable to the project? Changing the behavior would ultimately have my preference, because I consider the current behavior less secure from a user perspective |
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach |
For what it's worth, it seems the exclusion of |
@rouke-broersma please only update the docs. |
so as the default changed, the synapse chart I was using has failed trying to add a path for /.well-known/matrix It sounds like from this thread I should submit a PR that updates them to implementation specific, which disables validation right? Or is there still debate if periods are going to be allowed? |
Until kubernetes/ingress-nginx#11176 is addressed. Solution taken from halkeye/home-k8s@a17d48a.
Until kubernetes/ingress-nginx#11176 is addressed. Solution taken from halkeye/home-k8s@a17d48a.
Period is unfortunately not going to be allowed so you will have to change the path type to ImplementationSpecific. |
I think @Gacko put in a PR to allow period and other chars in some places but (as @rouke-broersma poonted out) that pathType value required is |
Could you link the pr? I could not find it |
@Gacko hoping you can comment here about the PR in which you added dot/period and other characters as valid characters. |
The new ingress-nginx doesn't allow `.` in paths of `pathType` `Exact`. The workaround is to use `ImplementationSpecific`. Do this for `/.well-known` paths for Gafaelfawr. See kubernetes/ingress-nginx#11176.
Instead of fixing the validation regex so that it properly validates URL Paths (and https://www.ietf.org/rfc/rfc3986.txt
It seems to me the original issue (CVE) is that the controller is treating the However, Prefix/Exact pathTypes should be treated as literal (not regex) strings, and its validation should conform to the published RFCs. |
I agree, which is why I reported this issue. |
What happened:
The documentation mentions the following text:
However the term
alphanumeric characters
is not specified and the term does not seem to be universally specified either. Some sources for example include special characters inalphanumeric characters
, which seems to defeat the purpose of the strict checking.The current text, depending on the definition of
alphanumeric characters
, seems to suggest that for example the period.
character is not allowed when using Exact or Prefix. This would mean that a path ofhttps://example.com/index.html
,https://example.com/.well-known/openid-configuration
orhttps://example.com/.well-known/acme-challenge/3857265
would be invalid for path type Exact and Prefix. I cannot imagine that it's intentional that all these super common url's would be unsupported by Exact or Prefix.What you expected to happen:
Define the term
alphanumeric characters
as used by this project and allow.
in Exact and Prefix path types./kind documentation
/remove-kind bug
The text was updated successfully, but these errors were encountered: