Skip to main content

Unrestricted access between network segments - Azure AD

Description

Azure Active Directory Graph API services can be accessed and used from anywhere on the Internet. Note: the URL of the service as well as the credentials to use it were found in the application code.

Impact

  • Access to confidential information from any computer on the Internet.
  • Edit information from any computer on the Internet.

Recommendation

Verify Azure documentation regarding Conditional Access policy and securely configure the service by establishing trusted locations to access the service.

Threat

Authorized user from the Internet.

Expected Remediation Time

⌚ 60 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: N
  • Attack complexity: L
  • Privileges required: L
  • User interaction: N
  • Scope: C
  • Confidentiality: L
  • Integrity: L
  • Availability: N

Temporal

  • Exploit code madurity: X
  • Remediation level: O
  • Report confidence: X

Result

  • Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N/E:X/RL:O/RC:X
  • Score:
    • Base: 6.4
    • Temporal: 6.1
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

Azure resources are configured to only be accessible to authorized users

public void grantAccess(user_id){
//Check correct permissions
if (getUser(user_id).hasPermissions){
ExecutorService service = Executors.newFixedThreadPool(1);
AuthenticationContext context = new AuthenticationContext(AUTHORITY, false, service);
Future<AuthenticationResult> future = context.acquireToken(
"https://graph.windows.net", user_id, null);
AuthenticationResult result = future.get();
//Granted access to the user
}
}

Non compliant code

The credentials to access azure services are found stored in the source code

USER_NAME = "admin";
PASSWORD = "accesspassword"
public void grantAccess(user_id){
ExecutorService service = Executors.newFixedThreadPool(1);
AuthenticationContext context = new AuthenticationContext(AUTHORITY, false, service);
Future<AuthenticationResult> future = context.acquireToken(
"https://graph.windows.net", user_id, USER_NAME, PASSWORD, null);
AuthenticationResult result = future.get();
//Granted access to the user
}

Requirements