security
정의가 누락되어 있습니다.security
정의가 없으면 공격자가 중요한 API 끝점과 상호 작용하게 될 수 있습니다. 그러면 특정 권한이 있는 특정 사용자 계정만 수행 가능하도록 제한해야 하는 작업을 수행할 수 있습니다.security
정의를 선언하지 않습니다. 이 사양을 구현하는 API를 사용하여 중요한 작업을 수행하면 무단 액세스나 미인증 액세스에 취약해질 수 있습니다.
{
"openapi" : "3.0.3",
"info" : {
"title" : "My API",
"version" : "1.0.0"
},
"servers" : [ {
"url" : "https://example.org"
} ],
...
}
security
정의가 누락되어 있습니다.security
정의가 없으면 공격자가 중요한 API 끝점과 상호 작용하게 될 수 있습니다. 그러면 특정 권한이 있는 특정 사용자 계정만 수행 가능하도록 제한해야 하는 작업을 수행할 수 있습니다.security
정의를 선언하지 않습니다. 이 사양을 구현하는 API를 사용하여 중요한 작업을 수행하면 무단 액세스나 미인증 액세스에 취약해질 수 있습니다.
openapi: 3.0.3
info:
title: My API
version: 1.0.0
...
security
정의가 포함되어 있지 않습니다.security
정의가 포함되어 있지 않은 작업을 수행하는 경우 공격자가 중요한 API 끝점과 상호 작용하게 될 수 있습니다. 그러면 명시적 권한이 있는 특정 사용자 계정만 수행 가능하도록 제한해야 하는 작업을 수행할 수 있습니다.security
정의를 설정하지 않습니다. 또한 전역 security
정의가 없으면 createUsers
작업이 미인증 무단 액세스에 취약해집니다.
{
"openapi": "3.0.0",
"info": {
...
},
"paths": {
"/users": {
"post": {
"summary": "Create a user",
"operationId": "createUsers",
...
}
...
}
}
security
정의가 포함되어 있지 않습니다.security
정의가 포함되어 있지 않은 작업을 수행하는 경우 공격자가 중요한 API 끝점과 상호 작용하게 될 수 있습니다. 그러면 명시적 권한이 있는 특정 사용자 계정만 수행 가능하도록 제한해야 하는 작업을 수행할 수 있습니다.security
정의를 설정하지 않습니다. 또한 전역 security
정의가 없으면 createUsers
작업이 미인증 무단 액세스에 취약해집니다.
openapi: 3.0.0
info:
...
paths:
/users:
post:
operationId: createUsers
responses:
'201':
...
securitySchemes
정의가 누락되어 있습니다.securitySchemes
정의는 전역적으로 사용되거나 특정 API 작업에서 사용될 수 있는 보안 메커니즘을 지정합니다.components
개체 아래에 지정되는 securitySchemes
정의는 상호 작용을 위한 보안 요구사항 확인을 위해 전역적으로 참조되거나 특정 작업에서 참조됩니다.securitySchemes
정의를 정의하지 않습니다.
{
"openapi" : "3.0.3",
"info" : {
"title" : "My API",
"version" : "1.0.0"
},
"components": {
"schemas": {
"GeneralError": {
"type": "object",
"properties": {
...
}
}
}
securitySchemes
정의가 누락되어 있습니다.securitySchemes
정의는 전역적으로 사용되거나 특정 API 작업에서 사용될 수 있는 보안 메커니즘을 지정합니다.components
개체 아래에 지정되는 securitySchemes
정의는 상호 작용을 위한 보안 요구사항 확인을 위해 전역적으로 참조되거나 특정 작업에서 참조됩니다.securitySchemes
정의를 정의하지 않습니다.
openapi: 3.0.3
info:
title: My API
version: 1.0.0
components:
schemas:
GeneralError:
type: object
properties:
...
security
정의 내에 선택적 보안 요구사항 항목이 정의되어 있으면 공격자가 중요한 API 끝점과 상호 작용하게 될 수 있습니다. 그러면 특정 권한이 있는 특정 사용자 계정만 수행 가능하도록 제한해야 하는 작업을 수행할 수 있습니다.{}
항목을 통해 선택적 보안을 사용하는 전역 security
정의를 선언합니다. 이 사양을 구현하는 API를 사용하여 중요한 작업을 수행하면 무단 액세스나 미인증 액세스에 취약해질 수 있습니다.
{
"openapi" : "3.0.3",
"info" : {
"title" : "My API",
"version" : "1.0.0"
},
"servers" : [ {
"url" : "/"
} ],
"security" : [ {}, { "oauth_auth" : ["write","read" ]} ],
...
}
security
정의 내에 선택적 보안 요구사항 항목이 정의되어 있으면 공격자가 중요한 API 끝점과 상호 작용하게 될 수 있습니다. 그러면 특정 권한이 있는 특정 사용자 계정만 수행 가능하도록 제한해야 하는 작업을 수행할 수 있습니다.{}
항목을 통해 선택적 보안을 사용하는 전역 security
정의를 선언합니다. 이 사양을 구현하는 API를 사용하여 중요한 작업을 수행하면 무단 액세스나 미인증 액세스에 취약해질 수 있습니다.
openapi: 3.0.3
info:
title: My API
version: 1.0.0
security:
- {}
- oauth_auth:
- write:users
- read:users
security
정의 내에 비어 있는 {}
개체가 포함되어 있기 때문입니다. 이로 인해 전역적으로 정의된 보안 요구사항이 다시 정의되며, createUsers
작업이 미인증 무단 액세스에 취약해집니다.
{
"openapi": "3.0.0",
"info": {
...
},
"paths": {
"/users": {
"post": {
"security": [
{},
{
"my_auth": [
"write:users"
]
}
],
"summary": "Create a user",
"operationId": "createUsers",
...
}
...
}
}
security
정의 내에 비어 있는 {}
개체가 포함되어 있기 때문입니다. 이로 인해 전역적으로 정의된 보안 요구사항이 다시 정의되며, createUsers
작업이 미인증 무단 액세스에 취약해집니다.
openapi: 3.0.0
info:
...
paths:
/users:
post:
operationId: createUsers
security:
- {}
- oauth_auth:
- write:users
- read:users
responses:
'201':
...
...
password = ''.
...
...
URLRequestDefaults.setLoginCredentialsForHost(hostname, "scott", "");
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
var storedPassword:String = "";
var temp:String;
if ((temp = readPassword()) != null) {
storedPassword = temp;
}
if(storedPassword.equals(userPassword))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
...
HttpRequest req = new HttpRequest();
req.setClientCertificate('mycert', '');
...
...
NetworkCredential netCred = new NetworkCredential("scott", "", domain);
...
Example 1
의 코드가 성공하면 네트워크 자격 증명 로그인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
string storedPassword = "";
string temp;
if ((temp = ReadPassword(storedPassword)) != null) {
storedPassword = temp;
}
if(storedPassword.Equals(userPassword))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
...
rc = SQLConnect(*hdbc, server, SQL_NTS, "scott", SQL_NTS, "", SQL_NTS);
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
char *stored_password = "";
readPassword(stored_password);
if(safe_strcmp(stored_password, user_password))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 user_password
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
...
<cfquery name = "GetSSNs" dataSource = "users"
username = "scott" password = "">
SELECT SSN
FROM Users
</cfquery>
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
var password = "";
var temp;
if ((temp = readPassword()) != null) {
password = temp;
}
if(password == userPassword()) {
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
...
response.SetBasicAuth(usrName, "")
...
...
DriverManager.getConnection(url, "scott", "");
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
String storedPassword = "";
String temp;
if ((temp = readPassword()) != null) {
storedPassword = temp;
}
if(storedPassword.equals(userPassword))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
...
webview.setWebViewClient(new WebViewClient() {
public void onReceivedHttpAuthRequest(WebView view,
HttpAuthHandler handler, String host, String realm) {
String username = "";
String password = "";
if (handler.useHttpAuthUsernamePassword()) {
String[] credentials = view.getHttpAuthUsernamePassword(host, realm);
username = credentials[0];
password = credentials[1];
}
handler.proceed(username, password);
}
});
...
Example 2
와 마찬가지로 useHttpAuthUsernamePassword()
에서 false
를 반환하면 공격자가 빈 암호를 입력하여 보호된 페이지를 볼 수 있습니다.
...
obj = new XMLHttpRequest();
obj.open('GET','/fetchusers.jsp?id='+form.id.value,'true','scott','');
...
{
...
"password" : ""
...
}
...
rc = SQLConnect(*hdbc, server, SQL_NTS, "scott", SQL_NTS, "", SQL_NTS);
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
NSString *stored_password = "";
readPassword(stored_password);
if(safe_strcmp(stored_password, user_password)) {
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 user_password
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
<?php
...
$connection = mysql_connect($host, 'scott', '');
...
?>
DECLARE
password VARCHAR(20);
BEGIN
password := "";
END;
...
db = mysql.connect("localhost","scott","","mydb")
...
...
conn = Mysql.new(database_host, "scott", "", databasename);
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.""
로 설정될 수 있습니다. 이 경우에는 암호가 함수에 전달되도록 인수의 개수를 올바르게 지정해야 합니다.
...
ws.url(url).withAuth("john", "", WSAuthScheme.BASIC)
...
...
let password = ""
let username = "scott"
let con = DBConnect(username, password)
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
var stored_password = ""
readPassword(stored_password)
if(stored_password == user_password) {
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 user_password
에 대해 빈 문자열을 입력하여 암호 확인을 무시할 수 있습니다.
...
Dim con As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
con.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=scott;Passwd=;"
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
password = 'tiger'.
...
...
URLRequestDefaults.setLoginCredentialsForHost(hostname, "scott", "tiger");
...
...
HttpRequest req = new HttpRequest();
req.setClientCertificate('mycert', 'tiger');
...
...
NetworkCredential netCred =
new NetworkCredential("scott", "tiger", domain);
...
...
rc = SQLConnect(*hdbc, server, SQL_NTS, "scott",
SQL_NTS, "tiger", SQL_NTS);
...
...
MOVE "scott" TO UID.
MOVE "tiger" TO PASSWORD.
EXEC SQL
CONNECT :UID
IDENTIFIED BY :PASSWORD
AT :MYCONN
USING :MYSERVER
END-EXEC.
...
...
<cfquery name = "GetSSNs" dataSource = "users"
username = "scott" password = "tiger">
SELECT SSN
FROM Users
</cfquery>
...
...
var password = "foobarbaz";
...
javap -c
명령을 사용하여 암호 값이 들어갈 디스어셈블된 코드에 액세스할 수 있다는 것입니다. Example 1
의 예제를 실행한 결과는 다음과 비슷합니다.
javap -c ConnMngr.class
22: ldc #36; //String jdbc:mysql://ixne.com/rxsql
24: ldc #38; //String scott
26: ldc #17; //String tiger
password := "letmein"
...
response.SetBasicAuth(usrName, password)
...
DriverManager.getConnection(url, "scott", "tiger");
...
javap -c
명령을 사용하여 암호 값이 들어갈 디스어셈블된 코드에 액세스할 수 있다는 것입니다. Example 1
의 예제를 실행한 결과는 다음과 비슷합니다.
javap -c ConnMngr.class
22: ldc #36; //String jdbc:mysql://ixne.com/rxsql
24: ldc #38; //String scott
26: ldc #17; //String tiger
...
webview.setWebViewClient(new WebViewClient() {
public void onReceivedHttpAuthRequest(WebView view,
HttpAuthHandler handler, String host, String realm) {
handler.proceed("guest", "allow");
}
});
...
Example 1
과 마찬가지로 이 코드는 정상 실행되지만 코드에 접근할 수 있는 사용자는 암호에도 접근할 수 있습니다.
...
obj = new XMLHttpRequest();
obj.open('GET','/fetchusers.jsp?id='+form.id.value,'true','scott','tiger');
...
...
{
"username":"scott"
"password":"tiger"
}
...
...
DriverManager.getConnection(url, "scott", "tiger")
...
javap -c
명령을 사용하여 암호 값이 들어갈 디스어셈블된 코드에 액세스할 수 있다는 것입니다. Example 1
의 예제를 실행한 결과는 다음과 비슷합니다.
javap -c ConnMngr.class
22: ldc #36; //String jdbc:mysql://ixne.com/rxsql
24: ldc #38; //String scott
26: ldc #17; //String tiger
...
webview.webViewClient = object : WebViewClient() {
override fun onReceivedHttpAuthRequest( view: WebView,
handler: HttpAuthHandler, host: String, realm: String
) {
handler.proceed("guest", "allow")
}
}
...
Example 1
과 마찬가지로 이 코드는 정상 실행되지만 코드에 접근할 수 있는 사용자는 암호에도 접근할 수 있습니다.
...
rc = SQLConnect(*hdbc, server, SQL_NTS, "scott",
SQL_NTS, "tiger", SQL_NTS);
...
...
$link = mysql_connect($url, 'scott', 'tiger');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
...
DECLARE
password VARCHAR(20);
BEGIN
password := "tiger";
END;
password = "tiger"
...
response.writeln("Password:" + password)
...
Mysql.new(URI(hostname, 'scott', 'tiger', databasename)
...
...
ws.url(url).withAuth("john", "secret", WSAuthScheme.BASIC)
...
javap -c
명령을 사용하여 암호 값이 들어갈 디스어셈블된 코드에 액세스할 수 있다는 것입니다. Example 1
의 예제를 실행한 결과는 다음과 비슷합니다.
javap -c MyController.class
24: ldc #38; //String john
26: ldc #17; //String secret
...
let password = "secret"
let username = "scott"
let con = DBConnect(username, password)
...
예제 2: 다음 ODBC 연결 문자열은 하드코드된 비밀번호를 사용합니다.
...
https://user:secretpassword@example.com
...
...
server=Server;database=Database;UID=UserName;PWD=Password;Encrypt=yes;
...
...
Dim con As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
con.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=scott;Passwd=tiger;"
...
...
credential_settings:
username: scott
password: tiger
...
Null
암호는 보안을 침해할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
var storedPassword:String = null;
var temp:String;
if ((temp = readPassword()) != null) {
storedPassword = temp;
}
if(Utils.verifyPassword(userPassword, storedPassword))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
string storedPassword = null;
string temp;
if ((temp = ReadPassword(storedPassword)) != null) {
storedPassword = temp;
}
if (Utils.VerifyPassword(storedPassword, userPassword)) {
// Access protected resources
...
}
...
ReadPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 비밀번호를 검색하지 못하면 공격자가 userPassword
에 대해 null
값을 입력하여 비밀번호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
string storedPassword = null;
string temp;
if ((temp = ReadPassword(storedPassword)) != null) {
storedPassword = temp;
}
if(Utils.VerifyPassword(storedPassword, userPassword))
// Access protected resources
...
}
...
ReadPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
char *stored_password = NULL;
readPassword(stored_password);
if(safe_strcmp(stored_password, user_password))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 user_password
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
을 지정하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
String storedPassword = null;
String temp;
if ((temp = readPassword()) != null) {
storedPassword = temp;
}
if(Utils.verifyPassword(userPassword, storedPassword))
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
로 초기화하고, 서버가 현재 요청을 이전에 거부하지 않은 경우 Android WebView 저장소에서 자격 증명을 읽은 후 보호된 페이지를 보기 위한 인증을 설정하는 데 사용합니다.
...
webview.setWebViewClient(new WebViewClient() {
public void onReceivedHttpAuthRequest(WebView view,
HttpAuthHandler handler, String host, String realm) {
String username = null;
String password = null;
if (handler.useHttpAuthUsernamePassword()) {
String[] credentials = view.getHttpAuthUsernamePassword(host, realm);
username = credentials[0];
password = credentials[1];
}
handler.proceed(username, password);
}
});
...
Example 1
과 마찬가지로 useHttpAuthUsernamePassword()
에서 false
를 반환하면 공격자가 null
암호를 입력하여 보호된 페이지를 볼 수 있습니다.null
암호를 사용하는 것은 좋은 방법이 아닙니다.null
로 설정합니다.
...
var password=null;
...
{
password=getPassword(user_data);
...
}
...
if(password==null){
// Assumption that the get didn't work
...
}
...
null
을 할당하지 마십시오.null
암호를 초기화합니다.
{
...
"password" : null
...
}
null
암호를 사용합니다. Null
암호는 보안을 침해할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
NSString *stored_password = NULL;
readPassword(stored_password);
if(safe_strcmp(stored_password, user_password)) {
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 user_password
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
<?php
...
$storedPassword = NULL;
if (($temp = getPassword()) != NULL) {
$storedPassword = $temp;
}
if(strcmp($storedPassword,$userPassword) == 0) {
// Access protected resources
...
}
...
?>
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화합니다.
DECLARE
password VARCHAR(20);
BEGIN
password := null;
END;
null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
storedPassword = NULL;
temp = getPassword()
if (temp is not None) {
storedPassword = temp;
}
if(storedPassword == userPassword) {
// Access protected resources
...
}
...
getPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 userPassword
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.nil
을 할당하는 것은 잘못된 방법입니다.nil
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
@storedPassword = nil
temp = readPassword()
storedPassword = temp unless temp.nil?
unless Utils.passwordVerified?(@userPassword, @storedPassword)
...
end
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 @userPassword
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.nil
로 설정될 수 있습니다. 이 경우에는 암호가 함수에 전달되도록 인수의 개수를 올바르게 지정해야 합니다.null
을 지정하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
ws.url(url).withAuth("john", null, WSAuthScheme.BASIC)
...
null
암호를 사용합니다. Null
암호는 보안을 침해할 수 있습니다.nil
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 저장된 암호 값을 읽으려고 함으로써 사용자가 제공하는 값과 비교합니다.
...
var stored_password = nil
readPassword(stored_password)
if(stored_password == user_password) {
// Access protected resources
...
}
...
readPassword()
가 데이터베이스 오류 또는 다른 문제로 인해 저장된 암호를 검색하지 못하면 공격자가 user_password
에 대해 null
값을 입력하여 암호 확인을 무시할 수 있습니다.null
을 할당하는 것은 잘못된 방법입니다.null
로 초기화하고 이를 사용하여 데이터베이스에 연결합니다.
...
Dim storedPassword As String
Set storedPassword = vbNullString
Dim con As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
con.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=scott;Passwd=" & storedPassword &";"
...
Example 1
의 코드가 성공하면 데이터베이스 사용자 계정인 “scott”이 공격자가 쉽게 추측할 수 있는 빈 암호로 구성되어 있음을 나타냅니다. 프로그램을 공개한 후에는 비어 있지 않은 암호를 사용하기 위한 계정 업데이트를 위해 코드 변경이 필요합니다.
...
* Default username for FTP connection is "scott"
* Default password for FTP connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
* Default username for database connection is "scott"
* Default password for database connection is "tiger"
...
...
<!-- Default username for database connection is "scott" -->
<!-- Default password for database connection is "tiger" -->
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
-- Default username for database connection is "scott"
-- Default password for database connection is "tiger"
...
...
# Default username for database connection is "scott"
# Default password for database connection is "tiger"
...
...
#Default username for database connection is "scott"
#Default password for database connection is "tiger"
...
...
// Default username for database connection is "scott"
// Default password for database connection is "tiger"
...
...
'Default username for database connection is "scott"
'Default password for database connection is "tiger"
...