Skip to content

Add GitLab jobToken exploit#499

Open
frjcomp wants to merge 6 commits intomainfrom
jobtoken-tests
Open

Add GitLab jobToken exploit#499
frjcomp wants to merge 6 commits intomainfrom
jobtoken-tests

Conversation

@frjcomp
Copy link
Collaborator

@frjcomp frjcomp commented Feb 9, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 9, 2026 13:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitLab gl jobToken exploit command path intended to validate a CI job token, download secure files, and attempt a repo write as an exploitation workflow within Pipeleek’s GitLab tooling.

Changes:

  • Introduces new Cobra command group gl jobToken with exploit subcommand and config bindings.
  • Adds pkg/gitlab/jobtoken implementation plus unit tests and GitLab e2e tests.
  • Updates example configuration and documentation to include the new gitlab.jobToken.exploit.project setting.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/e2e/gitlab/jobtoken/exploit_test.go New e2e coverage for the gl jobToken exploit CLI flow (mock GitLab API).
pkg/gitlab/jobtoken/exploit.go Implements job token validation, secure file download, and repo write attempt via git.
pkg/gitlab/jobtoken/exploit_test.go Unit tests for URL normalization, branch naming, auth URL formatting, and token scrubbing.
internal/cmd/gitlab/jobToken/jobtoken.go Adds jobToken root command with token prefix validation and inherited flag/config binding.
internal/cmd/gitlab/jobToken/exploit/exploit.go Adds exploit subcommand and binds project config key.
internal/cmd/gitlab/gitlab.go Registers the new jobToken command under gl.
pipeleek.example.yaml Documents new gitlab.jobToken.exploit.project config entry.
docs/introduction/configuration.md Documents new gitlab.jobToken.exploit.project config entry.
internal/cmd/gitlab/jobToken/jobtoken_test.go Basic command wiring tests for jobToken root cmd.
internal/cmd/gitlab/jobToken/exploit/exploit_test.go Basic command wiring tests for exploit subcommand.

log.Fatal().Err(err).Msg("required configuration missing")
}

gitlabApiToken := config.GetString("gitlab.token")
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

This assigns to a new local gitlabApiToken variable (shadowing the package-level var used for flag binding). It’s easy to misread as setting the persistent flag value. Consider using a differently named local variable (e.g., token) or assign to the existing variable to avoid shadowing confusion.

Suggested change
gitlabApiToken := config.GetString("gitlab.token")
gitlabApiToken = config.GetString("gitlab.token")

Copilot uses AI. Check for mistakes.
frjcomp and others added 5 commits February 9, 2026 14:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants