Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I started a web project. Now I was wondering if it is secure enough. I followed some tutorials on HTS, but I can't see all holes (if there are any). Can you check my pages and if you can find any hole in it (like XSS or SQL injections). Thanks for helping :)!

My URL is: **

And another security question: is my HTTPS certificate safe enough? (**) And my SMTP/SSH/... services?

You can now login using: user: demo, password: test123

User controller code:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User extends CI_Controller {

    public function create() {
        setHTTPS();
        if ($this->form_validation->run() == false) {
            $this->load->view('user/create');
        } else {
            $this->MUser->create();
            $this->load->view('user/email_sent');
        }
    }

    public function login() {
        setHTTPS();
        if ($this->form_validation->run() == false) {
            $this->load->view('user/login');
        } else {
            $this->MUser->createSession();
            $this->MUser->checkLogin();
            $this->load->view('user/dashboard');
        }
    }

    public function logout() {
        setHTTPS();
        if ($this->MUser->login()) {
            $this->MUser->logout();
            $this->load->view('user/logout');
        } else {
            $this->load->view('user/logout_failed');
        }
    }

    public function dashboard($username) {
        setHTTPS();
        $this->MUser->checkLogin();
        $this->load->view('/user/dashboard');
    }

    public function verify($userID, $code) {
        setHTTPS();
        $safeCode = urldecode($code);
        if ($this->MUser->checkVerifyCode($userID, $safeCode)) {
            $this->MUser->cleanVerifyCode($userID);
            $this->MUser->setActive($userID);
            mailSignupComplete($userID);
            $this->load->view('user/signup_complete');
        } else {
            $this->load->view('user/validation_failed');
        }
    }

    public function password($userID = null, $verifier = null) {
        setHTTPS();
        if ($userID !== null) {
            $safeCode = urldecode($verifier);
            if ($this->MUser->checkPasswordCode($userID, $safeCode)) {
                $this->MUser->updatePassword($userID);
                $this->load->view('user/password_succes');
            } else {
                $this->load->view('user/password_failed');
            }
        } else {
            if ($this->form_validation->run() == false) {
                $this->load->view('user/password');
            } else {
                $this->MUser->addRecoverPasswordEntry();
                $this->load->view('user/password_sent');
            }
        }
    }

}

/* End of file user.php */
/* Location: ./application/controllers/user.php */
share|improve this question
2  
This site is called **code**review for a reason ;) – Fge Jan 7 '12 at 2:04
I can't scroll down on this page. Chrome Canary 18.x. – minitech Jan 7 '12 at 5:54
Can't do a code review without the cod! – GordonM Jan 7 '12 at 7:48

1 Answer

Check your MySQL database. If you have another table called "websiteIsNotSecure" then you need to sanitize your database inputs. Also, it'd be easier to check security if we had some code to look at. You can't view PHP code, it's all parsed/executed on the server.

share|improve this answer
I saw you tries :), no, your CREATE COLUMN code was in the table where users are stored. I can't share code due security reasons. But I can tell it runs on CodeIgniter 2.1.0. – Kevin Jan 7 '12 at 0:45
1  
Not sharing code 'due to security reasons' always sounds like 'it's very unsecure but i hope noone finds all the holes' (which someone will usually find if he wants to). – Fge Jan 7 '12 at 2:03
Ok, I'll share my user controller. This would be the most vurnable file. – Kevin Jan 7 '12 at 10:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.