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

plots: fix wrong link #6693

Merged
merged 1 commit into from
Oct 11, 2021
Merged

plots: fix wrong link #6693

merged 1 commit into from
Oct 11, 2021

Conversation

pared
Copy link
Contributor

@pared pared commented Sep 27, 2021

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Fixes @jorgeorpinel review comments at #6431

@pared pared requested a review from jorgeorpinel September 27, 2021 21:17
@pared pared requested a review from a team as a code owner September 27, 2021 21:17
@pared pared requested a review from jbencook September 27, 2021 21:17
Copy link

@jbencook jbencook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

dvc/render/vega.py Show resolved Hide resolved
Comment on lines 38 to +40
<img src="{src}">
</div>""".format(
title=revision, src=rel_img_path
title=revision, src=(relpath(img_path, page_dir_path))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this refactoring does πŸ˜‹

My feedback (#6431 (review)) was that you could inject HTML code via revision, which is a CLI input I think (can be any string). Of course it get's prepended with static/ so maybe that neutralizes any script, not sure.

Still the best practice would be to validate the input or at least sanitize the HTML output? Or maybe I'm exaggerating here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgeorpinel I am not sure I understand. Do you mean to pass some HTML via revision CLI argument? What would this HTML be and what would be its purpose?

Copy link
Contributor

@jorgeorpinel jorgeorpinel Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay @pared .

Do you mean to pass some HTML via revision CLI argument?

Yes. Well, probably JS mainly.

What would this HTML be and what would be its purpose?

A malicious <script>.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so in the beginning, I did not understand the problem. Hmm, it seems that you are right here.

On the other hand, I think that if one is able to use dvc plots show, he/she can edit the webpage in-place (since they have write permission anyway), so the modification can be done without help of DVC.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK @pared ! Up to you

Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If #6693 (review) is not a vulnerability you should probably either roll back the refactored chunk and merge, or merge as it is now if you prefer. Thanks

@pared
Copy link
Contributor Author

pared commented Oct 11, 2021

@jorgeorpinel let's leave it as is. @jbencook can I get approval? cannot merge without it

@pared pared merged commit d6ecef7 into iterative:master Oct 11, 2021
@pared
Copy link
Contributor Author

pared commented Oct 11, 2021

Thanks @skshetry!

@efiop efiop added the skip-changelog Skips changelog label Oct 11, 2021
@pared pared deleted the images_review branch January 4, 2022 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skips changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants