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

Multiple Possible XSS vulnerabilities #30

Open
enferas opened this issue Dec 27, 2022 · 0 comments
Open

Multiple Possible XSS vulnerabilities #30

enferas opened this issue Dec 27, 2022 · 0 comments

Comments

@enferas
Copy link

enferas commented Dec 27, 2022

Hello,

I would like to report for some XSS vulnerabilities.

For example,

In file hr-payroll-master\application\controllers\Logistice.php

  public function Add_Assets_Category(){
      if($this->session->userdata('user_login_access') != False) {
      $id = $this->input->post('catid');
      $cattype = $this->input->post('cattype');
      $catname = $this->input->post('catname');
      $this->load->library('form_validation');
      $this->form_validation->set_error_delimiters();
      $this->form_validation->set_rules('catname', 'Category name', 'trim|required|min_length[1]|max_length[220]|xss_clean');

      //...
              $data = array(
                  'cat_name' => $catname,
                  'cat_status' => $cattype
              );
              $success = $this->logistic_model->Add_Assets_Category($data);
           //...          
      }
  //...    
}

We see that cat_name is validated against XSS but cat_status is not validated.
Then it will be saved in the DB, in file hr-payroll-master\application\models\Logistic_model.php

    public function Add_Assets_Category($data){
        $this->db->insert('assets_category',$data);
    }

Then in file

public function Assets_Category(){
    if($this->session->userdata('user_login_access') != False) {
        $data=array();
        $data['catvalue'] = $this->project_model->GetAssetsCategory();
        $this->load->view('backend/assets_category',$data);
    }
    //...     
}

In file hr-payroll-master\application\models\Project_model.php

    public function GetAssetsCategory(){
        $sql = "SELECT * FROM `assets_category`";
        $query=$this->db->query($sql);
        $result = $query->result();
		return $result;          
    } 

Finally cat_status is printed in the view 'backend/assets_category'.

<?php foreach($catvalue as $value): ?>
  <tr>
      <td><?php echo $value->cat_id; ?></td>
      <td><?php echo $value->cat_status ?></td>
      <td><?php echo $value->cat_name; ?></td>
      <td class="jsgrid-align-center ">
          <a href="" title="Edit" class="btn btn-sm btn-info waves-effect waves-light AssetsModal" data-id="<?php echo $value->cat_id; ?>"><i class="fa fa-pencil-square-o"></i></a>
      </td>
  </tr>
<?php endforeach; ?>
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

1 participant