-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Bug]: isAllowedURI disregards custom protocols #5468
Comments
Suggest change: Make |
Good catch, I think that we need to respect the |
@nperez0111 Same as this one, latest releases says this is fixed, but issue is still opened. |
Yep this is resolved |
I think a custom checker function would be better. This approach still disallows our custom links if they don't start with a protocol (they're transformed to include protocols elsewhere in our code, since we control the execution environment) and it forces inclusion of unsupported protocols - we don't support We still have to patch in ~50 lines, essentially copied from It's not feasible for us to adapt to the current approach. I understand if you feel this is not worth implementing, but it's disappointing to have to duplicate 50 lines of code just to add an ability to pass a custom checker function (2 lines of code.) |
Appreciate the concern here @Nantris if you like could you create a PR to see that this is addressed? Obviously my main concern was fixing the regression so I prioritized that. Now that we have that fixed we can figure out the better solution. It is already strange with a validate function and custom protocol handling I do feel a custom checker is in order with some of our changes as a default that can be overriden or something |
Thanks for the reply @nperez0111! I'll be happy to do so. It's not a high priority right now since I'm running behind on other things, but I'd love to eliminate the code duplication so I'll definitely loop back on this! |
Affected Packages
extension-link
Version(s)
2.5.9
Bug Description
The
link
extension accepts custom protocols, but then it rejects them anyway since the XSS fix: https://github.com/ueberdosis/tiptap/blob/84febb29c7092ba0393af78fb44be29e0befa3f4/packages/extension-link/src/link.ts#L112C9-L114C1Browser Used
Chrome
Code Example URL
No response
Expected Behavior
Custom protocols should be allowed - eg
file://
is necessary in our case.Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: