previene el spoofing de dominios en validación de enlaces + agrega dominios relevantes en el validador#7
Open
valnssh wants to merge 6 commits intopmemoli:mainfrom
Open
previene el spoofing de dominios en validación de enlaces + agrega dominios relevantes en el validador#7valnssh wants to merge 6 commits intopmemoli:mainfrom
valnssh wants to merge 6 commits intopmemoli:mainfrom
Conversation
❌ Deploy Preview for machete-exactas failed.
|
…o para incluir gitlab como fuente válida
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
La implementación actual de
validateLinkutilizaincludespara verificar si una URL pertenece a una fuente confiable, lo mismo ocurre para la comprobación dehttps://. Esto permite a un atacante spoofear dominios válidos mediante subdominios o poner esos nombres en el path, lo mismo ocurre parahttps://.PoC:
Un atacante podría usar una URL como
https://github.atacante.com/...,https://atacante.com/github/...ohttp://atacante.com/...?...&x=https://githuby pasar la validación, ya que la función solo chequea que el string contenga"github"y"https://".Este merge request reemplaza esa lógica por una validación basada en expresiones regulares que asegura coincidencia exacta con los dominios válidos definidos, y sigue permitiendo subdominios de los mismos.
Además, se ampliaron los dominios permitidos para incluir nuevas fuentes relevantes como
gitlab.com,git.exactas.uba.ary el campus viejo de la facultad, que aún contiene material relevante. Se podría aprovechar la validación por regex que implementa en este merge request para tomar directamente"exactas.uba.ar"como dominio válido, pero tampoco me parece mal segregar por subdominios de la facultad, y así forzar que los links sean del campus.