--sanitize incorrectly redacts HH:MM:SS timestamps as IPv6 addresses
Bug
Enabling --sanitize replaces ordinary timestamps such as 12:30:45
with 0.0.0.0::1, even though they are not IPv6 addresses.
This silently changes document content. I reproduced the issue with text, JSON, Markdown, and HTML output.
Steps to reproduce
Download the attached
time.pdf. It contains:Meeting at 12:30:45 on Monday. Ratio 1:2:3 and John 3:16:2. Score 3:2 and John 3:16 and time 12:30. Real IPv6: 2001:db8::1 and email [email protected]Using the CLI JAR built from the revision below, run:
java -jar opendataloader-pdf-cli-2.5.12-SNAPSHOT.jar \ --format text --output-dir plain time.pdf --quiet java -jar opendataloader-pdf-cli-2.5.12-SNAPSHOT.jar \ --sanitize --format text --output-dir sanitized time.pdf --quietCompare
plain/time.txtandsanitized/time.txt.
Expected behavior
The timestamp 12:30:45 and non-IP expressions 1:2:3 and 3:16:2
should remain unchanged. The actual IPv6 address and email should
still be sanitized.
Actual behavior
Without --sanitize:
Meeting at 12:30:45 on Monday. Ratio 1:2:3 and John 3:16:2. Score 3:2 and John 3:16 and time 12:30. Real IPv6: 2001:db8::1 and email [email protected]With --sanitize:
Meeting at 0.0.0.0::1 on Monday. Ratio 0.0.0.0::1 and John 0.0.0.0::1. Score 3:2 and John 3:16 and time 12:30. Real IPv6: 0.0.0.0::1 and email [email protected]Single-colon expressions such as 12:30, 3:2, and John 3:16
remain unchanged.
Relevant code
The default IPv6 sanitization rule in
java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/FilterConfig.java
uses:
Pattern.compile("\\b([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}\\b")This pattern accepts colon-separated numeric expressions such as
12:30:45 without requiring a valid IPv6 structure.
Version
2.5.12-SNAPSHOT, built locally from commit c61eecb. Tested through the Java CLI on macOS (Apple Silicon).
Java version
openjdk version "21.0.12.1" 2026-08-18 LTS
OpenJDK Runtime Environment Microsoft-14941480 (build 21.0.12.1+1-LTS)
OpenJDK 64-Bit Server VM Microsoft-14941480 (build 21.0.12.1+1-LTS, mixed mode, sharing)Source: opendataloader-project/opendataloader-pdf