Interactive consent for a non-ASCII host is asked for and then always refused

Aberta Para iniciantes
#131 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
go

Direção de pesquisa

Comece em internal/authz/authz.go no ramo padrão de Gate (por volta das linhas 84-96), onde confirm roda antes de o host ser validado. internal/authz/scope.go tem parseScopeHost, que já rejeita hosts não ASCII; verifique se ele pode rodar antes do prompt. Está concluído quando um host não ASCII é recusado antes de qualquer prompt com a dica de punycode, e um teste em internal/authz cobre isso. Execute go test ./internal/authz.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug good first issue severity: low

Summary

For a running target with a non-ASCII host (for example http://bücher.example/), authz.Gate asks the operator to type the host to confirm. After they type it correctly, it refuses with an error about the scope "from the interactive confirmation" not being valid. The host check that makes the target unusable runs after the prompt instead of before it.

Where

  • internal/authz/authz.go:84-96 (confirm, then the interactive scope built from ep.String(), then normalize)
  • internal/authz/scope.go:213-216 (parseScopeHost rejects non-ASCII hosts)
  • internal/authz/scope.go:290 (endpointOf accepts any u.Hostname())

Details

default:
	if err := confirm(ep, opts); err != nil {
		return nil, err
	}
	g.source = sourceInteractive
	raw = config.Scope{
		Hosts: []string{ep.String()},
		...
	}
}
g.scope, g.hosts, g.prefixes, err = normalize(raw)

Impact

The operator is asked for consent, types the host exactly, and is then refused with an error about a scope they never wrote. The punycode hint in the error is useful, but it should come before the prompt.

Steps to reproduce

authz.Gate on http://bücher.example/ with Interactive: true and stdin bücher.example\n: it prints the confirmation prompt, then returns "the scope from the interactive confirmation is not valid ... write international names in punycode".

Suggested fix

In Gate, run parseScopeHost(ep.String()) before confirm, and refuse up front with the punycode hint. Converting the host to punycode would need golang.org/x/net/idna, a new dependency that AGENTS.md asks to justify.

Acceptance criteria

  • A non-ASCII host is refused before any prompt, with the punycode hint.
  • A test in internal/authz covers it.

Getting started

  • Relevant files: internal/authz/authz.go, internal/authz/scope.go
  • How to run tests: go test ./internal/authz

Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: bug|internal/authz/authz.go|Gate

Linguagem predominante
Go
Estrelas
0
Forks
1
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Spackle

Todas as issues de TMHSDigital/Spackle

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.