indutny / indutny/node-ip

ip.cidrSubnet('efef::efef::/64').contains('::1') returns true

Open
#110 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.5k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

This shouldn't be right I think

Additionally since the address has two `::` I think it's invalid, too

Test in REPL:

```
const ip=require('ip')
ip.cidrSubnet('efef::efef::/64').contains('::1')
```

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

Reproduce the behavior with the provided REPL calls, then trace the cidrSubnet and contains entry points to the IPv6 parsing and validation logic. Add a regression test for the malformed address containing two `::`; done means the invalid CIDR is rejected or no longer reports that `::1` is contained.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.