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

Possible improper use of "replace()" to sanitize queryAi() results in XTM code? #9934

Open
1 of 3 tasks
PedroJSilva2001 opened this issue Feb 11, 2025 · 0 comments
Open
1 of 3 tasks
Labels
needs triage use to identify issue needing triage from Filigran Product team question Further information is requested

Comments

@PedroJSilva2001
Copy link

Prerequisites

  • I read the Deployment and Setup section of the OpenCTI documentation as well as the Troubleshooting page and didn't find anything relevant to my problem.
  • I went through old GitHub issues and couldn't find anything relevant
  • I googled the issue and didn't find anything relevant

Description

While performing a code scan in a fork of OpenCTI, I detected a possible improper sanitization of the results in XTM domain using the "replace()" function. In this case, from my understanding, with the pattern '"' it is only replacing the first occurrence of the double braces in the results of the LLM. Is this the intended behavior?

Version/Tag: 6.5.1
Commit: 1b14135
File: opencti/blob/master/opencti-platform/opencti-graphql/src/modules/xtm/xtm-domain.js
Lines:

  • 151
  • 197
  • 241
  • 287

Environment

N/A

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Run the line (e.g., in the Browser's console):
'\"Hello\"'.replace('"', '');
  1. The output of this should be 'Hello"' (but is this intended?)

Reference documentation

@PedroJSilva2001 PedroJSilva2001 added needs triage use to identify issue needing triage from Filigran Product team question Further information is requested labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage use to identify issue needing triage from Filigran Product team question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant