BUG BinAsciiConverter UUencode output cannot be decoded when all words are converted
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
The bug is in BinAsciiConverter when encoding_func="UUencode" and all words are selected: per-word UU lines get joined with an empty string, so the lines run together. Run the reproduction script from the issue and check that binascii.a2b_uu fails on the output. Compare with the hex and quoted-printable fix referenced in #2651. Done means the output keeps line separators and decodes back to the original prompt. Linked PR #3249 already addresses this, so check it before starting.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
With encoding_func="UUencode" and the default all-words selection, BinAsciiConverter encodes each word as its own UU line, strips the line endings and joins the results with "". The separators are dropped and the lines run together, so the output is not valid UUencode and cannot be decoded back to the prompt. #2651 fixed the same separator problem for hex and quoted-printable and noted that UUencode was a separate issue.
Steps/Code to Reproduce
import asyncio
import binascii
from pyrit.converter import BinAsciiConverter
async def main():
converter = BinAsciiConverter(encoding_func="UUencode")
result = await converter.convert_async(prompt="hello world")
print(repr(result.output_text))
print(b"".join(binascii.a2b_uu(line) for line in result.output_text.splitlines()))
asyncio.run(main())
Expected Results
The output decodes back to b'hello world'.
Actual Results
'%:&5L;&\\ %=V]R;&0 '
binascii.Error: Trailing garbage
Versions
- PyRIT version: installed from main (
68487b2e) in editable mode - Python version: 3.12
I have a fix that keeps each encoded word and the encoded separator on their own lines, and would like to open a PR for it.
- Vorherrschende Sprache
- Python
- Sterne
- 4.6k
- Forks
- 944
- Ø Merge
- 2 T. 18 Std.
- Gemergte PRs (30 T.)
- 358
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackEvtl. vergeben @u7k4rs6 hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
microsoft/PyRIT#3095 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
-
BUG Configuration keeps runtime-status errors after polling recoversEvtl. vergeben @joeyvictorino hat das vor 6 Tagen übernommen. OffenBug: triage GUI help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
microsoft/PyRIT#2868 · 6 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
FEAT: Support PDF and file inputs via `binary_path` in OpenAI chat and response targetsEvtl. vergeben @PranavD2905 hat das heute übernommen. Offenfeature-request help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
microsoft/PyRIT#3274 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
feature-request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 18/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in microsoft/PyRIT
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
PolicyEngine/policyengine-us#10262 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
kellyjonbrazil/jc#788 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
`/search.json` ignores the documented `editions.sort` parameterEvtl. vergeben @PranavD2905 hat das heute übernommen. OffenAffects: Server Good First Issue Module: Solr Needs: Triage Theme: Public APIs Theme: Search
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
internetarchive/openlibrary#13989 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug P2: misleading query
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
jeffknupp/association#478 ·