[M-1..M-5] MAC identity weaknesses — client-declared identity, shared fallback bucket, normalization gap, loopback XFF trust

オープン
#808 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
go

調査の方向性

Start by checking whether each finding still reproduces on upstream main: the quote-to-MAC binding in lightning.go (around lines 159-169), ValidateMACAddress in utils.go:26, net.ParseMAC in valve.go:48, and getIP in main.go (around lines 923-941). The fix needs a design decision on binding payments to the ARP-resolved MAC, so it is not a first-timer task. Done means each of M-1 to M-4 is confirmed or closed with evidence.

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

説明

Migrated from Amperstrand/tollgate-module-basic-go#80 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: #758.]


CONSOLIDATED ISSUE covering multiple MAC tracking weaknesses:

M-1 (High, functional/security hybrid): The MAC is a fully client-declared identity. ?mac=/body mac is accepted unvalidated (beyond format) on every payment path; quote↔MAC binding is enforced (lightning.go:159-169) but the bound value is attacker-declared. Pay-for-anyone's-MAC is possible (gifting/session-extension).

M-2 (Medium): Fallback MAC bucket. Clients missing from dhcp.leases AND ARP (static IPs, expired entries) all share session key 00:00:00:00:00:00: allotments pool, usage attribution conflates payers, ndsctl auth 00:00:00:00:00:00 fails for a non-existent client → the payer's token is consumed with no grantable session.

M-3 (Low): MAC normalization gap. ValidateMACAddress (utils.go:26) accepts hyphen/dot/bare-hex formats that map to different session-map keys than the colon-lowercase form from getMacAddress; net.ParseMAC (valve.go:48) rejects bare-hex → grant fails at valve after session mutation. NDS passes uppercase colon-form while dhcp.leases is lowercase — mixed-case keys for the same device.

M-4 (Low): Loopback XFF trust. getIP (main.go:923-941) honors X-Real-Ip/X-Forwarded-For only from loopback peers — any on-router forwarder makes /balance, /usage attribution and rate-limit bucketing spoofable.

M-5 (negative note): No MAC→shell injection found. Every sink is argv-exec behind net.ParseMAC or hex-regex validation.

Fix: Bind payments to ARP-resolved MAC where possible; normalize MAC formats consistently; validate XFF headers more strictly.

Evidence: /home/ubuntu/src/tollgate_audit_report_2026-08-26.md §5, lines 78-82; §7, line 150


Migrated 2026-10-09. Applicability to current upstream main (4614ac2, post-rc1) was not re-verified during migration — confirming whether the finding still reproduces upstream is this issue's first task.

主要言語
Go
スター
12
フォーク
14
平均マージ
3日 20時間
マージ済み PR(30日)
261

環境構築

はじめの一歩

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

OpenTollGate/tollgate-module-basic-go のほかの issue

OpenTollGate/tollgate-module-basic-go の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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