Giter Site home page Giter Site logo

Comments (3)

GideonLeGrange avatar GideonLeGrange commented on August 11, 2024

I can reproduce the problem. I am working on a solution, and will update the issue.

from mikrotik-java.

GideonLeGrange avatar GideonLeGrange commented on August 11, 2024

I've fixed it, and the API will now throw an exception if the user tries to log in with a empty (0 length or string full of spaces) username. Empty passwords are valid and are still allowed.

The fix is in the master branch, and I will release v2.0.3 for this bug shortly.

More detail, if you're interested:

The way the Mikrotik API works internally caused this problem. The user side sends a "/login" command, receives a hash, and then sends a second "/login" command using this hash and the username. This overloading of "/login" would have been fine if the Mikrotik side was prepared to handle the situation where a empty username with a valid hash is received. By handle I don't mean accept a blank username, simply return an error. But what they do if the username is empty, is to just return another hash.

So the fix was quite simple:

        if (username.trim().isEmpty()) {
            throw new ApiConnectionException("API username cannot be empty");
        }

Thank you for reporting this. I hope it resolves the issue for you.

Gideon

from mikrotik-java.

laviua avatar laviua commented on August 11, 2024

Yes, right, thanks!

from mikrotik-java.

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.