Add reserved? method to detect reserved IP addresses

Open
#80 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
ruby
Domain
networking

Research direction

Start by reading the existing private?, link_local?, and loopback? methods and the IP address range definitions they use, then compare them with the linked reserved-address reference. Done means a reserved? predicate is available for the library's supported IP addresses and its behavior is covered by tests for the relevant reserved ranges.

Written by the indexing model from the issue text.

Description

This library already has private?, link_local?, loopback?, etc.

It would be useful to have a reserved? method:
https://en.wikipedia.org/wiki/Reserved_IP_addresses

One of the reasons would be to mitigate SSRF attacks in a simple way, by limiting connections to "normal" "external" IP addresses (!ipaddr.reserved?).

Dominant language
Ruby
Stars
82
Forks
42
Avg merge
2h 24m
Merged PRs (30d)
3

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.

More from ruby/ipaddr

All issues in ruby/ipaddr

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.