Skip to content

Escape control characters when displaying VCL content#1637

Merged
jedisct1 merged 2 commits intofastly:mainfrom
dip-proto:sanitizevcl
Mar 9, 2026
Merged

Escape control characters when displaying VCL content#1637
jedisct1 merged 2 commits intofastly:mainfrom
dip-proto:sanitizevcl

Conversation

@jedisct1
Copy link
Contributor

@jedisct1 jedisct1 commented Jan 26, 2026

Change summary

VCL content currently allows control characters, which are stored without modification.

This allows injecting control characters that manipulate the user’s terminal, potentially causing the CLI to display VCL code different from the code being executed.

Fix this by escaping control sequences.

This is a low-impact issue, as it requires write access to the VCL.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

Escape sequences are now displayed as escaped.

Are there any considerations that need to be addressed for release?

@jedisct1 jedisct1 requested a review from a team as a code owner January 26, 2026 22:45
Copy link
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

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

This looks great! Thank you sir!

VCL content currently allows control characters, which are stored
without modification.

This allows a malicious API token owner to inject control characters
that manipulate the user’s terminal, potentially causing the CLI to
display VCL code different from the code being executed.

Fix this by escaping control sequences.
@jedisct1 jedisct1 enabled auto-merge (squash) March 9, 2026 14:11
@jedisct1 jedisct1 merged commit c6b7ba6 into fastly:main Mar 9, 2026
9 checks passed
jedisct1 added a commit that referenced this pull request Mar 17, 2026
Both PRs were merged after the v14.0.4 release.
jedisct1 added a commit that referenced this pull request Mar 17, 2026
### Change summary

Moved two changelog entries from the v14.0.0 section to Unreleased, as
both PRs were merged after v14.0.4 was tagged:

  - #1653 - feat(compute/build): Block version 1.93.0 of Rust
- #1637 - feat(service/vcl): escape control characters when displaying
VCL content

  All Submissions:

  * [x] Have you followed the guidelines in our Contributing document?
* [x] Have you checked to ensure there aren't other open [Pull
Requests](https://github.com/fastly/cli/pulls) for the
  same update/change?

  ### New Feature Submissions:

  * [x] Does your submission pass tests?

  ### Changes to Core Features:

  * [x] Have you written new tests for your core changes, as applicable?
  * [x] Have you successfully run tests with your changes locally?

  ### User Impact

  None. Documentation-only change to the changelog.

### Are there any considerations that need to be addressed for release?

  None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants