HTTP Header vulnerabilities
Posted: 2022-10-17 07:00
It is observed that number of http header vulnerabilities found. Please let us know to remove the header vulnerabilities.
A place where AppGini users can exchange ideas and help each other.
https://forums.appgini.com:443/phpbb/
https://forums.appgini.com:443/phpbb/viewtopic.php?f=11&t=4920
Code: Select all
########################################################################
function set_headers() {
// Additional security headers V22.14
@header('Content-Type: text/html; charset=' . datalist_db_encoding);
@header('X-Frame-Options: SAMEORIGIN'); // prevent iframing by other sites to prevent clickjacking
@header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
@header('Pragma: no-cache'); // HTTP 1.0.
@header('Expires: Thu, 01 Jan 1970 00:00:01 GMT'); // Proxies.
@header('X-Content-Type-Options: nosniff'); // nosniff.
@header('Referrer-Policy: strict-origin-when-cross-origin'); // Referrer Policy.
@header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
// @header("Feature-Policy: geolocation 'self'; sync-xhr 'self'"); deprecated, replaced with Permissions Policy
@header('Permissions-Policy: accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()');
@header('X-XSS-Protection: 1; mode=block'); // XSS Browser Protection
@header('X-Permitted-Cross-Domain-Policies: none');
@header('Expect-CT: max-age=43200, enforce, report-uri="https://yourdomain.com/report"');
@header("Content-Security-Policy: script-src 'self' https://translate.googleapis.com/ https://translate-pa.googleapis.com/ https://translate.google.com/ https://www.gstatic.com/recaptcha/releases/ https://www.google.com/ https://www.google.com/recaptcha/api.js https://secure.trust-provider.com/ https://cdnjs.cloudflare.com/ajax/libs/ https://ajax.googleapis.com/ https://translate.googleapis.com/ https://cdn.jsdelivr.net/ https://smarticon.geotrust.com/ https://www.jquery-az.com/javascript/alert/dist/; frame-src https://www.google.com/recaptcha/ https://www.gstatic.com/ https://www.google.com/; connect-src 'self'; img-src 'self' https://secure.trust-provider.com/ https://sectigo.com/ https://ui-avatars.com/api/ https://chart.googleapis.com/ https://www.gstatic.com/ data:"); // Content Security Policy
}
########################################################################