lakeFS icon indicating copy to clipboard operation
lakeFS copied to clipboard

Pull Requests: Sanitize to user provided fields

Open N-o-Z opened this issue 1 year ago • 3 comments

We should sanitize any user inputted fields in pull requests such as Title and Description to avoid potentially malicious attacks

N-o-Z avatar Sep 20 '24 17:09 N-o-Z

In case this is not part of the plan: It's cool to do it on the backend, but please (also) protect when inserting the user provided fields into the DOM. So it really needs to be based on an allowlist rather than on a blocklist. That list can come (and probably should) from an existing React library, of course.

arielshaqed avatar Sep 22 '24 08:09 arielshaqed

@itaigilo I think this is something we can do this current sprint. WDYT?

N-o-Z avatar Oct 02 '24 17:10 N-o-Z

@itaigilo I think this is something we can do this current sprint. WDYT?

Yeah, I guess so. Will do it on my next workday.

itaigilo avatar Oct 02 '24 18:10 itaigilo

@itaigilo should we close this?

itaiad200 avatar Nov 13 '24 15:11 itaiad200

@itaigilo should we close this?

@N-o-Z can we close it?

itaigilo avatar Nov 14 '24 22:11 itaigilo

@itaigilo should we close this?

@N-o-Z can we close it?

There's an open PR linked to this issue - what about it?

N-o-Z avatar Nov 14 '24 23:11 N-o-Z

There's an open PR linked to this issue - what about it?

It's not relevant anymore - there's no need to sanitize the fields on the UI side, and this PR can be closed.

itaigilo avatar Nov 15 '24 00:11 itaigilo

There's no need because? Also what about the BE?

N-o-Z avatar Nov 15 '24 00:11 N-o-Z

Why we do not believe that there is a threat here. lakeFS handles user-created metadata all over the place. For instance, a commit message is considerably more sensitive than a PR description because it appears in more places. We handle storing and displaying metadata by programming correctly: use the KV library, use pgx prepared queries when accessing SQL, using React to display data.

How this works, with examples from PRs>

  • WebUI uses React components. React components handle HTML-sensitive content correctly. For instance this is how we currently display description.
  • The backend uses KV to read and write data objects. For instance this is how we write a PR to KV.

So there is no issue here.

arielshaqed avatar Dec 23 '24 17:12 arielshaqed