Skip to content

Release 2.0.0 security boundary hardening - #8

Merged
HenkDz merged 8 commits into
mainfrom
codex-postgres-mcp-hardening
Jun 23, 2026
Merged

Release 2.0.0 security boundary hardening#8
HenkDz merged 8 commits into
mainfrom
codex-postgres-mcp-hardening

Conversation

@HenkDz

@HenkDz HenkDz commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • prepare the breaking hardening branch as version 2.0.0
  • add an explicit README migration section for the new security defaults
  • keep the 1.x non-breaking security patch path documented as @henkey/postgres-mcp-server@1.0.7
  • merge current main baseline, including the Glama badge and 1.0.7 SQLi patch line

Breaking changes

  • default security mode is readonly
  • per-tool connection strings are disabled by default
  • destructive operations require allowDestructive
  • legacy string where filters are rejected in favor of structured predicates or unsafe rawWhere
  • multi-statement pg_execute_sql requires transactional=true, expectRows=false, and no bind parameters
  • unknown tool input fields are rejected
  • user/target identifiers are restricted to safe simple PostgreSQL identifiers

Verification

  • npm run prepublishOnly

HenkDz added 3 commits May 25, 2026 16:13
Add security modes, audit and connection-boundary controls, docs and role guidance, packaging/verifier gates, and broad test coverage.

Harden tool behavior around schema-qualified metadata, sanitized diagnostics, bounded query/export/copy output, filesystem sandboxing, enum/schema DDL, and import validation.
@HenkDz HenkDz changed the title Harden PostgreSQL MCP server packaging, docs, and test coverage Release 2.0.0 security boundary hardening Jun 23, 2026
@socket-security

socket-security Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​types/​pg@​8.11.11 ⏵ 8.20.0100 +110073 +183100
Updatedpg-monitor@​3.0.0 ⏵ 3.1.010010010081100
Updated@​types/​node@​20.17.16 ⏵ 20.19.41100 +110081 +196100
Updatednodemon@​3.1.10 ⏵ 3.1.149610010083100
Updatedpg-query-stream@​4.9.6 ⏵ 4.15.0100 +110088 +189100
Updatedtypescript@​5.7.3 ⏵ 5.9.3100 +110090 +19790
Updatedpg@​8.16.3 ⏵ 8.21.099 +110099 +191100
Updatedzod@​3.24.4 ⏵ 3.25.76100 +110010093100

View full report

@socket-security

socket-security Bot commented Jun 23, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@HenkDz
HenkDz marked this pull request as ready for review June 23, 2026 11:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b7a40bf6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/utils/filesystem.ts
Comment thread src/server/connection-target.ts Outdated
}

return {
host: decodeURIComponent(parsed.hostname).toLowerCase(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Strip IPv6 brackets before target matching

For URL connection strings with IPv6 hosts, Node's URL parser leaves parsed.hostname bracketed (for example [::1]), while parseAllowedConnectionTarget('[::1]:5432/db') stores the host as ::1 after removing the brackets. As a result, an explicitly allowlisted IPv6 target is denied even though the connection string matches the documented bracketed IPv6 format.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68ce815bb2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/utils/connection.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: deb98caf67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/server/connection-target.ts
Comment thread src/tools/schema.ts
@HenkDz
HenkDz merged commit ea45bf3 into main Jun 23, 2026
4 checks passed
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