2020-12-21 15:38:52 +01:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
2023-01-09 15:29:41 +01:00
|
|
|
[source,php]
|
2020-12-21 15:38:52 +01:00
|
|
|
----
|
|
|
|
$url = "http://example.com"; // Sensitive
|
|
|
|
$url = "ftp://anonymous@example.com"; // Sensitive
|
|
|
|
$url = "telnet://anonymous@example.com"; // Sensitive
|
|
|
|
|
|
|
|
$con = ftp_connect('example.com'); // Sensitive
|
|
|
|
|
|
|
|
$trans = (new Swift_SmtpTransport('XXX', 1234)); // Sensitive
|
|
|
|
|
|
|
|
$mailer = new PHPMailer(true); // Sensitive
|
2021-08-16 13:40:21 +02:00
|
|
|
|
|
|
|
define( 'FORCE_SSL_ADMIN', false); // Sensitive
|
|
|
|
define( 'FORCE_SSL_LOGIN', false); // Sensitive
|
2020-12-21 15:38:52 +01:00
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,php]
|
2020-12-21 15:38:52 +01:00
|
|
|
----
|
2023-01-09 15:29:41 +01:00
|
|
|
$url = "https://example.com";
|
|
|
|
$url = "sftp://anonymous@example.com";
|
|
|
|
$url = "ssh://anonymous@example.com";
|
2020-12-21 15:38:52 +01:00
|
|
|
|
2023-01-09 15:29:41 +01:00
|
|
|
$con = ftp_ssl_connect('example.com');
|
2020-12-21 15:38:52 +01:00
|
|
|
|
|
|
|
$trans = (new Swift_SmtpTransport('smtp.example.org', 1234))
|
2023-01-09 15:29:41 +01:00
|
|
|
->setEncryption('tls')
|
2020-12-21 15:38:52 +01:00
|
|
|
;
|
|
|
|
|
|
|
|
$mailer = new PHPMailer(true);
|
2023-01-09 15:29:41 +01:00
|
|
|
$mailer->SMTPSecure = 'tls';
|
2021-08-16 13:40:21 +02:00
|
|
|
|
2023-01-09 15:29:41 +01:00
|
|
|
define( 'FORCE_SSL_ADMIN', true);
|
|
|
|
define( 'FORCE_SSL_LOGIN', true);
|
2020-12-21 15:38:52 +01:00
|
|
|
----
|
|
|
|
|
|
|
|
include::../exceptions.adoc[]
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2024-05-06 07:56:31 +01:00
|
|
|
|
2021-09-20 15:38:42 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|