Skip to content

auth:ntlm parsing throws TypeError when the domain line is absent #8695

Closed

Description

@haskiindahouse

Internal - [BRU-3988]


Title: auth:ntlm parsing throws TypeError when the domain line is absent

I have checked the following

  • I have searched existing issues and found nothing related to my issue.

This bug is

  • making Bruno unusable for me (a valid .bru fails to open / import throws)

Bruno version

2.0.0 (@usebruno/lang 0.12.0; reproduced on main @ 7ef252f)

Operating System

macOS 15 / any (pure parser)

Describe the bug

The authNTLM semantic action in bruToJson.js guards the domain lookup with the wrong key: it checks passwordKey but dereferences domainKey. An auth:ntlm block with username/password and no domain line makes passwordKey truthy, so the code reads domainKey.value on an undefined domainKey and throws. A request .bru with NTLM auth and no explicit domain fails to parse.

Steps to reproduce

const bruToJson = require('@usebruno/lang').bruToJsonV2;

const bru = `auth:ntlm {
  username: u
  password: p
}`;
bruToJson(bru); // throws

Output:

TypeError: Cannot read properties of undefined (reading 'value')

Expected vs actual

  • Expected: parses to { auth: { ntlm: { username: 'u', password: 'p', domain: '' } } }.
  • Actual: throws TypeError: Cannot read properties of undefined (reading 'value').

Root cause

packages/bruno-lang/v2/src/bruToJson.js:797:

const domain = passwordKey ? domainKey.value : '';

The guard should be domainKey.

Suggested fix

const domain = domainKey ? domainKey.value : '';

(matching the username/password patterns on the lines above).

Screenshots / Live demo

Terminal repro above (runtime-verified against main @ 7ef252f).


Found via property-based & differential bug-hunting, part of an effort to scale PBT (DepTyCheck-based) testing across the OSS ecosystem.

If this is intended / by-design: I'm really sorry, please just close it — no need to flag or ban me. I'm trying to scale property-based testing across the whole ecosystem and my publishing agents may have gotten this one wrong. I read every issue and follow up on each.

Activity

  1. coderabbitai commented on Jul 21, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #8136 - fix(generate-code)!: generate code URL issues [merged]
    #8494 - fix(converters): add missing auth mappings on postman export, add additional parameters mapping on postman import [merged]
    #8707 - fix(lang): guard ntlm domain on domainKey, not passwordKey [open]
    #8739 - Skip Ohm.js parsing large bodies [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    bug
    on Jul 21, 2026
  3. sbalagan22 commented on Jul 21, 2026

    @sbalagan22
    Contributor

    Confirmed on main. In authNTLM (packages/bruno-lang/v2/src/bruToJson.js), the domain line guards on passwordKey but dereferences domainKey: const domain = passwordKey ? domainKey.value : ''. An auth:ntlm block with username/password and no domain makes passwordKey truthy while domainKey is undefined, so domainKey.value throws and the .bru fails to parse. Fix guards on domainKey (matching the username/password lines), defaulting domain to an empty string. Adding a round-trip test for ntlm with and without a domain line.

  4. Rohan-Bruno commented on Jul 22, 2026

    @Rohan-Bruno
    Collaborator

    Hi @haskiindahouse, thank you for taking the time to report this issue!

    I've shared this with our engineering team, and it's being evaluated alongside our other product priorities. While I can't promise a timeline at the moment, we'll make sure it gets reviewed as soon as possible, and we'll share any updates as they become available.

    We'll keep this thread updated with any progress or new information.

  5. self-assigned this
    on Jul 22, 2026
  6. haskiindahouse commented on Jul 22, 2026

    @haskiindahouse
    Author

    nice, thx very much

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

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions