Commit Graph
34812 Commits
Author SHA1 Message Date
3adf79c536 Add telemetry for toolbar menu open events (#48225)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-04 16:26:13 -05:00
Kenan HasanaliyevandBen Kunkle b5765efcff edit_prediction: Add Mercury accept/reject tracking (#48306)
### Summary
Adds accept/reject tracking for Mercury edit predictions.

### Changes
Sends events to https://api-feedback.inceptionlabs.ai/feedback when:

Accept — user presses Tab
Reject — user presses Escape
Ignore — prediction dismissed implicitly (typing, cursor move, etc.)

Added `discard_explicit` method to the delegate trait to distinguish
explicit vs implicit dismissal. Updated `reject_prediction` and
`reject_current_prediction` methods with an `explicit` bool parameter to
thread this through to the Mercury feedback logic. Other providers are
unaffected—they use the default implementation.

Feedback is fire-and-forget in a background thread, only sent for
predictions that were shown.

### Data Collected
- Request ID (returned from Inception API)
- User action (either accept/reject/ignore)
- Client Zed version (to track updates made to Zed client which could
potentially affect nextedit implementation)


Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-02-04 16:19:33 -05:00
Richard Feldman 7b6057de46 Expand hardcoded agent terminal security rules (#48399)
Expands the hardcoded security rules that block dangerous `rm` commands
in the agent terminal tool.

### New blocked patterns

- `rm -rf $HOME` / `rm -rf $HOME/` / `rm -rf ${HOME}` / `rm -rf
${HOME}/`
- `rm -rf .` / `rm -rf ./`
- `rm -rf ..` / `rm -rf ../`
- `rm -rf ~/` (previously only `rm -rf ~` was blocked)

### Flag handling improvements

- Simplified the flag character class from `[rRfF]` to `[rf]` since the
regex is already compiled with case-insensitive mode — less confusing,
same behavior.
- Added tests verifying that reversed flags (`-fr`), uppercase (`RM
-RF`), split flags (`-r -f`), and chained commands all get caught.

### Safe commands still allowed

Paths like `rm -rf ./build`, `rm -rf ~/Documents`, `rm -rf
$HOME/Documents`, `rm -rf ../some_dir`, and `rm -rf .hidden_dir` are
**not** blocked.

Release Notes:

- Auto-block a wider range of agent terminal commands, e.g. `rm -rf
$HOME` in addition to `rm -rf ~`
2026-02-04 20:52:14 +00:00
Richard Feldman 8f67296991 Allow always_allow for nushell, elvish, and rc (#48395)
`brush-parser` handles `;` (sequential execution) and `|` (piping) which
all these shells use, so we can safely parse their commands for
`always_allow` pattern matching.

(No release notes because granular tool permissions haven't been
released yet.)

Release Notes:

- N/A
2026-02-04 19:49:56 +00:00
Piotr Osiewicz 31f8249b38 ci: Parse Cargo.toml and Cargo.lock with Python script to determine affected packages (#48389)
Closes #ISSUE

Release Notes:

- N/A
2026-02-04 19:31:25 +00:00
Cole Miller 9ec35ae904 git: Fix branch diff not updating when committing or changing branches (#48388)
This regressed in #47619 -- previously we would throw away and reopen
the diffs used to construct the branch diff pretty eagerly, and as a
result the branch diff would update itself when you committed or
switched branches. We inadvertently lost that when we switched to
retaining those diffs in the git store.

Release Notes:

- N/A
2026-02-04 14:29:30 -05:00
Xiaobo Liu ef94395614 project_search: Guard replace_next match lookup (#48327)
Release Notes:

- N/A

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
2026-02-04 20:08:24 +01:00
KyleBarton 2c8bbfe182 Refer to devcontainer.js rather than devcontainer.cmd.js (#48387)
Closes #46947

When installed with `npm install -g`, devcontainer gets created as
`devcontainer.cmd`. However, when invoked as a script from node, it's
still `devcontainer.js`. This addresses that difference so that we don't
accidentally invoke `devcontainer.cmd.js`.

Release Notes:

- Fixed devcontainer operation on Windows for when the devcontainer cli
is not installed globally
2026-02-04 10:48:40 -08:00
Piotr Osiewicz 8d162a00fc ci: Run tests only for the changed packages and their dependants (#48380)
We're still gonna run a full test suite on main and in non-PR workflows
exercising tests


Release Notes:

- N/A
2026-02-04 19:39:33 +01:00
Cole Miller 7f947801f2 git: Render hunk gutter highlights for side-by-side diff (#48321)
Release Notes:

- N/A
2026-02-04 18:25:25 +00:00
Katie GeerandDanilo Leal 5664212555 docs: Update edit prediction providers (#48055)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-02-04 15:19:33 -03:00
07e8e95c9c agent_ui: Refactor AcpThreadView (#48339)
Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-02-04 18:51:57 +01:00
elf-alchemist a8f417cbcc Do not treat binary Doom WAD files as text (#48349)
I primarily contribute to Doom source ports and related utilities. When
working with Doom WADs, the primary archive format for the game, Zed
will sometimes incorrectly assume that such files are plain text, due to
the nature of said container format not being compressed, some common
text files included in them will trigger a false positive in Zed's text
detection mode.

Considering some of these files can go from a couple dozen to a few
hundred megabytes, this usually makes Zed hang on my lower end machine,
until I manually terminate it :/ and has happened when I accidentally
clicked on one via the file explorer, or when viewing Git diffs.

Release Notes:

- Fixed Doom WAD files being erroneously treated as text
2026-02-04 19:51:00 +02:00
051754a5d4 editor: Implement semantic highlighting (#46356)
Part of #7450

Big thanks to @macmv for pushing this forwards so much!

Rebased version of https://github.com/zed-industries/zed/pull/39539 as
working on an in-org branch simplifies a lot of things for us)

Release Notes:

- Added LSP semantic tokens highlighting support

---------

Co-authored-by: Neil Macneale V <neil.macneale.v@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-04 17:37:13 +00:00
Fredrik Enestad e6bc8edfd8 project: Make individual DAP settings optional (#43647)
Currently, when overriding e.g a `binary` in dap settings, one have to
override all settings, including `args` as it otherwise set it to empty
string.

E.g this config will set `args` and `env` to their empty states, like
empty string and empty map:
```json
{
  "dap": {
    "Delve": {
      "binary": "/path/to/binary"
    }
  }
}
```

This PR changes so that it is instead possible to only override a single
field. This is useful e.g on nixos where you don't want (or cant let)
zed download binaries for you, but you want to use the default args,
such as in Delve, you want zed to configure it with a random listening
port.

Release Notes:

- Improved dap settings so that it is possible to override individual
fields, such as `binary`
2026-02-04 18:20:50 +01:00
Cole Miller 2747d4a113 git: Ensure the sides of the side-by-side diff use the same hunk controls (#48376)
Fixes hunk controls appearing on the LHS of the branch diff when they
should be disabled

Release Notes:

- N/A
2026-02-04 17:07:46 +00:00
Joseph T. Lyons f92654cb4f Bump Zed to v0.224 (#48375)
Release Notes:

- N/A
2026-02-04 16:54:54 +00:00
Ben Kunkle 475b7469ec Fix scroll in EP provider sub page when setting migration banner is showing (#48372)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-04 16:23:41 +00:00
Oleksiy SyvokonandBen Kunkle 7c3499cc84 ep: Lower max_output_tokens default for Ollama (#48370)
Zeta 1 should not be configurable, not by this setting.

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-02-04 16:07:23 +00:00
Lukas Wirth d888775824 gpui(windows): Reduce timer resolution to 1ms (#48364)
Otherwise block_with_timeout is effectively useless on windows as we
would block a minimum of 15ms which is our entire frame budget

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-04 14:49:02 +00:00
Danilo Leal fe794c262f agent_ui: Fix regression that made edited files unclickable (#48362)
There was a `when()` condition here looking at
`hovered_edited_file_buttons`, which is never turned to true when
hovering over the edited file button, and given we started to pass the
hover styles, tooltip, and on_click handler inside the condition, they
would never work. The solution here is to make these three things
unconditional, so edited files are always clickable.

Release Notes:

- N/A
2026-02-04 11:04:28 -03:00
Finn Evers e2943a78ae docs: Add BSD 2-Clause as accepted extension license (#48363)
Release Notes:

- N/A
2026-02-04 13:52:35 +00:00
Ben Brandt f219cc84b3 acp: Bump agent-client-protocol sdk to 0.9.4 (#48356)
Release Notes:

- N/A
2026-02-04 13:33:17 +00:00
Finn Evers 232f99d0fd languages: Do not show Zed keybinding context in language selector (#48354)
This language is used for the keymap editor and should not be selectable
for normal files. Hence, removing it here from the language selector

Release Notes:

- Fixed an issue where the Zed keybinding context would show up as a
language in the language selector.
2026-02-04 13:14:12 +00:00
Ben Brandt 1a2c767df3 acp: Cleanup unneeded cx from config state methods (#48353)
Release Notes:

- N/A
2026-02-04 13:12:49 +00:00
MostlyKandDanilo Leal 81a90ba6fc repl: Add quality of life changes in Jupyter view (#47533)
- Keyboard navigation where you can traverse through cells using up and
down arrow
- Jupyter Logo added 
- Initialize kernel as shutdown for more predictable behavior
- Ability to create .ipynb files with bare essential metadata.
- Optimize editor initialization to avoid cloning the entire notebook
and shortcuts


Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-02-04 07:05:22 -06:00
Roland RodriguezandMrSubidubi 78690f8b33 docs: Update git_hosting_providers setting documentation (#42129)
## Summary

Adds documentation for the `git_hosting_providers` setting that allows
users to configure custom self-hosted Git instances for clickable links.

## Description

This PR documents the previously undocumented `git_hosting_providers`
setting in the Git integration documentation. The setting allows users
to configure Zed to recognize and create clickable links to issues, pull
requests, and commits on self-hosted Git instances (like company GitLab
or GitHub Enterprise servers).

## Fixes

Closes #38433

## Test Plan

- Documentation follows the existing style and tone of `docs/src/git.md`
- Placement in the "Git Integrations" section makes logical sense
- Code example matches the format confirmed working by maintainers in
the issue

Release Notes:

- Improved: Documented the `git_hosting_providers` setting for
configuring custom self-hosted Git instances

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-02-04 13:01:13 +00:00
Oleksiy Syvokon 38806f59e5 ep: Meaure isolated whitespace change ratio (#48352)
Release Notes:

- N/A
2026-02-04 12:58:19 +00:00
Ben Brandt 7f21f6ff40 acp: Remove feature flag for session config options (#48350)
Release Notes:

- acp: Support ACP Session Config options for agents which provide them.
2026-02-04 12:45:13 +00:00
Oleksiy Syvokon df48705f49 ep: Heuristic for detecting wrong editable region (#48343)
Release Notes:

- N/A
2026-02-04 10:52:38 +00:00
little Kitchen bb5ca1a782 Auto-detect Rust for CodeLLDB panic breakpoints (#48236)
Fixes #48231

## Problem
When debugging Rust programs with CodeLLDB, panic breakpoints ("Rust: on
panic") don't work unless `sourceLanguages: ["rust"]` is explicitly set
in the debug configuration.

Without this setting, CodeLLDB doesn't return the `rust_panic` exception
filter, so the breakpoint shows `locations = 0 (pending)` and never
triggers.

## Root Cause
The Cargo locator correctly adds `sourceLanguages: ["rust"]`
([cargo.rs:97-100](https://github.com/zed-industries/zed/blob/main/crates/project/src/debugger/locators/cargo.rs#L97-L100)),
but other code paths may not:
- VSCode launch.json imports
- Manual debug configurations

## Solution
Auto-detect Rust binaries in `CodeLldbDebugAdapter::get_binary()` by
checking if the program path contains `/target/debug/` or
`/target/release/` (Cargo's standard output directories).

If detected and `sourceLanguages` isn't already set, we automatically
add `["rust"]`.

Release Notes:

- Fixed Rust panic breakpoints not working in debugger when using
CodeLLDB with non-Cargo debug configurations
2026-02-04 04:44:42 -05:00
Andres Suarez f0010404b4 remote: Fix build_remote_server_from_source compression on unix (#48319)
When using gzip, the output path's extension becomes `.gz`.

Release Notes:

- N/A
2026-02-04 09:15:21 +00:00
Bennet Bo Fenner 28475f5809 Disable subagents feature flag for staff (#48335)
Release Notes:

- N/A
2026-02-04 09:10:44 +00:00
BlankWasThereandKirill Bulatov 8d496420e1 docs(gpui): fix incomplete docs for function (#48333)
Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-02-04 09:00:43 +00:00
Lukas Wirth e5d5a7c44e workspace: Close toasts on middle mouse click (#48208)
Release Notes:

- Allow closing notification toasts via middle mouse clicks
2026-02-04 09:59:18 +01:00
Max Brunsfeld e4f962dee3 Remove sweep and mercury feature flags (#48329)
Release Notes:

- N/A
2026-02-04 07:53:49 +00:00
Danilo LealandRichard Feldman 733c517dcb settings ui: Add page for AI tool permissions (#48277)
This PR adds a page in the settings UI, under the AI section, that
allows to interact and customize permissions for tool calling for each
tool available to Zed's native agent.

Release Notes:

- AI: Added a settings page in the settings editor that allows to
customize tool call permissions for each tool.

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2026-02-04 03:42:35 -03:00
Max Brunsfeld 59995ece07 Show provider configuration in EP menu when signed out (#48325)
This way, you can configure external EP providers from the EP menu.

Release Notes:

- N/A
2026-02-04 06:26:22 +00:00
Cole Miller 8420315eb8 git: Add support for staging/unstaging/restoring to side-by-side diff LHS, and render hunk controls there (#48320)
Release Notes:

- N/A
2026-02-04 05:04:04 +00:00
Max Brunsfeld 2da19466d4 Eagerly connect to Ollama (#48318)
Previously, Ollama would not show up as available until you opened some
UI that prompted connecting to Ollama, like the agent panel or the edit
prediction settings.

Release Notes:

- N/A
2026-02-04 04:24:30 +00:00
Cole Miller b26378ef4a git: Use WrapPointCursor for spacer blocks calculation (#48315)
`spacer_blocks` is an ideal place to drop `WrapPointCursor` since a
large part of what it does it to convert an increasing sequence of
`MultiBufferPoint` into `WrapPoint`.

Release Notes:

- N/A
2026-02-04 03:58:42 +00:00
Marshall Bowers 9e6e9f59a4 Remove Postgres and stripe-mock from Docker Compose (#48313)
This PR removes the Postgres and `stripe-mock` contains from the Docker
Compose cluster, as these now run in Cloud's Docker Compose cluster.

Release Notes:

- N/A
2026-02-04 03:42:58 +00:00
Conrad Irwin 9011c5e667 Try to improve nix caching (#48297)
Release Notes:

- N/A
2026-02-03 20:31:02 -07:00
Cole Millerandcameron 6d2ed6c3f0 git: Refactor buffer_diff point translation APIs for more efficient side-by-side diff syncing (#48237)
The side-by-side diff heavily relies on a primitive from `buffer_diff`
that converts a point on one side of the diff to a range of points on
the other side. The way this primitive is set up on main is pretty
naive--every time we call `points_to_base_text_points` (or
`base_text_points_to_points`), we need to iterate over all hunks in the
diff. That's particularly bad for the case of constructing a new
side-by-side diff starting from a multibuffer, because we call those
APIs once per excerpt, and the number of excerpts is ~equal to the
number of hunks.

This PR changes the point translation APIs exposed by `buffer_diff` to
make it easier to use them efficiently in `editor`. The new shape is a
pair of functions that return a patch that can be used to translate from
the main buffer to the base text or vice versa. When syncing edits
through the block map that touch several excerpts for the same buffer,
we can reuse this patch for excerpts after the first--so when building a
new side-by-side diff, we'll iterate over each hunk just once.

The shape of the new APIs also sets us up to scale down to cases like
editing on the right-hand side of the diff: we can pass in a point range
and give them permission to return an approximate patch that's only
guaranteed to give the correct results when used with points in that
range. For edits that only affect one excerpt, and given how the project
diff is set up, that should allow us to skip iterating over most of the
hunks in a buffer.

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
2026-02-03 22:18:59 -05:00
0d99eb5d40 Add initial support for edit predictions via Ollama (#48233)
Closes https://github.com/zed-industries/zed/issues/15968

Release Notes:

- Added the ability to use Ollama as an edit prediction provider

---------

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-02-04 01:33:12 +00:00
Marshall Bowers c66f566a13 ci: Re-enable docs deployments (#48303)
This PR re-enables docs deployments.

The upstream incident has been resolved:
https://www.cloudflarestatus.com/incidents/m1xvmqf37z97

Release Notes:

- N/A
2026-02-03 23:12:41 +00:00
KyleBarton a1e9e6e4a6 Simplify error message and provide a route to Zed log (#48301)
Closes #46780

Creates a better flow for handling errors when a devcontainer fails, by
shortening the message and giving the user a direct route to the Zed
log. Additionally, the error from `stderr` is printed with proper line
endings, making the log more legible

<img width="1716" height="1093" alt="Screenshot 2026-02-03 at 2 54
50 PM"
src="https://github.com/user-attachments/assets/08d7847b-c9b8-49e9-9936-6ae417f82fb2"
/>
<img width="1711" height="908" alt="Screenshot 2026-02-03 at 2 55 07 PM"
src="https://github.com/user-attachments/assets/a2676419-a118-432e-8e8a-32c6e92f4f3b"
/>
<img width="2901" height="542" alt="Screenshot 2026-02-03 at 2 55 48 PM"
src="https://github.com/user-attachments/assets/ea9de533-c1c6-4cb7-bd79-e44bd035537c"
/>


Release Notes:

- Improved error messaging and handling in the event of a devcontainer
launch failure
2026-02-03 23:07:10 +00:00
John Tur 5fa931a5f8 Optimize resource upload in D3D11 (#48282)
Currently, each time we draw a primitive batch, we fully overwrite the
instance buffer with the contents of the new batch. Since we use a
write-only mapping to do this, the GPU driver may handle synchronization
hazards by transparently creating new allocations if the previous
allocation is still in use. We draw many primitive batches in one frame,
which stress-tests this mechanism somewhat. If internal driver limits
are hit, the resource update will start to block until the GPU catches
up and releases in-use allocations. This would result in a significant
reduction in framerate.

To avoid this, we upload the data for all primitive batches at once at
the beginning of the frame. Each primitive batch draw then binds the
relevant sub-array of the instance buffer. This way, there are no
mid-frame resource updates.

Release Notes:

- N/A
2026-02-03 17:15:44 -05:00
renovate[bot]andMarshall Bowers 3b0b5558eb Update Rust crate jsonwebtoken to v10 [SECURITY] (#48294)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [jsonwebtoken](https://redirect.github.com/Keats/jsonwebtoken) |
workspace.dependencies | major | `9.3` → `10.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

### GitHub Vulnerability Alerts

####
[GHSA-h395-gr6q-cpjc](https://redirect.github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc)

## Summary:

It has been discovered that there is a Type Confusion vulnerability in
jsonwebtoken, specifically, in its claim validation logic.

When a standard claim (such as nbf or exp) is provided with an incorrect
JSON type (Like a String instead of a Number), the library’s internal
parsing mechanism marks the claim as “FailedToParse”. Crucially, the
validation logic treats this “FailedToParse” state identically to
“NotPresent”.

This means that if a check is enabled (like: validate_nbf = true), but
the claim is not explicitly marked as required in required_spec_claims,
the library will skip the validation check entirely for the malformed
claim, treating it as if it were not there. This allows attackers to
bypass critical time-based security restrictions (like “Not Before”
checks) and commit potential authentication and authorization bypasses.

## Details:

The vulnerability stems from the interaction between the TryParse enum
and the validate function in
[src/validation.rs](https://redirect.github.com/Keats/jsonwebtoken/blob/master/src/validation.rs).

1. The TryParse Enum: The library uses a custom TryParse enum to handle
claim deserialization:
```
enum TryParse<T> {
    Parsed(T),
    FailedToParse, // Set when deserialization fails (e.g. type mismatch)
    NotPresent,
}
```
If a user sends {“nbf”: “99999999999”} (legacy/string format), serde
fails to parse it as u64, and it results in TryParse::FailedToParse.

1. The Validation Logic Flaw (src/validation.rs): In
Validation::validate, the code checks for exp and nbf
like this:
```
// L288-291
if matches!(claims.nbf, TryParse::Parsed(nbf) if options.validate_nbf && nbf > now + options.leeway) {
    return Err(new_error(ErrorKind::ImmatureSignature));
}
```
This matches! macro explicitly looks for TryParse::Parsed(nbf).

 • If claims.nbf is FailedToParse, the match returns false.
 • The if block is skipped.
 • No error is returned.
1. The “Required Claims” Gap: The only fallback mechanism is the
“Required Claims” check:
```
// Lines 259-267
for required_claim in &options.required_spec_claims {
    let present = match required_claim.as_str() {
        "nbf" => matches!(claims.nbf, TryParse::Parsed(_)),
        // ...
    };
    if !present { return Err(...); }
}
```
If “nbf” IS in required_spec_claims, FailedToParse will fail the
matches!(..., Parsed(_)) check, causing the present to be false, and
correctly returning an error.

However, widely accepted usage patterns often enable validation flags
(validate_nbf = true) without adding the claim to the required list,
assuming that enabling validation implicitly requires the claim’s
validity if it appears in the token. jsonwebtoken seems to violate this
assumption.

Environment:

 • Version: jsonwebtoken 10.2.0
 • Rust Version: rustc 1.90.0
 • Cargo Version: cargo 1.90.0
 • OS: MacOS Tahoe 26.2

POC:

For demonstrating, Here is this simple rust code that demonstrates the
bypass. It attempts to validate a token with a string nbf claiming to be
valid only in the far future.

create a new project:
```
cargo new nbf_poc; cd nbf_poc
```
add required dependencies:
```
cargo add serde --features derive
cargo add jsonwebtoken --features rust_crypto
cargo add serde_json
```
replace the code in src/main.rs with this:

```
use jsonwebtoken::{decode, Validation, Algorithm, DecodingKey, Header, EncodingKey, encode};
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
struct Claims {
    sub: String,
    nbf: String, // Attacker sends nbf as a String
    exp: usize,
}
fn main() {
    let key: &[u8; 24] = b"RedMouseOverTheSkyIsBlue";

    // nbf is a String "99999999999" (Far future)
    // Real nbf should be a Number.
    let my_claims: Claims = Claims {
        sub: "krishna".to_string(),
        nbf: "99999999999".to_string(), 
        exp: 10000000000, 
    };

    let token: String = encode(&Header::default(), &my_claims, &EncodingKey::from_secret(key)).unwrap();
    println!("Forged Token: {}", token);

    // 2. Configure Validation
    let mut validation: Validation = Validation::new(Algorithm::HS256);
    validation.validate_nbf = true; // Enable NBF check

    // We do NOT add "nbf" to required_spec_claims (default behavior)

    // We decode to serde_json::Value to avoid strict type errors in our struct definition hiding the library bug.
    // The library sees the raw JSON with string "nbf".
    let result: Result<jsonwebtoken::TokenData<serde_json::Value>, jsonwebtoken::errors::Error> = decode::<serde_json::Value>(
        &token, 
        &DecodingKey::from_secret(key), 
        &validation
    );

    match result {
        Ok(_) => println!("Token was accepted despite malformed far-future 'nbf'!"),
        Err(e) => println!("Token rejected. Error: {:?}", e),
    }
}
```
run cargo run

expected behaviour:

```
Forged Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJrcmlzaG5hIiwibmJmIjoiOTk5OTk5OTk5OTkiLCJleHAiOjEwMDAwMDAwMDAwfQ.Fm3kZIqMwqIA6sEA1w52UOMqqnu4hlO3FQStFmbaOwk
```
Token was accepted despite malformed far-future 'nbf'!
Impact:

If an application uses jsonwebtoken nbf (Not Before) to schedule access
for the future (like “Access granted starting tomorrow”).

By sending nbf as a string, an attacker can bypass this restriction and
access the resource immediately.

and for the exp claim (this is unlikely but still adding), If a
developer sets validate_exp = true but manually handles claim presence
(removing exp from required_spec_claims), an attacker can send a string
exp (e.g., “never”) and bypass expiration checks entirely. The token
becomes valid forever.

---

### Release Notes

<details>
<summary>Keats/jsonwebtoken (jsonwebtoken)</summary>

###
[`v10.3.0`](https://redirect.github.com/Keats/jsonwebtoken/blob/HEAD/CHANGELOG.md#1030-2026-01-27)

[Compare
Source](https://redirect.github.com/Keats/jsonwebtoken/compare/v10.2.0...v10.3.0)

- Export everything needed to define your own CryptoProvider
- Fix type confusion with exp/nbf when not required

###
[`v10.2.0`](https://redirect.github.com/Keats/jsonwebtoken/blob/HEAD/CHANGELOG.md#1020-2025-11-06)

[Compare
Source](https://redirect.github.com/Keats/jsonwebtoken/compare/v10.1.0...v10.2.0)

- Remove `Clone` bound from decode functions

###
[`v10.1.0`](https://redirect.github.com/Keats/jsonwebtoken/blob/HEAD/CHANGELOG.md#1010-2025-10-18)

[Compare
Source](https://redirect.github.com/Keats/jsonwebtoken/compare/v10.0.0...v10.1.0)

- add `dangerous::insecure_decode`
- Implement TryFrom \&Jwk for DecodingKey

###
[`v10.0.0`](https://redirect.github.com/Keats/jsonwebtoken/blob/HEAD/CHANGELOG.md#1000-2025-09-29)

[Compare
Source](https://redirect.github.com/Keats/jsonwebtoken/compare/v9.3.1...v10.0.0)

- BREAKING: now using traits for crypto backends, you have to choose
between `aws_lc_rs` and `rust_crypto`
- Add `Clone` bound to `decode`
- Support decoding byte slices
- Support JWS

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "" in timezone America/New_York,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45NS4yIiwidXBkYXRlZEluVmVyIjoiNDIuOTUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2026-02-03 15:51:40 -05:00
Richard Feldman 2fb699e017 Disable default tool permissions (#48278)
Follow-up to https://github.com/zed-industries/zed/pull/48209 - those
hardcoded rules are replacing these default settings, which will make
the rules clearer by removing the "override" scenario.

(No release notes because granular tool permissions are still behind a
feature flag.)

Release Notes:

- N/A
2026-02-03 20:01:15 +00:00