Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Account for hosts with/without ports in origin check

Abierto
#6,166 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
security

Línea de trabajo

Comienza reproduciendo la comparación entre Origin y Host con la configuración proporcionada de NGINX proxy_set_header y, después, revisa los issues relacionados 6161, 6023, 6064 y 6014. Determina el tratamiento previsto de los puertos predeterminados y no predeterminados; se considera terminado cuando la comprobación de Origin de WebSocket acepta de forma coherente las configuraciones válidas coincidentes sin debilitar sus garantías de seguridad.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Is there an existing issue for this?
  • I have searched the existing issues
OS/Web Information

N/A

Steps to Reproduce

You can simulate with this NGINX config:

proxy_set_header X-Forwarded-Host $host:$server_port;
Expected

If your origin is https://domain.tld and your host is domain.tld:443 the check should pass. Same for http://domain.tld and domain.tld:80.

Also I think NGINX's $host actually does not include ports so it will fail if your config only has $host and if you host on a port other than 443 and 80 since you would get an origin like https://domain.tld:8080 and the host would be domain.tld.

To fix the first we could just check the protocol on the origin and then add/remove 443 or 80.

For the second we could ignore the port altogether since I think the vulnerability does not happen across ports...

But I am not sure we should do anything; maybe the correct course of action is to edit the proxy config so the host and origin headers match. I have looked at other software but they all seem to do exact matches without messing around with the port. We could just edit the documentation to use $http_host.

Actual

The origin and domain are matched exactly so they do not match. Ends up causing the web sockets to fail with 1006.

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?
  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
  • I am using HTTPS.
Notes

https://github.com/coder/code-server/issues/6161

Might be causing issues reported in https://github.com/coder/code-server/issues/6023 and https://github.com/coder/code-server/issues/6064 as well.

And possibly https://github.com/coder/code-server/issues/6014

Lenguaje dominante
TypeScript
Estrellas
79.4k
Forks
6.9k
Merge medio
2 d 13 h
PR fusionados (30 d)
39

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de coder/code-server

Todos los issues de coder/code-server

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.