core-agent-ide/docs
Curtis 'Fjord' Hawthorne cfbbbb1dda
Harden js_repl emitImage to accept only data: URLs (#13507)
### Motivation

- Prevent untrusted js_repl code from supplying arbitrary external URLs
that the host would forward into model input and cause external fetches
/ data exfiltration. This change narrows the emitImage contract to safe,
self-contained data URLs.

### Description

- Kernel: added `normalizeEmitImageUrl` and enforce that string-valued
`codex.emitImage(...)` inputs and `input_image`/content-item paths only
accept non-empty `data:` URLs; byte-based paths still produce data URLs
as before (`kernel.js`).
- Host: added `validate_emitted_image_url` and check `EmitImage`
requests before creating `FunctionCallOutputContentItem::InputImage`,
returning an error to the kernel if the URL is not a `data:` URL
(`mod.rs`).
- Tests/docs: added a runtime test
`js_repl_emit_image_rejects_non_data_url` to assert rejection of
non-data URLs and updated user-facing docs/instruction text to state
`data URL` support instead of generic direct image URLs (`mod.rs`,
`docs/js_repl.md`, `project_doc.rs`).

### Testing

- Ran `just fmt` in `codex-rs`; it completed successfully.
- Added a runtime test (`cargo test -p codex-core
js_repl_emit_image_rejects_non_data_url`) but executing the test in this
environment failed due to a missing system dependency required by
`codex-linux-sandbox` (the vendored `bubblewrap` build requires
`libcap.pc` via `pkg-config`), so the test could not be run here.
- Attempted a focused `cargo test` invocation with and without default
features; both compile/test attempts were blocked by the same missing
system `libcap` dependency in this environment.

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_i_69a7837bce98832d91db92d5f76d6cbe)
2026-03-05 12:12:32 -08:00
..
agents_md.md Rename hierarchical_agents to child_agents_md (#9215) 2026-01-14 19:14:24 +00:00
authentication.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
CLA.md chore: subject docs/*.md to Prettier checks (#4645) 2025-10-03 11:35:48 -07:00
config.md notify: include client in legacy hook payload (#12968) 2026-02-26 22:27:34 -08:00
contributing.md [Codex][CLI] Gate image inputs by model modalities (#10271) 2026-02-02 18:56:39 -08:00
example-config.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
exec.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
execpolicy.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
exit-confirmation-prompt-design.md feat(tui): retire the tui2 experiment (#9640) 2026-01-22 01:02:29 +00:00
getting-started.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
install.md feat: discourage the use of the --all-features flag (#12429) 2026-02-20 23:02:24 -08:00
js_repl.md Harden js_repl emitImage to accept only data: URLs (#13507) 2026-03-05 12:12:32 -08:00
license.md chore: subject docs/*.md to Prettier checks (#4645) 2025-10-03 11:35:48 -07:00
open-source-fund.md chore: subject docs/*.md to Prettier checks (#4645) 2025-10-03 11:35:48 -07:00
prompts.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
sandbox.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
skills.md Point skills docs to developer documentation site (#8407) 2025-12-21 16:18:58 -08:00
slash_commands.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
tui-alternate-screen.md fix: add tui.alternate_screen config and --no-alt-screen CLI flag for Zellij scrollback (#8555) 2026-01-09 18:38:26 +00:00
tui-chat-composer.md tui: preserve kill buffer across submit and slash-command clears (#12006) 2026-03-03 02:06:08 +00:00
tui-request-user-input.md tui: make Esc clear request_user_input notes while notes are shown (#10569) 2026-02-03 16:17:06 -08:00
tui-stream-chunking-review.md feat(tui): pace catch-up stream chunking with hysteresis (#10461) 2026-02-03 15:01:51 -08:00
tui-stream-chunking-tuning.md feat(tui): pace catch-up stream chunking with hysteresis (#10461) 2026-02-03 15:01:51 -08:00
tui-stream-chunking-validation.md feat(core): add configurable log_dir (#10678) 2026-02-05 01:23:30 +00:00