내 개발자가 config.php
파일 내에 몇 가지 기능을 가진 코드를 클라이언트에 전달했습니다.config.php에 기능 코드가있는 보안 문제는 무엇입니까
고객은 보안 위험이 있으며 php
사람이 아닌 이유는이 사람이 누구인지 알기를 원합니다.
config.php
의 보안 취약점은 무엇입니까?
코드 : 구성 값이 상상 컨대 그들이 그 클래스를 인스턴스화 할 수있는 코드 내에서 다른 곳에서 덮어 쓸 수있는 확장 클래스 내에 위치 변수에 저장되어있는 경우
<?php
//$config["ALLOWED_IPS"] = Array("rrrr,tttt,uuuu");
$config["PRIVATE_KEY"] = "sssss";
$config["PUBLIC_KEY"] = "aaaaa";
$config["DB_HOST"] = "wwwww";
$config["DB_NAME"] = "334455ffff";
$config["DB_USER"] = "uuuu";
$config["DB_PASS"] = "uuuu";
//AWS access info
if (!defined('awsAccessKey')) define('awsAccessKey', 'xxxxx');
if (!defined('awsSecretKey')) define('awsSecretKey', 'yyyyy');
function uploadS3($FilePath,$name=""){
$FilePath = str_replace("https://s3.amazonaws.com/","",$FilePath);
$info_path2 = explode("/",$FilePath);
if (count($info_path2)>1){
$Bucket = $info_path2[0];
$Object_info = str_replace($Bucket."/","",$FilePath);
if (!class_exists('S3')) require_once('S3.php');
//instantiate the class
$s3 = new S3(awsAccessKey, awsSecretKey);
$s3>putBucket($Bucket, S3::ACL_PRIVATE);
if ($s3>getObject($Bucket, $Object_info, $name)) {
return true;
}else{
return false;
}
}
return false;
}
?>
* "config.php 파일"*? 당신은 그것보다 조금 더 구체적 일 수 있습니다. – deceze
안녕하세요, 데이터베이스 정보를 s3 정보와 함께 저장하는 작은 PHP 응용 프로그램의 구성 파일 –
죄송합니다. 일찍 입력하십시오 : php // $ config [ "ALLOWED_IPS"] = Array ("rrrr, tttt, uuuu "); $ config [ "PRIVATE_KEY"] = "sssss"; $ config [ "PUBLIC_KEY"] = "aaaaa"; $ config [ "DB_HOST"] = "wwwww"; $ config [ "DB_NAME"] = "334455ffff"; $ config [ "DB_USER"] = "uuuu"; $ config [ "DB_PASS"] = "uuuu"; // AWS 액세스 정보 if (! defined ('awsAccessKey')) define ('awsAccessKey', 'xxxxx'); if (! defined ('awsSecretKey')) define ('awsSecretKey', 'yyyyy'); ?> –