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

Creating an entity with ending/starting whitespaces can lead to stream sync infinite loop #6708

Closed
labo-flg opened this issue Apr 16, 2024 · 1 comment · Fixed by #6714
Closed
Assignees
Labels
bug use for describing something not working as expected solved use to identify issue that has been solved (must be linked to the solving PR)

Comments

@labo-flg
Copy link
Member

labo-flg commented Apr 16, 2024

Description

Knowing that:

  • (1) All string values are trimmed just before indexing, so if you create an entity with a name having trailing whitespaces, creation will succeed and in the database it will end up without these spaces.
  • (2) When a platform receives an update event to ingest, it checks if it would result in changes, and will not patch the object if there is nothing to change.

Now if you receive an update event with just the same name with the whitespaces, the patch check (2) will detect this is a valid patch as it's indeed different from what's in database (the trimmed version IS different from the raw version).
Update will occur, and an event will be emitted. But the object name is not changed in database because (1).

Now the fun part: if you have bidirectional synchronization of 2 OCTI platform on these events, you enter an infinite loop of update events. The initial emitter sees their own creation event coming back, ingested, and thrown back again, etc.

Environment

6.0.9

Reproducible Steps

A simple repo case can be achieved with Playbook to simulate this bidirectional sync loop

  1. Create a playbook with a Listener on create/update reports + ingester
  2. Start the playbook (in local, do not forget to start a Worker)
  3. Open the live stream
  4. Create a report with name ending with several whitespaces, like aa
  5. checkout the live stream

Expected Output

1 Creation event and that's it

Actual Output

Infinite loop of update events

Additional information

image
image

@labo-flg labo-flg added bug use for describing something not working as expected needs triage use to identify issue needing triage from Filigran Product team labels Apr 16, 2024
@labo-flg labo-flg self-assigned this Apr 16, 2024
@labo-flg
Copy link
Member Author

happens in all environments ; I'm pushing a draft PR to try and solve this quickly..

@SamuelHassine SamuelHassine added this to the Release 6.1.0 milestone Apr 17, 2024
@nino-filigran nino-filigran removed the needs triage use to identify issue needing triage from Filigran Product team label Apr 17, 2024
@SamuelHassine SamuelHassine added the solved use to identify issue that has been solved (must be linked to the solving PR) label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug use for describing something not working as expected solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants