zerotier / zerotier/ZeroTierOne

`macsrc` and `macdest` matches values are improperly parsed

Open
#2,175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
17.1k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

The rules compiler (featured in the official controller) automatically reformat MAC addresses to separate bytes with colon characters. For example, 0123456789AB becomes 01:23:45:67:89:AB. Matches macsrc (MATCH_MAC_SOURCE in JSON) and macdest (MATCH_MAC_DEST in JSON) are parsed in a way that doesn't ignore the : character, and treat it as if it was carrying address information (the current implementation treats it as a 0). In the end, the filtering engine doesn't get the valid MAC address and thus comparisons with packet MAC addresses fails.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by tracing the rules compiler's parsing of macsrc (MATCH_MAC_SOURCE in JSON) and macdest (MATCH_MAC_DEST in JSON), focusing on how colon-separated MAC addresses are converted. Reproduce the failure with a formatted address such as 01:23:45:67:89:AB, then verify that the filtering engine compares the resulting value correctly against packet MAC addresses.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.