1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-27 11:02:16 +01:00
unleash.unleash/src
Gastón Fournier fab5dc8725
fix: Information exposure through a stack trace (#10737)
Fix for
[https://github.com/Unleash/unleash/security/code-scanning/81](https://github.com/Unleash/unleash/security/code-scanning/81)

To prevent information exposure through stack traces, ensure that the
HTTP response sent to clients contains only sanitized, generic error
information, such as a status code and a simple message. Internal
details (including stack traces, error types, or internal error codes)
should not be sent to the client. These can be safely logged on the
server for debugging.

**The fix:**  
- Do not return the entire `finalError` object as JSON to the client, as
it may include fields like `stack` or `internalMessage`.
- Instead, return only a subset of fields that are safe to expose to the
user, in this case just `message` .
- Log the full error and any debugging details using the server-side
logger **as currently done**.


---
_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-07 16:41:40 +02:00
..
lib fix: Information exposure through a stack trace (#10737) 2025-10-07 16:41:40 +02:00
mailtemplates fix: health-technical debt trends in emails (#10308) 2025-07-04 16:46:59 +02:00
migrations feat: milestone progressions migration (#10738) 2025-10-06 13:47:02 +02:00
test fix: flaky test when updated_at matches the time of query (#10752) 2025-10-07 16:03:57 +02:00
migrator.ts chore: remove AWS IAM DB auth prototype code (#10662) 2025-09-12 14:46:28 +01:00
server-dev.ts feat: add a suggestion banner at the bottom of empty feature-environments (#10725) 2025-10-06 09:02:15 +02:00
server.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
test-setup.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00