GithubHelp home page GithubHelp logo

SQL Injection about expose HOT 8 OPEN

enygma avatar enygma commented on June 1, 2024
SQL Injection

from expose.

Comments (8)

quantumpacket avatar quantumpacket commented on June 1, 2024 1

@enygma Have not tested the below, but would using array_walk_recursive() suffice for the above? We may want to also check that recursion is being done in other areas as well.
[ DEMO ]

src/Expose/Manager.php

        // try to clean up standard filter bypass methods
        array_walk_recursive($data, [new \Expose\Converter\Converter, 'runAllConversions']);

        $path = array();
        // ...

src/Expose/Converter/Converter.php

    public function runAllConversions(&$value)
    {
        // ...
        // return $value;

Might I suggest running the rules against https://github.com/minimaxir/big-list-of-naughty-strings as part of the unit tests?

Also on a side-note, would you be interested in a Python3 port of Expose?

from expose.

quantumpacket avatar quantumpacket commented on June 1, 2024 1

@yehgdotnet what was the downvote for? Did the code not work or is the rule itself broken?

from expose.

quantumpacket avatar quantumpacket commented on June 1, 2024

Yes, it should detect SQLi as per filter_rules.json#L517-L529. If not, then the filter may have gotten broken. I had opened #58 in hopes of having better quality checks on new/old/modified rules.

from expose.

tranba avatar tranba commented on June 1, 2024

Because this rule does not include ' char?

from expose.

quantumpacket avatar quantumpacket commented on June 1, 2024

@tranba quotes are normalized here src/Expose/Converter/ConvertMisc.php#L80-L94 if that is not done then the patterns would be overly complex with having to match each and every variation of quote use.

from expose.

tranba avatar tranba commented on June 1, 2024

@quantumpacket I've found a problem in the run function:

foreach ($data as $key => $datum){
if (!is_array($datum)){
$data[$key] = $converter->runAllConversions($data[$key]);
}
}

Convert only apply to the first level of data array, then for example
$data = array(
'POST' = array('dirty' => " a ' or 1 = 1")
)
will bypass

from expose.

yehgdotnet avatar yehgdotnet commented on June 1, 2024

Seems anything' OR '1'='1 doesn't match with rules

Below are matched:

a' or 1=1;#
a' or 1=1;--

from expose.

yehgdotnet avatar yehgdotnet commented on June 1, 2024

@yehgdotnet what was the downvote for? Did the code not work or is the rule itself broken?

wrong click, was too sleepy, cheers

from expose.

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.