Kill switch Xray разрешает прямой трафик другим процессам с тем же именем

Open
#339 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
53/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp

Research direction

Read SingBoxTunGuard.cs lines 59–69 and SingBoxConfigBuilder.cs lines 321–323 to trace how the Xray exception is added and ordered in the generated route rules. Then inspect the existing config tests or test entry points for this behavior. Done means the exception targets the actual backend executable while other same-named processes remain subject to the kill switch; the issue notes that live traffic has not been tested.

Written by the indexing model from the issue text.

Description

bug network

Приоритет P1 · milestone 0.4.1

При TUN для Xray исключение для сетевого процесса привязано к имени файла. Другой локальный процесс с тем же именем получает такое же прямое правило для произвольных назначений, в том числе когда backend недоступен.

Воспроизведение без запуска движков

  1. Сгенерировать конфиг удерживаемого TUN для Xray, который расположен, например, в каталоге BYDLO и называется xray.exe.
  2. Проверить первое правило маршрутизации и сопоставить его с любым процессом xray.exe из другого каталога.
  3. Оба процесса совпадают по process_name. Ограничения пути или назначения в правиле нет.

Причина и доказательство: SingBoxTunGuard.cs:59–69 берёт Path.GetFileName найденного бинарника и добавляет вариант без расширения. SingBoxConfigBuilder.cs:321–323 вставляет process_name → direct первым. Правила sing-box различают имя и путь. Подтверждено по конфигу и порядку правил, реальный трафик не проверялся.

Ожидаемо: исключение относится к фактически запущенному backend, остальные процессы остаются под kill switch.

Направление исправления: использовать идентификатор конкретного исполняемого файла, например канонический process_path, и по возможности ограничить исключение адресами/портами backend.

Связано: #212.

Аудит ffa65648867139f9e45c15f4b635a83c1ff52c1b.

Dominant language
C#
Stars
5
Forks
1
Avg merge
23m
Merged PRs (30d)
144

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from endercodezz/BYDLO

All issues in endercodezz/BYDLO

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.