Code Monkey home page Code Monkey logo

Comments (8)

seperman avatar seperman commented on May 29, 2024

It is already using the GenericIPAddressField:
https://github.com/django-pci/django-axes/blob/master/axes/models.py#L9

from django-axes.

willkg avatar willkg commented on May 29, 2024

Looks like it got fixed in 81bebc4 which was done after the issue was opened.

First release with that fix was 1.3.7 released in early October. So I'm pretty sure we're good here.

@mythmon Want to verify that when you get a chance?

from django-axes.

aclysma avatar aclysma commented on May 29, 2024

This is still broken because is_valid_ip() will fail for ipv6 since it's just using socket.inet_aton. BTW using socket.inet_aton directly will also fail to detect bad IP addresses like "127.0"

I would suggest using the built-in django validators (assuming they exist in the versions of django you want to target). I have done this in my fork, so you could easily lift it from there:
aclysma@ae52351

As an aside, that commit also removes the IP sanitization. In my opinion it's much better to let people do that for themselves in middleware for reasons mentioned here: http://django-ratelimit.readthedocs.org/en/latest/security.html#security-chapter

from django-axes.

camilonova avatar camilonova commented on May 29, 2024

@aclysma Can you do a PR with those changes?

from django-axes.

aclysma avatar aclysma commented on May 29, 2024

Per your request, I sent a pull request, but it includes all my changes, several of which are very opinionated.. you probably don't want to take some of them. It may be easier/safer to just lift the ip address validation code manually.

from django-axes.

aclysma avatar aclysma commented on May 29, 2024

FYI the failed test test_log_data_truncated is failing because I removed storing GET/POST params (this is one of those opinionated changes that you likely don't want to take.)

from django-axes.

camilonova avatar camilonova commented on May 29, 2024

@aclysma Looks great. Can you please send the PR only with the ip validation changes?

from django-axes.

camilonova avatar camilonova commented on May 29, 2024

This should be fixed by now

from django-axes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.