An organization conducted a web application vulnerability assessment against the corporate website, and the following output was observed: Which of the following tuning recommendations should the security analyst share?
A.
Set an HttpOnly flag to force communication by HTTPS
B.
Block requests without an X-Frame-Options header
C.
Configure an Access-Control-Allow-Origin header to authorized domains
D.
Disable the cross-origin resource sharing header
The answer is actually C if there is only one option to choose since this has the most issues and highlighted in the picture, if it's multiple options then B and C since it's also vulnerable to clickjacking
C. Configure an Access-Control-Allow-Origin header to authorized domains
Explanation:
Cross Domain Misconfiguration often refers to improper handling of cross-origin resource sharing (CORS) policies. CORS is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the resource originated.
The Access-Control-Allow-Origin header is used in CORS to specify which domains are allowed to access the resources on a web server. If this header is misconfigured, it could allow any domain to access sensitive resources, leading to security vulnerabilities.
By configuring the Access-Control-Allow-Origin header to only authorized domains, you restrict access to those resources to only the specified, trusted domains, mitigating the risk associated with cross-domain requests.
Answer is B:
The output shows that the web application is vulnerable to clickjacking attacks which wouls allow a badguy to overlay a hidden frame on top of a legitimate page and trick users into clicking on malicious links. Blocking requests without an X-frame-Options header prevents this attack by intructing the browser to not display the page with a frame.
Cross-Domain Misconfiguration suggests that there might be an issue related to how the web application handles cross-origin requests.
Configuring an Access-Control-Allow-Origin header allows the server to specify which domains are permitted to access its resources, thereby controlling access to resources from different origins.
By configuring the Access-Control-Allow-Origin header to authorize specific domains, the organization can mitigate the risk of unauthorized cross-origin access and prevent potential security vulnerabilities associated with cross-domain interactions.
C is the correct answer.
Option B, “Block requests without an X-Frame-Options header,” addresses a different type of vulnerability related to clickjacking. While it’s important to mitigate clickjacking risks, the primary issue highlighted in the findings is “Cross-Domain Misconfiguration.”
Configuring the Access-Control-Allow-Origin header (Option C) directly addresses this specific issue by ensuring that only authorized domains can access resources, which is crucial for preventing unauthorized cross-domain access
while both the X-Frame-Options header and the Access-Control-Allow-Origin header are important for addressing specific vulnerabilities, setting the HttpOnly flag on cookies directly addresses multiple critical issues identified in the assessment. Each of these measures plays a vital role in enhancing the overall security posture of the web application.
It doesn't have the most issues though, Information Disclosure - Suspicious Comments has more. I don't think it being highlighted is relevant to the question. The reason B might be wrong is X-Frame-Options should be set to DENY but B says "block requests without an X-Frame Header" which I think it should say block requests WITH a X-Frame Header.
Answer is C.
Access-Control-Allow-Origin (ACAO) – Specifies the external domains that can access the web server’s resources. If the server generates this header dynamically, or if the website allows domains using a wildcard, the server may allow access to any domain, including those of attacker-controlled websites.
Source: https://crashtest-security.com/cors-misconfiguration/
Option B (Block requests without an X-Frame-Options header) deals with clickjacking protection, not specifically cross-domain misconfiguration.
The Access-Control-Allow-Origin header is used to specify which domains are permitted to access the resources on the server. By configuring this header to authorized domains, you can control and restrict cross-origin access, addressing the cross-domain misconfiguration issue.
if "A cross-origin resource-sharing misconfiguration occurs when the web server allows third-party domains to perform privileged tasks through the browsers of legitimate users." then adding the autentication to the allow-origin as in C what is changing? instead why is not D "disable the cross-oring sharing header"? on this way all the 'allowed' misuconfigurations would be blocked
Agree on C based on the following understanding.
What is Cross-Domain Misconfiguration?
https://crashtest-security.com/cors-misconfiguration/#:~:text=commonly%20asked%20questions.-,What%20is%20CORS%20Misconfiguration%3F,the%20browsers%20of%20legitimate%20users.
Troubleshooting and Solving CORS?
https://www.linkedin.com/pulse/its-always-cors-problem-troubleshooting-solving-errors-carrubba-/
After careful analysis of the question, this is the correct answer. In my previous comment I gave the explanation but I chose the wrong answer. In order to solve "Cross-Domain Misconfiguration" recommend "Access-Control-Allow-Origin header". (https://scanrepeat.com/web-security-knowledge-base/cross-domain-misconfiguration#content)
On the other hand. The output shows that the web application has a cross-origin resource sharing (CORS) header that allows any origin to access its resources. The tuning recommendation is to configure the Access-Control-Allow-Origin header to only allow authorized domains that need to access the web applications resources. This would prevent unauthorized cross-origin requests and reduce the risk of cross-site request forgery (CSRF) attacks.
This is the best answer for the scenario described
This has more over wall impact compared to Option B.
Both are viable options. But C will fix more issues.
CompTIA is just acting a fool with these questions lately.
This section is not available anymore. Please use the main Exam Page.CS0-003 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ms123451
Highly Voted 8 months agogomet2000
Highly Voted 8 months agoKANKALE
Most Recent 6 months, 3 weeks agoFrannie23
7 months, 1 week agoIE17
6 months, 3 weeks agoblacksheep6r
7 months, 2 weeks agoBanesTech
8 months agoalialzehhawi
8 months agocannedtooth
8 months, 3 weeks agom025
1 year, 2 months agouser82
1 year, 3 months agojudd1111
1 year, 4 months agogreatsparta
1 year, 6 months agom025
1 year, 6 months agodeeden
1 year, 8 months agokmordalv
1 year, 8 months agoUncle_Lucifer
1 year, 8 months agoUncle_Lucifer
1 year, 8 months ago