fix: Round 6 slop audit — string type guards + HTTP port validation#29
Merged
Conversation
Add is_string() guards to all 261 unguarded .get<std::string>() calls
across 14 source files, preventing nlohmann::json::type_error crashes
from malformed JSON with non-string values at string keys. Fix HTTP
port parsing to throw on invalid ports instead of silently defaulting.
F-1: 305 total .get<std::string>() calls now guarded (was 44/305)
F-2: http_impl.cpp stoi catch(...){} → proper validation + error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
NAAb Governance Report
All governance checks passed! Generated by NAAb Governance Engine v4.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_string()type guards to all 261 previously unguarded.get<std::string>()calls across 14 source files, completing the type guard coverage started in PR fix: drift tests, type guards, and R4/R5 audit fixes #28 (which covered bool/int/double/size_t but missed strings)catch(...){}onstd::stoiin HTTP URL port parsing — invalid ports now throw with clear error messages instead of silently defaulting to port 0checkCodeInjection()provides partial coverageRound 6 audit stats
Files changed (13)
governance_config.cppgovernance_engine.cppagent_provider.cppscanner.cppblock_registry.cpppackage_manager.cppblock_search_index.cpplockfile.cpptrust_store.cppgovernance_reports.cppproject_context.cppagent_review.cpphttp_impl.cppTest plan
🤖 Generated with Claude Code