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

オープン 初心者向け
#131 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

internal/authz/authz.go の Gate のデフォルト分岐(84〜96行目付近)から始めてください。ここではホストの検証より前に confirm が実行されます。internal/authz/scope.go の parseScopeHost はすでに非ASCIIのホストを拒否しているので、プロンプトの前に実行できるかを確認してください。非ASCIIのホストがプロンプトの前に punycode のヒントとともに拒否され、internal/authz のテストがそれをカバーしていれば完了です。go test ./internal/authz を実行してください。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Go
スター
0
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Spackle のほかの issue

TMHSDigital/Spackle の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。