Skip to content

Conversation

@dstorozhuk
Copy link
Collaborator

Description:
Explain the technical implementation of the work done.

Jira: (Skip unless you are MA staff)
DP-****

To Test:

  • Add steps to test this feature

Peer Review Checklist

@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat November 27, 2025 00:36 Destroyed
@dstorozhuk dstorozhuk changed the title feature/DP-43340-replace-feedback-api-backend DP-43340 replace-feedback-api-backend Nov 27, 2025
Copy link

@prisma-cloud-devsecops prisma-cloud-devsecops bot left a comment

Choose a reason for hiding this comment

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

Prisma Cloud has found errors in this PR ⬇️

timeout: 10000,
maximumAge: 300000, // 5 minutes cache
},
);

Choose a reason for hiding this comment

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

MEDIUM  Restrict unnecessarily powerful browser features
    File: mass-feedback-form.behaviors.js | Checkov ID: CKV3_SAST_78


How To Fix

// Only query for geolocation when a user action requires it
function getLocation() {
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(position => {
// Use the position data
});
} else {
// Handle no geolocation scenario
}
}

// This function should only be triggered when the user explicitly requests a feature that needs geolocation
document.querySelector("#getLocationButton").addEventListener('click', getLocation);


Description

CWEs: CWE-250: Execution with Unnecessary Privileges, CWE-359: Exposure of Private Personal Information to an Unauthorized Actor
OWASP: A01:2021-Broken Access Control

Browser features like geolocation, camera, and microphone offer vast functionalities but come with inherent security and privacy implications. These features are accessible through JavaScript APIs and often require user permissions. While these permissions might be essential for certain applications, they can be misused or exploited by attackers if not properly managed.

When unnecessary access to these features is allowed, it can lead to situations where sensitive information is exposed or where the application operates with more privileges than required, leading to potential security vulnerabilities.

Vulnerable code example:

javascript
// Querying for geolocation permission
navigator.permissions.query({name: "geolocation"}).then(response => {
  if (response.state == 'granted') {
    // Access granted
  } else {
    // Access denied
  }
});

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dstorozhuk Is it your understanding as well that we already are only calling the geolocation on form submit, so this issue is already addressed?

@dstorozhuk dstorozhuk force-pushed the feature/DP-43340-replace-feedback-api-backend branch from 09e598b to b3051b8 Compare November 27, 2025 01:13
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat November 27, 2025 01:14 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 1, 2025 19:27 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 1, 2025 19:51 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 2, 2025 04:31 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 2, 2025 12:09 Destroyed
Copy link
Collaborator

@tfleming-ma tfleming-ma left a comment

Choose a reason for hiding this comment

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

@dstorozhuk Overall looking good to me. I added some very minor comments and suggestions for a couple minor things. I also added a topic for discussion to the ticket.

timeout: 10000,
maximumAge: 300000, // 5 minutes cache
},
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dstorozhuk Is it your understanding as well that we already are only calling the geolocation on form submit, so this issue is already addressed?

@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 9, 2025 04:28 Destroyed
…support.

Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
…nodes without organization

Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
Co-authored-by: Thomas Fleming <thomas.r.fleming@mass.gov>
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 9, 2025 12:14 Destroyed
…n feedback submission

Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 9, 2025 16:00 Destroyed
…detection

Signed-off-by: Dmytro Storozhuk <dima@itech4web.com>
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 9, 2025 19:49 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 16, 2025 04:30 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 23, 2025 04:30 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat December 30, 2025 04:31 Destroyed
@arthurbaghdas arthurbaghdas temporarily deployed to Tugboat January 6, 2026 04:47 Destroyed
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.

4 participants