tensorflow / tensorflow/tensorboard
Polymer: disable data binding on style attribute
Open
Nobody has claimed this yet.
core:frontend
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Description
For security enhanced TensorBoard, we use polymer-resin. It fails to correctly sanitize data-bound style attribute and completely omits the style.
Very simple regex found few 7 instances of the violations:
tensorboard/plugins/text/tf_text_dashboard/tf-text-loader.html
39: style="border-color: [[_runColor]]"
tensorboard/plugins/graph/tf_graph_debugger_data_card/tf-graph-debugger-data-card.html
246: style="background:[[item.background_color]]"
tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.html
600: style="fill:[[item.color]]"
tensorboard/plugins/pr_curve/tf_pr_curve_dashboard/tf-pr-curve-steps-selector.html
31: style="background:[[_computeColorForRun(run)]];"
tensorboard/plugins/pr_curve/tf_pr_curve_dashboard/tf-pr-curve-card.html
75: style="background: [[_computeRunColor(run)]];"
tensorboard/plugins/projector/vz_projector/vz-projector-legend.html
57: <div class="shape" style="background-color: [[item.color]];"></div>
59: <div class="info" style="color: [[item.color]];">[[item.count]]</div>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the seven HTML templates and the listed style bindings, then check how polymer-resin handles data-bound style attributes. Verify the affected dashboards and confirm that the intended colors and borders still render without triggering the sanitizer issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- frontend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100