Bug: Service Principal App ID node property displaying Service Principal Object ID instead of App ID

Open Beginner friendly
#1,846 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
azure, go
Domain
api, cloud

Research direction

Start in packages/go/analysis/azure/service_principal.go at getServicePrincipalAppID and trace FetchServicePrincipalApplications into packages/go/analysis/azure/queries.go. Reproduce with an AzureHound payload containing a service principal, then verify the node panel shows the application ID rather than the service principal object ID.

Written by the indexing model from the issue text.

Description

bug triage

Description:

The node entity panel for AZServicePrincipal objects displays the object ID of the service principal in the App ID property instead of the application ID.

Are you intending to fix this bug?

Yes

Component(s) Affected:

  • API

Steps to Reproduce:

Ingest an azurehound payload for an Entra ID tenant with a service principal (e.g., specterdev), search for a service principal in the Explore tab, and click a service principal node. Note that the object ID and app ID are the same and that the app ID does not reflect the application ID noted in Entra ID.

Expected Behavior:

The application ID should be displayed in the app ID property of the service principal node entity panel.

Actual Behavior:

The object ID is displayed in the app ID property of the service principal node entity panel instead of the application ID.

Environment Information:

BloodHound: 8.1.0

Collector: AzureHound 2.4.1

OS: Windows 11

Additional Information:

https://specterops.atlassian.net/browse/BED-6431

Potential Solution (optional):

The issue is that the FetchServicePrincipalApplications function called by getServicePrincipalAppID function (https://github.com/SpecterOps/BloodHound/blob/main/packages/go/analysis/azure/service_principal.go#L58 ) gets the end node (the service principal) instead of the application (the end node) on this line: https://github.com/SpecterOps/BloodHound/blob/0c823b12f27b29aa36df0342a49769e20a107e99/packages/go/analysis/azure/queries.go#L567

Changing FetchEndNodes to FetchStartNodes resolves the issue.

Contributor Checklist:

  • I have searched the issue tracker to ensure this bug hasn't been reported before or is not already being addressed.
  • I have provided clear steps to reproduce the issue.
  • I have included relevant environment information details.
Dominant language
Go
Stars
3.4k
Forks
376
Avg merge
2d 7h
Merged PRs (30d)
97

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SpecterOps/BloodHound

All issues in SpecterOps/BloodHound

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.