Skip to content

Merge upstream Prometheus v3.13.0 into invoca-2.55.1-base - #28

Draft
ColinDKelley wants to merge 4157 commits into
invoca-2.55.1-basefrom
invoca-3.13-base
Draft

Merge upstream Prometheus v3.13.0 into invoca-2.55.1-base#28
ColinDKelley wants to merge 4157 commits into
invoca-2.55.1-basefrom
invoca-3.13-base

Conversation

@ColinDKelley

Copy link
Copy Markdown

Summary

Merge upstream Prometheus v3.13.0 (LTS, supported until 2027-07-31) into invoca-2.55.1-base, creating the 3.x integration anchor for Invoca's fork.

Stacked on invoca-2.55.1-base (#27 chain). No Invoca rate-func features in this branch — promql was taken from upstream 3.13 wholesale (merge kept stale Invoca xrate parser entries; fixed in second commit).

Lineage

invoca-2.53.1-base
└─ invoca-2.55.1-base (#27)
└─ invoca-3.13-base (#28, this PR) ← upstream v3.13.0
└─ (future) port-rate-funcs ← re-implement xrate/yrate + REPLACE_RATE_FUNCS

Why clean upstream PromQL?

Upstream 3.13 rewrote promql/functions.go (~1,600 lines changed vs 3.0). Invoca xrate/yrate from 2.55 will not cherry-pick — they must be re-ported against the new pickOrInterpolateLeft/pickOrInterpolateRight rate architecture. Starting from stock 3.13 PromQL avoids carrying 2.x fork debt forward.

Merge notes

  • Conflicts in promql/engine.go, promql/functions.go, promql/promqltest/testdata/functions.test → resolved with upstream 3.13
  • promql/parser/functions.go auto-merge kept Invoca xrate parser stubs → reset to upstream 3.13 in follow-up commit

Test plan

  • go build ./...
  • go test -count=1 ./promql/...
  • Full go test ./... (optional; large)
  • Staging spike checklist below before starting rate-func re-port

Pre-port spike checklist (ops / TSDB / integration)

Run these on this branch (or a throwaway deploy) before stacking invoca-3.13/port-rate-funcs. Goal: surface 3.x migration risk without touching Invoca PromQL yet.

Prerequisites

  • 2.55.1 stack merged and staging has run on Invoca 2.55.1 for ≥ one retention window (TSDB bridge requirement per migration guide)
  • Thanos pairing plan for 3.13 (likely v0.40.x+; 0.37.2 embeds 2.55-era prometheus only)

TSDB / data path

  • Start 3.13 against TSDB written by 2.55.1 — confirm blocks load, no corruption errors
  • Confirm downgrade path: 3.13 → 2.55.1 works; 3.13 → 2.53 does not (expected)
  • WAL replay clean on restart after 2.55 → 3.13 cutover

Config / deployment breaking changes (migration guide)

  • Scrape targets: Content-Type strictness — any targets need fallback_scrape_protocol?
  • Alertmanager: api_version: v2 only (no v1)
  • Remote write: http_config.enable_http2 default now false — verify remote_write still works if you rely on HTTP/2
  • Feature flags removed from --enable-feature (now default or dedicated flags): expand-external-labels, no-default-scrape-port, agent, remote-write-receiver, auto-gomemlimit, auto-gomaxprocs
  • scrape_classic_histogramsalways_scrape_classic_histograms if used
  • Log format changed (log/slog) — update any log parsers/alerts

PromQL behavior (upstream 3.x, no Invoca funcs yet)

  • Spot-check dashboards using rate/increase on boundary-aligned subqueries — 3.x is (start, end]; subqueries like foo[1m:1m] may return fewer points (migration guide)
  • Regex . now matches newlines — audit relabel/alert regexes if needed
  • le/quantile label normalization — audit rules referencing integer le="1" (now le="1.0")

Thanos / ecosystem

  • Build Invoca Thanos fork against 3.13 prometheus embed (new branch from v0.40.x?)
  • Sidecar uploads blocks from 3.13 Prometheus
  • Thanos Query evaluates standard PromQL against 3.13-embedded engine

Exit criteria for spike

  • Staging shard runs 3.13 base for ≥ 24–48h without TSDB/scrape/alert regressions
  • Known dashboard/recording-rule diffs documented (expected from 3.x semantics, not bugs)
  • Only then: branch invoca-3.13/port-rate-funcs off this base

Related

bwplotkaand others added 30 commits May 15, 2026 11:27
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
…prometheus#18699)
The oversize-chunk trigger introduced in prometheus#18692 was implemented as a
closure defined inside the per-sample loop in
populateChunksFromIterable and invoked once at the `if` condition.
Replace it with a plain conditional and hoist
`len(currentChunk.Bytes())` out of the switch so the two encoding
cases don't repeat the same expression. The new shape preserves the
original `||` short-circuit: the size check is only evaluated when
neither the encoding nor the start-timestamp capability forces a new
chunk, which also keeps `currentChunk` non-nil at the point of read.
`gcflags=-m=2` reports the closure body inlined and the symbol table
shows no separate `func1` symbol, yet benchstat shows a measurable
speedup. The most likely explanation: the closure body inlines, but
the `funcval` struct (capturing `currentChunk` and `currentValueType`)
is still stack-constructed each iteration — invisible to escape
analysis, but a real per-iteration cost in a hot loop.
Benchmark, `go test -count=6 -benchmem -bench=BenchmarkQuerierSelectWithOutOfOrder -benchtime=5s -run=^$ ./tsdb/`,
Intel Xeon Platinum 8280 @ 2.70 GHz (linux/amd64), 1M-series head,
query selectivity varies:
│ main │ optimized │
│ sec/op │ sec/op vs base │
Head/1of1000000-16 301.5m ± 4% 257.0m ± 4% -14.74% (p=0.002 n=6)
Head/10of1000000-16 305.6m ± 3% 260.4m ± 2% -14.80% (p=0.002 n=6)
Head/100of1000000-16 303.9m ± 2% 259.7m ± 2% -14.54% (p=0.002 n=6)
Head/1000of1000000-16 303.8m ± 2% 267.0m ± 2% -12.13% (p=0.002 n=6)
Head/10000of1000000-16 318.1m ± 1% 278.9m ± 8% -12.33% (p=0.002 n=6)
Head/100000of1000000-16 364.1m ± 7% 352.8m ± 4% ~ (p=0.065 n=6)
Head/1000000of1000000-16 1.115 ± 2% 1.089 ± 26% ~ (p=0.394 n=6)
geomean 377.8m 337.3m -10.71%
allocs/op and B/op unchanged. The two largest-selectivity cases trend
faster but are dominated by the per-sample append cost so the relative
delta is smaller and lost in variance.
`TestChunkQuerier_OverlappingInOrderAndOOOChunks` continues to
exercise the overflow path.
```release-notes
NONE
```
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Each test function creates its own mock AWS client and operates on
independent data stores with no shared global state between them.
Adding t.Parallel() to the 33 top-level test functions across the
six test files (aws, ec2, ecs, elasticache, msk, rds) allows the
Go test runner to overlap their execution, cutting wall-clock time.
TestLoadRegion is excluded because its subtests use t.Setenv, which
panics when a parallel ancestor is detected (Go 1.25+).
Refs: prometheus#15185
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
The previous split required callers to compute the inner slice before
calling correctForCounterResetsHistogram, which led to a bug where
h[lastSampleIndex] could be double-counted when it carries a reset hint
that equals the right boundary value.
Merge the boundary logic into correctForCounterResetsHistogram so the
function owns its own loop range, always excludes lastSampleIndex from
the inner loop, and initialises prev to h[firstSampleIndex+1] when the
left-boundary interpolation already spanned the first reset.
Add regression tests covering: reset at the last sample, two-sample
anchored windows, double-reset in smoothed mode, and the two-sample
smoothed window where both boundaries are interpolated from the same
reset segment.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Implement least(a, b) and greatest(a, b) as scalar-returning PromQL
functions backed by math.Min and math.Max respectively.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
tests: split 32bit x86 tests to a separate job with parallel=1
tsdb: fix init race that lets initialized() return true before maxTime is set
…y-aws-parallel
discovery/aws: run tests in parallel
Co-authored-by: Julien <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
- Fix copy-paste bug: smoothed branch in bare MatrixSelector eval now
says "smoothed modifier is not supported with histograms" instead of
"anchored".
- Change annosFromInterpolationError to take *annotations.Annotations,
consistent with all other histogram helper functions.
- Rename delta to result in interpolateHistograms to avoid the misleading
name (the variable holds the interpolated result, not a delta).
- Fix extendedRate doc comment: interpolates at boundaries, not
extrapolates.
- Fix stale comment in correctForCounterResetsHistogram that referenced
the nonexistent variable leftInterpolationHandledReset.
- Add comment explaining why right.Copy() is not redundant in
extendedHistogramRate.
- Hoist s.Labels().Get(labels.MetricName) out of the per-step loop in
smoothSeries; was called up to three times per step.
- Reset CounterResetHint to UnknownCounterReset on carry-forward
histograms in smoothSeries; a Reset hint at a new timestamp is
semantically misleading.
- Add TestInterpolateHistograms unit test covering exact-match, midpoint,
counter, reset, and quarter-point cases.
- Add rate(hist_counter[1m] anchored) test.
- Add delta(hist_counter[1m] anchored/smoothed) tests with
NativeHistogramNotGaugeWarning assertions.
- Add carry-forward test for smoothed vector selector.
- Add range eval test for rate(hist_counter[1m] smoothed).
- Add right-boundary reset interpolation test (right_boundary_reset).
- Fix stale test comment about "prev initialPrev path".
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
… extendedHistogramRate
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
…oothed-histogram
promql: support native histograms with smoothed/anchored rate
…3.12
Revert "chore: prepare 3.12.0-rc.0 release"
…eanup-funcmap
chore(promql): replace funcQueryContext with nil in FunctionCalls map
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
…bsequence-rank
strutil/subsequence: rank exact matches above non-exact matches
…ard-nil-funcall
promql: guard against nil function call in eval
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Kai Tanaka <275430420+quyentonndbs@users.noreply.github.com>
Co-authored-by: Kai Tanaka <275430420+quyentonndbs@users.noreply.github.com>
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
George Krajcsovitsand others added 19 commits June 19, 2026 12:00
You get
[ERR_PNPM_VERSION_NOT_CHANGED] Version was not changed: 0.313.0-rc.0
error if you try.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Bump VERSION to 3.13.0-rc.0 and add the 3.13.0-rc.0 CHANGELOG section.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
checkPackage read each workspace package's version via `pnpm run env | grep
npm_package_version`, an npm-ism. pnpm has no built-in `env` script, so it
fails with ERR_PNPM_NO_SCRIPT and returns an empty string, making
`ui_release.sh --check-package` report a false version mismatch for every
package.
Read the version with `pnpm pkg get version` instead. Leftover from the
npm-to-pnpm migration (prometheus#18797).
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…rometheus#18993)
Since the npm-to-pnpm migration (prometheus#18797), react-app is a separate pnpm project
with its own web/ui/react-app/node_modules, while `npm_licenses` only scanned the
workspace's web/ui/node_modules. The old react-app UI is still embedded in the
binary (served via --enable-feature=old-ui), so its dependencies (bootstrap,
jquery, reactstrap, moment, etc.) are distributed but their licenses were dropped
from npm_licenses.tar.bz2.
Scan react-app's node_modules too. ui-install already installs it, so the path
exists at build time. The tarball grows from ~626 to ~1992 license files.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The mantine-ui Vite build now generates a third-party-licenses.txt via
rollup-plugin-license, collecting the notices of every npm package bundled
into the UI. The file is embedded in the binary and served at
/assets/third-party-licenses.txt.
This replaces the npm_licenses.tar.bz2 archive, which was built by sweeping
node_modules for license* files and shipped as a separate file in release
tarballs and Docker images.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
v4.3.0 predates the npm + lockfile bootstrap rewrite (v5/v6) and its
follow-up fixes. v6.0.9 pulls in the self-update, standalone, and PATH
fixes and bumps the bootstrap pnpm to 11.7.0.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
…bed-npm-licenses
build: embed bundled web UI licenses instead of shipping a tarball
test_ui already builds and saves the web UI tarball. Restore it in
build_all, extract it, and pass it to the crossbuild containers via promu's
new --env flag (PREBUILT_ASSETS_STATIC_DIR), so make build skips rebuilding
the UI in every crossbuild thread.
Bump promu to 0.20.0 for the crossbuild --env flag.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
…ild-reuse-ui-assets
ci: reuse pre-built UI assets in build_all crossbuild
Bump VERSION to 3.13.0-rc.1 and add the 3.13.0-rc.1 CHANGELOG section.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Derive the npm dist-tag from the Prometheus version (VERSION file) and
download.json so pre-releases and old patches never move the "latest"
tag: pre-releases publish under their channel (rc/beta/alpha/next), the
latest stable under "latest", the newest LTS under "lts", and older
stable or LTS patches under "oldstable". Fail the publish if
download.json cannot be fetched.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
…m-dist-tag
ui: do not tag pre-release npm packages as latest
…eus#19134)
The head-chunk cache fingerprint (series ref, head pointer, mmapped
count) could not detect truncateChunksBefore removing older head
chunks: the head pointer survives and, for a series with no mmapped
chunks, the mmapped count stays 0, while firstChunkID advances. A
cache-enabled reader (range queries through the head-and-OOO reader)
then resolved chunk IDs against the stale slice and returned the wrong
chunk, or failed with ErrNotFound.
Include firstChunkID in the fingerprint; it advances on every
truncation and never regresses.
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 39359eb)
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Fan out the upgrade/downgrade test over each active LTS release so the
matrix jobs run in parallel and a single release failure does not mask
the others. A new list_lts_releases job reads the active LTS versions
from prometheus.io/download.json and feeds them to the matrix.
Add a --test.lts-version flag so TestVersionUpgrade can be restricted to
a single LTS release; when empty, all active LTS releases are tested.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
(cherry picked from commit 827d0f9)
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
jobs:
dependabot:
permissions:
contents: write
uses: ./.github/workflows/codeql-analysis.yml
permissions:
contents: read
security-events: write
name: Publish main branch artifacts
runs-on: ubuntu-latest
permissions:
packages: write
name: Publish release artefacts
runs-on: ubuntu-latest
permissions:
contents: write
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
name: Benchmark Start
if: github.event.action == 'prombench_start'
permissions:
statuses: write
name: Benchmark Cancel
if: github.event.action == 'prombench_stop'
permissions:
statuses: write
name: Benchmark Restart
if: github.event.action == 'prombench_restart'
permissions:
statuses: write
Comment threadDockerfile.distroless
ARG DISTROLESS_ARCH="amd64"

# Use DISTROLESS_ARCH for base image selection (handles armv7->arm mapping).
FROM gcr.io/distroless/static-debian13:nonroot-${DISTROLESS_ARCH}
@wiz-b82ec45539

ghost commented Jul 9, 2026

Copy link
Copy Markdown

Wiz Scan Summary

⚠️ Many findings detected
Many findings were detected, but only a subset of the findings are displayed inline due to API constraints. To view all findings inline, please click here.
ScannerFindings
Vulnerability Finding Vulnerabilities6 High 14 Medium 2 Low
Data Finding Sensitive Data-
Secret Finding Secrets-
IaC Misconfiguration IaC Misconfigurations1 High 1 Low
SAST Finding SAST Findings15 Medium 27 Low
Software Management Finding Software Management Findings-
Total7 High 29 Medium 30 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Comment threaddiscovery/aws/msk.go
// Only set static credentials if both access key and secret key are provided
// Otherwise, let AWS SDK use its default credential chain
if d.cfg.AccessKey != "" && d.cfg.SecretKey != "" {
credProvider := credentials.NewStaticCredentialsProvider(d.cfg.AccessKey, string(d.cfg.SecretKey), "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium SAST Finding

Hardcoded AWS Credentials in Go Application

More Details

Embedding static AWS credentials directly into a Go application using the credentials.NewStaticCredentialsProvider function poses a significant security risk. This practice exposes the AWS access keys and secret keys in plaintext within the application code, making them vulnerable to theft or misuse. If an attacker gains access to the application code or the compiled binary, they can extract the hardcoded credentials and potentially gain unauthorized access to AWS resources, leading to data breaches, financial losses, or other malicious activities.

Hardcoded credentials should never be used in production environments. Instead, applications should retrieve credentials securely from trusted sources, such as environment variables, secure key management services, or temporary credentials obtained through AWS Identity and Access Management (IAM) roles. Failing to properly manage and protect AWS credentials can lead to severe consequences, including data exfiltration, resource hijacking, and compliance violations.

AttributeValue
ImpactMedium
LikelihoodMedium

Remediation

Hardcoding AWS credentials into an application poses a significant security risk. If the application's code is compromised or accidentally exposed, the hardcoded credentials can be easily extracted and misused by attackers to gain unauthorized access to AWS resources, potentially leading to data breaches, financial losses, and other severe consequences.

To fix this issue securely, applications should retrieve AWS credentials from secure sources at runtime, such as environment variables, AWS credential files, or AWS credential providers. This approach ensures that credentials are not embedded in the application's code and can be easily rotated or revoked if needed.

Code examples

// VULNERABLE CODE - Hardcoded AWS credentialsimport (
"github.com/aws/aws-sdk-go-v2/aws""github.com/aws/aws-sdk-go-v2/credentials"
)
creds:=credentials.NewStaticCredentialsProvider(
"AKIAIOSFODNN7EXAMPLE",
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"",
)
// SECURE CODE - Using AWS credential providerimport (
"github.com/aws/aws-sdk-go-v2/config"
)
cfg, err:=config.LoadDefaultConfig(context.TODO())
iferr!=nil {
// Handle error
}
// AWS credentials are retrieved securely from the environment or other sources

Additional recommendations

  • Follow the AWS best practices for managing AWS access keys and secret access keys.
  • Implement least privilege access principles by granting only the necessary permissions to AWS resources.
  • Regularly rotate AWS credentials and revoke unused or compromised credentials.
  • Consider using temporary security credentials (AWS STS) for enhanced security and auditing capabilities.
  • Adhere to relevant security standards and guidelines, such as the AWS Security Best Practices and the OWASP Application Security Verification Standard (ASVS).

Rule ID: WS-GO-00051


To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Comment threaddiscovery/aws/rds.go
// Only set static credentials if both access key and secret key are provided
// Otherwise, let AWS SDK use its default credential chain
if d.cfg.AccessKey != "" && d.cfg.SecretKey != "" {
credProvider := credentials.NewStaticCredentialsProvider(d.cfg.AccessKey, string(d.cfg.SecretKey), "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium SAST Finding

Hardcoded AWS Credentials in Go Application

More Details

Embedding static AWS credentials directly into a Go application using the credentials.NewStaticCredentialsProvider function poses a significant security risk. This practice exposes the AWS access keys and secret keys in plaintext within the application code, making them vulnerable to theft or misuse. If an attacker gains access to the application code or the compiled binary, they can extract the hardcoded credentials and potentially gain unauthorized access to AWS resources, leading to data breaches, financial losses, or other malicious activities.

Hardcoded credentials should never be used in production environments. Instead, applications should retrieve credentials securely from trusted sources, such as environment variables, secure key management services, or temporary credentials obtained through AWS Identity and Access Management (IAM) roles. Failing to properly manage and protect AWS credentials can lead to severe consequences, including data exfiltration, resource hijacking, and compliance violations.

AttributeValue
ImpactMedium
LikelihoodMedium

Remediation

Hardcoding AWS credentials into an application poses a significant security risk. If the application's code is compromised or accidentally exposed, the hardcoded credentials can be easily extracted and misused by attackers to gain unauthorized access to AWS resources, potentially leading to data breaches, financial losses, and other severe consequences.

To fix this issue securely, applications should retrieve AWS credentials from secure sources at runtime, such as environment variables, AWS credential files, or AWS credential providers. This approach ensures that credentials are not embedded in the application's code and can be easily rotated or revoked if needed.

Code examples

// VULNERABLE CODE - Hardcoded AWS credentialsimport (
"github.com/aws/aws-sdk-go-v2/aws""github.com/aws/aws-sdk-go-v2/credentials"
)
creds:=credentials.NewStaticCredentialsProvider(
"AKIAIOSFODNN7EXAMPLE",
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"",
)
// SECURE CODE - Using AWS credential providerimport (
"github.com/aws/aws-sdk-go-v2/config"
)
cfg, err:=config.LoadDefaultConfig(context.TODO())
iferr!=nil {
// Handle error
}
// AWS credentials are retrieved securely from the environment or other sources

Additional recommendations

  • Follow the AWS best practices for managing AWS access keys and secret access keys.
  • Implement least privilege access principles by granting only the necessary permissions to AWS resources.
  • Regularly rotate AWS credentials and revoke unused or compromised credentials.
  • Consider using temporary security credentials (AWS STS) for enhanced security and auditing capabilities.
  • Adhere to relevant security standards and guidelines, such as the AWS Security Best Practices and the OWASP Application Security Verification Standard (ASVS).

Rule ID: WS-GO-00051


To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

}

func newLock(fileName string) (Releaser, error) {
f, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0o666)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium SAST Finding

Overly Permissive File Permissions in Go (CWE-732)

More Details

The application is setting file permissions to overly permissive values, allowing unauthorized access to sensitive files. This vulnerability can lead to data breaches, unauthorized modifications, or execution of malicious code. Attackers who gain access to the system could exploit these excessive permissions to read, modify, or execute files they should not have access to.

To mitigate this risk, applications should assign the least permissive file permissions required for their intended functionality. Permissions should be carefully reviewed and restricted to only allow necessary operations for the application user or group.

AttributeValue
ImpactMedium
LikelihoodMedium

Remediation

Setting overly permissive file permissions (greater than 0o640) exposes sensitive files to unauthorized users on the system. This violates the principle of least privilege and can lead to data breaches, unauthorized file modifications, or execution of malicious code by unintended users or groups. In multi-user environments, world-readable or world-writable files are especially dangerous.

To fix this issue, review all calls to os.Chmod, os.OpenFile, and os.WriteFile and restrict permissions to the minimum required. For most application files, 0o600 (owner read/write only) or 0o640 (owner read/write, group read) is sufficient. Avoid using permissions like 0o777, 0o755, or 0o666 unless there is a specific, documented requirement.

Code examples

// VULNERABLE CODE - World-readable and world-writable permissions expose the file to all usersfuncwriteConfig(filenamestring, data []byte) error {
returnos.WriteFile(filename, data, 0o777)
}
funcopenLog(filenamestring) (*os.File, error) {
returnos.OpenFile(filename, os.O_CREATE|os.O_WRONLY, 0o666)
}
// SECURE CODE - Restricts access to owner only, preventing unauthorized reads or writesfuncwriteConfig(filenamestring, data []byte) error {
returnos.WriteFile(filename, data, 0o600)
}
funcopenLog(filenamestring) (*os.File, error) {
returnos.OpenFile(filename, os.O_CREATE|os.O_WRONLY, 0o640)
}

Additional recommendations

  • Use 0o600 for sensitive files (private keys, credentials, config files) to restrict access to the owner only.
  • Use 0o640 when group read access is explicitly required by the application design.
  • Never use world-writable permissions (0o777, 0o666, 0o646) on files containing sensitive data.
  • Apply os.Chmod after file creation to enforce permissions even if the process umask is permissive.
  • Set a restrictive umask (e.g., 0o027 or 0o077) at application startup as a defense-in-depth measure.
  • This issue maps to CWE-732 and OWASP A01:2021 – Broken Access Control; follow your organization's security policy for file permission standards.

Rule ID: WS-I011-GO-00010


To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Comment on lines +226 to +227
const nodeContent = state.sliceDoc(node.from, node.to);
return durationWithUnitRegexp.test(nodeContent);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium SAST Finding

Regular Expression Denial of Service (ReDoS) in User Input Validation (CWE-185)

More Details

This rule detects instances where user-supplied input is matched against a regular expression without proper validation, potentially leading to a Regular Expression Denial of Service (ReDoS) vulnerability. ReDoS attacks exploit the fact that most Regular Expression implementations may take exponential time on certain input strings, causing excessive CPU consumption and effectively denying service to other users or system components.

This vulnerability presents a significant security risk as it can be exploited by an attacker to degrade or crash the application's performance, leading to a Denial of Service (DoS) condition. The consequences of a successful ReDoS attack can range from temporary unavailability of the application to complete system crashes, depending on the application's architecture and the resources available on the server.

To avoid this issue, it is crucial to validate and sanitize user input before processing it with regular expressions. Additionally, developers should carefully analyze the regular expressions used in their code to ensure they do not exhibit pathological behavior on specific input patterns.

AttributeValue
ImpactMedium
LikelihoodMedium

Remediation

Regular expression denial of service (ReDoS) is a vulnerability that can occur when untrusted input is used in a regular expression pattern. An attacker can craft a malicious input string that causes the regular expression engine to go into an infinite loop, consuming excessive amounts of memory and CPU resources, leading to a denial of service condition. This vulnerability can be exploited to degrade or crash the application, potentially causing a service disruption.

To mitigate this vulnerability, it is essential to validate and sanitize user input before using it in regular expression operations. Additionally, it is recommended to use a regular expression engine that has protection against ReDoS attacks or to implement your own safeguards.

Code examples

// VULNERABLE CODE - The regular expression is applied directly to user input without validationconstuserInput=req.body.param;constregex=/^(a+)+$/;constresult=regex.test(userInput);
// SECURE CODE - User input is validated and sanitized before using in the regular expressionconstuserInput=req.body.param;constsanitizedInput=sanitizeInput(userInput);// Implement input sanitization functionconstregex=/^(a+)+$/;constresult=regex.test(sanitizedInput);

Additional recommendations

  • Use a regular expression engine that has built-in protection against ReDoS attacks, such as the safe-regex library for Node.js.
  • Implement input validation and sanitization to remove or escape potentially malicious characters from user input.
  • Follow the principle of least privilege and use the most restrictive regular expression pattern possible.
  • Consider using alternative string matching algorithms, such as substring matching or Boyer-Moore string search, for complex patterns or untrusted input.
  • Adhere to the OWASP Cheat Sheet Series for input validation and sanitization best practices.
  • Comply with relevant security standards, such as the OWASP Top 10 and CWE-185 (Incorrect Regular Expression).

Rule ID: WS-I002-JAVASCRIPT-00082


To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Comment threadinternal/tools/go.mod
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v29.3.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v28.5.2+incompatible // indirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

High Vulnerability Finding

The following vulnerabilities impact github.com/docker/docker versions <29.3.1: CVE-2026-33997, CVE-2026-34040, CVE-2026-41567, CVE-2026-41568, CVE-2026-42306.

These can be remediated by updating to version 29.3.1 or higher.

To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).

To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Suggested change
github.com/docker/docker v28.5.2+incompatible// indirect
github.com/docker/docker v29.3.1// indirect

github.com/influxdata/influxdb-client-go/v2 v2.14.0
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/common v0.69.0
github.com/prometheus/prometheus v0.308.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

High Vulnerability Finding

The following vulnerabilities impact github.com/prometheus/prometheus versions <0.311.3: CVE-2026-40179, CVE-2026-42151, CVE-2026-42154, CVE-2026-44903.

These can be remediated by updating to version 0.311.3 or higher.

To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).

To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Suggested change
github.com/prometheus/prometheus v0.308.1
github.com/prometheus/prometheus v0.311.3

Comment threadcompliance/go.mod
github.com/prometheus/client_golang/exp v0.0.0-20260602051030-3537b20ac86b // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.69.0 // indirect
github.com/prometheus/prometheus v0.307.4-0.20251119130332-1174b0ce4f1f // indirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

High Vulnerability Finding

The following vulnerabilities impact github.com/prometheus/prometheus versions <0.311.3: CVE-2026-40179, CVE-2026-42151, CVE-2026-42154, CVE-2026-44903.

These can be remediated by updating to version 0.311.3 or higher.

To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).

To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Suggested change
github.com/prometheus/prometheus v0.307.4-0.20251119130332-1174b0ce4f1f// indirect
github.com/prometheus/prometheus v0.311.3// indirect

Comment threadinternal/tools/go.mod
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v29.3.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v28.5.2+incompatible // indirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

High Vulnerability Finding

More Details

Vulnerabilities [github.com/docker/docker:28.5.2+incompatible]

NameSeveritySourceFixed versionCVSS scoreCVSS exploitability scoreHas public exploitHas CISA KEV exploit
CVE-2026-33997Mediumhttps://github.com/advisories/GHSA-pxq6-2prw-chj9-8.12.8falsefalse
CVE-2026-41567Highhttps://github.com/advisories/GHSA-x86f-5xw2-fm2r-7.20.8falsefalse
CVE-2026-41568Mediumhttps://github.com/advisories/GHSA-vp62-88p7-qqf5-6.10.8falsefalse
CVE-2026-42306Highhttps://github.com/advisories/GHSA-rg2x-37c3-w2rh-7.20.8falsefalse

To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Comment threaddiscovery/aws/ec2.go
// Only set static credentials if both access key and secret key are provided.
// Otherwise, let the AWS SDK use its default credential chain (environment variables, IAM role, etc.).
if d.cfg.AccessKey != "" && d.cfg.SecretKey != "" {
credProvider := credentials.NewStaticCredentialsProvider(d.cfg.AccessKey, string(d.cfg.SecretKey), "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium SAST Finding

Hardcoded AWS Credentials in Go Application

More Details

Embedding static AWS credentials directly into a Go application using the credentials.NewStaticCredentialsProvider function poses a significant security risk. This practice exposes the AWS access keys and secret keys in plaintext within the application code, making them vulnerable to theft or misuse. If an attacker gains access to the application code or the compiled binary, they can extract the hardcoded credentials and potentially gain unauthorized access to AWS resources, leading to data breaches, financial losses, or other malicious activities.

Hardcoded credentials should never be used in production environments. Instead, applications should retrieve credentials securely from trusted sources, such as environment variables, secure key management services, or temporary credentials obtained through AWS Identity and Access Management (IAM) roles. Failing to properly manage and protect AWS credentials can lead to severe consequences, including data exfiltration, resource hijacking, and compliance violations.

AttributeValue
ImpactMedium
LikelihoodMedium

Remediation

Hardcoding AWS credentials into an application poses a significant security risk. If the application's code is compromised or accidentally exposed, the hardcoded credentials can be easily extracted and misused by attackers to gain unauthorized access to AWS resources, potentially leading to data breaches, financial losses, and other severe consequences.

To fix this issue securely, applications should retrieve AWS credentials from secure sources at runtime, such as environment variables, AWS credential files, or AWS credential providers. This approach ensures that credentials are not embedded in the application's code and can be easily rotated or revoked if needed.

Code examples

// VULNERABLE CODE - Hardcoded AWS credentialsimport (
"github.com/aws/aws-sdk-go-v2/aws""github.com/aws/aws-sdk-go-v2/credentials"
)
creds:=credentials.NewStaticCredentialsProvider(
"AKIAIOSFODNN7EXAMPLE",
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"",
)
// SECURE CODE - Using AWS credential providerimport (
"github.com/aws/aws-sdk-go-v2/config"
)
cfg, err:=config.LoadDefaultConfig(context.TODO())
iferr!=nil {
// Handle error
}
// AWS credentials are retrieved securely from the environment or other sources

Additional recommendations

  • Follow the AWS best practices for managing AWS access keys and secret access keys.
  • Implement least privilege access principles by granting only the necessary permissions to AWS resources.
  • Regularly rotate AWS credentials and revoke unused or compromised credentials.
  • Consider using temporary security credentials (AWS STS) for enhanced security and auditing capabilities.
  • Adhere to relevant security standards and guidelines, such as the AWS Security Best Practices and the OWASP Application Security Verification Standard (ASVS).

Rule ID: WS-GO-00051


To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

Comment threaddiscovery/aws/ecs.go
// Only set static credentials if both access key and secret key are provided
// Otherwise, let AWS SDK use its default credential chain
if d.cfg.AccessKey != "" && d.cfg.SecretKey != "" {
credProvider := credentials.NewStaticCredentialsProvider(d.cfg.AccessKey, string(d.cfg.SecretKey), "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium SAST Finding

Hardcoded AWS Credentials in Go Application

More Details

Embedding static AWS credentials directly into a Go application using the credentials.NewStaticCredentialsProvider function poses a significant security risk. This practice exposes the AWS access keys and secret keys in plaintext within the application code, making them vulnerable to theft or misuse. If an attacker gains access to the application code or the compiled binary, they can extract the hardcoded credentials and potentially gain unauthorized access to AWS resources, leading to data breaches, financial losses, or other malicious activities.

Hardcoded credentials should never be used in production environments. Instead, applications should retrieve credentials securely from trusted sources, such as environment variables, secure key management services, or temporary credentials obtained through AWS Identity and Access Management (IAM) roles. Failing to properly manage and protect AWS credentials can lead to severe consequences, including data exfiltration, resource hijacking, and compliance violations.

AttributeValue
ImpactMedium
LikelihoodMedium

Remediation

Hardcoding AWS credentials into an application poses a significant security risk. If the application's code is compromised or accidentally exposed, the hardcoded credentials can be easily extracted and misused by attackers to gain unauthorized access to AWS resources, potentially leading to data breaches, financial losses, and other severe consequences.

To fix this issue securely, applications should retrieve AWS credentials from secure sources at runtime, such as environment variables, AWS credential files, or AWS credential providers. This approach ensures that credentials are not embedded in the application's code and can be easily rotated or revoked if needed.

Code examples

// VULNERABLE CODE - Hardcoded AWS credentialsimport (
"github.com/aws/aws-sdk-go-v2/aws""github.com/aws/aws-sdk-go-v2/credentials"
)
creds:=credentials.NewStaticCredentialsProvider(
"AKIAIOSFODNN7EXAMPLE",
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"",
)
// SECURE CODE - Using AWS credential providerimport (
"github.com/aws/aws-sdk-go-v2/config"
)
cfg, err:=config.LoadDefaultConfig(context.TODO())
iferr!=nil {
// Handle error
}
// AWS credentials are retrieved securely from the environment or other sources

Additional recommendations

  • Follow the AWS best practices for managing AWS access keys and secret access keys.
  • Implement least privilege access principles by granting only the necessary permissions to AWS resources.
  • Regularly rotate AWS credentials and revoke unused or compromised credentials.
  • Consider using temporary security credentials (AWS STS) for enhanced security and auditing capabilities.
  • Adhere to relevant security standards and guidelines, such as the AWS Security Best Practices and the OWASP Application Security Verification Standard (ASVS).

Rule ID: WS-GO-00051


To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason

If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).


To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate

George Krajcsovitsand others added 3 commits July 9, 2026 08:18
…s-matrix-speedup
ci: run version upgrade test as a per-LTS matrix
…134-head-chunk-cache
tsdb: fix stale head-chunk cache after head-chunk truncation (prometheus#19134)
György Krajcsovitsand others added 3 commits July 10, 2026 08:27
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
chore: prep release 3.13.1 with tsdb related fix
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for freeto 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.

20 participants

@ColinDKelley@github-advanced-security@bwplotka@aknuds1@ogulcanaydogan@roidelapluie@quyentonndbs@Jyotishmoy12@tcp13equals2@colega@ywwg@krajorama@flying-musk@juliusv@msnandhis@miguelbernadi@fallintoplace@bboreham@DanCech@bragi92