Skip to content

Fix logic of ip.address('public/private')#61

Open
danez wants to merge 2 commits intoindutny:mainfrom
danez:patch-1
Open

Fix logic of ip.address('public/private')#61
danez wants to merge 2 commits intoindutny:mainfrom
danez:patch-1

Conversation

@danez
Copy link
Copy Markdown

@danez danez commented Oct 12, 2016

This reverses the check in the filter method of ip.address(), as the definition
of Array.prototype.filter() says "returns array of elements that pass the test".
It is currently doing exactly the opposite.

We noticed this, as we were doing ip.address('public') but received a private address.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

This reverses the check in the filter method, as the definition
of .filter() says return true for elements that should be in the filtered array
aka pass the test.
Previously it was doing exactly the opposite.
@danez
Copy link
Copy Markdown
Author

danez commented Oct 12, 2016

The tests are failing for some other reason.

@danez
Copy link
Copy Markdown
Author

danez commented Oct 25, 2016

This regressed with f52f79e @bryanwayb

@danez danez mentioned this pull request Oct 25, 2016
@julianxhokaxhiu
Copy link
Copy Markdown

Any update on this?

@julianxhokaxhiu
Copy link
Copy Markdown

Hi @indutny any update on this?

@betamos
Copy link
Copy Markdown

betamos commented Apr 25, 2020

This issue is a security vulnerability imo -- the user may accidentally start listen on a public address rather than a private.

As there are no recent commits.. Is this repository maintained?

@ouuan
Copy link
Copy Markdown

ouuan commented Feb 21, 2024

This issue is a security vulnerability imo -- the user may accidentally start listen on a public address rather than a private.

Maybe we need a CVE like CVE-2023-42282 to attract the author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants