0) {
+ const authors = Array.from(comments).map(comment =>
+ comment.getAttribute('w:author') || comment.getAttribute('author')
+ ).filter(Boolean);
+
+ if (authors.length > 0) {
+ leakReport.push({
+ type: "Comments",
+ content: "Comments by: " + [...new Set(authors)].join(', '),
+ severity: "medium",
+ safe: false,
+ description: "Document comments may contain sensitive information"
+ });
+ }
+ }
+ } catch (e) {
+ console.error('Error parsing comments.xml:', e);
+ }
+ }
+
+ // Check for embedded thumbnail
+ const hasThumbnail = Object.keys(fileParts).some(name =>
+ name.includes('thumbnail') || name.includes('Thumbnail')
+ );
+ if (hasThumbnail) {
+ leakReport.push({
type: "Embedded Thumbnail",
- content: "thumbnail.jpeg found",
+ content: "Thumbnail image found",
severity: "low",
safe: true,
description: "Preview image embedded in document"
- },
- {
+ });
+ }
+
+ // Check for EXIF data (would normally check actual image files)
+ const hasMedia = Object.keys(fileParts).some(name =>
+ name.includes('media/') && (name.endsWith('.jpg') || name.endsWith('.jpeg') || name.endsWith('.png'))
+ );
+ if (hasMedia) {
+ leakReport.push({
type: "EXIF Data",
- content: "Image contains GPS coordinates",
+ content: "Images may contain EXIF metadata",
severity: "high",
safe: false,
description: "Embedded images may contain location metadata"
- }
- ];
+ });
+ }
}
// Display the leak report
@@ -760,6 +786,11 @@
const reportContainer = document.getElementById('leak-report');
reportContainer.innerHTML = '';
+ if (leakReport.length === 0) {
+ reportContainer.innerHTML = 'No potential leaks detected.
';
+ return;
+ }
+
leakReport.forEach(item => {
const itemElement = document.createElement('div');
itemElement.className = `leak-item ${item.safe ? 'safe' : ''}`;
@@ -782,15 +813,20 @@
Analysis:
- This part ${partName.includes('core.xml') ? 'contains author metadata that should be reviewed' : 'appears to be standard OOXML content'}
- ${partName.includes('comments') ? 'Comments should be removed before sharing' : 'No immediate concerns detected'}
- ${partName.includes('thumbnail') ? 'Thumbnail images may reveal document appearance' : 'Content appears standard'}
+ This part ${isMetadataPart(partName) ? 'contains metadata that should be reviewed' : 'appears to be standard OOXML content'}
+ ${partName.includes('comments') ? 'Comments should be removed before sharing' : 'Content appears standard'}
+ ${partName.includes('thumbnail') ? 'Thumbnail images may reveal document appearance' : 'No immediate concerns detected'}
Close
`;
}
+ // Check if part contains metadata
+ function isMetadataPart(partName) {
+ return partName.includes('core.xml') || partName.includes('app.xml') || partName.includes('thumbnail');
+ }
+
// Helper function to escape HTML
function escapeHtml(unsafe) {
return unsafe