{"record":{"id":"150e0ab753746b6b","repo":"can1357/oh-my-pi","slug":"encrypted-rar5-member-rawpath-is-not-supporte","errorCode":null,"errorMessage":"Encrypted RAR5 member '${rawPath}' is not supported","messagePattern":"Encrypted RAR5 member '(.+?)' is not supported","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/rar.ts","lineNumber":381,"sourceCode":"\t\t\tif ((compression & 0x3f) === 1) dictionarySize += (dictionarySize * ((compression >>> 15) & 0x1f)) / 32;\n\t\t\tif (!Number.isSafeInteger(dictionarySize) || dictionarySize > options.limits.maxInMemorySize) {\n\t\t\t\tthrow new ArchiveError(`RAR5 dictionary is too large (${dictionarySize} bytes)`);\n\t\t\t}\n\t\t\tconst hostOs = readVint(bytes, cursor, extraStart, \"host OS\");\n\t\t\tconst nameSize = readVint(bytes, cursor, extraStart, \"file name size\");\n\t\t\tassertArchivePathBytes(nameSize, \"member path\", options.limits.maxPathBytes);\n\t\t\tneed(cursor.offset, nameSize, extraStart, \"RAR5 file name\");\n\t\t\tlet rawPath: string;\n\t\t\ttry {\n\t\t\t\trawPath = UTF8.decode(bytes.subarray(cursor.offset, cursor.offset + nameSize));\n\t\t\t} catch {\n\t\t\t\tthrow new ArchiveError(\"Invalid RAR5 UTF-8 member name\");\n\t\t\t}\n\t\t\tcursor.offset += nameSize;\n\t\t\tlet linkTarget: string | undefined;\n\t\t\tfor (const extra of readExtraRecords(bytes, extraStart, headerEnd)) {\n\t\t\t\tconst extraCursor = { offset: extra.start };\n\t\t\t\tif (extra.type === 1) throw new ArchiveError(`Encrypted RAR5 member '${rawPath}' is not supported`);\n\t\t\t\tif (extra.type === 3) {\n\t\t\t\t\tconst timeFlags = readVint(bytes, extraCursor, extra.end, \"time flags\");\n\t\t\t\t\tif ((timeFlags & 2) !== 0) {\n\t\t\t\t\t\tif ((timeFlags & 1) !== 0) {\n\t\t\t\t\t\t\tneed(extraCursor.offset, 4, extra.end, \"Unix modification time\");\n\t\t\t\t\t\t\tmtimeMs = readUInt32LE(bytes, extraCursor.offset) * 1000;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tneed(extraCursor.offset, 8, extra.end, \"Windows modification time\");\n\t\t\t\t\t\t\tmtimeMs = filetimeMs(bytes, extraCursor.offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (extra.type === 5) {\n\t\t\t\t\tconst redirectionType = readVint(bytes, extraCursor, extra.end, \"redirection type\");\n\t\t\t\t\treadVint(bytes, extraCursor, extra.end, \"redirection flags\");\n\t\t\t\t\tconst targetSize = readVint(bytes, extraCursor, extra.end, \"link target size\");\n\t\t\t\t\tassertArchivePathBytes(targetSize, \"link target\", options.limits.maxPathBytes);\n\t\t\t\t\tneed(extraCursor.offset, targetSize, extra.end, \"link target\");\n\t\t\t\t\tif (redirectionType < 1 || redirectionType > 5)","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/rar.ts#L363-L399","documentation":"RAR5 file headers may carry an extra record of type 1 (FILE_ENCRYPTION) marking the member as password-encrypted. The library does not implement RAR decryption, so any encrypted member is rejected, with the member name included in the message.","triggerScenarios":"Parsing a RAR5 archive where at least one file entry has the encryption extra record — i.e. the archive was password-protected without filename encryption (per-file encryption also occurs with -hp).","commonSituations":"User-uploaded password-protected archives; automated pipelines that cannot supply passwords; archives shared internally with a password for confidentiality.","solutions":["Decrypt first with the unrar CLI (`unrar x -p<password>`) and parse the plaintext output","Ask the archive producer to create an unencrypted copy","Detect encrypted members upstream and prompt for a password before invoking this library"],"exampleFix":"// before\nconst records = readRar(await Bun.file('locked.rar').bytes()); // throws on encrypted member\n// after\nawait $`unrar x -p${password} locked.rar extracted/`;\nconst records = readRar(await Bun.file('extracted/plain.rar').bytes());","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const records = readRar(bytes);\n} catch (err) {\n  if (err instanceof ArchiveError && /Encrypted RAR5 member/.test(err.message)) {\n    const member = /'(.+)'/.exec(err.message)?.[1];\n    // prompt for password and extract via unrar\n  } else throw err;\n}","preventionTips":["Detect password-protected RAR uploads early and collect a password","Decrypt via the unrar CLI before programmatic parsing","Avoid per-file encryption when targeting automated pipelines"],"tags":["rar5","encryption","password","unsupported-feature"],"backgroundTag":"encrypted-archive-unsupported","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}