Security Advisories (3)
CVE-2026-49145 (2026-07-08)

App::Ack versions through 3.10.0 for Perl read arbitrary files via --files-from in a project .ackrc. ack searches up the directory hierarchy from the current directory for a project .ackrc and loads its options. The project-source option blocklist in App::Ack::ConfigLoader does not include --files-from, so a project .ackrc can set it to a path whose listed files ack then reads and searches. Version 3.10.0 added --follow to the blocklist; --files-from remains accepted. A project .ackrc committed to an untrusted repository can make ack read files outside the project and print their matching lines.

CVE-2026-49146 (2026-07-08)

App::Ack versions before 3.10.0 for Perl allow memory exhaustion via an unbounded context value in a project .ackrc. ack searches up the directory hierarchy from the current directory for a project .ackrc and loads its options. The -B and -C context options accepted any positive integer, and ack sized the before-context buffer to that value, so a project .ackrc setting --before-context=100000000 made ack allocate a buffer of 100 million elements. A project .ackrc committed to an untrusted repository can abort ack with an out-of-memory condition.

CVE-2026-49147 (2026-07-08)

App::Ack versions through 3.10.0 for Perl print unsanitised terminal escape sequences from filenames in several output modes. When ack prints a filename whose basename contains terminal control bytes such as ANSI escape sequences, those bytes reach the terminal unchanged. Version 3.10.0 added a _safe_filename helper that sanitises the filenames printed by -f, -g, the colored match heading, and per-match lines, but the --show-types, -l/-L, and -c paths still emit the raw filename. A file whose name embeds cursor-movement or color escapes can overwrite or recolor earlier terminal output, or be passed unchanged to a downstream consumer.

NAME

App::Ack::Resource

DESCRIPTION

Abstracts a file from the filesystem.

METHODS

new( $filename )

Opens the file specified by $filename and returns a filehandle and a flag that says whether it could be binary.

If there's a failure, it throws a warning and returns an empty list.

$res->name()

Returns the name of the resource.

$res->basename()

Returns the basename (the last component the path) of the resource.

$res->open()

Opens a filehandle for reading this resource and returns it, or returns undef if the operation fails (the error is in $!). Instead of calling close $fh, $res->close should be called.

$res->needs_line_scan( \%opts )

Tells if the file needs a line-by-line scan. This is a big optimization because if you can tell from the outset that the pattern is not found in the resource at all, then there's no need to do the line-by-line iteration.

Slurp up an entire file up to 100K, see if there are any matches in it, and if so, let us know so we can iterate over it directly. If it's bigger than 100K or the match is inverted, we have to do the line-by-line, too.

$res->reset()

Resets the resource back to the beginning. This is only called if needs_line_scan() is true, but not always if needs_line_scan() is true.

$res->close()

Close the file.

$res->clone()

Clones this resource.

$res->firstliney()

Returns the first line of a file (or first 250 characters, whichever comes first).