Title: CSV formula injection sanitizing skips the header row · Issue #54 · brightdata/sdk-python · GitHub
Open Graph Title: CSV formula injection sanitizing skips the header row · Issue #54 · brightdata/sdk-python
X Title: CSV formula injection sanitizing skips the header row · Issue #54 · brightdata/sdk-python
Description: #52 added _sanitize_csv_cell to neutralize CWE-1236 in export_csv, but it only runs on values. writer.writeheader() writes fields unchanged, and those field names come from keys in the scraped payload. from brightdata.datasets.utils impo...
Open Graph Description: #52 added _sanitize_csv_cell to neutralize CWE-1236 in export_csv, but it only runs on values. writer.writeheader() writes fields unchanged, and those field names come from keys in the scraped payl...
X Description: #52 added _sanitize_csv_cell to neutralize CWE-1236 in export_csv, but it only runs on values. writer.writeheader() writes fields unchanged, and those field names come from keys in the scraped payl...
Opengraph URL: https://github.com/brightdata/sdk-python/issues/54
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CSV formula injection sanitizing skips the header row","articleBody":"#52 added `_sanitize_csv_cell` to neutralize CWE-1236 in `export_csv`, but it only runs on values. `writer.writeheader()` writes `fields` unchanged, and those field names come from keys in the scraped payload.\n\n```python\nfrom brightdata.datasets.utils import export_csv\n\nexport_csv([{'=HYPERLINK(\"http://evil\",\"x\")': \"safe\", \"ok\": \"=1+1\"}], \"out.csv\")\n```\n\nout.csv:\n\n```\n\"=HYPERLINK(\"\"http://evil\"\",\"\"x\"\")\",ok\nsafe,'=1+1\n```\n\nThe value gets the leading quote, the header does not, so opening the file in Excel or Sheets still evaluates the header cell.\n\nRunning the header through the same sanitizer closes it. Note the explicit `fields=` argument should probably be sanitized too, since it can carry the same names. Happy to send a PR.","author":{"url":"https://github.com/chiruu12","@type":"Person","name":"chiruu12"},"datePublished":"2026-08-15T12:44:29Z","url":"https://github.com/brightdata/sdk-python/issues/54"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9f0304db-ca9e-464f-b36d-cedb38268f36 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A36:102FBB:1FC5092:2976E5E:6B040CB9 |
| html-safe-nonce | a61a75a6da36a11b22a462c5a65ced58f51a866687a42a002742911aba135ba5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTM2OjEwMkZCQjoxRkM1MDkyOjI5NzZFNUU6NkIwNDBDQjkiLCJ2aXNpdG9yX2lkIjoiMTEwMDY1OTI0MDUzNzk1MTQxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | af739f5ab5496152839f6475e6c8cc044d1cdded16a2681b4176e6e27e95187b |
| hovercard-subject-tag | issue:5159420533 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/brightdata/sdk-python/54/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e2dbd9cc7f85e49259565c074f4e22f90f60d646e5e58d7e32a7e2c0c79df523/brightdata/sdk-python/issues/54 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e2dbd9cc7f85e49259565c074f4e22f90f60d646e5e58d7e32a7e2c0c79df523/brightdata/sdk-python/issues/54 |
| og:image:alt | #52 added _sanitize_csv_cell to neutralize CWE-1236 in export_csv, but it only runs on values. writer.writeheader() writes fields unchanged, and those field names come from keys in the scraped payl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chiruu12 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/brightdata/sdk-python git https://github.com/brightdata/sdk-python.git |
| octolytics-dimension-user_id | 213028976 |
| octolytics-dimension-user_login | brightdata |
| octolytics-dimension-repository_id | 1033685757 |
| octolytics-dimension-repository_nwo | brightdata/sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1033685757 |
| octolytics-dimension-repository_network_root_nwo | brightdata/sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width