Skip to content

Fix GitLab registry, detection classification, and client cleanups#6

Open
praetorian-rang wants to merge 4 commits intomainfrom
fix/gitlab-minor-bugs
Open

Fix GitLab registry, detection classification, and client cleanups#6
praetorian-rang wants to merge 4 commits intomainfrom
fix/gitlab-minor-bugs

Conversation

@praetorian-rang
Copy link
Collaborator

@praetorian-rang praetorian-rang commented Mar 17, 2026

Summary

  • Register missing GitLab attack plugins (runnerexec, secretsdump) in the global registry so they're discoverable via the SDK path in pkg/lib/
  • Fix mismatched vulnerability class in token-exposure and merge-request-secrets-exposure detections — findings were categorized as "excessive_permissions" instead of "secrets_exposure"
  • Use yaml.Marshal for runner tag serialization in runnerexec to prevent YAML injection via metacharacters
  • Add url.PathEscape to ListUserProjects for consistency with other client methods
  • Remove duplicate /api/v4 URL normalization between Platform.Init and NewClient
  • Hoist per-call regexp.MustCompile in log parser to a package-level var

Testing

  • All existing tests pass (make test-short)
  • Verified scan and attack commands against a live GitLab instance
  • Added regression test for YAML metacharacter handling in pipeline generation

Closes LAB-1455, LAB-1456, LAB-1460

Add blank imports for runnerexec and secretsdump GitLab attack plugins
to pkg/attacks/all/all.go. These plugins were only accessible via direct
CLI imports, silently omitting them from the global registry used by the
SDK integration in pkg/lib/.

Resolves LAB-1455
The permissions (token-exposure) and mrsecrets detections both passed
VulnExcessivePermissions to GetVulnerabilityClass instead of their
actual vulnerability type. This caused findings to be miscategorized
in JSON, SARIF, and HTML output.

- permissions.go: VulnExcessivePermissions → VulnTokenExposure
- mrsecrets.go: VulnExcessivePermissions → VulnMergeRequestSecretsExposure

Resolves LAB-1456
- Use yaml.Marshal for runner tag serialization in runnerexec pipeline
  generation, preventing YAML injection via metacharacters (matches the
  pattern already used by secretsdump)
- Add url.PathEscape to ListUserProjects for consistency with
  GetProject and ListGroupProjects
- Remove duplicate /api/v4 URL normalization from Platform.Init,
  letting NewClient be the single owner of that logic
- Hoist regexp.MustCompile in stripANSICodes to a package-level var
  to avoid recompilation on every log line

Resolves LAB-1460
Verify that runner tags containing YAML-special characters (colon, hash,
braces, anchors, aliases) are safely serialized via yaml.Marshal without
altering document structure.

Resolves LAB-1460
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.

1 participant