Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

194580 - productversions integration with scs stub #418

Draft
wants to merge 30 commits into
base: develop-s100
Choose a base branch
from

Conversation

chaital14503
Copy link
Collaborator

This PR includes code changes and UTs for
PBI 194580

…s' into dev/194580-productversions-integration-with-scs-stub
@chaital14503 chaital14503 changed the title Dev/194580 productversions integration with scs stub 194580 - productversions integration with scs stub Jan 8, 2025
@ukho-bot
Copy link

ukho-bot commented Jan 8, 2025

Snyk checks have failed. 2 issues have been found so far.

Icon Severity Issues
Critical 0
High 1
Medium 0
Low 1

code/snyk check is complete. 2 issues have been found. (View Details)

async () =>
{
var result = await _exchangeSetStandardService.ProcessProductVersionsRequest(productVersionRequest, exchangeSetStandard, callbackUri, _correlationId, GetRequestCancellationToken());
var result = await _exchangeSetStandardService.ProcessProductVersionsRequestAsync(productVersionRequest, ApiVersion.V2, exchangeSetStandard, callbackUri, _correlationId, GetRequestCancellationToken());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Log Forging

Unsanitized input from an HTTP parameter flows into global::Microsoft.Extensions.Logging.ILogger.LogError, where it is used as log input. This may result in a Logs Forging vulnerability.

Line 67 | CWE-117 | Priority score 407 | Learn more about this vulnerability
Data flow: 28 steps

Step 1 - 2

public Task<IActionResult> PostProductVersions(string exchangeSetStandard, [FromBody] IEnumerable<ProductVersionRequest> productVersionRequest, [FromQuery] string callbackUri)

Step 3 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Controllers/V2/ExchangeSetController.cs#L67

Step 4 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Services/V2/ExchangeSetStandardService.cs#L73

Step 5 - 7 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Services/V2/ExchangeSetStandardService.cs#L75

Step 8 - 9 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Services/V2/ExchangeSetStandardService.cs#L82

Step 10 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Services/V2/ExchangeSetStandardService.cs#L92

Step 11 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L73

Step 12 - 14 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L85

Step 15 - 17 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L87

Step 18 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L89

Step 19 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L94

Step 20 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L96

Step 21 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L99

Step 22 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L100

Step 23 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L103

Step 24 - 26 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L122

Step 27 - 28

_logger.LogError(EventIds.SalesCatalogueServiceNonOkResponse.ToEventId(),

async () =>
{
var result = await _exchangeSetStandardService.ProcessProductVersionsRequest(productVersionRequest, exchangeSetStandard, callbackUri, _correlationId, GetRequestCancellationToken());
var result = await _exchangeSetStandardService.ProcessProductVersionsRequestAsync(productVersionRequest, ApiVersion.V2, exchangeSetStandard, callbackUri, _correlationId, GetRequestCancellationToken());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Server-Side Request Forgery (SSRF)

Unsanitized input from an HTTP parameter flows into global::System.Net.Http.HttpRequestMessage, where it is used as an URL to perform a request. This may result in a Server-Side Request Forgery vulnerability.

Line 67 | CWE-918 | Priority score 603 | Learn more about this vulnerability
Data flow: 14 steps

Step 1 - 2

public Task<IActionResult> PostProductVersions(string exchangeSetStandard, [FromBody] IEnumerable<ProductVersionRequest> productVersionRequest, [FromQuery] string callbackUri)

Step 3 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Controllers/V2/ExchangeSetController.cs#L67

Step 4 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Services/V2/ExchangeSetStandardService.cs#L73

Step 5 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.API/Services/V2/ExchangeSetStandardService.cs#L92

Step 6 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L73

Step 7 - 9 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L81

Step 10 - 11 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/V2/SalesCatalogueService.cs#L87

Step 12 UKHO.ExchangeSetService.API/UKHO.ExchangeSetService.Common/Helpers/SalesCatalogueClient.cs#L25

Step 13 - 14

using var httpRequestMessage = new HttpRequestMessage(method, uri)

Copy link
Collaborator

@Nadeem14456 Nadeem14456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Collaborator

@harshal11869 harshal11869 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants