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

[TAXII ingester] Problem with passwords containing ":" #6403

Closed
Lhorus6 opened this issue Mar 21, 2024 · 3 comments · Fixed by #6529
Closed

[TAXII ingester] Problem with passwords containing ":" #6403

Lhorus6 opened this issue Mar 21, 2024 · 3 comments · Fixed by #6529
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)
Milestone

Comments

@Lhorus6
Copy link

Lhorus6 commented Mar 21, 2024

Description

If the credentials password used for a TAXII ingester contains ":", the platform deletes the end of the password (i.e. the ":" and all that follows).

Environment

OCTI 6.0.7

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Go to "Data > ingestion > TAXII feed" and create a TAXII ingester
  2. Select "Basic user / password" as Authentication type
  3. Put a password with ":" inside
  4. Close and reopen the configuration panel
  5. Check the password used -> it's been cut
@Lhorus6 Lhorus6 added bug use for describing something not working as expected needs triage use to identify issue needing triage from Filigran Product team labels Mar 21, 2024
@SamuelHassine SamuelHassine added this to the Release 6.0.9 milestone Mar 22, 2024
@nino-filigran nino-filigran removed the needs triage use to identify issue needing triage from Filigran Product team label Mar 22, 2024
@aHenryJard aHenryJard self-assigned this Mar 26, 2024
@aHenryJard
Copy link
Member

The user and password in Taxii feeds are concatenated together and coverted in base64 to create a Bearer on the backend side.
Here =>

const auth = Buffer.from(ingestion.authentication_value, 'utf-8').toString('base64');
headers.Authorization = `Basic ${auth}`;

And authentication is stored as one string field authentication_value on database, that can be depending on authentication_type:

  • "username:password" for basic
  • "base64certificate:base64key:base64CA" for certificate
  • "theToken" for bearer

So basically the authentication header that is send in request for username/password is "Bearer base64(username:password)"

First, I don't think it's possible to have ':' in the username because I don't know how the "Bearer usern:ame:password" will be read on the Taxii API side, but I think that ':' in the password side will work (since it's not the first ':' found in the string), I mean "username:pass:word" should works fine on taxi API side.

  1. Proposal 1 - more easy to implement but less user friendly:
  • in frontend we prevent users from having a ':' in both password and username, saying it's not allowed to have this character

Or

  1. Proposal 2 - a bit more complex to implement but more user friendly:
  • in frontend we prevent user to put a ":" in the username
  • instead of sending a string "username:password" to backend, we send it base64 encoded like "base64(username:password)" => so no ":" anymore on this string
  • to be backward compatible it's possible to check if ':' is present to know if it's base64 encoded or not (because existing username:password are not base64 in database)

I check other authentications ways, there is no ":" issue because it's base64 encoded already (we could check that on the frontend by the way), or the whole string is use as it is without splitting on ':'.

@nino-filigran could you give me your opinio between proposal 1 and 2 please ?

@nino-filigran
Copy link

In both solutions, I see that we would prevent users to input a ":" in their usernames. Given that we do not allow it in username, I would be keen to prevent it in the pwd field then. It's often something that exists in pwd forms.

This makes me wonder though: what if some users have already a ":" in their usernames or pwd, would they be affected?

cc @Jipegien in case you do not agree.

@Lhorus6
Copy link
Author

Lhorus6 commented Mar 28, 2024

If users currently have ":" in the password, their TAXII doesn't work (this is the subject of this issue). As for the username, I'd be surprised if any users have ":" in it. If that's the case, I don't think it works either.

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
4 participants