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

Fetosense API - variable name change and generate PDF correction #34

Merged
merged 10 commits into from
Mar 14, 2024

Conversation

devikasuresh20
Copy link
Member

@devikasuresh20 devikasuresh20 commented Mar 7, 2024

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Refactoring
  • Documentation
  • Other ( please specify )

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@devikasuresh20
Copy link
Member Author

@drtechie and @ravishanigarapu
As you can see there is a codeql error in FetosenseServiceImpl-> generatePDF method. As a fix , I given condition to check the protocol in the reportPath for sanitization. But still codeql error is coming.
Can we make this as a false positive case ? Pls suggest on this.

@drtechie
Copy link
Member

@devikasuresh20 As far as I understand, CodeQL has detected reportPathas a user provided input.
If you check the paths for this error, it looks like reportPath is coming via an API.
This URL is in turn used to initiate a connection - the reason for this security error.
I am not sure of the context, if the report is in an external system and if you know the domain of the reportPath, then add that as a criterion (see the example code provided in the issue).

@devikasuresh20
Copy link
Member Author

@drtechie
I added condition to check the domain of reportPath , but still same issue. Here I am comparing the domain using "contains()", because reportPath is different for each record.

@devikasuresh20
Copy link
Member Author

@drtechie As discussed, I added host name check also. But still same error from codeql.
In HWC API, the same logic is working fine without any domain check.

@drtechie and @ravishanigarapu Can we make it as false positive ?

}

Copy link
Member

Choose a reason for hiding this comment

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

Can we remove unused code?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@drtechie
Copy link
Member

@devikasuresh20 sounds okay to me.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Member

@ravishanigarapu ravishanigarapu left a comment

Choose a reason for hiding this comment

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

looks ok to me

@ravishanigarapu ravishanigarapu merged commit bec8bc0 into PSMRI:develop Mar 14, 2024
5 checks passed
ravishanigarapu pushed a commit that referenced this pull request Mar 14, 2024
#35)

* Corrected the properties variable name for ANC fetosense test

* Corrected partner fetosense Id variable name in FeotalMonitorData

* Corrected GeneratePDF from reportPath

* Added protocol check condition to identify invalid protocol

* Added condition to check filepath

* Added new URL inside condition check

* Added hostname comparison in foetalMonitor update

* fetosense update api - generate pdf changes

---------

Co-authored-by: Devika <[email protected]>
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.

3 participants