DBI parse_dsn accepts malformed DSNs without the dbi prefix
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start by running t/02_basic.t and comparing the bundled DBI->parse_dsn behavior with standard DBI, focusing on the malformed "bi:mysql:database=mytbl" case. The change is done when the missing dbi: prefix is rejected and DBIx::DSN::Resolver->resolv croaks on both execution backends.
Written by the indexing model from the issue text.
Description
Summary
The bundled DBI->parse_dsn accepts malformed DSNs that do not begin with the required dbi: prefix. This causes DBIx::DSN::Resolver to silently return an invalid DSN instead of throwing an error.
Affected distribution
- Distribution:
DBIx-DSN-Resolver - Version:
0.09 - CPAN run:
20260915-125610-17469 - PerlOnJava commit:
30095483379e4aa76540da1330f8f407bc145151
Reproduction
use DBIx::DSN::Resolver;
my $resolver = DBIx::DSN::Resolver->new;
eval { $resolver->resolv('bi:mysql:database=mytbl') };
die "expected an error\n" unless $@;
The same behavior is covered by the upstream test t/02_basic.t, line 34:
eval {
$r->resolv("bi:mysql:database=mytbl"),
};
ok($@);
Expected behavior
The malformed bi: DSN should be rejected by DBI->parse_dsn, causing DBIx::DSN::Resolver->resolv to croak.
Actual behavior
PerlOnJava accepts the malformed DSN and returns it unchanged:
value=bi:mysql:database=mytbl err=[]
The failure is reproducible on both execution backends:
- JVM backend:
t/02_basic.tfails at test 6 (line 34). - Interpreter backend: the focused reproduction also returns the invalid DSN without an error.
Comparison with system Perl
System Perl passes the complete upstream suite:
t/00_compile.t .. ok
t/02_basic.t .... ok
t/03_dsn.t ...... ok
Result: PASS
The archived PerlOnJava CPAN run reports 1 failed subtest out of 18, with the other test files passing. The failure is independent of DNS/network availability because it concerns the malformed DSN without a hostname.
Suggested investigation
Compare the bundled PerlOnJava implementation of DBI->parse_dsn with standard DBI behavior. It should reject DSNs that do not match the required dbi:<driver>:<driver_dsn> form, rather than treating bi: as a valid scheme and allowing DBIx::DSN::Resolver to return the original string.
Labels
bug, area:cpan-port, area:runtime
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 25m
- Merged PRs (30d)
- 157
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:cpan-port bug
Difficulty 4/5 3-5 days Newbie friendliness 44/100
fglock/PerlOnJava#1459 ·
-
area:cpan-port bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
fglock/PerlOnJava#1457 ·
-
bug high-impact
Difficulty 3/5 1-2 days Newbie friendliness 67/100
fglock/PerlOnJava#1456 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 72/100
fglock/PerlOnJava#1455 ·
All issues in fglock/PerlOnJava
Similar issues
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100