Dev.to Security 🔐 Cybersecurity 👁 0 📖 2 min read

Eliminating False-Positive Criticals: Sentinel Rank Handling in OASIS SARIF v2.1.0 Ingestion

The Hook In the OASIS SARIF v2.1.0 specification, an omitted result.rank property defaults to the sentinel value -1.0—meaning a security report parser that compares numeric rank thresholds without guarding against nega

The Hook

In the OASIS SARIF v2.1.0 specification, an omitted result.rank property defaults to the sentinel value -1.0—meaning a security report parser that compares numeric rank thresholds without guarding against negative values will silently promote low-severity unranked findings into critical vulnerabilities.

The Deep Dive

Enterprise DevSecOps teams rely on Static Application Security Testing (SAST) and third-party scanners emitting Static Analysis Results Interchange Format (SARIF) reports to gate merge requests cleanly. Under the OASIS SARIF v2.1.0 standard, rank is a floating-point value between 0.0 (lowest priority) and 100.0 (highest priority) representing the relative importance of a finding, while -1.0 is reserved as a sentinel default indicating that no rank was specified by the analyzer.

While investigating SARIF severity resolution in gitlab-org/gitlab and authoring MR !271129 (fix(sarif): ignore negative result ranks), I analyzed how Gitlab::Ci::Reports::Security::Locations::Sarif mapped findings onto GitLab's canonical severity levels. When a SARIF payload included an explicit "rank": -1.0 (the schema default emitted by several compliant static analyzers when rank calculation is disabled), the ingestion pipeline saw a non-nil numeric result['rank'] and routed it into rank-based severity resolution instead of falling back to the rule's native level (warning, note, or error).

Because the rank-to-severity comparator assumed any present numeric rank lay within the valid [0.0, 100.0] domain, negative sentinel values bypassed the expected range buckets and distorted severity classification. In MR !271129, I hardened resolve_severity to explicitly ignore negative result['rank'] values (rank >= 0), ensuring that whenever a tool emits the SARIF -1.0 sentinel, GitLab deterministically falls back to the finding's level and rule metadata.

The GitLab Hero Angle

GitLab's unified SARIF security ingestion engine (MR !271129) enforces strict OASIS specification semantics at the CI report parsing boundary, preventing third-party scanner sentinel defaults from polluting enterprise Merge Request approval policies or Vulnerability Reports.

The Takeaway

When implementing parsers for security interchange standards like SARIF, treat out-of-band sentinel numbers (such as rank: -1.0) as absent values prior to threshold bucketing so schema defaults never override native rule severities.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.