Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin conflicts: "verify core files" plugins #33

Open
nylen opened this issue Oct 28, 2018 · 2 comments
Open

Plugin conflicts: "verify core files" plugins #33

nylen opened this issue Oct 28, 2018 · 2 comments

Comments

@nylen
Copy link
Contributor

nylen commented Oct 28, 2018

For example, WordFence has this option (exact wording may be different):

Scan Options → General Options → Scan core files against repository versions for changes

Makes sense, because WordFence will key off the $wp_version of 4.9.8 and do its checks based on that.

What other plugins face similar issues?

@dixonge
Copy link
Contributor

dixonge commented Oct 30, 2018

Here is the relevant section of wordfenceScanner.php - will need to point the API request elsewhere?

  /**
     * Queries the is_safe_file endpoint. If provided an array, it does a bulk check and returns an array containing the
     * hashes that were marked as safe. If provided a string, it returns a boolean to indicate the safeness of the file.
     *
     * @param string|array $shac
     * @return array|bool
     */
    private function isSafeFile($shac) {
        if(! $this->api){
            $this->api = new wfAPI($this->apiKey, $this->wordpressVersion);
        }
        
        if (is_array($shac)) {
            $result = $this->api->call('is_safe_file', array(), array('multipleSHAC' => json_encode($shac)));
            if (isset($result['isSafe'])) {
                return $result['isSafe'];
            }
            return array();
        }
        
        $result = $this->api->call('is_safe_file', array(), array('shac' => strtoupper($shac)));
        if(isset($result['isSafe']) && $result['isSafe'] == 1){
            return true;
        }
        return false;
    }

    /**
     * @param string $file
     * @return array
     */
    private function dataForFile($file, $fullPath = null) {
        $loader = $this->scanEngine->getKnownFilesLoader();
        $data = array();
        if ($isKnownFile = $loader->isKnownFile($file)) {
            if ($loader->isKnownCoreFile($file)) {
                $data['cType'] = 'core';

@nylen
Copy link
Contributor Author

nylen commented Oct 30, 2018

That's one thing we could do, but it's likely to be a good bit of work, and fragile if WordFence changes the way their checks work. We could also ask them nicely to add support for ClassicPress.

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

No branches or pull requests

2 participants