Skip to content

TypeORM is configured with no SSL option, so a managed Postgres connection either fails or is silently unencrypted #766

Closed

Description

@chonilius

src/app.module.ts:40-52 builds the datasource from three fields only:

        return {
          type: 'postgres' as const,
          url: database.url,
          entities,
          synchronize: database.synchronize,
          logging: database.logging,
        };

There is no ssl setting, and configuration.ts's database block has no field for one. src/database/data-source.ts (used by the migration CLI) is a second place the same options are assembled.

Why it matters: every managed Postgres (RDS, Cloud SQL, Neon, Supabase, Render) requires TLS. Without an ssl option the behaviour depends entirely on whether the operator remembered ?sslmode=require in DATABASE_URL — and pg treats an unrecognised or absent sslmode as "no TLS", so the failure mode is either a hard connection refusal (visible, fine) or an unencrypted connection carrying every user's encrypted GitHub token, Stellar address and payment record across the provider's network (silent, not fine). assertRequiredConfig checks that DATABASE_URL is not the local default but says nothing about TLS.

Fix: add database.ssl to config (DATABASE_SSL=true, with rejectUnauthorized and an optional CA), pass it in both app.module.ts and data-source.ts, and require it in production via collectConfigIssues. Reject a production DATABASE_URL whose sslmode is disable.

Activity

  1. added
    security
    on Nov 12, 2026
  2. guptakumarranjeet150 commented on Nov 12, 2026

    @guptakumarranjeet150

    Hi team,

    I analyzed "TypeORM is configured with no SSL option, so a managed Postgres connection either fails or is silently unencrypted" in MergeFi/backend and have a concrete technical roadmap to resolve it.

    I have reviewed the problem description and acceptance criteria for this issue. I have a clear, tested implementation ready with defensive error handling and 100% green CI proof.

    I will deliver a clean, well-tested, and production-ready PR promptly upon assignment. Kindly assign this issue to me.

    Thank you!

  3. added
    Stellar Wave
    on Nov 19, 2026
  4. LayanGift commented on Nov 19, 2026

    @LayanGift

    @LayanGift has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

    Hello maintainer, can I work on this?

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @LayanGift to this issue.

  5. tonyy-starrk commented on Nov 20, 2026

    @tonyy-starrk

    @tonyy-starrk has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

    im familiar with this, please assing

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @tonyy-starrk to this issue.

  6. drips-wave commented on Nov 20, 2026

    @drips-wave

    Congratulations, @tonyy-starrk! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

    🧑‍💻 @tonyy-starrk: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  7. drips-wave commented on Nov 21, 2026

    @drips-wave

    This issue has been completed by @tonyy-starrk as part of the Stellar Wave Program's 11th Wave 🥳

    😎 @tonyy-starrk: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar Wavesecurity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions