Comments (6)
As a workaround, you can use {{.ref exampleptc}}
.
The current code strips non-ASCII-alphanumeric characters from the evidence name when generating it's ref, but the {{.ref}}
tag does not do that, hence the mismatch. We could change it to strip the name similarly, but if I'm reading the docx spec right, we could also use the full name in double quotes and just escape "
and \
characters. @chrismaddalena Would appreciate your thoughts.
from ghostwriter.
@ColonelThirtyTwo Yeah, let's try using quotes. If it works, that's the better solution. Escaping quotes is easy enough, and it should be unlikely that someone uses double quotes in a name anyway. This would also avoid a situation where someone could have evidence1
and evidence-1
and have their reference to the second one end up pointing to the first if we stripped the -
.
from ghostwriter.
Speaking of duplicate evidence files, there does not appear to be any checks to block that. I'm able to create two evidence items with the same name. So, quoting the evidence names wouldn't help here.
I think this indicates that there are two issues:
- Special characters are treated differently for figure naming and cross-reference naming. One strips the special characters and the other does not, respectively.
- There are no checks to prevent evidence naming duplicates upstream in the Ghostwriter UI or when stripping them when generating the report. Currently, a user can create multiple evidence items with the same friendly name.
from ghostwriter.
Could we concatenate the evidence friendly name and the evidence ID when generating the DOCX? This should prevent naming collisions, even if multiple evidence items have the same friendly name.
For example:
- "example-evidence", id 10 -> "example-evidence10"
- "example-evidence", id 11 -> "example-evidence11"
from ghostwriter.
Name+ID could still theoretically experience collisions but I think a user would really have to go out of their way (or, be incredibly [un]lucky) to encounter it.
For example:
- "example-evidence1", id: 10 -> "example-evidence110"
- "example-evidence", id: 110 -> "example-evidence110"
from ghostwriter.
Keep in mind that captions made with {{.caption <name>}}
can be referenced with {{.ref}}
as well, so it's not as simple as looking up the evidence by the name passed to {{.ref}}
. You could even reference a bookmark in the template with {{.ref}}
if you knew the internal reference name.
But I can see name collisions being an issue moving forward, especially with extra fields attempting to generate an evidence figure multiple times.
from ghostwriter.
Related Issues (20)
- 2FA Does not seem to work HOT 2
- Failed to RE-install the GhostWriter on Ubuntu HOT 1
- EVIDENCE PICTURES ATTACHED NOT SHOWING UP IN THE REPORT
- Jira Api Support HOT 2
- List Machine Status in Cloud Review Notifications HOT 2
- (Feature Request) Collaboration Features (comments on findings; tracked changes) HOT 6
- Severity levels not defined amongst variables for export HOT 2
- Issue with v4.1 and extra fields HOT 4
- Oplog start_time and end_time format missing timezone offset. HOT 1
- Report template types are broken HOT 4
- Generate DOCX report broken for existing findings with empty affected entities HOT 4
- Finding with SSTI payload in replication steps (as inline code), prevents report generation HOT 2
- No route found... Username incudes `-` HOT 1
- Release domains task not working HOT 3
- Extra Fields UI Screen Readability Improvement
- Observations Tab HOT 1
- Header bookmarks
- Space gets stripped in front of hyperlink
- `modules.reportwriter.richtext.plain_text.py` data-gw-evidence not replaced in output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghostwriter.