CVE-2022-2965 (published 2022-08-23T16:15Z)

Improper Restriction of Rendered UI Layers or Frames in GitHub repository notrinos/notrinoserp prior to 0.7.

CVSS v3 base score: 4.3, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N)

Weakness information:
cwe_id: CWE-1021
cwe_name: Improper Restriction of Rendered UI Layers or Frames
description: The web application does not restrict or incorrectly restricts frame objects or UI layers that belong to another application or domain, which can lead to user confusion about which interface the user is interacting with.
extended_description: A web application is expected to place restrictions on whether it is allowed to be rendered within frames, iframes, objects, embed or applet elements. Without the restrictions, users can be tricked into interacting with the application when they were not intending to.
         

Fix information:
repo_url: https://github.com/notrinos/notrinoserp
commit_details: repo_url: https://github.com/notrinos/notrinoserp
author: notrinos
author_date: 2022-08-23 21:31:52+07:00
msg: no x-frame-options header set which allow clickjacking attack. Fixed.
repository: repo_url: https://github.com/notrinos/notrinoserp
repo_name: notrinos/NotrinosERP
description: A web-based erp, accounting system that written in PHP and MySql includes Sales, Purchasing, Warehousing, Manufacturing, Human Resource... It supports multi user, multi currencies, multi languages.
repo_language: PHP
owner: notrinos
file_changes: filename: login.php
change_type: ModificationType.MODIFY
diff: @@ -52,6 +52,9 @@ $encoding = isset($_SESSION['language']->encoding) ? $_SESSION['language']->enco
 $rtl = isset($_SESSION['language']->dir) ? $_SESSION['language']->dir : 'ltr';
 $onload = !$login_timeout ? "onload='defaultCompany()'" : '';
 
+if (!headers_sent())
+	header("X-Frame-Options: SAMEORIGIN");
+
 echo "<!DOCTYPE html>\n";
 echo "<html dir='".$rtl."' >\n";
 echo "<head profile=\"http://www.w3.org/2005/10/profile\"><title>".$title."</title>\n";

programming_language: PHP
filename: password_reset.php
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,9 @@ $encoding = isset($_SESSION['language']->encoding) ? $_SESSION['language']->enco
 $rtl = isset($_SESSION['language']->dir) ? $_SESSION['language']->dir : 'ltr';
 $onload = !$login_timeout ? "onload='defaultCompany()'" : '';
 
+if (!headers_sent())
+	header("X-Frame-Options: SAMEORIGIN");
+
 echo "<!DOCTYPE html>\n";
 echo "<html dir='".$rtl."' >\n";
 echo "<head profile=\"http://www.w3.org/2005/10/profile\"><title>".$title."</title>\n";

programming_language: PHP
filename: header.inc
change_type: ModificationType.MODIFY
diff: @@ -41,7 +41,7 @@ function help_url($context=null) {
 		.'&ctxhelp=1&lang='.$country);
 }
 
-function send_css($css = '') {
+function send_css($css='') {
 	global $css_files;
 
 	init_css();
@@ -119,8 +119,10 @@ function page_header($title, $no_menu=false, $is_index=false, $onload='', $js=''
 
 	$encoding = $_SESSION['language']->encoding;
 
-	if (!headers_sent())
+	if (!headers_sent()) {
 		header("Content-type: text/html; charset=$encoding");
+		header("X-Frame-Options: SAMEORIGIN");
+	}
 	
 	echo "<!DOCTYPE html>\n";
 	echo "<html dir='" . $_SESSION['language']->dir . "' >\n";
@@ -145,4 +147,4 @@ function page_header($title, $no_menu=false, $is_index=false, $onload='', $js=''
 	$rend = new renderer();
 	$rend->menu_header($title, $no_menu, $is_index);
 	error_box();
-}
\ No newline at end of file
+}

programming_language: PHP