Skip to content

Function name validation not being enforced in Worker Indexing #10962

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

Open
mathewc opened this issue Mar 26, 2025 · 0 comments
Open

Function name validation not being enforced in Worker Indexing #10962

mathewc opened this issue Mar 26, 2025 · 0 comments
Labels
Milestone

Comments

@mathewc
Copy link
Member

mathewc commented Mar 26, 2025

Currently it's possible for a .NET Isolated function to define a function name containing slashes, e.g. "components/{id}". You can find examples in Kusto:

All("FunctionsLogs")
| where PreciseTimeStamp > ago(1d)
| where FunctionName contains "/"
| distinct AppName, FunctionName
| take 10

We have regex validation here that runs when functions are created/updated. Traditionally before worker indexing, host indexing would derive the name of the function from the folder on disk where the function.json was found, and because filenames can't contain "/" slashes, we knew the names couldn't contain slashes. The WebJobs SDK during indexing will also validate names applied via FunctionNameAttribute here. However, I believe that only applies to in-proc functions.

It appears that customers may be doing this to define route templates, but this isn't the correct way of doing so. They should be using the "route" property of the http binding to define their routes, as documented here.

I suspect that worker indexing is allowing invalid names through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants